Merged
Merge Request #13
·
created by
Fer 9915
From
FER_9915
into
develop
Showing
1 changed file
Show diff stats
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
@@ -427,59 +427,57 @@ class IHMJobsManagerClass { | @@ -427,59 +427,57 @@ class IHMJobsManagerClass { | ||
427 | default: | 427 | default: |
428 | $name = "unknown_".time(); | 428 | $name = "unknown_".time(); |
429 | } | 429 | } |
430 | - if(array_key_exists('timeTables', $obj)) { | ||
431 | - $ttXml = new DomDocument(); | ||
432 | - $ttXml->load(USERWSDIR . 'Tt.xml'); | ||
433 | - | ||
434 | - $sharedTtXml = new DomDocument(); | ||
435 | - $sharedTtXml->load(SHAREDPATH . 'SharedObjectTree.xml'); | ||
436 | - | ||
437 | - | ||
438 | - $ttIntervals = []; | ||
439 | - // TT/Cat | ||
440 | - foreach ($ttXml->getElementsByTagName('timetab') as $tt) { | ||
441 | - $ttIntervals[$tt->getAttribute('name')] = $tt->getAttribute('intervals'); | ||
442 | - } | ||
443 | - foreach ($ttXml->getElementsByTagName('catalog') as $cat) { | ||
444 | - $ttIntervals[$cat->getAttribute('name')] = $cat->getAttribute('intervals'); | ||
445 | - } | ||
446 | - | ||
447 | - // shared TT/Cat | ||
448 | - foreach ($sharedTtXml->getElementsByTagName('timeTable') as $tt) { | ||
449 | - $ttIntervals[$tt->getAttribute('name')] = $tt->getAttribute('nbIntervals'); | ||
450 | - } | ||
451 | - foreach ($sharedTtXml->getElementsByTagName('catalog') as $cat) { | ||
452 | - $ttIntervals[$cat->getAttribute('name')] = $cat->getAttribute('nbIntervals'); | ||
453 | - } | ||
454 | - | ||
455 | - if(count($obj['timeTables']) == 1) { | ||
456 | - $infos['Time table'] = $obj['timeTables'][0]->timeTableName; | ||
457 | - $infos['Nb Intervals'] = $ttIntervals[$infos['Time table']]; | ||
458 | - } else { | ||
459 | - foreach ($obj['timeTables'] as $tt) { | ||
460 | - if($tt === reset($obj['timeTables'])) { | ||
461 | - $intervalNb = $ttIntervals[$tt->timeTableName]; | ||
462 | - if(isset($intervalNb)){ | ||
463 | - $infos['Time tables'] = $tt->timeTableName . '(' .$intervalNb . ' int.)'; | ||
464 | - }else{ | ||
465 | - $infos['Time tables'] = $tt->timeTableName; | ||
466 | - } | ||
467 | - } else { | ||
468 | - $intervalNb = $ttIntervals[$tt->timeTableName]; | ||
469 | - if(isset($intervalNb)){ | ||
470 | - $infos['Time tables'] .= ', ' . $tt->timeTableName . '(' .$intervalNb. ' int.)'; | ||
471 | - }else{ | ||
472 | - $infos['Time tables'] .= ', ' . $tt->timeTableName; | ||
473 | - } | ||
474 | - } | ||
475 | - } | ||
476 | - } | ||
477 | - } else { | ||
478 | - $infos['Start date'] = $obj['startDate']; | ||
479 | - $infos['Stop date'] = $obj['stopDate']; | ||
480 | - } | ||
481 | - | ||
482 | - $infos['Started at'] = gmdate("Y-m-d H:i:s", $start); | 430 | + if(array_key_exists('timeTables', $obj)) { |
431 | + $ttXml = new DomDocument(); | ||
432 | + $ttXml->load(USERWSDIR . 'Tt.xml'); | ||
433 | + | ||
434 | + $sharedTtXml = new DomDocument(); | ||
435 | + $sharedTtXml->load(SHAREDPATH . 'SharedObjectTree.xml'); | ||
436 | + | ||
437 | + | ||
438 | + $ttIntervals = []; | ||
439 | + // TT/Cat | ||
440 | + foreach ($ttXml->getElementsByTagName('timetab') as $tt) { | ||
441 | + $ttIntervals[$tt->getAttribute('name')] = $tt->getAttribute('intervals'); | ||
442 | + } | ||
443 | + foreach ($ttXml->getElementsByTagName('catalog') as $cat) { | ||
444 | + $ttIntervals[$cat->getAttribute('name')] = $cat->getAttribute('intervals'); | ||
445 | + } | ||
446 | + | ||
447 | + // shared TT/Cat | ||
448 | + foreach ($sharedTtXml->getElementsByTagName('timeTable') as $tt) { | ||
449 | + $ttIntervals[$tt->getAttribute('name')] = $tt->getAttribute('nbIntervals'); | ||
450 | + } | ||
451 | + foreach ($sharedTtXml->getElementsByTagName('catalog') as $cat) { | ||
452 | + $ttIntervals[$cat->getAttribute('name')] = $cat->getAttribute('nbIntervals'); | ||
453 | + } | ||
454 | + | ||
455 | + if(count($obj['timeTables']) == 1) { | ||
456 | + $infos['Time table'] = $obj['timeTables'][0]->timeTableName; | ||
457 | + $infos['Nb Intervals'] = $ttIntervals[$infos['Time table']]; | ||
458 | + } else { | ||
459 | + foreach ($obj['timeTables'] as $tt) { | ||
460 | + if($tt === reset($obj['timeTables'])) { | ||
461 | + $intervalNb = $ttIntervals[$tt->timeTableName]; | ||
462 | + if(isset($intervalNb)){ | ||
463 | + $infos['Time tables'] = $tt->timeTableName . '(' .$intervalNb . ' int.)'; | ||
464 | + }else{ | ||
465 | + $infos['Time tables'] = $tt->timeTableName; | ||
466 | + } | ||
467 | + } else { | ||
468 | + $intervalNb = $ttIntervals[$tt->timeTableName]; | ||
469 | + if(isset($intervalNb)){ | ||
470 | + $infos['Time tables'] .= ', ' . $tt->timeTableName . '(' .$intervalNb. ' int.)'; | ||
471 | + }else{ | ||
472 | + $infos['Time tables'] .= ', ' . $tt->timeTableName; | ||
473 | + } | ||
474 | + } | ||
475 | + } | ||
476 | + } | ||
477 | + } else { | ||
478 | + $infos['Start date'] = $obj['startDate']; | ||
479 | + $infos['Stop date'] = $obj['stopDate']; | ||
480 | + } | ||
483 | 481 | ||
484 | $strInfo = ''; | 482 | $strInfo = ''; |
485 | foreach ($infos as $key => $info) { | 483 | foreach ($infos as $key => $info) { |
@@ -511,7 +509,7 @@ class IHMJobsManagerClass { | @@ -511,7 +509,7 @@ class IHMJobsManagerClass { | ||
511 | $newJob->setAttribute('jobType', $key); | 509 | $newJob->setAttribute('jobType', $key); |
512 | $newJob->setAttribute('folder', $args['folder']); | 510 | $newJob->setAttribute('folder', $args['folder']); |
513 | $newJob->setAttribute('result', $args['result']); | 511 | $newJob->setAttribute('result', $args['result']); |
514 | - $newJob->setAttribute('start', date('d-m-Y H:i:s', $args['start'])); | 512 | + $newJob->setAttribute('start', date(DATE_ISO8601, $args['start'])); |
515 | //to know if know if it's an immediate job or not | 513 | //to know if know if it's an immediate job or not |
516 | $newJob->setAttribute('immediate', !$args['running']); | 514 | $newJob->setAttribute('immediate', !$args['running']); |
517 | $newJob->setAttribute('exectime', $args['exectime']); | 515 | $newJob->setAttribute('exectime', $args['exectime']); |
@@ -586,7 +584,7 @@ class IHMJobsManagerClass { | @@ -586,7 +584,7 @@ class IHMJobsManagerClass { | ||
586 | if ($args['running']) { | 584 | if ($args['running']) { |
587 | $job->setAttribute('stop', 'unknown'); | 585 | $job->setAttribute('stop', 'unknown'); |
588 | } else if ($job->getAttribute('stop') == '' || $job->getAttribute('stop') == 'unknown') { | 586 | } else if ($job->getAttribute('stop') == '' || $job->getAttribute('stop') == 'unknown') { |
589 | - $job->setAttribute('stop', date('d-m-Y H:i:s', time())); | 587 | + $job->setAttribute('stop', date(DATE_ISO8601, time())); |
590 | 588 | ||
591 | $start = new DateTime($job->getAttribute('start')); | 589 | $start = new DateTime($job->getAttribute('start')); |
592 | $interval = (new DateTime('now'))->diff($start); | 590 | $interval = (new DateTime('now'))->diff($start); |