Commit 57bf884182c9ca67b2d8e0b45f66d6e3f8b67b37
1 parent
a8512cd5
Exists in
master
and in
111 other branches
correct mydataParam in IHM
Showing
3 changed files
with
18 additions
and
25 deletions
Show diff stats
js/app/models/InteractiveNode.js
... | ... | @@ -166,18 +166,7 @@ Ext.define('amdaModel.InteractiveNode', { |
166 | 166 | isValidName : function(name, callBackFn) |
167 | 167 | { |
168 | 168 | var dataToSend = {name: name, nodeType: this.get('nodeType'), leaf: this.isLeaf()}; |
169 | - AmdaAction.validNameObject(dataToSend, callBackFn); | |
170 | - | |
171 | - /*if (name.match(/[a-z,0-9]/gi)) { | |
172 | - var subTreeRoot = this.getRootNode(); | |
173 | - //TODO - check to be sure that preload is already applied before to use the isValidName function (normally, this is the case) | |
174 | - var nodeWithSameName = subTreeRoot.findChild('text', name, true); | |
175 | - if (nodeWithSameName !== null && this !== nodeWithSameName) { | |
176 | - return "This name already exists in this subtree!<br/>Do you want to overwrite it?"; | |
177 | - } else return true; | |
178 | - } else { | |
179 | - return "Name is required"; | |
180 | - }*/ | |
169 | + AmdaAction.validNameObject(dataToSend, callBackFn); | |
181 | 170 | }, |
182 | 171 | |
183 | 172 | /** | ... | ... |
js/app/models/MyDataParamNode.js
... | ... | @@ -40,7 +40,8 @@ Ext.define('amdaModel.MyDataParamNode', { |
40 | 40 | if (this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); |
41 | 41 | }, |
42 | 42 | |
43 | - localMenuItems : function() { | |
43 | + localMenuItems : function() | |
44 | + { | |
44 | 45 | var menuItems = |
45 | 46 | [{ |
46 | 47 | fnId : 'root-upload', |
... | ... | @@ -74,12 +75,16 @@ Ext.define('amdaModel.MyDataParamNode', { |
74 | 75 | return menuItems; |
75 | 76 | }, |
76 | 77 | |
77 | - getAllContextMenuItems: function(){ | |
78 | - return this.localMenuItems(); | |
79 | - }, | |
78 | + getAllContextMenuItems: function() | |
79 | + { | |
80 | + var menuItems = this.allMenuItems('Parameter'); | |
81 | + var locMenuItems = this.localMenuItems(); | |
80 | 82 | |
81 | - onMenuItemClick : function(menu,item,event) { | |
83 | + return Ext.Array.merge(menuItems,locMenuItems); | |
84 | + }, | |
82 | 85 | |
86 | + onMenuItemClick : function(menu,item,event) | |
87 | + { | |
83 | 88 | var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length); |
84 | 89 | |
85 | 90 | switch (fnId) { | ... | ... |
php/classes/AmdaAction.php
... | ... | @@ -141,8 +141,7 @@ class AmdaAction { |
141 | 141 | |
142 | 142 | $specialNode = false; |
143 | 143 | $isParameter = false; |
144 | - $skip = false; | |
145 | - $isAddable = false; | |
144 | + $isAddable = false; | |
146 | 145 | $isSimulation = false; |
147 | 146 | $rank = null; |
148 | 147 | |
... | ... | @@ -464,15 +463,15 @@ class AmdaAction { |
464 | 463 | $obsolete = false; |
465 | 464 | |
466 | 465 | $disable = $restricted || $nonavailable || $obsolete; |
467 | - $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'isAddable' => $isAddable, | |
468 | - 'info' => $info, 'leaf' => false, 'isRemoteDataSet' => $isRemoteDataSet, 'disable' => $disable, | |
466 | + | |
467 | + $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'isAddable' => $isAddable, | |
468 | + 'info' => $info, 'leaf' => false, 'isRemoteDataSet' => $isRemoteDataSet, 'disable' => $disable, | |
469 | 469 | 'isSimulation' => $isSimulation, 'rank' => $rank, 'isDeletable' => $isDeletable, 'help' => $help); |
470 | 470 | } |
471 | 471 | |
472 | 472 | break; |
473 | 473 | case 'myData' : |
474 | - $info = $child->hasAttribute('info') ? $child->getAttribute('info') : $child->nodeValue; | |
475 | - // $info = str_replace("\n","<br/>",$info); | |
474 | + $info = $child->hasAttribute('info') ? $child->getAttribute('info') : $child->nodeValue; | |
476 | 475 | break; |
477 | 476 | |
478 | 477 | case 'myDataParam' : |
... | ... | @@ -493,8 +492,8 @@ class AmdaAction { |
493 | 492 | } |
494 | 493 | |
495 | 494 | if ($child->hasAttribute('desc')) { |
496 | - $globalStart = substr(str_replace('-','/',$child->getAttribute('desc')), 0, 16); | |
497 | - $globalStop = substr(str_replace( '-','/',$child->getAttribute('desc')), 17, 22); | |
495 | + $globalStart = substr($child->getAttribute('desc'), 0, 19); | |
496 | + $globalStop = substr($child->getAttribute('desc'), 20); | |
498 | 497 | } |
499 | 498 | |
500 | 499 | $childrenToReturn[] = array('text' => $name, 'size' => $size, 'id' => $id, | ... | ... |