Changeset 734 for trunk/Modules/Export


Ignore:
Timestamp:
Jan 8, 2014, 4:43:28 PM (11 years ago)
Author:
maron
Message:
  • Added: list of progress task
Location:
trunk/Modules/Export
Files:
2 edited

Legend:

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

    r733 r734  
    228228    global $System;
    229229    $Output = '';
    230     $DbResult = $System->Database->query('SELECT Progress FROM `ExportTask` WHERE `Export`='.$Export->Id);
    231     $Task = $DbResult->fetch_assoc();
    232 
    233 //      $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    234 //                               'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&Auto&ExportId='.$Export->Id).'\'", 5000)'.
    235 //                                               '</script>';                                       '.ProgressBar(300, $Task['Progress']).'
    236         $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'.
     230    $DbResult = $System->Database->query('SELECT * FROM `ExportTask`'.
     231    ' LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE  (`Export`.`OutputType` = 9 OR  `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL ORDER BY `Progress` DESC');// `Export`='.$Export->Id
     232    $Output .= 'Fronta zpracování exportů. Zobrazuje procenta dokončení: <br /><br />';
     233    while($Task = $DbResult->fetch_assoc()) {
     234        $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'.
    237235               '<script>'.
    238236                  '$(document).ready(function() {'.
    239237                  'var refreshId = setInterval(function() {'.
    240                   '$("#progress").load("'.$System->Link('/Modules/Export/Progress.php?ExportId='.$Export->Id).'"); '.
     238                  '$("#progress'.$Task['Export'].'").load("'.$System->Link('/Modules/Export/Progress.php?ExportId='.$Task['Export']).'"); '.
    241239                  '}, 1000);'.
    242240                  '});'.
    243241               '</script>';
    244     $Output .= ' <strong>Dokončeno procent: <div id="progress">'.ProgressBar(300, $Task['Progress']).'</div></strong>';
    245             //   $(\'#load_progress\').load(\''.'?Action=View&Tab=7&Auto&ExportId='.$Export->Id.'\');   
    246               // Modules/Export/Progress.php?ExportId=37
    247     if ($Task['Progress'] == 0) $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
    248    
     242      $Export = '<a href="'.$System->Link('/export/?Action=View&ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>';         
     243      if ($_GET['ExportId'] == $Task['Export'])
     244        $Export = ''.$Export.' (aktuální)';
     245   
     246      $Output .= ' <strong>Export '.$Export.': <div id="progress'.$Task['Export'].'">'.ProgressBar(300, $Task['Progress']).'</div></strong><br />';
     247   // if ($Task['Progress'] == 0) $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
     248   
     249    }
    249250    return ($Output);
    250251}
  • trunk/Modules/Export/ProcessTask.php

    r732 r734  
    2121        $System->Database->query('UPDATE `ExportTask` SET `Progress`='.$per.' WHERE `Export`='.$Export->Id);
    2222}
    23 function SetOnline() {
    24   global $System;
    25         $File = new FileStream();
    26         $File->CreateFile(dirname(__FILE__).'/../../'.$System->Config['Web']['TempFolder'].'ProcessTask');
    27         $File->WriteLine(1);
    28 }
     23
    2924
    3025function DeleteOldFiles($deldir)
     
    10297while(1)
    10398{
    104   //setonline
    105   SetOnline();
    10699  // DBC files
    107100  $DbResult = $System->Database->query('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask`'.
Note: See TracChangeset for help on using the changeset viewer.