PMCORE-3383
This commit is contained in:
@@ -10,6 +10,7 @@ use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\JobsManager;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
|
||||
class WsBase
|
||||
@@ -3284,29 +3285,36 @@ class WsBase
|
||||
$_SESSION["INDEX"] = $delIndex;
|
||||
$_SESSION["USER_LOGGED"] = $userUid;
|
||||
|
||||
// Validate the appUid
|
||||
if (empty($caseUid)) {
|
||||
$result = new WsResponse(100, G::LoadTranslation("ID_REQUIRED_FIELD") . " caseUid");
|
||||
|
||||
$g->sessionVarRestore();
|
||||
|
||||
return $result;
|
||||
}
|
||||
// Validate the status
|
||||
$caseInfo = Application::getCase($caseUid);
|
||||
if ($caseInfo['APP_STATUS'] === Application::STATUS_DRAFT_NAME) {
|
||||
$result = new WsResponse(100, G::LoadTranslation("ID_DRAFT_CASES_CAN_NOT_PAUSED"));
|
||||
$g->sessionVarRestore();
|
||||
|
||||
return $result;
|
||||
}
|
||||
// Validate the index
|
||||
if (empty($delIndex)) {
|
||||
$result = new WsResponse(100, G::LoadTranslation("ID_REQUIRED_FIELD") . " delIndex");
|
||||
|
||||
$g->sessionVarRestore();
|
||||
|
||||
return $result;
|
||||
}
|
||||
// Validate the user
|
||||
if (empty($userUid)) {
|
||||
$result = new WsResponse(100, G::LoadTranslation("ID_REQUIRED_FIELD") . " userUid");
|
||||
|
||||
$g->sessionVarRestore();
|
||||
|
||||
return $result;
|
||||
}
|
||||
//Validate if status is closed
|
||||
// Validate if status is closed
|
||||
$appDelegation = new AppDelegation();
|
||||
$rows = $appDelegation->LoadParallel($caseUid, $delIndex);
|
||||
if (empty($rows)) {
|
||||
@@ -3314,7 +3322,7 @@ class WsBase
|
||||
$g->sessionVarRestore();
|
||||
return $result;
|
||||
}
|
||||
//Validate if the case is paused
|
||||
// Validate if the case is paused
|
||||
$appDelay = new AppDelay();
|
||||
$sw = $appDelay->isPaused($caseUid, $delIndex);
|
||||
if ($sw === true) {
|
||||
@@ -3322,6 +3330,7 @@ class WsBase
|
||||
$g->sessionVarRestore();
|
||||
return $result;
|
||||
}
|
||||
// Review the unpaused date
|
||||
if (strlen($unpauseDate) >= 10) {
|
||||
if (!preg_match("/^\d{4}-\d{2}-\d{2}| \d{2}:\d{2}:\d{2}$/", $unpauseDate)) {
|
||||
$result = new WsResponse(100, G::LoadTranslation("ID_INVALID_DATA") . " $unpauseDate");
|
||||
@@ -3336,7 +3345,7 @@ class WsBase
|
||||
$case = new Cases();
|
||||
$case->pauseCase($caseUid, $delIndex, $userUid, $unpauseDate);
|
||||
|
||||
//Response
|
||||
// Response
|
||||
$result = self::messageExecuteSuccessfully();
|
||||
$g->sessionVarRestore();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user