Changeset 695
- Timestamp:
- Jan 3, 2014, 11:09:37 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/CreateAddon.php
r580 r695 133 133 $Buffer = 'CZWOW_'.$Column['AddonFileName'].'_count='.$FileIndex.';CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={'; 134 134 135 $DbResult2 = $this->Database->query($this->BuildQuery($Group, '',$ExportVersion));135 $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion)); 136 136 137 137 while($Line = $DbResult2->fetch_assoc()) … … 197 197 $CanGenerated = ''; 198 198 199 $DbResult = $this->Database->query($this->BuildQuery($Group, '',$CanGenerated));199 $DbResult = $this->Database->query($this->BuildQuery($Group,$CanGenerated)); 200 200 while($Line = $DbResult->fetch_array()) 201 201 { -
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 -
trunk/Modules/Export/Page.php
r690 r695 430 430 $Output .= ShowMessage('Výběr uložen.'); 431 431 } 432 //items 433 foreach($TranslationTree as $Group) 434 { 435 // echo $Group['Id'].' '; 436 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 437 if(array_key_exists('item'.$Column['Id'], $_POST)) $Selected = true; 438 else $Selected = false; 439 //we will save only forbitten collums and need to be visible 440 $Selected = !$Selected; 441 if (!$Column['Visible']) $Selected = false; 442 443 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id']; 444 $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition); 445 if($DbResult->num_rows > 0) 446 { 447 if(!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition); 448 } else 449 { 450 if($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')'); 451 } 452 453 } 454 } 432 455 } 433 456 … … 439 462 440 463 $TableColumns = array( 464 array('Name' => '', 'Title' => 'Výběr'), 441 465 array('Name' => 'Name', 'Title' => 'Jméno'), 442 array('Name' => 'MangosTable', 'Title' => ' Tabulka MaNGOSu'),443 array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'),444 array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'),445 array('Name' => '', 'Title' => ' Výběr'),466 array('Name' => 'MangosTable', 'Title' => 'Mangos/DBC/Lua'), 467 // array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'), 468 // array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'), 469 array('Name' => '', 'Title' => 'Položky překladu'), 446 470 ); 447 471 $Order = GetOrderTableHeader($TableColumns, 'Name'); … … 460 484 '<table class="BaseTable">'. 461 485 $Order['Output']; 486 487 $DbResultItem = $this->System->Database->query('SELECT * FROM `ExportGroupItem` WHERE `Export`='.$_GET['ExportId']); 488 while($GroupItem = $DbResultItem->fetch_assoc()) 489 { 490 $GroupItems[$GroupItem['GroupItem']] = 1; 491 } 462 492 463 493 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; … … 465 495 while($Group = $DbResult->fetch_assoc()) 466 496 { 497 $Columns = ''; 498 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 499 if ($Column['Visible']) $Columns .= CheckBox('item'.$Column['Id'], !isset($GroupItems[$Column['Id']]), '', 'CheckBox', !$Editable).' '.$Column['Name'].' <br />'; 500 } 467 501 $Checked = $Group['ExportGroupId'] != ''; 468 502 $Selection = CheckBox('sel'.$Group['Id'], $Checked, '', 'CheckBox', !$Editable); 469 503 $Output .= '<tr>'. 470 '<td>'.$Group['Name'].'</td>'. 471 '<td>'.$Group['MangosTable'].'</td>'. 472 '<td>'.$Group['DBCFileName'].'</td>'. 473 '<td>'.$Group['LuaFileName'].'</td>'. 474 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td></tr>'; 504 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td>'. 505 '<td>'.$Group['Name'].'</td><td>'; 506 if ($Group['MangosTable'] <> '') 507 $Output .= $Group['MangosTable'].'.sql '; 508 if ($Group['LuaFileName'] <> '') 509 $Output .= $Group['LuaFileName'].'.lua '; 510 if ($Group['DBCFileName'] <> '') 511 $Output .= $Group['DBCFileName'].'.dbc '; 512 513 $Output .= '</td><td>'; 514 $Output .= $Columns. '</td>'; 515 $Output .= '</tr>'; 475 516 } 476 517 $Output .= '</table>'. -
trunk/admin/UpdateTrace.php
r678 r695 2684 2684 } 2685 2685 2686 function UpdateTo695($Manager) 2687 { 2688 $Manager->Execute('CREATE TABLE IF NOT EXISTS `ExportGroupItem` (`Id` int(11) NOT NULL AUTO_INCREMENT,'. 2689 '`Export` int(11) NOT NULL,`GroupItem` int(11) NOT NULL, PRIMARY KEY (`Id`), KEY `Export` (`Export`),'. 2690 ' KEY `GroupItem` (`GroupItem`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'); 2691 $Manager->Execute('ALTER TABLE `ExportGroupItem`'. 2692 'ADD CONSTRAINT `ExportGroupItem_ibfk_1` FOREIGN KEY (`Export`) REFERENCES `Export` (`Id`),'. 2693 'ADD CONSTRAINT `ExportGroupItem_ibfk_2` FOREIGN KEY (`GroupItem`) REFERENCES `GroupItem` (`Id`);'); 2694 } 2686 2695 2687 2696 $Updates = array( … … 2703 2712 646 => array('Revision' => 666 , 'Function' => 'UpdateTo666'), 2704 2713 666 => array('Revision' => 678 , 'Function' => 'UpdateTo678'), 2714 678 => array('Revision' => 695 , 'Function' => 'UpdateTo695'), 2705 2715 ); -
trunk/includes/Version.php
r694 r695 6 6 // and system will need database update. 7 7 8 $Revision = 69 4; // Subversion revision9 $DatabaseRevision = 6 78; // Database structure revision8 $Revision = 695; // Subversion revision 9 $DatabaseRevision = 695; // Database structure revision 10 10 $ReleaseTime = '2014-01-02';
Note:
See TracChangeset
for help on using the changeset viewer.