BUG 6788 Ad Hoc Assignment within a Task does not work
improving the code
This commit is contained in:
@@ -712,111 +712,109 @@ Ext.onReady(function(){
|
|||||||
|
|
||||||
/*-----added by krlos------------*/
|
/*-----added by krlos------------*/
|
||||||
Actions.adhocAssignmentUsers = function()
|
Actions.adhocAssignmentUsers = function()
|
||||||
{
|
{
|
||||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||||
Ext.QuickTips.init();
|
Ext.QuickTips.init();
|
||||||
store = new Ext.data.GroupingStore( {
|
store = new Ext.data.GroupingStore( {
|
||||||
proxy : new Ext.data.HttpProxy({
|
proxy : new Ext.data.HttpProxy({
|
||||||
url: '../adhocUserProxy/adhocAssignUsersk'//,
|
url : '../adhocUserProxy/adhocAssignUsersk'
|
||||||
//method: 'POST'
|
}),
|
||||||
}),
|
reader : new Ext.data.JsonReader( {
|
||||||
|
root: 'data',
|
||||||
reader : new Ext.data.JsonReader( {
|
fields : [
|
||||||
root: 'data',
|
{name : 'USR_UID'},
|
||||||
fields : [
|
{name : 'USR_FIRSTNAME'},
|
||||||
{name : 'USR_UID'},
|
{name : 'USR_LASTNAME'}
|
||||||
{name : 'USR_FIRSTNAME'},
|
]
|
||||||
{name : 'USR_LASTNAME'}
|
})
|
||||||
]
|
});
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
cmk = new Ext.grid.ColumnModel({
|
cmk = new Ext.grid.ColumnModel({
|
||||||
defaults: {
|
defaults: {
|
||||||
width: 40,
|
width: 40,
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{ id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
{ id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
||||||
{ header : "First Name", dataIndex : 'USR_FIRSTNAME', sortable : true, width: 130, align:'center'},
|
{ header : "First Name", dataIndex : 'USR_FIRSTNAME', sortable : true, width: 130, align:'center'},
|
||||||
{ header : "Last Name", dataIndex : 'USR_LASTNAME', sortable : true,width: 130, align:'center' }
|
{ header : "Last Name", dataIndex : 'USR_LASTNAME', sortable : true,width: 130, align:'center' }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
pbark = new Ext.PagingToolbar({
|
pbark = new Ext.PagingToolbar({
|
||||||
pageSize: 8,
|
pageSize: 8,
|
||||||
store: store,
|
store: store,
|
||||||
displayInfo: true,
|
displayInfo: true,
|
||||||
displayMsg: 'Displaying Users {0} - {1} of {2}',
|
displayMsg: 'Displaying Users {0} - {1} of {2}',
|
||||||
emptyMsg: "",
|
emptyMsg: "",
|
||||||
items:[]
|
items:[]
|
||||||
});
|
});
|
||||||
|
|
||||||
var adHocUserGrid = new Ext.grid.GridPanel( {
|
var adHocUserGrid = new Ext.grid.GridPanel( {
|
||||||
region: 'center',
|
region: 'center',
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
id: 'adHocUserGrid',
|
id: 'adHocUserGrid',
|
||||||
height:210,
|
height:210,
|
||||||
//autoWidth : true,
|
//autoWidth : true,
|
||||||
width:'',
|
width:'',
|
||||||
title : '',
|
title : '',
|
||||||
stateful : true,
|
stateful : true,
|
||||||
stateId : 'grid',
|
stateId : 'grid',
|
||||||
enableColumnResize: true,
|
enableColumnResize: true,
|
||||||
enableHdMenu: true,
|
enableHdMenu: true,
|
||||||
frame:false,
|
frame:false,
|
||||||
columnLines: true,
|
columnLines: true,
|
||||||
viewConfig: {
|
viewConfig: {
|
||||||
forceFit:true
|
forceFit:true
|
||||||
},
|
},
|
||||||
cm: cmk,
|
cm: cmk,
|
||||||
store: store,
|
store: store,
|
||||||
tbar:[{text:_('ID_ASSIGN'), iconCls: 'silk-add', icon: '/images/cases-selfservice.png', handler: assignAdHocUser} ],
|
tbar:[{text:_('ID_ASSIGN'), iconCls: 'silk-add', icon: '/images/cases-selfservice.png', handler: assignAdHocUser} ],
|
||||||
bbar: '',
|
bbar: '',
|
||||||
listeners:{
|
listeners:{
|
||||||
rowdblclick: assignAdHocUser
|
rowdblclick: assignAdHocUser
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var w = new Ext.Window({
|
var w = new Ext.Window({
|
||||||
title: _('ID_ADHOC_ASSIGNMENT'),
|
title: _('ID_ADHOC_ASSIGNMENT'),
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 240,
|
height: 240,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
items: [ adHocUserGrid ],
|
items: [ adHocUserGrid ],
|
||||||
id: 'w'
|
id: 'w'
|
||||||
});
|
});
|
||||||
adHocUserGrid.store.load();
|
adHocUserGrid.store.load();
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
function assignAdHocUser(){
|
function assignAdHocUser(){
|
||||||
rowSelected = adHocUserGrid.getSelectionModel().getSelected();
|
rowSelected = adHocUserGrid.getSelectionModel().getSelected();
|
||||||
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_ADHOCUSER_CASE'), function(){
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_ADHOCUSER_CASE'), function(){
|
||||||
var loadMask = new Ext.LoadMask(document.body, {msg:'Assignment case...'});
|
var loadMask = new Ext.LoadMask(document.body, {msg:'Assignment case...'});
|
||||||
loadMask.show();
|
loadMask.show();
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url : '../adhocUserProxy/reassignCase' ,
|
url : '../adhocUserProxy/reassignCase' ,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
params : {USR_UID: rowSelected.data.USR_UID, THETYPE: 'ADHOC'},
|
params : {USR_UID: rowSelected.data.USR_UID, THETYPE: 'ADHOC'},
|
||||||
success: function ( result, request ) {
|
success: function ( result, request ) {
|
||||||
loadMask.hide();
|
loadMask.hide();
|
||||||
var data = Ext.util.JSON.decode(result.responseText);
|
var data = Ext.util.JSON.decode(result.responseText);
|
||||||
if( data.success ) {
|
if( data.success ) {
|
||||||
CloseWindow();
|
CloseWindow();
|
||||||
location.href = 'casesListExtJs';
|
location.href = 'casesListExtJs';
|
||||||
} else {
|
} else {
|
||||||
PMExt.error(_('ID_ERROR'), data.msg);
|
PMExt.error(_('ID_ERROR'), data.msg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
failure: function ( result, request) {
|
failure: function ( result, request) {
|
||||||
Ext.MessageBox.alert('Failed', result.responseText);
|
Ext.MessageBox.alert('Failed', result.responseText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CloseWindow = function(){
|
CloseWindow = function(){
|
||||||
Ext.getCmp('w').hide();
|
Ext.getCmp('w').hide();
|
||||||
};
|
};
|
||||||
/*-----added by krlos end------------*/
|
/*-----added by krlos end------------*/
|
||||||
/*Date.prototype.dateFormat = function(format) {
|
/*Date.prototype.dateFormat = function(format) {
|
||||||
|
|||||||
Reference in New Issue
Block a user