/** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { if ($item->getType() == 'Entity') { $collection = new RuleRightCollection(); if ($collection->canList()) { $ldaprule = new RuleRight(); $ldaprule->showAndAddRuleForm($item); } $collection = new RuleImportEntityCollection(); if ($collection->canList()) { $importrule = new RuleImportEntity(); $importrule->showAndAddRuleForm($item); } $collection = new RuleMailCollectorCollection(); if ($collection->canList()) { $mailcollector = new RuleMailCollector(); $mailcollector->showAndAddRuleForm($item); } } else { if ($item->getType() == 'SLA') { $rule = new RuleTicket(); $rule->showAndAddRuleForm($item); } else { if ($item instanceof Rule) { $item->getRuleWithCriteriasAndActions($item->getID(), 1, 1); switch ($tabnum) { case 1: $item->showCriteriasList($item->getID()); break; case 2: $item->showActionsList($item->getID()); break; } } } } return true; }
if (!isset($_POST["id"])) { exit; } if (empty($_POST["id"])) { $_POST["id"] = -1; } $sla = new SLA(); $slalevel = new SlaLevel(); if ($_POST['id'] > 0 && $sla->getFromDB($_POST['id'])) { switch ($_REQUEST['glpi_tab']) { case -1: $slalevel->showForSLA($sla); $rule = new RuleTicket(); $rule->showAndAddRuleForm($sla); Ticket::showListForItem('Sla', $_POST["id"]); Plugin::displayAction($sla, $_REQUEST['glpi_tab']); break; case 4: $rule = new RuleTicket(); $rule->showAndAddRuleForm($sla); break; case 6: Ticket::showListForItem('Sla', $_POST["id"]); break; default: if (!Plugin::displayAction($sla, $_REQUEST['glpi_tab'])) { $slalevel->showForSLA($sla); } } } ajaxFooter();