HOR-736
HOR-736
This commit is contained in:
@@ -4108,6 +4108,25 @@ class Cases
|
||||
return $c;
|
||||
}
|
||||
|
||||
/*
|
||||
* Review is an unassigned Case
|
||||
*
|
||||
* @name isUnassignedPauseCase
|
||||
* @param string $sAppUid
|
||||
* @param string $iDelegation
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isUnassignedPauseCase($sAppUid, $iDelegation){
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aFieldsDel = $oAppDelegation->Load($sAppUid, $iDelegation);
|
||||
$usrUid = $aFieldsDel['USR_UID'];
|
||||
if($usrUid === ''){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* pause a Case
|
||||
*
|
||||
@@ -4121,6 +4140,11 @@ class Cases
|
||||
|
||||
public function pauseCase($sApplicationUID, $iDelegation, $sUserUID, $sUnpauseDate = null)
|
||||
{
|
||||
// Check if the case is unassigned
|
||||
if($this->isUnassignedPauseCase($sApplicationUID, $iDelegation)){
|
||||
throw new Exception( G::LoadTranslation("ID_CASE_NOT_PAUSED", array(G::LoadTranslation("ID_UNASSIGNED_STATUS"))) );
|
||||
}
|
||||
|
||||
$oApplication = new Application();
|
||||
$aFields = $oApplication->Load($sApplicationUID);
|
||||
//get the appthread row id ( APP_THREAD_INDEX' )
|
||||
|
||||
@@ -3973,6 +3973,12 @@ msgstr "No fields found!"
|
||||
msgid "Unassigned"
|
||||
msgstr "Unassigned"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_UNASSIGNED_STATUS
|
||||
#: LABEL/ID_UNASSIGNED_STATUS
|
||||
msgid "Unassigned Status"
|
||||
msgstr "Unassigned Status"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CLAIM
|
||||
#: LABEL/ID_CLAIM
|
||||
|
||||
@@ -2738,12 +2738,14 @@ SELECT 'LABEL','ID_SELECT_FILE_PMT_IMPORT','en','Please select a .pmt file','201
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_SELECT_FILE_PM_IMPORT','en','Please select a .pm file','2014-01-15'
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_PLEASE_SELECT_PLUGIN','en','Please select the plugin','2014-01-15'
|
||||
SELECT 'LABEL','ID_PLEASE_SELECT_PLUGIN','en','Please select the plugin','2014-01-15'
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_NO_FIELD_FOUND','en','No fields found!','2014-01-15'
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_UNASSIGNED','en','Unassigned','2014-01-15'
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_UNASSIGNED_STATUS','en','Unassigned Status','2016-04-11'
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_CLAIM','en','Claim','2014-01-15'
|
||||
UNION ALL
|
||||
SELECT 'LABEL','ID_TABLE_INVALID_SYNTAX','en','Invalid syntax','2014-01-15'
|
||||
|
||||
@@ -2086,6 +2086,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_PLEASE_SELECT_PLUGIN','en','Please select the plugin','2014-01-15') ,
|
||||
( 'LABEL','ID_NO_FIELD_FOUND','en','No fields found!','2014-01-15') ,
|
||||
( 'LABEL','ID_UNASSIGNED','en','Unassigned','2014-01-15') ,
|
||||
( 'LABEL','ID_UNASSIGNED_STATUS','en','Unassigned Status','2016-04-11') ,
|
||||
( 'LABEL','ID_CLAIM','en','Claim','2014-01-15') ,
|
||||
( 'LABEL','ID_TABLE_INVALID_SYNTAX','en','Invalid syntax','2014-01-15') ,
|
||||
( 'LABEL','ID_NO_PERMISSION_NO_PARTICIPATED','en','You do not have permission to see this case or you have not participated in it.','2014-01-15') ,
|
||||
|
||||
@@ -1315,80 +1315,76 @@ Ext.onReady(function(){
|
||||
Actions.pauseCase = function()
|
||||
{
|
||||
Ext.Ajax.request({
|
||||
url : 'ajaxListener' ,
|
||||
params : {action : 'verifySession'},
|
||||
success: function ( result, request ) {
|
||||
url : 'ajaxListener' ,
|
||||
params : {action : '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;
|
||||
}
|
||||
}
|
||||
});
|
||||
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 (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;
|
||||
var paramsNote = '&NOTE_REASON=' + noteReasonTxt + '&NOTIFY_PAUSE=' + notifyReasonVal;
|
||||
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;
|
||||
var paramsNote = '&NOTE_REASON=' + noteReasonTxt + '&NOTIFY_PAUSE=' + notifyReasonVal;
|
||||
var unpauseDate = Ext.getCmp('unpauseDate').getValue();
|
||||
if( unpauseDate == '') {
|
||||
return;
|
||||
} else {
|
||||
unpauseDate = unpauseDate.format('Y-m-d');
|
||||
}
|
||||
|
||||
var unpauseDate = Ext.getCmp('unpauseDate').getValue();
|
||||
if( unpauseDate == '') {
|
||||
//Ext.getCmp('submitPauseCase').setDisabled(true);
|
||||
return;
|
||||
} else
|
||||
//Ext.getCmp('submitPauseCase').enable();
|
||||
|
||||
unpauseDate = unpauseDate.format('Y-m-d');
|
||||
|
||||
Ext.getCmp('unpauseFrm').getForm().submit({
|
||||
waitTitle : " ",
|
||||
url:'ajaxListener',
|
||||
method : 'post',
|
||||
params : {
|
||||
action: 'pauseCase',
|
||||
unpauseDate:unpauseDate,
|
||||
NOTE_REASON: noteReasonTxt,
|
||||
NOTIFY_PAUSE: notifyReasonVal
|
||||
},
|
||||
waitMsg:'Pausing Case '+stringReplace("\\: ", "", _APP_NUM)+'...',
|
||||
timeout : 36000,
|
||||
success : function(res, req) {
|
||||
if(req.result.success) {
|
||||
try {
|
||||
parent.notify('PAUSE CASE', req.result.msg);
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
location.href = urlToRedirectAfterPause;
|
||||
} else {
|
||||
PMExt.error(_('ID_ERROR'), req.result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function ( result, request) {
|
||||
if (typeof(result.responseText) != 'undefined') {
|
||||
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
Ext.getCmp('unpauseFrm').getForm().submit({
|
||||
waitTitle : " ",
|
||||
url:'ajaxListener',
|
||||
method : 'post',
|
||||
params : {
|
||||
action: 'pauseCase',
|
||||
unpauseDate:unpauseDate,
|
||||
NOTE_REASON: noteReasonTxt,
|
||||
NOTIFY_PAUSE: notifyReasonVal
|
||||
},
|
||||
waitMsg:'Pausing Case '+stringReplace("\\: ", "", _APP_NUM)+'...',
|
||||
timeout : 36000,
|
||||
success : function(res, req) {
|
||||
if(req.result.success) {
|
||||
try {
|
||||
parent.notify('PAUSE CASE', req.result.msg);
|
||||
}catch (e) {
|
||||
}
|
||||
location.href = urlToRedirectAfterPause;
|
||||
} else {
|
||||
PMExt.error(_('ID_ERROR'), req.result.msg);
|
||||
}
|
||||
},
|
||||
failure: function ( res, req) {
|
||||
PMExt.error(_('ID_ERROR'), req.result.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function ( result, request) {
|
||||
if (typeof(result.responseText) != 'undefined') {
|
||||
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Actions.unpauseCase = function()
|
||||
|
||||
Reference in New Issue
Block a user