Ignore:
Timestamp:
Dec 24, 2013, 5:48:40 PM (11 years ago)
Author:
maron
Message:
  • Fixed: bad description
  • Added: progress in generation
File:
1 edited

Legend:

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

    r668 r670  
    204204  $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId);
    205205  $ExportTask = $DbResult->fetch_assoc();
     206  $Export = new Export($System);
     207  $Export->Id = $ExportId;
     208  $Export->Init();
    206209  if($ExportTask['TimeFinish'] > $ExportTask['TimeStart'])
    207210  {
    208     $Export = new Export($System);
    209     $Export->Id = $ExportId;
    210     $Export->Init();
    211211    $Output .= '<strong>Souhrný balík: <a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_DBC.zip').'">CzWoW_DBC.zip</a></strong><br/>';
    212212    $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`DBCFileName` != ""');
     
    216216        $Output .= '<a href="'.$System->Link('/'.$Export->TempDirRelative.'dbc/'.$Group['DBCFileName'].'.dbc').'">'.$Group['DBCFileName'].'.dbc</a><br/>';
    217217    }
    218   } else $Output .= '<strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
     218  } else {
     219 
     220    $Line = 0;
     221    if (file_exists (dirname(__FILE__).'/../../'.$Export->TempDirRelative.'progress')) {
     222      $File = new FileStream();
     223      $File->OpenFile(dirname(__FILE__).'/../../'.$Export->TempDirRelative.'progress');
     224      $Line = $File->ReadLine(); 
     225    }
     226        $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
     227                                 'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&ExportId='.$Export->Id).'\'", 4000)'.
     228                                                 '</script>';
     229    $Output .= ' <strong>Zbývá procent: '.ProgressBar(300, $Line).'</strong>';
     230    $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
     231  }
    219232  return($Output);
    220233}
     
    242255  $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId);
    243256  $ExportTask = $DbResult->fetch_assoc();
     257  $Export = new Export($System);
     258  $Export->Id = $ExportId;
     259  $Export->Init();
     260  $Export->LoadFilters();
    244261  if($ExportTask['TimeFinish'] > $ExportTask['TimeStart'])
    245262  {
    246     $Export = new Export($System);
    247     $Export->Id = $ExportId;
    248     $Export->Init();
    249     $Export->LoadFilters();
     263   // unlink($Export->TempDirRelative.'progress');
    250264    $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/>';
    251265
    252   } else $Output .= '<strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
     266  } else {
     267   
     268    $Line = 0;
     269    if (file_exists (dirname(__FILE__).'/../../'.$Export->TempDirRelative.'progress')) {
     270      $File = new FileStream();
     271      $File->OpenFile(dirname(__FILE__).'/../../'.$Export->TempDirRelative.'progress');
     272      $Line = $File->ReadLine(); 
     273    }
     274        $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
     275                                 'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&ExportId='.$Export->Id).'\'", 4000)'.
     276                                                 '</script>';
     277    $Output .= ' <strong>Zbývá procent: '.ProgressBar(300, $Line).'</strong>';
     278    $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
     279  }
    253280  return($Output);
    254281}
Note: See TracChangeset for help on using the changeset viewer.