From 5e2687bd44399bf6b79c44aeeb3bc40f2dc27e57 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 7 Jul 2023 19:03:41 +0200 Subject: [PATCH] =?UTF-8?q?Affichage=20correct=20des=20commentaires=20li?= =?UTF-8?q?=C3=A9s=20aux=20profils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/user/view/edit/edit.js.php | 2 + core/module/user/view/edit/edit.php | 51 ++++++++++++++++---------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/core/module/user/view/edit/edit.js.php b/core/module/user/view/edit/edit.js.php index b96d9d49..93909931 100644 --- a/core/module/user/view/edit/edit.js.php +++ b/core/module/user/view/edit/edit.js.php @@ -14,7 +14,9 @@ $(document).ready(function () { $(".userEditGroupProfil").hide(); + $(".userCommentProfil").hide(); $("#userEditGroupProfil" + $("#userEditGroup").val()).show(); + $("#userCommentProfil" + $("#userEditGroup").val()).show(); $("#userEditGroup").on("change", function () { $(".userEditGroupProfil").hide(); diff --git a/core/module/user/view/edit/edit.php b/core/module/user/view/edit/edit.php index fb4035e5..b5f4983d 100644 --- a/core/module/user/view/edit/edit.php +++ b/core/module/user/view/edit/edit.php @@ -110,7 +110,7 @@ 'disabled' => ($this->getUrl(2) === $this->getUser('id')), 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''), 'label' => 'Groupe', - 'selected' => $this->getData(['user', $this->getUrl(2), 'group']) + 'selected' => $this->getData(['user', $this->getUrl(2), 'group']), ]); ?> @@ -119,36 +119,47 @@ id="userEditGroupProfil"> 'Profil', - 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']) + 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), + 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, ]); ?>
'Profil', - 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']) + 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), + 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, ]); ?>
-
- implode("\n",$module::$userProfilsComments[self::GROUP_MEMBER]) - ]); - ?> -
-
- implode("\n",$module::$userProfilsComments[self::GROUP_EDITOR]) - ]); - ?> -
-
- implode("\n",$module::$userProfilsComments[self::GROUP_ADMIN]) - ]); - ?> +
+
+ implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]), + 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, + ]); + ?> +
+
+ implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]), + 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, + ]); + ?> +
+
+ 'Commentaire', + "value" => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]), + 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, + ]); + ?> +