Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / front / knowbase.form.php @ b67d8923

Historique | Voir | Annoter | Télécharger (3,93 ko)

1
<?php
2
/*
3
 * @version $Id: knowbase.form.php 7763 2009-01-06 18:44:50Z moyo $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2009 by the INDEPNET Development Team.
7

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

11
 LICENSE
12

13
 This file is part of GLPI.
14

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

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

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

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

    
36

    
37

    
38
$NEEDED_ITEMS=array("knowbase","document");
39

    
40
define('GLPI_ROOT', '..');
41
include (GLPI_ROOT . "/inc/includes.php");
42

    
43
if(!isset($_GET["ID"])) $_GET["ID"] = "";
44
if(!isset($_GET["modify"])) $_GET["modify"] = "";
45
if(!isset($_GET["delete"])) $_GET["delete"] = "";
46
if(!isset($_GET["addtofaq"])) $_GET["addtofaq"] = "";
47
if(!isset($_GET["removefromfaq"])) $_GET["removefromfaq"] = "";
48

    
49

    
50
$kb=new kbItem;
51

    
52

    
53
if ($_GET["ID"]=="new"){
54
        // on affiche le formulaire de saisie de l'item
55
        $kb->can(-1,'w');
56

    
57
        commonHeader($LANG["title"][5],$_SERVER['PHP_SELF'],"utils","knowbase");
58
        $kb->showForm($_SERVER['PHP_SELF'],"");
59
        commonFooter();
60

    
61
} else if (isset($_POST["add"])){
62
        // ajoute un item dans la base de connaisssances         
63
        $kb->can(-1,'w');
64

    
65
        $newID=$kb->add($_POST);
66
        logEvent($newID, "knowbase", 5, "tools", $_SESSION["glpiname"]." ".$LANG["log"][20]);
67
        glpi_header($CFG_GLPI["root_doc"]."/front/knowbase.php");
68

    
69
}  else if (isset($_POST["update"])){
70
        // actualiser  un item dans la base de connaissances
71
        $kb->can($_POST["ID"],'w');
72

    
73
        $kb->update($_POST);
74
        logEvent($_POST["ID"], "knowbase", 5, "tools", $_SESSION["glpiname"]." ".$LANG["log"][21]);        
75
        glpi_header($CFG_GLPI["root_doc"]."/front/knowbase.form.php?ID=".$_POST['ID']);
76

    
77
} else if (isset($_GET["ID"])  && strcmp($_GET["modify"],"yes") == 0){
78
        // modifier un item dans la base de connaissance
79
        $kb->can($_GET["ID"],'r');
80

    
81
        commonHeader($LANG["title"][5],$_SERVER['PHP_SELF'],"utils","knowbase");
82
        $kb->showForm($_SERVER['PHP_SELF'],$_GET["ID"]);
83
        commonFooter();
84

    
85
} else if (isset($_GET["ID"])  && strcmp($_GET["delete"],"yes") == 0){
86
        // effacer un item dans la base de connaissances
87
        $kb->can($_GET["ID"],'w');
88

    
89
        $kb->delete($_GET);
90
        logEvent($_GET["ID"], "knowbase", 5, "tools", $_SESSION["glpiname"]." ".$LANG["log"][22]);        
91
        glpi_header($CFG_GLPI["root_doc"]."/front/knowbase.php");
92

    
93
} else if (isset($_GET["ID"])  && strcmp($_GET["addtofaq"],"yes") == 0){
94
        // ajouter  un item dans la faq
95
        $kb->can($_GET["ID"],'w');
96

    
97
        KbItemaddtofaq($_GET["ID"]);
98
        glpi_header($_SERVER['HTTP_REFERER']);
99

    
100
} else if (isset($_GET["ID"])  && strcmp($_GET["removefromfaq"],"yes") == 0){
101
        // retirer  un item de la faq
102
        $kb->can($_GET["ID"],'w');
103

    
104
        KbItemremovefromfaq($_GET["ID"]);
105
        glpi_header($_SERVER['HTTP_REFERER']);
106

    
107
} else if (empty($_GET["ID"])) {
108
        glpi_header($CFG_GLPI["root_doc"]."/front/knowbase.php");
109

    
110
} else  {
111
        // Affiche un item de la base de connaissances
112
        $kb->can($_GET["ID"],'r');
113

    
114
        commonHeader($LANG["title"][5],$_SERVER['PHP_SELF'],"utils","knowbase");
115

    
116
        if (ShowKbItemFull($_GET["ID"])){
117
                kbItemMenu($_GET["ID"]);
118
                showDocumentAssociated(KNOWBASE_TYPE,$_GET["ID"]);
119
        }
120
        commonFooter();
121
}
122

    
123

    
124
?>
Redmine Appliance - Powered by TurnKey Linux