-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathupdate_05_051.php
113 lines (85 loc) · 3.79 KB
/
update_05_051.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/*
* @version $Id$
-------------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2012 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
-------------------------------------------------------------------------
LICENSE
This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
/// Update from 0.5 to 0.51
function update05to051() {
global $DB;
echo "<p class='center'>Version 0.51 </p>";
/*******************************GLPI 0.51***********************************************/
if (!FieldExists("glpi_infocoms","facture", false)) {
$query = "ALTER TABLE `glpi_infocoms`
ADD `facture` char(255) NOT NULL default ''";
$DB->queryOrDie($query, "0.51 add field facture");
}
if (!FieldExists("glpi_enterprises","fax", false)) {
$query = "ALTER TABLE `glpi_enterprises`
ADD `fax` char(255) NOT NULL default ''";
$DB->queryOrDie($query, "0.51 add field fax");
}
if (!FieldExists("glpi_docs","link", false)) {
$query = "ALTER TABLE `glpi_docs`
ADD `link` char(255) NOT NULL default ''";
$DB->queryOrDie($query, "0.51 add field fax");
}
if (!TableExists("glpi_dropdown_contact_type")) {
$query = "CREATE TABLE `glpi_dropdown_contact_type` (
`ID` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
PRIMARY KEY (`ID`)
) TYPE=MyISAM";
$DB->queryOrDie($query, "0.51 add table dropdown_contact_type");
$query = "INSERT INTO `glpi_dropdown_contact_type`
(`name`)
VALUES ('".__('Technician')."')";
$DB->queryOrDie($query, "0.51 add entries to dropdown_contact_type");
$query = "INSERT INTO `glpi_dropdown_contact_type`
(`name`)
VALUES ('".__('Commercial')."')";
$DB->queryOrDie($query, "0.51 add entries to dropdown_contact_type");
}
if (!FieldExists("glpi_config","cartridges_alarm", false)) {
$query = "ALTER TABLE `glpi_config`
ADD `cartridges_alarm` int(11) NOT NULL default '10'";
$DB->queryOrDie($query, "0.51 add field cartridges_alarm");
}
if (!TableExists("glpi_state_item")) {
$query = "ALTER TABLE `glpi_repair_item`
RENAME `glpi_state_item`";
$DB->queryOrDie($query, "0.51 alter glpi_state_item table name");
$query = "ALTER TABLE `glpi_state_item`
ADD `state` INT DEFAULT '1'";
$DB->queryOrDie($query, "0.51 add state field");
}
if (!TableExists("glpi_dropdown_state")) {
$query = "CREATE TABLE `glpi_dropdown_state` (
`ID` int(11) NOT NULL auto_increment,
`name` varchar(255) default NULL,
PRIMARY KEY (`ID`)
) TYPE=MyISAM";
$DB->queryOrDie($query, "0.51 add state field");
}
}
?>