HOR-170
This commit is contained in:
@@ -590,6 +590,14 @@ class Ajax
|
|||||||
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
||||||
$result->status = 0;
|
$result->status = 0;
|
||||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||||
|
|
||||||
|
// Save the note reassign reason
|
||||||
|
if (isset($_POST['NOTE_REASON']) && $_POST['NOTE_REASON'] !== '') {
|
||||||
|
require_once ("classes/model/AppNotes.php");
|
||||||
|
$appNotes = new AppNotes();
|
||||||
|
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||||
|
$appNotes->postNewNote($_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_REASSIGN']);
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$result->status = 1;
|
$result->status = 1;
|
||||||
$result->msg = $e->getMessage();
|
$result->msg = $e->getMessage();
|
||||||
|
|||||||
@@ -365,7 +365,13 @@ function getReassignList ()
|
|||||||
);
|
);
|
||||||
$caseColumns[] = array ('header' => 'Reassigned Uid','dataIndex' => 'TAS_UID','width' => 120,'hidden' => true,'hideable' => false
|
$caseColumns[] = array ('header' => 'Reassigned Uid','dataIndex' => 'TAS_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||||
);
|
);
|
||||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASSIGN_TO' ),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_ASSIGNED_TO' ),'dataIndex' => 'APP_CURRENT_USER','width' => 170
|
||||||
|
);
|
||||||
|
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASSIGNED_TO' ),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
||||||
|
);
|
||||||
|
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASON' ),'dataIndex' => 'NOTE_REASON','width' => 170
|
||||||
|
);
|
||||||
|
$caseColumns[] = array('header' => G::LoadTranslation('ID_NOTIFY'), 'dataIndex' => 'NOTIFY_REASSIGN', 'width' => 100
|
||||||
);
|
);
|
||||||
|
|
||||||
$caseReaderFields = array ();
|
$caseReaderFields = array ();
|
||||||
@@ -380,6 +386,7 @@ function getReassignList ()
|
|||||||
$caseReaderFields[] = array ('name' => 'APP_REASSIGN_USER');
|
$caseReaderFields[] = array ('name' => 'APP_REASSIGN_USER');
|
||||||
$caseReaderFields[] = array ('name' => 'CASE_SUMMARY');
|
$caseReaderFields[] = array ('name' => 'CASE_SUMMARY');
|
||||||
$caseReaderFields[] = array ('name' => 'CASE_NOTES_COUNT');
|
$caseReaderFields[] = array ('name' => 'CASE_NOTES_COUNT');
|
||||||
|
$caseReaderFields[] = array ('name' => 'APP_CURRENT_USER');
|
||||||
|
|
||||||
return array ('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
return array ('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -213,6 +213,14 @@ if ($actionAjax == 'reassignCase') {
|
|||||||
$result = new stdClass();
|
$result = new stdClass();
|
||||||
$result->status = 0;
|
$result->status = 0;
|
||||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||||
|
|
||||||
|
// Save the note reassign reason
|
||||||
|
if (isset($_POST['NOTE_REASON']) && $_POST['NOTE_REASON'] !== '') {
|
||||||
|
require_once ("classes/model/AppNotes.php");
|
||||||
|
$appNotes = new AppNotes();
|
||||||
|
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||||
|
$res = $appNotes->postNewNote($_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_REASSIGN']);
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$result->status = 1;
|
$result->status = 1;
|
||||||
$result->msg = $e->getMessage();
|
$result->msg = $e->getMessage();
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ if (empty( $aData )) {
|
|||||||
// var_dump($sql);
|
// var_dump($sql);
|
||||||
if (is_array( $aData )) {
|
if (is_array( $aData )) {
|
||||||
$currentCasesReassigned = 0;
|
$currentCasesReassigned = 0;
|
||||||
|
require_once ("classes/model/AppNotes.php");
|
||||||
foreach ($aData as $data) {
|
foreach ($aData as $data) {
|
||||||
$oTmpReassignCriteria = $oCasesReassignList;
|
$oTmpReassignCriteria = $oCasesReassignList;
|
||||||
$oTmpReassignCriteria->add( AppCacheViewPeer::APP_UID, $data->APP_UID );
|
$oTmpReassignCriteria->add( AppCacheViewPeer::APP_UID, $data->APP_UID );
|
||||||
@@ -66,6 +67,13 @@ if (is_array( $aData )) {
|
|||||||
$casesReassignedCount ++;
|
$casesReassignedCount ++;
|
||||||
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
|
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Save the note reassign reason
|
||||||
|
if (isset($data->NOTE_REASON) && $data->NOTE_REASON !== '') {
|
||||||
|
$appNotes = new AppNotes();
|
||||||
|
$noteContent = addslashes($data->NOTE_REASON);
|
||||||
|
$appNotes->postNewNote($row['APP_UID'], $_SESSION['USER_LOGGED'], $noteContent, isset($data->NOTIFY_REASSIGN) ? $data->NOTIFY_REASSIGN : false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$oTmpReassignCriteria = $oCasesReassignList;
|
$oTmpReassignCriteria = $oCasesReassignList;
|
||||||
|
|||||||
@@ -658,6 +658,26 @@ Ext.onReady ( function() {
|
|||||||
columns: columns
|
columns: columns
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
var reassignCm = new Ext.grid.ColumnModel({
|
var reassignCm = new Ext.grid.ColumnModel({
|
||||||
defaults: {
|
defaults: {
|
||||||
sortable: true // columns are sortable by default
|
sortable: true // columns are sortable by default
|
||||||
@@ -1500,12 +1520,16 @@ Ext.onReady ( function() {
|
|||||||
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
|
var rowSelected = Ext.getCmp("grdpnlUsersToReassign").getSelectionModel().getSelected();
|
||||||
|
|
||||||
if( rowSelected ) {
|
if( rowSelected ) {
|
||||||
|
if (Ext.getCmp('idTextareaReasonCasesList').getValue() === '') {
|
||||||
|
Ext.Msg.alert(_('ID_ALERT'), _('ID_THE_REASON_REASSIGN_EMPTY'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
|
||||||
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
|
var loadMask = new Ext.LoadMask(winReassignInCasesList.getEl(), {msg: _('ID_PROCESSING')});
|
||||||
loadMask.show();
|
loadMask.show();
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url : 'casesList_Ajax' ,
|
url : 'casesList_Ajax' ,
|
||||||
params : {actionAjax : 'reassignCase', USR_UID: rowSelected.data.USR_UID, APP_UID: APP_UID, DEL_INDEX:DEL_INDEX},
|
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()},
|
||||||
success: function ( result, request ) {
|
success: function ( result, request ) {
|
||||||
var data = Ext.util.JSON.decode(result.responseText);
|
var data = Ext.util.JSON.decode(result.responseText);
|
||||||
if( data.status == 0 ) {
|
if( data.status == 0 ) {
|
||||||
@@ -1660,6 +1684,23 @@ Ext.onReady ( function() {
|
|||||||
var smodelUsersToReassign = new Ext.grid.RowSelectionModel({
|
var smodelUsersToReassign = new Ext.grid.RowSelectionModel({
|
||||||
singleSelect: true
|
singleSelect: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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;'
|
||||||
|
});
|
||||||
|
|
||||||
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
|
var grdpnlUsersToReassign = new Ext.grid.GridPanel({
|
||||||
id: "grdpnlUsersToReassign",
|
id: "grdpnlUsersToReassign",
|
||||||
@@ -1667,7 +1708,7 @@ Ext.onReady ( function() {
|
|||||||
store: storeUsersToReassign,
|
store: storeUsersToReassign,
|
||||||
colModel: cmodelUsersToReassign,
|
colModel: cmodelUsersToReassign,
|
||||||
selModel: smodelUsersToReassign,
|
selModel: smodelUsersToReassign,
|
||||||
|
height: 200,
|
||||||
columnLines: true,
|
columnLines: true,
|
||||||
viewConfig: {forceFit: true},
|
viewConfig: {forceFit: true},
|
||||||
enableColumnResize: true,
|
enableColumnResize: true,
|
||||||
@@ -1721,18 +1762,35 @@ Ext.onReady ( function() {
|
|||||||
],
|
],
|
||||||
bbar: pagingUsersToReassign,
|
bbar: pagingUsersToReassign,
|
||||||
|
|
||||||
title: ""
|
title: "",
|
||||||
|
listeners: {
|
||||||
|
click: function () {
|
||||||
|
textareaReason.enable();
|
||||||
|
checkboxReason.enable();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
winReassignInCasesList = new Ext.Window({
|
winReassignInCasesList = new Ext.Window({
|
||||||
title: '',
|
title: '',
|
||||||
width: 450,
|
width: 450,
|
||||||
height: 350,
|
height: 350,
|
||||||
layout:'fit',
|
layout:'auto',
|
||||||
autoScroll:true,
|
autoScroll:true,
|
||||||
modal: true,
|
modal: true,
|
||||||
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
items: [grdpnlUsersToReassign]
|
items: [{
|
||||||
|
xtype: 'fieldset',
|
||||||
|
labelWidth: 130,
|
||||||
|
border: false,
|
||||||
|
items: [
|
||||||
|
textareaReason,
|
||||||
|
checkboxReason
|
||||||
|
]
|
||||||
|
},
|
||||||
|
grdpnlUsersToReassign
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
winReassignInCasesList.show();
|
winReassignInCasesList.show();
|
||||||
@@ -2164,113 +2222,93 @@ Ext.onReady ( function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var btnExecReassignSelected = new Ext.Button ({
|
var btnExecReassignSelected = new Ext.Button({
|
||||||
text: _('ID_REASSIGN'),
|
text: _('ID_REASSIGN'),
|
||||||
handler: function(){
|
handler: function () {
|
||||||
var rs = storeReassignCases.getModifiedRecords();
|
var rs = storeReassignCases.getModifiedRecords();
|
||||||
if (rs.length < storeReassignCases.totalLength) {
|
if (rs.length < storeReassignCases.totalLength) {
|
||||||
Ext.Msg.confirm( _('ID_CONFIRM'), _('ID_CONFIRM_TO_REASSIGN'), function (btn, text) {
|
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_TO_REASSIGN'), function (btn, text) {
|
||||||
if ( btn == 'yes' ) {
|
if (btn == 'yes') {
|
||||||
|
if (!isValidNoteReason(rs)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ExecReassign();
|
ExecReassign();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
if (!isValidNoteReason(rs)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ExecReassign();
|
ExecReassign();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
var gridForm = new Ext.FormPanel({
|
var gridForm = new Ext.FormPanel({
|
||||||
id: 'reassign-form',
|
id: 'reassign-form',
|
||||||
frame: true,
|
border: true,
|
||||||
labelAlign: 'left',
|
labelAlign: 'left',
|
||||||
//title: 'Company data',
|
width: 736,
|
||||||
bodyStyle:'padding:5px',
|
|
||||||
width: 750,
|
|
||||||
|
|
||||||
|
|
||||||
layout: 'column', // Specifies that the items will now be arranged in columns
|
|
||||||
items: [{
|
items: [{
|
||||||
id : 'tasksGrid',
|
id: 'tasksGrid',
|
||||||
columnWidth: 0.60,
|
columnWidth: 0.60,
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
items: {
|
items: {
|
||||||
id: 'TasksToReassign',
|
id: 'TasksToReassign',
|
||||||
xtype: 'grid',
|
xtype: 'editorgrid',
|
||||||
ds: storeReassignCases,
|
ds: storeReassignCases,
|
||||||
cm: reassignCm,
|
cm: reassignCm,
|
||||||
sm: new Ext.grid.RowSelectionModel({
|
sm: new Ext.grid.RowSelectionModel({
|
||||||
singleSelect: true
|
singleSelect: true
|
||||||
/*listeners: {
|
}),
|
||||||
rowselect: function(sm, row, rec) {
|
//autoExpandColumn: 'company',
|
||||||
Ext.getCmp("reassign-form").getForm().loadRecord(rec);
|
height: 278,
|
||||||
}
|
title: _('ID_CASES_TO_REASSIGN_TASK_LIST'),
|
||||||
}*/
|
border: true,
|
||||||
}),
|
listeners: {
|
||||||
//autoExpandColumn: 'company',
|
click: function () {
|
||||||
height: 265,
|
rows = this.getSelectionModel().getSelections();
|
||||||
title : _('ID_CASES_TO_REASSIGN_TASK_LIST'),
|
var application = '';
|
||||||
border : true,
|
var task = '';
|
||||||
|
var currentUser = '';
|
||||||
listeners: {
|
comboUsersToReassign.disable();
|
||||||
|
if (rows.length > 0) {
|
||||||
click: function() {
|
comboUsersToReassign.enable();
|
||||||
rows = this.getSelectionModel().getSelections();
|
var ids = '';
|
||||||
var application = '';
|
for (var i = 0; i < rows.length; i++) {
|
||||||
var task = '';
|
// filtering duplicate tasks
|
||||||
var currentUser = '';
|
application = rows[i].get('APP_UID');
|
||||||
comboUsersToReassign.disable();
|
task = rows[i].get('TAS_UID');
|
||||||
if( rows.length > 0 ) {
|
currentUser = rows[i].get('USR_UID');
|
||||||
comboUsersToReassign.enable();
|
}
|
||||||
var ids = '';
|
} else {
|
||||||
for(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 {
|
comboUsersToReassign.clearValue();
|
||||||
|
storeUsersToReassign.removeAll();
|
||||||
}
|
storeUsersToReassign.setBaseParam('application', application);
|
||||||
comboUsersToReassign.clearValue();
|
storeUsersToReassign.setBaseParam('task', task);
|
||||||
storeUsersToReassign.removeAll();
|
storeUsersToReassign.setBaseParam('currentUser', currentUser);
|
||||||
storeUsersToReassign.setBaseParam('application', application);
|
storeUsersToReassign.load();
|
||||||
storeUsersToReassign.setBaseParam('task', task);
|
//alert(record.USERS);
|
||||||
storeUsersToReassign.setBaseParam('currentUser', currentUser);
|
} // Allow rows to be rendered.
|
||||||
|
}
|
||||||
storeUsersToReassign.load();
|
|
||||||
//alert(record.USERS);
|
|
||||||
} // Allow rows to be rendered.
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},{
|
]
|
||||||
columnWidth: 0.4,
|
|
||||||
xtype: 'fieldset',
|
|
||||||
labelWidth: 50,
|
|
||||||
title: _('ID_USER_LIST'),
|
|
||||||
defaults: {width: 200, border:false}, // Default config options for child items
|
|
||||||
defaultType: 'textfield',
|
|
||||||
autoHeight: true,
|
|
||||||
bodyStyle: Ext.isIE ? 'text-align: left;padding:0 0 5px 15px;' : 'text-align: left; padding:10px 5px;',
|
|
||||||
border: false,
|
|
||||||
//style: {
|
|
||||||
// "margin-left": "10px", // when you add custom margin in IE 6...
|
|
||||||
// "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" // you have to adjust for it somewhere else
|
|
||||||
//},
|
|
||||||
items:
|
|
||||||
[
|
|
||||||
comboUsersToReassign,
|
|
||||||
{
|
|
||||||
xtype: 'fieldset',
|
|
||||||
border : true,
|
|
||||||
defaultType: 'textfield',
|
|
||||||
title: _('ID_INSTRUCTIONS'),
|
|
||||||
autoHeight:true,
|
|
||||||
html: _('ID_INSTRUCTIONS_TEXT')
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
//renderTo: bd
|
//renderTo: bd
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2603,4 +2641,3 @@ Ext.EventManager.on(window, 'beforeunload', function () {
|
|||||||
casesNewTab.close();
|
casesNewTab.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
| |||||||