Commit aa539485facb53c4bf6c6ce80ad6c6d27403cef4

Authored by Benjamin Renard
1 parent c235a080
Exists in SpeasyGet

Fix tooltip to show global start/stop definition of a speasy dataset

Showing 1 changed file with 25 additions and 7 deletions   Show diff stats
php/classes/AmdaAction.php
... ... @@ -506,19 +506,35 @@ class AmdaAction
506 506 if ($child->tagName == 'dataset') $isRemoteDataSet = true;
507 507 }
508 508  
  509 + $globalStartStr = "";
  510 + $globalStopStr = "";
  511 +
509 512 if ($child->tagName == 'parameter'){
510 513 if ($child->parentNode->hasAttribute('dataStart')){
511   - $globalStart = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStart')));
512   - $globalStop = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStop')));
  514 + $globalStartStr = $child->parentNode->getAttribute('dataStart');
  515 + $globalStopStr = $child->parentNode->getAttribute('dataStop');
513 516 }
514 517 }
515   -
516   - if ( $child->tagName == 'component'){
  518 + else if ( $child->tagName == 'component'){
517 519 if ($child->parentNode->parentNode->hasAttribute('dataStart')){
518   - $globalStart = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStart')));
519   - $globalStop = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStop')));
  520 + $globalStartStr = $child->parentNode->parentNode->getAttribute('dataStart');
  521 + $globalStopStr = $child->parentNode->parentNode->getAttribute('dataStop');
520 522 }
521 523 }
  524 + else {
  525 + if ($child->hasAttribute('dataStart')){
  526 + $globalStartStr = $child->getAttribute('dataStart');
  527 + $globalStopStr = $child->getAttribute('dataStop');
  528 + }
  529 + }
  530 +
  531 + if (!empty($globalStartStr)) {
  532 + $globalStart = date('Y-m-d\TH:i:s.u\Z', strtotime($globalStartStr));
  533 + }
  534 +
  535 + if (!empty($globalStopStr)) {
  536 + $globalStop = date('Y-m-d\TH:i:s.u\Z', strtotime($globalStopStr));
  537 + }
522 538  
523 539 if ($isParameter)
524 540 {
... ... @@ -560,7 +576,9 @@ class AmdaAction
560 576 $nonavailable = false;
561 577 }
562 578  
563   -
  579 + if ($globalStart) {
  580 + $info .= "<br/>Time Range: ".$globalStartStr."-".$globalStopStr;
  581 + }
564 582  
565 583 if ($nonavailable)
566 584 $info .= "<br/><b>Not available yet</b>";
... ...