From 862e1348ae805ee698a798d8f16889dd8fd5bca4 Mon Sep 17 00:00:00 2001 From: safan Date: Tue, 1 Feb 2011 13:29:25 +0000 Subject: [PATCH] Worked on fixed issue with loading windows more then twice, adjusted form panel in ExtJS --- workflow/engine/templates/bpmn/MyWorkflow.js | 10 +- .../templates/bpmn/ProcessMapContext.js | 146 ++++++------- .../engine/templates/bpmn/ProcessOptions.js | 192 +++++++++--------- workflow/engine/templates/bpmn/TaskContext.js | 41 ++-- workflow/engine/templates/bpmn/processmap.js | 5 - 5 files changed, 205 insertions(+), 189 deletions(-) diff --git a/workflow/engine/templates/bpmn/MyWorkflow.js b/workflow/engine/templates/bpmn/MyWorkflow.js index 0839b90d0..03ac743a0 100755 --- a/workflow/engine/templates/bpmn/MyWorkflow.js +++ b/workflow/engine/templates/bpmn/MyWorkflow.js @@ -1140,13 +1140,13 @@ MyWorkflow.prototype.AddEventInterContextMenu=function(_4093) handler: MyWorkflow.prototype.toggleShapes },*/ { - text: 'Message : Send', + text: 'Message : Throw', type:'bpmnEventMessageSendInter', scope:_4093, handler: MyWorkflow.prototype.toggleShapes }, { - text: 'Message : Receive', + text: 'Message : Catch', type:'bpmnEventMessageRecInter', scope:_4093, handler: MyWorkflow.prototype.toggleShapes @@ -1616,11 +1616,11 @@ MyWorkflow.prototype.saveShape= function(oNewShape) if(preSelectedFigure.type.match(/Task/)) this.workflow.saveRoute(preSelectedFigure,oNewShape); - if (preSelectedFigure.type.match(/Gateway/)) { + if (preSelectedFigure.type.match(/Gateway/)) //preSelectedFigure.rou_type = 'SEQUENTIAL'; this.workflow.saveRoute(preSelectedFigure,oNewShape); - } + if (preSelectedFigure.type.match(/Inter/)) { //preSelectedFigure.rou_type = 'SEQUENTIAL'; this.workflow.saveEvents(preSelectedFigure,oNewShape); @@ -2073,7 +2073,7 @@ MyWorkflow.prototype.saveRoute = function(preObj,newObj) } /** - * Delting Route Silently + * Deleting Route Silently * @Param oConn Object * @Param iVal Integer * @Author Girish joshi diff --git a/workflow/engine/templates/bpmn/ProcessMapContext.js b/workflow/engine/templates/bpmn/ProcessMapContext.js index 9716e5e71..1458d260d 100755 --- a/workflow/engine/templates/bpmn/ProcessMapContext.js +++ b/workflow/engine/templates/bpmn/ProcessMapContext.js @@ -28,6 +28,7 @@ ProcessMapContext.prototype.editProcess= function() var editProcess = new Ext.FormPanel({ labelWidth: 75, // label settings here cascade unless overridden frame:true, + monitorValid : true, bodyStyle:'padding:5px 5px 0', width: 500, height: 400, @@ -95,28 +96,9 @@ ProcessMapContext.prototype.editProcess= function() checked:checkDebug } ] - }] - }); - - editProcess.render(document.body); - workflow.editProcessForm = editProcess; - - var window = new Ext.Window({ - title: 'Edit Process', - collapsible: false, - maximizable: false, - width: 500, - height: 400, - minWidth: 300, - minHeight: 200, - layout: 'fit', - autoScroll: true, - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: editProcess, - buttons: [{ + }],buttons: [{ text: 'Save', + formBind :true, handler: function(){ //waitMsg: 'Saving...', // Wait Message var fields = editProcess.items.items; @@ -136,7 +118,7 @@ ProcessMapContext.prototype.editProcess= function() Ext.Ajax.request({ url: "processes_Ajax.php"+ urlparams, success: function(response) { - window.close(); + window.hide(); }, failure: function(){ Ext.Msg.alert ('Failure'); @@ -147,10 +129,29 @@ ProcessMapContext.prototype.editProcess= function() text: 'Cancel', handler: function(){ // when this button clicked, - window.close(); + window.hide(); } }] }); + + editProcess.render(document.body); + workflow.editProcessForm = editProcess; + + var window = new Ext.Window({ + title: 'Edit Process', + collapsible: false, + maximizable: false, + width: 500, + height: 400, + minWidth: 300, + minHeight: 200, + layout: 'fit', + autoScroll: true, + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: editProcess + }); window.show(); } @@ -164,6 +165,7 @@ ProcessMapContext.prototype.exportProcess= function() var exportProcessForm = new Ext.FormPanel({ labelWidth : 120, // label settings here cascade unless overridden frame : true, + monitorValid : true, title : '', bodyStyle : 'padding:5px 5px 0', width : 500, @@ -273,7 +275,7 @@ ProcessMapContext.prototype.exportProcess= function() collapsible: false, maximizable: false, width : 450, - height : 450, + height : 300, minWidth : 300, minHeight : 200, layout : 'fit', @@ -434,6 +436,7 @@ var tb = new Ext.Toolbar({ text: 'New', iconCls: 'application_add', handler: function () { + PermissionForm.getForm().reset(); formWindow.show(); } }) @@ -536,7 +539,8 @@ var tb = new Ext.Toolbar({ // title:"Add new Database Source", collapsible: false, maximizable: true, - width:450, + width:350, + monitorValid : true, frame:true, plain: true, bodyStyle: 'padding:5px;', @@ -793,26 +797,9 @@ var tb = new Ext.Toolbar({ } - ] - }) - - - -var formWindow = new Ext.Window({ - title: 'New specific Permission', - collapsible: false, - maximizable: true, - width: 450, - autoScroll: true, - //autoHeight: true, - height: 420, - //layout: 'fit', - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: PermissionForm, - buttons: [{ + ], buttons: [{ text: 'Create', + formBind :true, handler: function(){ var getForm = PermissionForm.getForm().getValues(); var TargetTask = getForm.TAS_UID; @@ -843,9 +830,9 @@ var formWindow = new Ext.Window({ }, success: function(response) { Ext.MessageBox.alert ('Status','Process Permission created successfully.'); - formWindow.close(); + formWindow.hide(); PermissionStore.reload(); - formWindow.close(); + formWindow.hide(); PermissionStore.reload(); } }); @@ -854,10 +841,27 @@ var formWindow = new Ext.Window({ text: 'Cancel', handler: function(){ // when this button clicked, - formWindow.close(); + formWindow.hide(); } }] - }); + }) + + + +var formWindow = new Ext.Window({ + title: 'New specific Permission', + collapsible: false, + maximizable: true, + width: 400, + autoScroll: true, + //autoHeight: true, + height: 350, + //layout: 'fit', + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: PermissionForm + }); gridWindow.show(); } @@ -1544,6 +1548,7 @@ ProcessMapContext.prototype.processFileManager= function() items: AwesomeUploaderInstance, buttons: [{ text: 'Save', + formBind :true, handler: function(){ //waitMsg: 'Saving...', // Wait Message var fields = editProcess.items.items; @@ -1563,7 +1568,7 @@ ProcessMapContext.prototype.processFileManager= function() Ext.Ajax.request({ url: "processes_Ajax.php"+ urlparams, success: function(response) { - window.close(); + window.hide(); }, failure: function(){ Ext.Msg.alert ('Failure'); @@ -1574,7 +1579,7 @@ ProcessMapContext.prototype.processFileManager= function() text: 'Cancel', handler: function(){ // when this button clicked, - window.close(); + window.hide(); } }] }); @@ -1588,6 +1593,7 @@ ProcessMapContext.prototype.caseTrackerProperties= function() var PropertiesForm = new Ext.FormPanel({ labelWidth: 75, // label settings here cascade unless overridden frame:true, + monitorValid : true, bodyStyle:'padding:5px 5px 0', width: 300, height: 300, @@ -1657,25 +1663,9 @@ ProcessMapContext.prototype.caseTrackerProperties= function() fieldLabel: 'Messages History', name: 'CT_MESSAGE_HISTORY' // checked:checkMessages - }] - - }); - var Propertieswindow = new Ext.Window({ - title: 'Case tracker', - collapsible: false, - maximizable: false, - width: 300, - height: 300, - //minWidth: 300, - //minHeight: 200, - layout: 'fit', - autoScroll: true, - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: PropertiesForm, - buttons: [{ + }], buttons: [{ text: 'Save', + formBind :true, handler: function(){ var getForm = PropertiesForm.getForm().getValues(); //var pro_uid = getForm.PRO_UID; @@ -1709,9 +1699,26 @@ ProcessMapContext.prototype.caseTrackerProperties= function() },{ text: 'Cancel', handler: function(){ - Propertieswindow.close(); + Propertieswindow.hide(); } }] + + }); + var Propertieswindow = new Ext.Window({ + title: 'Case tracker', + collapsible: false, + maximizable: false, + width: 300, + height: 300, + //minWidth: 300, + //minHeight: 200, + layout: 'fit', + autoScroll: true, + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: PropertiesForm + }); Propertieswindow.show(); } @@ -2091,6 +2098,7 @@ ProcessMapContext.prototype.ExtVariables = function() var varForm = new Ext.FormPanel({ labelWidth: 100, + monitorValid : true, bodyStyle :'padding:5px 5px 0', width : 400, height : 350, diff --git a/workflow/engine/templates/bpmn/ProcessOptions.js b/workflow/engine/templates/bpmn/ProcessOptions.js index 5aa7c9002..6ead958c5 100755 --- a/workflow/engine/templates/bpmn/ProcessOptions.js +++ b/workflow/engine/templates/bpmn/ProcessOptions.js @@ -28,6 +28,7 @@ ProcessOptions.prototype.addDynaform= function(_5625) text: 'New', iconCls: 'application_add', handler: function () { + dynaformDetails.getForm().reset(); formWindow.show(); } }); @@ -169,7 +170,7 @@ ProcessOptions.prototype.addDynaform= function(_5625) width: 280, editable: false, editor: new Ext.form.TextField({ - //allowBlank: false + allowBlank: false }) }, { @@ -194,7 +195,7 @@ ProcessOptions.prototype.addDynaform= function(_5625) sortable: true, editor: { xtype: 'textfield', - allowBlank: false, + //allowBlank: false, name : 'FLD_NAME' } },{ @@ -205,7 +206,7 @@ ProcessOptions.prototype.addDynaform= function(_5625) sortable: true, editor: { xtype: 'textfield', - allowBlank: false, + // allowBlank: false, name : 'PRO_VARIABLE' } },{ @@ -237,6 +238,7 @@ ProcessOptions.prototype.addDynaform= function(_5625) labelWidth: 100, bodyStyle :'padding:5px 5px 0', width : 550, + monitorValid : true, autoHeight: true, items: [{ @@ -293,8 +295,8 @@ ProcessOptions.prototype.addDynaform= function(_5625) items:[{ xtype : 'textfield', fieldLabel: 'Title', - name : 'DYN_TITLE', - allowBlank: false + name : 'DYN_TITLE' + //allowBlank: false },{ width: 150, xtype: 'combo', @@ -362,7 +364,7 @@ ProcessOptions.prototype.addDynaform= function(_5625) xtype : 'textfield', fieldLabel: 'Title', name : 'DYN_TITLE', - allowBlank: false + // allowBlank: false },{ xtype : 'textarea', fieldLabel: 'Description', @@ -387,40 +389,9 @@ ProcessOptions.prototype.addDynaform= function(_5625) } ] } - ] - - }); - - var gridWindow = new Ext.Window({ - title: 'Dynaform', - autoScroll: true, - collapsible: false, - maximizable: true, - width: 600, - //autoHeight: true, - height: 450, - layout: 'fit', - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: dynaformGrid - }); - - var formWindow = new Ext.Window({ - title: 'Dynaform', - autoScroll: true, - collapsible: false, - maximizable: true, - width: 550, - //autoHeight: true, - //height: 500, - layout: 'fit', - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: dynaformDetails, - buttons: [{ + ], buttons: [{ text: 'Save', + formBind :true, handler: function(){ var getForm = dynaformDetails.getForm().getValues(); //var sDynaType = getForm.DYN_SOURCE; @@ -462,19 +433,51 @@ ProcessOptions.prototype.addDynaform= function(_5625) success: function(response) { Ext.MessageBox.alert ('Status','Dynaform has been created successfully.'); taskDynaform.reload(); - formWindow.close() + formWindow.hide() } }); - + } - + },{ text: 'Cancel', handler: function(){ // when this button clicked, - formWindow.close(); + formWindow.hide(); } }] + + }); + + var gridWindow = new Ext.Window({ + title: 'Dynaform', + autoScroll: true, + collapsible: false, + maximizable: true, + width: 600, + //autoHeight: true, + height: 450, + layout: 'fit', + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: dynaformGrid + }); + + var formWindow = new Ext.Window({ + title: 'Dynaform', + autoScroll: true, + collapsible: false, + maximizable: true, + width: 550, + //autoHeight: true, + //height: 500, + layout: 'fit', + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: dynaformDetails + }); gridWindow.show(); } @@ -501,6 +504,7 @@ ProcessOptions.prototype.dbConnection = function() text: 'New', iconCls: 'application_add', handler: function () { + dbconnForm.getForm().reset(); formWindow.show(); } }); @@ -597,7 +601,7 @@ ProcessOptions.prototype.dbConnection = function() editable: false, sortable: true, editor: new Ext.form.TextField({ - //allowBlank: false + //allowBlank: false }) },{ id: 'DBS_SERVER', @@ -615,7 +619,7 @@ ProcessOptions.prototype.dbConnection = function() //width: 100, sortable: true, editor: new Ext.form.TextField({ - //allowBlank: false + // allowBlank: false }) },{ id: 'DBS_DESCRIPTION', @@ -653,8 +657,10 @@ ProcessOptions.prototype.dbConnection = function() // title:"Add new Database Source", collapsible: false, maximizable: true, + //allowBlank:false, width:450, frame:true, + monitorValid : true, plain: true, bodyStyle: 'padding:5px;', buttonAlign: 'center', @@ -864,7 +870,7 @@ ProcessOptions.prototype.dbConnection = function() fieldLabel: 'Port', name: 'DBS_PORT', id:'port', - allowBlank: false, + //allowBlank: false, editable:false },{ xtype: 'textarea', @@ -876,23 +882,9 @@ ProcessOptions.prototype.dbConnection = function() xtype: 'hidden', name : 'DBS_UID' } - ] - }) - - var formWindow = new Ext.Window({ - title: 'Add new Database Source', - collapsible: false, - maximizable: true, - width: 300, - //autoHeight: true, - //height: 400, - //layout: 'fit', - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: dbconnForm, - buttons: [{ + ], buttons: [{ text: 'Save', + formBind :true, handler: function(){ var getForm = dbconnForm.getForm().getValues(); var dbConnUID = getForm.DBS_UID; @@ -946,16 +938,31 @@ ProcessOptions.prototype.dbConnection = function() } }); } - formWindow.close(); + formWindow.hide(); dbStore.reload(); } },{ text: 'Cancel', handler: function(){ // when this button clicked, - formWindow.close(); + formWindow.hide(); } }] + }) + + var formWindow = new Ext.Window({ + title: 'Add new Database Source', + collapsible: false, + maximizable: true, + width: 300, + //autoHeight: true, + //height: 400, + //layout: 'fit', + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: dbconnForm + }); var gridWindow = new Ext.Window({ @@ -1341,8 +1348,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625) text: 'Save', formBind :true, handler: function(){ - var getForm = inputDocForm.getForm().getValues(); - + var getForm = inputDocForm.getForm().getValues(); var sDocUID = getForm.INP_DOC_UID; var sDocTitle = getForm.INP_DOC_TITLE; var sFormNeeded = getForm.INP_DOC_FORM_NEEDED; @@ -1398,7 +1404,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625) }, success: function(response) { Ext.MessageBox.alert ('Status','Input document has been created successfully.'); - newIOWindow.close(); + newIOWindow.hide(); inputDocStore.reload(); } }); @@ -1605,6 +1611,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625) text: 'New', iconCls: 'application_add', handler: function () { + outputDocForm.getForm().reset(); newOPWindow.show(); } }); @@ -1995,7 +2002,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625) success: function(response) { Ext.MessageBox.alert ('Status','Output document has been created successfully.'); outputDocStore.reload(); - newOPWindow.close(); + newOPWindow.hide(); } }); @@ -2033,7 +2040,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625) success: function(response) { Ext.MessageBox.alert ('Status','Output document has been updated successfully.'); outputDocStore.reload(); - newOPWindow.close(); + newOPWindow.hide(); } }); @@ -2043,7 +2050,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625) text: 'Cancel', handler: function(){ // when this button clicked, - newOPWindow.close(); + newOPWindow.hide(); } }], buttonAlign : 'center' @@ -2141,6 +2148,7 @@ ProcessOptions.prototype.addReportTable= function(_5625) text: 'New', iconCls: 'application_add', handler: function () { + reportForm.getForm().reset(); formWindow.show(); } }); @@ -2248,6 +2256,7 @@ var reportForm =new Ext.FormPanel({ width:450, height:380, frame:true, + monitorValid : true, plain: true, bodyStyle: 'padding:5px;', buttonAlign: 'center', @@ -2343,23 +2352,9 @@ var reportForm =new Ext.FormPanel({ }) }] } - ] - }) - -var formWindow = new Ext.Window({ - title: 'New Report Table', - collapsible: false, - maximizable: true, - width: 400, - //autoHeight: true, - height: 400, - //layout: 'fit', - plain: true, - bodyStyle: 'padding:5px;', - buttonAlign: 'center', - items: reportForm, - buttons: [{ + ], buttons: [{ text: 'Save', + formBind :true, handler: function(){ var getForm = reportForm.getForm().getValues(); //var pro_uid = getForm.PRO_UID; @@ -2371,10 +2366,10 @@ var formWindow = new Ext.Window({ Type = 'NORMAL'; else Type = 'GRID'; - + var Grid = getForm.REP_TAB_GRID; var Fields = getForm.FIELDS; - + if(typeof tableUID=='undefined') { Ext.Ajax.request({ @@ -2418,17 +2413,32 @@ var formWindow = new Ext.Window({ }); } - formWindow.close(); + formWindow.hide(); reportStore.reload(); - + } },{ text: 'Cancel', handler: function(){ // when this button clicked, - formWindow.close(); + formWindow.hide(); } }] + }) + +var formWindow = new Ext.Window({ + title: 'New Report Table', + collapsible: false, + maximizable: true, + width: 400, + //autoHeight: true, + height: 400, + //layout: 'fit', + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: reportForm + }); gridWindow.show(); } diff --git a/workflow/engine/templates/bpmn/TaskContext.js b/workflow/engine/templates/bpmn/TaskContext.js index 692bfc7d2..1c47dd766 100755 --- a/workflow/engine/templates/bpmn/TaskContext.js +++ b/workflow/engine/templates/bpmn/TaskContext.js @@ -381,6 +381,7 @@ TaskContext.prototype.editTaskSteps = function(_3252){ var taskStepsTabs = new Ext.FormPanel({ labelWidth: 100, bodyStyle :'padding:5px 5px 0', + monitorValid : true, width : 850, height : 500, items: @@ -723,6 +724,7 @@ TaskContext.prototype.editTaskProperties= function() var taskPropertiesTabs = new Ext.FormPanel({ labelWidth : 100, + monitorValid : true, // store : taskDetails, //url : 'proxyTaskPropertiesDetails.php', bodyStyle : 'padding:5px 5px 0', @@ -1262,7 +1264,23 @@ TaskContext.prototype.editTaskProperties= function() }] } - ] + ],buttons: [{ + text: 'Save', + formBind :true, + handler: function(){ + //var getstore = taskPropertiesTabs.getStore(); + //var getData = getstore.data.items; + taskExtObj.saveTaskProperties(); + window.hide(); + + } + },{ + text: 'Cancel', + handler: function(){ + // when this button clicked, + window.hide(); + } + }] } }); @@ -1332,24 +1350,8 @@ TaskContext.prototype.editTaskProperties= function() plain: true, bodyStyle: 'padding:5px;', buttonAlign: 'center', - items: taskPropertiesTabs, - buttons: [{ - text: 'Save', - handler: function(){ - //var getstore = taskPropertiesTabs.getStore(); - //var getData = getstore.data.items; - taskExtObj.saveTaskProperties(); - window.close(); - - } - },{ - text: 'Cancel', - handler: function(){ - // when this button clicked, - window.close(); - } - }] - }); + items: taskPropertiesTabs + }); window.show(); } @@ -1753,6 +1755,7 @@ TaskContext.prototype.stepTriggers = function() var treeGrid = new Ext.FormPanel({ frame: true, + monitorValid : true, labelAlign: 'left', bodyStyle:'padding:5px', width: 750, diff --git a/workflow/engine/templates/bpmn/processmap.js b/workflow/engine/templates/bpmn/processmap.js index 1fb717a41..c04b15a0c 100755 --- a/workflow/engine/templates/bpmn/processmap.js +++ b/workflow/engine/templates/bpmn/processmap.js @@ -308,11 +308,6 @@ Ext.onReady ( function() { iconCls: 'button_menu_ext ss_sprite ss_exclamation', handler: ProcessMapObj.caseTrackerObjects, scope:this - }, - { - text: 'Test', - handler: ProcessMapObj.ExtVariables, - scope:this } ] }