2015-10-09 14:13:52 +02:00
|
|
|
<?php
|
2016-10-25 11:37:01 +02:00
|
|
|
include_once '../../../inc/includes.php';
|
2015-10-09 14:13:52 +02:00
|
|
|
|
|
|
|
|
// check if it is from PM pages
|
2017-05-06 18:38:24 +02:00
|
|
|
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
|
2017-05-06 18:38:24 +02:00
|
|
|
$myCase = new PluginProcessmakerCase;
|
|
|
|
|
if ($myCase->getFromDB( $_REQUEST['APP_UID'] )) {
|
|
|
|
|
$myProcessMaker = new PluginProcessmakerProcessmaker();
|
|
|
|
|
$myProcessMaker->login( );
|
2016-10-25 11:37:01 +02:00
|
|
|
|
2017-05-06 18:38:24 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-06 18:38:24 +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
|
2017-05-06 18:38:24 +02:00
|
|
|
$myCase = new PluginProcessmakerCase;
|
|
|
|
|
if ($myCase->getFromDB( $_REQUEST['form']['APP_UID'] )) {
|
|
|
|
|
$myProcessMaker = new PluginProcessmakerProcessmaker();
|
|
|
|
|
$myProcessMaker->login( );
|
2017-04-28 14:57:49 +02:00
|
|
|
|
2017-05-06 18:38:24 +02:00
|
|
|
$pmClaimCase = $myProcessMaker->claimCase( $myCase->getID(), $_REQUEST['DEL_INDEX'] );
|
2017-04-28 14:57:49 +02:00
|
|
|
|
|
|
|
|
// now manage tasks associated with item
|
2017-05-06 18:38:24 +02:00
|
|
|
$myProcessMaker->claimTask( $myCase->getID(), $_REQUEST['DEL_INDEX'] );
|
2017-04-28 14:57:49 +02:00
|
|
|
}
|
2015-10-09 14:13:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// now redirect to item form page
|
2017-05-06 18:38:24 +02:00
|
|
|
$config = PluginProcessmakerConfig::getInstance();
|
2017-04-28 14:57:49 +02:00
|
|
|
echo "<html><body><script>";
|
2017-05-06 18:38:24 +02:00
|
|
|
if (isset($config->fields['domain']) && $config->fields['domain'] != '') {
|
2017-04-28 14:57:49 +02:00
|
|
|
echo "document.domain='{$config->fields['domain']}';";
|
|
|
|
|
}
|
2017-05-06 18:38:24 +02:00
|
|
|
echo "</script><input id='GLPI_FORCE_RELOAD' type='hidden' value='GLPI_FORCE_RELOAD'/></body></html>";
|
2015-10-09 14:13:52 +02:00
|
|
|
|
|
|
|
|
|