worked on process permission form
This commit is contained in:
@@ -5485,7 +5485,7 @@ class processMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function newExtObjectPermission($sProcessUID)
|
function newExtObjectPermission($sProcessUID,$sAction)
|
||||||
{
|
{
|
||||||
$aUsersGroups = array();
|
$aUsersGroups = array();
|
||||||
$aUsersGroups [] = array('UID' => 'char', 'LABEL' => 'char');
|
$aUsersGroups [] = array('UID' => 'char', 'LABEL' => 'char');
|
||||||
@@ -5561,13 +5561,23 @@ class processMap {
|
|||||||
}
|
}
|
||||||
global $_DBArray;
|
global $_DBArray;
|
||||||
$_DBArray = (isset($_SESSION ['_DBArray']) ? $_SESSION ['_DBArray'] : '');
|
$_DBArray = (isset($_SESSION ['_DBArray']) ? $_SESSION ['_DBArray'] : '');
|
||||||
$_DBArray ['usersGroups'] = $aUsersGroups;
|
|
||||||
$_DBArray ['allObjects'] = $aAllObjects;
|
switch($sAction){
|
||||||
$_DBArray ['allDynaforms'] = $aAllDynaforms;
|
case 'users':
|
||||||
$_DBArray ['allInputs'] = $aAllInputs;
|
return $aUsersGroups;
|
||||||
$_DBArray ['allOutputs'] = $aAllOutputs;
|
break;
|
||||||
$_SESSION ['_DBArray'] = $_DBArray;
|
case 'dynaform':
|
||||||
return $_SESSION['_DBArray']['usersGroups'];
|
return $aAllDynaforms;
|
||||||
|
break;
|
||||||
|
case 'input':
|
||||||
|
return $aAllInputs;
|
||||||
|
break;
|
||||||
|
case 'output':
|
||||||
|
return $aAllOutputs;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//return $_SESSION['_DBArray'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
G::LoadClass('processMap');
|
G::LoadClass('processMap');
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
$oProcessMap = new processMap(new DBConnection);
|
||||||
|
|
||||||
if ( isset($_GET['pid'] ) && !isset($_GET ['t']))
|
if ( isset($_GET['pid'] ) && !isset($_GET ['action']))
|
||||||
{
|
{
|
||||||
$rows = $oProcessMap->getExtObjectsPermissions($_GET['pid']);
|
$rows = $oProcessMap->getExtObjectsPermissions($_GET['pid']);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ( isset($_GET['pid'] )&& isset($_GET['t']) )
|
if ( isset($_GET['pid'] )&& isset($_GET['action']) )
|
||||||
{
|
{
|
||||||
$rows = $oProcessMap->newExtObjectPermission($_GET['pid']);
|
$rows = $oProcessMap->newExtObjectPermission($_GET['pid'],$_GET['action']);
|
||||||
|
array_shift($rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
$result['totalCount'] = count($rows);
|
||||||
|
|||||||
@@ -477,17 +477,65 @@ var PermissionGridColumn = new Ext.grid.ColumnModel({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var formStore = new Ext.data.JsonStore({
|
//Creating different stores required for fields in form
|
||||||
root : 'data',
|
var selectField = Ext.data.Record.create([
|
||||||
totalProperty: 'totalCount',
|
{ name: 'LABEL',type: 'string'},
|
||||||
idProperty : 'gridIndex',
|
{ name: 'UID',type: 'string'}
|
||||||
remoteSort : true,
|
]);
|
||||||
fields : dbConnFields,
|
var selectTaskStore = new Ext.data.JsonStore({
|
||||||
proxy: new Ext.data.HttpProxy({
|
root : 'data',
|
||||||
url: 'proxyObjectPermissions.php?pid='+pro_uid+'&t=1'
|
totalProperty: 'totalCount',
|
||||||
})
|
idProperty : 'gridIndex',
|
||||||
});
|
remoteSort : true,
|
||||||
formStore.load();
|
fields : selectField,
|
||||||
|
proxy: new Ext.data.HttpProxy({
|
||||||
|
url: 'proxyObjectPermissions.php?pid='+pro_uid+'&action=task'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var usersStore = new Ext.data.JsonStore({
|
||||||
|
root : 'data',
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
idProperty : 'gridIndex',
|
||||||
|
remoteSort : true,
|
||||||
|
fields : selectField,
|
||||||
|
proxy: new Ext.data.HttpProxy({
|
||||||
|
url: 'proxyObjectPermissions.php?pid='+pro_uid+'&action=users'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var dynaformStore = new Ext.data.JsonStore({
|
||||||
|
root : 'data',
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
idProperty : 'gridIndex',
|
||||||
|
remoteSort : true,
|
||||||
|
fields : selectField,
|
||||||
|
proxy: new Ext.data.HttpProxy({
|
||||||
|
url: 'proxyObjectPermissions.php?pid='+pro_uid+'&action=dynaform'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var inputDocStore = new Ext.data.JsonStore({
|
||||||
|
root : 'data',
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
idProperty : 'gridIndex',
|
||||||
|
remoteSort : true,
|
||||||
|
fields : selectField,
|
||||||
|
proxy: new Ext.data.HttpProxy({
|
||||||
|
url: 'proxyObjectPermissions.php?pid='+pro_uid+'&action=input'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var outputDocStore = new Ext.data.JsonStore({
|
||||||
|
root : 'data',
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
idProperty : 'gridIndex',
|
||||||
|
remoteSort : true,
|
||||||
|
fields : selectField,
|
||||||
|
proxy: new Ext.data.HttpProxy({
|
||||||
|
url: 'proxyObjectPermissions.php?pid='+pro_uid+'&action=output'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
var PermissionForm =new Ext.FormPanel({
|
var PermissionForm =new Ext.FormPanel({
|
||||||
// title:"Add new Database Source",
|
// title:"Add new Database Source",
|
||||||
@@ -498,8 +546,7 @@ var PermissionGridColumn = new Ext.grid.ColumnModel({
|
|||||||
plain: true,
|
plain: true,
|
||||||
bodyStyle: 'padding:5px;',
|
bodyStyle: 'padding:5px;',
|
||||||
buttonAlign: 'center',
|
buttonAlign: 'center',
|
||||||
|
items:[{
|
||||||
items:[{
|
|
||||||
width :150,
|
width :150,
|
||||||
xtype :'combo',
|
xtype :'combo',
|
||||||
mode :'local',
|
mode :'local',
|
||||||
@@ -519,71 +566,43 @@ var PermissionGridColumn = new Ext.grid.ColumnModel({
|
|||||||
{name : 'TO DO', value: '2'},
|
{name : 'TO DO', value: '2'},
|
||||||
{name : 'PAUSED', value: '3'},
|
{name : 'PAUSED', value: '3'},
|
||||||
{name : 'COMPLETED', value: '4'}]})
|
{name : 'COMPLETED', value: '4'}]})
|
||||||
},{
|
},
|
||||||
width :150,
|
new Ext.form.ComboBox({
|
||||||
xtype :'combo',
|
fieldLabel: 'Target Task',
|
||||||
mode :'local',
|
hiddenName:'popType',
|
||||||
editable :false,
|
autoload: true,
|
||||||
fieldLabel :'Target Task',
|
store: selectTaskStore,
|
||||||
triggerAction :'all',
|
valueField:'LABEL',
|
||||||
forceSelection : true,
|
displayField:'LABEL',
|
||||||
name :'TASK_TARGET',
|
triggerAction: 'all',
|
||||||
displayField :'name',
|
emptyText:'Select',
|
||||||
value :'All Tasks',
|
editable: true
|
||||||
valueField :'value',
|
}),
|
||||||
store :new Ext.data.JsonStore({
|
|
||||||
fields : ['name', 'value'],
|
new Ext.form.ComboBox({
|
||||||
data : [
|
|
||||||
{name : 'All tasks', value: '0'},
|
|
||||||
{name : 'Apply for leave', value: '1'},
|
|
||||||
{name : 'HR approval', value: '2'},
|
|
||||||
{name : 'Supervisor Approval', value: '3'}]})
|
|
||||||
},new Ext.form.ComboBox({
|
|
||||||
fieldLabel: 'Group or Users',
|
fieldLabel: 'Group or Users',
|
||||||
hiddenName:'popType',
|
hiddenName:'popType',
|
||||||
store: formStore,
|
autoload: true,
|
||||||
|
store: usersStore,
|
||||||
valueField:'LABEL',
|
valueField:'LABEL',
|
||||||
displayField:'LABEL',
|
displayField:'LABEL',
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText:'Select',
|
emptyText:'Select',
|
||||||
editable: true
|
editable: true
|
||||||
})
|
})
|
||||||
,/*{
|
,
|
||||||
width :150,
|
new Ext.form.ComboBox({
|
||||||
xtype :'combo',
|
fieldLabel: 'Origin Task',
|
||||||
mode :'local',
|
hiddenName:'popType',
|
||||||
editable :false,
|
autoload: true,
|
||||||
fieldLabel :'Group or Users',
|
store: selectTaskStore,
|
||||||
triggerAction :'all',
|
valueField:'LABEL',
|
||||||
forceSelection : true,
|
displayField:'LABEL',
|
||||||
name :'GROUP_USER',
|
triggerAction: 'all',
|
||||||
displayField :'name',
|
emptyText:'Select',
|
||||||
value :'Administrator(Admin)',
|
editable: true
|
||||||
valueField :'value',
|
}),
|
||||||
store :new Ext.data.JsonStore({
|
{
|
||||||
fields : ['name', 'value'],
|
|
||||||
data : [
|
|
||||||
{name : 'Administrator(Admin)', value: '0'}]})
|
|
||||||
},*/{
|
|
||||||
width :150,
|
|
||||||
xtype :'combo',
|
|
||||||
mode :'local',
|
|
||||||
editable :false,
|
|
||||||
fieldLabel :'Origin Task',
|
|
||||||
triggerAction :'all',
|
|
||||||
forceSelection : true,
|
|
||||||
name :'TASK_SOURCE',
|
|
||||||
displayField :'name',
|
|
||||||
value :'All Tasks',
|
|
||||||
valueField :'value',
|
|
||||||
store :new Ext.data.JsonStore({
|
|
||||||
fields : ['name', 'value'],
|
|
||||||
data : [
|
|
||||||
{name : 'All tasks', value: '0'},
|
|
||||||
{name : 'Apply for leave', value: '1'},
|
|
||||||
{name : 'HR approval', value: '2'},
|
|
||||||
{name : 'Supervisor Approval', value: '3'}]})
|
|
||||||
},{
|
|
||||||
width :150,
|
width :150,
|
||||||
xtype :'combo',
|
xtype :'combo',
|
||||||
mode :'local',
|
mode :'local',
|
||||||
@@ -619,7 +638,57 @@ var PermissionGridColumn = new Ext.grid.ColumnModel({
|
|||||||
{name : 'Dynaform', value: '1'},
|
{name : 'Dynaform', value: '1'},
|
||||||
{name : 'Input Document', value: '2'},
|
{name : 'Input Document', value: '2'},
|
||||||
{name : 'Output Document', value: '3'}]})
|
{name : 'Output Document', value: '3'}]})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'fieldset',
|
||||||
|
id : 'dynaform',
|
||||||
|
hidden: false,
|
||||||
|
items: [{
|
||||||
|
xtype: 'combo',
|
||||||
|
fieldLabel: 'Dynaform',
|
||||||
|
hiddenName:'popType',
|
||||||
|
autoload: true,
|
||||||
|
store: dynaformStore,
|
||||||
|
valueField:'LABEL',
|
||||||
|
displayField:'LABEL',
|
||||||
|
triggerAction: 'all',
|
||||||
|
emptyText:'Select',
|
||||||
|
editable: true
|
||||||
|
}]
|
||||||
},{
|
},{
|
||||||
|
xtype: 'fieldset',
|
||||||
|
id : 'inputdoc',
|
||||||
|
hidden: false,
|
||||||
|
items: [{
|
||||||
|
xtype: 'combo',
|
||||||
|
fieldLabel: 'Input Document',
|
||||||
|
hiddenName:'popType',
|
||||||
|
autoload: true,
|
||||||
|
store: inputDocStore,
|
||||||
|
valueField:'LABEL',
|
||||||
|
displayField:'LABEL',
|
||||||
|
triggerAction: 'all',
|
||||||
|
emptyText:'Select',
|
||||||
|
editable: true
|
||||||
|
}]
|
||||||
|
},{
|
||||||
|
xtype: 'fieldset',
|
||||||
|
id : 'outputdoc',
|
||||||
|
hidden: false,
|
||||||
|
items: [{
|
||||||
|
xtype: 'combo',
|
||||||
|
fieldLabel: 'Output Document',
|
||||||
|
hiddenName:'popType',
|
||||||
|
autoload: true,
|
||||||
|
store: outputDocStore,
|
||||||
|
valueField:'LABEL',
|
||||||
|
displayField:'LABEL',
|
||||||
|
triggerAction: 'all',
|
||||||
|
emptyText:'Select',
|
||||||
|
editable: true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
width :150,
|
width :150,
|
||||||
xtype :'combo',
|
xtype :'combo',
|
||||||
mode :'local',
|
mode :'local',
|
||||||
|
|||||||
Reference in New Issue
Block a user