Changeset 655 for trunk/Modules/Translation
- Timestamp:
- Dec 16, 2013, 11:42:02 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Form.php
r654 r655 88 88 if ($this->System->Config['OriginalLanguage'] == $Line['Language']){ 89 89 $LineAJ = $Line; 90 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '. 91 '(`Language` != '.$this->System->Config['OriginalLanguage'].') AND '. 92 '(`Entry` = '.$Line['Entry'].') ORDER BY `ModifyTime` DESC LIMIT 1'); 93 $LineSearch = $DbResult->fetch_assoc(); 94 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 95 if($TextItem['Visible'] == 1) 96 if (($LineAJ[$TextItem['Column']] <> '') and ($LineSearch[$TextItem['Column']] <> '')) $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']]; 97 90 91 if ($this->System->User->Language <> '') $Language = '`Language` = '.$this->System->User->Language; 92 else $Language = '`Language` != '.$this->System->Config['OriginalLanguage']; 93 $Columns = ''; 94 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 95 $Columns .= ' `Orig`.`'.$TextItem['Column'].'` as `Orig_'.$TextItem['Column'].'`, `Tran`.`'.$TextItem['Column'].'` as `'.$TextItem['Column'].'`,'; 96 97 $sql = 'SELECT '.$Columns.' Tran.`Entry` FROM `'.$Table.'` as Tran'; 98 $join = ' JOIN `'.$Table.'` as `Orig` ON `Orig`.`Language` = 0 AND `Tran`.`Entry` = `Orig`.`Entry` AND `Tran`.`VersionEnd` = `Orig`.`VersionEnd` '; 99 $where = ' WHERE '.'( `Tran`.'.$Language.' ) AND '.'(`Tran`.`Entry` = '.$Line['Entry'].') ORDER BY `Tran`.`ModifyTime` DESC'; 100 $DbResult = $this->Database->query($sql.$join.$where); 101 while ($LineSearch = $DbResult->fetch_assoc()) { 102 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 103 if($TextItem['Visible'] == 1) 104 if (($LineAJ[$TextItem['Column']] <> '') and 105 ($LineSearch[$TextItem['Column']] <> '') and 106 ($LineSearch['Orig_'.$TextItem['Column']] <> $LineSearch[$TextItem['Column']]) and 107 ($LineAJ[$TextItem['Column']] == $Line[$TextItem['Column']]) 108 ) 109 { 110 $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']]; 111 // echo $Line[$TextItem['Column']].'<br />'; 112 } 113 } 114 98 115 } else { 99 116 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
Note:
See TracChangeset
for help on using the changeset viewer.