3
0
Files
tomolino-processmaker/front/case.front.php

41 lines
1.5 KiB
PHP
Raw Normal View History

<?php
include_once '../../../inc/includes.php';
// check if it is from PM pages
if (isset( $_REQUEST['UID'] ) && isset( $_REQUEST['APP_UID'] ) && isset( $_REQUEST['__DynaformName__'] )) {
2017-04-28 14:57:49 +02:00
// then get item id from DB
$myCase = new PluginProcessmakerCase;
if ($myCase->getFromDB( $_REQUEST['APP_UID'] )) {
$myProcessMaker = new PluginProcessmakerProcessmaker();
$myProcessMaker->login( );
if (isset( $_REQUEST['form'] )) {
2017-02-28 13:56:37 +01:00
$myProcessMaker->derivateCase( $myCase, $_REQUEST); //, $_SERVER['HTTP_COOKIE'] ) ;
2017-04-28 14:57:49 +02:00
}
}
} else if (isset( $_REQUEST['form'] ) && isset( $_REQUEST['form']['BTN_CATCH'] ) && isset( $_REQUEST['form']['APP_UID'])) {
2017-04-28 14:57:49 +02:00
// Claim task management
// here we are in a Claim request
$myCase = new PluginProcessmakerCase;
if ($myCase->getFromDB( $_REQUEST['form']['APP_UID'] )) {
$myProcessMaker = new PluginProcessmakerProcessmaker();
$myProcessMaker->login( );
2017-04-28 14:57:49 +02:00
$pmClaimCase = $myProcessMaker->claimCase( $myCase->getID(), $_REQUEST['DEL_INDEX'] );
2017-04-28 14:57:49 +02:00
// now manage tasks associated with item
$myProcessMaker->claimTask( $myCase->getID(), $_REQUEST['DEL_INDEX'] );
2017-04-28 14:57:49 +02:00
}
}
// now redirect to item form page
$config = PluginProcessmakerConfig::getInstance();
2017-04-28 14:57:49 +02:00
echo "<html><body><script>";
if (isset($config->fields['domain']) && $config->fields['domain'] != '') {
2017-04-28 14:57:49 +02:00
echo "document.domain='{$config->fields['domain']}';";
}
echo "</script><input id='GLPI_FORCE_RELOAD' type='hidden' value='GLPI_FORCE_RELOAD'/></body></html>";