Changeset 646 for trunk/Modules/Export
- Timestamp:
- Dec 14, 2013, 12:51:59 PM (11 years ago)
- Location:
- trunk/Modules/Export
- Files:
-
- 2 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>'.
Note:
See TracChangeset
for help on using the changeset viewer.