task properties is saving from grid properties in bpmn designer

This commit is contained in:
Erik Amaru Ortiz
2011-02-25 17:11:15 +00:00
parent dbac405369
commit 4ab59a3afc
2 changed files with 69 additions and 38 deletions

View File

@@ -335,7 +335,7 @@ class Ajax
$properties['Title'] = $taskData['TAS_TITLE'];
$properties['Description'] = $taskData['TAS_DESCRIPTION'];
$properties['Variable for case priority'] = $taskData['TAS_PRIORITY_VARIABLE'];
$properties['Stating Task'] = $taskData['TAS_START'] == '1' ? true: false;
$properties['Starting Task'] = $taskData['TAS_START'] == 'TRUE' ? true: false;
$result->sucess = true;
$result->prop = $properties;
@@ -348,39 +348,69 @@ class Ajax
function saveProperties($param)
{
require_once 'classes/model/ProcessCategory.php';
require_once 'classes/model/CalendarDefinition.php';
switch ($param['type']) {
case 'process':
$process['PRO_UID'] = $param['UID'];
switch ($param['property']) {
case 'Title': $fieldName = 'PRO_TITLE'; break;
case 'Description': $fieldName = 'PRO_DESCRIPTION'; break;
case 'Debug':
$fieldName = 'PRO_DEBUG';
$param['value'] = $param['value'] == 'true' ? '1' : '0';
break;
case 'Category':
$fieldName = 'PRO_CATEGORY';
$category = ProcessCategory::loadByCategoryName($param['value']);
$param['value'] = $category[0]['CATEGORY_NAME'];
break;
case 'Calendar':
$fieldName = 'PRO_CALENDAR';
break;
}
$process[$fieldName] = $param['value'];
try{
$result->sucess = true;
$result->msg = '';
switch ($param['type']) {
case 'process':
require_once 'classes/model/ProcessCategory.php';
require_once 'classes/model/CalendarDefinition.php';
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$process['PRO_UID'] = $param['UID'];
switch ($param['property']) {
case 'Title': $fieldName = 'PRO_TITLE'; break;
case 'Description': $fieldName = 'PRO_DESCRIPTION'; break;
case 'Debug':
$fieldName = 'PRO_DEBUG';
$param['value'] = $param['value'] == 'true' ? '1' : '0';
break;
case 'Category':
$fieldName = 'PRO_CATEGORY';
$category = ProcessCategory::loadByCategoryName($param['value']);
$param['value'] = $category[0]['CATEGORY_UID'];
break;
case 'Calendar':
$fieldName = 'PRO_CALENDAR';
$calendar = CalendarDefinition::loadByCalendarName($param['value']);
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oProcessMap->updateProcess($process);
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($process['PRO_UID'], $calendar['CALENDAR_UID'], 'PROCESS');
break;
}
$result->sucess = true;
break;
if( $fieldName != 'PRO_CALENDAR' ) {
$process[$fieldName] = $param['value'];
$oProcessMap->updateProcess($process);
}
break;
case 'task':
break;
case 'task':
require_once 'classes/model/Task.php';
$oTask = new Task();
$task['TAS_UID'] = $param['UID'];
switch ($param['property']) {
case 'Title': $fieldName = 'TAS_TITLE'; break;
case 'Description': $fieldName = 'TAS_DESCRIPTION'; break;
case 'Variable for case priority': $fieldName = 'TAS_PRIORITY_VARIABLE'; break;
case 'Starting Task':
$fieldName = 'TAS_START';
$param['value'] = strtoupper($param['value']);
break;
}
$task[$fieldName] = $param['value'];
print_r($task);
$oTask->update($task);
break;
}
} catch (Exception $e) {
$result->sucess = false;
$result->msg = $e->getMessage();
}
print G::json_encode($result);

View File

@@ -68,7 +68,9 @@ Ext.onReady ( function() {
columns : [
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
{header: 'Assigned', id:'TU_RELATION', dataIndex: 'TU_RELATION', hidden:true, hideable:false},
{header: 'Assigned', dataIndex: 'NAME', hideable:false}
{header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){
return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME);
}}
]
}),
store: usersTaskStore,
@@ -170,19 +172,16 @@ Ext.onReady ( function() {
}
var eastPanelTree = new Ext.tree.TreePanel({
id: 'eastPanelTree',
useArrows: false,
autoScroll: true,
animate: true,
//autoHeight: true,
//enableDD: true,
//containerScroll: true,
rootVisible : false,
border: true,
height: PMExt.getBrowser().screen.height * 0.3,
region: 'north',
split : true,
collapseMode:'mini',
// auto create TreeLoader
loader : new Ext.tree.TreeLoader({
preloadChildren : true,
dataUrl : '../processes/ajaxListener',
@@ -327,12 +326,14 @@ Ext.onReady ( function() {
});
propertiesGrid.on('afteredit', function afterEdit(r) {
var node = Ext.getCmp('eastPanelTree').getSelectionModel().getSelectedNode();
Ext.Ajax.request({
url: '../processes/ajaxListener',
params: {
action : 'saveProperties',
UID: pro_uid,
type: 'process',
UID: node.attributes.id,
type: node.attributes.type,
property: r.record.data.name,
value: r.value
},