From 9b93ada15124d79786a5517ec1085c95ce54440d Mon Sep 17 00:00:00 2001 From: Hacene SI HADJ MOHAND Date: Wed, 21 Jul 2021 16:07:01 +0200 Subject: [PATCH] shared cat to tt ok --- js/app/models/CatalogNode.js | 22 +--------------------- js/app/models/InteractiveNode.js | 25 ++++++++++++++++++++++--- js/app/models/TimeTableNode.js | 4 ---- js/app/models/sharedCatalogNode.js | 11 +++++++++-- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/js/app/models/CatalogNode.js b/js/app/models/CatalogNode.js index 94fb0db..d42c993 100644 --- a/js/app/models/CatalogNode.js +++ b/js/app/models/CatalogNode.js @@ -114,25 +114,5 @@ Ext.define('amdaModel.CatalogNode', { module.setLinkedNode(me); module.createWindow();*/ //}); - }, - generateTT: function(node){ - var catObj = Ext.create('amdaModel.TimeTable'); - var timeTabNode = Ext.create('amdaModel.TimeTableNode',{leaf : true}); - catObj.set('relatedCatalogId', node.get('id')); - desc = 'Generated by CDPP/Amda Catalog Module \n'; - if (node.get('description')) - desc = desc + node.get('description'); - catObj.set('description', desc); - timeTabNode.set('object',catObj); - var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); - var ttRootNode = explorerTree.getRootNode().findChild('id', 'timeTable-treeRootNode', true); - amdaModel.InteractiveNode.preloadNodes(ttRootNode.getRootNode(), - function() - { - // edit newNode into Parameter Module with node as contextNode - timeTabNode.editInModule(); - }); - - - } + } }); diff --git a/js/app/models/InteractiveNode.js b/js/app/models/InteractiveNode.js index fd25b12..e3d3085 100644 --- a/js/app/models/InteractiveNode.js +++ b/js/app/models/InteractiveNode.js @@ -459,7 +459,9 @@ Ext.define('amdaModel.InteractiveNode', { case 'generateCatalog': this.generateCatalog(this); break; - + case 'generateTT': + this.generateTT(this); + break; default: break; } // switch end @@ -792,8 +794,25 @@ Ext.define('amdaModel.InteractiveNode', { { catNode.editInModule(); }); - } - }, this); + } + }, this); + }, + generateTT: function(node){ + var catObj = Ext.create('amdaModel.TimeTable'); + var timeTabNode = Ext.create('amdaModel.TimeTableNode',{leaf : true}); + catObj.set('relatedCatalogId', node.get('id')); + desc = 'Generated by CDPP/Amda Catalog Module \n'; + if (node.get('description')) + desc = desc + node.get('description'); + catObj.set('description', desc); + timeTabNode.set('object',catObj); + var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); + var ttRootNode = explorerTree.getRootNode().findChild('id', 'timeTable-treeRootNode', true); + amdaModel.InteractiveNode.preloadNodes(ttRootNode.getRootNode(), + function() + { + timeTabNode.editInModule(); + }); } }); diff --git a/js/app/models/TimeTableNode.js b/js/app/models/TimeTableNode.js index f0d20b4..8733c37 100644 --- a/js/app/models/TimeTableNode.js +++ b/js/app/models/TimeTableNode.js @@ -119,10 +119,6 @@ Ext.define('amdaModel.TimeTableNode', { case 'visu': this.visu(); break; - - case 'generateTT': - this.generateTT(this); - break; default: break; diff --git a/js/app/models/sharedCatalogNode.js b/js/app/models/sharedCatalogNode.js index af0d294..b0b5adf 100644 --- a/js/app/models/sharedCatalogNode.js +++ b/js/app/models/sharedCatalogNode.js @@ -32,7 +32,13 @@ Ext.define('amdaModel.sharedCatalogNode', { fnId : 'leaf-editLeaf', text : 'Edit Catalog', hidden : true - }]; + },{ + fnId : 'leaf-generateTT', + text : 'Generate Time Table ', + hidden : true + } + + ]; return menuItems; }, @@ -40,5 +46,6 @@ Ext.define('amdaModel.sharedCatalogNode', { getAllContextMenuItems: function(){ return this.localMenuItems(); - } + } + }); -- libgit2 0.21.2