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
|
||||
|
||||
@@ -2744,6 +2744,8 @@ 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') ,
|
||||
|
||||
@@ -1327,13 +1327,10 @@ Ext.onReady(function(){
|
||||
icon: Ext.MessageBox.ERROR,
|
||||
buttons: Ext.MessageBox.OK,
|
||||
fn : function(btn) {
|
||||
try
|
||||
{
|
||||
try{
|
||||
prnt = parent.parent;
|
||||
top.location = top.location;
|
||||
}
|
||||
catch (err)
|
||||
{
|
||||
} catch (err){
|
||||
parent.location = parent.location;
|
||||
}
|
||||
}
|
||||
@@ -1346,15 +1343,12 @@ Ext.onReady(function(){
|
||||
}
|
||||
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 == '') {
|
||||
//Ext.getCmp('submitPauseCase').setDisabled(true);
|
||||
return;
|
||||
} else
|
||||
//Ext.getCmp('submitPauseCase').enable();
|
||||
|
||||
} else {
|
||||
unpauseDate = unpauseDate.format('Y-m-d');
|
||||
}
|
||||
|
||||
Ext.getCmp('unpauseFrm').getForm().submit({
|
||||
waitTitle : " ",
|
||||
@@ -1372,13 +1366,15 @@ Ext.onReady(function(){
|
||||
if(req.result.success) {
|
||||
try {
|
||||
parent.notify('PAUSE CASE', req.result.msg);
|
||||
}
|
||||
catch (e) {
|
||||
}catch (e) {
|
||||
}
|
||||
location.href = urlToRedirectAfterPause;
|
||||
} else {
|
||||
PMExt.error(_('ID_ERROR'), req.result.msg);
|
||||
}
|
||||
},
|
||||
failure: function ( res, req) {
|
||||
PMExt.error(_('ID_ERROR'), req.result.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user