From ab46dd9ab26b0725dfbaf3c6c6a74d5e4cb928f4 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 10 May 2023 16:58:56 +0200 Subject: [PATCH] Add profil --- core/module/user/user.php | 7 +++++-- core/module/user/view/profilAdd/profilAdd.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/module/user/user.php b/core/module/user/user.php index 955d693d..916ad5bc 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -595,11 +595,14 @@ class user extends common { // Soumission du formulaire if ($this->isPost()) { + // Nombre de profils de ce groupe + $group = $this->getInput('profilAddGroup'); + $profil = (string) (count($this->getData(['profil', $group])) + 1); // Sauvegarder les données $this->setData([ 'profil', - $this->getInput('profilAddGroup'), - $this->getInput('profilAddProfil'), + $group, + $profil, [ 'name' => $this->getInput('profilAddName', helper::FILTER_STRING_SHORT, true), 'readonly' => false, diff --git a/core/module/user/view/profilAdd/profilAdd.php b/core/module/user/view/profilAdd/profilAdd.php index d41bfc35..be724994 100644 --- a/core/module/user/view/profilAdd/profilAdd.php +++ b/core/module/user/view/profilAdd/profilAdd.php @@ -21,13 +21,13 @@
- 'Nom du profil', 'value' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'name']) ]); ?>
- 'Groupe', 'selected' => $this->getUrl(2) ]); ?> @@ -35,7 +35,7 @@
- 'Commentaire', 'value' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'comment']) ]); ?>