2011-09-20 12:33:15 -04:00
|
|
|
new Ext.KeyMap(document, {
|
2015-06-11 11:27:12 -04:00
|
|
|
key: Ext.EventObject.F5,
|
2011-09-20 12:33:15 -04:00
|
|
|
fn: function(keycode, e) {
|
2015-06-11 11:27:12 -04:00
|
|
|
if (! e.ctrlKey) {
|
|
|
|
|
if (Ext.isIE) {
|
|
|
|
|
// IE6 doesn't allow cancellation of the F5 key, so trick it into
|
|
|
|
|
// thinking some other key was pressed (backspace in this case)
|
|
|
|
|
e.browserEvent.keyCode = 8;
|
|
|
|
|
}
|
|
|
|
|
e.stopEvent();
|
|
|
|
|
//document.location = document.location;
|
|
|
|
|
storeCases.reload();
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
else
|
|
|
|
|
Ext.Msg.alert(_('ID_REFRESH_LABEL'), _('ID_REFRESH_MESSAGE'));
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
});
|
|
|
|
|
|
2012-08-03 19:07:15 -04:00
|
|
|
|
2011-09-20 12:33:15 -04:00
|
|
|
/*** global variables **/
|
|
|
|
|
var storeCases;
|
|
|
|
|
var storeReassignCases;
|
|
|
|
|
var grid;
|
|
|
|
|
var textJump;
|
2013-03-28 10:45:26 -04:00
|
|
|
var ids = '';
|
2013-04-09 17:41:47 -04:00
|
|
|
var winReassignInCasesList;
|
2015-11-10 16:19:05 -04:00
|
|
|
var casesNewTab;
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2014-12-16 11:53:11 -04:00
|
|
|
function formatAMPM(date, initVal, calendarDate) {
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var currentDate = new Date();
|
|
|
|
|
var currentDay = currentDate.getDate();
|
|
|
|
|
var currentMonth = currentDate.getMonth()+1;
|
|
|
|
|
if (currentDay < 10) {
|
|
|
|
|
currentDay = '0' + currentDay;
|
|
|
|
|
}
|
|
|
|
|
if (currentMonth < 10) {
|
|
|
|
|
currentMonth = '0' + currentMonth;
|
|
|
|
|
}
|
|
|
|
|
currentDate = currentMonth + '-' + currentDay;
|
|
|
|
|
if (currentDate == calendarDate) {
|
|
|
|
|
var hours = date.getHours();
|
|
|
|
|
var minutes = (initVal === true)? ((date.getMinutes()<15)? 15: ((date.getMinutes()<30)? 30: ((date.getMinutes()<45)? 45: 45))): date.getMinutes();
|
|
|
|
|
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
|
|
|
hours = hours % 12;
|
|
|
|
|
hours = hours ? hours : 12; // the hour '0' should be '12'
|
|
|
|
|
minutes = minutes < 10 ? '0' + minutes : minutes;
|
|
|
|
|
var strTime = hours + ':' + minutes + ' ' + ampm;
|
|
|
|
|
} else {
|
|
|
|
|
var strTime = '12:00 AM';
|
|
|
|
|
}
|
|
|
|
|
return strTime;
|
2013-03-27 13:45:05 -04:00
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:22:40 -04:00
|
|
|
Ext.Ajax.timeout = 4 * 60 * 1000;
|
|
|
|
|
|
2011-09-20 12:33:15 -04:00
|
|
|
var caseSummary = function() {
|
2015-06-11 11:27:12 -04:00
|
|
|
var rowModel = grid.getSelectionModel().getSelected();
|
|
|
|
|
if (rowModel) {
|
|
|
|
|
openSummaryWindow(rowModel.data.APP_UID, rowModel.data.DEL_INDEX, action);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
msgBox(_('ID_INFORMATION'), _('ID_SELECT_ONE_AT_LEAST'));
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function caseNotes(){
|
2015-06-11 11:27:12 -04:00
|
|
|
var rowModel = grid.getSelectionModel().getSelected();
|
|
|
|
|
if(rowModel){
|
|
|
|
|
var appUid = rowModel.data.APP_UID;
|
|
|
|
|
var delIndex = rowModel.data.DEL_INDEX;
|
|
|
|
|
var caseTitle = (rowModel.data.APP_TITLE) ? rowModel.data.APP_TITLE : rowModel.data.APP_UID;
|
|
|
|
|
var task = (typeof(rowModel.json.TAS_UID) != 'undefined') ? rowModel.json.TAS_UID : '';
|
|
|
|
|
var proid = (typeof(rowModel.json.PRO_UID) != 'undefined') ? rowModel.json.PRO_UID : '';
|
|
|
|
|
|
|
|
|
|
openCaseNotesWindow(appUid, delIndex, true, caseTitle, proid, task);
|
|
|
|
|
}else{
|
|
|
|
|
msgBox(_('ID_INFORMATION'), _('ID_SELECT_ONE_AT_LEAST') );
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
function openCase(){
|
|
|
|
|
|
2016-03-08 18:37:38 -04:00
|
|
|
var rowModel = grid.getSelectionModel().getSelected(),
|
|
|
|
|
nameTab;
|
2011-09-20 12:33:15 -04:00
|
|
|
if(rowModel){
|
2015-06-11 11:27:12 -04:00
|
|
|
var appUid = rowModel.data.APP_UID;
|
|
|
|
|
var delIndex = rowModel.data.DEL_INDEX;
|
|
|
|
|
var caseTitle = (rowModel.data.APP_TITLE) ? rowModel.data.APP_TITLE : rowModel.data.APP_UID;
|
2016-04-14 11:44:26 -04:00
|
|
|
if(!isIE) {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
msg: _('ID_OPEN_CASE') + ' ' + caseTitle,
|
|
|
|
|
width:300,
|
|
|
|
|
wait:true,
|
|
|
|
|
waitConfig: {interval:200}
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
params = '';
|
|
|
|
|
switch(action){
|
|
|
|
|
case 'to_revise':
|
|
|
|
|
params += 'APP_UID=' + appUid;
|
|
|
|
|
params += '&DEL_INDEX=' + delIndex;
|
|
|
|
|
params += '&to_revise=true';
|
|
|
|
|
requestFile = 'open';
|
|
|
|
|
break;
|
|
|
|
|
case 'sent': // = participated
|
|
|
|
|
params += 'APP_UID=' + appUid;
|
|
|
|
|
params += '&DEL_INDEX=' + delIndex;
|
|
|
|
|
//requestFile = '../cases/cases_Open';
|
|
|
|
|
requestFile = 'open';
|
|
|
|
|
break;
|
|
|
|
|
case 'todo':
|
|
|
|
|
case 'draft':
|
|
|
|
|
case 'paused':
|
|
|
|
|
case 'unassigned':
|
|
|
|
|
default:
|
|
|
|
|
params += 'APP_UID=' + appUid;
|
|
|
|
|
params += '&DEL_INDEX=' + delIndex;
|
|
|
|
|
//requestFile = '../cases/cases_Open';
|
|
|
|
|
requestFile = 'open';
|
|
|
|
|
break;
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
try {
|
2015-06-11 11:27:12 -04:00
|
|
|
try {
|
|
|
|
|
parent._CASE_TITLE = caseTitle;
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
catch (e) {
|
2015-06-11 11:27:12 -04:00
|
|
|
// Nothing to do
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
params += '&action=' + action;
|
2016-04-13 15:46:29 -04:00
|
|
|
if(isIE) {
|
2015-11-10 16:19:05 -04:00
|
|
|
if(casesNewTab) {
|
|
|
|
|
casesNewTab.close();
|
|
|
|
|
}
|
2016-03-08 18:37:38 -04:00
|
|
|
nameTab = PM.Sessions.getCookie('PM-TabPrimary') + '_openCase';
|
|
|
|
|
casesNewTab = window.open(requestFile + '?' + params, nameTab);
|
2015-11-10 16:19:05 -04:00
|
|
|
} else {
|
|
|
|
|
redirect(requestFile + '?' + params);
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
|
|
|
|
} else
|
2015-06-11 11:27:12 -04:00
|
|
|
msgBox(_('ID_INFORMATION'), _('ID_SELECT_ONE_AT_LEAST'));
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function jumpToCase(appNumber){
|
2015-06-11 11:27:12 -04:00
|
|
|
// Code add by Brayan Pereyra - cochalo
|
|
|
|
|
// This ajax validate the appNumber exists
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'cases_Ajax',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
var res = Ext.decode(response.responseText);
|
|
|
|
|
if (res.exists === true) {
|
|
|
|
|
params = 'APP_NUMBER=' + appNumber;
|
|
|
|
|
params += '&action=jump';
|
2016-06-08 10:46:58 -04:00
|
|
|
|
|
|
|
|
if(action == 'to_revise') {
|
|
|
|
|
params += '&to_revise=true';
|
|
|
|
|
params += '&actionFromList=' + action;
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
requestFile = '../cases/open';
|
|
|
|
|
redirect(requestFile + '?' + params);
|
|
|
|
|
} else {
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
var message = new Array();
|
|
|
|
|
message['CASE_NUMBER'] = appNumber;
|
|
|
|
|
msgBox(_('ID_INPUT_ERROR'), _('ID_CASE_DOES_NOT_EXIST_JS', appNumber), 'error');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
params: {action:'previusJump', appNumber: appNumber}
|
|
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deleteCase() {
|
2015-06-11 11:27:12 -04:00
|
|
|
var rows = grid.getSelectionModel().getSelections();
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'casesList_Ajax' ,
|
|
|
|
|
params : {actionAjax : 'verifySession'},
|
|
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.lostSession ) {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title: _('ID_ERROR'),
|
|
|
|
|
msg: data.message,
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
fn : function(btn) {
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
prnt = parent.parent;
|
|
|
|
|
top.location = top.location;
|
|
|
|
|
}
|
|
|
|
|
catch (err)
|
|
|
|
|
{
|
|
|
|
|
parent.location = parent.location;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
if( rows.length > 0 ) {
|
|
|
|
|
ids = Array();
|
|
|
|
|
for(i=0; i<rows.length; i++)
|
|
|
|
|
ids[i] = rows[i].get('APP_UID');
|
|
|
|
|
|
|
|
|
|
APP_UIDS = ids.join(',');
|
|
|
|
|
|
|
|
|
|
Ext.Msg.confirm(
|
|
|
|
|
_('ID_CONFIRM'),
|
|
|
|
|
(rows.length == 1) ? _('ID_MSG_CONFIRM_DELETE_CASE') : _('ID_MSG_CONFIRM_DELETE_CASES'),
|
|
|
|
|
function(btn, text){
|
|
|
|
|
if ( btn == 'yes' ) {
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_DELETING_ELEMENTS'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'cases_Delete',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesView(true);
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesTree();
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
params: {APP_UIDS:APP_UIDS}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title:'',
|
|
|
|
|
msg: _('ID_NO_SELECTION_WARNING'),
|
|
|
|
|
buttons: Ext.Msg.INFO,
|
|
|
|
|
fn: function(){},
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.INFO,
|
|
|
|
|
buttons: Ext.MessageBox.OK
|
|
|
|
|
});
|
2013-09-18 10:13:59 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function pauseCase(date){
|
2015-06-11 11:27:12 -04:00
|
|
|
rowModel = grid.getSelectionModel().getSelected();
|
|
|
|
|
|
|
|
|
|
if(rowModel) {
|
|
|
|
|
unpauseDate = date.format('Y-m-d');
|
|
|
|
|
var msgPause = new Ext.Window({
|
|
|
|
|
//layout:'fit',
|
|
|
|
|
width:500,
|
|
|
|
|
plain: true,
|
|
|
|
|
modal: true,
|
|
|
|
|
title: _('ID_CONFIRM'),
|
|
|
|
|
|
|
|
|
|
items: [
|
|
|
|
|
new Ext.FormPanel({
|
|
|
|
|
labelAlign: 'top',
|
|
|
|
|
labelWidth: 75,
|
|
|
|
|
border: false,
|
|
|
|
|
frame: true,
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
html: '<div align="center" style="font: 14px tahoma,arial,helvetica,sans-serif">' + _('ID_PAUSE_CASE_TO_DATE') +' '+date.format('M j, Y')+'? </div> <br/>'
|
|
|
|
|
},
|
|
|
|
|
new Ext.form.TimeField({
|
|
|
|
|
id: 'unpauseTime',
|
|
|
|
|
fieldLabel: _('ID_UNPAUSE_TIME'),
|
|
|
|
|
name: 'unpauseTime',
|
|
|
|
|
value: formatAMPM(new Date(), false, date.format('m-d')),
|
|
|
|
|
minValue: formatAMPM(new Date(), true, date.format('m-d')),
|
|
|
|
|
format: 'h:i A'
|
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
xtype: 'textarea',
|
|
|
|
|
id: 'noteReason',
|
|
|
|
|
fieldLabel: _('ID_CASE_PAUSE_REASON'),
|
|
|
|
|
name: 'noteReason',
|
|
|
|
|
width: 450,
|
|
|
|
|
height: 50
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'notifyReason',
|
|
|
|
|
xtype:'checkbox',
|
|
|
|
|
name: 'notifyReason',
|
|
|
|
|
hideLabel: true,
|
|
|
|
|
boxLabel: _('ID_NOTIFY_USERS_CASE')
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
buttonAlign: 'center',
|
|
|
|
|
|
|
|
|
|
buttons: [{
|
2015-09-17 17:08:41 -04:00
|
|
|
text: _('ID_OK'),
|
2015-06-11 11:27:12 -04:00
|
|
|
handler: function(){
|
|
|
|
|
if (Ext.getCmp('noteReason').getValue() != '') {
|
|
|
|
|
var noteReasonTxt = _('ID_CASE_PAUSE_LABEL_NOTE') + ' ' + Ext.getCmp('noteReason').getValue();
|
|
|
|
|
} else {
|
|
|
|
|
var noteReasonTxt = '';
|
|
|
|
|
}
|
|
|
|
|
var notifyReasonVal = Ext.getCmp('notifyReason').getValue() == true ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'cases_Ajax',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesView(true);
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesTree();
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
msgPause.close();
|
|
|
|
|
},
|
|
|
|
|
params: {
|
|
|
|
|
action: 'pauseCase',
|
|
|
|
|
unpausedate: unpauseDate,
|
|
|
|
|
unpauseTime: Ext.getCmp('unpauseTime').getValue(),
|
|
|
|
|
APP_UID: rowModel.data.APP_UID,
|
|
|
|
|
DEL_INDEX: rowModel.data.DEL_INDEX,
|
|
|
|
|
NOTE_REASON: noteReasonTxt,
|
|
|
|
|
NOTIFY_PAUSE: notifyReasonVal
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},{
|
2015-09-17 17:08:41 -04:00
|
|
|
text: _('ID_CANCEL'), //COCHATRA
|
2015-06-11 11:27:12 -04:00
|
|
|
handler: function(){
|
|
|
|
|
msgPause.close();
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
msgPause.show(this);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title:'',
|
|
|
|
|
msg: _('ID_NO_SELECTION_WARNING'),
|
|
|
|
|
buttons: Ext.Msg.INFO,
|
|
|
|
|
fn: function(){},
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.INFO,
|
|
|
|
|
buttons: Ext.MessageBox.OK
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function cancelCase(){
|
|
|
|
|
var rows = grid.getSelectionModel().getSelections();
|
|
|
|
|
if( rows.length > 0 ) {
|
|
|
|
|
app_uid = Array();
|
|
|
|
|
del_index = Array();
|
|
|
|
|
|
|
|
|
|
for(i=0; i<rows.length; i++){
|
|
|
|
|
app_uid[i] = rows[i].get('APP_UID');
|
|
|
|
|
del_index[i] = rows[i].get('DEL_INDEX');
|
|
|
|
|
}
|
|
|
|
|
APP_UIDS = app_uid.join(',');
|
|
|
|
|
DEL_INDEXES = del_index.join(',');
|
|
|
|
|
|
|
|
|
|
Ext.Msg.confirm(
|
|
|
|
|
_('ID_CONFIRM'),
|
|
|
|
|
(rows.length == 1) ? _('ID_MSG_CONFIRM_CANCEL_CASE') : _('ID_MSG_CONFIRM_CANCEL_CASES'),
|
|
|
|
|
function(btn, text){
|
|
|
|
|
if ( btn == 'yes' ) {
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'cases_Ajax',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesView(true);
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesTree();
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
params: {action:'cancelCase', APP_UID:APP_UIDS, DEL_INDEX:DEL_INDEXES}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title:'',
|
|
|
|
|
msg: _('ID_NO_SELECTION_WARNING'),
|
|
|
|
|
buttons: Ext.Msg.INFO,
|
|
|
|
|
fn: function(){},
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.INFO,
|
|
|
|
|
buttons: Ext.MessageBox.OK
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function callbackUnpauseCase (btn, text) {
|
|
|
|
|
if ( btn == 'yes' ) {
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'cases_Ajax',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesView(true);
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
try {
|
|
|
|
|
parent.updateCasesTree();
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
params: {action:'unpauseCase', sApplicationUID: caseIdToUnpause, iIndex: caseIndexToUnpause}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unpauseCase() {
|
|
|
|
|
rowModel = grid.getSelectionModel().getSelected();
|
|
|
|
|
caseIdToUnpause = rowModel.data.APP_UID;
|
|
|
|
|
caseIndexToUnpause = rowModel.data.DEL_INDEX;
|
|
|
|
|
|
|
|
|
|
Ext.Msg.confirm( _('ID_CONFIRM'), _('ID_CONFIRM_UNPAUSE_CASE') , function (btn, text) {
|
|
|
|
|
if ( btn == 'yes' ) {
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'cases_Ajax',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
try {
|
2013-02-05 15:00:07 -04:00
|
|
|
parent.updateCasesView(true);
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
catch (e) {
|
2012-07-25 16:54:54 -04:00
|
|
|
// Nothing to do
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
try {
|
2012-07-25 16:54:54 -04:00
|
|
|
parent.updateCasesTree();
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
catch (e) {
|
2012-07-25 16:54:54 -04:00
|
|
|
// Nothing to do
|
2013-03-27 13:45:05 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
},
|
|
|
|
|
params: {action:'unpauseCase', sApplicationUID: caseIdToUnpause, iIndex: caseIndexToUnpause}
|
|
|
|
|
});
|
|
|
|
|
}
|
2012-07-25 16:54:54 -04:00
|
|
|
});
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
2012-08-15 19:04:55 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
function redirect(href){
|
|
|
|
|
window.location.href = href;
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
Ext.onReady ( function() {
|
2016-02-25 08:50:56 -04:00
|
|
|
setExtStateManagerSetProvider('casesGrid', action);
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
var ids = '';
|
|
|
|
|
var filterProcess = '';
|
|
|
|
|
var filterCategory = '';
|
|
|
|
|
var filterUser = '';
|
|
|
|
|
var caseIdToDelete = '';
|
|
|
|
|
var caseIdToUnpause = '';
|
|
|
|
|
var caseIndexToUnpause = '';
|
|
|
|
|
try {
|
|
|
|
|
parent._action = action;
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
var columnRenderer = function(data, metadata, record, rowIndex,columnIndex, store) {
|
|
|
|
|
var new_text = metadata.style.split(';');
|
|
|
|
|
var style = '';
|
|
|
|
|
if ( !record.data['DEL_INIT_DATE'] ){
|
|
|
|
|
style = style + "font-weight: bold; ";
|
|
|
|
|
}
|
|
|
|
|
for (var i = 0; i < new_text.length -1 ; i++) {
|
|
|
|
|
var chain = new_text[i] +";";
|
|
|
|
|
if (chain.indexOf('width') == -1) {
|
|
|
|
|
style = style + chain;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
data = Ext.util.Format.htmlEncode(data);
|
|
|
|
|
metadata.attr = 'ext:qtip="' + data + '" style="'+ style +' white-space: normal; "';
|
|
|
|
|
return data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function openLink(value, p, r){
|
|
|
|
|
return String.format("<a class='button_pm' href='../cases/cases_Open?APP_UID={0}&DEL_INDEX={1}&content=inner'>" + _('ID_VIEW') + "</a>", r.data['APP_UID'], r.data['DEL_INDEX'], r.data['APP_TITLE']);
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
function deleteLink(value, p, r){
|
|
|
|
|
return String.format("<a class='button_pm ss_sprite ss_bullet_red' href='#' onclick='deleteCase(\"{0}\")'>" + _('ID_DELETE') + "</a>", r.data['APP_UID'] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function viewLink(value, p, r){
|
|
|
|
|
return String.format("<a href='../cases/cases_Open?APP_UID={0}&DEL_INDEX={1}&content=inner'>" + _('ID_VIEW') + "</a>", r.data['APP_UID'], r.data['DEL_INDEX'], r.data['APP_TITLE']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unpauseLink(value, p, r){
|
|
|
|
|
return String.format("<a href='#' onclick='unpauseCaseFunction(\"{0}\",\"{1}\")'>" + _('ID_UNPAUSE') + "</a>", r.data['APP_UID'], r.data['DEL_INDEX'] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertDate ( value ) {
|
|
|
|
|
myDate = new Date( 1900,0,1,0,0,0);
|
|
|
|
|
try{
|
|
|
|
|
if(!Ext.isDate( value )){
|
|
|
|
|
var myArray = value.split(' ');
|
|
|
|
|
var myArrayDate = myArray[0].split('-');
|
|
|
|
|
if ( myArray.length > 1 )
|
|
|
|
|
var myArrayHour = myArray[1].split(':');
|
|
|
|
|
else
|
|
|
|
|
var myArrayHour = new Array('0','0','0');
|
|
|
|
|
var myDate = new Date( myArrayDate[0], myArrayDate[1]-1, myArrayDate[2], myArrayHour[0], myArrayHour[1], myArrayHour[2] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(e){};
|
|
|
|
|
|
|
|
|
|
return myDate;
|
|
|
|
|
}
|
|
|
|
|
function showDate (value,p,r) {
|
|
|
|
|
var myDate = convertDate( value );
|
|
|
|
|
return String.format("{0}", myDate.dateFormat( FORMATS.casesListDateFormat ));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dueDate(value, p, r){
|
|
|
|
|
if (value) {
|
|
|
|
|
var myDate = convertDate( value );
|
|
|
|
|
var myColor = (myDate < new Date()) ? " color:red;" : 'color:green;';
|
|
|
|
|
return String.format("<span style='{1}'>{0}</span>", myDate.dateFormat(FORMATS.casesListDateFormat), myColor );
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var renderSummary = function (val, p, r) {
|
|
|
|
|
var summaryIcon = '<img src="/images/ext/default/s.gif" class="x-tree-node-icon ss_layout_header" unselectable="off" id="extdd-17" ';
|
|
|
|
|
summaryIcon += 'onclick="openSummaryWindow(' + "'" + r.data['APP_UID'] + "'" + ', ' + r.data['DEL_INDEX'] + ', action)" title="' + _('ID_SUMMARY') + '" />';
|
|
|
|
|
return summaryIcon;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function renderNote(val,p,r) {
|
|
|
|
|
var pro = r.json.PRO_UID;
|
|
|
|
|
var tas = r.json.TAS_UID;
|
|
|
|
|
var appUid = r.data.APP_UID;
|
|
|
|
|
var delIndex = r.data.DEL_INDEX;
|
|
|
|
|
var title = Ext.util.Format.htmlEncode(r.data.APP_TITLE);
|
|
|
|
|
|
|
|
|
|
return "<img src=\"/images/ext/default/s.gif\" class=\"x-tree-node-icon ICON_CASES_NOTES\" unselectable=\"off\" id=\"extdd-17\" onClick=\"openCaseNotesWindow(\'" + appUid + "\', " + delIndex + ", true, \'" + title + "\', \'" + pro + "\', \'" + tas + "\');\" />";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Render Full Name
|
|
|
|
|
full_name = function(v, x, s) {
|
2015-12-01 17:27:50 -04:00
|
|
|
if (s.data.USR_UID && s.data.USR_USERNAME) {
|
2015-06-11 11:27:12 -04:00
|
|
|
return _FNF(s.data.USR_USERNAME, s.data.USR_FIRSTNAME, s.data.USR_LASTNAME);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return '[' + _('ID_UNASSIGNED').toUpperCase() + ']';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
previous_full_name = function(v, x, s) {
|
|
|
|
|
if (s.data.PREVIOUS_USR_UID) {
|
2015-10-19 14:01:31 -04:00
|
|
|
switch (s.data.PREVIOUS_USR_UID) {
|
|
|
|
|
case "SCRIPT-TASK":
|
|
|
|
|
return _("ID_SCRIPT_TASK");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return _FNF(s.data.PREVIOUS_USR_USERNAME, s.data.PREVIOUS_USR_FIRSTNAME, s.data.PREVIOUS_USR_LASTNAME);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2015-06-11 11:27:12 -04:00
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for(var i = 0, len = columns.length; i < len; i++){
|
|
|
|
|
var c = columns[i];
|
|
|
|
|
c.renderer = columnRenderer;
|
|
|
|
|
if( c.dataIndex == 'DEL_TASK_DUE_DATE') c.renderer = dueDate;
|
|
|
|
|
if( c.dataIndex == 'APP_UPDATE_DATE') c.renderer = showDate;
|
|
|
|
|
if( c.id == 'deleteLink') c.renderer = deleteLink;
|
|
|
|
|
if( c.id == 'viewLink') c.renderer = viewLink;
|
|
|
|
|
if( c.id == 'unpauseLink') c.renderer = unpauseLink;
|
|
|
|
|
if( c.dataIndex == 'CASE_SUMMARY') c.renderer = renderSummary;
|
|
|
|
|
if( c.dataIndex == 'CASE_NOTES_COUNT') c.renderer = renderNote;
|
|
|
|
|
|
|
|
|
|
if( c.dataIndex == 'CASE_SUMMARY') c.sortable = false;
|
|
|
|
|
if( c.dataIndex == 'CASE_NOTES_COUNT') c.sortable = false;
|
|
|
|
|
|
|
|
|
|
//Format the name if is disabled solr, otherwise show without format
|
|
|
|
|
if (solrEnabled == 0) {
|
|
|
|
|
if( c.dataIndex == 'APP_DEL_PREVIOUS_USER') c.renderer = previous_full_name;
|
|
|
|
|
if( c.dataIndex == 'APP_CURRENT_USER') c.renderer = full_name;
|
|
|
|
|
}
|
|
|
|
|
c.header = _(c.header);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//adding the hidden field DEL_INIT_DATE
|
|
|
|
|
readerFields.push ( {name: "DEL_INIT_DATE"});
|
|
|
|
|
readerFields.push ( {name: "APP_UID"});
|
|
|
|
|
readerFields.push ( {name: "DEL_INDEX"});
|
|
|
|
|
|
|
|
|
|
readerFields.push ( {name: "USR_FIRSTNAME"});
|
|
|
|
|
readerFields.push ( {name: "USR_LASTNAME"});
|
|
|
|
|
readerFields.push ( {name: "USR_USERNAME"});
|
|
|
|
|
|
|
|
|
|
for (i=0; i<columns.length; i++) {
|
|
|
|
|
if (columns[i].dataIndex == 'USR_UID') {
|
|
|
|
|
columns[i].hideable = false;
|
|
|
|
|
}
|
|
|
|
|
if(columns[i].dataIndex == 'PREVIOUS_USR_UID') {
|
|
|
|
|
columns[i].hideable=false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var cm = new Ext.grid.ColumnModel({
|
|
|
|
|
defaults: {
|
|
|
|
|
sortable: true // columns are sortable by default
|
|
|
|
|
},
|
2016-07-01 14:56:34 -04:00
|
|
|
listeners: {
|
|
|
|
|
hiddenchange: function (columnModel, columnIndex, hidden) {
|
|
|
|
|
var grid = Ext.getCmp('casesGrid');
|
|
|
|
|
if (grid && grid.getView) {
|
|
|
|
|
grid.getView().refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2015-06-11 11:27:12 -04:00
|
|
|
columns: columns
|
|
|
|
|
});
|
|
|
|
|
|
2016-06-23 18:17:35 -04:00
|
|
|
for (var i in reassignColumns) {
|
|
|
|
|
if (reassignColumns[i].dataIndex === 'APP_REASSIGN_USER') {
|
|
|
|
|
reassignColumns[i].editor = comboUsersToReassign;
|
|
|
|
|
}
|
|
|
|
|
if (reassignColumns[i].dataIndex === 'NOTE_REASON') {
|
|
|
|
|
reassignColumns[i].editor = new Ext.form.TextArea({allowBlank: false});
|
|
|
|
|
}
|
|
|
|
|
if (reassignColumns[i].dataIndex === 'NOTIFY_REASSIGN') {
|
|
|
|
|
reassignColumns[i].editor = new Ext.form.Checkbox({});
|
|
|
|
|
reassignColumns[i].renderer = function (v, x, s) {
|
|
|
|
|
if (s.data.NOTIFY_REASSIGN === true) {
|
|
|
|
|
return _('ID_YES');
|
|
|
|
|
}
|
|
|
|
|
if (s.data.NOTIFY_REASSIGN === true) {
|
|
|
|
|
return _('ID_NO');
|
|
|
|
|
}
|
|
|
|
|
return s.data.NOTIFY_REASSIGN;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
var reassignCm = new Ext.grid.ColumnModel({
|
|
|
|
|
defaults: {
|
|
|
|
|
sortable: true // columns are sortable by default
|
|
|
|
|
},
|
|
|
|
|
columns: reassignColumns
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var newPopUp = new Ext.Window({
|
|
|
|
|
id : Ext.id(),
|
|
|
|
|
el : 'reassign-panel',
|
|
|
|
|
title : _('ID_REASSIGN_ALL_CASES_BY_TASK'),
|
|
|
|
|
width : 750,
|
|
|
|
|
height : 350,
|
|
|
|
|
frame : true,
|
|
|
|
|
closable: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnCloseReassign = new Ext.Button ({
|
|
|
|
|
text: _('ID_CLOSE'),
|
|
|
|
|
// text: TRANSLATIONS.LABEL_SELECT_ALL,
|
|
|
|
|
handler: function(){
|
|
|
|
|
newPopUp.hide();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnExecReassign = new Ext.Button ({
|
|
|
|
|
text: _('ID_REASSIGN_ALL'),
|
|
|
|
|
// text: 'Reassign All',
|
|
|
|
|
// text: TRANSLATIONS.LABEL_SELECT_ALL,
|
|
|
|
|
handler: function(){
|
|
|
|
|
|
|
|
|
|
var rs = storeReassignCases.getModifiedRecords();
|
|
|
|
|
var sv = [];
|
|
|
|
|
for(var i = 0; i <= rs.length-1; i++){
|
|
|
|
|
//sv[i]= rs[i].data['name'];
|
|
|
|
|
sv[i]= rs[i].data;
|
|
|
|
|
}
|
|
|
|
|
var gridData = storeReassignCases.getModifiedRecords();
|
|
|
|
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'proxySaveReassignCasesList',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
newPopUp.hide();
|
|
|
|
|
storeCases.reload();
|
|
|
|
|
},
|
|
|
|
|
params: { APP_UIDS:ids, data:Ext.util.JSON.encode(sv), selected:false }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
storeReassignCases.setBaseParam('selected', false);
|
|
|
|
|
var result = storeReassignCases.save();
|
|
|
|
|
newPopUp.hide();
|
|
|
|
|
storeCases.reload();
|
|
|
|
|
*/
|
|
|
|
|
//storeReassignCases.reload();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var ExecReassign = function () {
|
|
|
|
|
newPopUp.hide();
|
|
|
|
|
var rs = storeReassignCases.getModifiedRecords();
|
|
|
|
|
|
|
|
|
|
var sv = [];
|
|
|
|
|
for(var i = 0; i <= rs.length-1; i++){
|
|
|
|
|
sv[i]= rs[i].data;
|
|
|
|
|
}
|
|
|
|
|
var gridData = storeReassignCases.getModifiedRecords();
|
|
|
|
|
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'proxySaveReassignCasesList',
|
2011-09-20 12:33:15 -04:00
|
|
|
success: function(response) {
|
2015-06-11 11:27:12 -04:00
|
|
|
Ext.MessageBox.hide();
|
|
|
|
|
storeCases.reload();
|
|
|
|
|
var ajaxServerResponse = Ext.util.JSON.decode(response.responseText);
|
|
|
|
|
var count;
|
|
|
|
|
var message = '';
|
|
|
|
|
|
|
|
|
|
for (count in ajaxServerResponse) {
|
|
|
|
|
if ( ajaxServerResponse[count]['TAS_TITLE'] != undefined ){
|
|
|
|
|
message = message + _('ID_CASE') + ": " + ajaxServerResponse[count]['APP_TITLE'] + " - " + _('ID_REASSIGNED_TO') + ": " + ajaxServerResponse[count]['APP_REASSIGN_USER'] + "<br>" ;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ajaxServerResponse['TOTAL']!=undefined&&ajaxServerResponse['TOTAL']!=-1){
|
|
|
|
|
message = message + "<br> " + _('ID_TOTAL_CASES_REASSIGNED') + ": " + ajaxServerResponse['TOTAL'];
|
|
|
|
|
} else {
|
|
|
|
|
message = "";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (message!=""){
|
|
|
|
|
Ext.MessageBox.alert( _('ID_STATUS_REASSIGNMENT'), message, '' );
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
},
|
2015-06-11 11:27:12 -04:00
|
|
|
params: { APP_UIDS:ids, data:Ext.util.JSON.encode(sv), selected:true }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create HttpProxy instance, all CRUD requests will be directed to single proxy url.
|
2015-12-03 17:30:42 -04:00
|
|
|
var proxyCasesList = new Ext.data.HttpProxy({
|
|
|
|
|
api: {
|
|
|
|
|
read : urlProxy
|
|
|
|
|
}
|
|
|
|
|
});
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
// Typical JsonReader with additional meta-data params for defining the core attributes of your json-response
|
|
|
|
|
// the readerFields is defined in PHP server side
|
|
|
|
|
var readerCasesList = new Ext.data.JsonReader({
|
|
|
|
|
totalProperty: 'totalCount',
|
|
|
|
|
successProperty: 'success',
|
|
|
|
|
idProperty: 'index',
|
|
|
|
|
root: 'data',
|
|
|
|
|
messageProperty: 'message'
|
|
|
|
|
},
|
|
|
|
|
readerFields
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// The new DataWriter component.
|
|
|
|
|
//currently we are not using this in casesList, but it is here just for complete definition
|
|
|
|
|
var writerCasesList = new Ext.data.JsonWriter({
|
|
|
|
|
encode: true,
|
|
|
|
|
writeAllFields: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var proxyReassignCasesList = new Ext.data.HttpProxy({
|
|
|
|
|
api: {
|
|
|
|
|
read : 'proxyReassignCasesList'
|
|
|
|
|
//destroy : 'proxyReassignCasesList'
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var readerReassignCasesList = new Ext.data.JsonReader({
|
|
|
|
|
totalProperty: 'totalCount',
|
|
|
|
|
successProperty: 'success',
|
|
|
|
|
idProperty: 'index',
|
|
|
|
|
root: 'data',
|
|
|
|
|
messageProperty: 'message'
|
|
|
|
|
},
|
|
|
|
|
reassignReaderFields
|
2011-09-20 12:33:15 -04:00
|
|
|
);
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
// The new DataWriter component.
|
|
|
|
|
//currently we are not using this in casesList, but it is here just for complete definition
|
|
|
|
|
var writerReassignCasesList = new Ext.data.JsonWriter({
|
|
|
|
|
encode: true,
|
|
|
|
|
writeAllFields: true
|
2011-09-20 12:33:15 -04:00
|
|
|
});
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Typical Store collecting the Proxy, Reader and Writer together.
|
|
|
|
|
// This is the store for Cases List
|
|
|
|
|
storeCases = new Ext.data.Store({
|
|
|
|
|
remoteSort: true,
|
|
|
|
|
proxy: proxyCasesList,
|
|
|
|
|
reader: readerCasesList,
|
|
|
|
|
writer: writerCasesList, // <-- plug a DataWriter into the store just as you would a Reader
|
|
|
|
|
autoSave: true, // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
|
|
|
|
sortInfo:{field: 'APP_CACHE_VIEW.APP_NUMBER', direction: "DESC"},
|
|
|
|
|
listeners: {
|
2016-06-07 16:52:49 -04:00
|
|
|
beforeload: function (store, options)
|
|
|
|
|
{
|
|
|
|
|
this.setBaseParam(
|
|
|
|
|
"openApplicationUid", (__OPEN_APPLICATION_UID__ !== null)? __OPEN_APPLICATION_UID__ : ""
|
|
|
|
|
);
|
|
|
|
|
},
|
2015-06-11 11:27:12 -04:00
|
|
|
load: function(response){
|
|
|
|
|
|
|
|
|
|
if (response.reader.jsonData.result === false) {
|
|
|
|
|
PMExt.notify('ERROR', response.reader.jsonData.message);
|
|
|
|
|
//PMExt.error
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
exception: function(dp, type, action, options, response, arg) {
|
|
|
|
|
responseObject = Ext.util.JSON.decode(response.responseText);
|
|
|
|
|
if (typeof(responseObject.error) != 'undefined') {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title: _('ID_ERROR'),
|
|
|
|
|
msg: responseObject.error,
|
|
|
|
|
fn: function(){parent.parent.location = '../login/login';},
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
|
buttons: Ext.MessageBox.OK
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
storeReassignCases = new Ext.data.Store({
|
|
|
|
|
remoteSort: false,
|
|
|
|
|
proxy : proxyReassignCasesList,
|
|
|
|
|
reader: readerReassignCasesList
|
|
|
|
|
//writer: writerReassignCasesList, // <-- plug a DataWriter into the store just as you would a Reader
|
|
|
|
|
//autoSave: false // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Layout Resizing
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
if (typeof valueFilterStatus != 'undefined') {
|
2016-04-13 15:46:29 -04:00
|
|
|
if (valueFilterStatus != '') {
|
|
|
|
|
storeCases.setBaseParam('filterStatus', valueFilterStatus);
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
storeCases.on('load',function(){var viewport = Ext.getCmp("viewportcases");viewport.doLayout();})
|
|
|
|
|
|
|
|
|
|
// create the Data Store for processes
|
|
|
|
|
var storeProcesses = new Ext.data.JsonStore({
|
|
|
|
|
root: 'data',
|
|
|
|
|
totalProperty: 'totalCount',
|
|
|
|
|
idProperty: 'index',
|
|
|
|
|
remoteSort: true,
|
|
|
|
|
fields: [
|
|
|
|
|
'PRO_UID', 'APP_PRO_TITLE'
|
|
|
|
|
],
|
|
|
|
|
proxy: new Ext.data.HttpProxy({
|
|
|
|
|
url: 'proxyProcessList?t=new'
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
storeProcesses.setDefaultSort('APP_PRO_TITLE', 'asc');
|
|
|
|
|
|
|
|
|
|
// creating the button for filters
|
|
|
|
|
var btnRead = new Ext.Button ({
|
|
|
|
|
id: 'read',
|
|
|
|
|
text: _('ID_OPT_READ'),
|
|
|
|
|
enableToggle: true,
|
|
|
|
|
toggleHandler: onItemToggle,
|
|
|
|
|
allowDepress: false,
|
|
|
|
|
pressed: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnUnread = new Ext.Button ({
|
|
|
|
|
id: 'unread',
|
|
|
|
|
text: _('ID_OPT_UNREAD'),
|
|
|
|
|
enableToggle: true,
|
|
|
|
|
toggleHandler: onItemToggle,
|
|
|
|
|
allowDepress: false,
|
|
|
|
|
pressed: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnAll = new Ext.Button ({
|
|
|
|
|
id: 'all',
|
|
|
|
|
text: _('ID_OPT_ALL'),
|
|
|
|
|
enableToggle: true,
|
|
|
|
|
toggleHandler: onItemToggle,
|
|
|
|
|
allowDepress: false,
|
|
|
|
|
pressed: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnStarted = new Ext.Button ({
|
|
|
|
|
id: 'started',
|
|
|
|
|
// text: 'started by me',
|
|
|
|
|
text: _('ID_OPT_STARTED'),
|
|
|
|
|
enableToggle: true,
|
|
|
|
|
toggleHandler: onItemToggle,
|
|
|
|
|
allowDepress: true,
|
|
|
|
|
pressed: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnCompleted = new Ext.Button ({
|
|
|
|
|
id: 'completed',
|
|
|
|
|
// text: 'Completed by me',
|
|
|
|
|
text: _('ID_OPT_COMPLETED'),
|
|
|
|
|
enableToggle: true,
|
|
|
|
|
toggleHandler: onItemToggle,
|
|
|
|
|
allowDepress: true,
|
|
|
|
|
pressed: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ComboBox creation processValues
|
|
|
|
|
var resultTpl = new Ext.XTemplate(
|
|
|
|
|
'<tpl for="."><div class="x-combo-list-item" style="white-space:normal !important;word-wrap: break-word;">',
|
|
|
|
|
'<span> {APP_PRO_TITLE}</span>',
|
|
|
|
|
'</div></tpl>'
|
|
|
|
|
);
|
|
|
|
|
|
2011-09-20 12:33:15 -04:00
|
|
|
Ext.Ajax.request({
|
2016-03-31 13:38:51 -04:00
|
|
|
url : 'casesList_Ajax',
|
|
|
|
|
params : {
|
|
|
|
|
actionAjax : 'processListExtJs',
|
2015-06-11 11:27:12 -04:00
|
|
|
action: action,
|
2016-03-31 13:38:51 -04:00
|
|
|
CATEGORY_UID: filterCategory
|
|
|
|
|
},
|
2015-06-11 11:27:12 -04:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
processValues = Ext.util.JSON.decode(result.responseText);
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess.getStore().removeAll();
|
|
|
|
|
suggestProcess.getStore().loadData(processValues);
|
2015-06-11 11:27:12 -04:00
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
2016-03-31 13:38:51 -04:00
|
|
|
var processStore = new Ext.data.Store( {
|
|
|
|
|
proxy : new Ext.data.HttpProxy( {
|
|
|
|
|
url : 'casesList_Ajax?actionAjax=processListExtJs',
|
|
|
|
|
method : 'POST'
|
|
|
|
|
}),
|
|
|
|
|
reader : new Ext.data.JsonReader( {
|
|
|
|
|
fields : [ {
|
|
|
|
|
name : 'PRO_UID'
|
|
|
|
|
}, {
|
|
|
|
|
name : 'PRO_TITLE'
|
|
|
|
|
} ]
|
|
|
|
|
})
|
|
|
|
|
});
|
2015-06-11 11:27:12 -04:00
|
|
|
|
2016-03-31 13:38:51 -04:00
|
|
|
var suggestProcess = new Ext.form.ComboBox({
|
|
|
|
|
store: processStore,
|
|
|
|
|
valueField : 'PRO_UID',
|
|
|
|
|
displayField:'PRO_TITLE',
|
|
|
|
|
typeAhead: false,
|
2015-06-11 11:27:12 -04:00
|
|
|
triggerAction: 'all',
|
2016-03-31 13:38:51 -04:00
|
|
|
emptyText : _('ID_EMPTY_PROCESSES'),
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
editable : true,
|
|
|
|
|
width: 150,
|
|
|
|
|
allowBlank : true,
|
|
|
|
|
autocomplete: true,
|
|
|
|
|
minChars: 1,
|
|
|
|
|
hideTrigger:true,
|
2015-06-11 11:27:12 -04:00
|
|
|
listeners:{
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function() {
|
2016-03-31 13:38:51 -04:00
|
|
|
filterProcess = suggestProcess.value;
|
2015-06-11 11:27:12 -04:00
|
|
|
if ( action == 'search' ){
|
|
|
|
|
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
|
|
|
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
|
|
|
|
}
|
|
|
|
|
storeCases.setBaseParam('process', filterProcess);
|
2016-03-31 13:38:51 -04:00
|
|
|
}
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
2016-03-31 13:38:51 -04:00
|
|
|
var resetProcessButton = {
|
|
|
|
|
text:'X',
|
|
|
|
|
ctCls:"pm_search_x_button_des",
|
|
|
|
|
handler: function(){
|
|
|
|
|
storeCases.setBaseParam('process', '');
|
|
|
|
|
suggestProcess.setValue('');
|
|
|
|
|
doSearch();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var comboAllUsers = new Ext.form.ComboBox({
|
|
|
|
|
width : 180,
|
|
|
|
|
boxMaxWidth : 180,
|
|
|
|
|
editable : false,
|
|
|
|
|
displayField : 'USR_FULLNAME',
|
|
|
|
|
valueField : 'USR_UID',
|
|
|
|
|
//typeAhead : true,
|
|
|
|
|
mode : 'local',
|
|
|
|
|
forceSelection: true,
|
|
|
|
|
triggerAction: 'all',
|
|
|
|
|
|
|
|
|
|
emptyText: _('ID_EMPTY_USERS'),
|
|
|
|
|
selectOnFocus: true,
|
|
|
|
|
//getListParent: function() {
|
|
|
|
|
// return this.el.up('.x-menu');
|
|
|
|
|
//},
|
|
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields: ['USR_UID','USR_FULLNAME'],
|
|
|
|
|
data : allUsersValues
|
|
|
|
|
}),
|
|
|
|
|
listeners:{
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function() {
|
|
|
|
|
filterProcess = comboAllUsers.value;
|
|
|
|
|
|
|
|
|
|
/*if (filterProcess==''){
|
|
|
|
|
btnSelectAll.hide();
|
|
|
|
|
btnUnSelectAll.hide();
|
|
|
|
|
btnReassign.hide();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
btnSelectAll.show();
|
|
|
|
|
btnUnSelectAll.show();
|
|
|
|
|
btnReassign.show();
|
|
|
|
|
}*/
|
|
|
|
|
storeCases.setBaseParam( 'user', filterProcess);
|
|
|
|
|
//storeCases.load({params:{user: filterProcess, start : 0 , limit : pageSize}});
|
|
|
|
|
}},
|
|
|
|
|
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var comboCategory = new Ext.form.ComboBox({
|
|
|
|
|
width : 180,
|
|
|
|
|
boxMaxWidth : 200,
|
|
|
|
|
editable : false,
|
|
|
|
|
displayField : 'CATEGORY_NAME',
|
|
|
|
|
valueField : 'CATEGORY_UID',
|
|
|
|
|
forceSelection : false,
|
|
|
|
|
emptyText : _('ID_PROCESS_NO_CATEGORY'),
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
typeAhead : true,
|
|
|
|
|
mode : 'local',
|
|
|
|
|
autocomplete : true,
|
|
|
|
|
triggerAction : 'all',
|
|
|
|
|
|
|
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields : ['CATEGORY_UID','CATEGORY_NAME'],
|
|
|
|
|
data : categoryValues
|
|
|
|
|
}),
|
|
|
|
|
listeners:{
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function() {
|
|
|
|
|
|
|
|
|
|
filterCategory = comboCategory.value;
|
|
|
|
|
storeCases.setBaseParam('category', filterCategory);
|
|
|
|
|
storeCases.setBaseParam('process', '');
|
|
|
|
|
//storeCases.load({params:{category: filterCategory, start : 0 , limit : pageSize}});
|
|
|
|
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'casesList_Ajax' ,
|
|
|
|
|
params : {actionAjax : 'processListExtJs',
|
|
|
|
|
action: action,
|
|
|
|
|
CATEGORY_UID: filterCategory},
|
|
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess.getStore().removeAll();
|
|
|
|
|
suggestProcess.getStore().loadData( data );
|
|
|
|
|
suggestProcess.setValue('');
|
2015-06-11 11:27:12 -04:00
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}},
|
|
|
|
|
iconCls: 'no-icon'
|
|
|
|
|
});
|
|
|
|
|
|
2015-06-18 10:40:56 -04:00
|
|
|
if (typeof filterStatus == 'undefined') {
|
|
|
|
|
filterStatus = [];
|
|
|
|
|
}
|
2015-08-05 23:59:07 -04:00
|
|
|
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
2015-06-11 11:27:12 -04:00
|
|
|
var comboFilterStatus = new Ext.form.ComboBox({
|
|
|
|
|
width : 180,
|
|
|
|
|
boxMaxWidth : 200,
|
|
|
|
|
editable : false,
|
|
|
|
|
displayField : 'NAME',
|
|
|
|
|
valueField : 'UID',
|
|
|
|
|
forceSelection : false,
|
|
|
|
|
emptyText : _('ID_SELECT_STATUS'),
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
typeAhead : true,
|
|
|
|
|
mode : 'local',
|
|
|
|
|
autocomplete : true,
|
|
|
|
|
triggerAction : 'all',
|
2015-06-18 10:40:56 -04:00
|
|
|
hidden : filterStatus.length == 0 ? true : false,
|
2015-06-11 11:27:12 -04:00
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields : ['UID','NAME'],
|
|
|
|
|
data : filterStatus
|
|
|
|
|
}),
|
|
|
|
|
listeners:{
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function() {
|
|
|
|
|
var filter = comboFilterStatus.value;
|
|
|
|
|
if ( action == 'search' ){
|
|
|
|
|
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
|
|
|
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
|
|
|
|
}
|
|
|
|
|
storeCases.setBaseParam('filterStatus', filter);
|
|
|
|
|
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
iconCls: 'no-icon'
|
|
|
|
|
});
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
|
|
|
|
|
var btnSelectAll = new Ext.Button ({
|
|
|
|
|
text: _('CHECK_ALL'),
|
|
|
|
|
// text: 'Check All',
|
|
|
|
|
// text: TRANSLATIONS.LABEL_SELECT_ALL,
|
|
|
|
|
handler: function(){
|
|
|
|
|
grid.getSelectionModel().selectAll();
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnUnSelectAll = new Ext.Button ({
|
|
|
|
|
text: _('UNCHECK_ALL'),
|
|
|
|
|
// text: 'Un-Check All',
|
|
|
|
|
// text: TRANSLATIONS.LABEL_UNSELECT_ALL,
|
|
|
|
|
handler: function(){
|
|
|
|
|
grid.getSelectionModel().clearSelections();
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnReassign = new Ext.Button ({
|
|
|
|
|
text: _('ID_REASSIGN'),
|
|
|
|
|
// text: 'Reassign',
|
|
|
|
|
// text: TRANSLATIONS.LABEL_UNSELECT_ALL,
|
|
|
|
|
handler: function(){
|
2016-06-15 14:51:44 -04:00
|
|
|
if(openReassignCallback) {
|
|
|
|
|
for(var key in openReassignCallback){
|
|
|
|
|
var callbackFunction = new Function(openReassignCallback[key]);
|
|
|
|
|
callbackFunction.call();
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
reassign();
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
// var conn = new Ext.data.Connection();
|
|
|
|
|
var nav = new Ext.FormPanel({
|
|
|
|
|
labelWidth:100,
|
|
|
|
|
frame:true,
|
|
|
|
|
width:300,
|
|
|
|
|
collapsible:true,
|
|
|
|
|
defaultType:'textfield',
|
|
|
|
|
items:[{
|
|
|
|
|
fieldLabel: _('ID_REASSIGN_TO'),
|
|
|
|
|
name:'txt_stock_in',
|
|
|
|
|
allowBlank:true
|
|
|
|
|
}]
|
|
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var reassignPopup = new Ext.Window({
|
|
|
|
|
el:'reassign-panel',
|
|
|
|
|
modal:true,
|
|
|
|
|
layout:'fit',
|
|
|
|
|
width:300,
|
|
|
|
|
height:300,
|
|
|
|
|
closable:false,
|
|
|
|
|
resizable:false,
|
|
|
|
|
plain:true,
|
|
|
|
|
items:[nav],
|
|
|
|
|
buttons:[{
|
|
|
|
|
text: _('ID_SUBMIT'),
|
|
|
|
|
handler:function(){
|
|
|
|
|
Ext.Msg.alert('OK','save ?');
|
|
|
|
|
Ext.Msg.prompt(_('ID_NAME'),'please enter your name: ',function(btn,text){
|
|
|
|
|
if(btn=='ok') {
|
|
|
|
|
alert('ok');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: _('ID_CLOSE'),
|
|
|
|
|
handler:function() {
|
|
|
|
|
reassignPopup.hide();
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
});
|
|
|
|
|
// ComboBox creation
|
|
|
|
|
var comboStatus = new Ext.form.ComboBox({
|
|
|
|
|
width : 80,
|
|
|
|
|
boxMaxWidth : 90,
|
|
|
|
|
editable : false,
|
|
|
|
|
mode : 'local',
|
|
|
|
|
store : new Ext.data.ArrayStore({
|
|
|
|
|
fields: ['id', 'value'],
|
|
|
|
|
data : statusValues
|
|
|
|
|
}),
|
|
|
|
|
valueField : 'id',
|
|
|
|
|
displayField : 'value',
|
|
|
|
|
triggerAction : 'all',
|
|
|
|
|
|
|
|
|
|
//typeAhead: true,
|
|
|
|
|
//forceSelection: true,
|
|
|
|
|
//emptyText: 'Select a status...',
|
|
|
|
|
//selectOnFocus: true,
|
|
|
|
|
//getListParent: function() {
|
|
|
|
|
// return this.el.up('.x-menu');
|
|
|
|
|
//},
|
|
|
|
|
listeners:{
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function() {
|
|
|
|
|
filterStatus = comboStatus.value;
|
2015-09-25 15:15:50 -04:00
|
|
|
storeCases.setBaseParam( 'filterStatus', filterStatus);
|
2015-06-11 11:27:12 -04:00
|
|
|
storeCases.setBaseParam( 'start', 0);
|
|
|
|
|
storeCases.setBaseParam( 'limit', pageSize);
|
|
|
|
|
//storeCases.load();
|
|
|
|
|
}},
|
|
|
|
|
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
|
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
// ComboBox creation processValues
|
|
|
|
|
var userStore = new Ext.data.Store( {
|
|
|
|
|
proxy : new Ext.data.HttpProxy( {
|
|
|
|
|
url : 'casesList_Ajax?actionAjax=userValues&action='+action,
|
|
|
|
|
method : 'POST'
|
|
|
|
|
}),
|
|
|
|
|
reader : new Ext.data.JsonReader( {
|
|
|
|
|
fields : [ {
|
|
|
|
|
name : 'USR_UID'
|
|
|
|
|
}, {
|
|
|
|
|
name : 'USR_FULLNAME'
|
|
|
|
|
} ]
|
|
|
|
|
})
|
|
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var suggestUser = new Ext.form.ComboBox({
|
|
|
|
|
store: userStore,
|
|
|
|
|
valueField : 'USR_UID',
|
|
|
|
|
displayField:'USR_FULLNAME',
|
|
|
|
|
typeAhead: false,
|
|
|
|
|
triggerAction: 'all',
|
|
|
|
|
emptyText : _('ID_ALL_USERS'),
|
|
|
|
|
selectOnFocus : true,
|
|
|
|
|
editable : true,
|
|
|
|
|
width: 180,
|
|
|
|
|
allowBlank : true,
|
|
|
|
|
autocomplete: true,
|
|
|
|
|
minChars: 1,
|
|
|
|
|
hideTrigger:true,
|
|
|
|
|
listeners:{
|
|
|
|
|
scope: this,
|
|
|
|
|
'select': function() {
|
|
|
|
|
//storeCases.setBaseParam( 'user', comboUser.store.getAt(0).get(comboUser.valueField));
|
|
|
|
|
filterUser = suggestUser.value;
|
|
|
|
|
storeCases.setBaseParam( 'user', filterUser);
|
|
|
|
|
storeCases.setBaseParam( 'start', 0);
|
|
|
|
|
storeCases.setBaseParam( 'limit', pageSize);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var textSearch = new Ext.form.TextField ({
|
|
|
|
|
allowBlank: true,
|
|
|
|
|
ctCls:'pm_search_text_field',
|
|
|
|
|
width: 140,
|
|
|
|
|
emptyText: _('ID_EMPTY_SEARCH'),
|
|
|
|
|
listeners: {
|
|
|
|
|
specialkey: function(f,e){
|
|
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
|
|
doSearch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var btnSearch = new Ext.Button ({
|
|
|
|
|
text: _('ID_SEARCH'),
|
|
|
|
|
iconCls: 'button_menu_ext ss_sprite ss_page_find',
|
|
|
|
|
//cls: 'x-form-toolbar-standardButton',
|
|
|
|
|
handler: doSearch
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function doSearch(){
|
|
|
|
|
//var viewText = Ext.getCmp('casesGrid').getView();
|
|
|
|
|
viewText.emptyText = _('ID_NO_RECORDS_FOUND');
|
|
|
|
|
//Ext.getCmp('casesGrid').getView().refresh();
|
|
|
|
|
|
|
|
|
|
searchText = textSearch.getValue();
|
|
|
|
|
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
|
|
|
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
|
|
|
|
storeCases.setBaseParam( 'search', searchText);
|
|
|
|
|
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
2012-04-20 16:41:27 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
var resetSearchButton = {
|
|
|
|
|
text:'X',
|
|
|
|
|
ctCls:"pm_search_x_button_des",
|
|
|
|
|
handler: function(){
|
|
|
|
|
textSearch.setValue('');
|
|
|
|
|
doSearch();
|
|
|
|
|
}
|
2012-04-20 16:41:27 -04:00
|
|
|
}
|
2014-04-01 15:06:11 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var resetSuggestButton = {
|
|
|
|
|
text:'X',
|
|
|
|
|
ctCls:"pm_search_x_button_des",
|
|
|
|
|
handler: function(){
|
|
|
|
|
suggestUser.setValue('');
|
|
|
|
|
doSearch();
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
textJump = {
|
|
|
|
|
xtype: 'numberfield',
|
|
|
|
|
id : 'textJump',
|
|
|
|
|
allowBlank: true,
|
|
|
|
|
width: 50,
|
|
|
|
|
emptyText: _('ID_CASESLIST_APP_UID'),
|
|
|
|
|
listeners: {
|
|
|
|
|
specialkey: function(f,e){
|
|
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
|
|
// defining an id and using the Ext.getCmp method improves the accesibility of Ext components
|
|
|
|
|
caseNumber = parseFloat(Ext.util.Format.trim(Ext.getCmp('textJump').getValue()));
|
|
|
|
|
if( caseNumber )
|
|
|
|
|
jumpToCase(caseNumber);
|
|
|
|
|
else
|
|
|
|
|
msgBox(_('ID_INPUT_ERROR'), _('ID_INVALID_APPLICATION_NUMBER'), 'error');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var btnJump = new Ext.Button ({
|
|
|
|
|
text: _('ID_OPT_JUMP'),
|
|
|
|
|
handler: function(){
|
|
|
|
|
var caseNumber = parseFloat(Ext.util.Format.trim(Ext.getCmp('textJump').getValue()));
|
|
|
|
|
if (caseNumber){
|
|
|
|
|
jumpToCase(caseNumber);
|
|
|
|
|
} else {
|
|
|
|
|
msgBox(_('ID_INPUT_ERROR'), _('ID_INVALID_APPLICATION_NUMBER'), 'error');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*** menu and toolbars **/
|
|
|
|
|
|
|
|
|
|
function onMessageContextMenu(grid, rowIndex, e) {
|
|
|
|
|
e.stopEvent();
|
|
|
|
|
var coords = e.getXY();
|
|
|
|
|
messageContextMenu.showAt([coords[0], coords[1]]);
|
|
|
|
|
enableDisableMenuOption();
|
2012-08-15 19:04:55 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
function enableDisableMenuOption(){
|
|
|
|
|
var rows = grid.getSelectionModel().getSelections();
|
|
|
|
|
switch(action){
|
|
|
|
|
case 'todo':
|
|
|
|
|
if( rows.length == 0 ) {
|
|
|
|
|
optionMenuOpen.setDisabled(true);
|
|
|
|
|
optionMenuPause.setDisabled(true);
|
|
|
|
|
optionMenuReassign.setDisabled(true);
|
|
|
|
|
optionMenuCancel.setDisabled(true);
|
|
|
|
|
} else if( rows.length == 1 ) {
|
|
|
|
|
optionMenuOpen.setDisabled(false);
|
|
|
|
|
optionMenuPause.setDisabled(false);
|
|
|
|
|
optionMenuReassign.setDisabled(false);
|
|
|
|
|
optionMenuCancel.setDisabled(false);
|
|
|
|
|
} else {
|
|
|
|
|
optionMenuOpen.setDisabled(true);
|
|
|
|
|
optionMenuPause.setDisabled(true);
|
|
|
|
|
optionMenuReassign.setDisabled(true);
|
|
|
|
|
optionMenuCancel.setDisabled(false);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'draft':
|
|
|
|
|
if( rows.length == 0 ) {
|
|
|
|
|
optionMenuOpen.setDisabled(true);
|
|
|
|
|
optionMenuPause.setDisabled(true);
|
|
|
|
|
optionMenuReassign.setDisabled(true);
|
|
|
|
|
optionMenuDelete.setDisabled(true);
|
|
|
|
|
} else if( rows.length == 1 ) {
|
|
|
|
|
optionMenuOpen.setDisabled(false);
|
|
|
|
|
optionMenuPause.setDisabled(false);
|
|
|
|
|
optionMenuReassign.setDisabled(false);
|
|
|
|
|
optionMenuDelete.setDisabled(false);
|
|
|
|
|
} else {
|
|
|
|
|
optionMenuOpen.setDisabled(true);
|
|
|
|
|
optionMenuPause.setDisabled(true);
|
|
|
|
|
optionMenuReassign.setDisabled(true);
|
|
|
|
|
optionMenuDelete.setDisabled(false);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if( rows.length == 0 ) {
|
|
|
|
|
optionMenuOpen.setDisabled(true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
optionMenuOpen.setDisabled(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-08-15 19:04:55 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
var menuItems;
|
|
|
|
|
//alert(action);
|
|
|
|
|
optionMenuOpen = new Ext.Action({
|
|
|
|
|
text: _('ID_OPEN'),
|
|
|
|
|
handler: openCase,
|
|
|
|
|
disabled: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
optionMenuUnpause = new Ext.Action({
|
|
|
|
|
text: _('ID_UNPAUSE_CASE'),
|
|
|
|
|
iconCls: 'ICON_CASES_UNPAUSE',
|
|
|
|
|
handler: unpauseCase
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
optionMenuPause = new Ext.Action({
|
|
|
|
|
text: _('ID_PAUSE_CASE'),
|
|
|
|
|
iconCls: 'ICON_CASES_PAUSED',
|
|
|
|
|
menu: new Ext.menu.DateMenu({
|
|
|
|
|
//vtype: 'daterange',
|
|
|
|
|
handler: function(dp, date){
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'casesList_Ajax' ,
|
|
|
|
|
params : {actionAjax : 'verifySession'},
|
|
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.lostSession ) {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title: _('ID_ERROR'),
|
|
|
|
|
msg: data.message,
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
fn : function(btn) {
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
prnt = parent.parent;
|
|
|
|
|
top.location = top.location;
|
|
|
|
|
}
|
|
|
|
|
catch (err)
|
|
|
|
|
{
|
|
|
|
|
parent.location = parent.location;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
pauseCase(date);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var optionMenuSummary = new Ext.Action({
|
|
|
|
|
text: _('ID_SUMMARY'),
|
|
|
|
|
iconCls: 'x-tree-node-icon ss_application_form',
|
|
|
|
|
handler: caseSummary
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
optionMenuNotes = new Ext.Action({
|
|
|
|
|
text: _('ID_CASES_NOTES'),
|
|
|
|
|
iconCls: 'ICON_CASES_NOTES',
|
|
|
|
|
handler: caseNotes
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
reassingCaseToUser = function()
|
|
|
|
|
{
|
|
|
|
|
var APP_UID = optionMenuReassignGlobal.APP_UID;
|
|
|
|
|
var DEL_INDEX = optionMenuReassignGlobal.DEL_INDEX;
|
|
|
|
|
|
2016-01-11 17:36:00 -04:00
|
|
|
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
if( rowSelected ) {
|
2016-06-23 18:17:35 -04:00
|
|
|
if (Ext.getCmp('idTextareaReasonCasesList').getValue() === '') {
|
|
|
|
|
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_EMPTY'));
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
|
|
|
|
|
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
|
|
|
|
|
loadMask.show();
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'casesList_Ajax' ,
|
2016-06-23 18:17:35 -04:00
|
|
|
params : {actionAjax : 'reassignCase', USR_UID: rowSelected.data.USR_UID, APP_UID: APP_UID, DEL_INDEX:DEL_INDEX, NOTE_REASON: Ext.getCmp('idTextareaReasonCasesList').getValue(), NOTIFY_REASSIGN: Ext.getCmp('idCheckboxReasonCasesList').getValue()},
|
2015-06-11 11:27:12 -04:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.status == 0 ) {
|
|
|
|
|
try {
|
|
|
|
|
parent.notify('', data.msg);
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
} else {
|
|
|
|
|
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
|
|
|
|
|
loadMask.hide();
|
|
|
|
|
winReassignInCasesList.hide();
|
|
|
|
|
alert(data.msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
|
|
|
|
|
loadMask.hide();
|
|
|
|
|
winReassignInCasesList.hide();
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
2012-10-16 15:22:18 -04:00
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
//optionMenuPause.setMinValue('2010-11-04');
|
|
|
|
|
|
2016-01-11 17:36:00 -04:00
|
|
|
var loadMaskUsersToReassign = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING_GRID")});
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var optionMenuReassignGlobal = {};
|
|
|
|
|
optionMenuReassignGlobal.APP_UID = "";
|
|
|
|
|
optionMenuReassignGlobal.DEL_INDEX = "";
|
|
|
|
|
|
|
|
|
|
optionMenuReassign = new Ext.Action({
|
|
|
|
|
text: _('ID_REASSIGN'),
|
|
|
|
|
iconCls: 'ICON_CASES_TO_REASSIGN',
|
|
|
|
|
handler: function() {
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'casesList_Ajax' ,
|
|
|
|
|
params : {actionAjax : 'verifySession'},
|
|
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.lostSession ) {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title: _('ID_ERROR'),
|
|
|
|
|
msg: data.message,
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
fn : function(btn) {
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
prnt = parent.parent;
|
|
|
|
|
top.location = top.location;
|
|
|
|
|
}
|
|
|
|
|
catch (err)
|
|
|
|
|
{
|
|
|
|
|
parent.location = parent.location;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
var casesGrid_ = Ext.getCmp('casesGrid');
|
|
|
|
|
var rowSelected = casesGrid_.getSelectionModel().getSelected();
|
|
|
|
|
var rowAllJsonArray = casesGrid_.store.reader.jsonData.data;
|
|
|
|
|
var rowSelectedIndex = casesGrid_.getSelectionModel().lastActive;
|
|
|
|
|
var rowSelectedJsonArray = rowAllJsonArray[rowSelectedIndex];
|
|
|
|
|
|
|
|
|
|
var TAS_UID = rowSelectedJsonArray.TAS_UID;
|
|
|
|
|
var USR_UID = rowSelectedJsonArray.USR_UID;
|
|
|
|
|
|
|
|
|
|
var APP_UID = rowSelectedJsonArray.APP_UID;
|
|
|
|
|
var DEL_INDEX = rowSelectedJsonArray.DEL_INDEX;
|
|
|
|
|
|
|
|
|
|
optionMenuReassignGlobal.APP_UID = APP_UID;
|
|
|
|
|
optionMenuReassignGlobal.DEL_INDEX = DEL_INDEX;
|
|
|
|
|
if( rowSelected ){
|
2016-01-11 17:36:00 -04:00
|
|
|
//Variables
|
|
|
|
|
var pageSizeUsersToReassign = 10;
|
|
|
|
|
|
|
|
|
|
//Stores
|
|
|
|
|
var storeUsersToReassign = new Ext.data.Store({
|
|
|
|
|
proxy: new Ext.data.HttpProxy({
|
|
|
|
|
url: "casesList_Ajax",
|
|
|
|
|
method: "POST"
|
2015-06-11 11:27:12 -04:00
|
|
|
}),
|
2016-01-11 17:36:00 -04:00
|
|
|
|
|
|
|
|
reader: new Ext.data.JsonReader({
|
|
|
|
|
root: "resultRoot",
|
|
|
|
|
totalProperty: "resultTotal",
|
|
|
|
|
fields: [
|
|
|
|
|
{name : "USR_UID"},
|
|
|
|
|
{name : "USR_USERNAME"},
|
|
|
|
|
{name : "USR_FIRSTNAME"},
|
|
|
|
|
{name : "USR_LASTNAME"}
|
2015-06-11 11:27:12 -04:00
|
|
|
]
|
2016-01-11 17:36:00 -04:00
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
remoteSort: true,
|
|
|
|
|
|
|
|
|
|
listeners: {
|
|
|
|
|
beforeload: function (store)
|
|
|
|
|
{
|
|
|
|
|
winReassignInCasesList.setDisabled(true);
|
|
|
|
|
|
|
|
|
|
loadMaskUsersToReassign.show();
|
|
|
|
|
|
|
|
|
|
this.baseParams = {
|
|
|
|
|
actionAjax: "getUsersToReassign",
|
|
|
|
|
taskUid: TAS_UID,
|
|
|
|
|
search: Ext.getCmp("txtSearchUsersToReassign").getValue(),
|
|
|
|
|
pageSize: pageSizeUsersToReassign
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
load: function (store, record, opt)
|
|
|
|
|
{
|
|
|
|
|
winReassignInCasesList.setDisabled(false);
|
|
|
|
|
|
|
|
|
|
loadMaskUsersToReassign.hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
2016-01-11 17:36:00 -04:00
|
|
|
//Components
|
|
|
|
|
var pagingUsersToReassign = new Ext.PagingToolbar({
|
|
|
|
|
id: "pagingUsersToReassign",
|
2015-06-11 11:27:12 -04:00
|
|
|
|
2016-01-11 17:36:00 -04:00
|
|
|
pageSize: pageSizeUsersToReassign,
|
|
|
|
|
store: storeUsersToReassign,
|
|
|
|
|
displayInfo: true,
|
|
|
|
|
displayMsg: _("ID_DISPLAY_ITEMS"),
|
|
|
|
|
emptyMsg: _("ID_NO_RECORDS_FOUND")
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var cmodelUsersToReassign = new Ext.grid.ColumnModel({
|
|
|
|
|
defaults: {
|
|
|
|
|
width: 200,
|
|
|
|
|
sortable: true
|
2015-06-11 11:27:12 -04:00
|
|
|
},
|
2016-01-11 17:36:00 -04:00
|
|
|
columns: [
|
|
|
|
|
{id: "USR_UID", dataIndex: "USR_UID", hidden: true, hideable: false},
|
|
|
|
|
{id: "USR_FIRSTNAME", dataIndex: "USR_FIRSTNAME", header: _("ID_FIRSTNAME"), width: 300},
|
|
|
|
|
{id: "USR_LASTNAME", dataIndex: "USR_LASTNAME", header: _("ID_LASTNAME"), width: 300}
|
|
|
|
|
]
|
|
|
|
|
});
|
2015-06-11 11:27:12 -04:00
|
|
|
|
2016-01-11 17:36:00 -04:00
|
|
|
var smodelUsersToReassign = new Ext.grid.RowSelectionModel({
|
|
|
|
|
singleSelect: true
|
|
|
|
|
});
|
2016-06-23 18:17:35 -04:00
|
|
|
|
|
|
|
|
var textareaReason = new Ext.form.TextArea({
|
|
|
|
|
id: 'idTextareaReasonCasesList',
|
|
|
|
|
disabled: true,
|
|
|
|
|
fieldLabel : _('ID_REASON_REASSIGN'),
|
|
|
|
|
emptyText: _('ID_REASON_REASSIGN') + '...',
|
|
|
|
|
enableKeyEvents: true,
|
|
|
|
|
width: 200
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var checkboxReason = new Ext.form.Checkbox({
|
|
|
|
|
id: 'idCheckboxReasonCasesList',
|
|
|
|
|
disabled: true,
|
|
|
|
|
fieldLabel : _('ID_NOTIFY_USERS_CASE'),
|
|
|
|
|
labelSeparator: '',
|
|
|
|
|
labelStyle: 'margin-left:150px;position:absolute;'
|
|
|
|
|
});
|
2016-01-11 17:36:00 -04:00
|
|
|
|
|
|
|
|
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
|
|
|
|
|
id: "grdpnlUsersToReassign",
|
|
|
|
|
|
|
|
|
|
store: storeUsersToReassign,
|
|
|
|
|
colModel: cmodelUsersToReassign,
|
|
|
|
|
selModel: smodelUsersToReassign,
|
2016-06-23 18:17:35 -04:00
|
|
|
height: 200,
|
2016-01-11 17:36:00 -04:00
|
|
|
columnLines: true,
|
|
|
|
|
viewConfig: {forceFit: true},
|
|
|
|
|
enableColumnResize: true,
|
|
|
|
|
enableHdMenu: true,
|
2015-06-11 11:27:12 -04:00
|
|
|
|
2016-01-11 17:36:00 -04:00
|
|
|
tbar: [
|
2015-06-11 11:27:12 -04:00
|
|
|
{
|
2016-01-11 17:36:00 -04:00
|
|
|
text: _("ID_REASSIGN"),
|
|
|
|
|
iconCls: "ICON_CASES_TO_REASSIGN",
|
|
|
|
|
|
|
|
|
|
handler: function ()
|
|
|
|
|
{
|
2015-06-11 11:27:12 -04:00
|
|
|
reassingCaseToUser();
|
|
|
|
|
}
|
2016-01-11 17:36:00 -04:00
|
|
|
},
|
|
|
|
|
"->",
|
|
|
|
|
{
|
|
|
|
|
xtype: "textfield",
|
|
|
|
|
id: "txtSearchUsersToReassign",
|
|
|
|
|
|
|
|
|
|
emptyText: _("ID_EMPTY_SEARCH"),
|
|
|
|
|
width: 150,
|
|
|
|
|
allowBlank: true,
|
|
|
|
|
|
|
|
|
|
listeners: {
|
|
|
|
|
specialkey: function (f, e)
|
|
|
|
|
{
|
|
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
|
|
pagingUsersToReassign.moveFirst();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "X",
|
|
|
|
|
ctCls: "pm_search_x_button",
|
|
|
|
|
|
|
|
|
|
handler: function ()
|
|
|
|
|
{
|
|
|
|
|
Ext.getCmp("txtSearchUsersToReassign").reset();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: _("ID_SEARCH"),
|
|
|
|
|
|
|
|
|
|
handler: function ()
|
|
|
|
|
{
|
|
|
|
|
pagingUsersToReassign.moveFirst();
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
],
|
2016-01-11 17:36:00 -04:00
|
|
|
bbar: pagingUsersToReassign,
|
|
|
|
|
|
2016-06-23 18:17:35 -04:00
|
|
|
title: "",
|
|
|
|
|
listeners: {
|
|
|
|
|
click: function () {
|
|
|
|
|
textareaReason.enable();
|
|
|
|
|
checkboxReason.enable();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
winReassignInCasesList = new Ext.Window({
|
|
|
|
|
title: '',
|
|
|
|
|
width: 450,
|
2016-01-11 17:36:00 -04:00
|
|
|
height: 350,
|
2016-06-23 18:17:35 -04:00
|
|
|
layout:'auto',
|
2015-06-11 11:27:12 -04:00
|
|
|
autoScroll:true,
|
|
|
|
|
modal: true,
|
2016-06-23 18:17:35 -04:00
|
|
|
resizable: false,
|
2015-06-11 11:27:12 -04:00
|
|
|
maximizable: false,
|
2016-06-23 18:17:35 -04:00
|
|
|
items: [{
|
|
|
|
|
xtype: 'fieldset',
|
|
|
|
|
labelWidth: 130,
|
|
|
|
|
border: false,
|
|
|
|
|
items: [
|
|
|
|
|
textareaReason,
|
|
|
|
|
checkboxReason
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
grdpnlUsersToReassign
|
|
|
|
|
]
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
2016-01-11 17:36:00 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
winReassignInCasesList.show();
|
2016-01-11 17:36:00 -04:00
|
|
|
|
|
|
|
|
grdpnlUsersToReassign.store.load();
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
optionMenuDelete = new Ext.Action({
|
|
|
|
|
text: _('ID_DELETE'),
|
|
|
|
|
iconCls: 'ICON_CASES_DELETE',
|
|
|
|
|
handler: deleteCase
|
|
|
|
|
});
|
|
|
|
|
optionMenuCancel = new Ext.Action({
|
|
|
|
|
text: _('ID_CANCEL'),
|
|
|
|
|
iconCls: 'ICON_CASES_CANCEL',
|
|
|
|
|
handler: cancelCase
|
|
|
|
|
});
|
|
|
|
|
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
switch(action){
|
|
|
|
|
case 'todo':
|
|
|
|
|
menuItems = [optionMenuPause, optionMenuSummary, optionMenuNotes];
|
2012-07-27 16:39:26 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
if( ___p34315105.search('R') != -1 )
|
|
|
|
|
menuItems.push(optionMenuReassign);
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
break;
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
case 'draft':
|
|
|
|
|
menuItems = [optionMenuPause, optionMenuSummary, optionMenuNotes];
|
|
|
|
|
if( ___p34315105.search('R') != -1 )
|
|
|
|
|
menuItems.push(optionMenuReassign);
|
|
|
|
|
menuItems.push(optionMenuDelete);
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
break;
|
2012-08-15 19:04:55 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
case 'paused':
|
|
|
|
|
menuItems = [optionMenuUnpause, optionMenuSummary, optionMenuNotes];
|
|
|
|
|
break;
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
default:
|
|
|
|
|
menuItems = [optionMenuSummary, optionMenuNotes]
|
2012-06-21 17:48:08 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
contextMenuItems = new Array();
|
|
|
|
|
contextMenuItems.push(optionMenuOpen);
|
|
|
|
|
for (i=0; i<menuItems.length; i++) {
|
|
|
|
|
contextMenuItems.push(menuItems[i]);
|
|
|
|
|
}
|
|
|
|
|
var messageContextMenu = new Ext.menu.Menu({
|
|
|
|
|
id: 'messageContextMenu',
|
|
|
|
|
items: contextMenuItems
|
2012-06-21 17:48:08 -04:00
|
|
|
});
|
2012-08-15 19:04:55 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
//
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var dateFrom = new Ext.form.DateField({
|
|
|
|
|
id:'dateFrom',
|
|
|
|
|
format: 'Y-m-d',
|
|
|
|
|
width: 120,
|
|
|
|
|
editable: false,
|
|
|
|
|
value: ''
|
2015-03-23 14:38:19 -04:00
|
|
|
});
|
2012-09-21 13:21:47 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var dateTo = new Ext.form.DateField({
|
|
|
|
|
id:'dateTo',
|
|
|
|
|
format: 'Y-m-d',
|
|
|
|
|
width: 120,
|
|
|
|
|
editable: false,
|
|
|
|
|
value: ''
|
2012-09-17 15:57:45 -04:00
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarTodo = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
{
|
2015-07-29 17:24:10 -04:00
|
|
|
xtype: 'tbbutton',
|
2015-06-11 11:27:12 -04:00
|
|
|
text: _('ID_ACTIONS'),
|
|
|
|
|
menu: menuItems
|
|
|
|
|
},
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
btnRead,
|
|
|
|
|
'-',
|
|
|
|
|
btnUnread,
|
|
|
|
|
'-',
|
|
|
|
|
btnAll,
|
|
|
|
|
'->', // begin using the right-justified button container
|
2015-06-18 10:40:56 -04:00
|
|
|
filterStatus.length != 0 ?[
|
|
|
|
|
_('ID_OVERDUE'),
|
|
|
|
|
comboFilterStatus
|
|
|
|
|
] : [
|
|
|
|
|
],
|
2015-06-11 11:27:12 -04:00
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
'-',
|
|
|
|
|
textJump,
|
|
|
|
|
btnJump,
|
|
|
|
|
' ',
|
|
|
|
|
' '
|
|
|
|
|
];
|
2012-09-17 10:30:12 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarGeneral = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
btnRead,
|
|
|
|
|
'-',
|
|
|
|
|
btnUnread,
|
|
|
|
|
'-',
|
|
|
|
|
btnAll,
|
|
|
|
|
'->', // begin using the right-justified button container
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
'-',
|
|
|
|
|
textJump,
|
|
|
|
|
btnJump,
|
|
|
|
|
' ',
|
|
|
|
|
' '
|
|
|
|
|
];
|
2012-09-21 13:21:47 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarUnassigned = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
btnRead,
|
|
|
|
|
'-',
|
|
|
|
|
btnUnread,
|
|
|
|
|
'-',
|
|
|
|
|
btnAll,
|
|
|
|
|
'->', // begin using the right-justified button container
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
'-',
|
|
|
|
|
textJump,
|
|
|
|
|
btnJump,
|
|
|
|
|
' ',
|
|
|
|
|
' '
|
|
|
|
|
];
|
2012-09-21 13:21:47 -04:00
|
|
|
|
|
|
|
|
|
2012-09-17 10:30:12 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarDraft = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
{
|
2015-07-29 17:24:10 -04:00
|
|
|
xtype: 'tbbutton',
|
2015-06-11 11:27:12 -04:00
|
|
|
text: _('ID_ACTIONS'),
|
|
|
|
|
menu: menuItems
|
|
|
|
|
},
|
|
|
|
|
'->',
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
'-',
|
|
|
|
|
textJump,
|
|
|
|
|
btnJump,
|
|
|
|
|
' ',
|
|
|
|
|
' '
|
|
|
|
|
];
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarToRevise = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
'->', // begin using the right-justified button container
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
'-',
|
|
|
|
|
textJump,
|
|
|
|
|
btnJump,
|
|
|
|
|
' ',
|
|
|
|
|
' '
|
|
|
|
|
];
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarToReassign = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
"-",
|
|
|
|
|
btnSelectAll,
|
|
|
|
|
btnUnSelectAll,
|
|
|
|
|
"-",
|
|
|
|
|
btnReassign,
|
|
|
|
|
"->",
|
|
|
|
|
_("ID_USER"),
|
|
|
|
|
comboAllUsers,
|
|
|
|
|
"-",
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_("ID_PROCESS"),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
" ",
|
|
|
|
|
" "
|
|
|
|
|
];
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var toolbarSent = [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
btnStarted,
|
|
|
|
|
'-',
|
|
|
|
|
btnCompleted,
|
|
|
|
|
'-',
|
|
|
|
|
btnAll,
|
|
|
|
|
'->', // begin using the right-justified button container
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
_('ID_STATUS'),
|
|
|
|
|
comboStatus,
|
|
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch,
|
|
|
|
|
'-',
|
|
|
|
|
textJump,
|
|
|
|
|
btnJump,
|
|
|
|
|
' ',
|
|
|
|
|
' '
|
|
|
|
|
];
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var clearDateFrom = new Ext.Action({
|
|
|
|
|
text: "X",
|
|
|
|
|
ctCls: "pm_search_x_button_des",
|
|
|
|
|
handler: function(){
|
|
|
|
|
Ext.getCmp("dateFrom").setValue("");
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var clearDateTo = new Ext.Action({
|
|
|
|
|
text: "X",
|
|
|
|
|
ctCls: "pm_search_x_button_des",
|
|
|
|
|
handler: function(){
|
|
|
|
|
Ext.getCmp("dateTo").setValue("");
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var toolbarSearch = [
|
|
|
|
|
' ',
|
|
|
|
|
_('ID_DELEGATE_DATE_FROM'),
|
|
|
|
|
dateFrom,
|
|
|
|
|
clearDateFrom,
|
|
|
|
|
' ',
|
|
|
|
|
_('ID_TO'),
|
|
|
|
|
dateTo,
|
|
|
|
|
clearDateTo,
|
|
|
|
|
"->",
|
|
|
|
|
'-',
|
|
|
|
|
textSearch,
|
|
|
|
|
resetSearchButton,
|
|
|
|
|
btnSearch ,
|
|
|
|
|
' '
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
var firstToolbarSearch = new Ext.Toolbar({
|
|
|
|
|
region: 'north',
|
|
|
|
|
width: '100%',
|
|
|
|
|
autoHeight: true,
|
|
|
|
|
items: [
|
|
|
|
|
optionMenuOpen,
|
|
|
|
|
'->',
|
|
|
|
|
_("ID_CATEGORY"),
|
|
|
|
|
comboCategory,
|
|
|
|
|
"-",
|
|
|
|
|
_('ID_PROCESS'),
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess,
|
|
|
|
|
resetProcessButton,
|
2015-06-11 11:27:12 -04:00
|
|
|
'-',
|
|
|
|
|
_('ID_STATUS'),
|
|
|
|
|
comboStatus,
|
|
|
|
|
"-",
|
|
|
|
|
_("ID_USER"),
|
|
|
|
|
//comboUser,
|
|
|
|
|
suggestUser,
|
|
|
|
|
resetSuggestButton,
|
|
|
|
|
' '
|
|
|
|
|
//'-',
|
|
|
|
|
//textSearch,
|
|
|
|
|
//resetSearchButton,
|
|
|
|
|
//btnSearch
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
//alert(action);
|
|
|
|
|
switch (action) {
|
|
|
|
|
case 'draft' : itemToolbar = toolbarDraft; break;
|
|
|
|
|
case 'sent' : itemToolbar = toolbarSent; break;
|
|
|
|
|
case 'to_revise' : itemToolbar = toolbarToRevise; break;
|
|
|
|
|
case 'to_reassign': itemToolbar = toolbarToReassign; break;
|
|
|
|
|
case 'search' : itemToolbar = toolbarSearch; break;
|
|
|
|
|
case 'unassigned' : itemToolbar = toolbarUnassigned; break;
|
|
|
|
|
case 'gral' : itemToolbar = toolbarGeneral; break;
|
|
|
|
|
default : itemToolbar = toolbarTodo; break;
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
var tb = new Ext.Toolbar({
|
|
|
|
|
height: 33,
|
|
|
|
|
items: itemToolbar
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var mask = new Ext.LoadMask(Ext.getBody(), {msg: _('ID_LOADING')});
|
|
|
|
|
// create the editor grid
|
|
|
|
|
grid = new Ext.grid.GridPanel({
|
|
|
|
|
region: 'center',
|
|
|
|
|
id: 'casesGrid',
|
|
|
|
|
store: storeCases,
|
|
|
|
|
cm: cm,
|
|
|
|
|
loadMask: mask,
|
|
|
|
|
|
|
|
|
|
sm: new Ext.grid.RowSelectionModel({
|
|
|
|
|
selectSingle: false,
|
|
|
|
|
listeners:{
|
|
|
|
|
selectionchange: function(sm){
|
|
|
|
|
enableDisableMenuOption();
|
|
|
|
|
// switch(sm.getCount()){
|
|
|
|
|
// case 0: Ext.getCmp('assignButton').disable(); break;
|
|
|
|
|
// default: Ext.getCmp('assignButton').enable(); break;
|
|
|
|
|
// }
|
2013-06-03 18:13:38 -04:00
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
}),
|
|
|
|
|
//autoHeight: true,
|
|
|
|
|
layout: 'fit',
|
|
|
|
|
viewConfig: {
|
|
|
|
|
forceFit:true,
|
|
|
|
|
cls:"x-grid-empty",
|
|
|
|
|
emptyText: ( _('ID_NO_RECORDS_FOUND') )
|
|
|
|
|
},
|
|
|
|
|
listeners: {
|
|
|
|
|
rowdblclick: openCase,
|
|
|
|
|
render: function(){
|
|
|
|
|
//this.loadMask = new Ext.LoadMask(this.body, {msg:TRANSLATIONS.LABEL_GRID_LOADING});
|
|
|
|
|
//this.ownerCt.doLayout();
|
2012-11-15 11:46:50 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
},
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
tbar: tb,
|
|
|
|
|
// paging bar on the bottom
|
|
|
|
|
bbar: new Ext.PagingToolbar({
|
|
|
|
|
pageSize: pageSize,
|
|
|
|
|
store: storeCases,
|
|
|
|
|
displayInfo: true,
|
|
|
|
|
//displayMsg: 'Displaying items {0} - {1} of {2} ' + ' ' ,
|
|
|
|
|
displayMsg: _('ID_DISPLAY_ITEMS') + ' ',
|
|
|
|
|
emptyMsg: _('ID_DISPLAY_EMPTY')
|
|
|
|
|
})
|
|
|
|
|
});
|
2013-09-18 10:13:59 -04:00
|
|
|
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
grid.on('rowcontextmenu', function (grid, rowIndex, evt) {
|
|
|
|
|
var sm = grid.getSelectionModel();
|
|
|
|
|
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
|
|
|
|
}, this);
|
|
|
|
|
grid.on('contextmenu', function (evt) {
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
|
grid.addListener('rowcontextmenu', onMessageContextMenu,this);
|
|
|
|
|
|
|
|
|
|
// patch in order to hide the USR_UIR and PREVIOUS_USR_UID columns
|
|
|
|
|
var userIndex = grid.getColumnModel().findColumnIndex('USR_UID');
|
|
|
|
|
if ( userIndex >= 0 ) grid.getColumnModel().setHidden(userIndex, true);
|
|
|
|
|
var prevUserIndex = grid.getColumnModel().findColumnIndex('PREVIOUS_USR_UID');
|
|
|
|
|
if ( prevUserIndex >= 0 ) grid.getColumnModel().setHidden(prevUserIndex, true);
|
|
|
|
|
|
|
|
|
|
if (action=='to_reassign'){
|
|
|
|
|
//grid.getColumnModel().setHidden(0, true);
|
|
|
|
|
grid.getColumnModel().setHidden(1, true);
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
// create reusable renderer
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
// create the editor grid
|
|
|
|
|
var reassignGrid = new Ext.grid.EditorGridPanel({
|
|
|
|
|
id : Ext.id(),
|
|
|
|
|
region: 'center',
|
|
|
|
|
store: storeReassignCases,
|
|
|
|
|
cm: reassignCm,
|
|
|
|
|
|
|
|
|
|
autoHeight: true,
|
|
|
|
|
viewConfig: {
|
|
|
|
|
forceFit:true
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
|
|
|
|
|
2016-06-23 18:17:35 -04:00
|
|
|
var btnExecReassignSelected = new Ext.Button({
|
2015-06-11 11:27:12 -04:00
|
|
|
text: _('ID_REASSIGN'),
|
2016-06-23 18:17:35 -04:00
|
|
|
handler: function () {
|
2015-06-11 11:27:12 -04:00
|
|
|
var rs = storeReassignCases.getModifiedRecords();
|
|
|
|
|
if (rs.length < storeReassignCases.totalLength) {
|
2016-06-23 18:17:35 -04:00
|
|
|
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_TO_REASSIGN'), function (btn, text) {
|
|
|
|
|
if (btn == 'yes') {
|
|
|
|
|
if (!isValidNoteReason(rs)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
ExecReassign();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
2016-06-23 18:17:35 -04:00
|
|
|
if (!isValidNoteReason(rs)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
ExecReassign();
|
|
|
|
|
}
|
2013-02-05 12:22:40 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
});
|
2012-08-15 19:04:55 -04:00
|
|
|
|
2016-06-23 18:17:35 -04:00
|
|
|
function isValidNoteReason(data) {
|
|
|
|
|
var row, sw = true;
|
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
row = data[i].data;
|
|
|
|
|
if (!(row.APP_REASSIGN_USER_UID !== '' && row.NOTE_REASON !== undefined && row.NOTE_REASON !== '')) {
|
|
|
|
|
sw = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!sw) {
|
|
|
|
|
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_USER_EMPTY'));
|
|
|
|
|
}
|
|
|
|
|
return sw;
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var gridForm = new Ext.FormPanel({
|
2011-09-20 12:33:15 -04:00
|
|
|
id: 'reassign-form',
|
2016-06-23 18:17:35 -04:00
|
|
|
border: true,
|
2011-09-20 12:33:15 -04:00
|
|
|
labelAlign: 'left',
|
2016-06-23 18:17:35 -04:00
|
|
|
width: 736,
|
2011-09-20 12:33:15 -04:00
|
|
|
items: [{
|
2016-06-23 18:17:35 -04:00
|
|
|
id: 'tasksGrid',
|
|
|
|
|
columnWidth: 0.60,
|
|
|
|
|
layout: 'fit',
|
|
|
|
|
items: {
|
|
|
|
|
id: 'TasksToReassign',
|
|
|
|
|
xtype: 'editorgrid',
|
|
|
|
|
ds: storeReassignCases,
|
|
|
|
|
cm: reassignCm,
|
|
|
|
|
sm: new Ext.grid.RowSelectionModel({
|
|
|
|
|
singleSelect: true
|
|
|
|
|
}),
|
|
|
|
|
//autoExpandColumn: 'company',
|
|
|
|
|
height: 278,
|
|
|
|
|
title: _('ID_CASES_TO_REASSIGN_TASK_LIST'),
|
|
|
|
|
border: true,
|
|
|
|
|
listeners: {
|
|
|
|
|
click: function () {
|
|
|
|
|
rows = this.getSelectionModel().getSelections();
|
|
|
|
|
var application = '';
|
|
|
|
|
var task = '';
|
|
|
|
|
var currentUser = '';
|
|
|
|
|
comboUsersToReassign.disable();
|
|
|
|
|
if (rows.length > 0) {
|
|
|
|
|
comboUsersToReassign.enable();
|
|
|
|
|
var ids = '';
|
|
|
|
|
for (var i = 0; i < rows.length; i++) {
|
|
|
|
|
// filtering duplicate tasks
|
|
|
|
|
application = rows[i].get('APP_UID');
|
|
|
|
|
task = rows[i].get('TAS_UID');
|
|
|
|
|
currentUser = rows[i].get('USR_UID');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2016-06-23 18:17:35 -04:00
|
|
|
comboUsersToReassign.clearValue();
|
|
|
|
|
storeUsersToReassign.removeAll();
|
|
|
|
|
storeUsersToReassign.setBaseParam('application', application);
|
|
|
|
|
storeUsersToReassign.setBaseParam('task', task);
|
|
|
|
|
storeUsersToReassign.setBaseParam('currentUser', currentUser);
|
|
|
|
|
storeUsersToReassign.load();
|
|
|
|
|
//alert(record.USERS);
|
|
|
|
|
} // Allow rows to be rendered.
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
}
|
2016-06-23 18:17:35 -04:00
|
|
|
]
|
2011-09-20 12:33:15 -04:00
|
|
|
//renderTo: bd
|
|
|
|
|
});
|
|
|
|
|
|
2012-08-17 18:23:58 -04:00
|
|
|
//Manually trigger the data store load
|
|
|
|
|
switch (action) {
|
|
|
|
|
case "draft":
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
case "sent":
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("status", comboStatus.store.getAt(0).get(comboStatus.valueField));
|
|
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
case "to_revise":
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
case "to_reassign":
|
|
|
|
|
storeCases.setBaseParam("user", comboAllUsers.store.getAt(0).get(comboAllUsers.valueField));
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
case "search":
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("status", comboStatus.store.getAt(0).get(comboStatus.valueField));
|
2013-02-07 17:33:53 -04:00
|
|
|
//storeCases.setBaseParam("user", comboUser.store.getAt(0).get(comboUser.valueField));
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
storeCases.setBaseParam("dateFrom", dateFrom.getValue());
|
|
|
|
|
storeCases.setBaseParam("dateTo", dateTo.getValue());
|
|
|
|
|
break;
|
|
|
|
|
case "unassigned":
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
case "gral":
|
2012-11-05 15:14:51 -04:00
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
//todo
|
2012-11-05 15:14:51 -04:00
|
|
|
//paused
|
|
|
|
|
storeCases.setBaseParam("category", "");
|
|
|
|
|
storeCases.setBaseParam("process", "");
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("search", textSearch.getValue());
|
|
|
|
|
break;
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2012-08-17 18:23:58 -04:00
|
|
|
storeCases.setBaseParam("action", action);
|
|
|
|
|
storeCases.setBaseParam("start", 0);
|
|
|
|
|
storeCases.setBaseParam("limit", pageSize);
|
2013-01-29 15:18:55 -04:00
|
|
|
|
2013-02-07 17:33:53 -04:00
|
|
|
var viewText = Ext.getCmp('casesGrid').getView();
|
2013-02-05 12:22:40 -04:00
|
|
|
storeCases.removeAll();
|
2016-06-07 16:52:49 -04:00
|
|
|
|
|
|
|
|
if (action != "search" || __OPEN_APPLICATION_UID__ !== null) {
|
2013-01-29 15:18:55 -04:00
|
|
|
storeCases.load();
|
|
|
|
|
} else {
|
2013-02-07 17:33:53 -04:00
|
|
|
viewText.emptyText = _('ID_ENTER_SEARCH_CRITERIA');
|
2013-01-29 15:18:55 -04:00
|
|
|
storeCases.load( {params: { first: true}} );
|
|
|
|
|
}
|
2016-06-07 16:52:49 -04:00
|
|
|
|
|
|
|
|
__OPEN_APPLICATION_UID__ = null;
|
|
|
|
|
|
2011-09-20 12:33:15 -04:00
|
|
|
//newPopUp.add(reassignGrid);
|
|
|
|
|
newPopUp.add(gridForm);
|
|
|
|
|
newPopUp.addButton(btnExecReassignSelected);
|
|
|
|
|
//newPopUp.addButton(btnExecReassign);
|
|
|
|
|
newPopUp.addButton(btnCloseReassign);
|
|
|
|
|
|
|
|
|
|
//storeProcesses.load();
|
|
|
|
|
|
|
|
|
|
function onItemToggle(item, pressed){
|
2015-06-11 11:27:12 -04:00
|
|
|
switch ( item.id ) {
|
|
|
|
|
case 'read' :
|
|
|
|
|
btnUnread.toggle( false, true);
|
|
|
|
|
btnAll.toggle( false, true);
|
|
|
|
|
break;
|
|
|
|
|
case 'unread' :
|
|
|
|
|
btnRead.toggle( false, true);
|
|
|
|
|
btnAll.toggle( false, true);
|
|
|
|
|
break;
|
|
|
|
|
case 'started' :
|
|
|
|
|
btnAll.toggle( false, true);
|
|
|
|
|
btnCompleted.toggle( false, true);
|
|
|
|
|
break;
|
|
|
|
|
case 'completed' :
|
|
|
|
|
btnAll.toggle( false, true);
|
|
|
|
|
btnStarted.toggle( false, true);
|
|
|
|
|
break;
|
|
|
|
|
case 'all' :
|
|
|
|
|
btnRead.toggle( false, true);
|
|
|
|
|
btnUnread.toggle( false, true);
|
|
|
|
|
btnStarted.toggle( false, true);
|
|
|
|
|
btnCompleted.toggle( false, true);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(pressed){
|
|
|
|
|
storeCases.setBaseParam( 'filter', item.id );
|
|
|
|
|
} else {
|
|
|
|
|
storeCases.setBaseParam( 'filter', '' );
|
|
|
|
|
}
|
|
|
|
|
storeCases.setBaseParam( 'start', 0 );
|
|
|
|
|
storeCases.setBaseParam( 'limit', pageSize );
|
|
|
|
|
storeCases.load();
|
|
|
|
|
//storeProcesses.load();
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
$configViewport = {
|
|
|
|
|
layout: 'border',
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
id:'viewportcases',
|
|
|
|
|
items: [grid]
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
if ( action == 'search' )
|
|
|
|
|
$configViewport.items.push(firstToolbarSearch);
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
var viewport = new Ext.Viewport($configViewport);
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
//routine to hide the debug panel if it is open
|
|
|
|
|
if( typeof parent != 'undefined' ){
|
|
|
|
|
if( parent.PANEL_EAST_OPEN ){
|
|
|
|
|
parent.PANEL_EAST_OPEN = false;
|
|
|
|
|
parent.Ext.getCmp('debugPanel').hide();
|
|
|
|
|
parent.Ext.getCmp('debugPanel').ownerCt.doLayout();
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
_nodeId = '';
|
|
|
|
|
switch(action){
|
|
|
|
|
case 'draft':
|
|
|
|
|
_nodeId = "CASES_DRAFT";
|
|
|
|
|
break;
|
|
|
|
|
case 'sent':
|
|
|
|
|
_nodeId = "CASES_SENT";
|
|
|
|
|
break;
|
|
|
|
|
case 'unassigned':
|
|
|
|
|
_nodeId = "CASES_SELFSERVICE";
|
|
|
|
|
break;
|
|
|
|
|
case 'paused':
|
|
|
|
|
_nodeId = "CASES_PAUSED";
|
|
|
|
|
break;
|
|
|
|
|
case 'todo':
|
|
|
|
|
_nodeId = "CASES_INBOX";
|
|
|
|
|
break;
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if ( _nodeId != '' ){
|
|
|
|
|
treePanel1 = parent.Ext.getCmp('tree-panel')
|
|
|
|
|
if(treePanel1)
|
|
|
|
|
node = treePanel1.getNodeById(_nodeId);
|
|
|
|
|
if(node)
|
|
|
|
|
node.select();
|
2013-06-03 18:13:38 -04:00
|
|
|
}
|
2015-06-11 11:27:12 -04:00
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
2015-06-11 11:27:12 -04:00
|
|
|
try {
|
|
|
|
|
parent.updateCasesTree();
|
|
|
|
|
}
|
|
|
|
|
catch (e) {
|
|
|
|
|
// Nothing to do
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
comboCategory.setValue("");
|
2016-03-31 13:38:51 -04:00
|
|
|
suggestProcess.setValue("");
|
2015-06-11 11:27:12 -04:00
|
|
|
comboStatus.setValue("");
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
if (typeof valueFilterStatus != 'undefined') {
|
|
|
|
|
comboFilterStatus.setValue(valueFilterStatus);
|
|
|
|
|
}
|
|
|
|
|
/*----------------------------------********---------------------------------*/
|
|
|
|
|
if(typeof(comboUser) != 'undefined'){
|
|
|
|
|
comboUser.setValue("");
|
|
|
|
|
}
|
|
|
|
|
comboAllUsers.setValue("CURRENT_USER");
|
|
|
|
|
|
|
|
|
|
function reassign(){
|
|
|
|
|
storeReassignCases.removeAll();
|
|
|
|
|
var rows = grid.getSelectionModel().getSelections();
|
|
|
|
|
storeReassignCases.rejectChanges();
|
|
|
|
|
var tasks = [];
|
|
|
|
|
var sw = 0;
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'proxyReassignCasesList' ,
|
|
|
|
|
params : {actionAjax : 'verifySession'},
|
|
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.lostSession ) {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title: _('ID_ERROR'),
|
|
|
|
|
msg: data.message,
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
|
buttons: Ext.MessageBox.OK,
|
|
|
|
|
fn : function(btn) {
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
prnt = parent.parent;
|
|
|
|
|
top.location = top.location;
|
|
|
|
|
}
|
|
|
|
|
catch (err)
|
|
|
|
|
{
|
|
|
|
|
parent.location = parent.location;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
if( rows.length > 0 ) {
|
|
|
|
|
ids = '';
|
|
|
|
|
for(i=0; i<rows.length; i++) {
|
|
|
|
|
// filtering duplicate tasks
|
|
|
|
|
|
|
|
|
|
if( i != 0 ) ids += ',';
|
|
|
|
|
ids += rows[i].get('APP_UID') + "|" + rows[i].get('TAS_UID')+ "|" + rows[i].get('DEL_INDEX');
|
|
|
|
|
}
|
|
|
|
|
storeReassignCases.setBaseParam( 'APP_UIDS', ids);
|
|
|
|
|
//storeReassignCases.setBaseParam( 'action', 'to_reassign');
|
|
|
|
|
storeReassignCases.load();
|
|
|
|
|
|
|
|
|
|
newPopUp.show();
|
|
|
|
|
comboUsersToReassign.disable();
|
|
|
|
|
|
|
|
|
|
//grid = reassignGrid.store.data;
|
|
|
|
|
//Ext.Msg.alert ( grid );
|
|
|
|
|
/*
|
|
|
|
|
for( var i =0; i < grid.length; i++) {
|
|
|
|
|
grid[i].data.APP_UID = grid[i].data.USERS[0];
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title:'',
|
|
|
|
|
msg: _('ID_NO_SELECTION_WARNING'),
|
|
|
|
|
buttons: Ext.Msg.INFO,
|
|
|
|
|
fn: function(){},
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: Ext.MessageBox.INFO,
|
|
|
|
|
buttons: Ext.MessageBox.OK
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
if (typeof(result.responseText) != 'undefined') {
|
|
|
|
|
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function inArray(arr, obj) {
|
|
|
|
|
for(var i=0; i<arr.length; i++) {
|
|
|
|
|
if (arr[i] == obj) return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2011-09-20 12:33:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the additional 'advanced' VTypes -- [Begin]
|
2015-06-11 11:27:12 -04:00
|
|
|
Ext.apply(Ext.form.VTypes, {
|
|
|
|
|
daterange : function(val, field) {
|
|
|
|
|
var date = field.parseDate(val);
|
|
|
|
|
|
|
|
|
|
if(!date){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
|
|
|
|
|
var start = Ext.getCmp(field.startDateField);
|
|
|
|
|
start.setMaxValue(date);
|
|
|
|
|
start.validate();
|
|
|
|
|
this.dateRangeMax = date;
|
|
|
|
|
}
|
|
|
|
|
else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
|
|
|
|
|
var end = Ext.getCmp(field.endDateField);
|
|
|
|
|
end.setMinValue(date);
|
|
|
|
|
end.validate();
|
|
|
|
|
this.dateRangeMin = date;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* Always return true since we're only using this vtype to set the
|
|
|
|
|
* min/max allowed values (these are tested for after the vtype test)
|
|
|
|
|
*/
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
// Add the additional 'advanced' VTypes -- [End]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function msgBox(title, msg, type){
|
2015-06-11 11:27:12 -04:00
|
|
|
if( typeof('type') == 'undefined' )
|
|
|
|
|
type = 'info';
|
|
|
|
|
|
|
|
|
|
switch(type){
|
|
|
|
|
case 'error':
|
|
|
|
|
icon = Ext.MessageBox.ERROR;
|
|
|
|
|
break;
|
|
|
|
|
case 'info':
|
|
|
|
|
default:
|
|
|
|
|
icon = Ext.MessageBox.INFO;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ext.Msg.show({
|
|
|
|
|
title: title,
|
|
|
|
|
msg: msg,
|
|
|
|
|
fn: function(){},
|
|
|
|
|
animEl: 'elId',
|
|
|
|
|
icon: icon,
|
|
|
|
|
buttons: Ext.MessageBox.OK
|
|
|
|
|
});
|
2011-09-20 12:33:15 -04:00
|
|
|
}
|
2012-08-17 18:23:58 -04:00
|
|
|
|
2015-11-10 16:19:05 -04:00
|
|
|
Ext.EventManager.on(window, 'beforeunload', function () {
|
2016-04-13 15:46:29 -04:00
|
|
|
if(casesNewTab) {
|
|
|
|
|
casesNewTab.close();
|
|
|
|
|
}
|
2015-12-03 17:30:42 -04:00
|
|
|
});
|