コード例 #1
0
// Récupération du fichier includes de GLPI, permet l'accès au cœur
include GLPI_ROOT . "inc/includes.php";
/**
 * Récupère le chemin absolu de l'instance GLPI
 * @return String : le chemin absolu (racine principale)
 */
function getAbsolutePath()
{
    return str_replace("plugins/reservation/front/reservation.php", "", $_SERVER['SCRIPT_FILENAME']);
}
$PluginReservationReservation = new PluginReservationReservation();
Session::checkRight("reservation", array(CREATE, UPDATE, DELETE));
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
    Html::helpHeader(__('Simplified interface'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]);
} else {
    Html::header(PluginReservationReservation::getTypeName(2), $_SERVER['PHP_SELF'], "plugins", "reservation");
}
if (!isset($datesresa)) {
    $datesresa = null;
}
if (isset($_POST['reserve'])) {
    $datesresa = $_POST['reserve'];
}
$PluginReservationReservation->showFormDate();
if (isset($_GET['resareturn'])) {
    $PluginReservationReservation->resaReturn($_GET['resareturn']);
}
if (isset($_GET['mailuser'])) {
    $PluginReservationReservation->mailUser($_GET['mailuser']);
}
if (isset($_POST['AjouterMatToResa'])) {
コード例 #2
0
 static function getMenuName()
 {
     return PluginReservationReservation::getTypeName(2);
 }
コード例 #3
0
<?php

// Définition de la variable GLPI_ROOT obligatoire pour l'instanciation des class
define('GLPI_ROOT', getAbsolutePath());
// Récupération du fichier includes de GLPI, permet l'accès au cœur
include GLPI_ROOT . "inc/includes.php";
$plugin = new Plugin();
if ($plugin->isActivated("reservation")) {
    $PluginReservationConfig = new PluginReservationConfig();
    Session::checkRight("config", array(CREATE, UPDATE, DELETE));
    if (isset($_POST["week"])) {
        $PluginReservationConfig->setConfigurationWeek($_POST["week"]);
        //Html::back();
    }
    if (isset($_POST["methode"])) {
        $PluginReservationConfig->setConfigurationMethode($_POST["methode"]);
        //Html::back();
    }
    Html::header(PluginReservationReservation::getTypeName(2), '', "plugins", "Reservation");
    $PluginReservationConfig->showForm();
    Html::footer();
} else {
    Html::header(__('Setup'), '', "config", "plugins");
    echo "<div class='center'><br><br>" . "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt='warning'><br><br>";
    echo "<b>" . __('Please activate the plugin', 'Reservation') . "</b></div>";
    Html::footer();
}
function getAbsolutePath()
{
    return str_replace("plugins/reservation/front/config.form.php", "", $_SERVER['SCRIPT_FILENAME']);
}