ryxeo-glpi-git / install / update_05_051.php @ b67d8923
Historique | Voir | Annoter | Télécharger (3,84 ko)
1 |
<?php
|
---|---|
2 |
/*
|
3 |
* @version $Id: update_05_051.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 |
/// 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 |
?>
|