Changeset 893 for trunk/Modules/Translation/Save.php
- Timestamp:
- Mar 6, 2023, 1:48:45 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Save.php
r888 r893 5 5 function Translate($Group, $TextID, $Complete, $Language) 6 6 { 7 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 7 8 $Output = ''; 8 9 $Table = $Group['TablePrefix']; … … 17 18 // Get data for english original 18 19 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') '. 19 'AND (`Language` = '. $this->System->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') '.20 'AND (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') '. 20 21 'AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 21 22 if ($DbResult->num_rows > 0) … … 33 34 else $Filter = ' AND 0'; 34 35 35 $Query = 'SELECT * FROM `'.$Table.'` WHERE (`Language` = '. $this->System->Config['OriginalLanguage'].')'.$Filter;36 $Query = 'SELECT * FROM `'.$Table.'` WHERE (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].')'.$Filter; 36 37 $DbResult = $this->Database->query($Query); 37 38 while ($EnglishFound = $DbResult->fetch_assoc()) 38 39 { 39 40 // Get user translation paired to found english item entry 40 $DbResult2 = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$ this->System->User->Id.41 $DbResult2 = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id. 41 42 ') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart']. 42 43 ') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); … … 110 111 $Columns = '`Entry`, `VersionStart`, `VersionEnd`, `Language`, `User`, `Take`, `ModifyTime`'; 111 112 $Values = $EnglishFound['Entry'].', '.$EnglishFound['VersionStart'].', '. 112 $EnglishFound['VersionEnd'].', '.$Language.', '.$ this->System->User->Id.', '.$TakeID.', NOW()';113 $EnglishFound['VersionEnd'].', '.$Language.', '.$User->Id.', '.$TakeID.', NOW()'; 113 114 114 115 $CompleteParts = 0; … … 178 179 global $Message, $MessageType; 179 180 181 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 180 182 $Output = ''; 181 183 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); … … 188 190 $Group = $TranslationTree[$GroupId]; 189 191 $Table = $Group['TablePrefix']; 190 if ($ this->System->User->Licence(LICENCE_USER))192 if ($User->Licence(LICENCE_USER)) 191 193 { 192 194 if (array_key_exists('ID', $_POST) and is_numeric($_POST['ID'])) … … 202 204 $Output .= $this->ShowRedirection($GroupId, $Table, $TextID); 203 205 204 UserLevelUpdate($ this->System->User->Id);206 UserLevelUpdate($User->Id); 205 207 } else $Output .= ShowMessage('Položka nenalezena', MESSAGE_CRITICAL); 206 208 } else … … 237 239 function ShowRedirection($GroupId, $Table, $TextID) 238 240 { 241 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 239 242 // Address and redirecting 240 243 $Output = '<br />'.T('Translate').': <a href="'.$this->System->Link('/TranslationList.php?group='.$GroupId.'&state=1&user=0&entry=').'">'.T('Not translated').'</a> '; … … 243 246 $next = FollowingTran($TextID, $Table, $GroupId); 244 247 $Output .= '<br /><br />'; 245 $DbResult = $this->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$ this->System->User->Id);248 $DbResult = $this->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id); 246 249 $redirecting = $DbResult->fetch_assoc(); 247 250
Note:
See TracChangeset
for help on using the changeset viewer.