Files
tomolino-processmaker/ajax/dropdownTicketCategories.php
Tomolimo 93424d51ab GLPI 9.5 compliance
Set version to 4.0.0
2021-03-18 10:01:49 +01:00

41 lines
1.0 KiB
PHP

<?php
/**
*/
if (strpos($_SERVER['PHP_SELF'], "dropdownTicketCategories.php")) {
include ("../../../inc/includes.php");
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
} else if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}
$opt['entity'] = $_POST["entity_restrict"] ?? -1;
if (isset($_POST["condition"])) {
$opt['condition'] = $_POST["condition"];
}
$currentcateg = new ITILCategory();
$currentcateg->getFromDB($_POST['value']);
if ($_POST["type"]) {
switch ($_POST['type']) {
case Ticket::INCIDENT_TYPE :
$opt['condition']['is_incident'] = '1';
if ($currentcateg->getField('is_incident') == 1) {
$opt['value'] = $_POST['value'];
}
break;
case Ticket::DEMAND_TYPE:
$opt['condition']['is_request'] = '1';
if ($currentcateg->getField('is_request') == 1) {
$opt['value'] = $_POST['value'];
}
break;
}
}
ITILCategory::dropdown($opt);