Beispiel #1
0
        $backup = $_POST["backup"] ? True : False;
        if (in_array("imaging", $_SESSION["modulesList"])) {
            //$dede = xmlrpc_imagingClearMenuFromUuid($uuid);
            $dede = xmlrpc_imagingClearMenuFromUuidAllLocation($uuid);
        }
        delComputer($uuid, $backup);
        if (!isXMLRPCError()) {
            new NotifyWidgetSuccess(_("The computer has been deleted."));
        }
        header("Location: " . urlStrRedirect("base/computers/index"));
        exit;
    }
} else {
    $uuid = urldecode($_GET["objectUUID"]);
    $f = new PopupForm(_("Delete this computer"));
    $f->push(new Table());
    $tr = new TrFormElement(_("Do you want a backup to be done ?"), new CheckBoxTpl("backup"), array("value" => ''));
    // Set first column to 100%, because without this setting, checkbox width is too large
    $tr->setFirstColWidth('100%');
    $f->add($tr);
    // this checkbox has to be checked to delete a computer
    $tr = new TrFormElement(_("I am aware that <b>all related images (non-master)</b> will be <b>DELETED</b>.<br />Check this box if it is what you want."), new CheckBoxTpl("imageWarning"), array("value" => ''));
    $tr->setFirstColWidth('100%');
    $f->add($tr);
    $hidden = new HiddenTpl("objectUUID");
    $f->add($hidden, array("value" => $uuid, "hide" => True));
    $f->pop();
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}