showForm() public method

Print the mailgate form
public showForm ( $ID, $options = [] ) : boolean
$ID integer Id of the item to print
$options array - target filename : where to go when done.
return boolean item found
Exemplo n.º 1
0
$mailgate = new MailCollector();
if (isset($_POST["add"])) {
    $mailgate->check(-1, 'w', $_POST);
    $newID = $mailgate->add($_POST);
    Event::log($newID, "mailcollector", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $mailgate->check($_POST['id'], 'd');
        $mailgate->delete($_POST);
        Event::log($_POST["id"], "mailcollector", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
        $mailgate->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $mailgate->check($_POST['id'], 'w');
            $mailgate->update($_POST);
            Event::log($_POST["id"], "mailcollector", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
            Html::back();
        } else {
            if (isset($_POST["get_mails"])) {
                $mailgate->check($_POST['id'], 'w');
                $mailgate->collect($_POST["id"], 1);
                Html::back();
            } else {
                Html::header(MailCollector::getTypeName(2), $_SERVER['PHP_SELF'], "config", "mailcollector");
                $mailgate->showForm($_GET["id"]);
                Html::footer();
            }
        }
    }
}