fix user edit profil comment hidden

This commit is contained in:
Fred Tempez 2023-10-06 09:53:53 +02:00
parent 35a0bde533
commit 281947f5b2
2 changed files with 37 additions and 35 deletions

View File

@ -82,7 +82,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col6 offset3">
<div class="block"> <div class="block">
<h4> <h4>
<?php echo helper::translate('Permissions'); ?> <?php echo helper::translate('Permissions'); ?>

View File

@ -98,13 +98,13 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col6 offset3">
<div class="block"> <div class="block">
<h4> <h4>
<?php echo helper::translate('Permissions'); ?> <?php echo helper::translate('Permissions'); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col12">
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?> <?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('userEditGroup', self::$groupEdits, [ <?php echo template::select('userEditGroup', self::$groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')), 'disabled' => ($this->getUrl(2) === $this->getUser('id')),
@ -112,19 +112,21 @@
'label' => 'Groupe', 'label' => 'Groupe',
'selected' => $this->getData(['user', $this->getUrl(2), 'group']), 'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
]); ?> ]); ?>
<?php else: ?>
<?php echo template::hidden('userEditGroup', [
'value' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col6"> <div class="col12">
<div class="userEditGroupProfil displayNone" <div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [ <?php echo template::select('userEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?> ]); ?>
</div> </div>
<div class="userEditGroupProfil displayNone" <div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [ <?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
@ -134,33 +136,33 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 userCommentProfil">
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>"
class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_MEMBER, [ <?php echo template::textarea('userEditProfilComment' . self::GROUP_MEMBER, [
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]), 'label' => 'Commentaire',
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, 'value' => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]),
'disabled' => true,
]); ]);
?> ?>
</div> </div>
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" <div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 userCommentProfil">
class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_EDITOR, [ <?php echo template::textarea('userEditProfilComment' . self::GROUP_EDITOR, [
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]), 'label' => 'Commentaire',
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, 'value' => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]),
'disabled' => true,
]); ]);
?> ?>
</div> </div>
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" <div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 userCommentProfil">
class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_ADMIN, [ <?php echo template::textarea('userEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Commentaire', 'label' => 'Commentaire',
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]), 'value' => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, 'disabled' => true,
]); ]);
?> ?>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>