Changeset 579 for trunk/Modules/Translation
- Timestamp:
- Sep 11, 2013, 11:30:14 PM (11 years ago)
- Location:
- trunk/Modules/Translation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Comparison.php
r550 r579 40 40 function Show() 41 41 { 42 global $ User, $Config, $TranslationTree;42 global $TranslationTree; 43 43 44 44 $Output = 'Text je porovnáván vždy ku předešlému (vlevo). Změny jsou zvýrazněny <span class="edit">barvou.</span><br /><br />'; … … 54 54 $TextID1 = $_GET['ID1']; 55 55 $TextID2 = $_GET['ID2']; 56 $WhereID = ' AND ((`'.$Table.'`.`ID` = '.$TextID1.') OR (`'.$Table.'`.`ID` = '.$TextID2.') OR (`'.$Table.'`.`Language` = '.$ Config['OriginalLanguage'].'))';56 $WhereID = ' AND ((`'.$Table.'`.`ID` = '.$TextID1.') OR (`'.$Table.'`.`ID` = '.$TextID2.') OR (`'.$Table.'`.`Language` = '.$this->System->Config['OriginalLanguage'].'))'; 57 57 } else $WhereID = ''; 58 58 -
trunk/Modules/Translation/Save.php
r578 r579 5 5 function Show() 6 6 { 7 global $ System, $User, $Config, $TranslationTree;7 global $TranslationTree; 8 8 9 9 $Output = ''; … … 11 11 12 12 unset($Message); 13 $ System->ModuleManager->Modules['FrontPage']->HandleLoginForm();13 $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm(); 14 14 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 15 15 … … 17 17 $Group = $TranslationTree[$GroupId]; 18 18 $Table = $Group['TablePrefix']; 19 if($ User->Licence(LICENCE_USER))19 if($this->System->User->Licence(LICENCE_USER)) 20 20 { 21 21 if(array_key_exists('ID', $_POST) and is_numeric($_POST['ID'])) … … 28 28 29 29 // Get source text record from database by ID 30 $DbResult = $ System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID`='.$TextID);30 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID`='.$TextID); 31 31 if($DbResult->num_rows > 0) 32 32 { … … 34 34 35 35 // Get data for english original 36 $DbResult = $ System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].37 ') AND (`Language` = '.$ Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].36 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry']. 37 ') AND (`Language` = '.$this->System->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart']. 38 38 ') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 39 39 if($DbResult->num_rows > 0) … … 48 48 if(substr($Filter, 0, 3) == ' OR') $Filter = ' AND ('.substr($Filter, 3).')'; 49 49 50 $DbResult = $ System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].')'.$Filter);50 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$this->System->Config['OriginalLanguage'].')'.$Filter); 51 51 while($EnglishFound = $DbResult->fetch_assoc()) 52 52 { 53 53 // Get user translation paired to found english item entry 54 $DbResult2 = $ System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id.54 $DbResult2 = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$this->System->User->Id. 55 55 ') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart']. 56 56 ') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); … … 98 98 99 99 // Update user translation 100 $ System->Database->query('UPDATE `'.$Table.'` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']);100 $this->Database->query('UPDATE `'.$Table.'` SET '.$Values.' WHERE `ID` = '.$ExistedText['ID']); 101 101 102 102 $Output .= 'Změny v překladu <a href="form.php?group='.$GroupId.'&ID='.$ExistedText['ID'].'">'.$ExistedText['ID'].'</a> ('.$ExistedText['Entry'].') uloženy jako '.$CompleteText[$NewComplete].'.<br />'; … … 106 106 // Insert new user translation 107 107 $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `User`, `Take`, `ModifyTime`'; 108 $Values = $EnglishFound['Entry'].', '.$EnglishFound['VersionStart'].', '.$EnglishFound['VersionEnd'].', '.$Language.', '.$ User->Id.', '.$SourceText['ID'].', NOW()';108 $Values = $EnglishFound['Entry'].', '.$EnglishFound['VersionStart'].', '.$EnglishFound['VersionEnd'].', '.$Language.', '.$this->System->User->Id.', '.$SourceText['ID'].', NOW()'; 109 109 110 110 $CompleteParts = 0; … … 145 145 $Values .= ', '.$NewComplete.', '.$CompleteParts; 146 146 147 $ System->Database->query('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')');148 $LastID = $ System->Database->insert_id;147 $this->Database->query('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')'); 148 $LastID = $this->Database->insert_id; 149 149 150 150 $Output .= 'Text <a href="form.php?group='.$GroupId.'&ID='.$LastID.'">'.$LastID.'</a> ze skupiny <a href="TranslationList.php?group='.$GroupId.'&user=0&action=filter">'.$TranslationTree[$GroupId]['Name'].'</a> uložen jako '.$CompleteText[$NewComplete].'. Převzat z <a href="form.php?group='.$GroupId.'&ID='.$TextID.'">'.$TextID.'</a>.<br/>'; … … 162 162 $next = FollowingTran($TextID, $Table, $GroupId); 163 163 $Output .= '<br /><br />'; 164 $DbResult = $ System->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id);164 $DbResult = $this->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$this->System->User->Id); 165 165 $redirecting = $DbResult->fetch_assoc(); 166 166 … … 186 186 } 187 187 188 $Output .= 'Z této stránky můžete být automaticky přesměrování. Nastavit kam chcete být přesměrování si můžete v <a href="'.$ System->Link('/Options.php').'" title="Nastavení uživatele">Nastavení</a>';188 $Output .= 'Z této stránky můžete být automaticky přesměrování. Nastavit kam chcete být přesměrování si můžete v <a href="'.$this->System->Link('/Options.php').'" title="Nastavení uživatele">Nastavení</a>'; 189 189 190 190 // Update flag for experience info load 191 $ System->Database->query('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id);191 $this->Database->query('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$this->System->User->Id); 192 192 } else $Output .= ShowMessage('Položka nenalezena', MESSAGE_CRITICAL); 193 193 } else
Note:
See TracChangeset
for help on using the changeset viewer.