Commit 0d95ceab81c7e6adb295631fd384e6144210d820

Authored by Elena.Budnik
1 parent 9ad25dca

redmine #5141, part1

Showing 1 changed file with 46 additions and 38 deletions   Show diff stats
js/app/views/TimeTableUI.js
... ... @@ -95,7 +95,7 @@ Ext.define('amdaUI.TimeTableUI', {
95 95  
96 96 //set cache token to the Time Table object
97 97 me.object.set('cacheToken', result.token);
98   -
  98 +
99 99 me.TTGrid.getStore().load();
100 100  
101 101 me.status = result.status;
... ... @@ -174,43 +174,51 @@ Ext.define('amdaUI.TimeTableUI', {
174 174 */
175 175 saveProcess : function(toRename)
176 176 {
177   - var timeTableModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.tt.id);
178   -
179   - // if the name has been modified this is a creation
180   - if (timeTableModule.contextNode && (timeTableModule.contextNode.data.id == 'sharedtimeTable-treeRootNode')) {
181   - timeTableModule.linkedNode = null;
182   - timeTableModule.createLinkedNode();
183   - timeTableModule.createObject(this.object.getJsonValues());
184   - var ttobj = timeTableModule.linkedNode.get('object');
185   - // synchronisation of objects
186   - this.object = ttobj;
187   - timeTableModule.linkedNode.create();
188   - }
189   - else if (this.fclose() /*TimeTable object has been modified*/) {
190   - if (this.object.isModified('name') || this.object.get('fromPlugin')) {
191   -
192   - // if object already has an id : it's a 'rename' of an existing TimeTable
193   - if (this.object.get('id')){
194   - // the context Node is the parent node of current edited one
195   - var contextNode = timeTableModule.linkedNode.parentNode;
196   - // link a new node to the TimeTableModule
197   - timeTableModule.createLinkedNode();
198   - // set the contextNode
199   - timeTableModule.linkedNode.set('contextNode',contextNode);
200   - // create a new object linked
201   - timeTableModule.createObject(this.object.getJsonValues());
202   -
203   - var ttobj = timeTableModule.linkedNode.get('object');
204   - // synchronisation of objects
205   - this.object = ttobj;
206   - if (toRename) timeTableModule.linkedNode.toRename = true;
207   - }
208   - timeTableModule.linkedNode.create({callback : function ($action) {timeTableModule.linkedNode.update();}, scope : this});
209   - } else {
210   - //update
211   - timeTableModule.linkedNode.update();
212   - }
213   - }
  177 + var timeTableModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.tt.id);
  178 +
  179 + // if the name has been modified this is a creation
  180 + if (timeTableModule.contextNode && (timeTableModule.contextNode.data.id == 'sharedtimeTable-treeRootNode'))
  181 + {
  182 + timeTableModule.linkedNode = null;
  183 + timeTableModule.createLinkedNode();
  184 + timeTableModule.createObject(this.object.getJsonValues());
  185 + var ttobj = timeTableModule.linkedNode.get('object');
  186 + // synchronisation of objects
  187 + this.object = ttobj;
  188 + timeTableModule.linkedNode.create();
  189 + }
  190 + else if (this.fclose()) /*TimeTable object has been modified*/
  191 + {
  192 + if (this.object.isModified('name') || this.object.get('fromPlugin'))
  193 + {
  194 + // if object already has an id : it's a 'rename' of an existing TimeTable
  195 + if (this.object.get('id'))
  196 + {
  197 + // the context Node is the parent node of current edited one
  198 + var contextNode = timeTableModule.linkedNode.parentNode;
  199 + // link a new node to the TimeTableModule
  200 + timeTableModule.createLinkedNode();
  201 + // set the contextNode
  202 + timeTableModule.linkedNode.set('contextNode',contextNode);
  203 + // create a new object linked
  204 + timeTableModule.createObject(this.object.getJsonValues());
  205 +
  206 + var ttobj = timeTableModule.linkedNode.get('object');
  207 + // synchronisation of objects
  208 + this.object = ttobj;
  209 +
  210 + if (toRename) timeTableModule.linkedNode.toRename = true;
  211 + }
  212 + timeTableModule.linkedNode.create({callback : function ($action) {
  213 + if (timeTableModule.linkedNode.get('object').get('fromPlugin'))
  214 + timeTableModule.linkedNode.get('object').set('fromPlugin',false);
  215 + timeTableModule.linkedNode.update();},
  216 + scope : this});
  217 + } else {
  218 + //update
  219 + timeTableModule.linkedNode.update();
  220 + }
  221 + }
214 222 },
215 223  
216 224 /**
... ...