worked on ExTJs variables and report table part

This commit is contained in:
safan
2011-01-03 10:29:07 +00:00
parent e7e086c4dd
commit 2840f1235c
3 changed files with 449 additions and 484 deletions

View File

@@ -25,38 +25,42 @@
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
G::LoadClass('reportTables');
if(isset($_POST['form']))
$value= $_POST['form'];
else
$value=$_POST;
$oReportTable = new ReportTable();
if (!isset($_POST['form']['REP_TAB_CONNECTION'])) {
$_POST['form']['REP_TAB_CONNECTION'] = 'report';
if (!isset($value['REP_TAB_CONNECTION'])) {
$value['REP_TAB_CONNECTION'] = 'report';
}
if ($_POST['form']['REP_TAB_UID'] != '') {
$aReportTable = $oReportTable->load($_POST['form']['REP_TAB_UID']);
if ($value['REP_TAB_UID'] != '') {
$aReportTable = $oReportTable->load($value['REP_TAB_UID']);
$sOldTableName = $aReportTable['REP_TAB_NAME'];
$sOldConnection = $aReportTable['REP_TAB_CONNECTION'];
}
else {
$sOldTableName = $_POST['form']['REP_TAB_NAME'];
$sOldConnection = $_POST['form']['REP_TAB_CONNECTION'];
$oReportTable->create($_POST['form']);
$_POST['form']['REP_TAB_UID'] = $oReportTable->getRepTabUid();
$sOldTableName = $value['REP_TAB_NAME'];
$sOldConnection = $value['REP_TAB_CONNECTION'];
$oReportTable->create($value);
$value['REP_TAB_UID'] = $oReportTable->getRepTabUid();
}
$oReportTable->update($_POST['form']);
$oReportTable->update($value);
$oReportVar = new ReportVar();
$oReportTables = new ReportTables();
$oReportTables->deleteAllReportVars($_POST['form']['REP_TAB_UID']);
$oReportTables->deleteAllReportVars($value['REP_TAB_UID']);
$aFields = array();
if ($_POST['form']['REP_TAB_TYPE'] == 'GRID') {
$aAux = explode('-', $_POST['form']['REP_TAB_GRID']);
if ($value['REP_TAB_TYPE'] == 'GRID') {
$aAux = explode('-', $value['REP_TAB_GRID']);
global $G_FORM;
$G_FORM = new Form($_POST['form']['PRO_UID'] . '/' . $aAux[1], PATH_DYNAFORM, SYS_LANG, false);
$G_FORM = new Form($value['PRO_UID'] . '/' . $aAux[1], PATH_DYNAFORM, SYS_LANG, false);
$aAux = $G_FORM->getVars(false);
foreach ($aAux as $aField) {
$_POST['form']['FIELDS'][] = $aField['sName'] . '-' . $aField['sType'];
$value['FIELDS'][] = $aField['sName'] . '-' . $aField['sType'];
}
}
foreach ($_POST['form']['FIELDS'] as $sField) {
foreach ($value['FIELDS'] as $sField) {
$aField = explode('-', $sField);
switch ($aField[1]) {
case 'currency':
@@ -82,13 +86,13 @@ foreach ($_POST['form']['FIELDS'] as $sField) {
$sType = 'char';
break;
}
$oReportVar->create(array('REP_TAB_UID' => $_POST['form']['REP_TAB_UID'],
'PRO_UID' => $_POST['form']['PRO_UID'],
$oReportVar->create(array('REP_TAB_UID' => $value['REP_TAB_UID'],
'PRO_UID' => $value['PRO_UID'],
'REP_VAR_NAME' => $aField[0],
'REP_VAR_TYPE' => $sType));
$aFields[] = array('sFieldName' => $aField[0], 'sType' => $sType);
}
$oReportTables->dropTable($sOldTableName, $sOldConnection);
$oReportTables->createTable($_POST['form']['REP_TAB_NAME'], $_POST['form']['REP_TAB_CONNECTION'], $_POST['form']['REP_TAB_TYPE'], $aFields);
$oReportTables->populateTable($_POST['form']['REP_TAB_NAME'], $_POST['form']['REP_TAB_CONNECTION'], $_POST['form']['REP_TAB_TYPE'], $aFields, $_POST['form']['PRO_UID'], $_POST['form']['REP_TAB_GRID']);
$oReportTables->createTable($value['REP_TAB_NAME'], $value['REP_TAB_CONNECTION'], $value['REP_TAB_TYPE'], $aFields);
$oReportTables->populateTable($value['REP_TAB_NAME'], $value['REP_TAB_CONNECTION'], $value['REP_TAB_TYPE'], $aFields, $value['PRO_UID'], $value['REP_TAB_GRID']);
?>

View File

@@ -1582,23 +1582,22 @@ ProcessMapContext.prototype.caseTrackerProperties= function()
defaults: {width: 350},
defaultType: 'textfield',
items: [{
width: 100,
xtype: 'combo',
mode: 'local',
triggerAction: 'all',
forceSelection: true,
editable: false,
fieldLabel: 'Map Type',
name: 'CT_MAP_TYPE',
displayField: 'name',
value: 'Process Map',
valueField: 'value',
store: new Ext.data.JsonStore({
width :100,
xtype :'combo',
mode :'local',
triggerAction :'all',
forceSelection :true,
editable :false,
fieldLabel :'Map Type',
name :'CT_MAP_TYPE',
displayField :'name',
value :'Process Map',
valueField :'value',
store :new Ext.data.JsonStore({
fields : ['name', 'value'],
data :[{name: 'None', value:'0'},
{name: 'Process Map', value: '1'},
{name: 'Stages Map', value:'2'}]
})
},{
xtype: 'checkbox',
@@ -1610,8 +1609,7 @@ ProcessMapContext.prototype.caseTrackerProperties= function()
fieldLabel: 'Messages History',
name: 'CT_MESSAGE_HISTORY'
// checked:checkMessages
}
]
}]
});
var Propertieswindow = new Ext.Window({
@@ -1655,8 +1653,7 @@ ProcessMapContext.prototype.caseTrackerProperties= function()
handler: function(){
Propertieswindow.close();
}
}
]
}]
});
Propertieswindow.show();
}
@@ -1702,18 +1699,16 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
var assignedStore = new Ext.data.JsonStore({
root : 'data',
totalProperty: 'totalCount',
totalProperty : 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : ObjectFields,
proxy: new Ext.data.HttpProxy({
url: 'proxyCaseTrackerObjects?pid='+pro_uid
proxy : new Ext.data.HttpProxy({
url : 'proxyCaseTrackerObjects?pid='+pro_uid
})
});
//taskUsers.setDefaultSort('LABEL', 'asc');
assignedStore.load();
// create the Data Store of users that are not assigned to a task
var availableStore = new Ext.data.JsonStore({
root : 'data',
url : 'proxyCaseTrackerObjects?tid='+pro_uid,
@@ -1731,12 +1726,11 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
handler: function(){
var User = Objectsgrid.getStore();
var e = new ObjectFields({
OBJECT_TITLE:'',
OBJECT_TYPE:'',
OBJECT_UID: ''
OBJECT_TITLE :'',
OBJECT_TYPE :'',
OBJECT_UID : ''
});
//storeUsers.reload();
if(availableStore.data.items.length == 0)
Ext.MessageBox.alert ('Status','No users are available. All users have been already assigned.');
else
@@ -1826,15 +1820,15 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
editor: new Ext.form.ComboBox({
xtype: 'combo',
store:availableStore,
fieldLabel: 'Title',
hiddenName: 'number',
fieldLabel : 'Title',
hiddenName : 'number',
displayField : 'OBJECT_TITLE' ,
valueField : 'OBJECT_TITLE',
name : 'OBJECT_TITLE',
triggerAction: 'all',
emptyText: 'Select User or Group',
allowBlank: false,
onSelect: function(record, index){
emptyText : 'Select User or Group',
allowBlank : false,
onSelect : function(record, index){
var User = Objectsgrid.getStore();
var selectedrowIndex = '0';
User.data.items[selectedrowIndex].data.OBJECT_UID = record.data.OBJECT_UID;
@@ -1844,29 +1838,22 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
this.collapse();
}
})
},
{
header: 'Type',
dataIndex: 'CTO_TYPE_OBJ',
//width: 200,
editable: false
},
{
header: 'Condition',
dataIndex: 'CTO_CONDITION',
name: 'CTO_CONDITION',
//width: 200,
},{
header : 'Type',
dataIndex : 'CTO_TYPE_OBJ',
editable : false
},{
header : 'Condition',
dataIndex : 'CTO_CONDITION',
name : 'CTO_CONDITION',
editable: true,
editor: new Ext.form.TextField({
allowBlank: true
})
},
{
},{
header: 'Assign Condition',
//width: 50,
renderer: function(val){return '<input type="button" value="@@" id="'+val+'"/>';}
}
],
}],
sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
@@ -1924,20 +1911,7 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
}
});
//Updating the user incase if already assigned user has been replaced by other user
/*if(changes != '' && typeof record.json != 'undefined')
{
var user_TURel = record.json.TU_RELATION;
var userUID = record.json.USR_UID;
var user_TUtype = record.json.TU_TYPE;
urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}';
Ext.Ajax.request({
url : 'processes_Ajax.php' +urlparams ,
success: function(response) {
//Ext.MessageBox.alert ('Status','User has been updated successfully.');
}
});
}*/
assignedStore.reload();
availableStore.reload();
@@ -2016,6 +1990,7 @@ ProcessMapContext.prototype.ExtVariables = function()
bodyStyle :'padding:5px 5px 0',
width : 400,
height : 350,
renderer: function(val){return '<table border=1> <tr> <td> @@ </td> <td> Replace the value in quotes </td> </tr> </table>';},
items:
{
xtype:'tabpanel',
@@ -2051,7 +2026,7 @@ ProcessMapContext.prototype.ExtVariables = function()
title:'System',
id:'system',
layout:'form',
listeners: {
listeners:{
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
@@ -2095,12 +2070,14 @@ ProcessMapContext.prototype.ExtVariables = function()
}]
}]
}
});
var window = new Ext.Window({
title: 'Steps Of',
collapsible: false,
maximizable: false,
scrollable: true,
width: 400,
height: 350,
minWidth: 200,
@@ -2109,7 +2086,10 @@ ProcessMapContext.prototype.ExtVariables = function()
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: varForm
items: [varForm]
/*buttons: [{
text: 'Save',
handler: function(){

View File

@@ -710,8 +710,7 @@ ProcessOptions.prototype.dbConnection = function()
this.setValue(record.data[this.valueField || this.displayField]);
this.collapse();
}
},
{
},{
xtype: 'fieldset',
id: 'encode',
border:false,
@@ -770,11 +769,8 @@ ProcessOptions.prototype.dbConnection = function()
{name:'eucjpms', value:'eucjpms'}
]})
}]
//displayField: 'name',
//emptyText : 'Select Format',
// valueField : 'value',
// value : 'Select'
}, {
},{
xtype: 'fieldset',
id: 'postgre',
border:false,
@@ -831,11 +827,7 @@ ProcessOptions.prototype.dbConnection = function()
{name:"WIN1258", value:"WIN1258"}
]})
}]
//displayField: 'name',
//emptyText : 'Select Format',
// valueField : 'value',
// value : 'Select'
}, {
},{
xtype: 'fieldset',
id: 'sqlserver',
border:false,
@@ -844,7 +836,6 @@ ProcessOptions.prototype.dbConnection = function()
xtype: 'combo',
width: 150,
mode: 'local',
// hidden: true,
editable: false,
fieldLabel: 'Encode',
triggerAction: 'all',
@@ -859,17 +850,13 @@ ProcessOptions.prototype.dbConnection = function()
{name:'utf8', value: 'utf8'}
]})
}]
//displayField: 'name',
//emptyText : 'Select Format',
// valueField : 'value',
// value : 'Select'
}, {
},{
xtype: 'textfield',
fieldLabel: 'Server',
name: 'DBS_SERVER',
allowBlank: false
}, {
},{
xtype: 'textfield',
fieldLabel: 'Database name',
name: 'DBS_DATABASE_NAME',
@@ -879,18 +866,18 @@ ProcessOptions.prototype.dbConnection = function()
fieldLabel: 'Username',
name: 'DBS_USERNAME',
allowBlank: false
}, {
},{
xtype: 'textfield',
fieldLabel: 'Password',
name: 'DBS_PASSWORD',
allowBlank: true
}, {
},{
xtype: 'textfield',
fieldLabel: 'Port',
name: 'DBS_PORT',
id:'port',
allowBlank: false
}, {
},{
xtype: 'textarea',
fieldLabel: 'Description',
name: 'DBS_DESCRIPTION',
@@ -903,7 +890,7 @@ ProcessOptions.prototype.dbConnection = function()
]
})
var formWindow = new Ext.Window({
var formWindow = new Ext.Window({
title: 'Add new Database Source',
collapsible: false,
maximizable: true,
@@ -943,7 +930,6 @@ var formWindow = new Ext.Window({
port :Port,
desc :Description,
action :'saveConnection'
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Saved Successfully.');
@@ -971,11 +957,6 @@ var formWindow = new Ext.Window({
}
});
}
//var getData = getstore.data.items;
//taskExtObj.saveTaskUsers(getData);
formWindow.close();
dbStore.reload();
}
@@ -2279,8 +2260,8 @@ var formWindow = new Ext.Window({
var Type = getForm.REP_TAB_TYPE;
var Grid = getForm.REP_TAB_GRID;
var Fields = getForm.FIELDS;
var VariableName = getForm.REP_VAR_NAME;
var VariableType = getForm.REP_VAR_TYPE;
// var VariableName = getForm.REP_VAR_NAME;
// var VariableType = getForm.REP_VAR_TYPE;
var Connection = getForm.REP_TAB_CONNECTION
@@ -2289,14 +2270,14 @@ var formWindow = new Ext.Window({
method: 'POST',
params:{
PRO_UID :pro_uid,
REP_TAB_UID :'',
REP_TAB_UID :tableUID,
REP_TAB_TITLE :Title,
REP_TAB_NAME :Name,
REP_TAB_TYPE :Type ,
REP_TAB_GRID :Grid,
FIELDS :Fields,
REP_VAR_NAME : VariableName,
REP_VAR_TYPE : VariableType,
//REP_VAR_NAME : VariableName,
//REP_VAR_TYPE : VariableType,
REP_TAB_CONNECTION: Connection
},