From 44581b46829966923947e25fe801a06d3c719c7a Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 23 May 2023 20:47:27 +0200 Subject: [PATCH] add afficher le commentaire de profil dans l'ajout d'un user --- core/module/user/user.php | 9 +++++++- core/module/user/view/add/add.php | 38 +++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/core/module/user/user.php b/core/module/user/user.php index 109b4545..ecb775e6 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -47,6 +47,7 @@ class user extends common public static $userGroups = []; public static $userProfils = []; + public static $userProfilsComments = []; public static $userLongtime = false; @@ -153,11 +154,17 @@ class user extends common // Profils disponibles foreach ($this->getData(['profil']) as $profilId => $profilData) { - if ($profilId < 1 || $profilId > 2) { + if ($profilId < self::GROUP_MEMBER ) { + continue; + } + if ($profilId === self::GROUP_ADMIN) { + self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name']; + self::$userProfilsComments[$profilId][self::GROUP_ADMIN] = $profilData['comment']; continue; } foreach ($profilData as $key => $value) { self::$userProfils[$profilId][$key] = $profilData[$key]['name']; + self::$userProfilsComments[$profilId][$key] = $profilData[$key]['comment']; } } diff --git a/core/module/user/view/add/add.php b/core/module/user/view/add/add.php index 64334e92..ad36a659 100644 --- a/core/module/user/view/add/add.php +++ b/core/module/user/view/add/add.php @@ -95,26 +95,40 @@ ]); ?>
-
+
'Profil', ]); ?>
-
+
'Profil', ]); ?> -
-
-
-
- '' - ]); - ?>
+
+
+
+ implode("\n",$module::$userProfils[self::GROUP_MEMBER]) + ]); + ?> +
+
+ implode("\n",$module::$userProfils[self::GROUP_MODERATOR]) + ]); + ?> +
+
+ implode("\n",$module::$userProfils[self::GROUP_ADMIN]) + ]); + ?> +
+
- - \ No newline at end of file + \ No newline at end of file