Changeset 734


Ignore:
Timestamp:
Jan 8, 2014, 4:43:28 PM (11 years ago)
Author:
maron
Message:
  • Added: list of progress task
Location:
trunk
Files:
5 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`'.
  • trunk/admin/index.php

    r708 r734  
    1414  $Output = '<h3>Volby pro správu</h3>';
    1515 
    16   $fileprocesstask = dirname(__FILE__).'/../'.$System->Config['Web']['TempFolder'].'ProcessTask';
    17   if (file_exists($fileprocesstask)) {
    18     if (filemtime($fileprocesstask) > (time()-1-$System->Config['ExportTaskProcessPeriod'])) {
    19        $Output .= 'ProcessTask je online<br />';
    20     } else $Output .= '<b>ProcessTask je offline f</b><br />';
    21   } else $Output .= '<b>ProcessTask je offline</b><br />';
    22 
    2316  $Output .= '<br />'.
    2417  '<a href="https://'.$Config['Web']['Host'].'/phpmyadmin/">Správa databáze</a><br/>'.
  • trunk/includes/Version.php

    r733 r734  
    66// and system will need database update.
    77
    8 $Revision = 733; // Subversion revision
     8$Revision = 734; // Subversion revision
    99$DatabaseRevision = 732; // Database structure revision
    1010$ReleaseTime = '2014-01-08';
  • trunk/includes/system.php

    r726 r734  
    406406                $Output .= $this->ShowSearchBox();
    407407
    408                 if($this->System->User->Licence(LICENCE_ADMIN)) {
    409                   $fileprocesstask = dirname(__FILE__).'/../'.$this->Config['Web']['TempFolder'].'ProcessTask';
    410       if (file_exists($fileprocesstask)) {
    411         if (filemtime($fileprocesstask) > (time()-1-$this->Config['ExportTaskProcessPeriod'])) {
    412            $Output .= 'ProcessTask je online<br />';
    413         } else $Output .= '<b>ProcessTask je offline</b><br />';
    414       } else $Output .= '<b>ProcessTask je offline</b><br />';
    415     }
    416408                $Output .= '</td><td id="border-left"></td><td class="content">';
    417409                return($Output);
Note: See TracChangeset for help on using the changeset viewer.