2011-12-22 16:56:22 -04:00
|
|
|
<?php
|
2010-12-02 23:34:41 +00:00
|
|
|
/**
|
|
|
|
|
* cases_CatchExecute.php
|
|
|
|
|
*
|
|
|
|
|
* ProcessMaker Open Source Edition
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Permissions */
|
|
|
|
|
switch ($RBAC->userCanAccess('PM_CASES'))
|
|
|
|
|
{
|
2012-07-25 10:44:00 -04:00
|
|
|
case -2:
|
|
|
|
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
|
|
|
|
G::header('location: ../login/login');
|
|
|
|
|
die;
|
|
|
|
|
break;
|
|
|
|
|
case -1:
|
|
|
|
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
|
|
|
G::header('location: ../login/login');
|
|
|
|
|
die;
|
|
|
|
|
break;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-07-25 10:44:00 -04:00
|
|
|
if (isset($_POST['form']['BTN_CANCEL'])) {
|
2012-05-09 15:51:15 -04:00
|
|
|
header ( "Location: ../cases/main");
|
|
|
|
|
die;
|
2012-07-25 10:44:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Includes */
|
|
|
|
|
G::LoadClass('case');
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-07-25 10:44:00 -04:00
|
|
|
$oCase = new Cases();
|
|
|
|
|
$sAppUid = $_SESSION['APPLICATION'];
|
|
|
|
|
$iDelIndex = $_SESSION['INDEX'];
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-07-25 10:44:00 -04:00
|
|
|
$oAppDelegation = new AppDelegation();
|
|
|
|
|
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-07-25 10:44:00 -04:00
|
|
|
//if there are no user in the delegation row, this case is still in selfservice
|
|
|
|
|
if ( $aDelegation['USR_UID'] == "" ) {
|
2010-12-02 23:34:41 +00:00
|
|
|
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
|
2012-07-25 10:44:00 -04:00
|
|
|
} else {
|
2010-12-02 23:34:41 +00:00
|
|
|
G::SendMessageText(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), 'error');
|
2012-07-25 10:44:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$validation = (SYS_SKIN != 'uxs')? 'true' : 'false';
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-07-25 10:44:00 -04:00
|
|
|
die('<script type="text/javascript">
|
|
|
|
|
if ('.$validation.') {
|
2012-05-09 15:51:15 -04:00
|
|
|
if (window.parent.frames.length != 0) {
|
2012-07-25 10:44:00 -04:00
|
|
|
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] .
|
|
|
|
|
'&action=unassigned";
|
2012-07-25 10:52:35 -04:00
|
|
|
} else {
|
2012-07-25 10:44:00 -04:00
|
|
|
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' .
|
|
|
|
|
$_SESSION['INDEX'] . '&action=unassigned";
|
2012-05-09 15:51:15 -04:00
|
|
|
}
|
2012-07-25 10:44:00 -04:00
|
|
|
} else {
|
|
|
|
|
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' .
|
|
|
|
|
$_SESSION['INDEX'] . '&action=unassigned";
|
|
|
|
|
}
|
|
|
|
|
</script>'
|
|
|
|
|
);
|
|
|
|
|
|