2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
2019-03-22 11:28:54 -04:00
|
|
|
CaseOptions define the menus that will show when a case is open
|
2010-12-02 23:34:41 +00:00
|
|
|
*
|
2019-03-22 11:28:54 -04:00
|
|
|
* @see Ajax::getCaseMenu()
|
|
|
|
|
* @see cases/cases_CatchSelfService.php
|
|
|
|
|
* @see cases/Cases_Resume.php
|
2010-12-02 23:34:41 +00:00
|
|
|
*
|
2019-03-22 11:28:54 -04:00
|
|
|
* @link https://wiki.processmaker.com/3.2/Cases/Running_Cases
|
2010-12-02 23:34:41 +00:00
|
|
|
*/
|
|
|
|
|
global $G_TMP_MENU;
|
|
|
|
|
global $sStatus;
|
2016-03-07 18:44:22 -04:00
|
|
|
global $RBAC;
|
2017-09-21 13:57:11 -04:00
|
|
|
|
|
|
|
|
$viewSteps = true;
|
2016-03-07 18:44:22 -04:00
|
|
|
$statusSendAndUnassigned = false;
|
2019-07-17 09:54:51 -04:00
|
|
|
$listName = $_SESSION['actionCaseOptions'];
|
2016-03-07 18:44:22 -04:00
|
|
|
//caseOptions
|
2019-07-17 09:54:51 -04:00
|
|
|
switch ($listName) {
|
2016-03-07 18:44:22 -04:00
|
|
|
case 'todo':
|
|
|
|
|
case 'draft':
|
|
|
|
|
if (isset($_SESSION['bNoShowSteps'])) {
|
|
|
|
|
unset($_SESSION['bNoShowSteps']);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'sent':
|
|
|
|
|
case 'unassigned':
|
|
|
|
|
$statusSendAndUnassigned = true;
|
|
|
|
|
break;
|
|
|
|
|
case 'paused':
|
2017-09-21 13:57:11 -04:00
|
|
|
$viewSteps = false;
|
2016-03-07 18:44:22 -04:00
|
|
|
break;
|
|
|
|
|
case 'to_revise':
|
|
|
|
|
$access = $RBAC->requirePermissions('PM_REASSIGNCASE', 'PM_SUPERVISOR');
|
|
|
|
|
if ($access) {
|
|
|
|
|
if (isset($_SESSION['bNoShowSteps'])) {
|
|
|
|
|
unset($_SESSION['bNoShowSteps']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2017-09-21 13:57:11 -04:00
|
|
|
case 'to_reassign':
|
|
|
|
|
$access = $RBAC->requirePermissions('PM_REASSIGNCASE', 'PM_SUPERVISOR');
|
|
|
|
|
if ($access) {
|
|
|
|
|
$aData = AppDelegation::getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
|
|
|
|
if (isset($aData) && !in_array($_SESSION['USER_LOGGED'], $aData)) {
|
|
|
|
|
$viewSteps = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2016-03-07 18:44:22 -04:00
|
|
|
default:
|
2017-09-21 13:57:11 -04:00
|
|
|
$aData = AppDelegation::getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
2016-03-07 18:44:22 -04:00
|
|
|
unset($_SESSION['bNoShowSteps']);
|
2017-09-21 13:57:11 -04:00
|
|
|
if (isset($aData) && !in_array($_SESSION['USER_LOGGED'], $aData)) {
|
|
|
|
|
$viewSteps = false;
|
|
|
|
|
}
|
2016-03-07 18:44:22 -04:00
|
|
|
break;
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2011-03-25 09:14:06 -04:00
|
|
|
|
2016-03-07 18:44:22 -04:00
|
|
|
unset($_SESSION['actionCaseOptions']);
|
2011-03-25 09:14:06 -04:00
|
|
|
|
2016-03-07 18:44:22 -04:00
|
|
|
if ((($sStatus === 'DRAFT') || ($sStatus === 'TO_DO')) && !$statusSendAndUnassigned) {
|
2019-03-22 11:28:54 -04:00
|
|
|
//Menu: Steps
|
|
|
|
|
if ($viewSteps === true) {
|
|
|
|
|
$G_TMP_MENU->AddIdOption('STEPS', G::LoadTranslation('ID_STEPS'), 'javascript:showSteps();', 'absolute');
|
2016-03-07 18:44:22 -04:00
|
|
|
}
|
2019-03-22 11:28:54 -04:00
|
|
|
//Menu: Information
|
|
|
|
|
$G_TMP_MENU->AddIdOption('INFO', G::LoadTranslation('ID_INFORMATION'), 'javascript:showInformation();', 'absolute');
|
|
|
|
|
//Menu: Actions
|
2016-03-07 18:44:22 -04:00
|
|
|
$G_TMP_MENU->AddIdOption('ACTIONS', G::LoadTranslation('ID_ACTIONS'), 'javascript:showActions();', 'absolute');
|
|
|
|
|
} else {
|
2019-03-22 11:28:54 -04:00
|
|
|
//Menu: Information
|
2016-03-07 18:44:22 -04:00
|
|
|
$G_TMP_MENU->AddIdOption('INFO', G::LoadTranslation('ID_INFORMATION'), 'javascript:showInformation();', 'absolute');
|
|
|
|
|
}
|
2019-03-22 11:28:54 -04:00
|
|
|
//Menu: Cases Notes
|
2016-03-07 18:44:22 -04:00
|
|
|
$G_TMP_MENU->AddIdOption('NOTES', G::LoadTranslation('ID_NOTES'), 'javascript:showNotes();', 'absolute');
|
2019-07-17 09:54:51 -04:00
|
|
|
//Menu: Return to advanced search button
|
|
|
|
|
if ($listName === 'search'){
|
|
|
|
|
$G_TMP_MENU->AddIdOption('RETURN_ADVANCED_SEARCH', G::LoadTranslation('ID_RETURN_ADVANCED_SEARCH'), 'javascript:showReturnAdvancedSearch();', 'absolute');
|
|
|
|
|
}
|