Changeset 525


Ignore:
Timestamp:
Feb 20, 2013, 11:30:49 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení porovnání překladů.
  • Opraveno: Zobrazení stavu dokončení pro všechny překlady.
  • Přidáno: V seznamu překladů přidán sloupec Jazyk.
  • Opraveno: Místa, kde s pevným indexem anglického originálu upravena na nastavitelný.
Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Options.php

    r524 r525  
    7171                if($PreferredVersion == '') $PreferredVersion = null;
    7272                $Info = $_POST['info'];
    73                 print_r($_POST);
    7473       
    7574                // Do user want to change password?
  • trunk/TranslationList.php

    r524 r525  
    55function ShowFilter($GroupId = 0)
    66{
    7   global $System, $TranslationTree;
     7  global $System, $TranslationTree, $Config;
    88 
    99  $Filter = array('SQL' => '');
     
    153153  {
    154154    if($Filter['State'] == 0) $Filter['SQL'] .= $UserFilter.$VersionFilter.'';
    155     else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0)'.$LanguageFilter.$UserFilter.' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND (`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))';
     155    else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = '.$Config['OriginalLanguage'].') '.
     156      'AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '.
     157      '(`Sub`.`Language` <> '.$Config['OriginalLanguage'].')'.$LanguageFilter.$UserFilter.
     158      ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND '.
     159      '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))';
    156160    else if($Filter['State'] == 2) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Complete` = 1)';
    157     else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Language` != 0) AND (`Complete` = 0)';
    158     else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = 0)';
     161    else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Language` != '.$Config['OriginalLanguage'].') AND (`Complete` = 0)';
     162    else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = '.$Config['OriginalLanguage'].')';
    159163  }
    160164
     
    193197  $Query = 'SELECT `T`.`ID`, `T`.`Entry`, `T`.`VersionStart`, `T`.`VersionEnd`, '.
    194198    '`T`.`'.$TranslationTree[$Filter['Group']]['Items'][0]['Column'].'`, '.
    195     '(SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `T`.`User`) '.
    196     'AS `UserName` FROM `'.$Table.'` AS `T` WHERE 1 '.$Filter['SQL'];
     199    '(SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `T`.`User`) AS `UserName`, '.
     200    '(SELECT `Language`.`Name` FROM `Language` WHERE `Language`.`ID` = `T`.`Language`) AS `LanguageName` '.
     201    'FROM `'.$Table.'` AS `T` WHERE 1 '.$Filter['SQL'];
    197202 
    198203  // Get total item count
     
    207212    array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => 'Název'),
    208213    array('Name' => 'VersionStart', 'Title' => 'Verze'),
    209     array('Name' => 'UserName', 'Title' => 'Překladatel'),
     214    array('Name' => 'LanguageName', 'Title' => 'Jazyk'),
     215        array('Name' => 'UserName', 'Title' => 'Překladatel'),
    210216  );
    211217   
     
    220226      '<td>'.htmlspecialchars($Line[$TranslationTree[$Filter['Group']]['Items'][0]['Column']]).'</td>'.
    221227      '<td>'.GetVersionWOW($Line['VersionStart']).'-'.GetVersionWOW($Line['VersionEnd']).'</td>'.
     228      '<td>'.$Line['LanguageName'].'</td>'.
    222229      '<td>'.$Line['UserName'].'</td>';
    223230      '</tr>';
  • trunk/action.php

    r522 r525  
    55function Search()
    66{
    7   global $System, $TranslationTree;
     7  global $System, $TranslationTree, $Config;
    88 
    99  if(array_key_exists('search', $_GET)) $Search = $_GET['search'];
     
    4040  $Output .= '<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>';
    4141 
    42   $DbResult = $System->Database->query('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = 0');
     42  $DbResult = $System->Database->query('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = '.$Config['OriginalLanguage']);
    4343  $Line = $DbResult->fetch_row();
    4444  $Output .= '<tr><td><a href="dictionary.php?search='.$Search.'">Slovníček</a></td><td>'.$Line[0].'</td></tr>';
     
    5050function DatabaseKit()
    5151{
    52   global $System, $TranslationTree, $User;
     52  global $System, $TranslationTree, $User, $Config;
    5353 
    5454  if($User->Licence(LICENCE_ADMIN))
     
    8686        $Output .= $Table.' ';
    8787   
    88         $sql = 'SELECT * FROM '.$Table.' WHERE (`Language` <> 0) AND (';
     88        $sql = 'SELECT * FROM '.$Table.' WHERE (`Language` <> '.$Config['OriginalLanguage'].') AND (';
    8989        foreach($Group['Items'] as $Item)
    9090        {
     
    128128        $Output .= $Table.' ';
    129129   
    130         $sql = 'SELECT `ID`, `Entry` AS EntryTran, `Take`,
    131      (SELECT `ID` FROM `'.$Table.'` WHERE `Language = 0 AND `Entry` = `EntryTran` LIMIT 1) AS `IDOrig`
    132       FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> 0) AND ((`Take` = 0) OR (`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))';
     130        $sql = 'SELECT `ID`, `Entry` AS EntryTran, `Take`, '.
     131       '(SELECT `ID` FROM `'.$Table.'` WHERE (`Language = '.$Config['OriginalLanguage'].') AND (`Entry` = `EntryTran`) LIMIT 1) AS `IDOrig` '.
     132       'FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> '.$Config['OriginalLanguage'].') AND ((`Take` IS NULL) OR '.
     133       '(`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))';
    133134     
    134135        $DbResult = $System->Database->query($sql);
     
    158159      {     
    159160        $Output .= $Table.' ';
    160         $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, `gs_orig`.`ShortCut`  AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE `gs_tran`.`Language` <> 0 AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`';     
     161        $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, '.
     162          '`gs_orig`.`ShortCut`  AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` '.
     163          'JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE '.
     164          '`gs_tran`.`Language` <> '.$Config['OriginalLanguage'].' AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`';     
    161165        $DbResult = $System->Database->query($sql);
    162166        while ($Line = $DbResult->fetch_assoc())
     
    181185function Delete()
    182186{
    183   global $System, $User;
     187  global $System, $User, $Config;
    184188 
    185189  if($User->Licence(LICENCE_MODERATOR))
    186190  {
    187191    $TextID = $_GET['ID'];       
    188     $System->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> 0');
     192    $System->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> '.$Config['OriginalLanguage']);
    189193    $Output = ShowMessage('Překlad byl smazán.');   
    190194    WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&amp;ID='.$TextID.'">'.$TextID.'</a>', LOG_TYPE_MODERATOR);
  • trunk/admin/UpdateTrace.php

    r524 r525  
    24662466(103, '5.1.0', 16309, '2012-11-27', 'Landfall', 0),
    24672467(104, '5.1.0a', 16357, '2012-12-10', '', 0);");
     2468  $Manager->Execute("INSERT INTO `ExportOutputType` (`Id`, `Name`) VALUES
     2469  (1, 'MaNGOS SQL - přímo zobrazit'),
     2470  (2, 'MaNGOS SQL - komprimovaný soubor'),
     2471  (3, 'AoWoW SQL - přímo zobrazit'),
     2472  (4, 'AoWoW SQL - komprimovaný soubor'),
     2473  (5, 'XML - přímo zobrazit'),
     2474  (6, 'XML - komprimovaný soubor'),
     2475  (7, 'Addon - komprimovaný soubor'),
     2476  (8, 'Lua skripty - komprimovaný soubor'),
     2477  (9, 'DBC soubory');");
    24682478}
    24692479
  • trunk/comparison.php

    r504 r525  
    3737    } else $Result .= '<span class="edit">'.$ArrStr1[$i].' </span>';
    3838  }
    39   //  echo $ArrStr1[0];
    4039  return($Result);
    4140}
     
    5150    $TextID1 = $_GET['ID1']; 
    5251    $TextID2 = $_GET['ID2']; 
    53     $WhereID = ' AND (ID = '.$TextID1.' OR ID = '.$TextID2.' OR Language = 0)';
     52    $WhereID = ' AND ((`ID` = '.$TextID1.') OR (`ID` = '.$TextID2.') OR (`Language` = '.$Config['OriginalLanguage'].'))';
    5453  } else $WhereID = '';
    5554
    56   $DataID = $System->Database->query('SELECT * FROM '.$Table.' Where entry = '.$Textentry.' '.$WhereID.' ORDER BY Language');
    57   $i = 0;
    58   while($Line = $DataID->fetch_assoc())
    59   {
    60     $BuffLine[$i] = $Line;
    61     $i = $i + 1;   
    62   }
    63  // if(!$Line) die('Překlad nenalezen.');
    64   $Line = $BuffLine;
    65   $i = $i - 1;
    66   $Output .= 'Počet porovnávaných textů: <strong>'.$i.'</strong><br /> ';
     55  $DataID = $System->Database->query('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName`, '.
     56        '`Language`.`Name` AS `LanguageName` '.
     57        'FROM '.$Table.' LEFT JOIN `User` ON `User`.`Id` = `'.$Table.'`.`User` '.
     58        ' LEFT JOIN `Language` ON `Language`.`Id` = `'.$Table.'`.`Language` '.
     59        'WHERE `Entry` = '.$Textentry.' '.$WhereID.' ORDER BY `Language`');
     60  while($Line[] = $DataID->fetch_assoc());
     61  array_pop($Line);
     62 
     63  $Output .= 'Počet porovnávaných textů: <strong>'.count($Line).'</strong><br /> ';
    6764
    6865  $Output .= '<strong>Číslo textu: <a href="http://www.wowhead.com/?quest='.$Textentry.'">'.$Textentry.'</a></strong>'.
     
    7067    '<tr><th>Přeložil</th>';
    7168  foreach($Line as $Index => $LineItem)
    72   {
    73     $DbResult = $System->Database->query('SELECT * FROM `User` WHERE `ID` = '.$LineItem['User']);
    74     $LineUser = $DbResult->fetch_array();
    75     $Output .= '<th>'.$LineUser['Name'].'</th>';
    76   }
     69    $Output .= '<th>'.$LineItem['UserName'].'</th>';
    7770  $Output .= '</tr>'.
    7871    '<tr>'.
    7972    '<th>ID textu</th>';
    8073  foreach($Line as $Index => $LineItem)
    81   {
    8274    $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['ID'].'">'.$LineItem['ID'].'</a></td>';
    83   }
    8475  $Output .= '</tr>'.
    8576    '<tr><th>Převzato</th>';
    8677  foreach($Line as $Index => $LineItem)
    87   {
    8878    $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['Take'].'">'.$LineItem['Take'].'</a></td>';
    89   }
    9079  $Output .= '</tr>'.
    9180    '<tr><th>Jazyk</th>';
    9281  foreach($Line as $Index => $LineItem)
    93   {
    94     $Output .= '<td>'.
    95     WriteLanguagesWithoutSel($LineItem['Language']).
    96     '</td>';
    97   }
     82    $Output .= '<td>'.$LineItem['LanguageName'].'</td>';
    9883  $Output .= '</tr>'.
    9984    '<tr><th>Verze</th>';
    10085  foreach($Line as $Index => $LineItem)
    101   {
    102     $Output .= '<td>';
    103     $Output .= GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']);
    104     $Output .= '</td>';
    105   }
     86    $Output .= '<td>'.GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']).'</td>';
    10687  $Output .= '</tr>';
    10788  foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
  • trunk/dictionary.php

    r524 r525  
    5858  }     
    5959}
    60 if(array_key_exists('language', $_GET)) $_SESSION['language'] = LoadLanguageIdParameter();
     60
     61if(array_key_exists('language', $_GET) or ($_SESSION['language'] == 'all'))
     62         $_SESSION['language'] = LoadLanguageIdParameter();
    6163
    6264$Output = '<h3>Slovníček</h3>';
     
    180182  //<div style="overflow: auto; width: 100%; height: 100%;">');
    181183
     184  if($_SESSION['language'] == 'all') $LanguageFilter = '';
     185    else $LanguageFilter = ' AND (`T2`.`Language` = '.$_SESSION['language'].')';
    182186  if($Search <> '')
    183187  {
    184     $sql = 'SELECT `User`.`Name` AS `UserName`, `User`. `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.`Language`, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].' WHERE LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%") OR LOWER(`T1`.`Description`) LIKE LOWER("%'.$Search.'%") ) AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
    185   } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
     188    $sql = 'SELECT `User`.`Name` AS `UserName`, `User`. `ID` AS `UserID`, '.
     189      '`T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` '.
     190      'FROM (SELECT `T2`.`User`, `T1`.`Language`, `T1`.`Text` AS `Original`, '.
     191      '`T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` '.
     192      'FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` '.
     193      'ON (`T2`.`Entry` = `T1`.`Entry`) '.$LanguageFilter.
     194      ' WHERE LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%") OR '.
     195      'LOWER(`T1`.`Description`) LIKE LOWER("%'.$Search.'%") ) AS `T3` '.
     196      'JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
     197  } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, '.
     198    '`T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM '.
     199    '(SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, '.
     200    '`T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` '.
     201    'FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON '.
     202    '(`T2`.`Entry` = `T1`.`Entry`) '.$LanguageFilter.') AS `T3` '.
     203    'JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
    186204
    187205  $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$sql.') AS `T1`');
  • trunk/export/export.php

    r506 r525  
    6363    // Expand query for loading english texts
    6464    $Query = 'SELECT `T4`.*, '.$OriginalColumns.' FROM ('.$Query.') AS `T4` '.
    65     ' LEFT JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T3`.`Entry` = `T4`.`Entry`) AND (`T3`.`Language` = 0) AND (`T3`.`VersionStart` = `T4`.`VersionStart`) AND (`T3`.`VersionEnd` = `T4`.`VersionEnd`)'; 
     65    ' LEFT JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T3`.`Entry` = `T4`.`Entry`) '.
     66    'AND (`T3`.`Language` = '.$Config['OriginalLanguage'].') AND '.
     67    '(`T3`.`VersionStart` = `T4`.`VersionStart`) AND (`T3`.`VersionEnd` = `T4`.`VersionEnd`)'; 
    6668
    6769    return($Query);
  • trunk/export/index.php

    r504 r525  
    505505  $Export = $DbResult->fetch_assoc();
    506506
     507  if($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL);
     508  else {
    507509  $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType'];
    508510
     
    544546    '</form>'.
    545547    $PageList['Output'];
     548  }
    546549  return($Output);
    547550}
     
    551554  global $System;
    552555 
     556  $Output = '';
    553557  $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    554558  $Export = $DbResult->fetch_assoc();
    555   $DbResult = $System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']);
     559  if($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL);
     560  else {
     561        $DbResult = $System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']);
    556562  if($DbResult->num_rows > 0)
    557563  {
     
    563569    } else $Output = ShowMessage('Nebyla vybrána požadovaná verze klienta.', MESSAGE_CRITICAL);
    564570  } else $Output = ShowMessage('Nebyl vybrán formát výstupu.', MESSAGE_CRITICAL);
     571    }
    565572  return($Output);
    566573}
     
    568575function ExportViewStat()
    569576{
    570   global $System;
     577  global $System, $Config;
    571578
    572579  $Export = new Export($System);
    573580  $Export->Id = $_GET['ExportId'];
    574581  $Export->Init();
    575   $Export->LoadFilters();
     582  if($Export->ClientVersion == '') $Output = ShowMessage('Nebyla vybrána verze klienta', MESSAGE_CRITICAL);
     583  else {
     584        $Export->LoadFilters();
    576585 
    577586  if($Export->ClientVersion['BuildNumber'] == '') $Output = ShowMessage('Nebyla vybrána verze klienta', MESSAGE_CRITICAL);
    578   {
     587  else {
    579588        $GroupListQuery = 'SELECT `Group`.* FROM `Group` '.
    580589  ' JOIN `ExportGroup` ON (`ExportGroup`.`Export`='.$Export->Id.') AND (`ExportGroup`.`Group`=`Group`.`Id`)';
     
    592601    '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    593602    ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    594     ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'.
     603    ' WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'.
    595604    ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name`';
    596605  }
     
    631640  $Output .= '<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, round($Percent, 2)).'</strong></td></tr>';
    632641  $Output .= '</table>';
     642  }
    633643  }
    634644  return($Output);
  • trunk/form.php

    r517 r525  
    3737  {
    3838   
    39   $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');
     39  $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');
    4040  $LineAJ = $DbResult->fetch_assoc();
    4141  if(!$LineAJ)
     
    8181    '<br />';
    8282   
    83   $DbResult = $System->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0) AND (`Complete` = 1)');
     83  $DbResult = $System->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`Complete` = 1)');
    8484  $Version = $DbResult->fetch_row();
    8585  $Version = $Version[0];
  • trunk/img_level.php

    r523 r525  
    103103function ImgLevelUpdate()
    104104{
    105   global $System, $TranslationTree;
     105  global $System, $TranslationTree, $Config;
    106106
    107107  // Hlavní kod pro uživatele
     
    116116      if($Group['TablePrefix'] != '')
    117117      {
    118         $Count = '(SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`Language` <> 0) AND (`User`='.$LineUser['ID'].'))';
     118        $Count = '(SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`User`='.$LineUser['ID'].'))';
    119119        $TranslatedCount .= 'COALESCE('.$Count.', 0) + ';
    120120      }
  • trunk/img_statistic.php

    r455 r525  
    2424if($BuildNumber_max == '') $BuildNumber_max = 0; // Empty result, no items in this group
    2525
    26 $where = '(`VersionEnd` = '.$BuildNumber_max.') AND (`Language` <> 0) AND (`Complete` = 1) '.$team.$language;
     26$where = '(`VersionEnd` = '.$BuildNumber_max.') AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`Complete` = 1) '.$team.$language;
    2727$DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where);
    2828$ID = $DbResult->fetch_row();
    2929$NumberTranslate = $ID[0];
    3030 
    31 $DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE (`VersionEnd` = '.$BuildNumber_max.') AND (`Language` = 0)');
     31$DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE (`VersionEnd` = '.$BuildNumber_max.') AND (`Language` = '.$Config['OriginalLanguage'].')');
    3232$ID = $DbResult->fetch_row();
    3333$NumberAJ = $ID[0];
  • trunk/includes/Database.php

    r507 r525  
    6666      $this->Error = $this->Error[2];
    6767      if(($this->Error != '') and ($this->ShowSQLError == true))
     68      {
    6869        echo('<div><strong>SQL Error: </strong>'.$this->Error.'<br />'.$Query.'</div>');
     70        echo(debug_backtrace());
     71      }
    6972    }
    7073    $this->insert_id = $this->PDO->lastInsertId();
  • trunk/includes/Page.php

    r524 r525  
    195195  $Output .= ShowSearchBox();
    196196  $Output .= '</td><td id="border-left"></td><td class="content">';
    197   if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
    198197  return($Output);
    199198}
  • trunk/includes/Version.php

    r524 r525  
    11<?php
    22
    3 $Revision = 524; // Subversion revision
     3$Revision = 525; // Subversion revision
    44$DatabaseRevision = 524;
    55$ReleaseTime = '2013-02-20';
  • trunk/includes/global.php

    r524 r525  
    328328}
    329329
    330 function WriteLanguagesWithoutSel($Selected)
    331 {
    332   global $LanguageList;
    333  
    334   $Output = '';
    335   foreach($LanguageList as $Language)
    336   {
    337     if($Selected == $Language['Id']) $Output .= $Language['Name'];
    338   }
    339   return($Output);
    340 }
    341 
    342330function GetLanguageList()
    343331{
     
    398386function FollowingTran($TextID, $Table, $GroupId, $Prev = false)
    399387{
    400   global $System;
     388  global $System, $Config;
    401389 
    402390  if($Prev)
    403   {
    404     $sql = 'SELECT ID FROM '.$Table.' as item WHERE Language = 0 AND NOT EXISTS(SELECT entry FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = item.entry) AND ID < '.$TextID.' ORDER BY ID DESC LIMIT 1';
    405   } else
    406   {
    407     $sql = 'SELECT ID FROM '.$Table.' as item WHERE Language = 0 AND NOT EXISTS(SELECT entry FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = item.entry) AND ID > '.$TextID.' ORDER BY ID LIMIT 1';
    408   }
     391    $sql = 'SELECT `ID` FROM `'.$Table.'` AS `item` WHERE '.
     392      '(`Language` = '.$Config['OriginalLanguage'].') AND NOT EXISTS(SELECT `entry` '.
     393      'FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> '.$Config['OriginalLanguage'].') '.
     394      'AND (`sub`.`entry` = `item`.`entry`)) AND (`ID` < '.$TextID.') ORDER BY `ID` DESC LIMIT 1';
     395    else $sql = 'SELECT `ID` FROM `'.$Table.'` AS `item` WHERE '.
     396      '(`Language` = '.$Config['OriginalLanguage'].') AND NOT EXISTS(SELECT `entry` '.
     397      'FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> '.$Config['OriginalLanguage'].') '.
     398      'AND (`sub`.`entry` = `item`.`entry`)) AND `ID` > '.$TextID.' ORDER BY `ID` LIMIT 1';
    409399 
    410400  $DbResult = $System->Database->query($sql);
     
    570560function GetTranslatNames($Text,$mode,$TablesColumn)
    571561{
    572   global $System;
     562  global $System, $Config;
    573563 
    574564 /* $TablesID = array('gameobject' => 5,
     
    582572  foreach($TablesColumn as $Table => $Column)
    583573  { 
    584     $sql = 'SELECT `ID`,`'.$Column.'`, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE `O`.`Entry` = `T`.`Entry` AND `Language` <> 0 LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE ';
     574    $sql = 'SELECT `ID`,`'.$Column.'`, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '.
     575      '(`O`.`Entry` = `T`.`Entry`) AND (`Language` <> '.$Config['OriginalLanguage'].') LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE ';
    585576    $groupby = ' GROUP BY `'.$Column.'`';
    586577 
    587578    $ArrStr = explode(' ', $Text);
    588     $where = '`Language` = 0 ';
    589     if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))';
    590     if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))';
     579    $where = '(`Language` = '.$Config['OriginalLanguage'].') ';
     580    if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))';
     581    if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))';
    591582    $where .= ' AND (';
    592583   
  • trunk/index.php

    r524 r525  
    130130}
    131131
    132 $Output = '<br />'. 
     132$Output = '';
     133if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
     134$Output .= '<br />'. 
    133135'<table class="Home"><tr><td colspan="3">'.ShowWelcome().
    134136'</td></tr>'.
  • trunk/save.php

    r514 r525  
    2626     
    2727      // Get data for english original
    28       $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = 0) AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
     28      $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
    2929      if($DbResult->num_rows > 0)
    3030      {
     
    3838        $Filter = ' AND ('.substr($Filter, 3).')';
    3939       
    40         $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0)'.$Filter);
     40        $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].')'.$Filter);
    4141        while($EnglishFound = $DbResult->fetch_assoc())
    4242        {         
  • trunk/statistic.php

    r524 r525  
    77if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
    88if(!array_key_exists('StatVersion', $_SESSION)) $_SESSION['StatVersion'] = $Config['Web']['GameVersion'];
     9if(!isset($_SESSION['language']))
     10{
     11        if($User->Licence(LICENCE_USER))
     12        {
     13                $_SESSION['language'] = $User->Language;
     14        } else $_SESSION['language'] = '';
     15}
     16if(array_key_exists('language', $_GET)) {
     17  if($_GET['language'] == 'all') $_SESSION['language'] = 'all';
     18          else $_SESSION['language'] = LoadLanguageIdParameter();
     19}
    920
    1021function ShowStatTable()
    1122{
    12   global $System, $User;
     23  global $System, $User, $Config;
    1324 
    1425  $Output = '';
    15   if(!isset($_SESSION['language']))
    16   {
    17     if($User->Licence(LICENCE_USER))
    18     {
    19       $_SESSION['language'] = $User->Language;
    20     } else $_SESSION['language'] = 2;
    21   }
    22   if(array_key_exists('language', $_GET)) $_SESSION['language'] = LoadLanguageIdParameter();
    23  
     26 
    2427  $BuildNumber = GetBuildNumber($_SESSION['StatVersion']);
     28  if(is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')';
     29    else $LanguageFilter = ' AND (`Language`!='.$Config['OriginalLanguage'].')';
    2530 
    2631  $GroupListQuery = 'SELECT `Id`, `TablePrefix`, `Name` FROM `Group`';
     
    3338    $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    3439    ' SELECT `T`.`Id`, `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    35     ' WHERE (`Complete` = 1) AND (`Language`='.$_SESSION['language'].') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
     40    ' WHERE (`Complete` = 1) '.$LanguageFilter.' AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    3641    ') AS `C1`) AS `Translated`, '.
    3742    '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    3843    ' SELECT `T`.`Id`, `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    39     ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
     44    ' WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    4045    ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
    4146  }
     
    8388
    8489// Show language selection
    85 $Output .= 'Jazyk: <a href="statistic.php">Dohromady</a>';
    86 foreach($LanguageList as $Language)
    87   if($Language['Enabled'] == 1) $Output .= ' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>';
     90$Output .= 'Jazyk: ';
     91$Lang = '<a href="statistic.php?language=all">Všechny</a>';
     92if('all' == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
     93  else $Output .= $Lang;
     94foreach($LanguageList as $Language)
     95if($Language['Enabled'] == 1)
     96{
     97        $Lang = ' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>';
     98  if($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
     99    else $Output .= $Lang;
     100}
    88101
    89 $Output .= '<br/><br /><h3>Statistika dokončení překladů pro verzi '.$_SESSION['StatVersion'].'</h3><br/>';
    90 
     102if(is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
     103  else $LanguageName = 'Všechny';
     104$Output .= '<br/><br /><h3>Statistika dokončení překladů jazyka '.$LanguageName.' pro verzi '.$_SESSION['StatVersion'].'</h3><br/>';
    91105$Output .= ShowStatTable();
    92106
    93 $Output .= '<br/><p><strong>Celková statistika v závislosti na čase: </strong><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a></p>
    94 <div>Počet stáhnutí přeložených textů v SQL souboru: <strong>';
    95        
     107$Output .= '<div>Počet stáhnutí přeložených textů v SQL souboru: <strong>';   
    96108$ID = $System->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2');
    97109$Line = $ID->fetch_row();
    98110$Output .= $Line[0];
    99 
    100 $Output .= '</strong></div>
    101 <div>Počet stáhnutí: <strong>';
    102      
     111$Output .= '</strong></div>';
     112               
     113$Output .= '<div>Počet stáhnutí: <strong>';     
    103114$ID = $System->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0');
    104115$Line = $ID->fetch_row();
    105116$Output .= $Line[0];
    106 
    107117$Output .= '</strong></div>';
    108118
  • trunk/team.php

    r524 r525  
    234234    '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    235235    ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    236     ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
     236    ' WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    237237    ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
    238238  }
Note: See TracChangeset for help on using the changeset viewer.