worked on sub process properties and saving part

This commit is contained in:
safan
2011-02-07 16:02:02 +00:00
parent 55e6cfcfa3
commit 9d3cd25bf4
3 changed files with 130 additions and 59 deletions

View File

@@ -275,20 +275,35 @@ if ( isset ($_REQUEST['action']) ) {
}
break;
case 'saveSubProcessVariables':
case 'saveSubprocessDetails':
//$aTask=$oTask->load($_POST['form']['TASKS']);
//$aTask=$oTask->load($_POST['form']['PRO_UID']);
$out = array();
$in = array();
if(isset($_POST['VAR_OUT1']))
if(isset($_POST['VAR_OUT']) && $_POST['VAR_OUT'] != '')
{
$out[$_POST['VAR_OUT1']] = $_POST['VAR_OUT2'];
$varOut = explode('|',$_POST['VAR_OUT']);
$aVarOut1 = json_decode($varOut[0]);
$aVarOut2 = json_decode($varOut[1]);
for($i=1; $i<=count($aVarOut1); $i++)
{
$out[$aVarOut1[$i-1]]= $aVarOut2[$i-1];
}
}
if(isset($_POST['VAR_IN1']))
if(isset($_POST['VAR_IN']) && $_POST['VAR_IN'] != '')
{
$in[$_POST['VAR_IN1']] = $_POST['VAR_IN2'];
$varIn = explode('|',$_POST['VAR_IN']);
$aVarIn1 = json_decode($varIn[0]);
$aVarIn2 = json_decode($varIn[1]);
for($i=1; $i<=count($aVarIn1); $i++)
{
$in[$aVarIn1[$i-1]]= $aVarIn2[$i-1];
}
}
if($_POST['VAR_IN'] == '')
$in[$_POST['VAR_IN']] = '';
$aTask=($_POST['TASKS']!=0)?$oTask->load($_POST['TASKS']):0;
//$aTask['PRO_UID']=0;
@@ -297,14 +312,14 @@ if ( isset ($_REQUEST['action']) ) {
$_POST['SP_SYNCHRONOUS'] = '0';
}
if ( !isset ( $_POST['form']['SP_SYNCHRONOUS']) ) {
if ( !isset ( $_POST['SP_SYNCHRONOUS']) ) {
$_POST['SP_SYNCHRONOUS'] = '0';
}
require_once 'classes/model/SubProcess.php';
$oOP = new SubProcess();
$aData = array('SP_UID' => $_POST['SP_UID'],//G::generateUniqueID(),
'PRO_UID' => $_POST['PRO_UID'],
'PRO_UID' => $aTask['PRO_UID'],
'TAS_UID' => $_POST['TASKS'],
'PRO_PARENT' => $_POST['PRO_PARENT'],
'TAS_PARENT' => $_POST['TAS_PARENT'],
@@ -316,17 +331,19 @@ if ( isset ($_REQUEST['action']) ) {
'SP_VARIABLES_IN' => serialize($in),
'SP_GRID_IN' => '');
$oOP->update($aData);
break;
case'saveSubprocessDetails':
case'saveSubprocessDetails11':
//$aTask=($_POST['TASKS']!=0)?$oTask->load($_POST['TASKS']):0;
require_once 'classes/model/SubProcess.php';
$oOP = new SubProcess();
$aData = array(
'SP_UID' => $_POST['SP_UID'],
'PRO_UID' => $_POST['PRO_UID'],
'SP_SYNCHRONOUS' => $_POST['SP_SYNCHRONOUS'],
'SP_UID' => $_POST['SP_UID'],
'PRO_UID' => $_POST['PRO_UID'],
'PRO_PARENT' => $_POST['PRO_PARENT'],
'TAS_PARENT' => $_POST['TAS_PARENT'],
'SP_SYNCHRONOUS' => $_POST['SP_SYNCHRONOUS']
);
$oOP->update($aData);

View File

@@ -14,10 +14,10 @@ ProcessOptions.prototype.addDynaform= function(_5625)
var pro_uid = workflow.getUrlVars();
var dynaFields = Ext.data.Record.create([
{ name: 'DYN_UID', type: 'string'},
{ name: 'DYN_TYPE', type: 'string'},
{ name: 'DYN_TITLE', type: 'string'},
{ name: 'DYN_DISCRIPTION',type: 'string'},
{name: 'DYN_UID', type: 'string'},
{name: 'DYN_TYPE', type: 'string'},
{name: 'DYN_TITLE', type: 'string'},
{name: 'DYN_DISCRIPTION',type: 'string'},
{name: 'ACTION', type: 'string'}
]);
@@ -127,9 +127,9 @@ ProcessOptions.prototype.addDynaform= function(_5625)
//Creating store for getting list of additional PM tables
var additionalTablesFields = Ext.data.Record.create([
{ name: 'ADD_TAB_UID', type: 'string'},
{ name: 'ADD_TAB_NAME', type: 'string'},
{ name: 'ADD_TAB_DESCRIPTION',type: 'string'}
{name: 'ADD_TAB_UID', type: 'string'},
{name: 'ADD_TAB_NAME', type: 'string'},
{name: 'ADD_TAB_DESCRIPTION',type: 'string'}
]);
var additionalTables = new Ext.data.JsonStore({
@@ -146,10 +146,10 @@ ProcessOptions.prototype.addDynaform= function(_5625)
//Creating store for getting list of Fields of additional PM tables
var TablesFields = Ext.data.Record.create([
{ name: 'FLD_UID',type: 'string'},
{ name: 'FLD_NAME',type: 'string'},
{ name: 'FLD_DESCRIPTION',type: 'string'},
{ name: 'FLD_TYPE',type: 'string'}
{name: 'FLD_UID',type: 'string'},
{name: 'FLD_NAME',type: 'string'},
{name: 'FLD_DESCRIPTION',type: 'string'},
{name: 'FLD_TYPE',type: 'string'}
]);
var tablesFieldsStore = new Ext.data.JsonStore({
@@ -192,6 +192,19 @@ ProcessOptions.prototype.addDynaform= function(_5625)
}
});
}
function renderName(value, metaData, record, rowIndex, colIndex, store) {
var returnString = "<strong>";
if(record.get("sex") == "male") {
metaData.attr = 'style="color: blue;"';
returnString += "Mr.";
}
if(record.get("sex") == "female") {
metaData.attr = 'style="color: red;"';
returnString += "Mrs.";
}
returnString += "</strong> "+value;
return returnString;
}
var dynaformColumns = new Ext.grid.ColumnModel({
columns: [
@@ -214,7 +227,7 @@ ProcessOptions.prototype.addDynaform= function(_5625)
editor: new Ext.form.TextField({
allowBlank: false
})
},
},{ header: "Name", dataIndex: "name", renderer: renderName},
{
sortable: false,
renderer: function(val, meta, record)
@@ -538,14 +551,14 @@ ProcessOptions.prototype.dbConnection = function()
//Database store code starts here
var dbConnFields = Ext.data.Record.create([
{ name: 'DBS_UID',type: 'string'},
{ name: 'DBS_TYPE',type: 'string'},
{ name: 'DBS_SERVER',type: 'string'},
{ name: 'DBS_DATABASE_NAME',type: 'string'},
{ name: 'DBS_USERNAME',type: 'string'},
{ name: 'DBS_PASSWORD',type: 'string'},
{ name: 'DBS_PORT',type: 'string'},
{ name: 'DBS_DESCRIPTION',type: 'string'}
{name: 'DBS_UID',type: 'string'},
{name: 'DBS_TYPE',type: 'string'},
{name: 'DBS_SERVER',type: 'string'},
{name: 'DBS_DATABASE_NAME',type: 'string'},
{name: 'DBS_USERNAME',type: 'string'},
{name: 'DBS_PASSWORD',type: 'string'},
{name: 'DBS_PORT',type: 'string'},
{name: 'DBS_DESCRIPTION',type: 'string'}
]);
var btnNew = new Ext.Button({
@@ -1326,9 +1339,9 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name : 'original', value: 'ORIGINAL'},
{name : 'legal copy', value: 'COPYLEGAL'},
{name : 'copy', value: 'COPY'}
{name : 'Original', value: 'ORIGINAL'},
{name : 'Legal Copy', value: 'COPYLEGAL'},
{name : 'Copy', value: 'COPY'}
]})
}]
},{
@@ -1438,10 +1451,10 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
var sDocTitle = getForm.INP_DOC_TITLE;
var sFormNeeded = getForm.INP_DOC_FORM_NEEDED;
var sOrig = getForm.INP_DOC_ORIGINAL;
if(sOrig == "")
if(sOrig == "" || sOrig == "Original")
sOrig = 'ORIGINAL';
if(sOrig == 'legal copy')
if(sOrig == 'Legal Copy')
sOrig = 'COPYLEGAL';
if(sFormNeeded == 'Digital')
@@ -1809,7 +1822,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
monitorValid :true,
labelWidth : 100,
bodyStyle :'padding:5px 5px 0',
defaults :{ autoScroll:true },
defaults :{autoScroll:true},
width : 500,
items :[{
@@ -2165,7 +2178,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
var newOPWindow = new Ext.Window({
title : _('ID_OUTPUT_DOCUMENTS'),
width : 550,
defaults :{ autoScroll:true },
defaults :{autoScroll:true},
height : 450,
minWidth : 200,
minHeight : 150,
@@ -2181,7 +2194,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
collapsible : false,
maximizable : false,
width : 550,
defaults :{ autoScroll:true },
defaults :{autoScroll:true},
height : 420,
minWidth : 200,
minHeight : 150,
@@ -2360,7 +2373,7 @@ ProcessOptions.prototype.addReportTable= function(_5625)
collapsible : false,
maximizable : false,
width : 400,
defaults :{ autoScroll:true },
defaults :{autoScroll:true},
height : 450,
minWidth : 200,
minHeight : 150,

View File

@@ -2287,7 +2287,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
url : 'proxySubProcessProperties?pid='+pro_uid+'&tid='+taskId+'&type=0' //type=0 specifies Variables Out (Asynchronous)
})
});
variablesOutStore.load();
variablesOutStore.load();
// create the Data Store of all Variables In
var variablesInStore = new Ext.data.JsonStore({
@@ -2329,6 +2329,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
plugins : [editorOut],
columns : [{
id : 'VAR_OUT1',
name : 'VAR_OUT1',
header : 'Origin',
dataIndex: 'VAR_OUT1',
width : 200,
@@ -2346,6 +2347,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
},
{
id : 'VAR_OUT2',
name : 'VAR_OUT2',
header : 'Target',
dataIndex : 'VAR_OUT2',
width : 200,
@@ -2381,6 +2383,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
plugins : [editorIn],
columns : [{
id : 'VAR_IN1',
name : 'VAR_IN1',
header : 'Origin',
dataIndex: 'VAR_IN1',
width : 200,
@@ -2398,6 +2401,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
},
{
id : 'VAR_IN2',
name : 'VAR_IN2',
header : 'Target',
dataIndex : 'VAR_IN2',
width : 200,
@@ -2421,10 +2425,10 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
editorOut.on({
/* editorOut.on({
scope: this,
afteredit: function(roweditor, changes, record, rowIndex) {
var storeData = variableOutGrid.getStore();
var sSP_UID = spUID;
var sProcess_Parent = proParent;
var sSync = spSync;
@@ -2458,6 +2462,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
editorIn.on({
scope: this,
afteredit: function(roweditor, changes, record, rowIndex) {
var storeData = variableInGrid.getStore();
var sSP_UID = spUID;
var sProcess_Parent = proParent;
var sSync = spSync;
@@ -2485,7 +2490,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
});
}
});
});*/
var subProcessProperties = new Ext.FormPanel({
labelWidth : 110, // label settings here cascade unless overridden
@@ -2568,6 +2573,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
},
{
id :'variableout',
name :'VAR_OUT1',
xtype:'fieldset',
title: 'Variables Out',
collapsible: false,
@@ -2576,6 +2582,7 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
},
{
id :'variablein',
name :'VAR_IN1',
xtype:'fieldset',
title: 'Variables In',
//hidden: true,
@@ -2591,13 +2598,15 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
method:'GET',
waitMsg:'Loading....',
success:function(form, action) {
spUID = action.result.data[0].SP_UID;
proParent = action.result.data[0].PRO_PARENT;
spSync = action.result.data[0].SP_SYNCHRONOUS;
tasParent = action.result.data[0].TAS_PARENT;
tasks = action.result.data[0].TASKS;
var processName = action.result.data[0].SPROCESS_NAME;
if(action.result.data.SP_SYNCHRONOUS == 0)
var response = action.response.responseText;
var aData = Ext.util.JSON.decode(response);
spUID = aData.data[0].SP_UID;
proParent = aData.data[0].PRO_PARENT;
spSync = aData.data[0].SP_SYNCHRONOUS;
tasParent = aData.data[0].TAS_PARENT;
tasks = aData.data[0].TASKS;
var processName = aData.data[0].SPROCESS_NAME;
if(action.result.data[0].SP_SYNCHRONOUS == 0)
{
Ext.getCmp("variablein").hide();
form.findField('SP_SYNCHRONOUS').setValue('Asynchronous');
@@ -2634,21 +2643,56 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
text: 'Save',
handler: function(){
var getForm = subProcessProperties.getForm().getValues();
var sTask_Parent = getForm.SEL_PROCESS;
//Getting data from Grid (Variables In and Out)
var storeOutData = variableOutGrid.getStore();
var storeInData = variableInGrid.getStore();
var storeOutLength = storeOutData.data.items.length;
var storeInLength = storeInData.data.items.length;
var varOut1 = new Array();
var varOut2 = new Array();
for(var i=0;i<storeOutLength;i++){
varOut1[i] = storeOutData.data.items[i].data['VAR_OUT1'];
varOut2[i] = storeOutData.data.items[i].data['VAR_OUT2'];
}
var varOut = Ext.util.JSON.encode(varOut1)+'|'+Ext.util.JSON.encode(varOut2);
var varIn1 = new Array();
var varIn2 = new Array();
for(var j=0;j<storeInLength;j++){
varIn1[j] = storeInData.data.items[j].data['VAR_IN1'];
varIn2[j] = storeInData.data.items[j].data['VAR_IN2'];
}
var sProcessUID = getForm.SEL_PROCESS;
var sSPNAME = getForm.SPROCESS_NAME;
var sSync = getForm.SP_SYNCHRONOUS;
if(sSync == 'Synchronous')
sSync = 0;
{
sSync = 1;
var varIn = Ext.util.JSON.encode(varIn1)+'|'+Ext.util.JSON.encode(varIn2);
}
else
sSync = 1;
{
sSync = 0;
varIn = new Array();
varIn[0] = '';
}
Ext.Ajax.request({
url : 'processes_Ajax.php',
method: 'POST',
params: {
action : 'saveSubprocessDetails',
SP_UID : spUID,
PRO_UID : sTask_Parent,
TASKS : tasks,
PRO_UID : sProcessUID,
SPROCESS_NAME : sSPNAME,
PRO_PARENT : proParent,
TAS_PARENT : tasParent,
VAR_OUT : varOut,
VAR_IN : varIn,
SP_SYNCHRONOUS : sSync
},
success: function(response) {
@@ -2660,9 +2704,6 @@ TaskContext.prototype.editSubProcessProperties= function(_3525)
workflow.currentSelection.bpmnNewText.drawStringRect(sSPNAME,20,20,100,'left');
workflow.currentSelection.bpmnNewText.paint();
workflow.currentSelection.subProcessName = sSPNAME;
//var getstore = taskPropertiesTabs.getStore();
//var getData = getstore.data.items;
//taskExtObj.saveTaskProperties(_5625);
}
},{
text: 'Cancel',