Skip to content

Commit

Permalink
Version 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Duv committed Feb 5, 2017
2 parents 7004d9a + 6a5b1b5 commit 70ee75d
Show file tree
Hide file tree
Showing 27 changed files with 178 additions and 41 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Room Management plugin for [GLPI](www.glpi-project.org)
=======================================================

This is a plugin to add room management feature to [**GLPI** assets inventory
software](http://glpi-project.org).

Description
-----------

This plugin allows you to manage the rooms and the elements that are included
in. A room is not the same as a location that already exists in GLPI because it
can not contain items nor be loaned (which a room can be).

Installation
------------

This plugins installs as any other GLPI plugin.

1. Place the current source code tree in a directory named `room` and move this
one inside the `plugins` directory of your GLPI installation.
2. Go to *Setup* > *Plugins*.
3. Look for the *Room Management* plugin's row.
4. Click on the *Install* button.
5. Click on the *Enable* button.

Uninstallation
--------------

This plugins uninstalls as any other GLPI plugin.

1. Go to *Setup* > *Plugins*.
2. Look for the *Room Management* plugin's row.
3. Click on the *Disnable* button.
4. Click on the *Uninstall* button.
5. Delete the `plugins/room` directory of your GLPI installation.
5 changes: 0 additions & 5 deletions README.txt

This file was deleted.

1 change: 0 additions & 1 deletion ajax/room.tabs.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/dropdown1.form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/dropdown1.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/profile.form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/room.form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: room.form.php 37 2009-01-06 18:41:29Z moyo $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/room.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: index.php 39 2009-03-02 15:31:11Z remi $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/roomaccesscond.form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/roomaccesscond.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/roomtype.form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion front/roomtype.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-03-03 21:49 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
32 changes: 25 additions & 7 deletions hook.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

/*
* @version $Id$
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down Expand Up @@ -74,6 +73,7 @@ function plugin_room_install() {
`state` smallint(6) NOT NULL default '0', # not used / for reservation search engine
`manufacturers_id` smallint(6) NOT NULL default '0', # not used / for reservation search engine
`groups_id` smallint(6) NOT NULL default '0', # not used / for reservation search engine
`groups_id_tech` int(11) NOT NULL default '0' COMMENT 'Group in charge of the hardware. RELATION to glpi_groups (id)',
PRIMARY KEY (`id`),
KEY `entities_id` (`entities_id`),
KEY `is_deleted` (`is_deleted`),
Expand All @@ -86,6 +86,10 @@ function plugin_room_install() {
KEY `users_id` (`users_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;";
$DB->query($query) or die("error adding glpi_plugin_room table " . __('Error during the database update') . $DB->error());
} elseif (!FieldExists('glpi_plugin_room_rooms', 'groups_id_tech')) { // Mise à jour entre 3.0.4 et 3.1.0; la table existe, mais il manque "groups_id_tech"
$query = "ALTER TABLE `glpi_plugin_room_rooms`
ADD COLUMN `groups_id_tech` INT NOT NULL DEFAULT '0' COMMENT 'Group in charge of the hardware. RELATION to glpi_groups (id)' AFTER `groups_id`;";
$result = $DB->query($query) or die('Error when adding `glpi_plugin_room_rooms`.`groups_id_tech` field. ' . __('Error during the database update') . $DB->error());
} elseif (FieldExists('glpi_plugin_room_rooms', 'FK_users')) { // mise à jour depuis 3.0.0 Beta; la table existe, mais avec les mauvais noms de champs
$upgradeFrom3Beta = true;
$query = "alter TABLE `glpi_plugin_room_rooms`
Expand All @@ -99,6 +103,9 @@ function plugin_room_install() {
ADD KEY `users_id` ( `users_id` );";
$result = $DB->query($query) or die("error renaming glpi_plugin_room fields from Beta version " . __('Error during the database update') . $DB->error());
}
$query = "ALTER TABLE `glpi_plugin_room_rooms`
ADD COLUMN `groups_id_tech` INT NOT NULL DEFAULT '0' COMMENT 'Group in charge of the hardware. RELATION to glpi_groups (id)' AFTER `groups_id`;";
$result = $DB->query($query) or die('Error when adding `glpi_plugin_room_rooms`.`groups_id_tech` field. ' . __('Error during the database update') . $DB->error());

}
if (TableExists('glpi_plugin_room')) { // il existe une table correspondant à l'ancienne nomenclature; voir à transférer les enregistrement contenus dans celle-ci.
Expand Down Expand Up @@ -351,22 +358,24 @@ function plugin_room_install() {
function plugin_room_uninstall() {
global $DB;

$query = 'DROP TABLE `glpi_plugin_room_rooms_computers`';
$query = 'DROP TABLE IF EXISTS `glpi_plugin_room_rooms_computers`';
$DB->query($query);
$query = 'DROP TABLE `glpi_plugin_room_roomtypes`';
$query = 'DROP TABLE IF EXISTS `glpi_plugin_room_roomtypes`';
$DB->query($query);
$query = 'DROP TABLE `glpi_plugin_room_roomaccessconds`';
$query = 'DROP TABLE IF EXISTS `glpi_plugin_room_roomaccessconds`';
$DB->query($query);
$query = 'DROP TABLE `glpi_plugin_room_dropdown1s`';
$query = 'DROP TABLE IF EXISTS `glpi_plugin_room_dropdown1s`';
$DB->query($query);
$query = 'DROP TABLE `glpi_plugin_room_rooms`';
$query = 'DROP TABLE IF EXISTS `glpi_plugin_room_rooms`';
$DB->query($query);

$tables_glpi = array(
"glpi_displaypreferences",
"glpi_documents_items",
"glpi_bookmarks",
"glpi_logs"
"glpi_logs",
'glpi_items_tickets',
'glpi_reservationitems',
);

foreach ($tables_glpi as $table_glpi)
Expand Down Expand Up @@ -569,4 +578,13 @@ function plugin_room_MassiveActionsProcess($data) {
}
}

function plugin_room_AssignToTicket($types) {
global $LANG;

if (in_array('PluginRoomRoom', $_SESSION['glpiactiveprofile']['helpdesk_item_type'])) {
$types['PluginRoomRoom'] = $LANG['plugin_room'][0];
}
return $types;
}

?>
1 change: 0 additions & 1 deletion inc/dropdown1.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion inc/menu.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id$
-------------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion inc/profile.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id$
* -------------------------------------------------------------------------
* Room plugin for GLPI
* Copyright (C) 2003-2011 by the certificates Development Team.
Expand Down
20 changes: 18 additions & 2 deletions inc/room.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

/*
* @version $Id: plugin_room.class.php 40 2009-03-04 07:00:56Z remi $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down Expand Up @@ -87,6 +86,13 @@ function getSearchOptions() {
$tab[2]['linkfield'] = 'type';
$tab[2]['name'] = __('Type');

$tab[26]['table'] = 'glpi_groups';
$tab[26]['field'] = 'completename';
$tab[26]['linkfield'] = 'groups_id_tech';
$tab[26]['name'] = __('Group in charge of the hardware');
$tab[26]['condition'] = '`is_assign`';
$tab[26]['datatype'] = 'dropdown';

$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'tech_num';
Expand Down Expand Up @@ -307,7 +313,17 @@ function showForm($ID, $options = array()) {
echo "<tr class='tab_bg_1'><td>" . $LANG['plugin_room'][4] . ": </td>";
echo "<td>";
Dropdown::showInteger("size", $this->fields["size"], 0, 500);
echo "</td><td colspan='2'>&nbsp;</td></tr>";
echo "</td>";

// Dropdown du Groupe responsable technique
echo '<td>' . __('Group in charge of the hardware') . '</td><td>';
Group::dropdown([
'name' => 'groups_id_tech',
'value' => $this->fields['groups_id_tech'],
'entity' => $this->fields['entities_id'],
'condition' => '`is_assign`'
]);
echo '</td></tr>';

// Date d'achat
echo "<tr class='tab_bg_1'><td>" . __('Date of purchase') . ": </td>";
Expand Down
1 change: 0 additions & 1 deletion inc/room_computer.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: room_computer.class.php 17154 2012-01-24 11:27:36Z moyo $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2012 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion inc/roomaccesscond.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2009-09-21 14:58 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion inc/roomtype.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: HEADER 1 2010-02-24 00:12 Tsmr $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2010 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id$
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion locales/de_DE.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id: fr_FR.php 8382 2009-01-06 18:41:29Z moyo $
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion locales/en_GB.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id$
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
1 change: 0 additions & 1 deletion locales/fr_FR.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
* @version $Id$
* -------------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2009 by the INDEPNET Development Team.
Expand Down
Binary file added room.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions room.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name>Room Management</name>
<key>room</key>
<state>stable</state>
<logo>https://raw.githubusercontent.com/pluginsGLPI/room/master/room.png</logo>
<description>
<short>
<en><![CDATA[Manage room and included hardwares (such as classrooms)]]></en>
<fr><![CDATA[Gestion des pièces/salles et des éléments inclus (comme des salles de classe)]]></fr>
</short>
<long>
<en><![CDATA[This plugin allows you to manage the rooms and the elements that are included in. A room is not the same as a location that already exists in GLPI because it can not contain items nor be loaned (which a room can be).]]></en>
<fr><![CDATA[Ce plugin vous permettra de gérer les pièces/salles et les éléments qui les composent. La notion de salle n'est pas la même que la notion de lieu déjà existante dans GLPI car cette dernière ne peut contenir des matériels ni être réservée (ce qu'une salle peut être).]]></fr>
</long>
</description>
<homepage>https://github.com/pluginsGLPI/room</homepage>
<download>https://github.com/pluginsGLPI/room/releases</download>
<issues>https://github.com/pluginsGLPI/room/issues</issues>
<readme>https://raw.githubusercontent.com/pluginsGLPI/room/master/README.md</readme>
<authors>
<author>Julien Dombre</author>
<author>bogucool</author>
<author>Pascal Marier-Dionne</author>
<author>Claude Duvergier</author>
</authors>
<versions>
<version>
<num>1.0</num>
<compatibility>0.71</compatibility>
</version>
<version>
<num>2.0</num>
<compatibility>0.72</compatibility>
</version>
<version>
<num>2.1</num>
<compatibility>0.72</compatibility>
</version>
<version>
<num>3.0.1</num>
<compatibility>0.80</compatibility>
</version>
<version>
<num>3.0.2</num>
<compatibility>0.80.7</compatibility>
</version>
<version>
<num>3.0.3</num>
<compatibility>0.84</compatibility>
</version>
<version>
<num>3.0.4b1</num>
<compatibility>0.85</compatibility>
</version>
<version>
<num>3.0.4b2</num>
<compatibility>0.85</compatibility>
<compatibility>0.90</compatibility>
</version>
<version>
<num>3.1.0</num>
<compatibility>0.85</compatibility>
<compatibility>0.90</compatibility>
<compatibility>9.1</compatibility>
<compatibility>9.1.1</compatibility>
</version>
</versions>
<langs>
<lang>de_DE</lang>
<lang>en_GB</lang>
<lang>fr_FR</lang>
<lang>it_IT</lang>
</langs>
<license>GPL v2+</license>
<tags>
<en>
<tag>Places</tag>
<tag>Inventory</tag>
<tag>Management</tag>
<tag>Reservation</tag>
</en>
<lang>
<tag>Lieux</tag>
<tag>Inventaire</tag>
<tag>Gestion</tag>
<tag>Réservation</tag>
</lang>
</tags>
</root>
Loading

0 comments on commit 70ee75d

Please sign in to comment.