Commit 3945ae763a786ad60d71aab1bf9868fd740756cb

Authored by Nathanaël Jourdane
1 parent efe25e99

Add error code on tooltip

Showing 1 changed file with 8 additions and 4 deletions   Show diff stats
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
... ... @@ -461,6 +461,10 @@ class IHMJobsManagerClass {
461 461 {
462 462 $job->setAttribute('stop', date('d-m-Y H:i:s', time()));
463 463  
  464 + $start = new DateTime($job->getAttribute('start'));
  465 + $interval = (new DateTime('now'))->diff($start);
  466 + $infos['Job duration'] = $interval->format('%Hh %Im %Ss');
  467 +
464 468 $res_dir = USERWORKINGDIR . $job->getAttribute('folder') . '/';
465 469 $fileSize = filesize ( glob($res_dir.'/' . $job->getAttribute('result') . '.*')[0]);
466 470 if ($fileSize < 1024) {
... ... @@ -474,13 +478,13 @@ class IHMJobsManagerClass {
474 478 }
475 479 $infos['File size'] = $strSize;
476 480  
477   - $start = new DateTime($job->getAttribute('start'));
478   - $interval = (new DateTime('now'))->diff($start);
479   - $infos['Job duration'] = $interval->format('%Hh %Im %Ss');
480   -
481 481 $this->jobXml->getElementById($this->resRootNode[$job->getAttribute('jobType')])->appendChild($job);
482 482 }
483 483  
  484 + if($exitcode != 0) {
  485 + $infos['Error code'] = $exitcode;
  486 + }
  487 +
484 488 $strInfo = $job->getAttribute('info');
485 489 foreach ($infos as $key => $info) {
486 490 $strInfo .= '<b>' . $key . '</b>: ' . $info . '<br/>';
... ...