first commit to assign ad hoc actors to tasks
This commit is contained in:
@@ -203,13 +203,9 @@ class ProcessProxy extends HttpProxyController
|
|||||||
function getActorsTask($httpData)
|
function getActorsTask($httpData)
|
||||||
{
|
{
|
||||||
require_once 'classes/model/TaskUser.php';
|
require_once 'classes/model/TaskUser.php';
|
||||||
G::LoadClass('configuration');
|
|
||||||
$usersTaskList = Array();
|
$usersTaskList = Array();
|
||||||
$task = new TaskUser;
|
$task = new TaskUser();
|
||||||
$conf = new Configurations;
|
$usersTask = $task->getUsersTask($httpData->tas_uid, $httpData->tu_type);
|
||||||
$TU_TYPE = 1;
|
|
||||||
|
|
||||||
$usersTask = $task->getUsersTask($httpData->tas_uid, $TU_TYPE);
|
|
||||||
|
|
||||||
foreach($usersTask->data as $userTask) {
|
foreach($usersTask->data as $userTask) {
|
||||||
$usersTaskListItem['TAS_UID'] = $userTask['TAS_UID'];
|
$usersTaskListItem['TAS_UID'] = $userTask['TAS_UID'];
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
var saveProcess;
|
var saveProcess;
|
||||||
var usersPanel;
|
var usersPanel;
|
||||||
var _TAS_UID;
|
var _TAS_UID;
|
||||||
|
var _TU_TYPE;
|
||||||
var processObj;
|
var processObj;
|
||||||
var ProcessMapObj;
|
var ProcessMapObj;
|
||||||
|
|
||||||
@@ -457,6 +458,21 @@ Ext.onReady ( function() {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
tbar:[
|
||||||
|
{
|
||||||
|
text: 'AD HOC',
|
||||||
|
icon:'/images/cases-folders.png',
|
||||||
|
id: 'adHocPress',
|
||||||
|
enableToggle: true,
|
||||||
|
toggleHandler: function(item, pressed){
|
||||||
|
///alert(item.id);
|
||||||
|
},
|
||||||
|
allowDepress: true,
|
||||||
|
pressed: false,
|
||||||
|
handler: function(){
|
||||||
|
//alert(Ext.getCmp('adHocPress').pressed);
|
||||||
|
}
|
||||||
|
}],
|
||||||
tools: [
|
tools: [
|
||||||
/*{
|
/*{
|
||||||
id:'help',
|
id:'help',
|
||||||
@@ -485,20 +501,20 @@ Ext.onReady ( function() {
|
|||||||
usersPanel._targetTask = null;
|
usersPanel._targetTask = null;
|
||||||
|
|
||||||
usersPanel._onDrop = function(ddSource, e, data) {
|
usersPanel._onDrop = function(ddSource, e, data) {
|
||||||
|
var type = Ext.getCmp('usersPanelTabs').getActiveTab().id == 'usersGrid' ? 1 : 2;
|
||||||
|
var records = ddSource.dragData.selections;
|
||||||
|
var uids = Array();
|
||||||
_TAS_UID = Ext.getCmp('usersPanel')._targetTask.id;
|
_TAS_UID = Ext.getCmp('usersPanel')._targetTask.id;
|
||||||
|
_TU_TYPE = Ext.getCmp('adHocPress').pressed ? 2 : 1;
|
||||||
|
|
||||||
if( typeof parent != 'undefined' ) {
|
if( typeof parent != 'undefined' ) {
|
||||||
parent._TAS_UID = _TAS_UID;
|
parent._TAS_UID = _TAS_UID;
|
||||||
}
|
}
|
||||||
|
|
||||||
var type = Ext.getCmp('usersPanelTabs').getActiveTab().id == 'usersGrid' ? 1 : 2;
|
|
||||||
var records = ddSource.dragData.selections;
|
|
||||||
var uids = Array();
|
|
||||||
Ext.each(records, function(gridRow){
|
Ext.each(records, function(gridRow){
|
||||||
if( type == 1 ) {//some users grid items were dropped
|
if( type == 1 ) {//some users grid items were dropped
|
||||||
//alert('usr_uid ->'+gridRow.data.USR_UID);
|
|
||||||
uids.push(gridRow.data.USR_UID);
|
uids.push(gridRow.data.USR_UID);
|
||||||
} else { //some groups grid items were dropped
|
} else { //some groups grid items were dropped
|
||||||
//alert('grp_uid ->'+gridRow.data.GRP_UID);
|
|
||||||
uids.push(gridRow.data.GRP_UID);
|
uids.push(gridRow.data.GRP_UID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -519,11 +535,16 @@ Ext.onReady ( function() {
|
|||||||
PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg);
|
PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg);
|
||||||
|
|
||||||
if( typeof parent != 'undefined' ) {
|
if( typeof parent != 'undefined' ) {
|
||||||
var tu_type = '';
|
|
||||||
parent.Ext.getCmp('eastPanel').show();
|
parent.Ext.getCmp('eastPanel').show();
|
||||||
parent.Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = '';
|
parent.Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = '';
|
||||||
|
parent.Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = '';
|
||||||
|
if( _TU_TYPE == 1 ) {
|
||||||
parent.Ext.getCmp('usersPanelTabs').setActiveTab(1);
|
parent.Ext.getCmp('usersPanelTabs').setActiveTab(1);
|
||||||
parent.Ext.getCmp('usersTaskGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: tu_type}});
|
parent.Ext.getCmp('usersTaskGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: 1}});
|
||||||
|
} else {
|
||||||
|
parent.Ext.getCmp('usersPanelTabs').setActiveTab(2);
|
||||||
|
parent.Ext.getCmp('usersTaskAdHocGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: 2}});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PMExt.error(_('ID_ERROR'), result.msg)
|
PMExt.error(_('ID_ERROR'), result.msg)
|
||||||
@@ -532,8 +553,8 @@ Ext.onReady ( function() {
|
|||||||
failure: function(){},
|
failure: function(){},
|
||||||
params: {
|
params: {
|
||||||
TAS_UID : _TAS_UID,
|
TAS_UID : _TAS_UID,
|
||||||
|
TU_TYPE : _TU_TYPE,
|
||||||
TU_RELATION : type,
|
TU_RELATION : type,
|
||||||
TU_TYPE : 1,
|
|
||||||
UIDS : uids
|
UIDS : uids
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
var _TAS_UID;
|
var _TAS_UID;
|
||||||
|
var updateActorsGrids;
|
||||||
var processObj;
|
var processObj;
|
||||||
|
|
||||||
|
|
||||||
Ext.onReady ( function() {
|
Ext.onReady ( function() {
|
||||||
new Ext.KeyMap(document, {
|
new Ext.KeyMap(document, {
|
||||||
key: Ext.EventObject.F5,
|
key: Ext.EventObject.F5,
|
||||||
@@ -108,9 +110,71 @@ Ext.onReady ( function() {
|
|||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
usersTaskGrid.on('keypress', function (e) {
|
//AD HOC
|
||||||
alert(e.getKey());
|
var usersTaskAdHocStore = new Ext.data.GroupingStore( {
|
||||||
}, this);
|
autoLoad: false,
|
||||||
|
url: '../processProxy/getActorsTask',
|
||||||
|
reader : new Ext.data.JsonReader({
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
root: 'data',
|
||||||
|
fields : [
|
||||||
|
{name : 'USR_UID'},
|
||||||
|
{name : 'USR_USERNAME'},
|
||||||
|
{name : 'USR_FIRSTNAME'},
|
||||||
|
{name : 'USR_LASTNAME'},
|
||||||
|
{name : 'NAME'},
|
||||||
|
{name : 'TU_RELATION'}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
baseParams: {tas_uid: '', tu_type: ''},
|
||||||
|
groupField: 'TU_RELATION'
|
||||||
|
});
|
||||||
|
|
||||||
|
var usersTaskAdHocGrid = new Ext.grid.GridPanel({
|
||||||
|
id : 'usersTaskAdHocGrid',
|
||||||
|
title : _('ID_AD_HOC_ACTORS'),
|
||||||
|
height : 180,
|
||||||
|
stateful : true,
|
||||||
|
stateId : 'usersTaskAdHocGrid',
|
||||||
|
sortable:false,
|
||||||
|
view: new Ext.grid.GroupingView({
|
||||||
|
forceFit:true,
|
||||||
|
groupTextTpl: '{[values.rs.length]} {[values.rs[0].data["TU_RELATION"] == 1 ? "Users" : "Groups"]}'
|
||||||
|
}),
|
||||||
|
cm : new Ext.grid.ColumnModel({
|
||||||
|
defaults: {
|
||||||
|
width: 300,
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
columns : [
|
||||||
|
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
||||||
|
{header: 'Assigned', id:'TU_RELATION', dataIndex: 'TU_RELATION', hidden:true, 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: usersTaskAdHocStore,
|
||||||
|
listeners: {
|
||||||
|
render: function(){
|
||||||
|
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')});
|
||||||
|
}
|
||||||
|
}/*,
|
||||||
|
tbar:[
|
||||||
|
'->', {
|
||||||
|
text: _('ID_REMOVE'),
|
||||||
|
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||||
|
handler: removeUsersTask
|
||||||
|
}
|
||||||
|
]*/,
|
||||||
|
bbar: [new Ext.PagingToolbar({
|
||||||
|
pageSize : 10,
|
||||||
|
store : usersTaskStore,
|
||||||
|
displayInfo: true,
|
||||||
|
displayMsg : '{2} Users',
|
||||||
|
emptyMsg : ''
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function onDynaformsContextMenu(grid, rowIndex, e) {
|
function onDynaformsContextMenu(grid, rowIndex, e) {
|
||||||
@@ -129,6 +193,10 @@ Ext.onReady ( function() {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateActorsGrids = function(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function removeUsersTask(){
|
function removeUsersTask(){
|
||||||
|
|
||||||
var usr_uid = Array();
|
var usr_uid = Array();
|
||||||
@@ -200,13 +268,15 @@ Ext.onReady ( function() {
|
|||||||
eastPanelTree.getSelectionModel().on('selectionchange', function(tree, node){
|
eastPanelTree.getSelectionModel().on('selectionchange', function(tree, node){
|
||||||
if( node.attributes.type == 'task') {
|
if( node.attributes.type == 'task') {
|
||||||
_TAS_UID = node.attributes.id;
|
_TAS_UID = node.attributes.id;
|
||||||
tu_type = '';
|
|
||||||
|
|
||||||
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = '';
|
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = '';
|
||||||
Ext.getCmp('usersTaskGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: tu_type}});
|
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = '';
|
||||||
|
Ext.getCmp('usersTaskGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: 1}});
|
||||||
|
Ext.getCmp('usersTaskAdHocGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: 2}});
|
||||||
} else {
|
} else {
|
||||||
Ext.getCmp('usersPanelTabs').setActiveTab(0);
|
Ext.getCmp('usersPanelTabs').setActiveTab(0);
|
||||||
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none';
|
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none';
|
||||||
|
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = 'none';
|
||||||
}
|
}
|
||||||
propertyStore.reload({params: {
|
propertyStore.reload({params: {
|
||||||
action : 'getProperties',
|
action : 'getProperties',
|
||||||
@@ -417,7 +487,8 @@ Ext.onReady ( function() {
|
|||||||
//height : 318,
|
//height : 318,
|
||||||
items : [
|
items : [
|
||||||
propertiesGrid,
|
propertiesGrid,
|
||||||
usersTaskGrid
|
usersTaskGrid,
|
||||||
|
usersTaskAdHocGrid
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
@@ -638,7 +709,9 @@ Ext.onReady ( function() {
|
|||||||
items:[main]
|
items:[main]
|
||||||
});
|
});
|
||||||
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none';
|
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none';
|
||||||
|
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = 'none';
|
||||||
//Ext.getCmp('eastPanel').hide();
|
//Ext.getCmp('eastPanel').hide();
|
||||||
//Ext.getCmp('eastPanel').ownerCt.doLayout();
|
//Ext.getCmp('eastPanel').ownerCt.doLayout();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 762 B |
Reference in New Issue
Block a user