Example #1
0
} else {
    if (isset($_POST["delete"])) {
        $ri->check($_POST["id"], 'd');
        $ri->delete($_POST);
        Event::log($_POST['id'], "reservationitem", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        Html::back();
    } else {
        if (isset($_POST["purge"])) {
            $ri->check($_POST["id"], 'd');
            $ri->delete($_POST, 1);
            Event::log($_POST['id'], "reservationitem", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
            Html::back();
        } else {
            if (isset($_POST["restore"])) {
                $ri->check($_POST["id"], 'd');
                $ri->restore($_POST);
                Event::log($_POST['id'], "reservationitem", 4, "inventory", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
                Html::back();
            } else {
                if (isset($_POST["update"])) {
                    $ri->check($_POST["id"], 'w');
                    $ri->update($_POST);
                    Event::log($_POST['id'], "reservationitem", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    Html::back();
                } else {
                    $ri->check($_GET["id"], 'r');
                    Html::header(Reservation::getTypeName(2), $_SERVER['PHP_SELF'], "utils", "reservation");
                    $ri->showForm($_GET["id"]);
                }
            }
        }