Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / install / update_04_042.php @ b67d8923

Historique | Voir | Annoter | Télécharger (2,87 ko)

1
<?php
2
/*
3
 * @version $Id: update_04_042.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.4 and 0.41 to 0.42
37
function update04to042(){
38
        global $DB,$LANG;
39

    
40
        echo "<p class='center'>Version 0.42 </p>";
41

    
42
        if(!TableExists("glpi_reservation_item")) {
43

    
44

    
45
                $query = "CREATE TABLE glpi_reservation_item (ID int(11) NOT NULL auto_increment,device_type tinyint(4) NOT NULL default '0', id_device int(11) NOT NULL default '0', comments text NOT NULL, PRIMARY KEY  (ID), KEY device_type (device_type));";
46

    
47
                $DB->query($query) or die("4201 ".$LANG["update"][90].$DB->error());
48
        }
49

    
50
        if(!TableExists("glpi_reservation_resa")) {
51
                $query = "CREATE TABLE glpi_reservation_resa (  
52
                        ID bigint(20) NOT NULL auto_increment,  
53
                           id_item int(11) NOT NULL default '0',  
54
                           begin datetime NOT NULL default '0000-00-00 00:00:00',  
55
                           end datetime NOT NULL default '0000-00-00 00:00:00',  
56
                           id_user int(11) NOT NULL default '0',  
57
                           PRIMARY KEY  (`ID`),  
58
                           KEY id_item (`id_item`),  
59
                           KEY id_user (`id_user`),  
60
                           KEY begin (`begin`),  
61
                           KEY end (`end`));";
62

    
63
                $DB->query($query) or die("4202 ".$LANG["update"][90].$DB->error());
64
        }
65

    
66
        if(!FieldExists("glpi_tracking","device_type")) {
67
                $query = "ALTER TABLE `glpi_tracking` ADD `device_type` INT DEFAULT '1' NOT NULL AFTER `assign` ;";
68
                $DB->query($query) or die("4203 ".$LANG["update"][90].$DB->error());
69
        }
70

    
71
        // Ajout language par defaut
72
        if(!FieldExists("glpi_config","default_language")) {
73

    
74
                $query = "ALTER TABLE `glpi_config` ADD `default_language` VARCHAR(255) DEFAULT 'english' NOT NULL ;";
75
                $DB->query($query) or die("4204 ".$LANG["update"][90].$DB->error());
76

    
77
        }
78

    
79
}
80

    
81
?>
Redmine Appliance - Powered by TurnKey Linux