/** * * @method * * Cancel a specified case. * * @name PMFCancelCase * @label PMF Cancel a specified case. * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCancelCase.28.29 * * @param string(32) | $caseUid | ID of the case | The unique ID of the case. * @param int | $delIndex | Delegation index of the case | The delegation index of the current task in the case. * @param string(32) | $userUid | ID user | The unique ID of the user who will cancel the case. * @return int | $result | Result of the cancelation | Returns 1 if the case is cancel successfully; otherwise, returns 0 if an error occurred. * */ function PMFCancelCase($caseUid, $delIndex, $userUid) { G::LoadClass("wsBase"); $ws = new wsBase(); $result = $ws->cancelCase($caseUid, $delIndex, $userUid); if ($result->status_code == 0) { if (isset($_SESSION['APPLICATION']) && isset($_SESSION['INDEX'])) { if ($_SESSION['APPLICATION'] == $caseUid && $_SESSION['INDEX'] == $delIndex) { if (!defined('WEB_SERVICE_VERSION')) { G::header('Location: ../cases/casesListExtJsRedirector'); die; } else { die(__('ID_PM_FUNCTION_CHANGE_CASE', SYS_LANG, array('PMFCancelCase', G::LoadTranslation('ID_CANCELLED')))); } } } return 1; } else { return 0; } }
function cancelCase($params) { $result = isValidSession($params->sessionId); if ($result->status_code != 0) { return $result; } if (ifPermission($params->sessionId, "PM_CASES") == 0) { $result = new wsResponse(2, G::LoadTranslation('ID_NOT_PRIVILEGES')); return $result; } $ws = new wsBase(); $result = $ws->cancelCase($params->caseUid, $params->delIndex, $params->userUid); return $result; }
function cancelCase($params) { $result = isValidSession($params->sessionId); if ($result->status_code != 0) { return $result; } if (ifPermission($params->sessionId, "PM_CASES") == 0) { $result = new wsResponse(2, "You do not have privileges"); return $result; } $ws = new wsBase(); $result = $ws->cancelCase($params->caseUid, $params->delIndex, $params->userUid); return $result; }