Changeset 864 for trunk/Modules/Export/ExportOutput.php
- Timestamp:
- Feb 5, 2016, 11:47:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ExportOutput.php
r818 r864 235 235 '$(document).ready(function() {'. 236 236 'var refreshId = setInterval(function() {'. 237 '$("#progress").load("'.$System->Link('/ Modules/Export/Progress.php?RedirectId='.$_GET['ExportId']).'"); '.237 '$("#progress").load("'.$System->Link('/export/progress?i='.$_GET['ExportId']).'"); '. 238 238 '}, 1000);'. 239 239 '});'. 240 240 '</script>'; 241 241 242 $Output .= ' <strong><div id="progress"></div></strong><br />'; 243 242 $Output .= ' <div id="progress">'.$System->ModuleManager->Modules['Export']->GetTaskProgress($_GET['ExportId'] * 1). 243 '</div><br />'; 244 245 // Check if process task is running 244 246 $DbResult = $System->Database->query('SELECT * FROM `ExportTask` '. 245 247 'LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` '. 246 'WHERE ((`Export`.`OutputType` = 9) OR (`Export`.`OutputType` = 10)) AND (`TimeFinish` IS NULL) AND (`TimeStart` < (NOW() - 10000))'); 248 'WHERE ((`Export`.`OutputType` = 9) OR (`Export`.`OutputType` = 10)) AND '. 249 '(`TimeFinish` IS NULL) AND (`TimeStart` < (NOW() - 10000))'); 247 250 if($DbResult->num_rows > 0) 248 251 { … … 262 265 263 266 $Output = ''; 264 if(array_key_exists('Regenerate', $_POST)) 265 { 266 $System->Database->query('UPDATE ExportTask SET TimeStart = NOW(), `Progress`=0, TimeFinish = NULL WHERE Export = '.$ExportId); 267 $Output .= ShowMessage('Soubor zařazen znovu ke zpracování do fronty.'); 268 $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování exe souboru', LOG_TYPE_DOWNLOAD); 269 } 270 271 $Output .= '<form action="?Action=View&Tab=7&ExportId='.$ExportId.'" method="post"><input type="submit" name="Regenerate" value="Přegenerovat"/></form><br />'; 267 // Allow to regenerate output if it was previously finished 268 $DbResult = $System->Database->query('SELECT `Id` FROM `ExportTask` WHERE (`Export` = '.$ExportId. 269 ') AND ((`TimeFinish` < `TimeStart`) OR (`TimeFinish` IS NULL))'); 270 if($DbResult->num_rows == 0) 271 { 272 if(array_key_exists('Regenerate', $_POST)) 273 { 274 $System->Database->query('UPDATE `ExportTask` SET `TimeStart` = NOW(), `Progress`=0, `TimeFinish` = NULL WHERE `Export` = '.$ExportId); 275 $Output .= ShowMessage('Soubor zařazen znovu ke zpracování do fronty.'); 276 $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování exe souboru', LOG_TYPE_DOWNLOAD); 277 } else { 278 $Output .= '<form action="?Action=View&Tab=7&ExportId='.$ExportId.'" method="post">'. 279 '<input type="submit" name="Regenerate" value="Přegenerovat"/></form><br />'; 280 } 281 } 282 272 283 $Output .= 'U souhrné instalace češtiny funguje export textů jinak, protože generování je náročné, jsou požadavky zařazovány do fronty a postupně zpracovávány.<br /><br />'; 273 284 274 $DbResult = $System->Database->query('SELECT * FROM ExportTask WHERE Export = '.$ExportId); 285 // Start task for the first time if export task was not yet started 286 $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId); 275 287 if($DbResult->num_rows == 0) 276 288 { … … 283 295 if($ExportTask['TimeFinish'] > $ExportTask['TimeStart']) 284 296 { 285 $Output .= '<strong>Souhrný EXE balík: <a href="'.$System->Link('/'.$Export->TempDirRelative.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe').'">Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe</a></strong><br/>'; 297 $FileName = 'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe'; 298 $Output .= '<strong>Souhrný EXE balík: <a href="'.$System->Link('/'.$Export->TempDirRelative.$FileName).'">'.$FileName.'</a></strong><br/>'; 286 299 } else { 287 300 $Output .= ShowProgress($Export);
Note:
See TracChangeset
for help on using the changeset viewer.