Commit d3f8a6d06df4553d544810a9d0b0d036bd64a0a3

Authored by Elena.Budnik
1 parent 92edb3d1

internal paramID

js/app/views/ParamsMgrUI.js
... ... @@ -155,7 +155,9 @@ Ext.define('amdaUI.ParamsMgrUI',{
155 155 var srcNode = record;
156 156 var id = srcNode.get('id');
157 157 // Check if node exists already at destination
158   - if (root.findChild('id',id, true)) {
  158 + var idToCheck = id.toLowerCase().replace(":", "_", "gi");
  159 + // TODO check at sever side
  160 + if (root.findChild('id',idToCheck, true)) {
159 161 myDesktopApp.infoMsg('This parameter exists already in your treee');
160 162 return;
161 163 }
... ... @@ -184,8 +186,8 @@ Ext.define('amdaUI.ParamsMgrUI',{
184 186 }
185 187 });
186 188  
187   - // Add new node to correct location
188   - parentNode.expand(!this.isDataSet, function(res){
  189 + // Add new node to correct location
  190 + parentNode.expand(!this.isDataSet, function(res){
189 191 var newNode = srcNode.copy();
190 192 parentNode.appendChild(newNode);
191 193 //to sync treeStore
... ... @@ -193,7 +195,7 @@ Ext.define('amdaUI.ParamsMgrUI',{
193 195 //expand the whole subtree of added node
194 196 tree.selectPath(newNode.getPath( 'id', '|'), 'id', '|');
195 197 });
196   - return true;
  198 + return true;
197 199 },
198 200  
199 201 onViewRender : function(view){
... ...
php/RemoteDataCenter/RemoteParamManager.php
... ... @@ -77,7 +77,7 @@ class RemoteParamManager
77 77 if (!$this->center->ViId) return false;
78 78 if (!$this->center->ParamId) return false;
79 79  
80   - $this->paramId = strtolower($this->center->baseID."_".$this->center->ViId."_".$this->center->ParamId);
  80 + // $this->paramId = strtolower($this->center->baseID."_".$this->center->ViId."_".$this->center->ParamId);
81 81  
82 82 $xmlNameRemote = RemoteData."/PARAMS/".$this->paramId.".xml";
83 83 $xmlNameTemp = PARAMS_LOCALDB_DIR."/".$this->paramId.".xml";
... ... @@ -126,7 +126,9 @@ class RemoteParamManager
126 126 protected function addNode($id)
127 127 {
128 128 // Node exists already
129   - if ($this->xmlDom->getElementById($id)) return true;
  129 + $this->paramId = strtr(strtolower($id),":","_");
  130 +
  131 + if ($this->xmlDom->getElementById($this->paramId)) return true;
130 132  
131 133 // Node to be added
132 134 $nodeRemote = $this->center->baseDom->getElementById($id);
... ... @@ -224,7 +226,8 @@ class RemoteParamManager
224 226  
225 227 if ($id == 'root') return array('res' => 'ok');
226 228  
227   - $this->setBaseId($id);
  229 + $this->setBaseId($id);
  230 +
228 231 $res = $this->addNode($id);
229 232  
230 233 if ($res === false) return array("err" => "Cannot add node : $id");
... ... @@ -238,6 +241,7 @@ class RemoteParamManager
238 241 if ($id == 'root') continue;
239 242  
240 243 if (!$this->baseId) $this->setBaseId($id);
  244 +
241 245 $res = $this->addNode($id);
242 246  
243 247 if ($res === false) return array("err" => "Cannot add node : $id");
... ...