Edit and Add to test profil

This commit is contained in:
Fred Tempez 2023-05-29 18:43:30 +02:00
parent 7c7c36a5e6
commit de84e3471b
5 changed files with 86 additions and 58 deletions

View File

@ -354,11 +354,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]['name'] . ' : ' . $profilData[$key]['comment'];
}
}

View File

@ -11,6 +11,7 @@
* @link http://zwiicms.fr/
*/
$(document).ready(function () {
/**
* Affichage de l'id en simulant FILTER_ID
*/
@ -46,5 +47,4 @@ $("#userAddGroup").on("change", function() {
$("#userCommentProfil" + $(this).val()).show();
}).trigger("change");
});

View File

@ -108,6 +108,7 @@
]); ?>
</div>
</div>
</div>
<div class="row">
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_MEMBER, [
@ -130,5 +131,4 @@
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -18,7 +18,9 @@ $(document).ready(function () {
$("#userEditGroup").on("change", function () {
$(".userEditGroupProfil").hide();
$(".userCommentProfil").hide();
$("#userEditGroupProfil" + $(this).val()).show();
$("#userCommentProfil" + $(this).val()).show();
});
});

View File

@ -131,6 +131,26 @@
</div>
</div>
</div>
<div class="row">
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_MEMBER, [
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MEMBER])
]);
?>
</div>
<div id="userCommentProfil<?php echo self::GROUP_MODERATOR; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_MODERATOR, [
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MODERATOR])
]);
?>
</div>
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_ADMIN, [
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_ADMIN])
]);
?>
</div>
</div>
</div>
</div>
</div>