Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / front / tracking.injector.php @ b67d8923

Historique | Voir | Annoter | Télécharger (6,19 ko)

1
<?php
2
/*
3
 * @version $Id: tracking.injector.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
// Based on:
32
// IRMA, Information Resource-Management and Administration
33
// Christian Bauer 
34
// ----------------------------------------------------------------------
35
// Original Author of file:
36
// Purpose of file:
37
// ----------------------------------------------------------------------
38

    
39

    
40

    
41
$NEEDED_ITEMS=array("user","group","profile","tracking","computer","printer","monitor","peripheral","networking","software","enterprise","phone","document","rulesengine","rule.tracking");
42

    
43
define('GLPI_ROOT', '..');
44
include (GLPI_ROOT . "/inc/includes.php");
45

    
46

    
47
if(!empty($_POST["type"]) && ($_POST["type"] == "Helpdesk") && ($CFG_GLPI["permit_helpdesk"] == "1"))
48
{
49
} else {
50
        checkRight("create_ticket","1");
51
}
52

    
53
//$status = "new";
54

    
55
// Sauvegarde des donn�s dans le cas de retours avec des navigateurs pourris style IE
56
/*$varstosav = array('emailupdates', 'uemail', 'computer', 'device_type', 'contents','_my_items','category');
57

58
        foreach ($varstosav as $v){
59
                if (isset($_POST[$v]))
60
                        $_SESSION["helpdeskSaved"][$v] = $_POST[$v];
61
        }
62
*/
63
$track=new Job();
64

    
65
// Security check
66
if (empty($_POST)||count($_POST)==0){
67
   glpi_header($CFG_GLPI["root_doc"]."/front/helpdesk.public.php");
68
}
69

    
70
/*if (!empty($_POST["priority"]) && empty($_POST["name"]))
71
{
72
        if(!empty($_POST["type"]) && ($_POST["type"] == "Helpdesk")) {
73
                nullHeader($LANG["title"][10],$_SERVER['PHP_SELF']);
74
        }
75
        else if ($_POST["_from_helpdesk"]){
76
                helpHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"]);
77
        }
78
        else commonHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"],"maintain","tracking");
79

80
        echo "<div align='center'><img src=\"".$CFG_GLPI["root_doc"]."/pics/warning.png\" alt=\"warning\"><br><br><b>";
81
        echo $LANG["help"][200]."<br><br>";
82
        displayBackLink();
83
        echo "</b></div>";
84

85
        nullFooter();
86
        exit;
87
}
88
if (!empty($_POST["priority"]) && !$_POST["category"])
89
{
90
        if(!empty($_POST["type"]) && ($_POST["type"] == "Helpdesk")) {
91
                nullHeader($LANG["title"][10],$_SERVER['PHP_SELF']);
92
        }
93
        else if ($_POST["_from_helpdesk"]){
94
                helpHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"]);
95
        }
96
        else commonHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"],"maintain","tracking");
97

98
        echo "<div align='center'><img src=\"".$CFG_GLPI["root_doc"]."/pics/warning.png\" alt=\"warning\"><br><br><b>";
99
        echo $LANG["help"][201]."<br><br>";
100
        displayBackLink();
101
        echo "</b></div>";
102

103
        nullFooter();
104
        exit;
105
}
106
elseif (!empty($_POST["priority"]) && empty($_POST["contents"]))
107
{
108
        if(!empty($_POST["type"]) && ($_POST["type"] == "Helpdesk")) {
109
                nullHeader($LANG["title"][10],$_SERVER['PHP_SELF']);
110
        }
111
        else if ($_POST["_from_helpdesk"]){
112
                helpHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"]);
113
        }
114
        else commonHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"],"maintain","tracking");
115

116
        echo "<div align='center'><img src=\"".$CFG_GLPI["root_doc"]."/pics/warning.png\" alt=\"warning\"><br><br><b>";
117
        echo $LANG["tracking"][8]."<br><br>";
118
        displayBackLink();
119
        echo "</b></div>";
120

121
        nullFooter();
122
        exit;
123
}
124
elseif (isset($_POST["emailupdates"]) && $_POST["emailupdates"] && isset($_POST["uemail"]) && $_POST["uemail"] =="")
125
{
126
        if(!empty($_POST["type"]) && ($_POST["type"] == "Helpdesk")) {
127
                nullHeader($LANG["title"][10],$_SERVER['PHP_SELF']);
128
        }
129
        else if ($_POST["_from_helpdesk"]){
130
                helpHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"]);
131
        }
132
        else commonHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"],"maintain","tracking");
133

134
        echo "<div align='center'><img src=\"".$CFG_GLPI["root_doc"]."/pics/warning.png\" alt=\"warning\"><br><br><b>";
135

136
        echo $LANG["help"][16]."<br><br>";
137
        displayBackLink();
138
        echo "</b></div>";
139
        nullFooter();
140
        exit;
141
} else
142
*/
143

    
144

    
145
        if(!empty($_POST["type"]) && ($_POST["type"] == "Helpdesk")) {
146
                nullHeader($LANG["title"][10],$_SERVER['PHP_SELF']);
147
        }
148
        else if ($_POST["_from_helpdesk"]){
149
                helpHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"]);
150
        }
151
        else commonHeader($LANG["title"][1],$_SERVER['PHP_SELF'],$_SESSION["glpiname"],"maintain","tracking");
152

    
153

    
154
{
155
        if (isset($_POST["_my_items"])&&!empty($_POST["_my_items"])){
156
                $splitter=split("_",$_POST["_my_items"]);
157
                if (count($splitter)==2){
158
                        $_POST["device_type"]=$splitter[0];
159
                        $_POST["computer"]=$splitter[1];
160
                }
161
        }
162

    
163
        if (!isset($_POST["device_type"])||(empty($_POST["computer"])&&$_POST["device_type"]!=0)) {
164
                $_POST["device_type"]=0;
165
                $_POST["computer"]=0;
166
        }
167

    
168
        $ci=new CommonItem;
169

    
170
        if ($newID=$track->add($_POST)){
171
                if(isset($_POST["type"]) && ($_POST["type"] == "Helpdesk")) {
172
                        echo "<div align='center'>";
173
                        echo $LANG["help"][18]."<br><br>";
174
                        displayBackLink();
175
                        echo "</div>";
176

    
177
                } else {
178
                        echo "<div align='center'><img src=\"".$CFG_GLPI["root_doc"]."/pics/ok.png\" alt=\"OK\"><br><br><b>";
179
                        echo $LANG["help"][18]." (".$LANG["job"][38]." <a class='b' href='helpdesk.public.php?show=user&amp;ID=$newID'>$newID</a>)<br>";
180
                        echo $LANG["help"][19];
181
                        echo "</b></div>";
182
                }
183
        } else {
184
                echo "<div align='center'><img src=\"".$CFG_GLPI["root_doc"]."/pics/warning.png\" alt=\"warning\"><br></div>";
185
                displayMessageAfterRedirect();
186
                displayBackLink();
187

    
188
        }
189
        nullFooter();
190

    
191
}
192

    
193
?>
Redmine Appliance - Powered by TurnKey Linux