use last activityReport plugin

master
Jean-Christian Paul Denis 2023-04-20 16:04:05 +02:00
parent fa53d53657
commit 0568131cb3
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
4 changed files with 51 additions and 50 deletions

View File

@ -11,17 +11,16 @@
use Dotclear\Helper\L10n;
L10n::$locales['Action successfuly excecuted'] = 'Action exécutée avec succès';
L10n::$locales['There is nothing to display'] = 'Il n\'y a rien à afficher';
L10n::$locales['There are %s entries'] = 'Il y a %s entrées';
L10n::$locales['Objects'] = 'Objets';
L10n::$locales['Values from official distribution'] = 'Valeurs de la distribution officielle';
L10n::$locales['Action on selected rows:'] = 'Action sur les lignes sélectionnées :';
L10n::$locales['Beware: All actions done here are irreversible and are directly applied'] = 'Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées';
L10n::$locales['Show Dotclear default properties'] = 'Afficher les propriétés de Dotclear';
L10n::$locales['Hide Dotclear default properties'] = 'Cacher les propriétés de Dotclear';
L10n::$locales['Failed to load cleaner'] = 'Impossible de charger le nettoyeur';
L10n::$locales['Plugin dcAdvancedCleaner'] = 'Plugin dcAdvancedCleaner';
L10n::$locales['New action from dcAdvancedCleaner has been made with type="%s", action="%s", ns="%s".'] = 'Une nouvelle action depuis dcAdvancedCleaner a été effectuée avec : type="%s", action="%s", ns="%s"';
L10n::$locales['Advanced cleaner'] = 'Nettoyeur avancé';
L10n::$locales['Make a huge cleaning of dotclear'] = 'Faites un énorme nettoyage de dotclear';
L10n::$locales['Action successfuly excecuted'] = 'Action exécutée avec succès';
L10n::$locales['There is nothing to display'] = 'Il n\'y a rien à afficher';
L10n::$locales['There are %s entries'] = 'Il y a %s entrées';
L10n::$locales['Objects'] = 'Objets';
L10n::$locales['Values from official distribution'] = 'Valeurs de la distribution officielle';
L10n::$locales['Action on selected rows:'] = 'Action sur les lignes sélectionnées :';
L10n::$locales['Beware: All actions done here are irreversible and are directly applied'] = 'Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées';
L10n::$locales['Show Dotclear default properties'] = 'Afficher les propriétés de Dotclear';
L10n::$locales['Hide Dotclear default properties'] = 'Cacher les propriétés de Dotclear';
L10n::$locales['Failed to load cleaner'] = 'Impossible de charger le nettoyeur';
L10n::$locales['Uninstalling module'] = 'Désinstallation de module';
L10n::$locales['Advanced cleaner'] = 'Nettoyeur avancé';
L10n::$locales['Make a huge cleaning of dotclear'] = 'Faites un énorme nettoyage de dotclear';

View File

@ -1,54 +1,54 @@
# Language: Français
# Module: dcAdvancedCleaner - 0.11
# Date: 2023-04-16 00:08:42
# Module: dcAdvancedCleaner - 0.2
# Date: 2023-04-20 14:01:57
# Author: , contact@jcdenis.fr
# Translated with translater 2023.03.19
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: dcAdvancedCleaner 0.11\n"
"Project-Id-Version: dcAdvancedCleaner 0.2\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2023-04-16T00:08:42+00:00\n"
"PO-Revision-Date: 2023-04-20T14:01:57+00:00\n"
"Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/Manage.php:77
#: src/Manage.php:82
msgid "Action successfuly excecuted"
msgstr "Action exécutée avec succès"
#: src/Manage.php:128
#: src/Manage.php:120
msgid "There is nothing to display"
msgstr "Il n'y a rien à afficher"
#: src/Manage.php:142
#: src/Manage.php:155
msgid "There are %s entries"
msgstr "Il y a %s entrées"
#: src/Manage.php:143
#: src/Manage.php:156
msgid "Objects"
msgstr "Objets"
#: src/Manage.php:163
#: src/Manage.php:176
msgid "Values from official distribution"
msgstr "Valeurs de la distribution officielle"
#: src/Manage.php:172
#: src/Manage.php:185
msgid "Action on selected rows:"
msgstr "Action sur les lignes sélectionnées :"
#: src/Manage.php:180
#: src/Manage.php:193
msgid "Beware: All actions done here are irreversible and are directly applied"
msgstr "Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées"
#: src/Manage.php:188
#: src/Manage.php:201
msgid "Show Dotclear default properties"
msgstr "Afficher les propriétés de Dotclear"
#: src/Manage.php:188
#: src/Manage.php:201
msgid "Hide Dotclear default properties"
msgstr "Cacher les propriétés de Dotclear"
@ -56,13 +56,9 @@ msgstr "Cacher les propriétés de Dotclear"
msgid "Failed to load cleaner"
msgstr "Impossible de charger le nettoyeur"
#: src/Prepend.php:40
msgid "Plugin dcAdvancedCleaner"
msgstr "Plugin dcAdvancedCleaner"
#: src/Prepend.php:47
msgid "New action from dcAdvancedCleaner has been made with type=\"%s\", action=\"%s\", ns=\"%s\"."
msgstr "Une nouvelle action depuis dcAdvancedCleaner a été effectuée avec : type=\"%s\", action=\"%s\", ns=\"%s\""
#: src/Prepend.php:48
msgid "Uninstalling module"
msgstr "Désinstallation de module"
msgid "Advanced cleaner"
msgstr "Nettoyeur avancé"

View File

@ -67,7 +67,7 @@ class Manage extends dcNsProcess
true,
true
);
dcPage::addSuccessNotice(__('Configuration successfuly updated'));
dcPage::addSuccessNotice(__('Configuration successfully updated.'));
dcCore::app()->adminurl?->redirect(
'admin.plugin.' . My::id(),
['part' => $vars->cleaner->id]

View File

@ -16,6 +16,12 @@ namespace Dotclear\Plugin\dcAdvancedCleaner;
use dcCore;
use dcNsProcess;
use Dotclear\Plugin\activityReport\{
Action,
ActivityReport,
Group
};
use Dotclear\Plugin\Uninstaller\Uninstaller;
class Prepend extends dcNsProcess
{
@ -34,22 +40,22 @@ class Prepend extends dcNsProcess
return false;
}
if (defined('ACTIVITY_REPORT_V2')) {
dcCore::app()->activityReport->addGroup(
My::id(),
__('Plugin dcAdvancedCleaner')
);
dcCore::app()->activityReport->addAction(
My::id(),
'maintenance',
__('Maintenance'),
__('New action from dcAdvancedCleaner has been made with type="%s", action="%s", ns="%s".'),
'dcAdvancedCleanerBeforeAction',
function ($type, $action, $ns) {
dcCore::app()->activityReport->addLog(My::id(), 'maintenance', [$type,$action, $ns]);
// log plugin Uninstaller actions
if (defined('ACTIVITY_REPORT') && ACTIVITY_REPORT == 3) {
$group = new Group(My::id(), My::name());
$group->add(new Action(
'uninstaller',
__('Uninstalling module'),
'%s',
'UninstallerBeforeAction',
function (string $id, string $action, string $ns): void {
$success = Uninstaller::instance()->cleaners->get($id)?->get($action)?->success;
if (!is_null($success)) {
ActivityReport::instance()->addLog(My::id(), 'uninstaller', [sprintf($success, $ns)]);
}
}
);
));
ActivityReport::instance()->groups->add($group);
}
return true;