Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 101 lines (76 sloc) 3.872 kb
de5b4e7 Mise à jour update
moyo authored
1 <?php
2 /*
3 * @version $Id: update.php 3336 2006-04-24 14:37:40Z moyo $
4 ----------------------------------------------------------------------
5 GLPI - Gestionnaire Libre de Parc Informatique
6 Copyright (C) 2003-2006 by the INDEPNET Development Team.
7
8 http://indepnet.net/ http://glpi.indepnet.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 // Update from 0.5 to 0.51
37 function update05to051(){
38 global $db,$lang;
39
40 echo "<p class='center'>Version 0.51 </p>";
41
42 /*******************************GLPI 0.51***********************************************/
43
44 if(!FieldExists("glpi_infocoms","facture")) {
45 $query = "ALTER TABLE `glpi_infocoms` ADD `facture` char(255) NOT NULL default ''";
46 $db->query($query) or die("0.51 add field facture ".$lang["update"][90].$db->error());
47 }
48
49 if(!FieldExists("glpi_enterprises","fax")) {
50 $query = "ALTER TABLE `glpi_enterprises` ADD `fax` char(255) NOT NULL default ''";
51 $db->query($query) or die("0.51 add field fax ".$lang["update"][90].$db->error());
52 }
53
54 if(!FieldExists("glpi_docs","link")) {
55 $query = "ALTER TABLE `glpi_docs` ADD `link` char(255) NOT NULL default ''";
56 $db->query($query) or die("0.51 add field fax ".$lang["update"][90].$db->error());
57 }
58
59 if(!TableExists("glpi_dropdown_contact_type")) {
60
61 $query = "CREATE TABLE glpi_dropdown_contact_type (
62 ID int(11) NOT NULL auto_increment,
63 name varchar(255) NOT NULL default '',
64 PRIMARY KEY (ID)
65 ) TYPE=MyISAM;";
66
67 $db->query($query) or die("0.51 add table dropdown_contact_type ".$lang["update"][90].$db->error());
68
69 $query="INSERT INTO glpi_dropdown_contact_type (name) VALUES ('".$lang["financial"][43]."');";
70 $db->query($query) or die("0.51 add entries to dropdown_contact_type ".$lang["update"][90].$db->error());
71 $query="INSERT INTO glpi_dropdown_contact_type (name) VALUES ('".$lang["financial"][42]."');";
72 $db->query($query) or die("0.51 add entries to dropdown_contact_type ".$lang["update"][90].$db->error());
73 }
74
75 if(!FieldExists("glpi_config","cartridges_alarm")) {
76 $query = "ALTER TABLE `glpi_config` ADD `cartridges_alarm` int(11) NOT NULL default '10'";
77 $db->query($query) or die("0.51 add field cartridges_alarm ".$lang["update"][90].$db->error());
78 }
79
80 if(!TableExists("glpi_state_item")) {
81
82 $query = "ALTER TABLE `glpi_repair_item` RENAME `glpi_state_item`;";
83 $db->query($query) or die("0.51 alter glpi_state_item table name ".$lang["update"][90].$db->error());
84
85 $query = "ALTER TABLE `glpi_state_item` ADD `state` INT DEFAULT '1';";
86 $db->query($query) or die("0.51 add state field ".$lang["update"][90].$db->error());
87 }
88
89 if(!TableExists("glpi_dropdown_state")) {
90 $query = "CREATE TABLE glpi_dropdown_state (
91 ID int(11) NOT NULL auto_increment,
92 name varchar(255) default NULL,
93 PRIMARY KEY (ID)
94 ) TYPE=MyISAM;";
95 $db->query($query) or die("0.51 add state field ".$lang["update"][90].$db->error());
96
97 }
98
99 }
100
101 ?>
Something went wrong with that request. Please try again.