showForm() public method

Print the transfer form
public showForm ( $ID, $options = [] ) : boolean
$ID integer : Id of the contact to print
$options array - target filename : where to go when done. - withtemplate boolean : template or basic item
return boolean item found
コード例 #1
0
ファイル: transfers.php プロジェクト: glpi-project/glpi
LICENSE

This file is part of GLPI.

GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

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
*/
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkRight("transfer", READ);
if (isset($_POST["id"]) && $_POST["id"] > 0) {
    $transfer = new Transfer();
    $transfer->showForm($_POST["id"], array('target' => $CFG_GLPI["root_doc"] . "/front/transfer.action.php"));
}
Html::ajaxFooter();
コード例 #2
0
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
checkRight("transfer", "r");
if (empty($_GET["id"])) {
    $_GET["id"] = "";
}
$transfer = new Transfer();
if (isset($_POST["add"])) {
    $transfer->check(-1, 'w', $_POST);
    $newID = $transfer->add($_POST);
    Event::log($newID, "transfers", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " " . $_POST["name"] . ".");
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_POST["delete"])) {
        $transfer->check($_POST["id"], 'w');
        $transfer->delete($_POST);
        Event::log($_POST["id"], "transfers", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
        glpi_header($CFG_GLPI["root_doc"] . "/front/transfer.php");
    } else {
        if (isset($_POST["update"])) {
            $transfer->check($_POST["id"], 'w');
            $transfer->update($_POST);
            Event::log($_POST["id"], "transfers", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
            glpi_header($_SERVER['HTTP_REFERER']);
        }
    }
}
commonHeader($LANG['transfer'][1], '', 'admin', 'rule', 'transfer');
$transfer->showForm($_GET["id"], array('target' => $transfer->getFormURL()));
commonFooter();