$constype->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $constype->check($_POST["id"], PURGE);
            if ($constype->restore($_POST)) {
                Event::log($_POST["id"], "consumableitems", 4, "inventory", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
            }
            $constype->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $constype->check($_POST["id"], PURGE);
                if ($constype->delete($_POST, 1)) {
                    Event::log($_POST["id"], "consumableitems", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                }
                $constype->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $constype->check($_POST["id"], UPDATE);
                    if ($constype->update($_POST)) {
                        Event::log($_POST["id"], "consumableitems", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    }
                    Html::back();
                } else {
                    Html::header(_n('Consumable', 'Consumables', 2), $_SERVER['PHP_SELF'], "assets", "consumableitem");
                    $constype->display(array('id' => $_GET["id"]));
                    Html::footer();
                }
            }
        }
    }
}