PMCORE-1338

This commit is contained in:
Paula Quispe
2020-04-15 10:49:09 -04:00
parent b7586c06f0
commit 730c9c9997

View File

@@ -1,25 +1,9 @@
<?php <?php
/** /**
* cases_CatchExecute.php * cases_CatchExecute.php
* This page is executed when we claim the case
* *
* ProcessMaker Open Source Edition * @link https://wiki.processmaker.com/3.2/Cases/Cases#Unassigned
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
if (!isset($_SESSION['USER_LOGGED'])) { if (!isset($_SESSION['USER_LOGGED'])) {
$responseObject = new stdclass(); $responseObject = new stdclass();
@@ -50,23 +34,23 @@ if (isset($_POST['form']['BTN_CANCEL'])) {
/* Includes */ /* Includes */
$oCase = new Cases(); $case = new Cases();
$sAppUid = $_SESSION['APPLICATION']; $appUid = $_SESSION['APPLICATION'];
$iDelIndex = $_SESSION['INDEX']; $delIndex = $_SESSION['INDEX'];
$oAppDelegation = new AppDelegation(); $appDelegation = new AppDelegation();
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex); $delegation = $appDelegation->load($appUid, $delIndex);
// if there are no user in the delegation row, this case is still in selfservice // if there are no user in the delegation row, this case is still in selfservice
if ($aDelegation['USR_UID'] == "") { if (empty($delegation['USR_UID'])) {
$oCase->setCatchUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED']); $case->setCatchUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED']);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$licensedFeatures = PMLicensedFeatures::getSingleton(); $licensedFeatures = PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) { if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$pmGoogle = new PmGoogleApi(); $pmGoogle = new PmGoogleApi();
if ($pmGoogle->getServiceGmailStatus()) { if ($pmGoogle->getServiceGmailStatus()) {
$labGmail = new labelsGmail(); $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 //add users email next task
$user = new Users(); $user = new Users();
$userInfo = $user->load($_SESSION['USER_LOGGED']); $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('<script type="text/javascript"> die('<script type="text/javascript">
if (' . $validation . ') { if (' . $validation . ') {
if (window.parent.frames.length != 0) { if (window.parent.frames.length != 0) {
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned"; parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=jump";
} else { } else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned"; window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=jump";
} }
} else { } else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned"; window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=jump";
} }
</script>'); </script>');