From c57c57c943f28b23028fd75817bcf59190236289 Mon Sep 17 00:00:00 2001 From: Elena.Budnik Date: Wed, 12 Sep 2018 16:40:16 +0200 Subject: [PATCH] info message depends on group + nettoyage --- php/classes/AmdaAction.php | 65 +++++++++++++++++++++-------------------------------------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 29da7be..6d0ff5d 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -225,18 +225,15 @@ class AmdaAction { $info = $child->getAttribute('desc'); - if ($child->hasAttribute('dataStart') && $child->hasAttribute('dataStop')) - { + if ($child->hasAttribute('dataStart') && $child->hasAttribute('dataStop')) { $info .= "
Time Range: ".$child->getAttribute('dataStart')."-".$child->getAttribute('dataStop'); } - if ($child->getAttribute('dataStart') == 'depending on mission') - { + if ($child->getAttribute('dataStart') == 'depending on mission') { $info .= "
Time Range: ".$child->getAttribute('dataStart'); } - if ($child->getAttribute('restriction') > 1) - { + if ($child->getAttribute('restriction') > 1) { $restricted = $child->getAttribute('restriction'); $info .= "
Time Restriction: -$restricted days"; } @@ -248,21 +245,14 @@ class AmdaAction { $isParameter = true; - if ($child->parentNode->hasAttribute('dataStart')) - { + if ($child->parentNode->hasAttribute('dataStart')) { $globalStart = $child->parentNode->getAttribute('dataStart'); $globalStop = $child->parentNode->getAttribute('dataStop'); } - if ($child->parentNode->getAttribute('restriction') > 1 ) - { + if ($child->parentNode->getAttribute('restriction') > 1 ) { $timeRestriction = true; - } - /*------------------- to show not tested parameters ------*/ - if ($child->getAttribute('tbd')) - $info .= "
Not tested yet"; - /*------------------- --------------------------------------*/ } $component_info = array(); @@ -270,14 +260,12 @@ class AmdaAction { $isParameter = true; - if ($child->parentNode->parentNode->hasAttribute('dataStart')) - { + if ($child->parentNode->parentNode->hasAttribute('dataStart')) { $globalStart = $child->parentNode->parentNode->getAttribute('dataStart'); $globalStop = $child->parentNode->parentNode->getAttribute('dataStop'); } - if ($child->parentNode->parentNode->getAttribute('restriction') > 1) - { + if ($child->parentNode->parentNode->getAttribute('restriction') > 1) { $timeRestriction = true; } @@ -292,19 +280,16 @@ class AmdaAction if ($child->tagName == 'parameter' && $child->hasAttribute('display_type')) { - if ($child->getAttribute('display_type') == 'spectrogram') - { + if ($child->getAttribute('display_type') == 'spectrogram') { $needsArgs = true; $isSpectra = true; } - elseif ($child->getAttribute('display_type') == 'stackplot') - { + elseif ($child->getAttribute('display_type') == 'stackplot') { $isStack = true; } } - if ($isParameter) - { + if ($isParameter) { $objectMgr = new AliasMgr(); $alias = $objectMgr->getAlias($id); @@ -314,25 +299,20 @@ class AmdaAction 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'isSpectra' => $isSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet); } - else - { - if ($child->tagName == 'mission' || $child->tagName == 'observatory') - { - $disable = $child->hasAttribute('restriction'); + else { + + if ($child->tagName == 'mission' || $child->tagName == 'observatory') { $rank = $child->getAttribute('rank'); } - else - { - $disable = $child->hasAttribute('restriction'); - } - - if ($disable) - { - if ($disable == 1) { - $info .= "
Sorry ! Not finished yet..."; - } + + $disable = $child->hasAttribute('restriction'); + + if ($disable) { + if ($child->hasAttribute("group") && $child->getAttribute("group") !== "TBD") { + $info .= "
Restricted Access"; + } else { - $disable = false; + $info .= "
Sorry! Not finished yet..."; } } @@ -410,9 +390,6 @@ class AmdaAction case 'THEMIS' : $rank = 5; break; - case 'MAPSKP' : - $rank = 9; - break; default: } -- libgit2 0.21.2