Changeset 646
- Timestamp:
- Dec 14, 2013, 12:51:59 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r582 r646 22 22 $this->SourceDirRelative = $this->Config['Web']['SourceFolder']; 23 23 if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true); 24 $this->SaveAllUsers(); 25 } 26 27 function SaveAllUsers() { 28 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$this->Id); 29 $Export = $DbResult->fetch_assoc(); 30 if ($Export['AllUsers']) { 31 $DbResult2 = $this->System->Database->query('SELECT ID FROM `User` WHERE `ID` NOT IN(SELECT `User` FROM `ExportUser` WHERE `Export`='.$this->Id.')'); 32 while($UserLine = $DbResult2->fetch_assoc()) 33 { 34 $Condition = ' WHERE `Export`='.$this->Id.' AND `User`='.$UserLine['ID']; 35 $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition); //,MAX(`Sequence`) as MaxSequence 36 if($DbResult->num_rows > 0) 37 { 38 // $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition); 39 } else 40 { 41 $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$this->Id.', '.$UserLine['ID'].', 0)'); 42 } 43 } 44 45 $this->System->Database->query('SET @I = 0'); 46 $this->System->Database->query('UPDATE `ExportUser` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$this->Id.' ORDER BY `Sequence`;'); 47 } 24 48 } 25 49 -
trunk/Modules/Export/Page.php
r645 r646 138 138 return($Output); 139 139 } 140 141 function SaveAllUsers() 142 { 143 global $System; 144 $Export = new Export($System); 145 $Export->Id = $_GET['ExportId']; 146 $Export->SaveAllUsers(); 147 148 } 140 149 141 150 function ExportViewTranslators() … … 176 185 } 177 186 187 if (array_key_exists('AllUsers', $_POST)) { 188 //add allusers to export 189 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=1 WHERE `Id`='.$_GET['ExportId']); 190 191 //update export stat 192 $Export['AllUsers'] = 1; 193 $this->SaveAllUsers(); 194 } else { 195 //update export stat 196 $Export['AllUsers'] = 0; 197 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=0 WHERE `Id`='.$_GET['ExportId']); 198 } 199 178 200 // Recalculate sequence number 179 201 $this->System->Database->query('SET @I = 0'); … … 208 230 { 209 231 $Output .= '<input type="submit" value="Uložit" '.$DisabledInput[$Editable].'/>'. 210 '<input type="hidden" name="Operation" value="Save"/>'. 211 ' <span onclick="CheckAllCheckbox();">'.CheckBox('CheckAll', False, 'CheckAll').' Zatrhnout vše</span> '. 232 '<input type="hidden" name="Operation" value="Save"/><br />'. 233 ' <span onclick="CheckAllCheckbox();">'.CheckBox('CheckAll', False, 'CheckAll').' Zatrhnout vše na stránce</span> <br />'. 234 ' <span>'.CheckBox('AllUsers', $Export['AllUsers']).' '.T('Export allways from all users').'</span> '. 212 235 '<br />'. 213 236 'Zvolte ze seznamu uživatele, od kterých chcete načítat překlady a upravte jejich pořadí.<br />'. … … 226 249 $XP = GetLevelMinMax($UserLine['XP']); 227 250 $Checked = $UserLine['Sequence'] != ''; 228 $Selection = CheckBox('sel'.$UserLine['ID'], $Checked, '', 'CheckBox', !$Editable);251 $Selection = CheckBox('sel'.$UserLine['ID'], $Checked, '', 'CheckBox', ((!$Editable) or ($Export['AllUsers']))); 229 252 $Sequence = '<input type="text" name="seq'.$UserLine['ID'].'" style="text-align: center; width: 40px;" value="'.$UserLine['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 230 253 $Output .= '<tr>'. -
trunk/admin/UpdateTrace.php
r639 r646 2665 2665 } 2666 2666 2667 function UpdateTo646($Manager) 2668 { 2669 $Manager->Execute('ALTER TABLE `Export` ADD `AllUsers` TINYINT( 1 ) NOT NULL ;'); 2670 2671 } 2672 2667 2673 $Updates = array( 2668 2674 498 => array('Revision' => 506, 'Function' => 'UpdateTo506'), … … 2680 2686 609 => array('Revision' => 610, 'Function' => 'UpdateTo610'), 2681 2687 610 => array('Revision' => 639, 'Function' => 'UpdateTo639'), 2688 639 => array('Revision' => 646 , 'Function' => 'UpdateTo646'), 2682 2689 ); -
trunk/includes/Version.php
r645 r646 6 6 // and system will need database update. 7 7 8 $Revision = 64 5; // Subversion revision9 $DatabaseRevision = 6 39; // Database structure revision10 $ReleaseTime = '2013-12-1 3';8 $Revision = 646; // Subversion revision 9 $DatabaseRevision = 646; // Database structure revision 10 $ReleaseTime = '2013-12-14'; -
trunk/locale/cs.php
r637 r646 135 135 'Item not specified' => 'Položka nezadána', 136 136 'Settings saved' => 'Nastavení uloženo', 137 'Export allways from all users' => 'Exportovat vždy od všech uživatelů', 137 138 'There are servers listed which are in fact offering translated game. '. 138 139 'There is resoluted if translation is offered either on client side, on server side or both. '.
Note:
See TracChangeset
for help on using the changeset viewer.