GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.85 */ include '../inc/includes.php'; $criteria = new SlaLevelAction(); if (isset($_POST["add"])) { $criteria->check(-1, CREATE, $_POST); $criteria->add($_POST); Html::back(); } else { if (isset($_POST["update"])) { $criteria->check($_POST['id'], UPDATE); $criteria->update($_POST); Html::back(); } else { if (isset($_POST["purge"])) { $criteria->check($_POST['id'], PURGE); $criteria->delete($_POST, 1); Html::back(); }
} Html::back(); } else { if (isset($_POST["purge"])) { if (isset($_POST['id'])) { $item->check($_POST['id'], PURGE); if ($item->delete($_POST, 1)) { Event::log($_POST["id"], "slas", 4, "setup", sprintf(__('%s purges a sla level'), $_SESSION["glpiname"])); } $item->redirectToList(); } Html::back(); } else { if (isset($_POST["add_action"])) { $item->check($_POST['slalevels_id'], UPDATE); $action = new SlaLevelAction(); $action->add($_POST); Html::back(); } else { if (isset($_POST["add_criteria"])) { $item->check($_POST['slalevels_id'], UPDATE); $criteria = new SlaLevelCriteria(); $criteria->add($_POST); Html::back(); } else { if (isset($_GET["id"]) && $_GET["id"] > 0) { //print computer information Html::header(SlaLevel::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "sla", "slalevel"); //show computer form to add $item->display(array('id' => $_GET["id"])); Html::footer();
$item->redirectToList(); } } glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_POST["add_action"])) { $item->check($_POST['slalevels_id'], 'w'); $action = new SlaLevelAction(); $action->add($_POST); // Can't do this in SlaLevelAction, so do it here $item->update(array('id' => $_POST['slalevels_id'], 'date_mod' => $_SESSION['glpi_currenttime'])); glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_POST["delete_action"])) { $item->check($_POST['slalevels_id'], 'w'); $action = new SlaLevelAction(); if (count($_POST["item"])) { foreach ($_POST["item"] as $key => $val) { $input["id"] = $key; $action->delete($input); } } // Can't do this in RuleAction, so do it here $item->update(array('id' => $_POST['slalevels_id'], 'date_mod' => $_SESSION['glpi_currenttime'])); glpi_header($_SERVER['HTTP_REFERER']); } else { //print computer informations commonHeader($LANG['sla'][6], $_SERVER['PHP_SELF'], "config", "sla"); //show computer form to add $item->showForm($_GET["id"]); commonFooter();