Add profil

This commit is contained in:
Fred Tempez 2023-05-10 16:58:56 +02:00
parent f2636c87d8
commit ab46dd9ab2
2 changed files with 8 additions and 5 deletions

View File

@ -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,

View File

@ -21,13 +21,13 @@
<div class="col6">
<div class="row">
<div class="col12">
<?php echo template::text('profilEditName', [
<?php echo template::text('profilAddName', [
'label' => 'Nom du profil',
'value' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'name'])
]); ?>
</div>
<div class="col12">
<?php echo template::select('profilEditGroup', $module::$groupProfils, [
<?php echo template::select('profilAddGroup', $module::$groupProfils, [
'label' => 'Groupe',
'selected' => $this->getUrl(2)
]); ?>
@ -35,7 +35,7 @@
</div>
</div>
<div class="col6">
<?php echo template::textarea('profilEditComment', [
<?php echo template::textarea('profilAddComment', [
'label' => 'Commentaire',
'value' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'comment'])
]); ?>