Changeset 695 for trunk/Modules/Export/Export.php
- Timestamp:
- Jan 3, 2014, 11:09:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r686 r695 72 72 } 73 73 74 function BuildQuery($Group, $ Columns = '', $Version = '')74 function BuildQuery($Group, $Version = '') 75 75 { 76 76 global $TranslationTree; … … 80 80 else 81 81 $ExportVersion = $this->ClientVersion['BuildNumber']; 82 83 $Query = 'SELECT * FROM (SELECT `T`.*, '.$Columns.'`User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'. 82 83 $DbResultItem = $this->System->Database->query('SELECT * FROM `ExportGroupItem` WHERE `Export`='.$this->Id); 84 while($GroupItem = $DbResultItem->fetch_assoc()) 85 { 86 $GroupItems[$GroupItem['GroupItem']] = 1; 87 } 88 // Build selected columns 89 $Columns = ''; 90 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 91 if (!isset($GroupItems[$Column['Id']])) $Columns .= ' `T`.`'.$Column['Column'].'` AS `'.$Column['Column'].'`, '; 92 } 93 // $Columns = substr($Columns, 0, -2); 94 95 96 $Query = 'SELECT * FROM (SELECT '.$Columns.' T.`ID`,T.`Language`,T.`User`,T.`Entry`,T.`VersionEnd`,T.`VersionStart`, `User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'. 84 97 ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$this->Id.') '. 85 98 ' JOIN `User` ON `User`.`ID`=`T`.`User`'. … … 90 103 // Build columns for english texts 91 104 $OriginalColumns = ''; 92 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) 105 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 93 106 $OriginalColumns .= ' `T3`.`'.$Column['Column'].'` AS `En'.$Column['Column'].'`, '; 107 if (isset($GroupItems[$Column['Id']])) 108 $OriginalColumns .= ' `T3`.`'.$Column['Column'].'` AS `'.$Column['Column'].'`, '; 109 } 94 110 $OriginalColumns = substr($OriginalColumns, 0, -2); 95 111
Note:
See TracChangeset
for help on using the changeset viewer.