ProcessMapContext=function(id){ Workflow.call(this,id); }; ProcessMapContext.prototype=new Workflow; ProcessMapContext.prototype.type="ProcessMap"; ProcessMapContext.prototype.editProcess= function() { var editProcess = new Ext.FormPanel({ labelWidth : 75, // label settings here cascade unless overridden frame :false, buttonAlign : 'center', bodyStyle : 'padding:5px 0 0 5px;', monitorValid: true, width : 450, height : 400, defaultType : 'textfield', items : [{ xtype :'fieldset', title : 'Process Information', collapsible : false, autoHeight :true, buttonAlign : 'center', width : 450, defaultType : 'textfield', items : [{ fieldLabel : _('ID_TITLE'), name : 'PRO_TITLE', width : 300, allowBlank : false },{ xtype : 'textarea', fieldLabel : _('ID_DESCRIPTION'), name : 'PRO_DESCRIPTION', width : 300, height : 150 },{ width : 300, xtype : 'combo', mode : 'local', forceSelection : true, triggerAction : 'all', editable : false, fieldLabel : _('ID_CALENDAR'), name : 'PRO_CALENDAR', hiddenName : 'calendar', displayField : 'name', valueField : 'value', store : new Ext.data.JsonStore({ fields : ['name', 'value'], data : [ {name:'none', value: ''}, {name:'default', value: '00000000000000000000000000000001'} ] }) },{ width : 300, xtype : 'combo', mode : 'local', triggerAction : 'all', forceSelection : true, editable : false, fieldLabel : _('ID_CATEGORY'), name : 'PRO_CATEGORY', hiddenName : 'category', displayField : 'CATEGORY_NAME', valueField : 'CATEGORY_UID', value : '--None--', store :new Ext.data.JsonStore({ fields : ['CATEGORY_NAME', 'CATEGORY_UID'] }) },{ xtype : 'checkbox', fieldLabel : _('ID_PRO_DEBUG'), name :'PRO_DEBUG', checked : workflow.checkdebug } ] }],buttons: [{ text : _('ID_SAVE'), formBind : true, handler : function(form, action){ var getForm = editProcess.getForm().getValues(); var pro_title = getForm.PRO_TITLE; var pro_description = getForm.PRO_DESCRIPTION; var pro_calendar = getForm.calendar; var pro_category = getForm.category; var pro_debug = getForm.PRO_DEBUG; if(pro_debug == 'on') pro_debug = 1; else pro_debug = 0; var urlparams = '?action=saveProcess&data={"PRO_UID":"'+ pro_uid +'","PRO_CALENDAR":"'+ pro_calendar +'","PRO_CATEGORY":"'+ pro_category +'","PRO_DEBUG":"'+ pro_debug +'","PRO_DESCRIPTION":"'+ pro_description +'","PRO_TITLE":"'+ pro_title +'"}'; Ext.Ajax.request({ url: "processes_Ajax.php"+ urlparams, success: function(response) { PMExt.notify( _('ID_STATUS') , _('ID_PROCESS_SAVE') ); window.hide(); } }); } },{ text: _('ID_CANCEL'), handler: function(){ // when this button clicked, window.hide(); } }] }); editProcess.form.load({ url:'proxyExtjs.php?pid='+pro_uid+'&action=process_Edit', method:'GET', waitMsg:'Loading', success:function(form, action) { if(action.result.data.PRO_DEBUG== 0) workflow.checkdebug = false; else workflow.checkdebug = true; window.show(); }, failure:function(form, action) { PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); } }); editProcess.render(document.body); var window = new Ext.Window({ title: _('ID_EDIT_PROCESS'), collapsible: false, maximizable: false, width: 480, height: 380, minWidth: 300, minHeight: 200, layout: 'fit', autoScroll: true, plain: true, buttonAlign: 'center', items: editProcess }); window.show(); } ProcessMapContext.prototype.exportProcess= function() { var exportProcessForm = new Ext.FormPanel({ labelWidth : 160, frame : false, height : 200, defaultType : 'textfield', defaults : {width: 180}, buttonAlign : 'center', items: [ { xtype : 'fieldset', bodyStyle :'padding:10px 10px 10px 10px;', title : 'Process Info', width : 370, collapsible: false, autoHeight : true, buttonAlign: 'center', items:[ { xtype : 'displayfield', fieldLabel : _('ID_PRO_TITLE'), name : 'PRO_TITLE' },{ xtype : 'displayfield', fieldLabel : _('ID_DESCRIPTION'), name : 'PRO_DESCRIPTION' /* },{ xtype : 'displayfield', fieldLabel : _('ID_SIZE_IN_BYTES'), name : 'SIZE' */ },{ xtype : 'displayfield', fieldLabel : _('ID_PM_FILENAME'), //id : 'PM_FILENAME', name : 'PM_FILENAME' },{ xtype : 'displayfield', fieldLabel : _('ID_XPDL_FILENAME'), //id : 'XPDL_FILENAME', name : 'XPDL_FILENAME' } ] }], buttons: [{ text: _('ID_CANCEL'), handler: function(){ exportProcesswindow.hide(); } }] }); exportProcessForm.render(document.body); workflow.exportProcessForm = exportProcessForm; exportProcessForm.form.load({ url:'proxyProcesses_Export?pro_uid='+pro_uid, method:'GET', waitMsg:'Loading', success:function(form, action) { var aData = action.result.data; var fieldSet = workflow.exportProcessForm.items.items[0]; var fields = fieldSet.items.items; form.findField('PM_FILENAME').setValue("" + aData.FILENAME + "<\/a>"); form.findField('XPDL_FILENAME').setValue("" + aData.FILENAMEXPDL + "<\/a>"); }, failure:function(form, action) { } }); var exportProcesswindow = new Ext.Window({ title : _('ID_EXPORT_PROCESS'), collapsible: false, maximizable: false, sizeable : false, width : 400, height : 210, resizable : false, layout : 'fit', plain : true, buttonAlign: 'center', items : exportProcessForm }); workflow.exportProcesswindow = exportProcesswindow; exportProcesswindow.show(); } ProcessMapContext.prototype.addTask= function() { var newShape = eval("new bpmnTask(workflow)"); var xPos = workflow.contextX; var yPos = workflow.contextY; workflow.addFigure(newShape, xPos, yPos); newShape.actiontype = 'addTask'; workflow.saveShape(newShape); //Saving Annotations when user drags and drops it } ProcessMapContext.prototype.horiLine= function() { PMExt.notify( _('ID_STATUS') , _('ID_HORIZONTAL_LINE') ); } ProcessMapContext.prototype.vertiLine= function() { PMExt.notify( _('ID_STATUS') , _('ID_VERTICAL_LINE') ); } ProcessMapContext.prototype.delLines= function() { PMExt.notify( _('ID_STATUS') , _('ID_DELETE_LINES') ); } ProcessMapContext.prototype.processPermission= function() { //Process Permission store code starts here var dbConnFields = Ext.data.Record.create([ { name: 'OP_UID',type: 'string'}, { name: 'LABEL',type: 'string'}, { name: 'TASK_TARGET',type: 'string'}, { name: 'GROUP_USER',type: 'string'}, { name: 'TASK_SOURCE',type: 'string'}, { name: 'PARTICIPATED',type: 'string'}, { name: 'OBJECT_TYPE',type: 'string'}, { name: 'OBJECT',type: 'string'}, { name: 'ACTION',type: 'string'}, { name: 'OP_CASE_STATUS',type: 'string'}, { name: 'DYNAFORM',type: 'string'}, { name: 'INPUT',type: 'string'}, { name: 'OUTPUT',type: 'string'}, { name: 'TAS_UID',type: 'string'}, { name: 'OP_TASK_SOURCE',type: 'string'}, { name: 'OP_PARTICIPATE',type: 'string'}, { name: 'OP_OBJ_TYPE',type: 'string'}, { name: 'OP_GROUP_USER',type: 'string'}, { name: 'OBJ_NAME',type: 'string'}, { name: 'OP_ACTION',type: 'string'}, { name: 'USR_FULLNAME',type: 'string'}, { name: 'DYNAFORM_NAME',type: 'string'}, { name: 'INPUT_NAME',type: 'string'}, { name: 'OUTPUT_NAME',type: 'string'} ]); //Creating different stores required for fields in form var selectField = Ext.data.Record.create([ { name: 'LABEL',type: 'string'}, { name: 'UID',type: 'string'} ]); var editor = new Ext.ux.grid.RowEditor({ saveText: _('ID_UPDATE') }); var btnCreate = new Ext.Button({ id: 'btnCreate', text: _('ID_NEW'), iconCls: 'button_menu_ext ss_sprite ss_add', handler: function () { PermissionForm.getForm().reset(); formWindow.show(); } }); var editProPermission = function() { editor.stopEditing(); var rowSelected = Ext.getCmp('permissiongrid').getSelectionModel().getSelections(); if( rowSelected.length == 0 ) { PMExt.error('', _('ID_NO_SELECTION_WARNING')); return false; } var opUID = rowSelected[0].get('OP_UID'); PermissionForm.form.load({ url:'proxyExtjs.php?pid='+pro_uid+'&op_uid=' +opUID+'&action=editObjectPermission', method:'GET', waitMsg:'Loading', success:function(form, action) { formWindow.show(); if(action.result.data.OP_PARTICIPATE == 1) form.findField('OP_PARTICIPATE').setValue('Yes'); else form.findField('OP_PARTICIPATE').setValue('No'); if(action.result.data.OP_OBJ_TYPE == 'DYNAFORM') Ext.getCmp('dynaform').show(); if(action.result.data.OP_OBJ_TYPE == 'INPUT') Ext.getCmp('inputdoc').show(); if(action.result.data.OP_OBJ_TYPE == 'OUTPUT') Ext.getCmp('outputdoc').show(); }, failure:function(form, action) { PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); } }); } var deleteProPermission = function(){ ids = Array(); editor.stopEditing(); var rowsSelected = Ext.getCmp('permissiongrid').getSelectionModel().getSelections(); if( rowsSelected.length == 0 ) { PMExt.error('', _('ID_NO_SELECTION_WARNING')); return false; } for(i=0; i",record.data.CTO_UID); } }*/] }), sm: new Ext.grid.RowSelectionModel({ singleSelect: true, listeners: { rowselect: function(smObj, rowIndex, record) { workflow.currentrowIndex = rowIndex; } } }), stripeRows: true, viewConfig: {forceFit: true}, tbar: tb, bbar: new Ext.PagingToolbar({ pageSize: 10, store: assignedStore, displayInfo: true, displayMsg: 'Displaying Case Tracker Object {0} - {1} of {2}', emptyMsg: "No Case Tracker Object to display", items:[] }) }); editor.on({ scope: this, afteredit: function(roweditor, changes, record, rowIndex) { var objType = record.data.OBJECT_TYPE; var objUID = record.data.OBJECT_UID; var objTitle = record.data.OBJECT_TITLE; var cto_uid = record.data.CTO_UID; var condition = record.data.CTO_CONDITION; Ext.Ajax.request({ url : '../tracker/tracker_Ajax.php', method: 'POST', params:{ PRO_UID : pro_uid, OBJECT_TYPE : objType, OBJECT_UID : objUID, action :'assignCaseTrackerObject' }, success: function (response) { cto_uid = response.responseText; Ext.Ajax.request({ url : '../tracker/tracker_ConditionsSave.php', method: 'POST', params: { PRO_UID : pro_uid, CTO_UID : cto_uid, CTO_CONDITION : condition }, success: function (response){ PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_ASSIGNED') ); availableStore.reload(); assignedStore.reload(); } }) }, failure: function () { // when saving data failed PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_FAILED') ); } }) //Updating the user incase if already assigned user has been replaced by other user if(changes != '' && typeof record.json != 'undefined') { var obj_type = record.json.CTO_TYPE_OBJ; var obj_UID = record.json.CTO_UID; var obj_title = record.json.CTO_TITLE; var obj_uid = record.json.CTO_UID; var obj_condition = record.json.CTO_CONDITION; var obj_position = record.json.CTO_POSITION; Ext.Ajax.request({ url: '../tracker/tracker_Ajax.php', method: 'POST', params: { action :'removeCaseTrackerObject', CTO_UID : obj_UID, PRO_UID : pro_uid, STEP_POSITION : obj_position }, success: function(response) { PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_UPDATE') ); } }); } availableStore.reload(); assignedStore.reload(); } }); var gridObjectWindow = new Ext.Window({ title : 'Objects', collapsible : false, maximizable : false, width : 550, defaults :{ autoScroll:true }, height : 380, minWidth : 200, minHeight : 150, plain : true, items : Objectsgrid, buttonAlign : 'center' }); gridObjectWindow.show() } ProcessMapContext.prototype.ExtVariables = function() { var varFields = Ext.data.Record.create([ { name: 'variable', type: 'string' }, { name: 'type', type: 'string' }, { name: 'label', type: 'string' } ]); var varStore = ''; varStore = new Ext.data.JsonStore({ root : 'data', totalProperty: 'totalCount', idProperty : 'gridIndex', remoteSort : true, fields : varFields, proxy : new Ext.data.HttpProxy({ url : 'proxyExtjs?pid='+pro_uid+'&action=getVariables&sFieldName=form[CTO_CONDITION]&sSymbol=@@' }) }); //varStore.load(); var varColumns = new Ext.grid.ColumnModel({ columns: [ new Ext.grid.RowNumberer(), { id: 'FLD_NAME', header: _('ID_VARIABLES'), dataIndex: 'variable', width: 170, editable: false, sortable: true },{ id: 'PRO_VARIABLE', header: _('ID_LABEL'), dataIndex: 'label', width: 150, sortable: true } ] }); var varForm = new Ext.FormPanel({ labelWidth: 100, monitorValid : true, width : 400, bodyStyle : 'padding:10px 0 0 10px;', height : 350, renderer: function(val){return ' @@ Replace the value in quotes ';}, items: { xtype:'tabpanel', activeTab: 0, defaults:{ autoHeight:true }, items:[{ title:_('ID_ALL_VARIABLES'), id :'allVar', layout:'form', listeners: { activate: function(tabPanel){ // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. var link = 'proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; varStore.proxy.setUrl(link, true); varStore.load(); } }, items:[{ xtype: 'grid', ds: varStore, cm: varColumns, width: 380, autoHeight: true, //plugins: [editor], //loadMask : true, loadingText : 'Loading...', border: false, listeners: { //rowdblclick: alert("ok"), rowdblclick: function(){ var objectSelected = workflow.variablesAction; switch(objectSelected) { case 'grid': var getObjectGridRow = workflow.gridObjectRowSelected; var FieldSelected = workflow.gridField; //getting selected row of variables var rowSelected = this.getSelectionModel().getSelected(); var rowLabel = rowSelected.data.variable; //Assigned new object with condition if(typeof getObjectGridRow.colModel != 'undefined') getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); //Assigning / updating Condition for a row else getObjectGridRow[0].set(FieldSelected,rowLabel); if(FieldSelected=='CTO_CONDITION') { Ext.Ajax.request({ url : '../tracker/tracker_ConditionsSave.php', method: 'POST', params: { PRO_UID : pro_uid, CTO_UID : getObjectGridRow[0].data.CTO_UID, CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION }, success: function (response){ Ext.MessageBox.alert ('Status','Objects has been edited successfully '); } }) } else if (FieldSelected=='STEP_CONDITION') { Ext.Ajax.request({ url : '../steps/conditions_Save.php', method: 'POST', params: { PRO_UID : pro_uid, STEP_UID : getObjectGridRow[0].data.STEP_UID, STEP_CONDITION : getObjectGridRow[0].data.STEP_CONDITION }, success: function (response){ Ext.MessageBox.alert ('Status','Objects has been edited successfully '); } }) } else if (FieldSelected=='ST_CONDITION') { Ext.Ajax.request({ url : '../steps/steps_Ajax.php', method: 'POST', params: { action : 'saveTriggerCondition', PRO_UID : pro_uid, STEP_UID : getObjectGridRow[0].data.STEP_UID, ST_CONDITION : getObjectGridRow[0].data.STEP_CONDITION, TAS_UID : taskId, TRI_UID : getObjectGridRow[0].data.TRI_UID, ST_TYPE : getObjectGridRow[0].data.ST_TYPE }, success: function (response){ Ext.MessageBox.alert ('Status','Objects has been edited successfully '); } }) } window.hide(); break; case 'form': FormSelected = workflow.formSelected; rowSelected = this.getSelectionModel().getSelected(); FieldSelected = workflow.fieldName; rowLabel = rowSelected.data.variable; var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); window.hide(); break; } } } }] },{ title:_('ID_SYSTEM'), id:'system', layout:'form', listeners:{ activate: function(tabPanel){ // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. var link = 'proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; varStore.proxy.setUrl(link, true); varStore.load(); } }, items:[{ xtype: 'grid', ds: varStore, cm: varColumns, width: 380, autoHeight: true, //plugins: [editor], //loadMask : true, loadingText : 'Loading...', border: false, listeners: { //rowdblclick: alert("ok"), rowdblclick: function(){ var objectSelected = workflow.variablesAction; switch(objectSelected) { case 'grid': var getObjectGridRow = workflow.gridObjectRowSelected; var FieldSelected = workflow.gridField; //getting selected row of variables var rowSelected = this.getSelectionModel().getSelected(); var rowLabel = rowSelected.data.variable; //Assigned new object with condition if(typeof getObjectGridRow.colModel != 'undefined') getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); //Assigning / updating Condition for a row else getObjectGridRow[0].set(FieldSelected,rowLabel); if(CTO_UID!='') { Ext.Ajax.request({ url : '../tracker/tracker_ConditionsSave.php', method: 'POST', params: { PRO_UID : pro_uid, CTO_UID : getObjectGridRow[0].data.CTO_UID, CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION }, success: function (response){ Ext.MessageBox.alert ('Status','Objects has been edited successfully '); } }) window.hide(); } break; case 'form': FormSelected = workflow.formSelected; rowSelected = this.getSelectionModel().getSelected(); FieldSelected = workflow.fieldName; rowLabel = rowSelected.data.variable; var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); window.hide(); break; } } } }] },{ title:_('ID_CASESLIST_APP_PRO_TITLE'), id :'process', layout:'form', listeners: { activate: function(tabPanel){ // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. var link = 'proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; varStore.proxy.setUrl(link, true); varStore.load(); } }, items:[{ xtype: 'grid', ds: varStore, cm: varColumns, width: 380, autoHeight: true, //plugins: [editor], //loadMask : true, loadingText : 'Loading...', border: false, listeners: { //rowdblclick: alert("ok"), rowdblclick: function(){ var objectSelected = workflow.variablesAction; switch(objectSelected) { case 'grid': var getObjectGridRow = workflow.gridObjectRowSelected; var FieldSelected = workflow.gridField; //getting selected row of variables var rowSelected = this.getSelectionModel().getSelected(); var rowLabel = rowSelected.data.variable; //Assigned new object with condition if(typeof getObjectGridRow.colModel != 'undefined') getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); //Assigning / updating Condition for a row else getObjectGridRow[0].set(FieldSelected,rowLabel); Ext.Ajax.request({ url : '../tracker/tracker_ConditionsSave.php', method: 'POST', params: { PRO_UID : pro_uid, CTO_UID : getObjectGridRow[0].data.CTO_UID, CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION }, success: function (response){ Ext.MessageBox.alert ('Status','Objects has been edited successfully '); } }) window.hide(); break; case 'form': FormSelected = workflow.formSelected; rowSelected = this.getSelectionModel().getSelected(); FieldSelected = workflow.fieldName; rowLabel = rowSelected.data.variable; var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); window.hide(); break; } } } }] }] } }); var window = new Ext.Window({ title: _('ID_VARIABLES'), collapsible: false, maximizable: false, scrollable: true, width: 400, height: 350, minWidth: 200, minHeight: 150, autoScroll: true, layout: 'fit', plain: true, buttonAlign: 'center', items: [varForm] }); window.show(); }