Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / plugins / pdf / front / plugin_pdf.profiles.php @ 7b214c36

Historique | Voir | Annoter | Télécharger (2,98 ko)

1
<?php
2

    
3

    
4
/*
5
   ----------------------------------------------------------------------
6
   GLPI - Gestionnaire Libre de Parc Informatique
7
   Copyright (C) 2003-2008 by the INDEPNET Development Team.
8

9
   http://indepnet.net/   http://glpi-project.org/
10
   ----------------------------------------------------------------------
11

12
   LICENSE
13

14
   This file is part of GLPI.
15

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

21
   GLPI is distributed in the hope that it will be useful,
22
   but WITHOUT ANY WARRANTY; without even the implied warranty of
23
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
   GNU General Public License for more details.
25

26
   You should have received a copy of the GNU General Public License
27
   along with GLPI; if not, write to the Free Software
28
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
   ------------------------------------------------------------------------
30
 */
31

    
32
// Original Author of file: Remi Collet
33
// Purpose of file:
34
// ----------------------------------------------------------------------
35

    
36
$NEEDED_ITEMS=array("profile");
37

    
38
if(!defined('GLPI_ROOT')){
39
        define('GLPI_ROOT', '../../..'); 
40
}
41
include_once (GLPI_ROOT . "/inc/includes.php");
42
checkRight("profile","r");
43

    
44
commonHeader($LANGPDF["config"][1], $_SERVER["PHP_SELF"],"plugins","reports");
45

    
46
$prof = new PluginPdfProfile();
47

    
48
if(!isset($_POST["ID"])) $ID=0;        
49
else $ID=$_POST["ID"];
50

    
51
if (isset($_POST["add"])){
52
        checkRight("profile","w");
53
        $prof->add($_POST);
54
        if ($_SESSION['glpiactiveprofile']['ID']==$ID)
55
                $_SESSION["glpi_plugin_pdf_profile"]=$prof->fields;        
56
}
57
else  if (isset($_POST["delete"])){
58
        checkRight("profile","w");
59

    
60
        $prof->delete($_POST);
61
        if ($_SESSION['glpiactiveprofile']['ID']==$ID)
62
                unset($_SESSION["glpi_plugin_pdf_profile"]);
63
}
64
else  if (isset($_POST["update"])){
65
        checkRight("profile","w");
66
        $prof->update($_POST);
67
        if ($_SESSION['glpiactiveprofile']['ID']==$ID)
68
                $_SESSION["glpi_plugin_pdf_profile"]=$prof->fields;
69
}
70

    
71
echo "<div align='center'><form method='post' action=\"".$_SERVER["PHP_SELF"]."\">";
72
echo "<table class='tab_cadre' cellpadding='5'><tr><th colspan='2'>";
73
echo $LANGPDF["config"][1]."<br />" . $LANGPDF["config"][6] . "</th></tr>\n";
74

    
75
echo "<tr class='tab_bg_1'><td>" . $LANG["profiles"][22] . "&nbsp;: ";
76
$query="SELECT ID, name FROM glpi_profiles ORDER BY name";
77
$result=$DB->query($query);
78

    
79
echo "<select name='ID'>";
80
while ($data=$DB->fetch_assoc($result)){
81
        echo "<option value='".$data["ID"]."' ".($ID==$data["ID"]?"selected":"").">".$data['name']."</option>";
82
}
83
echo "</select>";
84
echo "<td><input type='submit' value=\"".$LANG["buttons"][2]."\" class='submit' ></td></tr>";
85
echo "</table></form></div>";
86

    
87
if ($ID>0){        
88
        $prof->showForm($_SERVER['PHP_SELF'],$ID);
89
}
90

    
91
commonFooter();
92
?>
93

    
Redmine Appliance - Powered by TurnKey Linux