Commit 5b64c444070fdbfc798fe57d8eaa6503cf74362a

Authored by Hacene SI HADJ MOHAND
1 parent a52d11df

rm-6903 corrected

js/app/models/InteractiveNode.js
... ... @@ -194,12 +194,18 @@ Ext.define('amdaModel.InteractiveNode', {
194 194  
195 195 if (opt)
196 196 {
  197 +
197 198 var scope = opt.scope ? opt.scope : this;
198 199 if (opt.callback)
199 200 opt.callback.call(scope,'update');
  201 +
200 202 }
201   -
202   - Ext.Msg.alert('Complete', 'Object '+this.get('object').get('name')+' has been modified', this);
  203 + if(opt.notDisplayMsg){
  204 + //do nothing
  205 + }else{
  206 + Ext.Msg.alert('Complete', 'Object '+this.get('object').get('name')+' has been modified');
  207 + }
  208 +
203 209 // fix the modifications for object
204 210 this.get('object').commit();
205 211  
... ... @@ -290,8 +296,12 @@ Ext.define('amdaModel.InteractiveNode', {
290 296 // set ownerTree panel as the active tab - to enable selection of this node his ownerTree must have a view
291 297 this.myGetOwnerTree().ownerCt.setActiveTab(this.myGetOwnerTree());
292 298 }
293   -
294   - Ext.Msg.alert('Complete', 'New object '+this.get('object').get('name')+' has been created');
  299 + if(opt.notDisplayMsg){
  300 + //do nothing
  301 + }else{
  302 + Ext.Msg.alert('Complete', 'New object '+this.get('object').get('name')+' has been created');
  303 + }
  304 +
295 305 // expand the contextNode
296 306 this.get('contextNode').expand(false, function() {
297 307 if (!this.get('contextNode').findChild('text',this.get('text'))) {
... ...
js/app/views/CatalogUI.js
... ... @@ -117,7 +117,6 @@ Ext.define('amdaUI.CatalogUI', {
117 117 this.formPanel.getForm().findField('nbIntervals').setValue(this.object.get('nbIntervals'));
118 118 },
119 119 generateTT : function(){
120   - console.log(this);
121 120 if(this.fclose()){
122 121 Ext.Msg.confirm('Generate TT', 'Current Catalog has been modified.\nDo you want to save it to include these changes in the generated Time Table ?' ,
123 122 function (btn, text){
... ... @@ -125,16 +124,18 @@ Ext.define('amdaUI.CatalogUI', {
125 124 // mark this.closed as true before the call to close() as that will fire the beforeclose event again
126 125 if(this.object.get('id') ==""){
127 126 // case of creation of catalog
128   - this.saveCatalog(true);
  127 + this.saveCatalog(true,true);
129 128 }else{
130 129 // casse existing catalog
131   - this.saveProcess(false,true);
  130 + this.saveProcess(false,true,true);
132 131 }
133   - return
134   - //win.close();
  132 + return;
135 133 }
136 134 }, this);
137 135  
  136 + }else{
  137 + this.createTT(this.object.get('id'));
  138 + return;
138 139 }
139 140 },
140 141 createTT : function(catId){
... ... @@ -491,7 +492,7 @@ Ext.define('amdaUI.CatalogUI', {
491 492 /*
492 493 * save method called by Save button
493 494 */
494   - saveProcess : function(toRename, onAfterSave)
  495 + saveProcess : function(toRename, onAfterSave, notDisplayMsg)
495 496 {
496 497 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id);
497 498 // store / columns are the same - not needed to reconfigure grid
... ... @@ -506,7 +507,7 @@ Ext.define('amdaUI.CatalogUI', {
506 507 var obj = module.linkedNode.get('object');
507 508 // synchronisation of objects
508 509 this.object = obj;
509   - module.linkedNode.create({callback : function() {if (onAfterSave) this.createTT(this.object.get('id'));}, scope : this});
  510 + module.linkedNode.create({notDisplayMsg:notDisplayMsg, callback : function() {if (onAfterSave) this.createTT(this.object.get('id'));}, scope : this});
510 511 }
511 512 // if the name has been modified this is a creation
512 513 else if (this.fclose()) {
... ... @@ -527,14 +528,14 @@ Ext.define('amdaUI.CatalogUI', {
527 528 this.object = obj;
528 529 if (toRename) module.linkedNode.toRename = true;
529 530 }
530   - module.linkedNode.create({callback : function() {module.linkedNode.update({callback : function() {if (onAfterSave) this.createTT(this.object.get('id'));}, scope : this});}, scope : this});
  531 + module.linkedNode.create({callback : function() {module.linkedNode.update({notDisplayMsg:notDisplayMsg, callback : function() {if (onAfterSave) this.createTT(this.object.get('id'));}, scope : this},"",notDisplayMsg);}, scope : this});
531 532 } else {
532 533 //update
533   - module.linkedNode.update({callback : function() {if (onAfterSave) this.createTT(this.object.get('id'));}, scope : this});
  534 + module.linkedNode.update({notDisplayMsg:notDisplayMsg,callback : function() {if (onAfterSave) this.createTT(this.object.get('id'));}, scope : this});
534 535 }
535 536 }
536 537 },
537   - saveCatalog : function (onAfterSave){
  538 + saveCatalog : function (onAfterSave,notDisplayMsg){
538 539 if (this.updateObject())
539 540 {
540 541 var basicForm = this.formPanel.getForm();
... ... @@ -585,7 +586,7 @@ Ext.define('amdaUI.CatalogUI', {
585 586  
586 587 me.fieldName.validFlag = true;
587 588 me.fieldName.validate();
588   - me.saveProcess(false, onAfterSave);
  589 + me.saveProcess(false, onAfterSave,notDisplayMsg);
589 590 });
590 591 });
591 592 }
... ...