Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / front / entity.tree.php @ b67d8923

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

1
<?php
2
/*
3
 * @version $Id: entity.tree.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("setup","profile","ocsng");
39

    
40
if(!defined('GLPI_ROOT')){
41
        define('GLPI_ROOT', '..');
42
}
43
include (GLPI_ROOT . "/inc/includes.php");
44

    
45
checkRight("entity","w");
46

    
47
$which=ENTITY_TYPE;
48

    
49
if (isset($_GET["where"]))$where=$_GET["where"];
50
else if (isset($_POST["value_where"]))$where=$_POST["value_where"];
51
else $where="";
52
if (isset($_GET["tomove"])) $tomove=$_GET["tomove"];
53
else if (isset($_POST["value_to_move"])) $tomove=$_POST["value_to_move"];
54
else $tomove="";
55
if (isset($_GET["type"]))$type=$_GET["type"];
56
else if (isset($_POST["type"]))$type=$_POST["type"];
57
else $type="";
58
if (isset($_GET["value2"]))$value2=$_GET["value2"];
59
else if (isset($_POST["value2"]))$value2=$_POST["value2"];
60
else $value2="";
61
// Selected Item
62
if (isset($_POST["ID"])) $ID=$_POST["ID"];
63
elseif (isset($_GET["ID"])) $ID=$_GET["ID"];
64
else $ID="";
65

    
66
if (isset($_POST["move"])) {
67
        moveTreeUnder($_POST["tablename"],$_POST["value_to_move"],$_POST["value_where"]);
68
        logEvent(0, "dropdown", 5, "setup", $_SESSION["glpiname"]."".$LANG["log"][21]);
69
        glpi_header($_SERVER['PHP_SELF']."?which=$which&value2=$value2&tomove=$tomove&where=$where&type=$type");
70
}else if (isset($_POST["add"])) {
71
        addDropdown($_POST);
72
        logEvent(0, "dropdown", 5, "setup", $_SESSION["glpiname"]." ".$LANG["log"][20]);
73
        glpi_header($_SERVER['PHP_SELF']."?which=$which&value2=$value2&tomove=$tomove&where=$where&type=$type");
74
} else if (isset($_POST["delete"])) {
75
        if(dropdownUsed($_POST["tablename"], $_POST["ID"]) && empty($_POST["forcedelete"])) {
76
                if (ereg("popup",$_SERVER['PHP_SELF']))
77
                        popHeader($LANG["common"][12],$_SERVER['PHP_SELF']);
78
                else         
79
                        commonHeader($LANG["common"][12],$_SERVER['PHP_SELF']);
80
                showDeleteConfirmForm($_SERVER['PHP_SELF'],$_POST["tablename"], $_POST["ID"],$_POST["FK_entities"]);
81
                if (ereg("popup",$_SERVER['PHP_SELF']))
82
                        popFooter();
83
                else 
84
                        commonFooter();
85
        } else {
86
                deleteDropdown($_POST);
87
                logEvent(0, "dropdown", 4, "setup", $_SESSION["glpiname"]." ".$LANG["log"][22]);
88
                glpi_header($_SERVER['PHP_SELF']."?which=$which");
89
        }
90

    
91
} else if (isset($_POST["update"])) {
92
        updateDropdown($_POST);
93
        logEvent(0, "dropdown", 4, "setup", $_SESSION["glpiname"]." ".$LANG["log"][21]);
94
        glpi_header($_SERVER['PHP_SELF']."?which=$which&ID=$ID");
95
} else if (isset($_POST["replace"])) {
96
        replaceDropDropDown($_POST);
97
        logEvent(0, "dropdown", 4, "setup", $_SESSION["glpiname"]." ".$LANG["log"][21]);
98
        glpi_header($_SERVER['PHP_SELF']."?which=$which");
99
}
100
else {
101
        commonHeader($LANG["common"][12],$_SERVER['PHP_SELF'],"admin","entity");
102

    
103
        showFormTreeDown($_SERVER['PHP_SELF'],"glpi_entities",$LANG["entity"][1],$ID,$value2,$where,$tomove,$type);
104
        commonFooter();
105
}
106

    
107

    
108
?>
Redmine Appliance - Powered by TurnKey Linux