Changeset 894 for trunk/Modules/Export/Page.php
- Timestamp:
- Mar 6, 2023, 12:16:38 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Page.php
r893 r894 39 39 40 40 $Output .= '<h3>'.T('List of export').'</h3>'. 41 41 $PageList['Output']; 42 42 43 43 $TableColumns = array( 44 45 46 47 48 49 50 51 52 44 array('Name' => 'TimeCreate', 'Title' => T('Time made')), 45 array('Name' => 'UserName', 'Title' => T('Translator')), 46 array('Name' => 'Title', 'Title' => T('Name od export')), 47 // array('Name' => 'UserCount', 'Title' => 'Vybraných překladatelů'), 48 // array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'), 49 array('Name' => 'OutputType', 'Title' => T('Type of output')), 50 array('Name' => 'ClientVersion', 'Title' => T('Client version')), 51 array('Name' => 'UsedCount', 'Title' => T('Viewed count')), 52 array('Name' => '', 'Title' => T('Action')), 53 53 ); 54 54 $Order = GetOrderTableHeader($TableColumns, 'TimeCreate', 1); 55 55 $Output .= '<table class="BaseTable">'. 56 56 $Order['Output']; 57 57 58 58 $DbResult = $this->System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, '. … … 70 70 if ($User->Id != null) $Action .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a>'; 71 71 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 72 73 74 75 76 77 72 '<td><a href="'.$this->System->Link('/user/?user='.$Export['User']).'">'.$Export['UserName'].'</a></td>'. 73 '<td>'.htmlspecialchars($Export['Title']).'</td>'. 74 '<td>'.$Export['OutputType'].'</td>'. 75 '<td><a href="'.$this->System->Link('/client-version/?action=item&id='.$Export['ClientVersionId']).'">'.$Export['ClientVersion'].'</a></td>'. 76 '<td>'.$Export['UsedCount'].'</td>'. 77 '<td>'.$Action.'</td></tr>'; 78 78 } 79 79 $Output .= '</table>'. 80 80 $PageList['Output']; 81 81 82 82 return $Output; … … 93 93 { 94 94 $Output = '<form action="?Action=CreateFinish" method="post">'. 95 96 97 98 99 95 '<fieldset><legend>'.T('Creation of new export').'</legend>'. 96 '<table><tr><td>'.T('Identification').':</td><td><input type="text" name="Title" /></td></tr>'. 97 '<tr><td>'.T('Description').':</td><td><textarea name="Description" cols="54" rows="10"></textarea></td></tr>'. 98 '<tr><td colspan="2"><input type="submit" value="'.T('Create').'" /></td></tr>'. 99 '</table></fieldset></form>'; 100 100 } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), Core::Cast($this->System)->Config['MaxExportPerUser']), MESSAGE_CRITICAL); 101 101 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); … … 152 152 function SaveAllUsers() 153 153 { 154 global $System; 155 $Export = new Export($System); 156 $Export->Id = $_GET['ExportId']; 157 $Export->SaveAllUsers(); 158 154 $Export = new Export($this->System); 155 $Export->Id = $_GET['ExportId']; 156 $Export->SaveAllUsers(); 159 157 } 160 158 … … 162 160 { 163 161 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 164 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();165 162 166 163 $Output = ''; … … 174 171 { 175 172 if ($_POST['Operation'] == 'Save') 176 { 177 //print_r($_POST); 173 { 178 174 // Update user selection page 179 175 foreach ($_POST as $Index => $Value) … … 197 193 } 198 194 199 if (array_key_exists('AllUsers', $_POST)) { 200 //add allusers to export 201 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=1 WHERE `Id`='.$_GET['ExportId']); 202 203 //update export stat 204 $Export['AllUsers'] = 1; 205 $this->SaveAllUsers(); 206 } else { 207 //update export stat 208 $Export['AllUsers'] = 0; 209 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=0 WHERE `Id`='.$_GET['ExportId']); 210 } 195 if (array_key_exists('AllUsers', $_POST)) 196 { 197 //add allusers to export 198 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=1 WHERE `Id`='.$_GET['ExportId']); 199 200 //update export stat 201 $Export['AllUsers'] = 1; 202 $this->SaveAllUsers(); 203 } else 204 { 205 //update export stat 206 $Export['AllUsers'] = 0; 207 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=0 WHERE `Id`='.$_GET['ExportId']); 208 } 211 209 212 210 // Recalculate sequence number … … 218 216 219 217 $TableColumns = array( 220 221 222 223 224 225 218 array('Name' => 'Name', 'Title' => T('Name')), 219 array('Name' => 'TranslatedCount', 'Title' => T('Translated count')), 220 array('Name' => 'XP', 'Title' => T('Level')), 221 array('Name' => 'XP', 'Title' => T('Experience')), 222 array('Name' => '', 'Title' => T('Select')), 223 array('Name' => 'Sequence2', 'Title' => T('Order')), 226 224 ); 227 225 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1); 228 226 if ($Order['Column'] != 'Sequence2') $InitialOrder = ', '.substr($Order['SQL'], 10); 229 else $InitialOrder = '';227 else $InitialOrder = ''; 230 228 231 229 $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `TT`.* FROM (SELECT `ExportUser`.`Sequence`, `T`.`ID`, `T`.`TranslatedCount`, `T`.`Name`, `T`.`XP` FROM (SELECT `User`.`ID`, `User`.`Name`, `User`.`XP`, `TranslatedCount` FROM `User`) AS T'; … … 238 236 239 237 $Output .= '<form name="Translators" action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 240 238 '<h3>'.T('Translators').'</h3>'; 241 239 if ($Editable) 242 240 { 243 241 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 244 245 246 247 248 249 242 '<input type="hidden" name="Operation" value="Save"/><br />'. 243 ' <span onclick="CheckAllCheckbox();">'.CheckBox('CheckAll', False, 'CheckAll').' '.T('Select all on page').'</span> <br />'. 244 ' <span>'.CheckBox('AllUsers', $Export['AllUsers']).' '.T('Export allways from all users').'</span> '. 245 '<br />'. 246 T('Select users from list which you want to export from. And edit their order.').'<br />'. 247 T('Order is done by numeric value which is can be edit to desirable order. Lines with same number will be renumbered in ascending order.'); 250 248 } 251 249 … … 264 262 $Sequence = '<input type="text" name="seq'.$UserLine['ID'].'" style="text-align: center; width: 40px;" value="'.$UserLine['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 265 263 $Output .= '<tr>'. 266 267 268 269 270 264 '<td><a href="'.$this->System->Link('/TranslationList.php?user='.$UserLine['ID'].'&state=2&group=0').'" title="Zobrazit všechny jeho přeložené texty">'.$UserLine['Name'].'</a></td>'. 265 '<td>'.$UserLine['TranslatedCount'].'</td>'. 266 '<td>'.$XP['Level'].'</td>'. 267 '<td>'.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'</td>'. 268 '<td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'; 271 269 } 272 270 $Output .= '</table>'. 273 274 271 '</form>'. 272 $PageList['Output']; 275 273 return $Output; 276 274 } … … 288 286 289 287 if (array_key_exists('Operation', $_POST)) 288 { 290 289 if ($_POST['Operation'] == 'Save') if ($Editable and array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST)) 291 290 { … … 301 300 $Output .= ShowMessage('Nastavení uloženo.'); 302 301 } 303 304 if ($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"'; 302 } 303 304 if ($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"'; 305 305 else $WithDiacritic = ''; 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 306 $Output .= '<form action="?Action=View&Tab=0&ExportId='.$Export['Id'].'" method="post">'. 307 '<table>'; 308 if ($User->Id != null) 309 { 310 $Output .= '<input type="hidden" name="Operation" value="Save"/>'. 311 '<tr><td colspan="2">'; 312 if ($Editable) $Output .= ' <input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'; 313 $Output .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a> '; 314 if ($User->Licence(LICENCE_ADMIN)) 315 $Output .= CheckBox('Featured', $Export['Featured'], '', 'CheckBox', !$Editable). ' '.T('Recommended').' '; 316 $Output .= '</td></tr>'; 317 } 318 $Output .= '<tr><td>'.T('Identification').':</td><td><input type="text" style="width: 400px" name="Title" value="'.htmlspecialchars($Export['Title']).'"'.$DisabledInput[$Editable].'/></td></tr>'. 319 '<tr><td>'.T('Description').':</td><td><textarea name="Description" cols="54" rows="10"'.$DisabledTextArea[$Editable].'>'.htmlspecialchars($Export['Description']).'</textarea></td></tr>'. 320 '<tr><td>'.T('With diacritics').'</td><td><input type="checkbox" name="WithDiacritic" '.$WithDiacritic.''.$DisabledInput[$Editable].'/></td></tr>'. 321 '</table></form>'; 322 return $Output; 323 323 } 324 324 … … 326 326 { 327 327 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 328 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();329 328 330 329 $Output = ''; … … 339 338 if ($_POST['Operation'] == 'Save') 340 339 { 341 //print_r($_POST);342 340 // Update user selection page 343 341 foreach ($_POST as $Index => $Value) … … 377 375 378 376 $TableColumns = array( 379 380 381 377 array('Name' => 'Name', 'Title' => T('Name')), 378 array('Name' => '', 'Title' => T('Select')), 379 array('Name' => 'Sequence2', 'Title' => T('Order')), 382 380 ); 383 381 $Order = GetOrderTableHeader($TableColumns, 'Sequence2'); … … 394 392 395 393 $Output .= $PageList['Output']. 396 '<table class="BaseTable">'.394 '<table class="BaseTable">'. 397 395 $Order['Output']; 398 396 … … 410 408 } 411 409 $Output .= '</table>'. 412 413 410 '</form>'. 411 $PageList['Output']; 414 412 return $Output; 415 413 } … … 425 423 $Export = $DbRows->fetch_assoc(); 426 424 if ($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 427 else $Editable = false;425 else $Editable = false; 428 426 429 427 if (array_key_exists('Operation', $_POST)) 430 428 { 431 429 if ($_POST['Operation'] == 'Save') 432 { 433 //print_r($_POST); 430 { 434 431 // Update user selection page 435 432 foreach ($_POST as $Index => $Value) … … 459 456 if (array_key_exists('item'.$Column['Id'], $_POST)) $Selected = true; 460 457 else $Selected = false; 461 // we will save only forbitten collums and need to be visible458 // we will save only forbitten collums and need to be visible 462 459 $Selected = !$Selected; 463 460 if (!$Column['Visible']) $Selected = false; 464 461 465 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id']; 466 $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition); 467 if ($DbResult->num_rows > 0) 468 { 469 if (!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition); 470 } else 471 { 472 if ($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')'); 473 } 474 462 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id']; 463 $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition); 464 if ($DbResult->num_rows > 0) 465 { 466 if (!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition); 467 } else 468 { 469 if ($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')'); 470 } 475 471 } 476 472 } … … 484 480 485 481 $TableColumns = array( 486 487 488 489 // 490 // 491 482 array('Name' => '', 'Title' => T('Select')), 483 array('Name' => 'Name', 'Title' => T('Name')), 484 array('Name' => 'MangosTable', 'Title' => 'Mangos/DBC/Lua'), 485 // array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'), 486 // array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'), 487 array('Name' => '', 'Title' => T('Items of translation')), 492 488 ); 493 489 $Order = GetOrderTableHeader($TableColumns, 'Name'); 494 490 $Output .= '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 495 491 '<h3>'.T('Translation groups').'</h3>'; 496 492 if ($Editable) 497 493 { 498 494 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 499 500 501 502 495 '<input type="hidden" name="Operation" value="Save"/>'. 496 ' <span onclick="CheckAllCheckbox();">'.CheckBox('CheckAll', False, 'CheckAll').' '.T('Select all').'</span> '. 497 '<br />'. 498 T('Select translation groups witch you want to export.').'<br />'; 503 499 } 504 500 … … 518 514 { 519 515 $Columns = ''; 520 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 516 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 517 { 521 518 if ($Column['Visible']) $Columns .= CheckBox('item'.$Column['Id'], 522 519 !isset($GroupItems[$Column['Id']]), '', 'CheckBox', !$Editable).' '.T($Column['Name']).' <br/>'; … … 525 522 $Selection = CheckBox('sel'.$Group['Id'], $Checked, '', 'CheckBox', !$Editable); 526 523 $Output .= '<tr>'. 527 528 529 530 531 532 533 534 524 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td>'. 525 '<td>'.T($Group['Name']).'</td><td>'; 526 if ($Group['MangosTable'] <> '') 527 $Output .= $Group['MangosTable'].'.sql '; 528 if ($Group['LuaFileName'] <> '') 529 $Output .= $Group['LuaFileName'].'.lua '; 530 if ($Group['DBCFileName'] <> '') 531 $Output .= $Group['DBCFileName'].'.dbc '; 535 532 536 533 $Output .= '</td><td>'; … … 556 553 $Export = $DbRows->fetch_assoc(); 557 554 if ($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 558 else $Editable = false;555 else $Editable = false; 559 556 560 557 if (array_key_exists('Operation', $_POST)) 558 { 561 559 if ($_POST['Operation'] == 'Save') 562 560 { … … 567 565 } else $Output .= ShowMessage(T('Format wasn\'t selected'), MESSAGE_CRITICAL); 568 566 } 569 570 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 571 $Export = $DbResult->fetch_assoc(); 572 573 $Output .= '<h3>'.T('Format the generated output').'</h3>'. 574 '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'; 575 if ($Editable) 576 { 577 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 578 '<input type="hidden" name="Operation" value="Save"/>'. 579 '<br />'; 580 } 581 $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 582 while ($ExportFormat = $DbResult->fetch_assoc()) 583 { 584 $Output .= RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>'; 585 } 586 $Output .= '</form>'; 567 } 568 569 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 570 $Export = $DbResult->fetch_assoc(); 571 572 $Output .= '<h3>'.T('Format the generated output').'</h3>'. 573 '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'; 574 if ($Editable) 575 { 576 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 577 '<input type="hidden" name="Operation" value="Save"/>'. 578 '<br />'; 579 } 580 $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 581 while ($ExportFormat = $DbResult->fetch_assoc()) 582 { 583 $Output .= RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>'; 584 } 585 $Output .= '</form>'; 587 586 } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 588 587 } else $Output .= ShowMessage(T('Is isn\'t select'), MESSAGE_CRITICAL); … … 601 600 602 601 if (array_key_exists('Operation', $_POST)) 602 { 603 603 if (($_POST['Operation'] == 'Save') and (array_key_exists('ClientVersion', $_POST))) 604 604 { … … 606 606 $Output .= ShowMessage(T('Select saved.')); 607 607 } 608 609 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 610 $Export = $DbResult->fetch_assoc(); 611 612 if ($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 613 else { 614 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` '. 615 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 616 617 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 618 $DbRow = $DbResult->fetch_row(); 619 $PageList = GetPageList($DbRow[0]); 620 621 $TableColumns = array( 622 array('Name' => 'Version', 'Title' => T('Version')), 623 array('Name' => 'BuildNumber', 'Title' => T('Build')), 624 array('Name' => 'ReleaseDate', 'Title' => T('Release date')), 625 array('Name' => 'Title', 'Title' => T('Name2')), 626 array('Name' => '', 'Title' => T('Select')), 627 ); 628 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1); 629 $Output .= '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 630 '<h3>'.T('Client version').'</h3>'; 631 632 if ($Editable) 633 { 634 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 635 '<input type="hidden" name="Operation" value="Save"/>'. 636 '<br />'. 637 T('Select version of game client witch you want to export.').'<br />'; 638 } 639 $Output .= $PageList['Output']. 640 '<table class="BaseTable">'. 641 $Order['Output']; 642 643 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 644 $DbResult = $this->System->Database->query($Query); 645 while ($Version = $DbResult->fetch_assoc()) 646 { 647 $Output .= '<tr><td><a href="'.$this->System->Link('/client-version/?action=item&id='.$Version['Id']).'">'. 648 $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'. 649 HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td><td>'. 650 RadioButton('ClientVersion', $Version['Id'], $Export['ClientVersion'] == $Version['Id'], '', !$Editable 651 ).'</td></tr>'; 652 653 } 654 $Output .= '</table>'. 655 '</form>'. 656 $PageList['Output']; 657 } 658 return $Output; 608 } 609 610 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 611 $Export = $DbResult->fetch_assoc(); 612 613 if ($Export['OutputType'] == '') 614 { 615 $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 616 } else 617 { 618 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` '. 619 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 620 621 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 622 $DbRow = $DbResult->fetch_row(); 623 $PageList = GetPageList($DbRow[0]); 624 625 $TableColumns = array( 626 array('Name' => 'Version', 'Title' => T('Version')), 627 array('Name' => 'BuildNumber', 'Title' => T('Build')), 628 array('Name' => 'ReleaseDate', 'Title' => T('Release date')), 629 array('Name' => 'Title', 'Title' => T('Name2')), 630 array('Name' => '', 'Title' => T('Select')), 631 ); 632 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1); 633 $Output .= '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 634 '<h3>'.T('Client version').'</h3>'; 635 636 if ($Editable) 637 { 638 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 639 '<input type="hidden" name="Operation" value="Save"/>'. 640 '<br />'. 641 T('Select version of game client witch you want to export.').'<br />'; 642 } 643 $Output .= $PageList['Output']. 644 '<table class="BaseTable">'. 645 $Order['Output']; 646 647 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 648 $DbResult = $this->System->Database->query($Query); 649 while ($Version = $DbResult->fetch_assoc()) 650 { 651 $Output .= '<tr><td><a href="'.$this->System->Link('/client-version/?action=item&id='.$Version['Id']).'">'. 652 $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'. 653 HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td><td>'. 654 RadioButton('ClientVersion', $Version['Id'], $Export['ClientVersion'] == $Version['Id'], '', !$Editable 655 ).'</td></tr>'; 656 } 657 $Output .= '</table>'. 658 '</form>'. 659 $PageList['Output']; 660 } 661 return $Output; 659 662 } 660 663 … … 666 669 if ($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 667 670 else if ($Export['ClientVersion'] == '') $Output .= ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL); 668 else { 671 else 672 { 669 673 $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 670 674 if ($DbResult->num_rows > 0) … … 691 695 if (($Export->Export['ClientVersion'] == '') or ($Export->ClientVersion['BuildNumber'] == '')) 692 696 $Output = ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL); 693 else { 697 else 698 { 694 699 $GroupListQuery = 'SELECT `Group`.* FROM `Group` '. 695 700 ' JOIN `ExportGroup` ON (`ExportGroup`.`Export`='.$Export->Id.') AND (`ExportGroup`.`Group`=`Group`.`Id`)'; 696 701 $Query = ''; 697 702 $UnionItems = array(); … … 700 705 { 701 706 $UnionItems[] = 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 702 703 704 705 706 707 708 709 710 707 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 708 ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$Export->Id.') '. 709 ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$Export->Id.')'. 710 ' WHERE (`Complete` = 1) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 711 ') AS `C1`) AS `Translated`, '. 712 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 713 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 714 ' WHERE (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].') AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 715 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name`'; 711 716 } 712 717 $Query = substr($Query, 0, - 6);
Note:
See TracChangeset
for help on using the changeset viewer.