Changeset 525 for trunk/action.php


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ý.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.