diff --git a/js/app/models/InteractiveNode.js b/js/app/models/InteractiveNode.js index 07361b8..fd25b12 100644 --- a/js/app/models/InteractiveNode.js +++ b/js/app/models/InteractiveNode.js @@ -456,6 +456,10 @@ Ext.define('amdaModel.InteractiveNode', { case 'downParam': this.createDownload(this); break; + case 'generateCatalog': + this.generateCatalog(this); + break; + default: break; } // switch end @@ -761,5 +765,35 @@ Ext.define('amdaModel.InteractiveNode', { myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '" + this.get('name') + "' found!"); } - } + }, + + generateCatalog: function(node){ + id = node.get('id'); + name = node.get('text'); + Ext.Msg.prompt('Create catalog', 'Enter the number of columns:', function (btn, text) { + if (btn == 'ok') { + var catObj = Ext.create('amdaModel.Catalog'); + var catNode = Ext.create('amdaModel.CatalogNode', {leaf: true}); + catObj.set('relatedTimeTableId', id); + //creatDate = new Date(this.object.get('created')); + //date = Ext.Date.format(creatDate, 'Y-m-d\\TH:i:s'); + descr = 'Generated by CDPP/Amda Time Table Module \n' + 'From Time Table: ' + name; + catObj.set('description', descr ); + var nbParam = parseInt(text); + if ((nbParam <= 0) || (nbParam > 100)) { + nbParam = 1; + } + catObj.set('nbParameters', nbParam); + catNode.set('object', catObj); + var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); + var catRootNode = explorerTree.getRootNode().findChild('id', 'catalog-treeRootNode', true); + amdaModel.InteractiveNode.preloadNodes(catRootNode.getRootNode(), + function () + { + catNode.editInModule(); + }); + } + }, this); + } + }); diff --git a/js/app/models/TimeTableNode.js b/js/app/models/TimeTableNode.js index 1a9952a..f0d20b4 100644 --- a/js/app/models/TimeTableNode.js +++ b/js/app/models/TimeTableNode.js @@ -166,36 +166,5 @@ Ext.define('amdaModel.TimeTableNode', { Ext.Array.each(selection,function(item,index,allItems){ item.ttOperations(); }) - }, - - generateCatalog: function(node){ - id = node.get('id'); - name = node.get('text'); - Ext.Msg.prompt('Create catalog', 'Enter the number of columns:', function (btn, text) { - if (btn == 'ok') { - var catObj = Ext.create('amdaModel.Catalog'); - var catNode = Ext.create('amdaModel.CatalogNode', {leaf: true}); - catObj.set('relatedTimeTableId', id); - //creatDate = new Date(this.object.get('created')); - //date = Ext.Date.format(creatDate, 'Y-m-d\\TH:i:s'); - descr = 'Generated by CDPP/Amda Time Table Module \n' + 'From Time Table: ' + name; - catObj.set('description', descr ); - var nbParam = parseInt(text); - if ((nbParam <= 0) || (nbParam > 100)) { - nbParam = 1; - } - catObj.set('nbParameters', nbParam); - catNode.set('object', catObj); - var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); - var catRootNode = explorerTree.getRootNode().findChild('id', 'catalog-treeRootNode', true); - amdaModel.InteractiveNode.preloadNodes(catRootNode.getRootNode(), - function () - { - catNode.editInModule(); - }); - } - }, this); - - - } + } }); diff --git a/js/app/models/sharedTimeTableNode.js b/js/app/models/sharedTimeTableNode.js index d3cb4b0..e722351 100644 --- a/js/app/models/sharedTimeTableNode.js +++ b/js/app/models/sharedTimeTableNode.js @@ -31,6 +31,10 @@ Ext.define('amdaModel.sharedTimeTableNode', { fnId : 'leaf-editLeaf', text : 'Edit Time Table', hidden : true + },{ + fnId : 'leaf-generateCatalog', + text : 'Generate Catalog', + hidden : true }]; return menuItems; -- libgit2 0.21.2