From 9e6c6b095607ac5b822968231bac65f720a8f0fc Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 30 Jun 2020 17:51:26 +0200 Subject: [PATCH 01/27] Add php cs fixer (test) --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c09b1ba --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,10 @@ +on: [push, pull_request] +name: Main +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga From fbb03661fd5a34cd752cf874b679dbf0422a72ea Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 30 Jun 2020 18:09:47 +0200 Subject: [PATCH 02/27] Delete main.yml --- .github/workflows/main.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c09b1ba..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -on: [push, pull_request] -name: Main -jobs: - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga From afe42667a7c2e1ec2b830de24af858c7d85273a4 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sat, 23 Oct 2021 12:14:45 +0200 Subject: [PATCH 03/27] Rename .php_cs.dist to .php-cs-fixer.dist.php --- .php_cs.dist => .php-cs-fixer.dist.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (100%) diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 100% rename from .php_cs.dist rename to .php-cs-fixer.dist.php From 2792d7bc0549c91264f97cb95937951d07fd0fdf Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Mon, 25 Oct 2021 09:59:37 +0200 Subject: [PATCH 04/27] README: Removed comment added in fork --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index ca791cd..f7670ec 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,6 @@ 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). -GLPI 9.5.1 compatibility added and tested. Translation fixed (gettext domain). -I also added a basic hungarian translation :) - Installation ------------ From 7960efcb557602ab291d2467fa4ea83b0fde738f Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Mon, 25 Oct 2021 10:03:04 +0200 Subject: [PATCH 05/27] Revert "Rename .php_cs.dist to .php-cs-fixer.dist.php" This reverts commit afe42667a7c2e1ec2b830de24af858c7d85273a4. --- .php-cs-fixer.dist.php => .php_cs.dist | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .php-cs-fixer.dist.php => .php_cs.dist (100%) diff --git a/.php-cs-fixer.dist.php b/.php_cs.dist similarity index 100% rename from .php-cs-fixer.dist.php rename to .php_cs.dist From 7b2af2b5064132918a140a16bde38b8c9255d47f Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Fri, 17 Dec 2021 16:36:57 +0100 Subject: [PATCH 06/27] glpi10 compatibility: Preliminary tests show that the plugin works as is on glpi 10. --- setup.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.php b/setup.php index bba7857..1c207c3 100644 --- a/setup.php +++ b/setup.php @@ -55,13 +55,13 @@ function plugin_version_room() // Optional : check prerequisites before install : may print errors or add to message after redirect function plugin_room_check_prerequisites() { - if (version_compare(GLPI_VERSION, '9.5', '>=') && version_compare(GLPI_VERSION, '9.6', '<=')) { + if (version_compare(GLPI_VERSION, '9.5', '>=') && version_compare(GLPI_VERSION, '10.1', '<=')) { return true; } else { if (method_exists('Plugin', 'messageIncompatible')) { - echo Plugin::messageIncompatible('core', '9.5', '9.6'); + echo Plugin::messageIncompatible('core', '9.5', '10.1'); } else { - echo 'This plugin requires GLPI >= 9.5 && <= 9.6'; + echo 'This plugin requires GLPI >= 9.5 && <= 10.1'; } return false; } From 1ef47af7c4415114447c87be2714a83fdba71467 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 14:18:42 +0200 Subject: [PATCH 07/27] Fix spurious '\n' in profile window in GLPI 10. Use double quotes when emitting '\n' otherwise it's shown on screen in the profile window in GLPI 10. Also set the Save button class --- inc/profile.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/profile.class.php b/inc/profile.class.php index 61c817c..e7a7326 100755 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -129,9 +129,10 @@ public function showForm($profiles_id = 0, $openform = true, $closeform = true) _sx('button', 'Save'), [ 'name' => 'update', + 'class' => 'btn btn-primary', ] ); - echo '\n'; + echo "\n"; Html::closeForm(); } echo ''; From 88c0352a607aac15469dc3547ae880e3b4e3f3a2 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 14:55:50 +0200 Subject: [PATCH 08/27] On uninstall, delete reservations for rooms This should fix issue 64 reported on reservation plugins. --- hook.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hook.php b/hook.php index d0ab39c..bc4e991 100644 --- a/hook.php +++ b/hook.php @@ -121,6 +121,7 @@ function plugin_room_uninstall() { global $DB; + // Drop plugin tables $tables = [ 'glpi_plugin_room_rooms_computers', 'glpi_plugin_room_roomtypes', @@ -133,6 +134,11 @@ function plugin_room_uninstall() $DB->query("DROP TABLE IF EXISTS `$table`;"); } + // Delete reservations + $DB->query('DELETE FROM `glpi_reservations` WHERE `reservationitems_id` in + (SELECT id FROM `glpi_reservationitems` WHERE `itemtype` = "PluginRoomRoom";)'; + + // Delete logs, items and other things from glpi tables $tables_glpi = [ 'glpi_displaypreferences', 'glpi_documents_items', From e4086fb75b37870e9ce3f17f43d5222eeb589a59 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Thu, 7 Apr 2022 15:56:45 +0200 Subject: [PATCH 09/27] missing parenthesis --- hook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook.php b/hook.php index bc4e991..d7f5014 100644 --- a/hook.php +++ b/hook.php @@ -136,7 +136,7 @@ function plugin_room_uninstall() // Delete reservations $DB->query('DELETE FROM `glpi_reservations` WHERE `reservationitems_id` in - (SELECT id FROM `glpi_reservationitems` WHERE `itemtype` = "PluginRoomRoom";)'; + (SELECT id FROM `glpi_reservationitems` WHERE `itemtype` = "PluginRoomRoom";)'); // Delete logs, items and other things from glpi tables $tables_glpi = [ From 26011868cc0aabdd3289b9b1cd75681d01f1bd3f Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 16:08:06 +0200 Subject: [PATCH 10/27] Also fix wrong placement of semicolon --- hook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook.php b/hook.php index d7f5014..499b0c9 100644 --- a/hook.php +++ b/hook.php @@ -136,7 +136,7 @@ function plugin_room_uninstall() // Delete reservations $DB->query('DELETE FROM `glpi_reservations` WHERE `reservationitems_id` in - (SELECT id FROM `glpi_reservationitems` WHERE `itemtype` = "PluginRoomRoom";)'); + (SELECT id FROM `glpi_reservationitems` WHERE `itemtype` = "PluginRoomRoom");'); // Delete logs, items and other things from glpi tables $tables_glpi = [ From 3c0e9df2fccfee83c9730aff3354b39661cc69f1 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 16:16:12 +0200 Subject: [PATCH 11/27] Try to use Innodb and utf8mb4 (WIP) --- hook.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hook.php b/hook.php index 499b0c9..d0bc751 100644 --- a/hook.php +++ b/hook.php @@ -50,7 +50,7 @@ function plugin_room_install() KEY `dropdown2` (`dropdown2`), KEY `tech_num` (`tech_num`), KEY `users_id` (`users_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC EOS; $DB->query($query) || die('error adding glpi_plugin_room table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -65,7 +65,7 @@ function plugin_room_install() PRIMARY KEY (`id`), UNIQUE `computers_id` (`computers_id`), KEY `rooms_id` (`rooms_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_rooms_computers table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -79,7 +79,7 @@ function plugin_room_install() `comment` text collate utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_roomtypes table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -93,7 +93,7 @@ function plugin_room_install() `comment` text collate utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_roomaccessconds table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -107,7 +107,7 @@ function plugin_room_install() `comment` text collate utf8_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_roomspecificities table ' . __('Error during the database update', 'room') . $DB->error()); } From 18477301705985ce625960f588632ed3f50b29b3 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 16:24:49 +0200 Subject: [PATCH 12/27] Fix collate statement --- hook.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/hook.php b/hook.php index d0bc751..95f8c7e 100644 --- a/hook.php +++ b/hook.php @@ -11,7 +11,7 @@ function plugin_room_install() $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_rooms` ( `id` int(11) NOT NULL auto_increment, - `name` varchar(255) collate utf8_unicode_ci default NULL, + `name` varchar(255) collate utf8mb4_unicode_ci default NULL, `entities_id` int(11) NOT NULL default 0, `locations_id` int(11) NOT NULL default 0, `is_recursive` smallint(6) NOT NULL default 0, @@ -25,11 +25,11 @@ function plugin_room_install() `printer` smallint(6) NOT NULL default 0, `videoprojector` smallint(6) NOT NULL default 0, `wifi` smallint(6) NOT NULL default 0, - `comment` text collate utf8_unicode_ci, - `opening` varchar(255) collate utf8_unicode_ci default NULL, - `limits` varchar(255) collate utf8_unicode_ci default NULL, - `text1` varchar(255) collate utf8_unicode_ci default NULL, - `text2` varchar(255) collate utf8_unicode_ci default NULL, + `comment` text collate utf8mb4_unicode_ci, + `opening` varchar(255) collate utf8mb4_unicode_ci default NULL, + `limits` varchar(255) collate utf8mb4_unicode_ci default NULL, + `text1` varchar(255) collate utf8mb4_unicode_ci default NULL, + `text2` varchar(255) collate utf8mb4_unicode_ci default NULL, `dropdown1` int(11) NOT NULL default 0, `dropdown2` int(11) NOT NULL default 0, `tech_num` int(11) NOT NULL default 0, @@ -50,7 +50,7 @@ function plugin_room_install() KEY `dropdown2` (`dropdown2`), KEY `tech_num` (`tech_num`), KEY `users_id` (`users_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC EOS; $DB->query($query) || die('error adding glpi_plugin_room table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -65,7 +65,7 @@ function plugin_room_install() PRIMARY KEY (`id`), UNIQUE `computers_id` (`computers_id`), KEY `rooms_id` (`rooms_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_rooms_computers table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -75,11 +75,11 @@ function plugin_room_install() $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_roomtypes` ( `id` int(11) NOT NULL auto_increment, - `name` varchar(255) collate utf8_unicode_ci default NULL, - `comment` text collate utf8_unicode_ci, + `name` varchar(255) collate utf8mb4_unicode_ci default NULL, + `comment` text collate utf8mb4_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_roomtypes table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -89,11 +89,11 @@ function plugin_room_install() $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_roomaccessconds` ( `id` int(11) NOT NULL auto_increment, - `name` varchar(255) collate utf8_unicode_ci default NULL, - `comment` text collate utf8_unicode_ci, + `name` varchar(255) collate utf8mb4_unicode_ci default NULL, + `comment` text collate utf8mb4_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_roomaccessconds table ' . __('Error during the database update', 'room') . $DB->error()); } @@ -103,11 +103,11 @@ function plugin_room_install() $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_dropdown1s` ( `id` int(11) NOT NULL auto_increment, - `name` varchar(255) collate utf8_unicode_ci default NULL, - `comment` text collate utf8_unicode_ci, + `name` varchar(255) collate utf8mb4_unicode_ci default NULL, + `comment` text collate utf8mb4_unicode_ci, PRIMARY KEY (`id`), KEY `name` (`name`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; EOS; $DB->query($query) || die('error adding glpi_plugin_room_roomspecificities table ' . __('Error during the database update', 'room') . $DB->error()); } From a4edf0d779db3c00b609c81d457bb8215ada5976 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 16:33:18 +0200 Subject: [PATCH 13/27] Fix signed int fields --- hook.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hook.php b/hook.php index 95f8c7e..9775b38 100644 --- a/hook.php +++ b/hook.php @@ -10,18 +10,18 @@ function plugin_room_install() if (!$DB->tableExists('glpi_plugin_room_rooms')) { $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_rooms` ( - `id` int(11) NOT NULL auto_increment, + `id` int unsigned NOT NULL auto_increment, `name` varchar(255) collate utf8mb4_unicode_ci default NULL, - `entities_id` int(11) NOT NULL default 0, - `locations_id` int(11) NOT NULL default 0, + `entities_id` int unsigned NOT NULL default 0, + `locations_id` int unsigned NOT NULL default 0, `is_recursive` smallint(6) NOT NULL default 0, `is_deleted` smallint(6) NOT NULL default 0, - `type` int(11) NOT NULL default 0, + `type` int unsigned NOT NULL default 0, `date_mod` datetime default NULL, `size` smallint(6) NOT NULL default 0, `count_linked` smallint(6) NOT NULL default 0, `buy` datetime default NULL, - `access` int(11) NOT NULL default 0, + `access` int unsigned NOT NULL default 0, `printer` smallint(6) NOT NULL default 0, `videoprojector` smallint(6) NOT NULL default 0, `wifi` smallint(6) NOT NULL default 0, @@ -30,16 +30,16 @@ function plugin_room_install() `limits` varchar(255) collate utf8mb4_unicode_ci default NULL, `text1` varchar(255) collate utf8mb4_unicode_ci default NULL, `text2` varchar(255) collate utf8mb4_unicode_ci default NULL, - `dropdown1` int(11) NOT NULL default 0, - `dropdown2` int(11) NOT NULL default 0, - `tech_num` int(11) NOT NULL default 0, - `users_id` int(11) NOT NULL default 0, + `dropdown1` int unsigned NOT NULL default 0, + `dropdown2` int unsigned NOT NULL default 0, + `tech_num` int unsigned NOT NULL default 0, + `users_id` int unsigned NOT NULL default 0, `is_template` smallint(6) NOT NULL default 0, # not used / for reservation search engine `location` smallint(6) NOT NULL default 0, # not used / for reservation search engine `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)", + `groups_id_tech` int unsigned 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`), @@ -59,9 +59,9 @@ function plugin_room_install() if (!$DB->TableExists('glpi_plugin_room_rooms_computers')) { $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_rooms_computers` ( - `id` int(11) NOT NULL auto_increment, - `computers_id` int(11) NOT NULL, - `rooms_id` int(11) NOT NULL, + `id` int unsigned NOT NULL auto_increment, + `computers_id` int unsigned NOT NULL, + `rooms_id` int unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE `computers_id` (`computers_id`), KEY `rooms_id` (`rooms_id`) @@ -74,7 +74,7 @@ function plugin_room_install() if (!$DB->TableExists('glpi_plugin_room_roomtypes')) { $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_roomtypes` ( - `id` int(11) NOT NULL auto_increment, + `id` int unsigned NOT NULL auto_increment, `name` varchar(255) collate utf8mb4_unicode_ci default NULL, `comment` text collate utf8mb4_unicode_ci, PRIMARY KEY (`id`), @@ -88,7 +88,7 @@ function plugin_room_install() if (!$DB->TableExists('glpi_plugin_room_roomaccessconds')) { $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_roomaccessconds` ( - `id` int(11) NOT NULL auto_increment, + `id` int unsigned NOT NULL auto_increment, `name` varchar(255) collate utf8mb4_unicode_ci default NULL, `comment` text collate utf8mb4_unicode_ci, PRIMARY KEY (`id`), @@ -102,7 +102,7 @@ function plugin_room_install() if (!$DB->TableExists('glpi_plugin_room_dropdown1s')) { $query = <<<'EOS' CREATE TABLE `glpi_plugin_room_dropdown1s` ( - `id` int(11) NOT NULL auto_increment, + `id` int unsigned NOT NULL auto_increment, `name` varchar(255) collate utf8mb4_unicode_ci default NULL, `comment` text collate utf8mb4_unicode_ci, PRIMARY KEY (`id`), From d3300c6766e4a3bd478537e44e3eb1172f541836 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 16:55:21 +0200 Subject: [PATCH 14/27] Uninstall: use double quotes otherwise the variable doesn't get expanded --- hook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook.php b/hook.php index 9775b38..9f3ffc3 100644 --- a/hook.php +++ b/hook.php @@ -149,7 +149,7 @@ function plugin_room_uninstall() ]; foreach ($tables_glpi as $table_glpi) { - $DB->query('DELETE FROM `$table_glpi` WHERE `itemtype` = "PluginRoomRoom";'); + $DB->query("DELETE FROM `$table_glpi` WHERE `itemtype` = 'PluginRoomRoom';"); } return true; From f1fcf530bb212ca2d8ba3f2036f3e8b7e77f2ffe Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 22:53:11 +0200 Subject: [PATCH 15/27] Remove automatic actions They were there only for testing and were failing, anyway. --- .github/workflows/main.yml | 10 ---------- .github/workflows/php-lint.yml | 8 -------- 2 files changed, 18 deletions(-) delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/php-lint.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c09b1ba..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -on: [push, pull_request] -name: Main -jobs: - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml deleted file mode 100644 index 3abbc65..0000000 --- a/.github/workflows/php-lint.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: PHP Linting -on: pull_request -jobs: - phplint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: michaelw90/PHP-Lint@master From c26d962680c6160be1348b33580b6bea527eaabc Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 21:15:05 +0000 Subject: [PATCH 16/27] Update POT --- locales/room.pot | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/locales/room.pot b/locales/room.pot index 9fb3db5..11aad3a 100644 --- a/locales/room.pot +++ b/locales/room.pot @@ -1,13 +1,14 @@ -# GLPI - Room Management plugin -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Rooms Development Team +# This file is distributed under the same license as the GLPI - Rooms plugin package. # FIRST AUTHOR , YEAR. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: GLPI - Room plugin 3.2.0-jb\n\n" +"Project-Id-Version: GLPI - Rooms plugin\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-30 18:48+0200\n" +"POT-Creation-Date: 2022-04-07 21:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,7 +22,7 @@ msgstr "" msgid "Error during the database update" msgstr "" -#: hook.php:276 hook.php:284 hook.php:362 front/room.form.php:82 +#: hook.php:276 hook.php:284 hook.php:362 index.php:11 front/room.form.php:82 #: front/room.php:11 inc/profile.class.php:145 msgid "Room Management" msgstr "" @@ -57,14 +58,11 @@ msgstr "" msgid "General" msgstr "" -#: inc/roomaccesscond.class.php:14 inc/room.class.php:113 -#: inc/room.class.php:330 -msgid "Conditions of Access" -msgstr "" - -#: inc/room.class.php:61 inc/room.class.php:318 +#: inc/room.class.php:61 inc/room.class.php:318 inc/roomtype.class.php:14 msgid "Type" -msgstr "" +msgid_plural "Types" +msgstr[0] "" +msgstr[1] "" #: inc/room.class.php:69 inc/room.class.php:377 msgid "Group in charge of the hardware" @@ -86,6 +84,11 @@ msgstr "" msgid "Seating" msgstr "" +#: inc/room.class.php:113 inc/room.class.php:330 +#: inc/roomaccesscond.class.php:14 +msgid "Conditions of Access" +msgstr "" + #: inc/room.class.php:121 inc/room.class.php:387 msgid "Date of purchase" msgstr "" From 123b7a8ff18b145fd30aeb575d93742ffea0eb86 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Fri, 8 Apr 2022 10:20:31 +0200 Subject: [PATCH 17/27] Updated italian translation --- locales/it_IT.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/locales/it_IT.po b/locales/it_IT.po index af38740..8859006 100644 --- a/locales/it_IT.po +++ b/locales/it_IT.po @@ -52,7 +52,7 @@ msgstr[1] "Locali" #: inc/dropdown1.class.php:14 msgid "Room specificities" -msgstr "Caratteristica di Locale" +msgstr "Caratteristica del locale" #: inc/profile.class.php:115 msgid "General" @@ -61,27 +61,27 @@ msgstr "" #: inc/roomaccesscond.class.php:14 inc/room.class.php:113 #: inc/room.class.php:330 msgid "Conditions of Access" -msgstr "" +msgstr "Condizioni di accesso" #: inc/room.class.php:61 inc/room.class.php:318 msgid "Type" -msgstr "" +msgstr "Tipo" #: inc/room.class.php:69 inc/room.class.php:377 msgid "Group in charge of the hardware" -msgstr "" +msgstr "Gruppo responsabile dell'hardware" #: inc/room.class.php:79 inc/room.class.php:353 msgid "Technician in charge of the hardware" -msgstr "" +msgstr "Responsabile tecnico" #: inc/room.class.php:87 inc/room.class.php:342 msgid "Alternate username" -msgstr "" +msgstr "Nome utente alternativo" #: inc/room.class.php:95 inc/room.class.php:153 inc/room.class.php:468 msgid "Comments" -msgstr "" +msgstr "Commenti" #: inc/room.class.php:105 inc/room.class.php:364 msgid "Seating" @@ -89,7 +89,7 @@ msgstr "Posti a sedere" #: inc/room.class.php:121 inc/room.class.php:387 msgid "Date of purchase" -msgstr "" +msgstr "Data di acquisto" #: inc/room.class.php:129 msgid "Printer" @@ -149,11 +149,11 @@ msgstr "" #: inc/room.class.php:306 msgid "Location" -msgstr "" +msgstr "Posizione" #: inc/room.class.php:400 msgid "Whiteboard" -msgstr "" +msgstr "Lavagna" #: inc/room.class.php:513 msgid "Associated items" From 4c7a3e284e9b4da79b474ac450bf883e84a56959 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Fri, 8 Apr 2022 10:48:30 +0200 Subject: [PATCH 18/27] Update italian mo file --- locales/it_IT.mo | Bin 1435 -> 1979 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/locales/it_IT.mo b/locales/it_IT.mo index 5c09eaa170e3cc6f36e9347fa290dd6a84066302..ec39a07e9f52810a5ead435380d4bec01f33109c 100644 GIT binary patch literal 1979 zcmaKrOKco97{?8i*HT_>c@zpb0;xpREW4Ws!h}?Wl0+-zu}YToh`cjjCaz}e!S)1- z;J^*;?G=H58=N?B?5PqLgv1GniYtN>Hy+}^|MPAVk^|O^fA);+|M&3s^QjZp1=`bi z&*43Jn-J6BKOnbHZWp2jehQufzXb0AZ-DoL--2hrAHaveUqA`|2|fd!y+ermz?VVZ zw*;O5*TK`^7I;5cfOmrp$m`z+S@$FGLGT*L`k#Zm?i-Nz-I(yZ34faKSMWLf{{v*b zbLdWjQy`z$2KoGpARf_2w+ElsLDso>rx1^UKZ0!c@8DVRFYpoY^j%|rr@;%Dr{EO0 z1G4=ef*hY~AfNv+$hx0_4})J%{@(=IuJ1wi=N8E8egj$WZ}0)|44mfpK0D#;gi8}{ zgPex~WWD!5j_(H`pLZR^Bfdb#I$wdDVz?9a*=Ei^$7H`jIyUx~ZRT_L8{5R^v5yFG z)OZ5?Z)2VP_9OM|2bWl-8tlBJ&uw-c%!UtafPBMoos5 zhPomz22h2qVv~FgJN2j}5k2J2$Dv$PMis=)jpx3mOz-FnuHl3&f}knH*1^}SvU_CK zJ2IO&GMg1c%61J7Q|5nM9A2$SaL2wx`?hsXRt}uKLRqj*T;A1zMiwyt0HFbF$k@XJ^LiR+SIQ&?)0f z1;bM*U-5xzDl~Ys|1M4-9#$Iqek+TQIBsQFKW7BGK z0rFxisH$cw_A4qX#Ii&vVnno9A^*o8}xq4um8>U!Ljw$L%SljOxRtDV&pa9QDj+EayrpXBy9GBOt1 Ezfv0Sp#T5? delta 622 zcmX}pJxIe)5Ww-*HnwWD+WJ{kc=!Q=xC%lS5f!9W&_P{?964 zxVQ*{iy#ON4o+?^evE=Tx+(szM2}v6p?UZ2UUJoP7_U5~tg0e9$X@c6>?7AgT!77OmC;gMc4(? Date: Fri, 8 Apr 2022 13:08:41 +0200 Subject: [PATCH 19/27] Fix unsigned & timestamps --- hook.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hook.php b/hook.php index 9f3ffc3..867d51e 100644 --- a/hook.php +++ b/hook.php @@ -17,10 +17,10 @@ function plugin_room_install() `is_recursive` smallint(6) NOT NULL default 0, `is_deleted` smallint(6) NOT NULL default 0, `type` int unsigned NOT NULL default 0, - `date_mod` datetime default NULL, + `date_mod` timestamp NULL default NULL, `size` smallint(6) NOT NULL default 0, `count_linked` smallint(6) NOT NULL default 0, - `buy` datetime default NULL, + `buy` timestamp NULL default NULL, `access` int unsigned NOT NULL default 0, `printer` smallint(6) NOT NULL default 0, `videoprojector` smallint(6) NOT NULL default 0, @@ -37,8 +37,8 @@ function plugin_room_install() `is_template` smallint(6) NOT NULL default 0, # not used / for reservation search engine `location` smallint(6) NOT NULL default 0, # not used / for reservation search engine `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 + `manufacturers_id` int unsigned NOT NULL default 0, # not used / for reservation search engine + `groups_id` int unsigned NOT NULL default 0, # not used / for reservation search engine `groups_id_tech` int unsigned NOT NULL default 0 COMMENT "Group in charge of the hardware. RELATION to glpi_groups (id)", PRIMARY KEY (`id`), KEY `entities_id` (`entities_id`), From 341e016e6c973f26d36940ad15c361c0ddcaaad4 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Mon, 6 Jun 2022 14:36:11 +0200 Subject: [PATCH 20/27] Fix addSelect for glpi10 --- hook.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hook.php b/hook.php index 867d51e..2bfaa9a 100644 --- a/hook.php +++ b/hook.php @@ -299,10 +299,10 @@ function plugin_room_getAddSearchOptions($itemtype) function plugin_room_addSelect($type, $ID, $num) { - global $SEARCH_OPTION; + $searchopt = &Search::getOptions($type); - $table = $SEARCH_OPTION[$type][$ID]['table']; - $field = $SEARCH_OPTION[$type][$ID]['field']; + $table = $searchopt[$ID]['table']; + $field = $searchopt[$ID]['field']; // Example of standard Select clause but use it ONLY for specific Select // No need of the function if you do not have specific cases From 21be6ce7af993f03d36e54809b6420a49d983d61 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Mon, 6 Jun 2022 15:26:50 +0200 Subject: [PATCH 21/27] room.form.php: improve by avoiding nesting of 'if' conditions --- front/room.form.php | 112 ++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 62 deletions(-) diff --git a/front/room.form.php b/front/room.form.php index fa31944..043318f 100644 --- a/front/room.form.php +++ b/front/room.form.php @@ -26,68 +26,56 @@ $newID = $room->add($_POST); Html::back(); -} else { - if (isset($_POST['delete'])) { // Supression d'une salle - $room->check($_POST['id'], DELETE); - - $room->delete($_POST); - Html::redirect($CFG_GLPI['root_doc'] . '/plugins/room/index.php'); - } else { - if (isset($_POST['purge'])) { // Purge de la salle - $room->check($_POST['id'], PURGE); - - $room->delete($_POST, 1); - Html::redirect($CFG_GLPI['root_doc'] . '/plugins/room/index.php'); - } else { - if (isset($_POST['restore'])) { // Restauration de la salle - $room->check($_POST['id'], PURGE); - - $room->restore($_POST); - Html::redirect($CFG_GLPI['root_doc'] . '/plugins/room/index.php'); - } else { - if (isset($_POST['update'])) { // Modification d'une salle - $room->check($_POST['id'], UPDATE); - - $room->update($_POST); - Html::back(); - } else { - if (isset($_POST['additem'])) { // Ajout de la liaison à un ordinateur - $room->check($_POST['room_id'], UPDATE); // Ça devrait pas être rooms_id? - - if ($_POST['room_id'] > 0 && $_POST['computers_id'] > 0) { - $room->plugin_room_AddDevice($_POST['room_id'], $_POST['computers_id']); - } - Html::back(); - } else { - if (isset($_POST['deleteitem'])) { // Suppression de la liaison à un ordinateur - $room->check($_POST['room_id'], UPDATE); - - if (count($_POST['item'])) { - foreach ($_POST['item'] as $key => $val) { - $room->plugin_room_DeleteDevice($key); - } - } - Html::back(); - } else { // Logiquement on passe ici pour visualiser une salle - $room->check($_GET['id'], READ); - - // test l'onglet de départ a afficher à l'ouverture de la fiche - if (!isset($_SESSION['glpi_tab'])) { - $_SESSION['glpi_tab'] = 1; - } - if (isset($_GET['tab'])) { - $_SESSION['glpi_tab'] = $_GET['tab']; - } - - Html::header(__('Room Management', 'room'), '', 'assets', 'pluginroommenu'); - - $room->display($_GET); - - Html::footer(); - } - } - } - } +} else if (isset($_POST['delete'])) { // Supression d'une salle + $room->check($_POST['id'], DELETE); + + $room->delete($_POST); + Html::redirect($CFG_GLPI['root_doc'] . '/plugins/room/index.php'); +} else if (isset($_POST['purge'])) { // Purge de la salle + $room->check($_POST['id'], PURGE); + + $room->delete($_POST, 1); + Html::redirect($CFG_GLPI['root_doc'] . '/plugins/room/index.php'); +} else if (isset($_POST['restore'])) { // Restauration de la salle + $room->check($_POST['id'], PURGE); + + $room->restore($_POST); + Html::redirect($CFG_GLPI['root_doc'] . '/plugins/room/index.php'); +} else if (isset($_POST['update'])) { // Modification d'une salle + $room->check($_POST['id'], UPDATE); + + $room->update($_POST); + Html::back(); +} else if (isset($_POST['additem'])) { // Ajout de la liaison à un ordinateur + $room->check($_POST['room_id'], UPDATE); // Ça devrait pas être rooms_id? + + if ($_POST['room_id'] > 0 && $_POST['computers_id'] > 0) { + $room->plugin_room_AddDevice($_POST['room_id'], $_POST['computers_id']); + } + Html::back(); +} else if (isset($_POST['deleteitem'])) { // Suppression de la liaison à un ordinateur + $room->check($_POST['room_id'], UPDATE); + + if (count($_POST['item'])) { + foreach ($_POST['item'] as $key => $val) { + $room->plugin_room_DeleteDevice($key); } } + Html::back(); +} else { // Logiquement on passe ici pour visualiser une salle + $room->check($_GET['id'], READ); + + // test l'onglet de départ a afficher à l'ouverture de la fiche + if (!isset($_SESSION['glpi_tab'])) { + $_SESSION['glpi_tab'] = 1; + } + if (isset($_GET['tab'])) { + $_SESSION['glpi_tab'] = $_GET['tab']; + } + + Html::header(__('Room Management', 'room'), '', 'assets', 'pluginroommenu'); + + $room->display($_GET); + + Html::footer(); } From 8b372b8af49e0b4154566419c65a400f59a3bea0 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Mon, 6 Jun 2022 15:30:55 +0200 Subject: [PATCH 22/27] Comment autocompletion for text fields since it's been deprecated --- inc/room.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/room.class.php b/inc/room.class.php index 52a24b2..4c4b587 100644 --- a/inc/room.class.php +++ b/inc/room.class.php @@ -301,7 +301,7 @@ public function showForm($ID, $options = []) // Nom de la salle echo '' . __('Name', 'room') . ': '; echo ''; - Html::autocompletionTextField($this, 'name'); + //Html::autocompletionTextField($this, 'name'); echo ''; echo '' . __('Location', 'room') . ': '; echo ''; @@ -417,7 +417,7 @@ public function showForm($ID, $options = []) // Spécificité 1 echo '' . __('Specificity 1', 'room') . ': '; echo ''; - Html::autocompletionTextField($this, 'text1'); + //Html::autocompletionTextField($this, 'text1'); echo ''; // Spécificité 3 @@ -435,7 +435,7 @@ public function showForm($ID, $options = []) // Spécificité 2 echo '' . __('Specificity 2', 'room') . ': '; echo ''; - Html::autocompletionTextField($this, 'text2'); + //Html::autocompletionTextField($this, 'text2'); echo ''; // Spécificité 4 @@ -453,13 +453,13 @@ public function showForm($ID, $options = []) // Horaires d'ouverture echo '' . __('Opening Times', 'room') . ': '; echo ''; - Html::autocompletionTextField($this, 'opening'); + //Html::autocompletionTextField($this, 'opening'); echo ''; // limitations echo '' . __('Limitations', 'room') . ': '; echo ''; - Html::autocompletionTextField($this, 'limits'); + //Html::autocompletionTextField($this, 'limits'); echo ''; // Commentaires From f3078e2cf5c6b59519ab4c01c6135d23d78e137c Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Mon, 6 Jun 2022 16:52:19 +0200 Subject: [PATCH 23/27] Restore cloning rooms in glpi 10 --- inc/room.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/room.class.php b/inc/room.class.php index 4c4b587..6be375b 100644 --- a/inc/room.class.php +++ b/inc/room.class.php @@ -2,12 +2,20 @@ class PluginRoomRoom extends CommonDBTM { - public $dohistory = true; + use Glpi\Features\Clonable; + + public $dohistory = true; public static $rightname = 'plugin_room'; protected $usenotepad = true; + public function getCloneRelations() :array { + return [ + Document_Item::class, + ]; + } + public static function getTypeName($nb = 0) { return _n('Room', 'Rooms', $nb, 'room'); From 037e37ae6a372e637d0fb8fee76ccbf3a9b70df2 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Mon, 24 Oct 2022 09:37:03 +0200 Subject: [PATCH 24/27] Fix missing Name and other fields with commit 8b372b8af49e0b4154566419c65a400f59a3bea0 I accidentally removed various fields. Fixed --- inc/room.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/room.class.php b/inc/room.class.php index 6be375b..62a1750 100644 --- a/inc/room.class.php +++ b/inc/room.class.php @@ -271,7 +271,7 @@ public function defineTabs($options = []) // Cette fonction affiche le formulaire de l'objet (en création ou en édition/consultation) // Cette fonction est appelée par /front/room.form.php // showForm(ID de l'objet,tableau pour les options) - public function showForm($ID, $options = []) + public function showForm($ID, array $options = []) { global $CFG_GLPI; @@ -309,7 +309,7 @@ public function showForm($ID, $options = []) // Nom de la salle echo '' . __('Name', 'room') . ': '; echo ''; - //Html::autocompletionTextField($this, 'name'); + echo Html::input('name', ['value' => $this->fields['name']]); echo ''; echo '' . __('Location', 'room') . ': '; echo ''; @@ -425,7 +425,7 @@ public function showForm($ID, $options = []) // Spécificité 1 echo '' . __('Specificity 1', 'room') . ': '; echo ''; - //Html::autocompletionTextField($this, 'text1'); + echo Html::input('text1', ['value' => $this->fields['text1']]); echo ''; // Spécificité 3 @@ -443,7 +443,7 @@ public function showForm($ID, $options = []) // Spécificité 2 echo '' . __('Specificity 2', 'room') . ': '; echo ''; - //Html::autocompletionTextField($this, 'text2'); + echo Html::input('text2', ['value' => $this->fields['text2']]); echo ''; // Spécificité 4 @@ -461,13 +461,13 @@ public function showForm($ID, $options = []) // Horaires d'ouverture echo '' . __('Opening Times', 'room') . ': '; echo ''; - //Html::autocompletionTextField($this, 'opening'); + echo Html::input('opening', ['value' => $this->fields['opening']]); echo ''; // limitations echo '' . __('Limitations', 'room') . ': '; echo ''; - //Html::autocompletionTextField($this, 'limits'); + echo Html::input('limits', ['value' => $this->fields['limits']]); echo ''; // Commentaires From 207c7b54b70220e013dfd97330a46d47795096ed Mon Sep 17 00:00:00 2001 From: Fernando Toledo Date: Sat, 6 Jan 2024 20:41:46 -0300 Subject: [PATCH 25/27] add translation (es_AR) --- locales/es_AR.mo | Bin 0 -> 2544 bytes locales/es_AR.po | 190 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 locales/es_AR.mo create mode 100644 locales/es_AR.po diff --git a/locales/es_AR.mo b/locales/es_AR.mo new file mode 100644 index 0000000000000000000000000000000000000000..74381c05dc7eb8b2a9ee1c75b7dad0c885bf96ce GIT binary patch literal 2544 zcmbW1ONbmr7{@Cb9~m`je7};4(U=5!ot+I5XI*uYeYmiXVKYet4^rD*J5#2+Ypm+t zxC$a3M7)Y1dlPaCGktJXmzqud2Ep-}kTj z>f*M|9|@#=$d4kYn}iqz&)C}xv;1j1&)WFZcZQz&SUEp`%7VtOlR`B<#{Wo|o z+W&wYw{^1+H-kGs3GN1O0jIzn;5^7JEqEK~D!vVJ-48%~;zJbofFFZ*fS*?V=RmIa z70CJDfVB4~@J{d|NW1?6Id0QULOcX+0lChuio+FOs5lEgf&Z_79RChTe^)`Se-gYM zJOgsy^C0*8w)+1Ih%Ln>@O^0e2gvAm^Q|`acJ`-q%(82k<_$e+4=2 zGKepTQzsx2+s}gZrv*~ad64rKK#d^hq6+0m3ErE}NCqUY}3Ud8ZAniO0($5PZ&+SK$ z{#^p8=bs?t3}^EQ$hBzKR%D616Pb2xM_x~~kG?Wdlf9ufSf6K0JD3;;xVFL0r`S;? z>a`1*cG3pgLtEF=!&QanNsaGEezNM@1H$B>Wz`ix&3R5tj02{9$h(p0KNIy7tt4TV zN-kKNiB?)@m#ad{(zB9j(emEL23?6Xh0eS<)YI{C*-BG!$Yz<&3v}76Ut%U}d14A< zb1&_ZY{jwmUW{`=H2bBCd&+Aukr$>|5fjc?CzH~dyeo^ImWe9VA_mB^kE#|^I@eC6 zV#?XFFHJ5n-F3rS9F9hELOCs_$Hk2D#rm`vlbJ#VE5wYALru)lnYl7s)Q+}nm^|Ot zISuHTOncF`z7TC#1b4)O_I*PJ}i8w%2}1GuBQKkw(slMESVVIW0}JmyXIXm z)p0R!PJ82^B4*I}!&k-?}22^<9%h2g|OHI<_fm?fGayFB{H_cuAVFQE%*z z>cdg}8C0A5>rs8AUa#?RqmEO#PZi8)%1K_%Jh8H4Qw=<~RD{ZliH(o@G8uyJL&`mm znR&OwIYk|cD%OWH*fd2AEhjix-XXo^}pEpf%8N$WD-lsN=L(~mVqsU50gdvdvROb+iI zt-Tx#0wPGzwi=NpM}`_hjhbk6o$e~PPI*|RO3c}8(IKiB&82e2N>#y9M10wYxe^w2Vd}V8TTKg-DVae#MA=}z7)1KO95GW; zfq~OvZtYyA9WQ$o>XrR3!3%oDAFaN21vG}a%LY@YVLQA*M-}*rfghw~;qg*tCO5ut z8|DvwOsq#geoz{`ng;s8q3{5(6VfvBgDO{zrV7L2>iO(xT-P&lT@RjuwbL=4f(@M} zd;!Tq*avrUd5g7AurH, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: GLPI - Rooms plugin\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-04-07 21:15+0000\n" +"PO-Revision-Date: 2024-01-06 20:40-0300\n" +"Last-Translator: Fernando Toledo \n" +"Language-Team: Fernando Toledo \n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.2.2\n" + +#: hook.php:55 hook.php:70 hook.php:84 hook.php:98 hook.php:112 +msgid "Error during the database update" +msgstr "Error durante la actualización de base de datos" + +#: hook.php:276 hook.php:284 hook.php:362 index.php:11 front/room.form.php:82 +#: front/room.php:11 inc/profile.class.php:145 +msgid "Room Management" +msgstr "Administración de Salas" + +#: hook.php:276 inc/room.class.php:51 inc/room.class.php:302 +#: inc/room.class.php:517 +msgid "Name" +msgstr "Nombre" + +#: hook.php:284 +msgid "Type of Room" +msgstr "Tipo de Sala" + +#: hook.php:317 +msgid "Add a Room" +msgstr "Agregar Sala" + +#: hook.php:333 +msgid "Post" +msgstr "Enviar" + +#: setup.php:46 inc/room.class.php:13 inc/room.class.php:635 +msgid "Room" +msgid_plural "Rooms" +msgstr[0] "Sala" +msgstr[1] "Salas" + +#: inc/dropdown1.class.php:14 +msgid "Room specificities" +msgstr "Especificaciones" + +#: inc/profile.class.php:115 +msgid "General" +msgstr "General" + +#: inc/room.class.php:61 inc/room.class.php:318 inc/roomtype.class.php:14 +msgid "Type" +msgid_plural "Types" +msgstr[0] "Tipo" +msgstr[1] "Tipos" + +#: inc/room.class.php:69 inc/room.class.php:377 +msgid "Group in charge of the hardware" +msgstr "Grupo a cargo" + +#: inc/room.class.php:79 inc/room.class.php:353 +msgid "Technician in charge of the hardware" +msgstr "Técnico a cargo" + +#: inc/room.class.php:87 inc/room.class.php:342 +msgid "Alternate username" +msgstr "Nombre de usuario alternativo" + +#: inc/room.class.php:95 inc/room.class.php:153 inc/room.class.php:468 +msgid "Comments" +msgstr "Comentarios" + +#: inc/room.class.php:105 inc/room.class.php:364 +msgid "Seating" +msgstr "Asientos" + +#: inc/room.class.php:113 inc/room.class.php:330 +#: inc/roomaccesscond.class.php:14 +msgid "Conditions of Access" +msgstr "Condiciones de acceso" + +#: inc/room.class.php:121 inc/room.class.php:387 +msgid "Date of purchase" +msgstr "Fecha de compra" + +#: inc/room.class.php:129 +msgid "Printer" +msgstr "Impresora" + +#: inc/room.class.php:137 inc/room.class.php:406 +msgid "Video Projector" +msgstr "Proyector de video" + +#: inc/room.class.php:145 inc/room.class.php:412 +msgid "WiFi" +msgstr "WiFi" + +#: inc/room.class.php:161 inc/room.class.php:454 +msgid "Opening Times" +msgstr "Horarios de Apertura" + +#: inc/room.class.php:169 inc/room.class.php:460 +msgid "Limitations" +msgstr "Limitaciones" + +#: inc/room.class.php:177 inc/room.class.php:418 +msgid "Specificity 1" +msgstr "Especificación 1" + +#: inc/room.class.php:185 inc/room.class.php:436 +msgid "Specificity 2" +msgstr "Especificación 2" + +#: inc/room.class.php:193 inc/room.class.php:424 +msgid "Specificity 3" +msgstr "Especificación 3" + +#: inc/room.class.php:201 inc/room.class.php:442 +msgid "Specificity 4" +msgstr "Especificación 4" + +#: inc/room.class.php:209 +msgid "ID" +msgstr "ID" + +#: inc/room.class.php:217 +msgid "Computers" +msgstr "Computadoras" + +#: inc/room.class.php:228 +msgid "Number of Computers" +msgstr "Número de Computadoras" + +#: inc/room.class.php:237 +msgid "Entity" +msgstr "Entidad" + +#: inc/room.class.php:294 +msgid "Last update" +msgstr "Última modificación" + +#: inc/room.class.php:306 +msgid "Location" +msgstr "Lugar" + +#: inc/room.class.php:400 +msgid "Whiteboard" +msgstr "Pizarra" + +#: inc/room.class.php:513 +msgid "Associated items" +msgstr "Items Asociados" + +#: inc/room.class.php:518 +msgid "Select the desired entity" +msgstr "Seleccionar entidad" + +#: inc/room.class.php:566 +msgid "Add" +msgstr "Agregar" + +#: inc/room.class.php:578 +msgid "Check All" +msgstr "Marcar Todos" + +#: inc/room.class.php:586 +msgid "Uncheck All" +msgstr "Desmarcar Todos" + +#: inc/room.class.php:589 +msgid "To delete" +msgstr "Para eliminar" + +#: inc/room.class.php:634 +msgid "This computer is in room:" +msgstr "Esta computadora está en la sala:" + +#: inc/room.class.php:636 +msgid "Responsible" +msgstr "Responsable" From 7eb7ee2d29ba7cd41d367c70ece86f83b35d0d99 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Thu, 31 Aug 2023 13:49:17 +0200 Subject: [PATCH 26/27] Style fixes --- inc/room.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/inc/room.class.php b/inc/room.class.php index 62a1750..ca7cafb 100644 --- a/inc/room.class.php +++ b/inc/room.class.php @@ -3,18 +3,18 @@ class PluginRoomRoom extends CommonDBTM { use Glpi\Features\Clonable; - - public $dohistory = true; + + public $dohistory = true; public static $rightname = 'plugin_room'; protected $usenotepad = true; - public function getCloneRelations() :array { - return [ - Document_Item::class, - ]; - } + public function getCloneRelations() :array { + return [ + Document_Item::class, + ]; + } public static function getTypeName($nb = 0) { @@ -255,14 +255,14 @@ public function defineTabs($options = []) $ong = []; $this->addDefaultFormTab($ong); - if (Session::haveRight('reservation', READ)) { - // Affiche "Réservations" - $this->addStandardTab('Reservation', $ong, $options); - } $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Document_Item', $ong, $options); $this->addStandardTab('Notepad', $ong, $options); + if (Session::haveRight('reservation', READ)) { + // Affiche "Réservations" + $this->addStandardTab('Reservation', $ong, $options); + } $this->addStandardTab('Log', $ong, $options); return $ong; From d270f0618574c75bbfd00a63ecf82f15c0fc38e9 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Mon, 13 May 2024 12:15:18 +0200 Subject: [PATCH 27/27] Fix uncaught exception done by theuwguy Fixes #7 --- hook.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hook.php b/hook.php index 2bfaa9a..180b412 100644 --- a/hook.php +++ b/hook.php @@ -364,7 +364,8 @@ function plugin_room_MassiveActionsProcess($data) function plugin_room_AssignToTicket($types) { - if (in_array('PluginRoomRoom', $_SESSION['glpiactiveprofile']['helpdesk_item_type'])) { + if (isset($_SESSION['glpiactiveprofile']['helpdesk_item_type']) + && in_array('PluginRoomRoom', $_SESSION['glpiactiveprofile']['helpdesk_item_type'])) { $types['PluginRoomRoom'] = __('Room Management', 'room'); } return $types;