From 1fae4157bd4cb69ff92e957766eb245376d9f344 Mon Sep 17 00:00:00 2001 From: safan Date: Tue, 28 Dec 2010 14:32:43 +0000 Subject: [PATCH] worked on saving condition for trackers worked on getting Variables list --- .../engine/methods/bpmn/proxyVariable.php | 60 ++++++ .../templates/bpmn/ProcessMapContext.js | 179 +++++++++++++++++- workflow/engine/templates/bpmn/processmap.js | 5 + 3 files changed, 242 insertions(+), 2 deletions(-) create mode 100644 workflow/engine/methods/bpmn/proxyVariable.php diff --git a/workflow/engine/methods/bpmn/proxyVariable.php b/workflow/engine/methods/bpmn/proxyVariable.php new file mode 100644 index 000000000..7af26c3a2 --- /dev/null +++ b/workflow/engine/methods/bpmn/proxyVariable.php @@ -0,0 +1,60 @@ + + 'char', + 'variable' => 'char', + 'type' => 'type', + 'label' => 'char' +); +foreach ( $aFields as $aField ) { + switch ($aType){ + case "system": + if($aField['sType']=="system"){ + $aRows[] = Array ( + 'fieldname' => $_GET['sFieldName'], + 'variable' => $_GET['sSymbol'] . $aField['sName'], + 'variable_label' => '
'.$_GET['sSymbol'] . $aField['sName'].'
', + 'type' => $aField['sType'], + 'label' => $aField['sLabel'] + ); + } + break; + case "process": + if($aField['sType']!="system"){ + $aRows[] = Array ( + 'fieldname' => $_GET['sFieldName'], + 'variable' => $_GET['sSymbol'] . $aField['sName'], + 'variable_label' => '
'.$_GET['sSymbol'] . $aField['sName'].'
', + 'type' => $aField['sType'], + 'label' => $aField['sLabel'] + ); + } + break; + default: + $aRows[] = Array ( + 'fieldname' => $_GET['sFieldName'], + 'variable' => $_GET['sSymbol'] . $aField['sName'], + 'variable_label' => '
'.$_GET['sSymbol'] . $aField['sName'].'
', + 'type' => $aField['sType'], + 'label' => $aField['sLabel'] + ); + break; + } + +} + +array_shift($aRows); +$result['totalCount'] = count($aRows); +$result['data'] = $aRows; +print json_encode($result); +?> diff --git a/workflow/engine/templates/bpmn/ProcessMapContext.js b/workflow/engine/templates/bpmn/ProcessMapContext.js index b0dc5a308..29cad79d5 100755 --- a/workflow/engine/templates/bpmn/ProcessMapContext.js +++ b/workflow/engine/templates/bpmn/ProcessMapContext.js @@ -1754,7 +1754,7 @@ ProcessMapContext.prototype.caseTrackerObjects= function() var btnRemove = new Ext.Button({ id: 'btnRemove', - text: 'Remove User', + text: 'Remove', iconCls: 'application_delete', handler: function (s) { editor.stopEditing(); @@ -1962,7 +1962,182 @@ ProcessMapContext.prototype.caseTrackerObjects= function() buttonAlign : 'center' }); gridObjectWindow.show() -} + } +ProcessMapContext.prototype.ExtVariables = function() + { + var pro_uid = workflow.getUrlVars(); + //var taskId = workflow.currentSelection.id; +var varFields = Ext.data.Record.create([ + { + name: 'variable', + type: 'string' + }, + { + name: 'type', + type: 'string' + }, + { + name: 'label', + type: 'string' + } + ]); + var varStore = new Ext.data.JsonStore({ + root : 'data', + totalProperty: 'totalCount', + idProperty : 'gridIndex', + remoteSort : true, + fields : varFields, + proxy : new Ext.data.HttpProxy({ + url : 'proxyVariable?pid='+pro_uid+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@' + }) + }); + //taskUsers.setDefaultSort('LABEL', 'asc'); + varStore.load(); + +var allVarGrid = new Ext.grid.GridPanel({ + store : varStore, + id : 'mygrid', + loadMask : true, + loadingText : 'Loading...', + //renderTo : 'cases-grid', + frame : false, + autoHeight : false, + enableDragDrop : true, + ddGroup : 'firstGridDDGroup', + clicksToEdit: 1, + minHeight :400, + height :400, + layout : 'form', + //plugins : [editor], + columns : [{ + id: 'variable', + header: 'Variable', + dataIndex: 'variable', + width: 200, + sortable: true + },{ + id: 'label', + header: 'Label', + dataIndex: 'label', + width: 200, + sortable: true + }] + }); + +var sysStore = new Ext.data.JsonStore({ + root : 'data', + totalProperty: 'totalCount', + idProperty : 'gridIndex', + remoteSort : true, + fields : varFields, + proxy : new Ext.data.HttpProxy({ + url : 'proxyVariable?pid='+pro_uid+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@' + }) + }); + //taskUsers.setDefaultSort('LABEL', 'asc'); + sysStore.load(); + +var sysGrid = new Ext.grid.GridPanel({ + store : sysStore, + id : 'mygrid', + loadMask : true, + loadingText : 'Loading...', + //renderTo : 'cases-grid', + frame : false, + autoHeight : false, + enableDragDrop : true, + ddGroup : 'firstGridDDGroup', + clicksToEdit: 1, + minHeight :400, + height :400, + layout : 'form', + //plugins : [editor], + columns : [{ + id: 'variable', + header: 'Variable', + dataIndex: 'variable', + width: 200, + sortable: true + },{ + id: 'Label', + header: 'Label', + dataIndex: 'label', + width: 200, + sortable: true + }] + }); +var varForm = new Ext.FormPanel({ + labelWidth: 100, + bodyStyle :'padding:5px 5px 0', + width : 850, + height : 500, + items: + { + xtype:'tabpanel', + activeTab: 0, + defaults:{ + autoHeight:true, + bodyStyle:'padding:10px' + }, + items:[{ + title:'All Variables', + layout:'fit', + defaults: { + width: 400 + }, + items:[allVarGrid] + },{ + title:'System', + layout:'fit', + defaults: { + width: 400 + }, + items:[sysGrid] + },{ + title:'Process', + layout:'form', + defaults: { + width: 400 + }, + items:[] + }] + } + }); + + //varForm.render(document.body); + //workflow.taskStepsTabs = varForm; + + var window = new Ext.Window({ + title: 'Steps Of', + collapsible: false, + maximizable: false, + width: 800, + height: 470, + minWidth: 200, + minHeight: 150, + layout: 'fit', + plain: true, + bodyStyle: 'padding:5px;', + buttonAlign: 'center', + items: varForm + /*buttons: [{ + text: 'Save', + handler: function(){ + //var getstore = grid.getStore(); + //var getData = getstore.data.items; + //taskExtObj.saveTaskSteps(getData); + } + },{ + text: 'Cancel', + handler: function(){ + // when this button clicked, + window.close(); + } + }]*/ + }); + window.show(); + + } diff --git a/workflow/engine/templates/bpmn/processmap.js b/workflow/engine/templates/bpmn/processmap.js index 9745d7876..d12144d1d 100755 --- a/workflow/engine/templates/bpmn/processmap.js +++ b/workflow/engine/templates/bpmn/processmap.js @@ -258,6 +258,11 @@ Ext.onReady ( function() { text: 'Objects', handler: ProcessMapObj.caseTrackerObjects, scope:this + }, + { + text: 'Test', + handler: ProcessMapObj.ExtVariables, + scope:this } ] }