HOR-736
This commit is contained in:
Paula V. Quispe
2016-04-11 15:10:09 -04:00
parent 88fe91aae6
commit deb711d8fc
5 changed files with 100 additions and 71 deletions

View File

@@ -4108,6 +4108,25 @@ class Cases
return $c; 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 * pause a Case
* *
@@ -4121,6 +4140,11 @@ class Cases
public function pauseCase($sApplicationUID, $iDelegation, $sUserUID, $sUnpauseDate = null) 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(); $oApplication = new Application();
$aFields = $oApplication->Load($sApplicationUID); $aFields = $oApplication->Load($sApplicationUID);
//get the appthread row id ( APP_THREAD_INDEX' ) //get the appthread row id ( APP_THREAD_INDEX' )

View File

@@ -3973,6 +3973,12 @@ msgstr "No fields found!"
msgid "Unassigned" msgid "Unassigned"
msgstr "Unassigned" msgstr "Unassigned"
# TRANSLATION
# LABEL/ID_UNASSIGNED_STATUS
#: LABEL/ID_UNASSIGNED_STATUS
msgid "Unassigned Status"
msgstr "Unassigned Status"
# TRANSLATION # TRANSLATION
# LABEL/ID_CLAIM # LABEL/ID_CLAIM
#: LABEL/ID_CLAIM #: LABEL/ID_CLAIM

View File

@@ -2738,12 +2738,14 @@ SELECT 'LABEL','ID_SELECT_FILE_PMT_IMPORT','en','Please select a .pmt file','201
UNION ALL UNION ALL
SELECT 'LABEL','ID_SELECT_FILE_PM_IMPORT','en','Please select a .pm file','2014-01-15' SELECT 'LABEL','ID_SELECT_FILE_PM_IMPORT','en','Please select a .pm file','2014-01-15'
UNION ALL 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 UNION ALL
SELECT 'LABEL','ID_NO_FIELD_FOUND','en','No fields found!','2014-01-15' SELECT 'LABEL','ID_NO_FIELD_FOUND','en','No fields found!','2014-01-15'
UNION ALL UNION ALL
SELECT 'LABEL','ID_UNASSIGNED','en','Unassigned','2014-01-15' SELECT 'LABEL','ID_UNASSIGNED','en','Unassigned','2014-01-15'
UNION ALL UNION ALL
SELECT 'LABEL','ID_UNASSIGNED_STATUS','en','Unassigned Status','2016-04-11'
UNION ALL
SELECT 'LABEL','ID_CLAIM','en','Claim','2014-01-15' SELECT 'LABEL','ID_CLAIM','en','Claim','2014-01-15'
UNION ALL UNION ALL
SELECT 'LABEL','ID_TABLE_INVALID_SYNTAX','en','Invalid syntax','2014-01-15' SELECT 'LABEL','ID_TABLE_INVALID_SYNTAX','en','Invalid syntax','2014-01-15'

View File

@@ -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_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_NO_FIELD_FOUND','en','No fields found!','2014-01-15') ,
( 'LABEL','ID_UNASSIGNED','en','Unassigned','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_CLAIM','en','Claim','2014-01-15') ,
( 'LABEL','ID_TABLE_INVALID_SYNTAX','en','Invalid syntax','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') , ( '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') ,

View File

@@ -1315,80 +1315,76 @@ Ext.onReady(function(){
Actions.pauseCase = function() Actions.pauseCase = function()
{ {
Ext.Ajax.request({ Ext.Ajax.request({
url : 'ajaxListener' , url : 'ajaxListener' ,
params : {action : 'verifySession'}, params : {action : 'verifySession'},
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.lostSession ) { if( data.lostSession ) {
Ext.Msg.show({ Ext.Msg.show({
title: _('ID_ERROR'), title: _('ID_ERROR'),
msg: data.message, msg: data.message,
animEl: 'elId', animEl: 'elId',
icon: Ext.MessageBox.ERROR, icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK, buttons: Ext.MessageBox.OK,
fn : function(btn) { fn : function(btn) {
try try{
{ prnt = parent.parent;
prnt = parent.parent; top.location = top.location;
top.location = top.location; } catch (err){
} parent.location = parent.location;
catch (err) }
{ }
parent.location = parent.location; });
}
}
});
} else { } else {
if (Ext.getCmp('noteReason').getValue() != '') { if (Ext.getCmp('noteReason').getValue() != '') {
var noteReasonTxt = _('ID_CASE_PAUSE_LABEL_NOTE') + ' ' + Ext.getCmp('noteReason').getValue(); var noteReasonTxt = _('ID_CASE_PAUSE_LABEL_NOTE') + ' ' + Ext.getCmp('noteReason').getValue();
} else { } else {
var noteReasonTxt = ''; var noteReasonTxt = '';
} }
var notifyReasonVal = Ext.getCmp('notifyReason').getValue() == true ? 1 : 0; var notifyReasonVal = Ext.getCmp('notifyReason').getValue() == true ? 1 : 0;
var paramsNote = '&NOTE_REASON=' + noteReasonTxt + '&NOTIFY_PAUSE=' + notifyReasonVal; 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(); Ext.getCmp('unpauseFrm').getForm().submit({
if( unpauseDate == '') { waitTitle : " ",
//Ext.getCmp('submitPauseCase').setDisabled(true); url:'ajaxListener',
return; method : 'post',
} else params : {
//Ext.getCmp('submitPauseCase').enable(); action: 'pauseCase',
unpauseDate:unpauseDate,
unpauseDate = unpauseDate.format('Y-m-d'); NOTE_REASON: noteReasonTxt,
NOTIFY_PAUSE: notifyReasonVal
Ext.getCmp('unpauseFrm').getForm().submit({ },
waitTitle : " ", waitMsg:'Pausing Case '+stringReplace("\\: ", "", _APP_NUM)+'...',
url:'ajaxListener', timeout : 36000,
method : 'post', success : function(res, req) {
params : { if(req.result.success) {
action: 'pauseCase', try {
unpauseDate:unpauseDate, parent.notify('PAUSE CASE', req.result.msg);
NOTE_REASON: noteReasonTxt, }catch (e) {
NOTIFY_PAUSE: notifyReasonVal }
}, location.href = urlToRedirectAfterPause;
waitMsg:'Pausing Case '+stringReplace("\\: ", "", _APP_NUM)+'...', } else {
timeout : 36000, PMExt.error(_('ID_ERROR'), req.result.msg);
success : function(res, req) { }
if(req.result.success) { },
try { failure: function ( res, req) {
parent.notify('PAUSE CASE', req.result.msg); PMExt.error(_('ID_ERROR'), req.result.msg);
} }
catch (e) { });
} }
location.href = urlToRedirectAfterPause; },
} else { failure: function ( result, request) {
PMExt.error(_('ID_ERROR'), req.result.msg); if (typeof(result.responseText) != 'undefined') {
} Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
} }
}); }
} });
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
} }
Actions.unpauseCase = function() Actions.unpauseCase = function()