add afficher le commentaire de profil dans l'ajout d'un user

This commit is contained in:
Fred Tempez 2023-05-23 20:47:27 +02:00
parent 2fe0a8e7b1
commit 44581b4682
2 changed files with 34 additions and 13 deletions

View File

@ -47,6 +47,7 @@ class user extends common
public static $userGroups = []; public static $userGroups = [];
public static $userProfils = []; public static $userProfils = [];
public static $userProfilsComments = [];
public static $userLongtime = false; public static $userLongtime = false;
@ -153,11 +154,17 @@ class user extends common
// Profils disponibles // Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) { 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; continue;
} }
foreach ($profilData as $key => $value) { foreach ($profilData as $key => $value) {
self::$userProfils[$profilId][$key] = $profilData[$key]['name']; self::$userProfils[$profilId][$key] = $profilData[$key]['name'];
self::$userProfilsComments[$profilId][$key] = $profilData[$key]['comment'];
} }
} }

View File

@ -95,26 +95,40 @@
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<div class="userAddGroupProfil displayNone" id="userAddGroupProfil<?php echo self::GROUP_MEMBER; ?>"> <div class="userAddGroupProfil displayNone"
id="userAddGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('userAddProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [ <?php echo template::select('userAddProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil', 'label' => 'Profil',
]); ?> ]); ?>
</div> </div>
<div class="userAddGroupProfil displayNone" id="userAddGroupProfil<?php echo self::GROUP_MODERATOR; ?>"> <div class="userAddGroupProfil displayNone"
id="userAddGroupProfil<?php echo self::GROUP_MODERATOR; ?>">
<?php echo template::select('userAddProfil' . self::GROUP_MODERATOR, $module::$userProfils[self::GROUP_MODERATOR], [ <?php echo template::select('userAddProfil' . self::GROUP_MODERATOR, $module::$userProfils[self::GROUP_MODERATOR], [
'label' => 'Profil', 'label' => 'Profil',
]); ?> ]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('useraddProfilComment', [
"value" => ''
]);
?>
</div> </div>
</div>
<div class="row">
<div id="commentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_MEMBER, [
"value" => implode("\n",$module::$userProfils[self::GROUP_MEMBER])
]);
?>
</div>
<div id="commentProfil<?php echo self::GROUP_MODERATOR; ?>" class="col12">
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_MODERATOR, [
"value" => implode("\n",$module::$userProfils[self::GROUP_MODERATOR])
]);
?>
</div>
<div id="commentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_ADMIN, [
"value" => implode("\n",$module::$userProfils[self::GROUP_ADMIN])
]);
?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> <?php echo template::formClose(); ?>
<?php echo template::formClose(); ?>