diff --git a/workflow/engine/methods/cases/cases_CatchExecute.php b/workflow/engine/methods/cases/cases_CatchExecute.php index 4e1fce6eb..0cf3cf475 100644 --- a/workflow/engine/methods/cases/cases_CatchExecute.php +++ b/workflow/engine/methods/cases/cases_CatchExecute.php @@ -1,25 +1,9 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., - * Coral Gables, FL, 33134, USA, or email info@colosa.com. + * This page is executed when we claim the case + * + * @link https://wiki.processmaker.com/3.2/Cases/Cases#Unassigned */ if (!isset($_SESSION['USER_LOGGED'])) { $responseObject = new stdclass(); @@ -50,23 +34,23 @@ if (isset($_POST['form']['BTN_CANCEL'])) { /* Includes */ -$oCase = new Cases(); -$sAppUid = $_SESSION['APPLICATION']; -$iDelIndex = $_SESSION['INDEX']; +$case = new Cases(); +$appUid = $_SESSION['APPLICATION']; +$delIndex = $_SESSION['INDEX']; -$oAppDelegation = new AppDelegation(); -$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex); +$appDelegation = new AppDelegation(); +$delegation = $appDelegation->load($appUid, $delIndex); -//if there are no user in the delegation row, this case is still in selfservice -if ($aDelegation['USR_UID'] == "") { - $oCase->setCatchUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED']); +// if there are no user in the delegation row, this case is still in selfservice +if (empty($delegation['USR_UID'])) { + $case->setCatchUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED']); /*----------------------------------********---------------------------------*/ $licensedFeatures = PMLicensedFeatures::getSingleton(); if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) { $pmGoogle = new PmGoogleApi(); if ($pmGoogle->getServiceGmailStatus()) { $labGmail = new labelsGmail(); - $labGmail->addRelabelingToQueue($sAppUid, $iDelIndex, -1, true); + $labGmail->addRelabelingToQueue($appUid, $delIndex, -1, true); } } @@ -76,7 +60,7 @@ if ($aDelegation['USR_UID'] == "") { //add users email next task $user = new Users(); $userInfo = $user->load($_SESSION['USER_LOGGED']); - $drive->addUsersDocumentDrive($sAppUid, array($userInfo['USR_EMAIL'])); + $drive->addUsersDocumentDrive($appUid, [$userInfo['USR_EMAIL']]); } } /*----------------------------------********---------------------------------*/ @@ -97,11 +81,11 @@ unset($_SESSION['TASK']); die('');