Files
luos/workflow/engine/methods/cases/cases_StepToRevise.php

160 lines
5.2 KiB
PHP
Raw Normal View History

<?php
2015-03-16 17:26:48 -04:00
$filter = new InputFilter();
2017-12-04 13:25:35 +00:00
$_GET = $filter->xssFilterHard($_GET, "url");
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
case - 2:
2017-12-04 13:25:35 +00:00
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die();
break;
case - 1:
2017-12-04 13:25:35 +00:00
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die();
break;
}
2016-08-30 14:56:18 -04:00
//If the user does not have the permission and the user can be access from url
$processUser = new ProcessUser();
2016-10-07 14:27:54 -04:00
$userAccess = $processUser->validateUserAccess($_GET['PRO_UID'], $_SESSION['USER_LOGGED']);
2017-12-04 13:25:35 +00:00
if (!$userAccess) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die();
}
2017-12-04 13:25:35 +00:00
$_SESSION = $filter->xssFilterHard($_SESSION, "url");
if ((int) $_SESSION['INDEX'] < 1) {
2015-03-16 17:26:48 -04:00
$_SERVER['HTTP_REFERER'] = $filter->xssFilterHard($_SERVER['HTTP_REFERER']);
2017-12-04 13:25:35 +00:00
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die();
}
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
2017-12-04 13:25:35 +00:00
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oCase = new Cases();
2017-12-04 13:25:35 +00:00
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
2017-12-04 13:25:35 +00:00
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
}
2017-12-04 13:25:35 +00:00
}");
// DEPRECATED this script call is marked for removal since almost all the interface is extJS based
2017-12-04 13:25:35 +00:00
$oHeadPublisher->addScriptCode('
2011-03-25 09:14:06 -04:00
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.Package.Load("cases",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases.js"});
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
2017-12-04 13:25:35 +00:00
' . (isset($_SESSION['showCasesWindow']) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
2010-12-02 23:34:41 +00:00
});
2017-12-04 13:25:35 +00:00
');
// DEPRECATED this script call is marked for removal
2017-12-04 13:25:35 +00:00
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
2017-12-04 13:25:35 +00:00
if (! isset($_GET['type'])) {
$_GET['type'] = 'DYNAFORM';
}
2017-12-04 13:25:35 +00:00
if (! isset($_GET['position'])) {
$_GET['position'] = $_SESSION['STEP_POSITION'];
2017-12-04 13:25:35 +00:00
} else {
if ($_GET['type'] == 'DYNAFORM') {
$criteria = new Criteria();
$criteria->addSelectColumn(StepSupervisorPeer::STEP_POSITION);
$criteria->add(StepSupervisorPeer::PRO_UID, $_SESSION['PROCESS'], Criteria::EQUAL);
$criteria->add(StepSupervisorPeer::STEP_UID_OBJ, $_GET['DYN_UID'], Criteria::EQUAL);
$rsCriteria = StepSupervisorPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
2016-08-30 14:56:18 -04:00
$aRow = $rsCriteria->getRow();
$_GET['position'] = $aRow['STEP_POSITION'];
2017-12-04 13:25:35 +00:00
} else {
$_GET['position'] = 1;
}
}
$_SESSION['STEP_POSITION'] = (int) $_GET['position'];
//Obtain previous and next step - Start
2017-12-04 13:25:35 +00:00
if (isset($_GET['type'])) {
$sType = $_GET['type'];
} else {
$sType = '';
}
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
/**
* Added By erik
* date: 16-05-08
* Description: this was added for the additional database connections
*/
2017-12-04 13:25:35 +00:00
if (! isset($_GET['ex'])) {
2016-08-26 17:24:26 -04:00
$_GET['ex'] = $_GET['position'];
}
2017-12-04 13:25:35 +00:00
$oDbConnections = new DbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$G_PUBLISH = new Publisher();
if ($_GET['DYN_UID'] != '') {
$_SESSION['CURRENT_DYN_UID'] = $_GET['DYN_UID'];
2015-05-07 16:44:30 -04:00
$FieldsPmDynaform = $Fields;
$FieldsPmDynaform["PRO_UID"] = $_SESSION['PROCESS'];
$FieldsPmDynaform["CURRENT_DYNAFORM"] = $_GET['DYN_UID'];
2017-08-11 15:49:39 -04:00
$a = new PmDynaform($FieldsPmDynaform);
2015-05-07 16:44:30 -04:00
if ($a->isResponsive()) {
$a->printEditSupervisor(['DEL_INDEX' => $_GET['DEL_INDEX']]);
2017-12-04 13:25:35 +00:00
} else {
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID=' . $_GET['DYN_UID'] . '&ex=' . $_GET['ex']);
2015-05-07 16:44:30 -04:00
}
}
2017-12-04 13:25:35 +00:00
G::RenderPage('publish', 'blank');
2010-12-02 23:34:41 +00:00
?>
<script>
/*------------------------------ To Revise Routines ---------------------------*/
// DEPRECATED this JS section is marked for removal
2010-12-02 23:34:41 +00:00
function setSelect()
{
var ex=<?php echo $filter->xssFilterHard($_GET['ex'])?>;
try {
for(i=1; i<50; i++) {
if (i == ex) {
document.getElementById('focus'+i).innerHTML = '<img src="/images/bulletButton.gif" />';
} else {
document.getElementById('focus'+i).innerHTML = '';
}
}
} catch (e){
return 0;
}
2010-12-02 23:34:41 +00:00
}
</script>
<?php