diff --git a/.gitignore b/.gitignore index 3a9875b..9e71d2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -/vendor/ -composer.lock +*.log +.vscode/ +vendor/ diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index cc05d9a..957ec02 --- a/README.md +++ b/README.md @@ -1,9 +1,3 @@ -## Transferticketentity plugin for GLPI - -[![License](https://img.shields.io/badge/License-GNU%20GPL%20v3-blue.svg?style=flat-square)](https://github.com/pluginsGLPI/transferticketentity/blob/master/LICENSE) -[![Translate](https://img.shields.io/badge/Translate-Transifex-cyan)](https://explore.transifex.com/pluginsGLPI/glpi-plugin-transfer-ticket-entity/) - - # GLPi Transfer Ticket Entity Plugin (FR) ## Introduction @@ -43,7 +37,9 @@ Pour configurer les prérequis du transfert d'entité : Vous pouvez configurer les droits d'accès au plugin dans l'administration des profils. Les prérequis du transfert se gèrent dans l'administration des entités. +## Compatibilité +Ce plugin a été testé jusqu'à la version de GLPI 10.0.14 # GLPi Transfer Ticket Entity Plugin (EN) @@ -84,3 +80,6 @@ To configure entity transfer prerequisites : You can configure access rights to the plugin in profile administration. The transfer prerequisites are managed in the entity administration. +## Compatibility + +This plugin has been tested up to GLPI version 10.0.14 \ No newline at end of file diff --git a/ajax/getEntitiesRights.php b/ajax/getEntitiesRights.php old mode 100644 new mode 100755 index f99ef84..91f4268 --- a/ajax/getEntitiesRights.php +++ b/ajax/getEntitiesRights.php @@ -1,37 +1,37 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * LICENSE + * + * This file is part of Transferticketentity plugin for GLPI. + * + * Transferticketentity is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Transferticketentity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Reports. If not, see . + * + * @category Ticket + * @package Transferticketentity + * @author Yannick Comba, Xavier Caillaud, Infotel, Département de Maine-et-Loire, Ilyasse Mellouk + * @copyright 2015-2026 Transferticketentity team + * @license AGPL License 3.0 or (at your option) any later version + * https://www.gnu.org/licenses/gpl-3.0.html + * @link https://github.com/pluginsGLPI/transferticketentity/ + * -------------------------------------------------------------------------- */ use GlpiPlugin\Transferticketentity\Entity; -header("Content-Type: application/json; charset=UTF-8"); +header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); diff --git a/ajax/showentitygroups.php b/ajax/showentitygroups.php old mode 100644 new mode 100755 index 637d423..5fc661d --- a/ajax/showentitygroups.php +++ b/ajax/showentitygroups.php @@ -1,38 +1,38 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Metademands plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Metademands. + * + * Metademands is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Metademands is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Metademands. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2013-2022 by Metademands plugin team. + * @copyright 2015-2022 Teclib' and contributors. + * @copyright 2003-2014 by the INDEPNET Development Team. + * @licence https://www.gnu.org/licenses/gpl-3.0.html + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/Metademands + * ------------------------------------------------------------------------- */ use GlpiPlugin\Transferticketentity\Ticket; -Session::checkLoginUser(); - if (strpos($_SERVER['PHP_SELF'], "showentitygroups.php")) { header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); diff --git a/ajax/showentitymandatorygroup.php b/ajax/showentitymandatorygroup.php old mode 100644 new mode 100755 index 82b8afd..7ffae35 --- a/ajax/showentitymandatorygroup.php +++ b/ajax/showentitymandatorygroup.php @@ -1,38 +1,38 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Metademands plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Metademands. + * + * Metademands is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Metademands is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Metademands. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2013-2022 by Metademands plugin team. + * @copyright 2015-2022 Teclib' and contributors. + * @copyright 2003-2014 by the INDEPNET Development Team. + * @licence https://www.gnu.org/licenses/gpl-3.0.html + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/Metademands + * ------------------------------------------------------------------------- */ use GlpiPlugin\Transferticketentity\Entity; -Session::checkLoginUser(); - if (strpos($_SERVER['PHP_SELF'], "showentitymandatorygroup.php")) { header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); @@ -40,7 +40,6 @@ die("Sorry. You can't access this file directly"); } -Toolbox::logInfo($_POST); if (isset($_POST['entity_selection'])) { $entitites_id = $_POST['entity_selection']; diff --git a/ajax/showentitymandatoryjustification.php b/ajax/showentitymandatoryjustification.php old mode 100644 new mode 100755 index 8b35b29..eac11d5 --- a/ajax/showentitymandatoryjustification.php +++ b/ajax/showentitymandatoryjustification.php @@ -1,38 +1,38 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Metademands plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Metademands. + * + * Metademands is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Metademands is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Metademands. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2013-2022 by Metademands plugin team. + * @copyright 2015-2022 Teclib' and contributors. + * @copyright 2003-2014 by the INDEPNET Development Team. + * @licence https://www.gnu.org/licenses/gpl-3.0.html + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/Metademands + * ------------------------------------------------------------------------- */ use GlpiPlugin\Transferticketentity\Entity; -Session::checkLoginUser(); - if (strpos($_SERVER['PHP_SELF'], "showentitymandatoryjustification.php")) { header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 diff --git a/front/entity.form.php b/front/entity.form.php old mode 100644 new mode 100755 index 02ee367..3d293fa --- a/front/entity.form.php +++ b/front/entity.form.php @@ -1,32 +1,32 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * LICENSE + * + * This file is part of Transferticketentity plugin for GLPI. + * + * Transferticketentity is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Transferticketentity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Reports. If not, see . + * + * @category Ticket + * @package Transferticketentity + * @author Yannick Comba, Xavier Caillaud, Infotel, Département de Maine-et-Loire, Ilyasse Mellouk + * @copyright 2015-2026 Transferticketentity team + * @license AGPL License 3.0 or (at your option) any later version + * https://www.gnu.org/licenses/gpl-3.0.html + * @link https://github.com/pluginsGLPI/transferticketentity/ + * -------------------------------------------------------------------------- */ use GlpiPlugin\Transferticketentity\Entity; diff --git a/front/ticket.form.php b/front/ticket.form.php old mode 100644 new mode 100755 index 163011c..b427923 --- a/front/ticket.form.php +++ b/front/ticket.form.php @@ -1,32 +1,32 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * LICENSE + * + * This file is part of Transferticketentity plugin for GLPI. + * + * Transferticketentity is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Transferticketentity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Reports. If not, see . + * + * @category Ticket + * @package Transferticketentity + * @author Yannick Comba, Xavier Caillaud, Infotel, Département de Maine-et-Loire, Ilyasse Mellouk + * @copyright 2015-2026 Transferticketentity team + * @license AGPL License 3.0 or (at your option) any later version + * https://www.gnu.org/licenses/gpl-3.0.html + * @link https://github.com/pluginsGLPI/transferticketentity/ + * -------------------------------------------------------------------------- */ use GlpiPlugin\Transferticketentity\Ticket; @@ -36,7 +36,8 @@ $ticket = new Ticket(); if (isset($_POST['transfertticket'])) { - if (isset($_POST['entity_choice'])) { + if (isset($_POST['entity_choice']) + && $_POST['entity_choice'] > 0) { $ticket->launchTicketTransfer($_POST); } else { Session::addMessageAfterRedirect( diff --git a/hook.php b/hook.php old mode 100644 new mode 100755 index c572721..6778ae0 --- a/hook.php +++ b/hook.php @@ -1,6 +1,6 @@ TableExists("glpi_plugin_transferticketentity_entities_settings")) { $query = "CREATE TABLE `glpi_plugin_transferticketentity_entities_settings` ( @@ -55,7 +56,6 @@ function plugin_transferticketentity_install() `allow_transfer` BOOLEAN NOT NULL DEFAULT 0, `keep_category` BOOLEAN NOT NULL DEFAULT 0, `itilcategories_id` INT {$default_key_sign}, - `log_type` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), FOREIGN KEY (`entities_id`) REFERENCES `glpi_entities` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; @@ -63,11 +63,6 @@ function plugin_transferticketentity_install() $DB->doQuery($query); } - if (!$DB->fieldExists('glpi_plugin_transferticketentity_entities_settings', 'log_type')) { - $DB->doQuery("ALTER TABLE `glpi_plugin_transferticketentity_entities_settings` - ADD COLUMN `log_type` TINYINT NOT NULL DEFAULT 0"); - } - return true; } @@ -94,3 +89,27 @@ function plugin_transferticketentity_uninstall() } return true; } + +/** + * Declare specific massive actions for the plugin on core GLPI itemtypes. + * + * @param string $type Type of the item (e.g., 'Ticket') + * + * @return array Associative array of available massive actions + */ +function plugin_transferticketentity_MassiveActions($type) +{ + $actions = []; + + if ($type === 'Ticket') { + if (Session::haveRight('plugin_transferticketentity_massive', READ)) { + $class = Ticket::class; + $key = 'transfer_entity'; + $label = __('Transfer to another entity', 'transferticketentity'); + + $actions[$class . MassiveAction::CLASS_ACTION_SEPARATOR . $key] = $label; + } + } + + return $actions; +} diff --git a/img/gifs/TransferTicketEntity_EN.gif b/img/gifs/TransferTicketEntity_EN.gif old mode 100644 new mode 100755 diff --git a/img/gifs/TransferTicketEntity_FR.gif b/img/gifs/TransferTicketEntity_FR.gif old mode 100644 new mode 100755 diff --git a/img/logo.png b/img/logo.png old mode 100644 new mode 100755 diff --git a/locales/en_GB.mo b/locales/en_GB.mo old mode 100644 new mode 100755 index 715c926..321c4ae Binary files a/locales/en_GB.mo and b/locales/en_GB.mo differ diff --git a/locales/en_GB.po b/locales/en_GB.po old mode 100644 new mode 100755 index 3bd82b1..9813107 --- a/locales/en_GB.po +++ b/locales/en_GB.po @@ -1,167 +1,198 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# +# # Translators: -# Xavier CAILLAUD , 2026 -# -#, fuzzy +# Yannick Comba , 2022 +# Yannick Comba, 2022,2023 +# Département de Maine et Loire msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: GLPI Plugin - admincolor\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-24 09:22+0200\n" -"PO-Revision-Date: 2026-05-22 06:32+0000\n" -"Last-Translator: Xavier CAILLAUD , 2026\n" -"Language-Team: English (United Kingdom) (https://app.transifex.com/pluginsGLPI/teams/73419/en_GB/)\n" +"POT-Creation-Date: 2022-10-24 09:03+0000\n" +"PO-Revision-Date: 2024-04-08 11:12+0200\n" +"Last-Translator: Yannick Comba, 2022,2023\n" +"Language-Team: English (United Kingdom) (Département de Maine et Loire)\n" +"Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: en_GB\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.3.2\n" -#: templates/config.html.twig:51 -msgid "Allow Transfer function" -msgstr "Allow Transfer function" +#: inc/profile.class.php:74 inc/ticket.class.php:48 -#: templates/config.html.twig:67 -msgid "Assigned group required" -msgstr "Assigned group required" +msgid "Transfer Ticket Entity" +msgstr "Transfer Ticket Entity" + +msgid "Change rights" +msgstr "Change rights" -#: src/Profile.php:124 msgid "Authorized entity transfer" msgstr "Authorized entity transfer" -#: src/Ticket.php:582 +msgid "Save" +msgstr "Save" + +msgid "Item successfully updated" +msgstr "Item successfully updated" + +msgid "Error, please reload the page." +msgstr "Error, please reload the page." + msgid "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." +"If the problem persists, you can try to empty the cache by doing CTRL + F5." msgstr "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." - -#: templates/ticket.html.twig:147 -msgid "Confirm" -msgstr "Confirm" +"If the problem persists, you can try to empty the cache by doing CTRL + F5." -#: templates/config.html.twig:109 -msgid "Default category" -msgstr "Default category" +msgid "Select ticket entity to transfer" +msgstr "Select ticket entity to transfer" -#: templates/ticket.html.twig:119 -msgid "Justification" -msgstr "Justification" +msgid "Choose your entity" +msgstr "Choose your entity" -#: templates/config.html.twig:74 -msgid "Justification required" -msgstr "Justification required" +msgid "Select the group to assign" +msgstr "Select the group to assign" -#: templates/config.html.twig:81 -msgid "Keep category after transfer" -msgstr "Keep category after transfer" +msgid "Choose your group" +msgstr "Choose your group" -#: src/Ticket.php:168 -msgid "No entity available found, transfer impossible." -msgstr "No entity available found, transfer impossible." +msgid "Confirm transfer ?" +msgstr "Confirm transfer ?" -#: ajax/showentitygroups.php:60 msgid "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." +"Once the transfer has been completed, the ticket will remain visible only if you have the required rights." msgstr "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." +"Once the transfer has been completed, the ticket will remain visible only if you have the required rights." -#: templates/ticket.html.twig:51 -msgid "" -"Once the transfer has been completed, the ticket will remain visible only if" -" you have the required rights." -msgstr "" -"Once the transfer has been completed, the ticket will remain visible only if" -" you have the required rights." +msgid "Cancel" +msgstr "Cancel" -#: src/Ticket.php:480 -msgid "Please explain your transfer" -msgstr "Please explain your transfer" +msgid "Confirm" +msgstr "Confirm" -#: front/ticket.form.php:43 src/Ticket.php:526 msgid "Please select a valid entity" msgstr "Please select a valid entity" -#: src/Ticket.php:497 src/Ticket.php:538 msgid "Please select a valid group" msgstr "Please select a valid group" -#: templates/config.html.twig:142 templates/profile.html.twig:36 -msgctxt "button" -msgid "Save" -msgstr "Save" +msgid "Escalation to" +msgstr "Escalation to" -#: templates/ticket.html.twig:106 -msgid "Select the group to assign" -msgstr "Select the group to assign" +msgid "in the group" +msgstr "in the group" -#: templates/ticket.html.twig:56 -msgid "Select ticket entity to transfer" -msgstr "Select ticket entity to transfer" +msgid "Successful transfer for ticket n° : " +msgstr "Successful transfer for ticket n° : " + +msgid "Transfer canceled" +msgstr "Transfer canceled" + +msgid "Unauthorized transfer on closed ticket." +msgstr "Unauthorized transfer on closed ticket." + +msgid "Please explain your transfer" +msgstr "Please explain your transfer" + +msgid "You must be assigned to the ticket to be able to transfer it" +msgstr "You must be assigned to the ticket to be able to transfer it" + +msgid "No entity available found, transfer impossible." +msgstr "No entity available found, transfer impossible." + +msgid "None" +msgstr "None" -#: templates/config.html.twig:42 msgid "Settings Transfer Ticket Entity" msgstr "Settings Transfer Ticket Entity" -#: src/Ticket.php:672 -msgid "Successful transfer for ticket" -msgstr "Successful transfer for ticket" +msgid "Assigned group required" +msgstr "Assigned group required" + +msgid "Justification required" +msgstr "Justification required" + +msgid "Allow Transfer function" +msgstr "Allow Transfer function" + +msgid "No previous entity" +msgstr "No previous entity" -#: front/entity.form.php:56 templates/config.html.twig:133 msgid "" -"The category is mandatory in the ticket template assigned to the entity" +"No group found with « Assigned to » right while a group is required. Transfer impossible." msgstr "" -"The category is mandatory in the ticket template assigned to the entity" +"No group found with « Assigned to » right while a group is required. Transfer impossible." -#: src/Entity.php:161 src/Profile.php:75 src/Ticket.php:397 -msgid "Transfer Ticket Entity" -msgstr "Transfer Ticket Entity" +msgid "Active" +msgstr "Active" -#: src/Profile.php:131 msgid "" "Transfer authorized without assignment of technician or associated group" msgstr "" "Transfer authorized without assignment of technician or associated group" -#: templates/config.html.twig:91 -msgid "Transfer log type" -msgstr "" - -#: templates/ticket.html.twig:44 -msgid "Transfer the ticket" -msgstr "Transfer the ticket" - -#: src/Ticket.php:637 -msgid "Transfer to" -msgstr "" - -#: src/Ticket.php:179 -msgid "Unauthorized transfer on closed ticket." -msgstr "Unauthorized transfer on closed ticket." +msgid "Keep category after transfer" +msgstr "Keep category after transfer" -#: templates/ticket.html.twig:139 msgid "" "Warning, category will be reset if it does not exist in the target entity." msgstr "" "Warning, category will be reset if it does not exist in the target entity." -#: src/Ticket.php:158 msgid "" "You don't have right to update tickets. Please contact your administrator." msgstr "" "You don't have right to update tickets. Please contact your administrator." -#: src/Ticket.php:146 src/Ticket.php:514 -msgid "You must be assigned to the ticket to be able to transfer it" -msgstr "You must be assigned to the ticket to be able to transfer it" +msgid "optional" +msgstr "optional" + +msgid "Default category" +msgstr "Default category" + +msgid "" +"Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." +msgstr "" +"Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." + +msgid "Transfer to another entity" +msgstr "Transfer to another entity" + +msgid "Mass transfer authorized" +msgstr "Mass transfer authorized" + +msgid "Add myself as observer" +msgstr "Add myself as observer" + +msgid "Choose an entity" +msgstr "Choose an entity" + +msgid "Target entity" +msgstr "Target entity" + +msgid "Group to assign" +msgstr "Group to assign" + +msgid "No group" +msgstr "No group" + +msgid "Transfer" +msgstr "Transfer" + +msgid "You must be assigned to ticket ID %d to transfer it." +msgstr "You must be assigned to ticket ID %d to transfer it." + +msgid "Escalate to" +msgstr "Escalate to" + +msgid "in group" +msgstr "in group" + +msgid "Failed to transfer ticket ID %d" +msgstr "Failed to transfer ticket ID %d" + +msgid "Massive transfer authorized" +msgstr "Massive transfer authorized" -#: src/Ticket.php:642 -msgid "in the group" -msgstr "in the group" diff --git a/locales/es_VE.mo b/locales/es_VE.mo old mode 100644 new mode 100755 index 9d05e70..acc9f5d Binary files a/locales/es_VE.mo and b/locales/es_VE.mo differ diff --git a/locales/es_VE.po b/locales/es_VE.po old mode 100644 new mode 100755 index ace9c61..a8f4a5e --- a/locales/es_VE.po +++ b/locales/es_VE.po @@ -1,167 +1,163 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# +# # Translators: -# Xavier CAILLAUD , 2026 -# -#, fuzzy +# Yannick Comba , 2022 +# Yannick Comba, 2022,2023 +# Département de Maine et Loire msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: GLPI Plugin - admincolor\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-24 09:22+0200\n" -"PO-Revision-Date: 2026-05-22 06:32+0000\n" -"Last-Translator: Xavier CAILLAUD , 2026\n" -"Language-Team: Spanish (Venezuela) (https://app.transifex.com/pluginsGLPI/teams/73419/es_VE/)\n" +"POT-Creation-Date: 2022-10-24 09:03+0000\n" +"PO-Revision-Date: 2024-04-16 17:54-0400\n" +"Last-Translator: \n" +"Language-Team: English (United Kingdom) (Département de Maine et Loire)\n" +"Language: es_VE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: es_VE\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" -#: templates/config.html.twig:51 -msgid "Allow Transfer function" -msgstr "Permitir función de transferencia" +#: inc/profile.class.php:74 inc/ticket.class.php:48 -#: templates/config.html.twig:67 -msgid "Assigned group required" -msgstr "Se requiere grupo asignado" +msgid "Transfer Ticket Entity" +msgstr "Transferir Caso a Entidad" + +msgid "Change rights" +msgstr "Cambiar derechos" -#: src/Profile.php:124 msgid "Authorized entity transfer" msgstr "Transferencia de entidad autorizada" -#: src/Ticket.php:582 -msgid "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." -msgstr "" -"La categoría se establecerá como nula pero está configurada como obligatoria" -" en la plantilla GLPI; comuníquese con su administrador." +msgid "Save" +msgstr "Guardar" -#: templates/ticket.html.twig:147 -msgid "Confirm" -msgstr "Confirmar" +msgid "Item successfully updated" +msgstr "Elemento actualizado exitosamente" -#: templates/config.html.twig:109 -msgid "Default category" -msgstr "Categoría predeterminada" +msgid "Error, please reload the page." +msgstr "Error, por favor recarga la página." -#: templates/ticket.html.twig:119 -msgid "Justification" -msgstr "Justification" +msgid "Select ticket entity to transfer" +msgstr "Seleccione la entidad del caso para transferir" -#: templates/config.html.twig:74 -msgid "Justification required" -msgstr "Justificación requerida" +msgid "Choose your entity" +msgstr "Elige tu entidad" -#: templates/config.html.twig:81 -msgid "Keep category after transfer" -msgstr "Mantener categoría después de la transferencia" +msgid "Select the group to assign" +msgstr "Seleccione el grupo a asignar" -#: src/Ticket.php:168 -msgid "No entity available found, transfer impossible." -msgstr "No se encontró ninguna entidad disponible, transferencia imposible." +msgid "Choose your group" +msgstr "Elige tu grupo" -#: ajax/showentitygroups.php:60 -msgid "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." -msgstr "" -"No se encontró ningún grupo con el derecho «Asignado a» mientras se requiere" -" un grupo. Transferencia imposible." +msgid "Confirm transfer ?" +msgstr "¿Confirmar transferencia?" -#: templates/ticket.html.twig:51 -msgid "" -"Once the transfer has been completed, the ticket will remain visible only if" -" you have the required rights." -msgstr "" -"Una vez completada la transferencia, el caso permanecerá visible sólo si " -"tienes los derechos requeridos." +msgid "Cancel" +msgstr "Anular" -#: src/Ticket.php:480 -msgid "Please explain your transfer" -msgstr "Por favor explica tu transferencia" +msgid "Confirm" +msgstr "Confirmar" -#: front/ticket.form.php:43 src/Ticket.php:526 msgid "Please select a valid entity" msgstr "Por favor seleccione una entidad válida" -#: src/Ticket.php:497 src/Ticket.php:538 msgid "Please select a valid group" msgstr "Por favor seleccione un grupo válido" -#: templates/config.html.twig:142 templates/profile.html.twig:36 -msgctxt "button" -msgid "Save" -msgstr "Save" +msgid "Escalation to" +msgstr "Escalamiento a" -#: templates/ticket.html.twig:106 -msgid "Select the group to assign" -msgstr "Seleccione el grupo a asignar" +msgid "in the group" +msgstr "en el grupo" -#: templates/ticket.html.twig:56 -msgid "Select ticket entity to transfer" -msgstr "Seleccione la entidad del caso para transferir" +msgid "Successful transfer for ticket n° : " +msgstr "Transferencia exitosa para el caso n°: " + +msgid "Transfer canceled" +msgstr "Transferencia cancelada" + +msgid "Unauthorized transfer on closed ticket." +msgstr "Traslado no autorizado en caso cerrado." + +msgid "Please explain your transfer" +msgstr "Por favor explica tu transferencia" + +msgid "You must be assigned to the ticket to be able to transfer it" +msgstr "Debes estar asignado al caso para poder transferirlo" + +msgid "No entity available found, transfer impossible." +msgstr "No se encontró ninguna entidad disponible, transferencia imposible." + +msgid "None" +msgstr "Ninguno" -#: templates/config.html.twig:42 msgid "Settings Transfer Ticket Entity" msgstr "Configuración de entidad de caso de transferencia" -#: src/Ticket.php:672 -msgid "Successful transfer for ticket" -msgstr "Successful transfer for ticket" +msgid "Assigned group required" +msgstr "Se requiere grupo asignado" -#: front/entity.form.php:56 templates/config.html.twig:133 -msgid "" -"The category is mandatory in the ticket template assigned to the entity" -msgstr "" -"The category is mandatory in the ticket template assigned to the entity" +msgid "Justification required" +msgstr "Justificación requerida" -#: src/Entity.php:161 src/Profile.php:75 src/Ticket.php:397 -msgid "Transfer Ticket Entity" -msgstr "Transferir Caso a Entidad" +msgid "Allow Transfer function" +msgstr "Permitir función de transferencia" -#: src/Profile.php:131 -msgid "" -"Transfer authorized without assignment of technician or associated group" -msgstr "Traspaso autorizado sin asignación de técnico o grupo asociado" +msgid "No previous entity" +msgstr "Ninguna entidad previa" -#: templates/config.html.twig:91 -msgid "Transfer log type" -msgstr "" +msgid "Active" +msgstr "Activo" -#: templates/ticket.html.twig:44 -msgid "Transfer the ticket" -msgstr "Transfer the ticket" +msgid "Keep category after transfer" +msgstr "Mantener categoría después de la transferencia" -#: src/Ticket.php:637 -msgid "Transfer to" -msgstr "" +msgid "optional" +msgstr "opcional" -#: src/Ticket.php:179 -msgid "Unauthorized transfer on closed ticket." -msgstr "Traslado no autorizado en caso cerrado." +msgid "Default category" +msgstr "Categoría predeterminada" -#: templates/ticket.html.twig:139 -msgid "" -"Warning, category will be reset if it does not exist in the target entity." -msgstr "" -"Advertencia, la categoría se restablecerá si no existe en la entidad de " -"destino." +msgid "Transfer to another entity" +msgstr "Transferir a otra entidad" -#: src/Ticket.php:158 -msgid "" -"You don't have right to update tickets. Please contact your administrator." -msgstr "" -"No tienes derecho a actualizar casos. Por favor contacte a su administrador." +msgid "Mass transfer authorized" +msgstr "Transferencia masiva autorizada" -#: src/Ticket.php:146 src/Ticket.php:514 -msgid "You must be assigned to the ticket to be able to transfer it" -msgstr "Debes estar asignado al caso para poder transferirlo" +msgid "Add myself as observer" +msgstr "Añadirme como observador" -#: src/Ticket.php:642 -msgid "in the group" +msgid "Choose an entity" +msgstr "Elige una entidad" + +msgid "Target entity" +msgstr "Entidad de destino" + +msgid "Group to assign" +msgstr "Grupo a asignar" + +msgid "No group" +msgstr "Sin grupo" + +msgid "Transfer" +msgstr "Transferir" + +msgid "You must be assigned to ticket ID %d to transfer it." +msgstr "Debes estar asignado al caso ID %d para poder transferirlo." + +msgid "Escalate to" +msgstr "Escalar a" + +msgid "in group" msgstr "en el grupo" + +msgid "Failed to transfer ticket ID %d" +msgstr "Error al transferir el caso ID %d" + +msgid "Massive transfer authorized" +msgstr "Transferencia masiva autorizada" + diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo old mode 100644 new mode 100755 index fd22e2a..d66ea7d Binary files a/locales/fr_FR.mo and b/locales/fr_FR.mo differ diff --git a/locales/fr_FR.po b/locales/fr_FR.po old mode 100644 new mode 100755 index 8c79e86..df89137 --- a/locales/fr_FR.po +++ b/locales/fr_FR.po @@ -1,170 +1,218 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# +# # Translators: -# Xavier CAILLAUD , 2026 -# -#, fuzzy +# Yannick Comba , 2022 +# Yannick Comba, 2022,2023 +# Département de Maine et Loire msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: GLPI Plugin - Entity Ticket Transfer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-24 09:22+0200\n" -"PO-Revision-Date: 2026-05-22 06:32+0000\n" -"Last-Translator: Xavier CAILLAUD , 2026\n" -"Language-Team: French (France) (https://app.transifex.com/pluginsGLPI/teams/73419/fr_FR/)\n" +"POT-Creation-Date: 2026-03-08 16:11+0100\n" +"PO-Revision-Date: 2026-03-08 16:12+0100\n" +"Last-Translator: Yannick Comba, 2022,2023\n" +"Language-Team: French (France) (Département de Maine et Loire)\n" +"Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: fr_FR\n" -"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" - -#: templates/config.html.twig:51 -msgid "Allow Transfer function" -msgstr "Autoriser la fonction Transfert" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0\n" -#: templates/config.html.twig:67 -msgid "Assigned group required" -msgstr "Groupe à assigner obligatoire" +#: ajax/showentitygroups.php:59 +msgid "" +"No group found with « Assigned to » right while a group is required. " +"Transfer impossible." +msgstr "" +"Aucun groupe avec le droit « Assigné à » n'a été trouvé alors qu'un groupe " +"est requis. Transfert impossible." -#: src/Profile.php:124 -msgid "Authorized entity transfer" -msgstr "Transfert d'entité autorisé" +#: front/entity.form.php:57 inc/entity.class.php:245 -#: src/Ticket.php:582 msgid "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." +"The category is mandatory in the ticket template assigned to the entity" msgstr "" -"La catégorie va être remise à nulle mais est configurée comme obligatoire " -"dans les templates de GLPI, veuillez contacter votre administrateur." +"La catégorie est obligatoire dans le gabarit de ticket affecté à l'entité" -#: templates/ticket.html.twig:147 -msgid "Confirm" -msgstr "Confirmer" +msgid "Please select a valid entity" +msgstr "Veuillez sélectionner une entité valide" -#: templates/config.html.twig:109 -msgid "Default category" -msgstr "Catégorie par défaut" +msgid "Transfer Ticket Entity" +msgstr "Transfert d'entité" -#: templates/ticket.html.twig:119 -msgid "Justification" -msgstr "Justification" +msgid "Settings Transfer Ticket Entity" +msgstr "Paramètres Transfert d'entité" + +msgid "Allow Transfer function" +msgstr "Autoriser la fonction Transfert" + +msgid "Assigned group required" +msgstr "Groupe à assigner obligatoire" -#: templates/config.html.twig:74 msgid "Justification required" msgstr "Justification obligatoire" -#: templates/config.html.twig:81 msgid "Keep category after transfer" msgstr "Catégorie à conserver après le transfert" -#: src/Ticket.php:168 +msgid "Default category" +msgstr "Catégorie par défaut" + +msgid "Authorized entity transfer" +msgstr "Transfert d'entité autorisé" + +msgid "You must be assigned to the ticket to be able to transfer it" +msgstr "" +"Vous devez être assigné sur le ticket ou être membre du groupe assigné pour être autorisé à le transférer" + msgid "No entity available found, transfer impossible." msgstr "Aucune entité disponible trouvée, transfert impossible." -#: ajax/showentitygroups.php:60 -msgid "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." -msgstr "" -"Aucun groupe avec le droit « Assigné à » n'a été trouvé alors qu'un groupe " -"est requis. Transfert impossible." +msgid "Unauthorized transfer on closed ticket." +msgstr "Transfert non autorisé sur ticket clos." -#: templates/ticket.html.twig:51 -msgid "" -"Once the transfer has been completed, the ticket will remain visible only if" -" you have the required rights." -msgstr "" -"Une fois le transfert effectué, le ticket restera visible uniquement si vous" -" avez les droits requis." +msgid "Transfer the ticket" +msgstr "Transférer le ticket" + +msgid "Select ticket entity to transfer" +msgstr "Sélectionnez l'entité vers laquelle migrer le ticket" + +msgid "Select the group to assign" +msgstr "Sélectionnez le groupe à assigner" + +msgid "Justification" +msgstr "Justification" + +msgid "Confirm" +msgstr "Confirmer" -#: src/Ticket.php:480 msgid "Please explain your transfer" msgstr "Veuillez expliquer la raison de votre transfert" -#: front/ticket.form.php:43 src/Ticket.php:526 -msgid "Please select a valid entity" -msgstr "Veuillez sélectionner une entité valide" - -#: src/Ticket.php:497 src/Ticket.php:538 msgid "Please select a valid group" msgstr "Veuillez sélectionner un groupe valide" -#: templates/config.html.twig:142 templates/profile.html.twig:36 -msgctxt "button" -msgid "Save" -msgstr "Sauver" +msgid "in the group" +msgstr "dans le groupe" -#: templates/ticket.html.twig:106 -msgid "Select the group to assign" -msgstr "Sélectionnez le groupe à assigner" +msgid "Escalation to" +msgstr "Escalade vers" -#: templates/ticket.html.twig:56 -msgid "Select ticket entity to transfer" -msgstr "Sélectionnez l'entité vers laquelle migrer le ticket" +msgid "Successful transfer for ticket n° : " +msgstr "Transfert réussi pour le ticket n° : " -#: templates/config.html.twig:42 -msgid "Settings Transfer Ticket Entity" -msgstr "Paramètres Transfert d'entité" +msgid "Change rights" +msgstr "Modifier les droits" + +msgid "Save" +msgstr "Sauvegarder" + +msgid "Item successfully updated" +msgstr "Élément modifié" -#: src/Ticket.php:672 -msgid "Successful transfer for ticket" -msgstr "Transfert réussi pour le ticket" +msgid "Error, please reload the page." +msgstr "Erreur, veuillez recharger la page." -#: front/entity.form.php:56 templates/config.html.twig:133 msgid "" -"The category is mandatory in the ticket template assigned to the entity" +"If the problem persists, you can try to empty the cache by doing CTRL + F5." msgstr "" -"La catégorie est obligatoire dans le gabarit de ticket affecté à l'entité" +"Si le problème persiste, vous pouvez tenter de vider le cache en faisant CTRL + F5." -#: src/Entity.php:161 src/Profile.php:75 src/Ticket.php:397 -msgid "Transfer Ticket Entity" -msgstr "Transfert d'entité" +msgid "Choose your entity" +msgstr "Choisissez votre entité" + +msgid "Choose your group" +msgstr "Choisissez votre groupe" + +msgid "Confirm transfer ?" +msgstr "Confirmer le transfert ?" -#: src/Profile.php:131 msgid "" -"Transfer authorized without assignment of technician or associated group" -msgstr "Transfert autorisé sans affectation du technicien ou groupe associé" +"Once the transfer has been completed, the ticket will remain visible only if you have the required rights." +msgstr "" +"Une fois le transfert effectué, le ticket restera visible uniquement si vous avez les droits requis." -#: templates/config.html.twig:91 -msgid "Transfer log type" -msgstr "Type de journal de transfert" +msgid "Cancel" +msgstr "Annuler" -#: templates/ticket.html.twig:44 -msgid "Transfer the ticket" -msgstr "Transférer le ticket" +msgid "Transfer canceled" +msgstr "Transfert annulé" -#: src/Ticket.php:637 -msgid "Transfer to" -msgstr "Transféré vers" +msgid "You must be assigned to ticket ID %d to transfer it." +msgstr "Vous devez être assigné au ticket ID %d pour le transférer." + +msgid "None" +msgstr "Aucun" + +msgid "No previous entity" +msgstr "Pas de précédente entité" -#: src/Ticket.php:179 -msgid "Unauthorized transfer on closed ticket." -msgstr "Transfert non autorisé sur ticket clos." -#: templates/ticket.html.twig:139 +msgid "Active" +msgstr "Actif" + +msgid "" +"Transfer authorized without assignment of technician or associated group" +msgstr "Transfert autorisé sans affectation du technicien ou groupe associé" + msgid "" "Warning, category will be reset if it does not exist in the target entity." msgstr "" -"Attention, la catégorie sera remise à nulle si non existante dans l'entité " -"cible." +"Attention, la catégorie sera remise à nulle si non existante dans l'entité cible." -#: src/Ticket.php:158 msgid "" "You don't have right to update tickets. Please contact your administrator." msgstr "" -"Vous n'avez pas le droit de mettre à jour les tickets. Veuillez contacter " -"votre administrateur." +"Vous n'avez pas le droit de mettre à jour les tickets. Veuillez contacter votre administrateur." -#: src/Ticket.php:146 src/Ticket.php:514 -msgid "You must be assigned to the ticket to be able to transfer it" +msgid "optional" +msgstr "facultatif" + +msgid "Transfer to another entity" +msgstr "Transférer vers une autre entité" + +msgid "Massive transfer authorized" +msgstr "Transfert en masse autorisé" + +msgid "Failed to transfer ticket ID %d" +msgstr "Failed to transfer ticket ID %d" + +msgid "" +"Category will be set to null but its configured as mandatory in GLPIs template, please contact your administrator." msgstr "" -"Vous devez être assigné sur le ticket ou être membre du groupe assigné pour " -"être autorisé à le transférer" +"La catégorie va être remise à null mais est configurée comme obligatoire dans les templates de GLPI, veuillez contacter votre administrateur." -#: src/Ticket.php:642 -msgid "in the group" +msgid "Choose an entity" +msgstr "Choisissez une entité" + +msgid "Add myself as observer" +msgstr "S'ajouter comme observateur" + +msgid "Target entity" +msgstr "Entité cible" + +msgid "Group to assign" +msgstr "Groupe à assigner" + +msgid "Unauthorized transfer for closed or resolved tickets." +msgstr "Transfert non autorisé pour les tickets fermés ou résolus." + +msgid "Escalate to" +msgstr "Escalade vers" + +msgid "in group" msgstr "dans le groupe" + +msgid "Transfer" +msgstr "Transférer" + +msgid "Escalation to %s" +msgstr "Transféré vers %s" + +msgid "No group" +msgstr "Aucun groupe" + +msgid "Mass transfer authorized" +msgstr "Transfert en masse autorisé" \ No newline at end of file diff --git a/locales/pt_BR.mo b/locales/pt_BR.mo old mode 100644 new mode 100755 index 3bdc18d..27618c5 Binary files a/locales/pt_BR.mo and b/locales/pt_BR.mo differ diff --git a/locales/pt_BR.po b/locales/pt_BR.po old mode 100644 new mode 100755 index ffb00fc..7b674ae --- a/locales/pt_BR.po +++ b/locales/pt_BR.po @@ -1,167 +1,131 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# +# # Translators: -# Xavier CAILLAUD , 2026 -# -#, fuzzy +# Yannick Comba , 2022 +# Yannick Comba, 2022,2023 +# Département de Maine et Loire msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: GLPI Plugin - Transfer Ticket Entity\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-24 09:22+0200\n" -"PO-Revision-Date: 2026-05-22 06:32+0000\n" -"Last-Translator: Xavier CAILLAUD , 2026\n" -"Language-Team: Portuguese (Brazil) (https://app.transifex.com/pluginsGLPI/teams/73419/pt_BR/)\n" +"POT-Creation-Date: 2022-10-24 09:03+0000\n" +"PO-Revision-Date: 2024-02-22 15:22-0300\n" +"Last-Translator: Yannick Comba, 2022,2023\n" +"Language-Team: Portuguese (Brasil)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" -"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.4.2\n" -#: templates/config.html.twig:51 -msgid "Allow Transfer function" -msgstr "Allow Transfer function" +#: inc/profile.class.php:74 inc/ticket.class.php:48 -#: templates/config.html.twig:67 -msgid "Assigned group required" -msgstr "Assigned group required" +msgid "Transfer Ticket Entity" +msgstr "Transferência de Entidade do Ticket" -#: src/Profile.php:124 -msgid "Authorized entity transfer" +msgid "Change rights" +msgstr "Mudar permissões" + +msgid "Using entity transfer" msgstr "Usando transferência de entidade" -#: src/Ticket.php:582 +msgid "Save" +msgstr "Salvar" + +msgid "Item successfully updated" +msgstr "Item atualizado com sucesso" + +msgid "Error, please reload the page." +msgstr "Erro, por favor atualizar a página." + msgid "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." +"If the problem persists, you can try to empty the cache by doing CTRL + F5." msgstr "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." +"Se o problema persistir, você pode tentar esvaziar o cache através das teclas CTRL + F5." -#: templates/ticket.html.twig:147 -msgid "Confirm" -msgstr "Confirmar" - -#: templates/config.html.twig:109 -msgid "Default category" -msgstr "Default category" +msgid "Select ticket entity to transfer" +msgstr "Select ticket entity to transfer" -#: templates/ticket.html.twig:119 -msgid "Justification" -msgstr "Justification" +msgid "Choose your entity" +msgstr "Escolha sua entidade" -#: templates/config.html.twig:74 -msgid "Justification required" -msgstr "Justification required" +msgid "Select the group to assign" +msgstr "Selecione o grupo para atribuir" -#: templates/config.html.twig:81 -msgid "Keep category after transfer" -msgstr "Keep category after transfer" +msgid "Choose your group" +msgstr "Escolha seu grupo" -#: src/Ticket.php:168 -msgid "No entity available found, transfer impossible." -msgstr "No entity available found, transfer impossible." +msgid "Confirm transfer ?" +msgstr "Conformar transferência?" -#: ajax/showentitygroups.php:60 msgid "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." +"Once the transfer has been completed, the ticket will remain visible only if you have the required rights." msgstr "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." +"Uma vez que a transferência tiver sido completa, o ticket será visível somente se você tiver as permissões corretas." -#: templates/ticket.html.twig:51 -msgid "" -"Once the transfer has been completed, the ticket will remain visible only if" -" you have the required rights." -msgstr "" -"Uma vez que a transferência tiver sido completa, o ticket será visível " -"somente se você tiver as permissões corretas." +msgid "Cancel" +msgstr "Cancelar" -#: src/Ticket.php:480 -msgid "Please explain your transfer" -msgstr "Por favor apresentar mais dados sobre sua transferência" +msgid "Confirm" +msgstr "Confirmar" -#: front/ticket.form.php:43 src/Ticket.php:526 msgid "Please select a valid entity" msgstr "Por favor selecione uma entidade válida" -#: src/Ticket.php:497 src/Ticket.php:538 msgid "Please select a valid group" msgstr "Por favor selecione um grupo válido" -#: templates/config.html.twig:142 templates/profile.html.twig:36 -msgctxt "button" -msgid "Save" -msgstr "Save" +msgid "Escalation to" +msgstr "Escalação para" -#: templates/ticket.html.twig:106 -msgid "Select the group to assign" -msgstr "Selecione o grupo para atribuir" +msgid "in the group" +msgstr "no grupo" -#: templates/ticket.html.twig:56 -msgid "Select ticket entity to transfer" -msgstr "Select ticket entity to transfer" +msgid "Successful transfer for ticket n° : " +msgstr "Transferência feita com sucesso para o ticket n° : " -#: templates/config.html.twig:42 -msgid "Settings Transfer Ticket Entity" -msgstr "Settings Transfer Ticket Entity" +msgid "Transfer canceled" +msgstr "Transferência cancelada" -#: src/Ticket.php:672 -msgid "Successful transfer for ticket" -msgstr "Transferência feita com sucesso para o ticket" +msgid "Unauthorized transfer on closed ticket." +msgstr "Não é possível transferir um ticket cujo status é fechado." -#: front/entity.form.php:56 templates/config.html.twig:133 -msgid "" -"The category is mandatory in the ticket template assigned to the entity" -msgstr "" -"The category is mandatory in the ticket template assigned to the entity" +msgid "Please explain your transfer" +msgstr "Por favor apresentar mais dados sobre sua transferência" -#: src/Entity.php:161 src/Profile.php:75 src/Ticket.php:397 -msgid "Transfer Ticket Entity" -msgstr "Transferência de Entidade do Ticket" +msgid "You must be assigned to the ticket to be able to transfer it" +msgstr "Você precisa estar atribuído ao ticket para ser capaz de transferi-lo" -#: src/Profile.php:131 -msgid "" -"Transfer authorized without assignment of technician or associated group" -msgstr "" -"Transfer authorized without assignment of technician or associated group" +msgid "Add myself as observer" +msgstr "Adicionar como observador" -#: templates/config.html.twig:91 -msgid "Transfer log type" -msgstr "" +msgid "Choose an entity" +msgstr "Escolha uma entidade" -#: templates/ticket.html.twig:44 -msgid "Transfer the ticket" -msgstr "Transfer the ticket" +msgid "Transfer to another entity" +msgstr "Transferir para outra entidade" -#: src/Ticket.php:637 -msgid "Transfer to" -msgstr "" +msgid "Target entity" +msgstr "Entidade de destino" -#: src/Ticket.php:179 -msgid "Unauthorized transfer on closed ticket." -msgstr "Não é possível transferir um ticket cujo status é fechado." +msgid "Group to assign" +msgstr "Grupo a atribuir" -#: templates/ticket.html.twig:139 -msgid "" -"Warning, category will be reset if it does not exist in the target entity." -msgstr "" -"Warning, category will be reset if it does not exist in the target entity." +msgid "No group" +msgstr "Nenhum grupo" -#: src/Ticket.php:158 -msgid "" -"You don't have right to update tickets. Please contact your administrator." -msgstr "" -"You don't have right to update tickets. Please contact your administrator." +msgid "Transfer" +msgstr "Transferir" -#: src/Ticket.php:146 src/Ticket.php:514 -msgid "You must be assigned to the ticket to be able to transfer it" -msgstr "Você precisa estar atribuído ao ticket para ser capaz de transferi-lo" +msgid "You must be assigned to ticket ID %d to transfer it." +msgstr "Você deve estar atribuído ao ticket ID %d para poder transferi-lo." -#: src/Ticket.php:642 -msgid "in the group" +msgid "Escalate to" +msgstr "Escalar para" + +msgid "in group" msgstr "no grupo" + diff --git a/locales/pt_PT.mo b/locales/pt_PT.mo old mode 100644 new mode 100755 index 34f29f4..59e9fd6 Binary files a/locales/pt_PT.mo and b/locales/pt_PT.mo differ diff --git a/locales/pt_PT.po b/locales/pt_PT.po old mode 100644 new mode 100755 index 02a0c18..2503db1 --- a/locales/pt_PT.po +++ b/locales/pt_PT.po @@ -1,171 +1,167 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# +# # Translators: -# Xavier CAILLAUD , 2026 -# -#, fuzzy +# Département MaineEtLoire, 2024 +# +# +# Département de Maine et Loire msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: GLPI Plugin - transferticketentity\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-24 09:22+0200\n" -"PO-Revision-Date: 2026-05-22 06:32+0000\n" -"Last-Translator: Xavier CAILLAUD , 2026\n" -"Language-Team: Portuguese (Portugal) (https://app.transifex.com/pluginsGLPI/teams/73419/pt_PT/)\n" +"POT-Creation-Date: 2022-10-24 09:03+0000\n" +"PO-Revision-Date: 2024-04-17 11:42+0200\n" +"Last-Translator: Département MaineEtLoire, 2024\n" +"Language-Team: Portuguese (Portugal) (https://app.transifex.com/departement-" +"de-maine-et-loire/teams/190752/pt_PT/)\n" +"Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_PT\n" -"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" +"X-Generator: Poedit 3.3.2\n" -#: templates/config.html.twig:51 -msgid "Allow Transfer function" -msgstr "Permitir a funcionalidade de Transferência" +#: inc/profile.class.php:74 inc/ticket.class.php:48 -#: templates/config.html.twig:67 -msgid "Assigned group required" -msgstr "É obrigatório atribuir a um grupo" +msgid "Transfer Ticket Entity" +msgstr "Transferência de Entidade do Ticket" + +msgid "Change rights" +msgstr "Mudar permissões" -#: src/Profile.php:124 msgid "Authorized entity transfer" msgstr "Permitir a transferência de entidade" -#: src/Ticket.php:582 -msgid "" -"Category will be set to null but its configured as mandatory in GLPIs " -"template, please contact your administrator." -msgstr "" -"A categoria ficará definida como nula, mas está configurada como obrigatória" -" no modelo do GLPI. Entre em contato com o seu administrador." +msgid "Save" +msgstr "Gravar" -#: templates/ticket.html.twig:147 -msgid "Confirm" -msgstr "Confirmar" +msgid "Item successfully updated" +msgstr "Item atualizado com sucesso" -#: templates/config.html.twig:109 -msgid "Default category" -msgstr "Categoria por omissão" +msgid "Error, please reload the page." +msgstr "Erro. Por favor, atualize a página." -#: templates/ticket.html.twig:119 -msgid "Justification" -msgstr "Justification" +msgid "Select ticket entity to transfer" +msgstr "Selecione a entidade para transferir o ticket" -#: templates/config.html.twig:74 -msgid "Justification required" -msgstr "Obrigatório preencher justificação" +msgid "Choose your entity" +msgstr "Escolha a sua entidade" -#: templates/config.html.twig:81 -msgid "Keep category after transfer" -msgstr "Manter a categoria após a transferência" +msgid "Select the group to assign" +msgstr "Selecione o grupo a atribuir" -#: src/Ticket.php:168 -msgid "No entity available found, transfer impossible." -msgstr "" -"Não é possível transferir, porque não foi encontrada nenhuma entidade." +msgid "Choose your group" +msgstr "Escolha o grupo" -#: ajax/showentitygroups.php:60 -msgid "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." -msgstr "" -"Nenhum grupo encontrado com permissão \"Atribuído a\", embora um grupo seja " -"necessário. Transferência impossível." +msgid "Confirm transfer ?" +msgstr "Confirmar a transferência?" -#: templates/ticket.html.twig:51 -msgid "" -"Once the transfer has been completed, the ticket will remain visible only if" -" you have the required rights." -msgstr "" -"Quando a transferência for concluída, o ticket apenas ficará visível caso " -"tenha as permissões necessárias." +msgid "Cancel" +msgstr "Cancelar" -#: src/Ticket.php:480 -msgid "Please explain your transfer" -msgstr "Justificação para a transferência" +msgid "Confirm" +msgstr "Confirmar" -#: front/ticket.form.php:43 src/Ticket.php:526 msgid "Please select a valid entity" msgstr "Selecione por favor uma entidade válida" -#: src/Ticket.php:497 src/Ticket.php:538 msgid "Please select a valid group" msgstr "Selecione por favor um grupo válido" -#: templates/config.html.twig:142 templates/profile.html.twig:36 -msgctxt "button" -msgid "Save" -msgstr "Save" +msgid "Escalation to" +msgstr "Escalar para" -#: templates/ticket.html.twig:106 -msgid "Select the group to assign" -msgstr "Selecione o grupo a atribuir" +msgid "in the group" +msgstr "no grupo" -#: templates/ticket.html.twig:56 -msgid "Select ticket entity to transfer" -msgstr "Selecione a entidade para transferir o ticket" +msgid "Successful transfer for ticket n° : " +msgstr "Transferência com sucesso para o ticket n° : " + +msgid "Transfer canceled" +msgstr "Transferência cancelada" + +msgid "Unauthorized transfer on closed ticket." +msgstr "Não é permitido transferir tickets fechados." + +msgid "Please explain your transfer" +msgstr "Justificação para a transferência" + +msgid "You must be assigned to the ticket to be able to transfer it" +msgstr "" +"Para conseguir transferir o ticket, terá de estar atribuído como técnico" + +msgid "No entity available found, transfer impossible." +msgstr "Não é possível transferir, porque não foi encontrada nenhuma entidade." + +msgid "None" +msgstr "Nenhum" -#: templates/config.html.twig:42 msgid "Settings Transfer Ticket Entity" msgstr "Definições para Transferir Ticket de Entidade" -#: src/Ticket.php:672 -msgid "Successful transfer for ticket" -msgstr "Transferência com sucesso para o ticket" +msgid "Assigned group required" +msgstr "É obrigatório atribuir a um grupo" -#: front/entity.form.php:56 templates/config.html.twig:133 -msgid "" -"The category is mandatory in the ticket template assigned to the entity" -msgstr "" -"The category is mandatory in the ticket template assigned to the entity" +msgid "Justification required" +msgstr "Obrigatório preencher justificação" -#: src/Entity.php:161 src/Profile.php:75 src/Ticket.php:397 -msgid "Transfer Ticket Entity" -msgstr "Transferência de Entidade do Ticket" +msgid "Allow Transfer function" +msgstr "Permitir a funcionalidade de Transferência" -#: src/Profile.php:131 -msgid "" -"Transfer authorized without assignment of technician or associated group" -msgstr "" -"Transferência autorizada sem a atribuição de um técnico ou grupo ao ticket" +msgid "No previous entity" +msgstr "Nenhuma entidade anterior encontrada" -#: templates/config.html.twig:91 -msgid "Transfer log type" -msgstr "" +msgid "Active" +msgstr "Ativado" + +msgid "Keep category after transfer" +msgstr "Manter a categoria após a transferência" -#: templates/ticket.html.twig:44 -msgid "Transfer the ticket" -msgstr "Transfer the ticket" +msgid "optional" +msgstr "opcional" -#: src/Ticket.php:637 -msgid "Transfer to" -msgstr "" +msgid "Default category" +msgstr "Categoria por omissão" -#: src/Ticket.php:179 -msgid "Unauthorized transfer on closed ticket." -msgstr "Não é permitido transferir tickets fechados." +msgid "Transfer to another entity" +msgstr "Transferir para outra entidade" -#: templates/ticket.html.twig:139 -msgid "" -"Warning, category will be reset if it does not exist in the target entity." -msgstr "" -"Aviso: Caso a categoria do ticket não exista na entidade de destino, a mesma" -" será removida." +msgid "Mass transfer authorized" +msgstr "Transferência em massa autorizada" -#: src/Ticket.php:158 -msgid "" -"You don't have right to update tickets. Please contact your administrator." -msgstr "" -"Não tem permissão para atualizar tickets. Por favor contacte o " -"administrador." +msgid "Add myself as observer" +msgstr "Adicionar-me como observador" -#: src/Ticket.php:146 src/Ticket.php:514 -msgid "You must be assigned to the ticket to be able to transfer it" -msgstr "" -"Para conseguir transferir o ticket, terá de estar atribuído como técnico" +msgid "Choose an entity" +msgstr "Escolha uma entidade" -#: src/Ticket.php:642 -msgid "in the group" +msgid "Target entity" +msgstr "Entidade de destino" + +msgid "Group to assign" +msgstr "Grupo a atribuir" + +msgid "No group" +msgstr "Sem grupo" + +msgid "Transfer" +msgstr "Transferir" + +msgid "You must be assigned to ticket ID %d to transfer it." +msgstr "Tem de estar atribuído ao ticket ID %d para o poder transferir." + +msgid "Escalate to" +msgstr "Escalar para" + +msgid "in group" msgstr "no grupo" + +msgid "Failed to transfer ticket ID %d" +msgstr "Falha ao transferir o ticket ID %d" + +msgid "Massive transfer authorized" +msgstr "Transferência em massa autorizada" + diff --git a/locales/transferticketentity.pot b/locales/transferticketentity.pot old mode 100644 new mode 100755 index 373be29..1ca2242 --- a/locales/transferticketentity.pot +++ b/locales/transferticketentity.pot @@ -1,14 +1,14 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR Transferticketentity Development Team +# This file is distributed under the same license as the GLPI - Transferticketentity plugin package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: GLPI - Transferticketentity plugin 1.1.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-25 04:08+0000\n" +"POT-Creation-Date: 2026-03-08 16:11+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,131 +17,128 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: templates/ticket.html.twig -msgid "Transfer the ticket" -msgstr "" - -#: templates/ticket.html.twig +#: ajax/showentitygroups.php:59 msgid "" -"Once the transfer has been completed, the ticket will remain visible only if " -"you have the required rights." -msgstr "" - -#: templates/ticket.html.twig -msgid "Select ticket entity to transfer" -msgstr "" - -#: templates/ticket.html.twig -msgid "Select the group to assign" +"No group found with « Assigned to » right while a group is required. " +"Transfer impossible." msgstr "" -#: templates/ticket.html.twig -msgid "Justification" +#: front/entity.form.php:57 inc/entity.class.php:245 +msgid "The category is mandatory in the ticket template assigned to the entity" msgstr "" -#: templates/ticket.html.twig -msgid "" -"Warning, category will be reset if it does not exist in the target entity." +#: front/ticket.form.php:41 inc/ticket.class.php:566 +msgid "Please select a valid entity" msgstr "" -#: templates/ticket.html.twig -msgid "Confirm" +#: inc/entity.class.php:117 inc/profile.class.php:68 inc/profile.class.php:126 +#: inc/ticket.class.php:436 +msgid "Transfer Ticket Entity" msgstr "" -#: templates/config.html.twig +#: inc/entity.class.php:175 msgid "Settings Transfer Ticket Entity" msgstr "" -#: templates/config.html.twig +#: inc/entity.class.php:180 msgid "Allow Transfer function" msgstr "" -#: templates/config.html.twig +#: inc/entity.class.php:193 msgid "Assigned group required" msgstr "" -#: templates/config.html.twig +#: inc/entity.class.php:206 msgid "Justification required" msgstr "" -#: templates/config.html.twig +#: inc/entity.class.php:219 msgid "Keep category after transfer" msgstr "" -#: templates/config.html.twig -msgid "Transfer log type" -msgstr "" - -#: templates/config.html.twig +#: inc/entity.class.php:232 msgid "Default category" msgstr "" -#: templates/config.html.twig front/entity.form.php:56 -msgid "The category is mandatory in the ticket template assigned to the entity" -msgstr "" - -#: front/ticket.form.php:43 src/Ticket.php:526 -msgid "Please select a valid entity" -msgstr "" - -#: src/Profile.php:75 src/Entity.php:161 src/Ticket.php:397 -msgid "Transfer Ticket Entity" -msgstr "" - -#: src/Profile.php:124 +#: inc/profile.class.php:150 msgid "Authorized entity transfer" msgstr "" -#: src/Profile.php:131 +#: inc/profile.class.php:157 msgid "" "Transfer authorized without assignment of technician or associated group" msgstr "" -#: src/Ticket.php:146 src/Ticket.php:514 +#: inc/ticket.class.php:103 inc/ticket.class.php:554 msgid "You must be assigned to the ticket to be able to transfer it" msgstr "" -#: src/Ticket.php:158 +#: inc/ticket.class.php:115 msgid "" "You don't have right to update tickets. Please contact your administrator." msgstr "" -#: src/Ticket.php:168 +#: inc/ticket.class.php:125 msgid "No entity available found, transfer impossible." msgstr "" -#: src/Ticket.php:179 +#: inc/ticket.class.php:136 msgid "Unauthorized transfer on closed ticket." msgstr "" -#: src/Ticket.php:480 +#: inc/ticket.class.php:152 +msgid "Transfer the ticket" +msgstr "" + +#: inc/ticket.class.php:160 +msgid "" +"Once the transfer has been completed, the ticket will remain visible only if " +"you have the required rights." +msgstr "" + +#: inc/ticket.class.php:166 +msgid "Select ticket entity to transfer" +msgstr "" + +#: inc/ticket.class.php:215 +msgid "Select the group to assign" +msgstr "" + +#: inc/ticket.class.php:230 +msgid "Justification" +msgstr "" + +#: inc/ticket.class.php:246 +msgid "" +"Warning, category will be reset if it does not exist in the target entity." +msgstr "" + +#: inc/ticket.class.php:256 +msgid "Confirm" +msgstr "" + +#: inc/ticket.class.php:520 msgid "Please explain your transfer" msgstr "" -#: src/Ticket.php:497 src/Ticket.php:538 +#: inc/ticket.class.php:537 inc/ticket.class.php:578 msgid "Please select a valid group" msgstr "" -#: src/Ticket.php:582 +#: inc/ticket.class.php:623 msgid "" "Category will be set to null but its configured as mandatory in GLPIs " "template, please contact your administrator." msgstr "" -#: src/Ticket.php:637 -msgid "Transfer to" -msgstr "" - -#: src/Ticket.php:642 +#: inc/ticket.class.php:681 msgid "in the group" msgstr "" -#: src/Ticket.php:672 -msgid "Successful transfer for ticket" +#: inc/ticket.class.php:691 +msgid "Escalation to" msgstr "" -#: ajax/showentitygroups.php:60 -msgid "" -"No group found with « Assigned to » right while a group is required. " -"Transfer impossible." +#: inc/ticket.class.php:700 +msgid "Successful transfer for ticket n° : " msgstr "" diff --git a/public/css/style.css b/public/css/style.css old mode 100644 new mode 100755 diff --git a/setup.php b/setup.php old mode 100644 new mode 100755 index 81b039d..00cbcee --- a/setup.php +++ b/setup.php @@ -1,6 +1,6 @@ 'Ticket']); Plugin::registerClass(Entity::class, ['addtabon' => 'Entity']); - if (isset($_SESSION['glpiactiveprofile'])) { - $PLUGIN_HOOKS[Hooks::CHANGE_PROFILE]['transferticketentity'] = [Profile::class, 'initProfile']; - } + $PLUGIN_HOOKS['change_profile']['transferticketentity'] = [Profile::class, 'initProfile']; Plugin::registerClass(Profile::class, ['addtabon' => ['Profile']]); - $PLUGIN_HOOKS[Hooks::ADD_CSS]['transferticketentity'][] = "css/style.css"; - + $PLUGIN_HOOKS['add_css']['transferticketentity'][] = "css/style.css"; + $PLUGIN_HOOKS['csrf_compliant']['transferticketentity'] = true; + $PLUGIN_HOOKS['use_massive_action']['transferticketentity'] = 1; } function plugin_version_transferticketentity() { - return [ - 'name' => 'TransferTicketEntity', - 'version' => PLUGIN_TRANSFERTICKETENTITY_VERSION, - 'author' => 'Yannick COMBA & Infotel', - 'license' => 'GPLv3+', - 'homepage' => 'https://github.com/InfotelGLPI/transferticketentity', - 'requirements' => [ + 'name' => 'TransferTicketEntity', + 'version' => TRANSFERTICKETENTITY_VERSION, + 'author' => 'Département de Maine et Loire & Y.COMBA & I.MELLOUK', + 'license' => 'GPLv3+', + 'homepage' => 'https://github.com/InfotelGLPI/transferticketentity', + 'requirements' => [ 'glpi' => [ 'min' => '11.0', 'max' => '12.0', 'dev' => false, ], - ]]; + ], + ]; } - function plugin_transferticketentity_options() { - return [ Plugin::OPTION_AUTOINSTALL_DISABLED => true, ]; diff --git a/src/Entity.php b/src/Entity.php old mode 100644 new mode 100755 index 0454854..c885d7d --- a/src/Entity.php +++ b/src/Entity.php @@ -1,32 +1,32 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * LICENSE + * + * This file is part of Transferticketentity plugin for GLPI. + * + * Transferticketentity is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Transferticketentity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Reports. If not, see . + * + * @category Ticket + * @package Transferticketentity + * @author Yannick Comba, Xavier Caillaud, Infotel, Département de Maine-et-Loire, Ilyasse Mellouk + * @copyright 2015-2026 Transferticketentity team + * @license AGPL License 3.0 or (at your option) any later version + * https://www.gnu.org/licenses/gpl-3.0.html + * @link https://github.com/pluginsGLPI/transferticketentity/ + * -------------------------------------------------------------------------- */ namespace GlpiPlugin\Transferticketentity; @@ -69,41 +69,35 @@ public static function getInstance($entities_id) } /** - * If category belong to ancestor, return it + * Keep only known fields before adding in database * + * @param array $input * @return array */ public function prepareInputForAdd($input) { - return array_intersect_key($input, array_flip([ + $allowed = [ 'entities_id', 'allow_entity_only_transfer', 'justification_transfer', 'allow_transfer', 'keep_category', 'itilcategories_id', - 'log_type', - ])); - } + ]; - public function prepareInputForUpdate($input) - { - return array_intersect_key($input, array_flip([ - 'id', - 'entities_id', - 'allow_entity_only_transfer', - 'justification_transfer', - 'allow_transfer', - 'keep_category', - 'itilcategories_id', - 'log_type', - ])); + return array_intersect_key($input, array_flip($allowed)); } - - public function availableCategories(int $entity_id) + + /** + * If category belong to ancestor, return it + * + * @param int|null $entities_id + * @return array + */ + public function availableCategories(?int $entities_id = null) { global $DB; - $entity = $entity_id; + $entity = $entities_id ?? (int) ($_REQUEST['id'] ?? 0); $allItilCategories = [0 => Dropdown::EMPTY_VALUE]; $result = $DB->request([ @@ -192,7 +186,7 @@ public function showFormMcv($item) $checkRights = new self(); $checkRights->getFromDBByCrit(['entities_id' => $item->getID()]); - $availableCategories = self::availableCategories($item->getID()); + $availableCategories = self::availableCategories(); $params['entity_choice'] = $item->getID(); $checkMandatoryCategory = Ticket::checkMandatoryCategory($params); @@ -203,7 +197,6 @@ public function showFormMcv($item) $checkRights->fields['allow_transfer'] = 0; $checkRights->fields['keep_category'] = 0; $checkRights->fields['itilcategories_id'] = 0; - $checkRights->fields['log_type'] = 0; } $target = self::getFormURL(); @@ -218,10 +211,6 @@ public function showFormMcv($item) 'entities_id' => $item->getID(), 'availableCategories' => $availableCategories, 'checkMandatoryCategory' => $checkMandatoryCategory, - 'log_type_options' => [ - 0 => _n('Followup', 'Followups', 1), - 1 => _n('Task', 'Tasks', 1), - ], ], ); @@ -271,7 +260,6 @@ public static function checkEntityRight($params) $array['allow_transfer'] = $data['allow_transfer']; $array['keep_category'] = $data['keep_category']; $array['itilcategories_id'] = $data['itilcategories_id']; - $array['log_type'] = $data['log_type'] ?? 0; } return $array; diff --git a/src/Profile.php b/src/Profile.php old mode 100644 new mode 100755 index 0d6a0bb..651415b --- a/src/Profile.php +++ b/src/Profile.php @@ -1,32 +1,32 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * LICENSE + * + * This file is part of Transferticketentity plugin for GLPI. + * + * Transferticketentity is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Transferticketentity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Reports. If not, see . + * + * @category Ticket + * @package Transferticketentity + * @author Yannick Comba, Xavier Caillaud, Infotel, Département de Maine-et-Loire, Ilyasse Mellouk + * @copyright 2015-2026 Transferticketentity team + * @license AGPL License 3.0 or (at your option) any later version + * https://www.gnu.org/licenses/gpl-3.0.html + * @link https://github.com/pluginsGLPI/transferticketentity/ + * -------------------------------------------------------------------------- */ namespace GlpiPlugin\Transferticketentity; @@ -68,9 +68,8 @@ public static function getIcon() */ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - if ($item->getType() == 'Profile' - && $item->fields['interface'] == 'central' + && $item->fields['interface'] == 'central' ) { return self::createTabEntry(__("Transfer Ticket Entity", "transferticketentity")); } @@ -113,36 +112,45 @@ public static function displayTabContentForItem( /** * Get all rights * - * @param $all - * * @return array */ public static function getAllRights() { + $rights = []; - $rights[] = ['itemtype' => Entity::class, + $rights[] = [ + 'itemtype' => Entity::class, 'label' => __('Authorized entity transfer', 'transferticketentity'), 'field' => 'plugin_transferticketentity_use', - 'rights' => [ - READ => __('Read'), - ],]; + 'rights' => [ + READ => __('Read'), + ], + ]; - $rights[] = ['itemtype' => Entity::class, + $rights[] = [ + 'itemtype' => Entity::class, 'label' => __('Transfer authorized without assignment of technician or associated group', 'transferticketentity'), 'field' => 'plugin_transferticketentity_bypass', - 'rights' => [ - READ => __('Read'), - ],]; + 'rights' => [ + READ => __('Read'), + ], + ]; + $rights[] = [ + 'itemtype' => Entity::class, + 'label' => __('Mass transfer authorized', 'transferticketentity'), + 'field' => 'plugin_transferticketentity_massive', + 'rights' => [ + READ => __('Read'), + ], + ]; return $rights; } /** * Init profiles - * **/ - public static function translateARight($old_right) { switch ($old_right) { @@ -181,10 +189,10 @@ public static function initProfile() } $it = $DB->request([ - 'FROM' => 'glpi_profilerights', + 'FROM' => 'glpi_profilerights', 'WHERE' => [ 'profiles_id' => $_SESSION['glpiactiveprofile']['id'], - 'name' => ['LIKE', '%plugin_transferticketentity%'], + 'name' => ['LIKE', '%plugin_transferticketentity%'], ], ]); foreach ($it as $prof) { @@ -197,9 +205,10 @@ public static function initProfile() */ public static function createFirstAccess($profiles_id) { - - $rights = ['plugin_transferticketentity_use' => READ, - 'plugin_transferticketentity_bypass' => READ, + $rights = [ + 'plugin_transferticketentity_use' => READ, + 'plugin_transferticketentity_bypass' => READ, + 'plugin_transferticketentity_massive' => READ, ]; self::addDefaultProfileInfos( @@ -210,7 +219,9 @@ public static function createFirstAccess($profiles_id) } /** - * @param $profile + * @param $profiles_id + * @param $rights + * @param bool $drop_existing **/ public static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) { @@ -219,15 +230,13 @@ public static function addDefaultProfileInfos($profiles_id, $rights, $drop_exist foreach ($rights as $right => $value) { if ($dbu->countElementsInTable( 'glpi_profilerights', - ["profiles_id" => $profiles_id, - "name" => $right] + ["profiles_id" => $profiles_id, "name" => $right] ) && $drop_existing) { $profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]); } if (!$dbu->countElementsInTable( 'glpi_profilerights', - ["profiles_id" => $profiles_id, - "name" => $right] + ["profiles_id" => $profiles_id, "name" => $right] )) { $myright['profiles_id'] = $profiles_id; $myright['name'] = $right; diff --git a/src/Ticket.php b/src/Ticket.php old mode 100644 new mode 100755 index a504223..824ea1c --- a/src/Ticket.php +++ b/src/Ticket.php @@ -1,32 +1,31 @@ . - - @category Ticket - @package Transferticketentity - @author Yannick Comba, Xavier Caillaud, Infotel - @copyright 2015-2026 Transferticketentity team - @license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html - @link https://github.com/pluginsGLPI/transferticketentity/ - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * LICENSE + * + * This file is part of Transferticketentity plugin for GLPI. + * + * Transferticketentity is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Transferticketentity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Reports. If not, see . + * + * @category Ticket + * @package Transferticketentity + * @author Yannick Comba, Xavier Caillaud, Infotel, Département de Maine-et-Loire, Ilyasse Mellouk + * @copyright 2015-2026 Transferticketentity team + * @license AGPL License 3.0 or (at your option) any later version + * https://www.gnu.org/licenses/gpl-3.0.html + * @link https://github.com/pluginsGLPI/transferticketentity/ + * -------------------------------------------------------------------------- */ namespace GlpiPlugin\Transferticketentity; @@ -42,10 +41,10 @@ use Group_Ticket; use Group_User; use Html; +use MassiveAction; +use Planning; use Session; use Ticket_User; -use ITILFollowup; -use Planning; use TicketTask; use TicketTemplateMandatoryField; @@ -114,8 +113,8 @@ public static function getGroupEntities($entities) 'ORDERBY' => 'name' ]; $criteria['WHERE'] = $criteria['WHERE'] + getEntitiesRestrictCriteria( - 'glpi_groups','',$entities, true - ); + 'glpi_groups', '', $entities, true + ); $iterator = $DB->request($criteria); @@ -137,6 +136,8 @@ public static function getGroupEntities($entities) public function showFormMcv($ticket) { $params['id_ticket'] = $ticket->getID(); + $params['id_user'] = $_SESSION['glpiID']; + $entity = new \Entity(); $entity->getFromDB($ticket->fields['entities_id']); $checkAssign = self::checkAssign($params); @@ -183,16 +184,12 @@ public function showFormMcv($ticket) return false; } - $group_required = 0; - $entities_selection[-1] = Dropdown::EMPTY_VALUE; + + $entities_selection[0] = Dropdown::EMPTY_VALUE; foreach ($getEntitiesRights as $getEntitiesRight) { if ($getEntitiesRight['allow_transfer']) { $entities_selection[$getEntitiesRight['entities_id']] = $getEntitiesRight['name']; } - - if ($getEntitiesRight['allow_entity_only_transfer'] == 1) { - $group_required = 1; - } } $target = $this->getFormURL(); @@ -200,17 +197,16 @@ public function showFormMcv($ticket) TemplateRenderer::getInstance()->display( '@transferticketentity/ticket.html.twig', [ - 'can_edit' => Session::haveRight(self::$rightname, READ), - 'root_plugin' => PLUGIN_TRANSFERTICKETENTITY_WEBDIR, - 'action' => $target, - 'id_ticket' => $ticket->getID(), - 'entities_id' => $ticket->getID(), - 'entities_name' => $entity->getName(), - 'entities' => $entities_selection, - 'group_required' => $group_required, + 'can_edit' => Session::haveRight(self::$rightname, READ), + 'root_plugin' => PLUGIN_TRANSFERTICKETENTITY_WEBDIR, + 'action' => $target, + 'id_ticket' => $ticket->getID(), + 'id_user' => $_SESSION['glpiID'], + 'entities_id' => $ticket->getID(), + 'entities_name' => $entity->getName(), + 'entities' => $entities_selection, ], ); - } @@ -224,9 +220,11 @@ public static function checkAssign($params) $ticket = new \Ticket(); $ticket->getfromDB($params['id_ticket']); - $groupTech = Group_User::getUserGroups($_SESSION['glpiID']); + $id_user = $params['id_user']; - $checkAssignedTech = []; + $groupTech = Group_User::getUserGroups($id_user); + + $checkAssignedTech = []; $checkAssignedGroup = []; $users_ticket = $ticket->getUsers(CommonITILActor::ASSIGN); @@ -240,7 +238,7 @@ public static function checkAssign($params) $var_check = 0; - if (in_array($_SESSION['glpiID'], $checkAssignedTech)) { + if (in_array($id_user, $checkAssignedTech)) { $var_check++; } @@ -290,15 +288,15 @@ public static function checkGroup($params) $criteria = [ 'SELECT' => 'id', - 'FROM' => 'glpi_groups', - 'WHERE' => [ + 'FROM' => 'glpi_groups', + 'WHERE' => [ 'is_assign' => 1, ], 'ORDERBY' => 'name' ]; $criteria['WHERE'] = $criteria['WHERE'] + getEntitiesRestrictCriteria( - 'glpi_groups','', $entities, true - ); + 'glpi_groups', '', $entities, true + ); $iterator = $DB->request($criteria); @@ -321,14 +319,13 @@ public static function checkExistingCategory($params) { global $DB; - $id_ticket = $params['id_ticket']; + $id_ticket = $params['id_ticket']; $targetEntity = $params['entity_choice']; - $result = $DB->request([ 'SELECT' => 'itilcategories_id', - 'FROM' => 'glpi_tickets', - 'WHERE' => ['id' => $id_ticket] + 'FROM' => 'glpi_tickets', + 'WHERE' => ['id' => $id_ticket] ]); $getTicketCategory = ''; @@ -338,7 +335,7 @@ public static function checkExistingCategory($params) } $result = $DB->request([ - 'FROM' => 'glpi_entities', + 'FROM' => 'glpi_entities', 'WHERE' => ['id' => $targetEntity] ]); @@ -355,17 +352,16 @@ public static function checkExistingCategory($params) } $result = $DB->request([ - 'FROM' => 'glpi_itilcategories', + 'FROM' => 'glpi_itilcategories', 'WHERE' => ['id' => $getTicketCategory] ]); - $getEntitiesFromCategoryTicket = ''; - $isRecursiveCategory = ''; + $isRecursiveCategory = ''; foreach ($result as $data) { $getEntitiesFromCategoryTicket = $data['entities_id']; - $isRecursiveCategory = $data['is_recursive']; + $isRecursiveCategory = $data['is_recursive']; } if (!$isRecursiveCategory) { @@ -388,7 +384,7 @@ public static function checkExistingCategory($params) * @param object $item Ticket * @param int $withtemplate 0 * - * @return "Entity ticket transfer" + * @return string */ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { @@ -411,8 +407,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { if ($item->getType() == \Ticket::class - && $_SESSION['glpiactiveprofile']['interface'] == 'central' - && Session::haveRight(self::$rightname, READ)) { + && $_SESSION['glpiactiveprofile']['interface'] == 'central') { $ticket = new self(); $ticket->showFormMcv($item); } @@ -455,9 +450,9 @@ public function launchTicketTransfer($params) { global $CFG_GLPI; - $checkAssign = self::checkAssign($params); - $checkEntity = self::checkEntityETT(); - $checkGroup = self::checkGroup($params); + $checkAssign = self::checkAssign($params); + $checkEntity = self::checkEntityETT(); + $checkGroup = self::checkGroup($params); $checkEntityRight = Entity::checkEntityRight($params); @@ -472,6 +467,9 @@ public function launchTicketTransfer($params) $entity->getfromDB($params['entity_choice']); $theEntity = $entity->getName(); + $group = new Group(); + $group->getfromDB($params['group_choice']); + if (!isset($params['justification']) || $params['justification'] == '') { if ($checkEntityRight['justification_transfer'] == 1) { @@ -548,11 +546,11 @@ public function launchTicketTransfer($params) $ticket = new \Ticket(); $ticket_update = [ - 'id' => $params['id_ticket'], + 'id' => $params['id_ticket'], 'entities_id' => $params['entity_choice'], ]; - if (!empty($params['group_choice']) && $params['group_choice'] > 0) { + if ($params['group_choice'] && $params['group_choice'] > 0) { $ticket_status = ['status' => CommonITILObject::ASSIGNED]; $ticket_update = array_merge($ticket_update, $ticket_status); } else { @@ -560,19 +558,20 @@ public function launchTicketTransfer($params) $ticket_update = array_merge($ticket_update, $ticket_status); } - if ($checkEntityRight['keep_category']) { - if ($checkExistingCategory) { - // Explicitly include the current category so GLPI does not reset it on entity change - $currentTicket = new \Ticket(); - $currentTicket->getFromDB($params['id_ticket']); - $ticket_category = ['itilcategories_id' => $currentTicket->fields['itilcategories_id']]; - } else { + // In case keep_category is at yes and category doesn't exist, reset category's ticket + if ($checkEntityRight['keep_category'] && !$checkExistingCategory) { + $ticket_category = ['itilcategories_id' => 0]; + $ticket_update = array_merge($ticket_update, $ticket_category); + } + + if (!$checkEntityRight['keep_category']) { + if ($checkEntityRight['itilcategories_id'] == null) { $ticket_category = ['itilcategories_id' => 0]; + } else { + $ticket_category = ['itilcategories_id' => $checkEntityRight['itilcategories_id']]; } - } else { - $ticket_category = ['itilcategories_id' => $checkEntityRight['itilcategories_id'] ?? 0]; + $ticket_update = array_merge($ticket_update, $ticket_category); } - $ticket_update = array_merge($ticket_update, $ticket_category); // If category is mandatory with GLPIs template and category will be null if ($ticket_category['itilcategories_id'] == 0 @@ -592,39 +591,50 @@ public function launchTicketTransfer($params) // Remove the link with the current user $delete_link_user = [ 'tickets_id' => $params['id_ticket'], - 'type' => CommonITILActor::ASSIGN + 'type' => CommonITILActor::ASSIGN ]; $ticket_user = new Ticket_User(); - $found_user = $ticket_user->find($delete_link_user); + $found_user = $ticket_user->find($delete_link_user); foreach ($found_user as $id => $tu) { - //delete user $ticket_user->delete(['id' => $id]); } // Remove the link with the current group $delete_link_group = [ 'tickets_id' => $params['id_ticket'], - 'type' => CommonITILActor::ASSIGN + 'type' => CommonITILActor::ASSIGN ]; $group_ticket = new Group_Ticket(); - $found_group = $group_ticket->find($delete_link_group); + $found_group = $group_ticket->find($delete_link_group); foreach ($found_group as $id => $tu) { - //delete group $group_ticket->delete(['id' => $id]); } $ticket->update($ticket_update); + // Add current user as observer if requested + if (isset($params['add_as_observer']) && $params['add_as_observer'] == 1) { + $ticket_user = new Ticket_User(); + $observer_data = [ + 'tickets_id' => $params['id_ticket'], + 'users_id' => $_SESSION['glpiID'], + 'type' => CommonITILActor::OBSERVER + ]; + if (!$ticket_user->find($observer_data)) { + $ticket_user->add($observer_data); + } + } + if ($requiredGroup) { // Change group ticket $group_check = [ 'tickets_id' => $params['id_ticket'], - 'groups_id' => $params['group_choice'], - 'type' => CommonITILActor::ASSIGN + 'groups_id' => $params['group_choice'], + 'type' => CommonITILActor::ASSIGN ]; if (!$group_ticket->find($group_check)) { @@ -634,52 +644,280 @@ public function launchTicketTransfer($params) } } - $content = __("Transfer to", "transferticketentity") . " $theEntity"; + $groupText = "

