fixed DB connection issue,added EDIT process permission option

This commit is contained in:
safan
2011-02-02 10:56:23 +00:00
parent 79f9837b9c
commit 8bfa1e1607
6 changed files with 142 additions and 45 deletions

View File

@@ -158,6 +158,10 @@ if ( isset ($_REQUEST['action']) ) {
$sOutput = $oTask->update($aData);
echo $sOutput;
break;
case 'editObjectPermission':
// we also need the process uid variable for the function.
$oProcessMap->editObjectPermission($oData->op_uid,$oData->pro_uid);
break;
case 'triggersList':
$sOutput = $oProcessMap->getTriggers($oData->pro_uid);
$sOutput = $oJSON->encode($sOutput);

View File

@@ -61,6 +61,11 @@ switch($_GET['action'])
array_shift($rows);
break;
case 'editObjectPermission':
$rows = $oProcessMap->editExtObjectPermission($_GET['op_uid'],$_GET['pid']);
array_shift($rows);
break;
case 'editOutputDocument':
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
@@ -195,6 +200,7 @@ switch($_GET['action'])
$rows[$key] = 'Work Days';
else if($key == 'TAS_TYPE_DAY' && $value == '2')
$rows[$key] = 'Calendar Days';
if($key == 'TAS_TYPE' && $value == 'NORMAL')
$rows[$key] = false;
else if($key == 'TAS_TYPE' && $value == 'ADHOC')
@@ -214,4 +220,4 @@ switch($_GET['action'])
$result = $tmpData;
echo $result;
?>
?>

View File

@@ -36,6 +36,9 @@ if( isset($_POST['action']) ){
throw new Exception('dbconnections Fatal error, No action defined!...');
}
if(isset($_POST['PROCESS']))
$_SESSION['PROCESS'] = $_POST['PROCESS'];
#Global Definitions
require_once 'classes/model/DbSource.php';
require_once 'classes/model/Content.php';

View File

@@ -426,27 +426,85 @@ var PermissionGridColumn = new Ext.grid.ColumnModel({
}
]
});
var editor = new Ext.ux.grid.RowEditor({
saveText: 'Update'
});
var btnCreate = new Ext.Button({
id: 'btnCreate',
text: 'New',
iconCls: 'application_add',
handler: function () {
formWindow.show();
PermissionForm.getForm().reset();
}
});
var btnEdit = new Ext.Button({
id: 'btnEdit',
text: 'Edit',
iconCls: 'application_add',
handler: function (s) {
var selectedRow = PermissionGrid.getSelectionModel().getSelections();
var opUID = selectedRow[0].data.OP_UID;
//Loading Task Details into the form
PermissionForm.form.load({
url:'proxyExtjs.php?pid='+pro_uid+'&op_uid=' +opUID+'&action=editObjectPermission',
method:'GET',
waitMsg:'Loading',
success:function(form, action) {
//Ext.MessageBox.alert('Message', 'Loaded OK');
formWindow.show();
//Ext.getCmp("OP_UID").setValue(opUID);
},
failure:function(form, action) {
Ext.MessageBox.alert('Message', 'Load failed');
}
});
}
})
var tb = new Ext.Toolbar({
items: [btnCreate]
});
var btnAdd = new Ext.Button({
id: 'btnAdd',
text: 'New',
iconCls: 'application_add',
handler: function () {
PermissionForm.getForm().reset();
formWindow.show();
var btnRemove = new Ext.Button({
id: 'btnRemove',
text: 'Delete',
iconCls: 'application_delete',
handler: function (s) {
editor.stopEditing();
var s = PermissionGrid.getSelectionModel().getSelections();
for(var i = 0, r; r = s[i]; i++){
//First Deleting process permission from Database using Ajax
var opUID = r.data.OP_UID;
//if OP_UID is properly defined (i.e. set to valid value) then only delete the row
//else its a BLANK ROW for which Ajax should not be called.
if(r.data.OP_UID != "")
{
Ext.Ajax.request({
url : '../inputdocs/inputdocs_Delete.php',
method: 'POST',
params: {
functions : 'deleteInputDocument',
OP_UID : opUID
},
success: function(response) {
Ext.MessageBox.alert ('Status','Process Permission has been removed successfully.');
//Secondly deleting from Grid
PermissionStore.remove(r);
//reloading store after deleting input document
PermissionStore.reload();
}
});
}
else
PermissionStore.remove(r);
}
}
})
});
var tb = new Ext.Toolbar({
items: [btnCreate,btnRemove,btnEdit]
});
var PermissionGrid = new Ext.grid.GridPanel({
store: PermissionStore,
@@ -690,6 +748,7 @@ var tb = new Ext.Toolbar({
xtype: 'fieldset',
id : 'dynaform',
hidden: true,
border: false,
items: [{
xtype: 'combo',
fieldLabel: 'Dynaform',
@@ -714,6 +773,7 @@ var tb = new Ext.Toolbar({
xtype: 'fieldset',
id : 'inputdoc',
hidden: true,
border: false,
items: [{
xtype: 'combo',
fieldLabel: 'Input Document',
@@ -738,6 +798,7 @@ var tb = new Ext.Toolbar({
xtype: 'fieldset',
id : 'outputdoc',
hidden: true,
border: false,
items: [{
xtype: 'combo',
fieldLabel: 'Output Document',
@@ -804,7 +865,8 @@ var tb = new Ext.Toolbar({
}
], buttons: [{
],
buttons: [{
text: 'Create',
formBind :true,
handler: function(){

View File

@@ -363,7 +363,7 @@ ProcessOptions.prototype.addDynaform= function(_5625)
{
xtype : 'textfield',
fieldLabel: 'Title',
name : 'DYN_TITLE',
name : 'DYN_TITLE'
// allowBlank: false
},{
xtype : 'textarea',
@@ -895,6 +895,8 @@ ProcessOptions.prototype.dbConnection = function()
var Password = getForm.DBS_PASSWORD;
var Port = getForm.DBS_PORT;
var Description = getForm.DBS_DESCRIPTION;
var encode = getForm.DBS_ENCODE;
if(dbConnUID=='')
{
@@ -910,6 +912,8 @@ ProcessOptions.prototype.dbConnection = function()
passwd :Password,
port :Port,
desc :Description,
PROCESS :pro_uid,
enc :encode,
action :'saveConnection'
},
success: function(response) {
@@ -930,7 +934,9 @@ ProcessOptions.prototype.dbConnection = function()
user :Username ,
passwd :Password,
port :Port,
PROCESS :pro_uid,
desc :Description,
enc :encode,
action :'saveEditConnection'
},
success: function(response) {
@@ -1082,8 +1088,8 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
text: 'New',
iconCls: 'application_add',
handler: function () {
inputDocForm.getForm().reset();
newIOWindow.show();
inputDocForm.getForm().reset();
}
});
@@ -2051,6 +2057,10 @@ ProcessOptions.prototype.addReportTable= function(_5625)
{
name: 'FIELD_NAME',
type: 'string'
},
{
name: 'FIELD_UID',
type: 'string'
}
]);
@@ -2069,6 +2079,18 @@ ProcessOptions.prototype.addReportTable= function(_5625)
})
});
reportStore.load();
var reportTableTypeStore = new Ext.data.JsonStore({
root : 'data',
totalProperty: 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : reportFields,
proxy : new Ext.data.HttpProxy({
url : 'proxyExtjs?pid='+pro_uid+'&type=NORMAL&action=getReportTableType'
})
});
reportTableTypeStore.load();
var reportColumns = new Ext.grid.ColumnModel({
columns: [
@@ -2091,8 +2113,8 @@ ProcessOptions.prototype.addReportTable= function(_5625)
text: 'New',
iconCls: 'application_add',
handler: function () {
reportForm.getForm().reset();
formWindow.show();
reportForm.getForm().reset();
}
});
@@ -2144,7 +2166,7 @@ ProcessOptions.prototype.addReportTable= function(_5625)
//Secondly deleting from Grid
reportGrid.remove(r);
//Reloading store after deleting report table
reportGrid.reload();
reportStore.reload();
}
});
}
@@ -2226,7 +2248,7 @@ var reportForm =new Ext.FormPanel({
name: 'REP_TAB_TYPE',
displayField: 'name',
valueField : 'value',
value : 'global',
value : 'Global',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
@@ -2245,9 +2267,9 @@ var reportForm =new Ext.FormPanel({
Ext.getCmp("gridfields").show();
Ext.getCmp("fields").hide();
}
var link = 'proxyReportTables?pid='+pro_uid+'&type='+record.data.value+'&action=getReportTableType';
reportStore.proxy.setUrl(link, true);
reportStore.load();
var link = 'proxyExtjs?pid='+pro_uid+'&type='+record.data.value+'&action=getReportTableType';
reportTableTypeStore.proxy.setUrl(link, true);
reportTableTypeStore.load();
this.setValue(record.data[this.valueField || this.displayField]);
this.collapse();
@@ -2269,9 +2291,9 @@ var reportForm =new Ext.FormPanel({
forceSelection: false,
dataIndex : 'FIELD_NAME',
name: 'FIELDS',
valueField: 'FIELD_NAME',
valueField: 'FIELD_UID',
displayField: 'FIELD_NAME',
store: reportStore
store: reportTableTypeStore
}]
}, {
xtype: 'fieldset',
@@ -2357,7 +2379,7 @@ var reportForm =new Ext.FormPanel({
});
}
formWindow.hide();
reportStore.reload();
//reportStore.reload();
}
},{
@@ -2376,13 +2398,12 @@ var formWindow = new Ext.Window({
width: 400,
//autoHeight: true,
height: 400,
//layout: 'fit',
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: reportForm
});
gridWindow.show();
//gridWindow.show();
}

View File

@@ -1264,23 +1264,7 @@ TaskContext.prototype.editTaskProperties= function()
}]
}
],buttons: [{
text: 'Save',
formBind :true,
handler: function(){
//var getstore = taskPropertiesTabs.getStore();
//var getData = getstore.data.items;
taskExtObj.saveTaskProperties();
window.hide();
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
window.hide();
}
}]
]
}
});
@@ -1353,7 +1337,24 @@ TaskContext.prototype.editTaskProperties= function()
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: taskPropertiesTabs
items: taskPropertiesTabs,
buttons: [{
text: 'Save',
formBind :true,
handler: function(){
//var getstore = taskPropertiesTabs.getStore();
//var getData = getstore.data.items;
taskExtObj.saveTaskProperties();
window.hide();
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
window.hide();
}
}]
});
window.show();