Commit 3b63d483df71f077cf88c29523bd7b6ef464803b

Authored by Hacene SI HADJ MOHAND
1 parent 1913b8cc

shared in progress

js/app/models/InteractiveNode.js
@@ -456,6 +456,10 @@ Ext.define('amdaModel.InteractiveNode', { @@ -456,6 +456,10 @@ Ext.define('amdaModel.InteractiveNode', {
456 case 'downParam': 456 case 'downParam':
457 this.createDownload(this); 457 this.createDownload(this);
458 break; 458 break;
  459 + case 'generateCatalog':
  460 + this.generateCatalog(this);
  461 + break;
  462 +
459 default: 463 default:
460 break; 464 break;
461 } // switch end 465 } // switch end
@@ -761,5 +765,35 @@ Ext.define('amdaModel.InteractiveNode', { @@ -761,5 +765,35 @@ Ext.define('amdaModel.InteractiveNode', {
761 myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '" 765 myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '"
762 + this.get('name') + "' found!"); 766 + this.get('name') + "' found!");
763 } 767 }
764 - } 768 + },
  769 +
  770 + generateCatalog: function(node){
  771 + id = node.get('id');
  772 + name = node.get('text');
  773 + Ext.Msg.prompt('Create catalog', 'Enter the number of columns:', function (btn, text) {
  774 + if (btn == 'ok') {
  775 + var catObj = Ext.create('amdaModel.Catalog');
  776 + var catNode = Ext.create('amdaModel.CatalogNode', {leaf: true});
  777 + catObj.set('relatedTimeTableId', id);
  778 + //creatDate = new Date(this.object.get('created'));
  779 + //date = Ext.Date.format(creatDate, 'Y-m-d\\TH:i:s');
  780 + descr = 'Generated by CDPP/Amda Time Table Module \n' + 'From Time Table: ' + name;
  781 + catObj.set('description', descr );
  782 + var nbParam = parseInt(text);
  783 + if ((nbParam <= 0) || (nbParam > 100)) {
  784 + nbParam = 1;
  785 + }
  786 + catObj.set('nbParameters', nbParam);
  787 + catNode.set('object', catObj);
  788 + var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);
  789 + var catRootNode = explorerTree.getRootNode().findChild('id', 'catalog-treeRootNode', true);
  790 + amdaModel.InteractiveNode.preloadNodes(catRootNode.getRootNode(),
  791 + function ()
  792 + {
  793 + catNode.editInModule();
  794 + });
  795 + }
  796 + }, this);
  797 + }
  798 +
765 }); 799 });
js/app/models/TimeTableNode.js
@@ -166,36 +166,5 @@ Ext.define(&#39;amdaModel.TimeTableNode&#39;, { @@ -166,36 +166,5 @@ Ext.define(&#39;amdaModel.TimeTableNode&#39;, {
166 Ext.Array.each(selection,function(item,index,allItems){ 166 Ext.Array.each(selection,function(item,index,allItems){
167 item.ttOperations(); 167 item.ttOperations();
168 }) 168 })
169 - },  
170 -  
171 - generateCatalog: function(node){  
172 - id = node.get('id');  
173 - name = node.get('text');  
174 - Ext.Msg.prompt('Create catalog', 'Enter the number of columns:', function (btn, text) {  
175 - if (btn == 'ok') {  
176 - var catObj = Ext.create('amdaModel.Catalog');  
177 - var catNode = Ext.create('amdaModel.CatalogNode', {leaf: true});  
178 - catObj.set('relatedTimeTableId', id);  
179 - //creatDate = new Date(this.object.get('created'));  
180 - //date = Ext.Date.format(creatDate, 'Y-m-d\\TH:i:s');  
181 - descr = 'Generated by CDPP/Amda Time Table Module \n' + 'From Time Table: ' + name;  
182 - catObj.set('description', descr );  
183 - var nbParam = parseInt(text);  
184 - if ((nbParam <= 0) || (nbParam > 100)) {  
185 - nbParam = 1;  
186 - }  
187 - catObj.set('nbParameters', nbParam);  
188 - catNode.set('object', catObj);  
189 - var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);  
190 - var catRootNode = explorerTree.getRootNode().findChild('id', 'catalog-treeRootNode', true);  
191 - amdaModel.InteractiveNode.preloadNodes(catRootNode.getRootNode(),  
192 - function ()  
193 - {  
194 - catNode.editInModule();  
195 - });  
196 - }  
197 - }, this);  
198 -  
199 -  
200 - } 169 + }
201 }); 170 });
js/app/models/sharedTimeTableNode.js
@@ -31,6 +31,10 @@ Ext.define(&#39;amdaModel.sharedTimeTableNode&#39;, { @@ -31,6 +31,10 @@ Ext.define(&#39;amdaModel.sharedTimeTableNode&#39;, {
31 fnId : 'leaf-editLeaf', 31 fnId : 'leaf-editLeaf',
32 text : 'Edit Time Table', 32 text : 'Edit Time Table',
33 hidden : true 33 hidden : true
  34 + },{
  35 + fnId : 'leaf-generateCatalog',
  36 + text : 'Generate Catalog',
  37 + hidden : true
34 }]; 38 }];
35 39
36 return menuItems; 40 return menuItems;