ZwiiCMS/core/module/user/view/edit/edit.php

174 lines
6.0 KiB
PHP
Raw Normal View History

2018-04-02 08:29:19 +02:00
<?php echo template::formOpen('userEditForm'); ?>
2022-09-29 08:45:59 +02:00
<div class="row">
<div class="col1">
2023-03-10 16:49:49 +01:00
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
2022-09-29 08:45:59 +02:00
<?php echo template::button('userEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user',
'value' => template::ico('left')
]); ?>
2023-03-10 16:49:49 +01:00
<?php else: ?>
2022-09-29 08:45:59 +02:00
<?php echo template::button('userEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'value' => template::ico('home')
]); ?>
<?php endif; ?>
</div>
<div class="col2 offset9">
<?php echo template::submit('userEditSubmit'); ?>
2018-04-02 08:29:19 +02:00
</div>
2022-09-29 08:45:59 +02:00
</div>
<div class="row">
<div class="col6">
<div class="block">
2023-03-10 16:49:49 +01:00
<h4>
<?php echo helper::translate('Identité'); ?>
2022-09-29 08:45:59 +02:00
</h4>
<div class="row">
<div class="col6">
<?php echo template::text('userEditFirstname', [
'autocomplete' => 'off',
2023-07-28 11:12:58 +02:00
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
2022-09-29 08:45:59 +02:00
'label' => 'Prénom',
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
]); ?>
2018-04-02 08:29:19 +02:00
</div>
2022-09-29 08:45:59 +02:00
<div class="col6">
<?php echo template::text('userEditLastname', [
'autocomplete' => 'off',
2023-10-06 09:52:38 +02:00
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
2022-09-29 08:45:59 +02:00
'label' => 'Nom',
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
2018-04-02 08:29:19 +02:00
]); ?>
2022-09-29 08:45:59 +02:00
</div>
2018-04-02 08:29:19 +02:00
</div>
2023-05-02 23:37:51 +02:00
<div class="row">
<div class="col6">
<?php echo template::text('userEditPseudo', [
'autocomplete' => 'off',
'label' => 'Pseudo',
'value' => $this->getData(['user', $this->getUrl(2), 'pseudo'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('userEditSignature', $module::$signature, [
'label' => 'Signature',
'selected' => $this->getData(['user', $this->getUrl(2), 'signature'])
]); ?>
</div>
</div>
2022-09-29 08:45:59 +02:00
<?php echo template::mail('userEditMail', [
'autocomplete' => 'off',
'label' => 'Adresse électronique',
2022-09-29 08:45:59 +02:00
'value' => $this->getData(['user', $this->getUrl(2), 'mail'])
]); ?>
2023-05-02 23:37:51 +02:00
<?php echo template::select('userEditLanguage', $module::$languagesInstalled, [
'label' => 'Langue',
2023-05-09 08:58:57 +02:00
'selected' => $this->getData(['user', $this->getUrl(2), 'language'])
2023-05-02 23:37:51 +02:00
]); ?>
2022-09-29 08:45:59 +02:00
</div>
</div>
<div class="col6">
<div class="block">
2023-03-10 16:49:49 +01:00
<h4>
<?php echo helper::translate('Authentification'); ?>
2022-09-29 08:45:59 +02:00
</h4>
<?php echo template::text('userEditId', [
'autocomplete' => 'off',
'help' => 'L\'identifiant est défini lors de la création du compte, il ne peut pas être modifié.',
'label' => 'Identifiant',
'readonly' => true,
'value' => $this->getUrl(2)
]); ?>
2023-11-07 21:48:37 +01:00
<?php
// Les admins ont le pouvoir de forcer le changement de mot de passe
if ($this->getUser('group') < self::GROUP_ADMIN): ?>
<?php echo template::password('userEditOldPassword', [
'autocomplete' => 'new-password',
// remplace 'off' pour éviter le pré remplissage auto
'label' => 'Ancien mot de passe',
]); ?>
<?php endif; ?>
2022-09-29 08:45:59 +02:00
<?php echo template::password('userEditNewPassword', [
'autocomplete' => 'off',
'label' => 'Nouveau mot de passe'
]); ?>
<?php echo template::password('userEditConfirmPassword', [
'autocomplete' => 'off',
'label' => 'Confirmation'
]); ?>
2018-04-02 08:29:19 +02:00
</div>
</div>
2022-09-29 08:45:59 +02:00
</div>
<div class="row">
2023-10-06 09:52:38 +02:00
<div class="col6 offset3">
<div class="block">
2023-03-10 16:49:49 +01:00
<h4>
2023-05-02 23:37:51 +02:00
<?php echo helper::translate('Permissions'); ?>
</h4>
<div class="row">
2023-10-06 09:52:38 +02:00
<div class="col12">
2023-03-10 16:49:49 +01:00
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('userEditGroup', self::$groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
]); ?>
2023-10-06 09:52:38 +02:00
<?php else: ?>
<?php echo template::hidden('userEditGroup', [
'value' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?>
2023-05-06 19:52:33 +02:00
<?php endif; ?>
</div>
2023-10-06 09:52:38 +02:00
<div class="col12">
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
2023-05-06 19:52:33 +02:00
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
2023-05-06 19:52:33 +02:00
]); ?>
</div>
2023-10-06 09:52:38 +02:00
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
2023-07-05 18:04:42 +02:00
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
2023-05-06 19:52:33 +02:00
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
2023-05-06 19:52:33 +02:00
]); ?>
2023-05-02 23:37:51 +02:00
</div>
2023-03-10 16:49:49 +01:00
</div>
</div>
2023-05-29 18:43:30 +02:00
<div class="row">
2023-10-06 09:52:38 +02:00
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_MEMBER, [
'label' => 'Commentaire',
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]),
'disabled' => true,
]);
?>
</div>
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_EDITOR, [
'label' => 'Commentaire',
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]),
'disabled' => true,
]);
?>
</div>
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Commentaire',
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]),
'disabled' => true,
]);
?>
2023-05-29 18:43:30 +02:00
</div>
2023-10-06 09:52:38 +02:00
2023-05-29 18:43:30 +02:00
</div>
</div>
</div>
</div>
2022-09-29 08:45:59 +02:00
<?php echo template::formClose(); ?>