Commit 222e562d8fb733608677aa8acd2d0db3b517df20

Authored by Benjamin Renard
1 parent 990eccc9

Give the possibility to hide a private dataset in the AMDA local tree

Showing 2 changed files with 9 additions and 2 deletions   Show diff stats
js/app/models/AmdaNode.js
... ... @@ -21,7 +21,8 @@ Ext.define('amdaModel.AmdaNode', {
21 21 {name:'rootNode', persist: false},
22 22 {name: 'ownerTreeId', persist: false},
23 23 {name: 'ownerTree', persist: false},
24   - {name: 'checked', defaultValue: null, persist: false}
  24 + {name: 'checked', defaultValue: null, persist: false},
  25 + {name: 'visible', type: 'boolean', defaultValue: true},
25 26 ],
26 27  
27 28 statics : {
... ...
php/classes/AmdaAction.php
... ... @@ -361,6 +361,11 @@ class AmdaAction
361 361 }
362 362 $disable = TRUE;
363 363  
  364 + $hideIfRestricted = FALSE;
  365 + if ($child->hasAttribute("hideIfRestricted") && ($child->getAttribute("hideIfRestricted") == "1")) {
  366 + $hideIfRestricted = TRUE;
  367 + }
  368 +
364 369 if ($child->hasAttribute('group')) {
365 370 if ($child->getAttribute("group") === "TBD") {
366 371 $info .= "<br/><b>Under Testing</b>";
... ... @@ -381,9 +386,10 @@ class AmdaAction
381 386 if ($child->hasAttribute('restriction') && $child->getAttribute('restriction') == 'plotOnly')
382 387 $info .= "<br/><b>Plot Only!!!</b>";
383 388 }
  389 + $visible = !($disable && $hideIfRestricted);
384 390  
385 391 $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'info' => $info, 'last_update' => $last_update,
386   - 'leaf' => false, 'help' => $help, 'disable' => $disable, 'rank' => $rank, 'timeRestriction' => $timeRestriction);
  392 + 'leaf' => false, 'help' => $help, 'disable' => $disable, 'visible' => $visible, 'rank' => $rank, 'timeRestriction' => $timeRestriction);
387 393 }
388 394 break;
389 395  
... ...