From 7dd9b6601b48fd9c34c08eda63400aad62b4ac4f Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 16:55:21 +0200 Subject: [PATCH 1/6] 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 d0ab39c..54c273e 100644 --- a/hook.php +++ b/hook.php @@ -143,7 +143,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 a2aa92cbf5bcedc35751acb6dbf28bf044ff7336 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 14:55:50 +0200 Subject: [PATCH 2/6] 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 54c273e..a79c1a9 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 85c3b70eb49e88ecaa8ec6ed14b483478960ee4b Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 22:53:11 +0200 Subject: [PATCH 3/6] 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 35017fdebd016097e57305d83528309fb3d50050 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Fri, 8 Apr 2022 10:20:31 +0200 Subject: [PATCH 4/6] 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 81c87981521f9b9e321e5d6976d1a4580b536cf9 Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Thu, 7 Apr 2022 21:15:05 +0000 Subject: [PATCH 5/6] 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 757451704bf752792b4d8ee6c58fa281bce2590d Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Fri, 8 Apr 2022 10:48:30 +0200 Subject: [PATCH 6/6] 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-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