Changeset 321


Ignore:
Timestamp:
Feb 14, 2010, 1:00:53 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazování seznamu nepřeložených textů. Zobrazí se všechny anglické originály, které nemají překlad ve stejné verzi.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/TranslationList.php

    r316 r321  
    4545function Nontranslated()
    4646{
    47   global $GroupId, $Table, $BuildNumber_max;
    48  
    49   echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
    50         <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&amp;action=selection">Nepřeložené texty</a> - >
    51         <strong>Vypsání nepřeložených textů s limitem na stránku</strong><br /><br />');
    52 
    53   WriteQuests('SELECT * FROM '.$Table.' AS items WHERE (items.Language = 0) AND
    54     NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'")');
     47  global $GroupId, $Table;
     48 
     49  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> -> '.
     50  '<a title="Zde můžete začít překládat" href="?group='.$GroupId.'&amp;action=selection">Nepřeložené texty</a> - > '.
     51  '<strong>Vypsání nepřeložených textů s limitem na stránku</strong><br /><br />');
     52
     53  WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`entry` = `items`.`entry`)  )');
    5554}
    5655
     
    6261
    6362 //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1)
    64   $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT Name FROM connexion WHERE `Id` = '.$_SESSION['connexion_id']));
     63  $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT `Name` FROM `connexion` WHERE `Id` = '.$_SESSION['connexion_id']));
    6564    echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
    6665        <a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&amp;action=connexion">Souvislosti</a> - >
    6766        <strong>Vypsání souvislostí ze skupiny '.$Line['Name'].'</strong><br /><br />');
    6867
    69    WriteQuests('SELECT *, (SELECT sub.User FROM '.$Table.' as sub WHERE sub.entry  = '.$Table.'.entry AND Language <> 0 LIMIT 1) as UserID, (SELECT user.user FROM user WHERE user.id = UserID) AS UserName FROM '.$Table.' WHERE Language = 0 AND entry IN(SELECT entry FROM connexion_item WHERE connexion = '.$_SESSION['connexion_id'].') AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'"');
     68   WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.`entry` = `'.$Table.'`.`entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`entry` IN(SELECT `entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"');
    7069}
    7170
     
    8079  echo('<table class="BaseTable"><tr><th>Pořadové číslo</th><th>Název</th>');
    8180  echo('</tr>');
    82   $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE  `Group` = '.$GroupId);       
     81  $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$GroupId);       
    8382  while($Line = mysql_fetch_assoc($ID))
    8483  {
     
    342341if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = '';
    343342
    344 $ID = mysql_fetch_row($Database->SQLCommand('SELECT max(VersionEnd) FROM '.$TranslationTree[$GroupId]['TablePrefix']));
     343$DbResult = $Database->SQLCommand('SELECT MAX(`VersionEnd`) FROM `'.$TranslationTree[$GroupId]['TablePrefix'].'`');
     344$ID = mysql_fetch_row($DbResult);
    345345$BuildNumber_max = $ID[0];
    346346
  • trunk/form.php

    r320 r321  
    1313  $TextID = $_GET['ID'] * 1; 
    1414
    15   $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM '.$Table.' Where ID = '.$TextID));
     15  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
     16  $Line = mysql_fetch_assoc($DbResult);
    1617  if(!$Line) die('Překlad nenalezen.');
    1718   
    18   $LineAJ = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0  AND entry = '.$Line['entry'].' AND VersionEnd = '.$Line['VersionEnd'].' LIMIT 1'));
     19  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0  AND `entry` = '.$Line['entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1');
     20  $LineAJ = mysql_fetch_assoc($DbResult);
    1921  if(!$Line) die('Anglický originál k překladu nenalezen.');
    2022 
    2123  $User = @$_SESSION['User'];
    22   $IDUser = $Database->SQLCommand('SELECT * FROM user WHERE id = '.$Line['User']);
     24  $IDUser = $Database->SQLCommand('SELECT * FROM `user` WHERE `id` = '.$Line['User']);
    2325  $LineUser = mysql_fetch_array($IDUser);
    2426 
    2527  echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />');
    2628     
    27   if(($Line['Language'] <> 0) and ($LineUser['user'] <> '')) echo('Přeložil: <strong>'.$LineUser['user'].'</strong> <br />');
     29  if(($Line['Language'] <> 0) and ($LineUser['user'] <> ''))
     30    echo('Přeložil: <strong>'.$LineUser['user'].'</strong> <br />');
    2831  if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
    2932  {
    30     $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT Language,VersionStart,VersionEnd FROM '.$Table.' Where ID = '.$Line['Take']));
     33    $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']));
    3134    // echo $Language['Language'].'  '.$Line['Take'];
    3235    if($Language['Language'] <> 0)
     
    3841    if($Line['Complete'] == 1) echo(' <b>Hotov</b>');
    3942      else echo(' <b> Uložen v rozepsaných</b> ');
    40   } else
    41   {
    42     echo(' <b>Anglická, původní verze</b> ');
    43   }
     43  } else echo(' <b>Anglická, původní verze</b> ');
     44
    4445  echo('<br />');
    45   echo ('Verze: <b>'.GetVersionWOW($Line['VersionStart']).' - '.GetVersionWOW($Line['VersionEnd'].'</b>'));
     46  echo('Verze: <b>'.GetVersionWOW($Line['VersionStart']).' - '.GetVersionWOW($Line['VersionEnd'].'</b>'));
    4647  echo('<br />');
    4748   
    48   $version = mysql_fetch_array($Database->SQLCommand('SELECT count(*) FROM '.$Table.' Where entry = '.$Line['entry'].' AND Language <> 0'));
    49   if ($version['count(*)'] > 0)
     49  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `entry` = '.$Line['entry'].' AND `Language` <> 0');
     50  $Version = mysql_fetch_row($DbResult);
     51  $Version = $Version[0];
     52  if($Version > 0)
    5053  {
    51     echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['entry'].'">Počet verzí: <strong>'.$version['count(*)'].'</strong></a> 
     54    echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['entry'].'">Počet verzí: <strong>'.$Version.'</strong></a> 
    5255      <input type="hidden" name="group" value="'.$GroupId.'" />
    5356      <input type="hidden" name="entry" value="'.$Line['entry'].'" />
     
    5659      <option value="-1">Vyberte text k porovnání</option>
    5760      <option value="-1">Zobrazit/porovnat všechny</option>');
    58    $DataID = $Database->SQLCommand('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User  FROM '.$Table.' WHERE (entry = '.$Line['entry'].') AND (ID <> '.$Line['ID'].')'); 
    59      while($version = mysql_fetch_array($DataID))
    60      {     
     61    $DataID = $Database->SQLCommand('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE (`entry` = '.$Line['entry'].') AND (`ID` <> '.$Line['ID'].')'); 
     62    while($version = mysql_fetch_array($DataID))
     63    {     
    6164      if ($version['ID'] == $Line['Take']) echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' (převzato)</option>');   
    62       else {
    63       if (0 == $version['Language']) $version['User'] = 'Předloha';
    64       echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
     65      else
     66      {
     67        if($version['Language'] == 0) $version['User'] = 'Předloha';
     68        echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['User'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
     69      }
    6570    }
    66      }
    67      echo('</select></form>');   
     71    echo('</select></form>');   
    6872  } else
    6973  {
    70       echo('<a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['entry'].'">Počet verzí: <strong>'.$version['count(*)'].'</strong></a>');
     74    echo('<a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>');
    7175  }
    7276
     
    7579  if(Licence(LICENCE_USER))
    7680  {
    77     if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo ('<a href="dictionary.php?group='.$GroupId.'&amp;ID='.$LineAJ['ID'].'" target="_blank"  title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>');
     81    if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$GroupId.'&amp;ID='.$LineAJ['ID'].'" target="_blank"  title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>');
    7882    echo(' <input type="submit" value="Uložit do rozepsaných" name="save" title="Klikněte na uložit pro pozdější dokončení překladu" />
    7983    <input type="submit" value="Dokončeno" name="End" title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat" /> ');
    80      FollowingTran($TextID,$Table,$GroupId, True); FollowingTran($TextID,$Table,$GroupId);
    81  }
     84    FollowingTran($TextID, $Table, $GroupId, true);
     85    FollowingTran($TextID, $Table, $GroupId);
     86  }
    8287
    8388  if($TranslationTree[$GroupId]['WowheadName'] != '')
    84     $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].
    85       '='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a>';
     89    $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['entry'].'">'.$LineAJ['entry'].'</a>';
    8690    else $WowheadLink = $LineAJ['entry'];
    8791 
     
    103107  else if($_SESSION['UserID'] != '')
    104108  {
    105     $IDUser = $Database->SQLCommand('SELECT * FROM user WHERE id = '.$_SESSION['UserID']);
     109    $IDUser = $Database->SQLCommand('SELECT * FROM `user` WHERE `id` = '.$_SESSION['UserID']);
    106110    $LineUser = mysql_fetch_array($IDUser);
    107111    $Language = $LineUser['Language'];  //jiný user vyčítám
     
    112116  if($TextItem['Visible'] == 1)
    113117  {         
    114     if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> ''))  {
    115       if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings')))
    116         echo('<tr><th>'.$LineAJ['ShortCut'].'</th>');
    117        else
    118         echo('<tr><th>'.$TextItem['Name'].'</th>');
    119         echo ('<td>'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td>
     118    if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> '')) 
     119    {
     120      if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) echo('<tr><th>'.$LineAJ['ShortCut'].'</th>');
     121        else echo('<tr><th>'.$TextItem['Name'].'</th>');
     122      echo('<td>'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td>
    120123      <td><textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'.htmlspecialchars($Line[$TextItem['Column']]).'</textarea></td></tr>');
    121124    }
    122125  } else
    123126  {
    124   echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />');
     127    echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />');
    125128  }
    126129  echo('</table></div></form>');
  • trunk/save.php

    r309 r321  
    106106    if(array_key_exists($GroupItem['Column'], $_POST))
    107107      $sql .= ', `'.$GroupItem['Column'].'`="'.$_POST[$GroupItem['Column']].'"';
    108     $sql .= ', `Language` = '.$Language.' WHERE ID = '.$TextID.' AND Language <> 0';
     108    $sql .= ', `Language` = '.$Language.' WHERE `ID` = '.$TextID.' AND `Language` <> 0';
    109109  //echo($sql);
    110110    $Database->SQLCommand($sql);
     
    119119  $next = FollowingTran($TextID,$Table,$GroupId);
    120120  echo('<br /><br />');
    121   $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT redirecting FROM user WHERE ID='.$UserID));
     121  $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `redirecting` FROM `user` WHERE `ID`='.$UserID));
    122122   
    123123  switch($redirecting['redirecting'])
     
    145145   
    146146  // Aktualizace informace o nutnosti načíst XP
    147   $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE ID = '.$UserID);
     147  $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID);
    148148} else
    149149{
Note: See TracChangeset for help on using the changeset viewer.