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

127 lines
4.7 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;
}
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();
}
/* GET , POST & $_SESSION Vars */
2010-12-02 23:34:41 +00:00
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* 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();
2017-12-04 13:25:35 +00:00
$oHeadPublisher = headPublisher::getSingleton();
// Check if these code needs to be removed since the interface ar now moving to ExtJS
2017-12-04 13:25:35 +00:00
$oHeadPublisher->addScriptCode('
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
');
// Check if these code needs to be removed since the interface ar now moving to ExtJS
2017-12-04 13:25:35 +00:00
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
2017-12-04 13:25:35 +00:00
if (! isset($_GET['position'])) {
$_GET['position'] = 1;
}
$_SESSION['STEP_POSITION'] = (int) $_GET['position'];
$oCase = new Cases();
2017-12-04 13:25:35 +00:00
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$G_PUBLISH = new Publisher();
2016-09-22 17:47:09 -04:00
$ex = 0;
2017-12-04 13:25:35 +00:00
if (! isset($_GET['ex']) || empty($_GET['ex'])) {
$_GET['ex'] = 0;
2016-09-22 17:47:09 -04:00
} else {
$ex = $filter->xssFilterHard($_GET['ex']);
}
2017-12-04 13:25:35 +00:00
if (! isset($_GET['INP_DOC_UID'])) {
$oCase = new Cases();
2017-12-04 13:25:35 +00:00
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_InputdocsListToRevise', $oCase->getInputDocumentsCriteriaToRevise($_SESSION['APPLICATION']), '');
} else {
$oInputDocument = new InputDocument();
2017-12-04 13:25:35 +00:00
$Fields = $oInputDocument->load($_GET['INP_DOC_UID']);
switch ($Fields['INP_DOC_FORM_NEEDED']) {
case 'REAL':
2017-12-04 13:25:35 +00:00
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_NEW');
$sXmlForm = 'cases/cases_AttachInputDocument2';
break;
case 'VIRTUAL':
2017-12-04 13:25:35 +00:00
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_ATTACH');
$sXmlForm = 'cases/cases_AttachInputDocument1';
break;
case 'VREAL':
2017-12-04 13:25:35 +00:00
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_ATTACH');
$sXmlForm = 'cases/cases_AttachInputDocument3';
break;
}
2017-12-04 13:25:35 +00:00
$Fields['MESSAGE1'] = G::LoadTranslation('ID_PLEASE_ENTER_COMMENTS');
$Fields['MESSAGE2'] = G::LoadTranslation('ID_PLEASE_SELECT_FILE');
$docName = $Fields['INP_DOC_TITLE'];
2017-12-04 13:25:35 +00:00
$oHeadPublisher->addScriptCode('var documentName=\'Reviewing Input Document<br>' . $docName . '\';');
$G_PUBLISH->AddContent('view','cases/paged-table-inputDocumentsToReviseNavBar');
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocumentsToRevise', 'cases/cases_ToReviseInputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['INP_DOC_UID']), array_merge(['DOC_UID' => $_GET['INP_DOC_UID']], $Fields));
}
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 Section since the interface are now movig to ExtJS
2010-12-02 23:34:41 +00:00
function setSelect()
{
2016-09-22 17:47:09 -04:00
var ex=<?php echo $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