diff --git a/front/rgpdtools.form.php b/front/rgpdtools.form.php index 8757b3f..5d5fd10 100644 --- a/front/rgpdtools.form.php +++ b/front/rgpdtools.form.php @@ -15,7 +15,7 @@ $nbUnlinkedElmts = $PluginRgpdtoolsRgpdtools::deleteUserLinkItems($_POST); if ($nbUnlinkedElmts) { - $message = $nbUnlinkedElmts.' link(s) with the user where deleted successfully.'; + $message = $nbUnlinkedElmts.__(' link(s) with the user where deleted successfully', 'rgpdtools'); } else { $message = __('No links matching criteria were founded, no update query were executed.', 'rgpdtools'); } @@ -32,7 +32,9 @@ } // standard form -Html::header(__('RgpdTools', 'rgpdtools'), $_SERVER['PHP_SELF'], 'tools', 'rgpdtools'); -$PluginRgpdtoolsRgpdtools = new PluginRgpdtoolsRgpdtools(); -$PluginRgpdtoolsRgpdtools->getFormsForCompleteForm(); -Html::footer(); +if (!isset($_REQUEST['generate'])) { + Html::header(__('RgpdTools', 'rgpdtools'), $_SERVER['PHP_SELF'], 'tools', 'rgpdtools'); + $PluginRgpdtoolsRgpdtools = new PluginRgpdtoolsRgpdtools(); + $PluginRgpdtoolsRgpdtools->getFormsForCompleteForm(); + Html::footer(); +} diff --git a/inc/rgpdtools.class.php b/inc/rgpdtools.class.php index a19087c..c7b1252 100644 --- a/inc/rgpdtools.class.php +++ b/inc/rgpdtools.class.php @@ -180,8 +180,8 @@ private static function generateExportForm($users_id, $itemsTypes) $rand = mt_rand(); $idForm = "useritemsexport_form$rand"; - $html .= "
"; - $html .= "
"; $html .= '
'; @@ -251,7 +251,7 @@ private static function generateUnlinkItemsForm($users_id, $itemsTypes) } $idForm = "useritemsdelete_form$rand"; - $html .= "
"; + $html .= "
"; $html .= ""; $html .= '
'; @@ -355,7 +355,7 @@ private static function generateAnonymiseForm($users_id) $values[$i] = $i . ' ' . __('month'); } $idForm = "userpurgelogs_form$rand"; - $html .= "
"; + $html .= "
"; $html .= ""; $html .= '
'; @@ -605,7 +605,7 @@ private static function unlinkUserAssociateElementsToDate($userID, $className, $ if ($nbUnlinkedElmts) { // construction du tableau des ids $objectsIds = []; - while ($row = $DB->fetch_assoc($results)) { + while ($row = $DB->fetchAssoc($results)) { array_push($objectsIds, $row['id']); } $query = "UPDATE " . $object->getTable() . " SET users_id=NULL WHERE id IN (" . implode(',', $objectsIds) . ")"; diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo index c8170aa..e5c17ac 100644 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 index 7dee4b8..bfada0b 100644 --- a/locales/fr_FR.po +++ b/locales/fr_FR.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: RgpdTools 0.0.1\n" "Report-Msgid-Bugs-To: contact@probesys.com\n" -"POT-Creation-Date: 2021-03-05 14:01+0100\n" -"PO-Revision-Date: 2021-03-30 08:39+0200\n" +"POT-Creation-Date: 2023-01-12 09:47+0100\n" +"PO-Revision-Date: 2023-01-12 10:01+0100\n" "Last-Translator: probeSys \n" "Language-Team: \n" "Language: fr_FR\n" @@ -18,7 +18,8 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 2.4.2\n" -#: setup.php:71 front/rgpdtools.form.php:35 inc/rgpdtools.class.php:47 +#: setup.php:71 front/rgpdtools.form.php:35 inc/rgpdtools.class.php:29 +#: inc/rgpdtools.class.php:48 msgctxt "rgpdtools" msgid "RgpdTools" msgstr "Utilitaires RGPD" @@ -28,6 +29,11 @@ msgctxt "rgpdtools" msgid "Export successfully generated." msgstr "Export généré avec succès." +#: front/rgpdtools.form.php:18 +msgctxt "rgpdtools" +msgid " link(s) with the user where deleted successfully" +msgstr " lien(s) avec le(s) utilisateur(s) sélectionné(s) supprimé(s)" + #: front/rgpdtools.form.php:20 msgctxt "rgpdtools" msgid "No links matching criteria were founded, no update query were executed." @@ -39,69 +45,79 @@ msgstr "" msgctxt "rgpdtools" msgid "Logs contains information about the user were anonymize successfully." msgstr "" -"Les logs contenant des informations relatives à l'utilisateur ont été " -"anonymisés avec succès." +"Les logs contenant des informations relatives aux utilisateurs sélectionnés " +"ont été anonymisés avec succès." -#: inc/rgpdtools.class.php:10 +#: inc/rgpdtools.class.php:11 msgctxt "rgpdtools" msgid "Run \"composer install --no-dev\" in the plugin tree" msgstr "Executer \"composer install --no-dev\" dans le dossier du plugin" -#: inc/rgpdtools.class.php:180 inc/rgpdtools.class.php:250 -#: inc/rgpdtools.class.php:346 +#: inc/rgpdtools.class.php:71 inc/rgpdtools.class.php:102 +msgctxt "rgpdtools" +msgid "user is required" +msgstr "vous devez sélectionner un utilisateur" + +#: inc/rgpdtools.class.php:85 +msgctxt "rgpdtools" +msgid "user is required or all user checkbox" +msgstr "vous devez sélectionner un utilisateur ou tout les utilisateurs" + +#: inc/rgpdtools.class.php:185 inc/rgpdtools.class.php:256 +#: inc/rgpdtools.class.php:360 msgctxt "rgpdtools" msgid "Are you sure you want to execute this operation" msgstr "Etes vous certain de vouloir exécuter cette opération" -#: inc/rgpdtools.class.php:186 +#: inc/rgpdtools.class.php:191 msgctxt "rgpdtools" msgid "Export users data" msgstr "Export des données de l'utilisateur" -#: inc/rgpdtools.class.php:204 +#: inc/rgpdtools.class.php:209 msgctxt "rgpdtools" msgid "Choosing what to export" msgstr "Sélectionner les éléments à exporter" -#: inc/rgpdtools.class.php:255 +#: inc/rgpdtools.class.php:261 msgctxt "rgpdtools" msgid "Removal of links to the user" msgstr "Suppression des liens vers l'utilisateur" -#: inc/rgpdtools.class.php:273 +#: inc/rgpdtools.class.php:283 msgctxt "rgpdtools" msgid "Choice of elements for which to remove links to the user" msgstr "" "Sélection des types d'éléments pour lesquels supprimer les liens avec " "l'utilisateur" -#: inc/rgpdtools.class.php:274 +#: inc/rgpdtools.class.php:284 msgctxt "rgpdtools" msgid "For each item, retention period" msgstr "Pour chaque type d'élément, durée de rétention" -#: inc/rgpdtools.class.php:310 +#: inc/rgpdtools.class.php:320 msgid "User" msgid_plural "User" msgstr[0] "Utilisateur" msgstr[1] "Utilisateurs" -#: inc/rgpdtools.class.php:320 +#: inc/rgpdtools.class.php:334 msgctxt "rgpdtools" msgid "Apply to all users" msgstr "Appliquer à tout les utilisateurs" -#: inc/rgpdtools.class.php:351 +#: inc/rgpdtools.class.php:365 msgctxt "rgpdtools" msgid "Purge logs referring to the user" msgstr "Suppression des logs faisant référence à l'utilisateur" -#: inc/rgpdtools.class.php:355 +#: inc/rgpdtools.class.php:369 msgctxt "rgpdtools" msgid "Retention Period" msgstr "Durée de rétention" -#: inc/rgpdtools.class.php:523 +#: inc/rgpdtools.class.php:582 #, php-format msgctxt "rgpdtools" msgid "The class %1$s can't be instanciate because not finded on GLPI." diff --git a/locales/rgpdtools.pot b/locales/rgpdtools.pot index a1199f2..133a111 100644 --- a/locales/rgpdtools.pot +++ b/locales/rgpdtools.pot @@ -5,9 +5,9 @@ # #, fuzzy msgid "" -msgstr "Project-Id-Version: RgpdTools 0.0.1\n" +msgstr "Project-Id-Version: RgpdTools 1.0.0\n" "Report-Msgid-Bugs-To: contact@probesys.com\n" - "POT-Creation-Date: 2021-03-05 14:01+0100\n" + "POT-Creation-Date: 2023-01-12 09:47+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,8 @@ msgstr "Project-Id-Version: RgpdTools 0.0.1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: setup.php:71 front/rgpdtools.form.php:35 inc/rgpdtools.class.php:47 +#: setup.php:71 front/rgpdtools.form.php:35 inc/rgpdtools.class.php:29 +#: inc/rgpdtools.class.php:48 msgctxt "rgpdtools" msgid "RgpdTools" msgstr "" @@ -27,6 +28,11 @@ msgctxt "rgpdtools" msgid "Export successfully generated." msgstr "" +#: front/rgpdtools.form.php:18 +msgctxt "rgpdtools" +msgid " link(s) with the user where deleted successfully" +msgstr "" + #: front/rgpdtools.form.php:20 msgctxt "rgpdtools" msgid "No links matching criteria were founded, no update query were " @@ -38,64 +44,74 @@ msgctxt "rgpdtools" msgid "Logs contains information about the user were anonymize successfully." msgstr "" -#: inc/rgpdtools.class.php:10 +#: inc/rgpdtools.class.php:11 msgctxt "rgpdtools" msgid "Run \"composer install --no-dev\" in the plugin tree" msgstr "" -#: inc/rgpdtools.class.php:180 inc/rgpdtools.class.php:250 -#: inc/rgpdtools.class.php:346 +#: inc/rgpdtools.class.php:71 inc/rgpdtools.class.php:102 +msgctxt "rgpdtools" +msgid "user is required" +msgstr "" + +#: inc/rgpdtools.class.php:85 +msgctxt "rgpdtools" +msgid "user is required or all user checkbox" +msgstr "" + +#: inc/rgpdtools.class.php:185 inc/rgpdtools.class.php:256 +#: inc/rgpdtools.class.php:360 msgctxt "rgpdtools" msgid "Are you sure you want to execute this operation" msgstr "" -#: inc/rgpdtools.class.php:186 +#: inc/rgpdtools.class.php:191 msgctxt "rgpdtools" msgid "Export users data" msgstr "" -#: inc/rgpdtools.class.php:204 +#: inc/rgpdtools.class.php:209 msgctxt "rgpdtools" msgid "Choosing what to export" msgstr "" -#: inc/rgpdtools.class.php:255 +#: inc/rgpdtools.class.php:261 msgctxt "rgpdtools" msgid "Removal of links to the user" msgstr "" -#: inc/rgpdtools.class.php:273 +#: inc/rgpdtools.class.php:283 msgctxt "rgpdtools" msgid "Choice of elements for which to remove links to the user" msgstr "" -#: inc/rgpdtools.class.php:274 +#: inc/rgpdtools.class.php:284 msgctxt "rgpdtools" msgid "For each item, retention period" msgstr "" -#: inc/rgpdtools.class.php:310 +#: inc/rgpdtools.class.php:320 msgid "User" msgid_plural "User" msgstr[0] "" msgstr[1] "" -#: inc/rgpdtools.class.php:320 +#: inc/rgpdtools.class.php:334 msgctxt "rgpdtools" msgid "Apply to all users" msgstr "" -#: inc/rgpdtools.class.php:351 +#: inc/rgpdtools.class.php:365 msgctxt "rgpdtools" msgid "Purge logs referring to the user" msgstr "" -#: inc/rgpdtools.class.php:355 +#: inc/rgpdtools.class.php:369 msgctxt "rgpdtools" msgid "Retention Period" msgstr "" -#: inc/rgpdtools.class.php:523 +#: inc/rgpdtools.class.php:582 #, php-format msgctxt "rgpdtools" msgid "The class %1$s can't be instanciate because not finded on GLPI." diff --git a/setup.php b/setup.php index 18d12e8..fc96249 100644 --- a/setup.php +++ b/setup.php @@ -28,8 +28,9 @@ * * -------------------------------------------------------------------------- */ -define('PLUGIN_RGPDTOOLS_VERSION', '0.1.3'); +define('PLUGIN_RGPDTOOLS_VERSION', '1.0.0'); define('PLUGIN_RGPDTOOLS_GLPI_MIN_VERSION', '9.5'); +define('PLUGIN_RGPDTOOLS_GLPI_MAX_VERSION', '11'); if (!defined("PLUGIN_RGPDTOOLS_DIR")) { define('PLUGIN_RGPDTOOLS_DIR', Plugin::getPhpDir('rgpdtools')); } @@ -81,14 +82,16 @@ function plugin_version_rgpdtools() } /** - * Check pre-requisites before install - * OPTIONNAL, but recommanded - * - * @return boolean + * Check plugin's prerequisites before installation */ function plugin_rgpdtools_check_prerequisites() { - return true; + if (version_compare(GLPI_VERSION, PLUGIN_RGPDTOOLS_GLPI_MIN_VERSION, 'lt') || version_compare(GLPI_VERSION, PLUGIN_RGPDTOOLS_GLPI_MAX_VERSION, 'ge')) { + echo __('This plugin requires GLPI >= ' . PLUGIN_RGPDTOOLS_GLPI_MIN_VERSION . ' and GLPI < ' . PLUGIN_RGPDTOOLS_GLPI_MAX_VERSION . '
'); + } else { + return true; + } + return false; } /**