Ignore:
Timestamp:
Feb 23, 2015, 12:32:54 AM (10 years ago)
Author:
chronos
Message:
  • Modified: Do not link to external jquery script which can change in future and break function.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/ExportOutput.php

    r816 r818  
    99function CreateZipFromDir(&$Zip, $Path, $ZipPath)
    1010{
    11   //echo($Path.'<br />');
    1211  $FileList = scandir($Path);
    1312  foreach($FileList as $FileName)
     
    1514    if(file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..'))
    1615    {
    17       //echo($Path.$FileName.'<br />');
    1816      if(is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/');
    1917        else $Zip->addFile(file_get_contents($Path.$FileName), $ZipPath.$FileName);
     
    226224}
    227225
    228 function ShowProgress($Export) {
    229     global $System;
    230     $Output = '';
    231     $Output .= 'Fronta zpracování exportů. Zobrazuje procenta dokončení: <br /><br />';
    232 
    233 
    234       $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'.
    235                '<script>'.
    236                   '$(document).ready(function() {'.
    237                   'var refreshId = setInterval(function() {'.
    238                   '$("#progress").load("'.$System->Link('/Modules/Export/Progress.php?RedirectId='.$_GET['ExportId']).'"); '.
    239                   '}, 1000);'.
    240                   '});'.
    241                '</script>';
    242 
    243 
    244       $Output .= ' <strong><div id="progress"></div></strong><br />';
    245 
    246     $DbResult = $System->Database->query('SELECT * FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE '.
    247     ' (`Export`.`OutputType` = 9 OR  `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL AND `TimeStart` < NOW()-10000');
    248     if($DbResult->num_rows > 0) {
    249       $System->ModuleManager->Modules['Log']->WriteLog('ProcesTask nepracuje přes 2 hodiny, pravděpodobně nepracuje!', LOG_TYPE_ERROR);
    250 
    251     }
    252     return ($Output);
     226function ShowProgress($Export)
     227{
     228  global $System;
     229
     230  $Output = '';
     231  $Output .= 'Fronta zpracování exportů. Zobrazuje procenta dokončení: <br /><br />';
     232
     233  $Output .= '<script src="'.$System->Link('/style/jquery.js').'"></script>'.
     234    '<script>'.
     235    '$(document).ready(function() {'.
     236    'var refreshId = setInterval(function() {'.
     237    '$("#progress").load("'.$System->Link('/Modules/Export/Progress.php?RedirectId='.$_GET['ExportId']).'"); '.
     238    '}, 1000);'.
     239    '});'.
     240    '</script>';
     241
     242  $Output .= ' <strong><div id="progress"></div></strong><br />';
     243
     244  $DbResult = $System->Database->query('SELECT * FROM `ExportTask` '.
     245    '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))');
     247  if($DbResult->num_rows > 0)
     248  {
     249    $System->ModuleManager->Modules['Log']->WriteLog('ProcesTask nepracuje přes 2 hodiny, pravděpodobně nepracuje!', LOG_TYPE_ERROR);
     250  }
     251  return ($Output);
    253252}
    254253
     
    285284  {
    286285    $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/>';
    287 
    288286  } else {
    289 
    290287    $Output .= ShowProgress($Export);
    291288  }
Note: See TracChangeset for help on using the changeset viewer.