Changeset 865 for trunk/Modules/Export


Ignore:
Timestamp:
Feb 5, 2016, 11:51:42 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: Division by zero error in case of zero progress of export task.
File:
1 edited

Legend:

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

    r864 r865  
    744744      // Show estimated time to complete
    745745      $PrefixMultiplier = new PrefixMultiplier();
    746       $EstimatedTime = (time() - MysqlDateTimeToTime($Task['TimeStart'])) / $Task['Progress'] * (100 - $Task['Progress']);
    747       $Output .= 'Zbývající odhadovaný čas: '.$PrefixMultiplier->Add($EstimatedTime, '', 4, 'Time').'<br/>';
     746      if($Task['Progress'] > 0) {
     747        $EstimatedTime = (time() - MysqlDateTimeToTime($Task['TimeStart'])) / $Task['Progress'] * (100 - $Task['Progress']);
     748        $Output .= 'Zbývající odhadovaný čas: '.$PrefixMultiplier->Add($EstimatedTime, '', 4, 'Time').'<br/>';
     749      }
    748750
    749751      if($Task['Progress'] > 99)
Note: See TracChangeset for help on using the changeset viewer.