Merged in bugfix/PMC-435 (pull request #6769)

PMC-435

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly
2019-02-01 19:55:06 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 23 additions and 2 deletions

View File

@@ -3205,7 +3205,12 @@ class WsBase
* @param string userUid : The unique ID of the user who will pause the case.
* @param string unpauseDate : Optional parameter. The date in the format "yyyy-mm-dd" indicating when to unpause
* the case.
*
*
* @see workflow/engine/classes/class.pmFunctions.php::PMFPauseCase()
* @see workflow/engine/methods/services/soap2.php::pauseCase()
*
* @link https://wiki.processmaker.com/3.3/ProcessMaker_Functions/Case_Functions#PMFPauseCase.28.29
*
* @return $result will return an object
*/
public function pauseCase($caseUid, $delIndex, $userUid, $unpauseDate = null)
@@ -3241,6 +3246,22 @@ class WsBase
return $result;
}
//Validate if status is closed
$appDelegation = new AppDelegation();
$rows = $appDelegation->LoadParallel($caseUid, $delIndex);
if (empty($rows)) {
$result = new WsResponse(100, G::LoadTranslation('ID_CASE_DELEGATION_ALREADY_CLOSED'));
$g->sessionVarRestore();
return $result;
}
//Validate if the case is paused
$appDelay = new AppDelay();
$sw = $appDelay->isPaused($caseUid, $delIndex);
if ($sw === true) {
$result = new WsResponse(19, G::LoadTranslation('ID_CASE_IN_STATUS') . " " . AppDelay::APP_TYPE_PAUSE);
$g->sessionVarRestore();
return $result;
}
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");