Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / htdocs / front / contact.form.php @ 1c14bcc4

Historique | Voir | Annoter | Télécharger (4,42 ko)

1
<?php
2
/*
3
 * @version $Id: contact.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: Julien Dombre
33
// Purpose of file:
34
// ----------------------------------------------------------------------
35

    
36
$NEEDED_ITEMS=array("contact","enterprise","link","document");
37
define('GLPI_ROOT', '..');
38
include (GLPI_ROOT . "/inc/includes.php");
39

    
40
if(empty($_GET["ID"])) $_GET["ID"] = -1;
41

    
42
$contact=new Contact;
43
if (isset($_POST["add"])){
44
        $contact->check(-1,'w',$_POST['FK_entities']);
45

    
46
        $newID=$contact->add($_POST);
47
        logEvent($newID, "contacts", 4, "financial", $_SESSION["glpiname"]." ".$LANG["log"][20]." ".$_POST["name"].".");
48
        glpi_header($_SERVER['HTTP_REFERER']);
49
}
50
else if (isset($_POST["delete"]))
51
{
52
        $contact->check($_POST["ID"],'w');
53

    
54
        $contact->delete($_POST);
55
        logEvent($_POST["ID"], "contacts", 4, "financial", $_SESSION["glpiname"]." ".$LANG["log"][22]);
56
        glpi_header($CFG_GLPI["root_doc"]."/front/contact.php");
57
}
58
else if (isset($_POST["restore"]))
59
{
60
        $contact->check($_POST["ID"],'w');
61

    
62
        $contact->restore($_POST);
63
        logEvent($_POST["ID"], "contacts", 4, "financial", $_SESSION["glpiname"]." ".$LANG["log"][23]);
64
        glpi_header($CFG_GLPI["root_doc"]."/front/contact.php");
65
}
66
else if (isset($_POST["purge"]))
67
{
68
        $contact->check($_POST["ID"],'w');
69

    
70
        $contact->delete($_POST,1);
71
        logEvent($_POST["ID"], "contacts", 4, "financial", $_SESSION["glpiname"]." ".$LANG["log"][24]);
72
        glpi_header($CFG_GLPI["root_doc"]."/front/contact.php");
73
}
74
else if (isset($_POST["update"]))
75
{
76
        $contact->check($_POST["ID"],'w');
77

    
78
        $contact->update($_POST);
79
        logEvent($_POST["ID"], "contacts", 4, "financial", $_SESSION["glpiname"]." ".$LANG["log"][21]);
80
        glpi_header($_SERVER['HTTP_REFERER']);
81
}
82
else if (isset($_POST["addenterprise"]))
83
{
84
        $contact->check($_POST["conID"],'w');
85

    
86
        addContactEnterprise($_POST["entID"],$_POST["conID"]);
87
        logEvent($_POST["conID"], "contacts", 4, "financial", $_SESSION["glpiname"]."  ".$LANG["log"][34]);
88
        glpi_header($CFG_GLPI["root_doc"]."/front/contact.form.php?ID=".$_POST["conID"]);
89
}
90
else if (isset($_GET["deleteenterprise"]))
91
{
92
        $contact->check($_GET["cID"],'w');
93

    
94
        deleteContactEnterprise($_GET["ID"]);
95
        logEvent($_GET["cID"], "contacts", 4, "financial", $_SESSION["glpiname"]."  ".$LANG["log"][35]);
96
        glpi_header($_SERVER['HTTP_REFERER']);
97
}
98

    
99
else
100
{
101
        $contact->check($_GET["ID"],'r');
102

    
103
        if (!isset($_SESSION['glpi_onglet'])) $_SESSION['glpi_onglet']=1;
104
        if (isset($_GET['onglet'])) {
105
                $_SESSION['glpi_onglet']=$_GET['onglet'];
106
        }
107

    
108
        commonHeader($LANG["Menu"][22],$_SERVER['PHP_SELF'],"financial","contact");
109

    
110
        if ($contact->showForm($_SERVER['PHP_SELF'],$_GET["ID"],'')) {
111
                if ($_GET['ID']>0){
112
                        switch($_SESSION['glpi_onglet']){
113
                                case -1 :        
114
                                        showEnterpriseContact($_GET["ID"]);
115
                                        showDocumentAssociated(CONTACT_TYPE,$_GET["ID"]);
116
                                        showLinkOnDevice(CONTACT_TYPE,$_GET["ID"]);
117
                                        displayPluginAction(CONTACT_TYPE,$_GET["ID"],$_SESSION['glpi_onglet']);
118
                                        break;
119
                                case 5 : 
120
                                        showDocumentAssociated(CONTACT_TYPE,$_GET["ID"]);
121
                                        break;
122
                                case 7 : 
123
                                        showLinkOnDevice(CONTACT_TYPE,$_GET["ID"]);
124
                                        break;
125
                                case 10 :
126
                                        showNotesForm($_SERVER['PHP_SELF'],CONTACT_TYPE,$_GET["ID"]);
127
                                        break;
128
                                default :
129
                                        if (!displayPluginAction(CONTACT_TYPE,$_GET["ID"],$_SESSION['glpi_onglet'])){
130
                                                showEnterpriseContact($_GET["ID"]);
131
                                        }
132
                                        break;
133
                        }
134
                }
135
        }        
136

    
137
        commonFooter();
138
}
139

    
140

    
141
?>
Redmine Appliance - Powered by TurnKey Linux