$justification"; - if (!empty($params['group_choice']) && $params['group_choice'] > 0) { - $group = new Group(); - $group->getFromDB($params['group_choice']); - $content .= " " . __("in the group", "transferticketentity") . " " . $group->getName(); + if ($params['group_choice'] && $params['group_choice'] > 0) { + $groupText = __("in the group", "transferticketentity") . " " . $group->getName() . "\n

$justification"; } - if (!empty($justification)) { - $content .= "

" . $justification; - } - - // Log the transfer as a followup or task depending on entity configuration - if (($checkEntityRight['log_type'] ?? 0) == 1) { - $task = new TicketTask(); - $task->add([ - 'tickets_id' => $params['id_ticket'], - 'is_private' => true, - 'state' => Planning::INFO, - 'content' => $content, - ]); - } else { - $followup = new ITILFollowup(); - $followup->add([ - 'itemtype' => \Ticket::class, - 'items_id' => $params['id_ticket'], - 'is_private' => true, - 'content' => $content, - ]); - } + // Log the transfer in a task + $task = new TicketTask(); + $task->add([ + 'tickets_id' => $params['id_ticket'], + 'is_private' => true, + 'state' => Planning::INFO, + 'content' => __( + "Escalation to", + "transferticketentity" + ) . " $theEntity " . $groupText + ]); $ticket = new \Ticket(); $ticket->getFromDB($params['id_ticket']); Session::addMessageAfterRedirect( __( - "Successful transfer for ticket", + "Successful transfer for ticket n° : ", "transferticketentity" ) . $ticket->getLink(), true, INFO ); - if ($ticket->getID() > 0) { - Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . (int) $ticket->getID()); + Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $ticket->getID()); + } + } + + + // ========================================================================= + // MASSIVE ACTIONS + // ========================================================================= + + /** + * Get specific massive actions available for tickets. + * + * @param mixed $checkitem Not used here + * + * @return array + */ + public function getSpecificMassiveActions($checkitem = null): array + { + $actions = parent::getSpecificMassiveActions($checkitem); + + if (Session::haveRight('plugin_transferticketentity_massive', READ)) { + $actions[self::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'transfer_entity'] = + __('Transfer to another entity', 'transferticketentity'); + } + + return $actions; + } + + /** + * Display the form fields for the massive action "transfer_entity". + * + * @param MassiveAction $ma Massive action object + * + * @return bool + */ + public static function showMassiveActionsSubForm(MassiveAction $ma): bool + { + if ($ma->getAction() === 'transfer_entity') { + $ticket_obj = new self(); + + $ids = array_keys($ma->getItems()[\Ticket::class] ?? []); + $first_ticket_id = reset($ids); + $fake_params = ['id_ticket' => $first_ticket_id ?: 0]; + + // Build entities list (only those with allow_transfer = 1) + $entity_config = new Entity(); + $all_entities = $entity_config->find(['allow_transfer' => 1]); + $entities_list = []; + foreach ($all_entities as $ec) { + $e = new \Entity(); + $e->getFromDB($ec['entities_id']); + $entities_list[$ec['entities_id']] = $e->getName(); + } + asort($entities_list); + + // Build groups list (all assignable groups) + global $DB; + $groups_list = []; + $iterator = $DB->request([ + 'SELECT' => ['id', 'name', 'entities_id'], + 'FROM' => 'glpi_groups', + 'WHERE' => ['is_assign' => 1], + 'ORDERBY' => ['entities_id ASC', 'name ASC'], + ]); + foreach ($iterator as $row) { + $groups_list[] = $row; + } + + echo ""; + + // Target entity + echo " + + + "; + + // Group to assign + echo " + + + "; + + echo "
+ " . __('Target entity', 'transferticketentity') . " + + +
+ " . __('Group to assign', 'transferticketentity') . " + + +
"; + + // JS to filter groups by selected entity + echo Html::scriptBlock(" + function updateGroupOptionsTTE(entityId) { + const allOptions = document.querySelectorAll('#group_choice_massive option.group_option'); + allOptions.forEach(function(opt) { + opt.style.display = opt.classList.contains('entity_' + entityId) ? '' : 'none'; + }); + } + + function updateSubmitStateTTE() { + const entitySelect = document.getElementById('target_entity_id'); + const groupSelect = document.getElementById('group_choice_massive'); + const submitBtn = document.getElementById('tte_massive_submit'); + + if (entitySelect && groupSelect && submitBtn) { + submitBtn.disabled = (entitySelect.value === '' || groupSelect.value === ''); + } + } + + document.addEventListener('change', function(e) { + if (e.target && e.target.id === 'target_entity_id') { + updateGroupOptionsTTE(e.target.value); + const groupSelect = document.getElementById('group_choice_massive'); + if (groupSelect) groupSelect.value = ''; + } + if (e.target && (e.target.id === 'target_entity_id' || e.target.id === 'group_choice_massive')) { + updateSubmitStateTTE(); + } + }); + + updateSubmitStateTTE(); + "); + + echo "
"; + + return true; + } + + return parent::showMassiveActionsSubForm($ma); + } + + /** + * Process the massive action "transfer_entity" for each selected ticket. + * + * @param MassiveAction $ma Massive action object + * @param CommonDBTM $item Ticket object + * @param array $ids List of ticket IDs + * + * @return void + */ + public static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids): void + { + global $DB; + + if ($ma->getAction() !== 'transfer_entity') { + parent::processMassiveActionsForOneItemtype($ma, $item, $ids); + return; + } + + $current_user = Session::getLoginUserID(); + $input = $ma->getInput(); + $target_entity_id = $input['target_entity_id'] ?? 0; + $group_id = $input['group_choice'] ?? null; + + foreach ($ids as $id) { + // Check if current user is assigned or has bypass right + $assigned = countElementsInTable( + 'glpi_tickets_users', + ['tickets_id' => $id, 'users_id' => $current_user, 'type' => CommonITILActor::ASSIGN] + ); + + $can_bypass = Session::haveright("plugin_transferticketentity_bypass", READ); + + if (!$assigned && !$can_bypass) { + $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO); + $ma->addMessage(sprintf( + __("You must be assigned to ticket ID %d to transfer it.", 'transferticketentity'), + $id + )); + continue; + } + + if ($item->getFromDB($id)) { + // Remove assigned users + $DB->delete('glpi_tickets_users', [ + 'tickets_id' => $id, + 'type' => CommonITILActor::ASSIGN + ]); + + // Update entity + $item->update([ + 'id' => $id, + 'entities_id' => $target_entity_id, + ]); + + // Remove assigned groups + $DB->delete('glpi_groups_tickets', [ + 'tickets_id' => $id, + 'type' => CommonITILActor::ASSIGN + ]); + + // Assign new group if provided + if (!empty($group_id)) { + $DB->insert('glpi_groups_tickets', [ + 'tickets_id' => $id, + 'groups_id' => $group_id, + 'type' => CommonITILActor::ASSIGN + ]); + } + + // Log task + $entity = new \Entity(); + $entity->getFromDB($target_entity_id); + $entity_name = $entity->getName(); + + $group_name = ''; + if (!empty($group_id)) { + $group = new Group(); + $group->getFromDB($group_id); + $group_name = $group->getName(); + } + + $content = __("Escalate to", "transferticketentity") . " " . $entity_name; + if (!empty($group_name)) { + $content .= " " . __("in group", "transferticketentity") . " " . $group_name; + } + + $task = new TicketTask(); + $task->add([ + 'tickets_id' => $id, + 'is_private' => true, + 'state' => Planning::INFO, + 'content' => $content + ]); + + $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK); } else { - Html::back(); + $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO); + $ma->addMessage(sprintf(__('Failed to transfer ticket ID %d', 'transferticketentity'), $id)); } } } diff --git a/templates/config.html.twig b/templates/config.html.twig old mode 100644 new mode 100755 index c3817db..e2b4a72 --- a/templates/config.html.twig +++ b/templates/config.html.twig @@ -1,31 +1,30 @@ {# -------------------------------------------------------------------------- -LICENSE - -This file is part of Transferticketentity plugin for GLPI. - -Transferticketentity is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Transferticketentity is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with Reports. If not, see . - -@category Ticket -@package Transferticketentity -@author Yannick Comba, Xavier Caillaud, Infotel -@copyright 2015-2026 Transferticketentity team -@license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html -@link https://github.com/pluginsGLPI/transferticketentity/ --------------------------------------------------------------------------- - #} +# ------------------------------------------------------------------------- +# Transferticketentity plugin for GLPI +# ------------------------------------------------------------------------- +# +# LICENSE +# +# This file is part of Transferticketentity. +# +# Transferticketentity is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Transferticketentity is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Transferticketentity. If not, see . +# ------------------------------------------------------------------------- +# @copyright Copyright (C) 2026-2026 by Transferticketentity plugin team. +# @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html +# @link https://github.com/InfotelGLPI/Transferticketentity +# ------------------------------------------------------------------------- +#} {% import "components/form/fields_macros.html.twig" as fields %} {% set field_options = {'label_class': 'col-5', 'input_class': 'col-7', 'full_width': false} %} @@ -86,22 +85,6 @@ along with Reports. If not, see . ) }} -
- -
- {% do call('Dropdown::showFromArray', [ - 'log_type', - log_type_options, - { - 'multiple': false, - 'value': item.fields['log_type']|default(0), - } - ]) %} -
-
- {# Bloc catégorie #}
@@ -146,5 +129,23 @@ along with Reports. If not, see .
- + {% endif %} diff --git a/templates/profile.html.twig b/templates/profile.html.twig old mode 100644 new mode 100755 index 650f8b4..85d3a9a --- a/templates/profile.html.twig +++ b/templates/profile.html.twig @@ -1,30 +1,29 @@ {# -------------------------------------------------------------------------- -LICENSE - -This file is part of Transferticketentity plugin for GLPI. - -Transferticketentity is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Transferticketentity is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with Reports. If not, see . - -@category Ticket -@package Transferticketentity -@author Yannick Comba, Xavier Caillaud, Infotel -@copyright 2015-2026 Transferticketentity team -@license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html -@link https://github.com/pluginsGLPI/transferticketentity/ --------------------------------------------------------------------------- + # ------------------------------------------------------------------------- + # Transferticketentity plugin for GLPI + # ------------------------------------------------------------------------- + # + # LICENSE + # + # This file is part of Transferticketentity. + # + # Transferticketentity is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # Transferticketentity is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with Transferticketentity. If not, see . + # ------------------------------------------------------------------------- + # @copyright Copyright (C) 2026-2026 by Transferticketentity plugin team. + # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + # @link https://github.com/InfotelGLPI/Transferticketentity + # ------------------------------------------------------------------------- #}
diff --git a/templates/ticket.html.twig b/templates/ticket.html.twig old mode 100644 new mode 100755 index 03e4bf7..648b952 --- a/templates/ticket.html.twig +++ b/templates/ticket.html.twig @@ -1,31 +1,30 @@ {# -------------------------------------------------------------------------- -LICENSE - -This file is part of Transferticketentity plugin for GLPI. - -Transferticketentity is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Transferticketentity is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with Reports. If not, see . - -@category Ticket -@package Transferticketentity -@author Yannick Comba, Xavier Caillaud, Infotel -@copyright 2015-2026 Transferticketentity team -@license AGPL License 3.0 or (at your option) any later version - https://www.gnu.org/licenses/gpl-3.0.html -@link https://github.com/pluginsGLPI/transferticketentity/ --------------------------------------------------------------------------- - #} +# ------------------------------------------------------------------------- +# Transferticketentity plugin for GLPI +# ------------------------------------------------------------------------- +# +# LICENSE +# +# This file is part of Transferticketentity. +# +# Transferticketentity is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Transferticketentity is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Transferticketentity. If not, see . +# ------------------------------------------------------------------------- +# @copyright Copyright (C) 2026-2026 by Transferticketentity plugin team. +# @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html +# @link https://github.com/InfotelGLPI/Transferticketentity +# ------------------------------------------------------------------------- +#} {% import "components/form/fields_macros.html.twig" as fields %} {% set field_options = {'label_class': 'col-5', 'input_class': 'col-7', 'full_width': false} %} @@ -39,6 +38,7 @@ along with Reports. If not, see .
+

{{ __('Transfer the ticket', 'transferticketentity') }} - {{ entities_name }} @@ -51,6 +51,7 @@ along with Reports. If not, see . {{ __('Once the transfer has been completed, the ticket will remain visible only if you have the required rights.', 'transferticketentity') }}

+ {# Entity selector #}

- {% if group_required is defined and group_required is true %} -
- -
- - -
+ {# Group selector #} +
+ +
+
- {% endif %} +
+ + {# Justification #}
{{ fields.textareaField( @@ -131,7 +130,23 @@ along with Reports. If not, see . 'field_class' : "col-12", } ) }} +
+
+ {# Add as observer checkbox #} +
+
+
+
+ + +
diff --git a/tests/ProfileTest.php b/tests/ProfileTest.php index 1a51753..298e365 100644 --- a/tests/ProfileTest.php +++ b/tests/ProfileTest.php @@ -41,9 +41,15 @@ public function testGetTypeNameIsNotEmpty(): void $this->assertNotEmpty(Profile::getTypeName(1)); } - public function testGetAllRightsReturnsTwoEntries(): void + public function testGetAllRightsReturnsThreeEntries(): void { - $this->assertCount(2, Profile::getAllRights()); + $this->assertCount(3, Profile::getAllRights()); + } + + public function testGetAllRightsContainsMassiveField(): void + { + $fields = array_column(Profile::getAllRights(), 'field'); + $this->assertContains('plugin_transferticketentity_massive', $fields); } public function testGetAllRightsContainsUseField(): void diff --git a/tools/extract_template.sh b/tools/extract_template.sh old mode 100644 new mode 100755 index 81defcd..0dd6f7c --- a/tools/extract_template.sh +++ b/tools/extract_template.sh @@ -1,18 +1,16 @@ #!/bin/bash +# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) -# --- Étape 1 : Extraction des chaînes PHP --- -find . -name '*.php' > php_files.list - -xgettext --files-from=php_files.list \ +find . -name '*.php' | xargs xgettext \ --copyright-holder='Transferticketentity Development Team' \ - --package-name='Transferticketentity plugin' \ - -o locales/glpi.pot \ + --package-name='GLPI - Transferticketentity plugin' \ + --package-version='1.1.4' \ + -o locales/transferticketentity-php.pot \ -L PHP \ --add-comments=TRANS \ --from-code=UTF-8 \ --force-po \ - --sort-output \ --keyword=_n:1,2,4t \ --keyword=__s:1,2t \ --keyword=__:1,2t \ @@ -22,38 +20,17 @@ xgettext --files-from=php_files.list \ --keyword=_nx:1c,2,3,5t \ --keyword=_sx:1c,2,3t -rm php_files.list - -# --- Étape 2 : Extraction des chaînes Twig --- - -# Append locales from Twig templates -SCRIPT_DIR=$(dirname $0) -WORKING_DIR=$(readlink -f "$SCRIPT_DIR/..") # Script will be executed from "vendor/bin" directory -# Define translate function args -F_ARGS_N="1,2" -F_ARGS__S="1" -F_ARGS__="1" -F_ARGS_X="1c,2" -F_ARGS_SX="1c,2" -F_ARGS_NX="1c,2,3" -F_ARGS_SN="1,2" +find . -name '*.js' | xargs xgettext \ + --copyright-holder='Transferticketentity Development Team' \ + --package-name='GLPI - Transferticketentity plugin' \ + --package-version='1.1.4' \ + -o locales/transferticketentity-js.pot \ + -L JavaScript \ + --add-comments=TRANS \ + --from-code=UTF-8 \ + --force-po \ + --keyword=__:1,2t \ + --keyword=_x:1c,2t \ + --keyword=_nx:1,2,3,5t -for file in $(cd $WORKING_DIR && find -regextype posix-egrep -not -regex $EXCLUDE_REGEX "$SCRIPT_DIR/.." -name "*.twig") -do - # 1. Convert file content to replace "{{ function(.*) }}" by "" and extract strings via std input - # 2. Replace "standard input:line_no" by file location in po file comments - contents=`cat $file | sed -r "s|\{\{\s*([a-z0-9_]+\(.*\))\s*\}\}||gi"` - cat $file | perl -0pe "s/\{\{(.*?)\}\}//gism" | xgettext - \ - -o locales/glpi.pot \ - -L PHP \ - --add-comments=TRANS \ - --from-code=UTF-8 \ - --force-po \ - --join-existing \ - --sort-output \ - --keyword=_n:$F_ARGS_N \ - --keyword=__:$F_ARGS__ \ - --keyword=_x:$F_ARGS_X \ - --keyword=_nx:$F_ARGS_NX - sed -i -r "s|standard input:([0-9]+)|`echo $file | sed "s|./||"`:\1|g" locales/glpi.pot -done +msgcat --use-first locales/transferticketentity-php.pot locales/transferticketentity-js.pot -o locales/transferticketentity.pot diff --git a/transferticketentity.xml b/transferticketentity.xml old mode 100644 new mode 100755 index 60babd4..8922adb --- a/transferticketentity.xml +++ b/transferticketentity.xml @@ -18,27 +18,20 @@ https://github.com/pluginsGLPI/transferticketentity/issues https://raw.githubusercontent.com/pluginsGLPI/transferticketentity/master/README.md - Xavier CAILLAUD - Infotel - Département de Maine-et-Loire - Yannick COMBA - + Xavier CAILLAUD + Infotel + Département de Maine-et-Loire + Yannick COMBA + Ilyasse MELLOUK + + + + 1.3.0 + ~11.0.0 + https://github.com/pluginsGLPI/transferticketentity/releases/download/1.3.0/glpi-transferticketentity-1.3.0.tar.bz2 + + - - 1.2.2 - ~11.0.0 - https://github.com/pluginsGLPI/transferticketentity/releases/download/1.2.2/glpi-transferticketentity-1.2.2.tar.bz2 - - - 1.2.1 - ~11.0.0 - https://github.com/pluginsGLPI/transferticketentity/releases/download/1.2.1/glpi-transferticketentity-1.2.1.tar.bz2 - - - 1.2.0 - ~11.0.0 - https://github.com/pluginsGLPI/transferticketentity/releases/download/1.2.0/glpi-transferticketentity-1.2.0.tar.bz2 - 1.1.3 ~10.0.0 @@ -49,19 +42,14 @@ en_GB es_VE pt_BR - pt_PT - + Ticket - Entité - Transfert Ticket - Entity - Transfert diff --git a/transifex.yaml b/transifex.yaml new file mode 100755 index 0000000..51d0e5f --- /dev/null +++ b/transifex.yaml @@ -0,0 +1,7 @@ +git: + filters: + - filter_type: file + file_format: PO + source_file: locales/transferticketentity.pot + source_language: en + translation_files_expression: 'locales/.po' \ No newline at end of file