fix user preference activity

This commit is contained in:
Jean-Christian Denis 2023-04-21 00:29:27 +02:00
parent 5ffa8525a1
commit 2c6764c95c
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
3 changed files with 16 additions and 13 deletions

View file

@ -46,7 +46,7 @@ L10n::$locales['A new user named "%s" was created by "%s"']
L10n::$locales['updating user'] = 'Mise à jour d\'utilisateur';
L10n::$locales['User named "%s" has been updated by "%s"'] = 'L\'utilisateur "%s" a été mis à jour par "%s"';
L10n::$locales['updating user preference'] = 'Mise à jour de préférence';
L10n::$locales['User named "%s" preference has been updated by "%s"'] = 'L\'utilisateur "%s" a mis à jour les préférences de "%s"';
L10n::$locales['"%s" user preference has been updated'] = 'Les préférences utilisateur de "%s" ont été mis à jour';
L10n::$locales['user deletion'] = 'Suppression d\'utilisateur';
L10n::$locales['User named "%s" has been deleted by "%"'] = 'L\'utilisateur nommé "%s" a été supprimé par "%s"';
L10n::$locales['HTML'] = 'HTML';

View file

@ -1,6 +1,6 @@
# Language: Français
# Module: activityReport - 3.0
# Date: 2023-04-20 12:38:46
# Date: 2023-04-20 22:27:38
# Author: , contact@jcdenis.fr
# Translated with translater 2023.03.19
@ -9,7 +9,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: activityReport 3.0\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2023-04-20T12:38:46+00:00\n"
"PO-Revision-Date: 2023-04-20T22:27:38+00:00\n"
"Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -157,8 +157,8 @@ msgid "updating user preference"
msgstr "Mise à jour de préférence"
#: src/ActivityBehaviors.php:195
msgid "User named \"%s\" preference has been updated by \"%s\""
msgstr "L'utilisateur \"%s\" a mis à jour les préférences de \"%s\""
msgid "\"%s\" user preference has been updated"
msgstr "Les préférences utilisateur de \"%s\" ont été mis à jour"
#: src/ActivityBehaviors.php:217
msgid "user deletion"

View file

@ -192,21 +192,21 @@ class ActivityBehaviors
$user->add(new Action(
'preference',
__('updating user preference'),
__('User named "%s" preference has been updated by "%s"'),
__('"%s" user preference has been updated'),
'adminAfterUserProfileUpdate',
[self::class, 'userPreference']
));
$user->add(new Action(
'preference',
__('updating user preference'),
__('User named "%s" preference has been updated by "%s"'),
__('"%s" user preference has been updated'),
'adminAfterUserOptionsUpdate',
[self::class, 'userPreference']
));
$user->add(new Action(
'preference',
__('updating user preference'),
__('User named "%s" preference has been updated by "%s"'),
__('"%s" user preference has been updated'),
'adminAfterDashboardOptionsUpdate',
[self::class, 'userPreference']
));
@ -448,15 +448,18 @@ class ActivityBehaviors
public static function userPreference(cursor $cur, string $user_id): void
{
$user = dcCore::app()->getUser($user_id);
if ($user->isEmpty()) {
return;
}
$user_cn = dcUtils::getUserCN(
$cur->getField('user_id'),
$cur->getField('user_name'),
$cur->getField('user_firstname'),
$cur->getField('user_displayname')
$user->f('user_id'),
$user->f('user_name'),
$user->f('user_firstname'),
$user->f('user_displayname')
);
$logs = [
(string) $user_cn,
(string) dcCore::app()->auth?->getInfo('user_cn'),
];
ActivityReport::instance()->addLog('user', 'preference', $logs);
}