suscribe 2.6

This commit is contained in:
Fred Tempez 2025-01-05 17:58:54 +01:00
parent 384dc2503b
commit 3736c2ebc9
20 changed files with 1118 additions and 1103 deletions

View File

@ -1,11 +1,15 @@
# Version 2.4 # Version 2.6
- L'approbation par un administrateur initialise le pseudo avec l'id de l'utilisateur. - Corrige d'un bug empêchat de terminer la procédure d'inscription après approbation.
# Version 2.3 # Version 2.5
- Warning lors de la saisie d'un email vide - Reformatage du formulaire d'approbation pour mettre en avant les actions à réaliser par l'administrateur.
# Version 2.2 # Version 2.4
- Ajoute la gestion des profils - L'approbation par un administrateur initialise le pseudo avec l'id de l'utilisateur.
# Version 2.1 # Version 2.3
- N'envoie pas d'email lorsque le domaine est invalide. - Warning lors de la saisie d'un email vide
- Corrige la validation de domaines multiples séparés par des points virgules. # Version 2.2
# Version 2.0 - Ajoute la gestion des profils
# Version 2.1
- N'envoie pas d'email lorsque le domaine est invalide.
- Corrige la validation de domaines multiples séparés par des points virgules.
# Version 2.0
- trop de corrections. - trop de corrections.

View File

@ -1 +1 @@
{"name":"suscribe","realName":"Auto Inscription","version":"2.4","update":"0.0","delete":true,"dataDirectory":""} {"name":"suscribe","realName":"Auto Inscription","version":"2.6","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -1,9 +1,9 @@
<?php $moduleData['suscribe'] = [ <?php $moduleData['suscribe'] = [
'edit' => $this->getInput('profilAddSuscribeEdit', helper::FILTER_BOOLEAN), 'edit' => $this->getInput('profilAddSuscribeEdit', helper::FILTER_BOOLEAN),
'delete' => $this->getInput('profilAddSuscribeDelete', helper::FILTER_BOOLEAN), 'delete' => $this->getInput('profilAddSuscribeDelete', helper::FILTER_BOOLEAN),
'user' => $this->getInput('profilAddSuscribeUser', helper::FILTER_BOOLEAN), 'user' => $this->getInput('profilAddSuscribeUser', helper::FILTER_BOOLEAN),
'config' => $this->getInput('profilAddSuscribeAdd', helper::FILTER_BOOLEAN) || 'config' => $this->getInput('profilAddSuscribeAdd', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddSuscribeEdit', helper::FILTER_BOOLEAN) || $this->getInput('profilAddSuscribeEdit', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddSuscribeDelete', helper::FILTER_BOOLEAN) || $this->getInput('profilAddSuscribeDelete', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddSuscribeUser', helper::FILTER_BOOLEAN) $this->getInput('profilAddSuscribeUser', helper::FILTER_BOOLEAN)
]; ];

View File

@ -1,9 +1,9 @@
<?php $moduleData['suscribe'] = [ <?php $moduleData['suscribe'] = [
'edit' => $this->getInput('profilEditSuscribeEdit', helper::FILTER_BOOLEAN), 'edit' => $this->getInput('profilEditSuscribeEdit', helper::FILTER_BOOLEAN),
'delete' => $this->getInput('profilEditSuscribeDelete', helper::FILTER_BOOLEAN), 'delete' => $this->getInput('profilEditSuscribeDelete', helper::FILTER_BOOLEAN),
'user' => $this->getInput('profilEditSuscribeUser', helper::FILTER_BOOLEAN), 'user' => $this->getInput('profilEditSuscribeUser', helper::FILTER_BOOLEAN),
'config' => $this->getInput('profilEditSuscribeAdd', helper::FILTER_BOOLEAN) || 'config' => $this->getInput('profilEditSuscribeAdd', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditSuscribeEdit', helper::FILTER_BOOLEAN) || $this->getInput('profilEditSuscribeEdit', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditSuscribeDelete', helper::FILTER_BOOLEAN) || $this->getInput('profilEditSuscribeDelete', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditSuscribeUser', helper::FILTER_BOOLEAN) $this->getInput('profilEditSuscribeUser', helper::FILTER_BOOLEAN)
]; ];

View File

@ -1,20 +1,20 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4> <h4>
<?php echo sprintf('%s %s', helper::translate('Permissions'), helper::translate('Auto-inscription')); ?> <?php echo sprintf('%s %s', helper::translate('Permissions'), helper::translate('Auto-inscription')); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::checkbox('profilAddSuscribeEdit', true, 'Éditer inscription'); ?> <?php echo template::checkbox('profilAddSuscribeEdit', true, 'Éditer inscription'); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::checkbox('profilAddSuscribeDelete', true, 'Effacer inscription'); ?> <?php echo template::checkbox('profilAddSuscribeDelete', true, 'Effacer inscription'); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::checkbox('profilAddSuscribeUser', true, 'Valider inscriptions'); ?> <?php echo template::checkbox('profilAddSuscribeUser', true, 'Valider inscriptions'); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,26 +1,26 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4> <h4>
<?php echo sprintf('%s %s', helper::translate('Permissions'), helper::translate('Auto-inscription')); ?>· <?php echo sprintf('%s %s', helper::translate('Permissions'), helper::translate('Auto-inscription')); ?>·
</h4> </h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::checkbox('profilEditSuscribeEdit', true, 'Éditer inscription', [ <?php echo template::checkbox('profilEditSuscribeEdit', true, 'Éditer inscription', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'edit']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'edit'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::checkbox('profilEditSuscribeDelete', true, 'Effacer inscription', [ <?php echo template::checkbox('profilEditSuscribeDelete', true, 'Effacer inscription', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'delete']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'delete'])
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3">
<?php echo template::checkbox('profilEditSuscribeUser', true, 'Valider inscriptions', [ <?php echo template::checkbox('profilEditSuscribeUser', true, 'Valider inscriptions', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'user']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'user'])
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,21 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */
textarea .editorWysiwyg { textarea .editorWysiwyg {
height : 100px; height : 100px;
} }

View File

@ -1,103 +1,103 @@
<?php echo template::formOpen('registrationConfig'); ?> <?php echo template::formOpen('registrationConfig'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('registrationConfigBack', [ <?php echo template::button('registrationConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>
<div class="col2 offset7"> <div class="col2 offset7">
<?php echo template::button('registrationConfigBack', [ <?php echo template::button('registrationConfigBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/users', 'href' => helper::baseUrl() . $this->getUrl(0) . '/users',
'value' => 'Inscriptions' 'value' => 'Inscriptions'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">
<?php echo template::submit('registrationConfigSubmit', [ <?php echo template::submit('registrationConfigSubmit', [
'class' => 'green' 'class' => 'green'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Paramètres</h4> <h4>Paramètres</h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('registrationConfigLayout', $module::$layout, [ <?php echo template::select('registrationConfigLayout', $module::$layout, [
'label' => 'Disposition', 'label' => 'Disposition',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('registrationConfigSuccess', helper::arraycollumn($this->getData(['page']), 'title', 'SORT_ASC'), [ <?php echo template::select('registrationConfigSuccess', helper::arraycollumn($this->getData(['page']), 'title', 'SORT_ASC'), [
'label' => 'Redirection après confirmation', 'label' => 'Redirection après confirmation',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageSuccess']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageSuccess'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('registrationConfigError', helper::arraycollumn($this->getData(['page']), 'title', 'SORT_ASC'), [ <?php echo template::select('registrationConfigError', helper::arraycollumn($this->getData(['page']), 'title', 'SORT_ASC'), [
'label' => 'Redirection après erreur', 'label' => 'Redirection après erreur',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageError']) 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageError'])
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Communication</h4> <h4>Communication</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::select('registrationConfigTimeOut', $module::$timeLimit, [ <?php echo template::select('registrationConfigTimeOut', $module::$timeLimit, [
'label' => 'Validité du lien', 'label' => 'Validité du lien',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeOut']) / 60 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeOut']) / 60
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::text('registrationConfigFilter', [ <?php echo template::text('registrationConfigFilter', [
'label' => 'Domaines acceptés', 'label' => 'Domaines acceptés',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'filter']), 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'filter']),
'help' => 'Champ vide sinon limitation à des domaines spécifiques, le séparateur est ;' 'help' => 'Champ vide sinon limitation à des domaines spécifiques, le séparateur est ;'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php $messageDefault = '<p>Confirmez votre inscription en cliquant sur ce lien dans les ... minutes.</p>'; ?> <?php $messageDefault = '<p>Confirmez votre inscription en cliquant sur ce lien dans les ... minutes.</p>'; ?>
<?php echo template::textarea('registrationconfigMailRegisterContent', [ <?php echo template::textarea('registrationconfigMailRegisterContent', [
'label' => 'Corps du mail de confirmation', 'label' => 'Corps du mail de confirmation',
'value' => !empty($this->getData(['module', $this->getUrl(0), 'config', 'mailRegisterContent'])) ? $this->getData(['module', $this->getUrl(0), 'config', 'mailRegisterContent']) : $messageDefault, 'value' => !empty($this->getData(['module', $this->getUrl(0), 'config', 'mailRegisterContent'])) ? $this->getData(['module', $this->getUrl(0), 'config', 'mailRegisterContent']) : $messageDefault,
'class' => 'editorWysiwyg', 'class' => 'editorWysiwyg',
'help' => 'Précisez la durée de validité. Le lien sera inséré après ces explications.' 'help' => 'Précisez la durée de validité. Le lien sera inséré après ces explications.'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6 verticalAlignMiddle"> <div class="col6 verticalAlignMiddle">
<?php echo template::checkbox('registrationConfigState', true, 'Approbation préalable', [ <?php echo template::checkbox('registrationConfigState', true, 'Approbation préalable', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'approval']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'approval']),
'help' => 'Les comptes sont inactifs tant que les inscriptions ne sont pas approuvées par un administrateur.', 'help' => 'Les comptes sont inactifs tant que les inscriptions ne sont pas approuvées par un administrateur.',
'check' => true 'check' => true
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php $messageDefault = '<p>Votre inscription a été approuvée par un administrateur.</p>'; ?> <?php $messageDefault = '<p>Votre inscription a été approuvée par un administrateur.</p>'; ?>
<?php echo template::textarea('registrationconfigMailValidateContent', [ <?php echo template::textarea('registrationconfigMailValidateContent', [
'label' => 'Corps du mail d\'approbation', 'label' => 'Corps du mail d\'approbation',
'value' => !empty($this->getData(['module', $this->getUrl(0), 'config', 'mailValidateContent'])) ? $this->getData(['module', $this->getUrl(0), 'config', 'mailValidateContent']) : $messageDefault, 'value' => !empty($this->getData(['module', $this->getUrl(0), 'config', 'mailValidateContent'])) ? $this->getData(['module', $this->getUrl(0), 'config', 'mailValidateContent']) : $messageDefault,
'class' => 'editorWysiwyg' 'class' => 'editorWysiwyg'
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<div class="moduleVersion">Version <?php echo $module::VERSION; ?> <div class="moduleVersion">Version <?php echo $module::VERSION; ?>
</div> </div>

View File

@ -1,21 +1,21 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */
#registrationUserEditProfil1Wrapper, #registrationUserEditProfil1Wrapper,
#registrationUserEditProfil2Wrapper { #registrationUserEditProfil2Wrapper {
padding: 0; padding: 0;
} }

View File

@ -1,31 +1,31 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/** /**
* Droits des groupes * Droits des groupes
*/ */
$(document).ready(function () { $(document).ready(function () {
$(".registrationUserEditGroupProfil").hide(); $(".registrationUserEditGroupProfil").hide();
$(".registrationUserCommentProfil").hide(); $(".registrationUserCommentProfil").hide();
$("#registrationUserEditGroupProfil" + $("#registrationUserEditGroup").val()).show(); $("#registrationUserEditGroupProfil" + $("#registrationUserEditGroup").val()).show();
$("#registrationUserCommentProfil" + $("#registrationUserEditGroup").val()).show(); $("#registrationUserCommentProfil" + $("#registrationUserEditGroup").val()).show();
$("#registrationUserEditGroup").on("change", function () { $("#registrationUserEditGroup").on("change", function () {
$(".registrationUserEditGroupProfil").hide(); $(".registrationUserEditGroupProfil").hide();
$(".registrationUserCommentProfil").hide(); $(".registrationUserCommentProfil").hide();
$("#registrationUserEditGroupProfil" + $(this).val()).show(); $("#registrationUserEditGroupProfil" + $(this).val()).show();
$("#registrationUserCommentProfil" + $(this).val()).show(); $("#registrationUserCommentProfil" + $(this).val()).show();
}); });
}); });

View File

@ -1,140 +1,148 @@
<?php echo template::formOpen('registrationUserEditForm'); ?> <?php echo template::formOpen('registrationUserEditForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('registrationUserEditBack', [ <?php echo template::button('registrationUserEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->geturl(0) . '/users', 'href' => helper::baseUrl() . $this->geturl(0) . '/users',
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>
<div class="col2 offset9"> <div class="col2 offset9">
<?php echo template::submit('registrationUserEditSubmit', [ <?php echo template::submit('registrationUserEditSubmit', [
'class' => 'green' 'class' => 'green'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Confirmation de l'inscription</h4> <h4>Approbation de l'inscription</h4>
<div class="row"> <div class="row">
<div class="col12"> <div class="col4">
<div class="row"> <?php echo template::text('registrationUserLabel', [
<div class="col6"> 'label' => 'Étiquettes',
<?php echo template::text('registrationUserEditFirstname', [ 'help' => 'Les étiquettes sont séparées par des espaces',
'autocomplete' => 'off', ]); ?>
'label' => 'Prénom', </div>
'value' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'firstname']), <div class="col4">
'disabled' => true <?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
]); ?> <?php echo template::select('registrationUserEditGroup', $module::$groups, [
</div> 'disabled' => ($this->getUrl(2) === $this->getUser('id')),
<div class="col6"> 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
<?php echo template::text('registrationUserEditLastname', [ 'label' => 'Groupe',
'autocomplete' => 'off', 'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status'])
'label' => 'Nom', ]); ?>
'value' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'lastname']), <?php endif; ?>
'disabled' => true </div>
]); ?> <div class="col4">
</div> <div class="registrationUserEditGroupProfil"
</div> id="registrationUserEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<div class="row"> <?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
<div class="col12"> 'label' => 'Profil',
<?php echo template::mail('registrationUserEditMail', [ 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'autocomplete' => 'off', 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
'label' => 'Adresse électronique', ]); ?>
'value' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'mail']), </div>
'disabled' => true <div class="registrationUserEditGroupProfil"
]); ?> id="registrationUserEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
</div> <?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
</div> 'label' => 'Profil',
<div class="row"> 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
<div class="col8"> 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
<?php echo template::text('registrationUserState', [ ]); ?>
'label' => 'État de l\'inscription', </div>
'value' => $module::$statusGroups[$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'status'])], </div>
'disabled' => true, <div class="row">
'help' => 'En attente : le mail n\'a pas encore été validé<br>Email validé : approbation nécessaire.' <div class="col12">
]); ?> <div id="registrationUserCommentProfil<?php echo self::GROUP_MEMBER; ?>"
</div> class="col12 registrationUserCommentProfil">
<div class="col4"> <?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_MEMBER, [
<?php echo template::text('registrationUsertimer', [ 'label' => 'Commentaire',
'label' => 'Date de demande', 'value' => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]),
'value' => helper::dateUTF8(date('Y-m-d G:i'), $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'timer'])), 'readonly' => true,
'disabled' => true
]); ?> ]);
</div> ?>
</div> </div>
</div> <div id="registrationUserCommentProfil<?php echo self::GROUP_EDITOR; ?>"
</div> class="col12 registrationUserCommentProfil">
<div class="row"> <?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_EDITOR, [
<div class="col4"> 'label' => 'Commentaire',
<?php echo template::text('registrationUserLabel', [ 'value' => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]),
'label' => 'Étiquette' 'readonly' => true,
]); ?>
</div> ]);
<div class="col4"> ?>
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?> </div>
<?php echo template::select('registrationUserEditGroup', $module::$groups, [ <div id="registrationUserCommentProfil<?php echo self::GROUP_ADMIN; ?>"
'disabled' => ($this->getUrl(2) === $this->getUser('id')), class="col12 registrationUserCommentProfil">
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''), <?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Groupe', 'label' => 'Commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status']) 'value' => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]),
]); ?> 'readonly' => true,
<?php endif; ?> ]);
</div> ?>
<div class="col4"> </div>
<div class="registrationUserEditGroupProfil" </div>
id="registrationUserEditGroupProfil<?php echo self::GROUP_MEMBER; ?>"> </div>
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [ </div>
'label' => 'Profil', </div>
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), </div>
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, </div>
]); ?> <div class="row">
</div> <div class="col12">
<div class="registrationUserEditGroupProfil" <div class="block">
id="registrationUserEditGroupProfil<?php echo self::GROUP_EDITOR; ?>"> <h4>Identité du compte</h4>
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [ <div class="row">
'label' => 'Profil', <div class="col12">
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), <div class="row">
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, <div class="col6">
]); ?> <?php echo template::text('registrationUserEditFirstname', [
</div> 'autocomplete' => 'off',
</div> 'label' => 'Prénom',
<div class="row"> 'value' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'firstname']),
<div class="col12"> 'disabled' => true
<div id="registrationUserCommentProfil<?php echo self::GROUP_MEMBER; ?>" ]); ?>
class="col12 registrationUserCommentProfil"> </div>
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_MEMBER, [ <div class="col6">
'label' => 'Commentaire', <?php echo template::text('registrationUserEditLastname', [
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]), 'autocomplete' => 'off',
'readonly' => true, 'label' => 'Nom',
'value' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'lastname']),
]); 'disabled' => true
?> ]); ?>
</div> </div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_EDITOR; ?>" </div>
class="col12 registrationUserCommentProfil"> <div class="row">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_EDITOR, [ <div class="col12">
'label' => 'Commentaire', <?php echo template::mail('registrationUserEditMail', [
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]), 'autocomplete' => 'off',
'readonly' => true, 'label' => 'Adresse électronique',
'value' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'mail']),
]); 'disabled' => true
?> ]); ?>
</div> </div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_ADMIN; ?>" </div>
class="col12 registrationUserCommentProfil"> <div class="row">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_ADMIN, [ <div class="col8">
'label' => 'Commentaire', <?php echo template::text('registrationUserState', [
'value' => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]), 'label' => 'État de l\'inscription',
'readonly' => true, 'value' => $module::$statusGroups[$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'status'])],
]); 'disabled' => true,
?> 'help' => 'En attente : le mail n\'a pas encore été validé<br>Email validé : approbation nécessaire.'
</div> ]); ?>
</div> </div>
</div> <div class="col4">
</div> <?php echo template::text('registrationUsertimer', [
</div> 'label' => 'Date de demande',
</div> 'value' => helper::dateUTF8(date('Y-m-d G:i'), $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'timer'])),
</div> 'disabled' => true
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>

View File

@ -1,37 +1,37 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
.inputRowContainer1, .inputRowContainer1,
.inputRowContainer2, .inputRowContainer2,
.inputRowContainer4, .inputRowContainer4,
.inputColContainer { .inputColContainer {
display: grid; display: grid;
gap: 10px; /* Espacement entre les inputs */ gap: 10px; /* Espacement entre les inputs */
} }
/* En lignes */ /* En lignes */
.inputRowContainer1 { .inputRowContainer1 {
grid-template-columns: repeat(1, 1fr); /* 3 colonnes de largeur égale */ grid-template-columns: repeat(1, 1fr); /* 3 colonnes de largeur égale */
} }
.inputRowContainer2 { .inputRowContainer2 {
grid-template-columns: repeat(2, 1fr); /* 3 colonnes de largeur égale */ grid-template-columns: repeat(2, 1fr); /* 3 colonnes de largeur égale */
} }
.inputRowContainer4 { .inputRowContainer4 {
grid-template-columns: repeat(4, 1fr); /* 3 colonnes de largeur égale */ grid-template-columns: repeat(4, 1fr); /* 3 colonnes de largeur égale */
} }
.inputColContainer { .inputColContainer {
grid-template-rows: repeat(50px, auto); /* 3 rangées ajustées à la hauteur des contenus */ grid-template-rows: repeat(50px, auto); /* 3 rangées ajustées à la hauteur des contenus */
} }

View File

@ -1,47 +1,47 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/** /**
* Affichage de l'id en simulant FILTER_ID * Affichage de l'id en simulant FILTER_ID
*/ */
$("#registrationAddId").on("change keydown keyup", function(event) { $("#registrationAddId").on("change keydown keyup", function(event) {
var userId = $(this).val(); var userId = $(this).val();
if( if(
event.keyCode !== 8 // BACKSPACE event.keyCode !== 8 // BACKSPACE
&& event.keyCode !== 37 // LEFT && event.keyCode !== 37 // LEFT
&& event.keyCode !== 39 // RIGHT && event.keyCode !== 39 // RIGHT
&& event.keyCode !== 46 // DELETE && event.keyCode !== 46 // DELETE
&& window.getSelection().toString() !== userId // Texte sélectionné && window.getSelection().toString() !== userId // Texte sélectionné
) { ) {
var searchReplace = { var searchReplace = {
"á": "a", "à": "a", "â": "a", "ä": "a", "ã": "a", "å": "a", "ç": "c", "é": "e", "è": "e", "ê": "e", "ë": "e", "í": "i", "ì": "i", "î": "i", "ï": "i", "ñ": "n", "ó": "o", "ò": "o", "ô": "o", "ö": "o", "õ": "o", "ú": "u", "ù": "u", "û": "u", "ü": "u", "ý": "y", "ÿ": "y", "á": "a", "à": "a", "â": "a", "ä": "a", "ã": "a", "å": "a", "ç": "c", "é": "e", "è": "e", "ê": "e", "ë": "e", "í": "i", "ì": "i", "î": "i", "ï": "i", "ñ": "n", "ó": "o", "ò": "o", "ô": "o", "ö": "o", "õ": "o", "ú": "u", "ù": "u", "û": "u", "ü": "u", "ý": "y", "ÿ": "y",
"Á": "A", "À": "A", "Â": "A", "Ä": "A", "Ã": "A", "Å": "A", "Ç": "C", "É": "E", "È": "E", "Ê": "E", "Ë": "E", "Í": "I", "Ì": "I", "Î": "I", "Ï": "I", "Ñ": "N", "Ó": "O", "Ò": "O", "Ô": "O", "Ö": "O", "Õ": "O", "Ú": "U", "Ù": "U", "Û": "U", "Ü": "U", "Ý": "Y", "Ÿ": "Y", "Á": "A", "À": "A", "Â": "A", "Ä": "A", "Ã": "A", "Å": "A", "Ç": "C", "É": "E", "È": "E", "Ê": "E", "Ë": "E", "Í": "I", "Ì": "I", "Î": "I", "Ï": "I", "Ñ": "N", "Ó": "O", "Ò": "O", "Ô": "O", "Ö": "O", "Õ": "O", "Ú": "U", "Ù": "U", "Û": "U", "Ü": "U", "Ý": "Y", "Ÿ": "Y",
"'": "-", "\"": "-", " ": "-" "'": "-", "\"": "-", " ": "-"
}; };
userId = userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/ig, function(match) { userId = userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/ig, function(match) {
return searchReplace[match]; return searchReplace[match];
}); });
userId = userId.replace(/[^a-z0-9-]/ig, ""); userId = userId.replace(/[^a-z0-9-]/ig, "");
$(this).val(userId); $(this).val(userId);
} }
}); });
/** /**
* Droits des groupes * Droits des groupes
*/ */
$("#registrationAddGroup").on("change", function() { $("#registrationAddGroup").on("change", function() {
$(".registrationAddGroupDescription").hide(); $(".registrationAddGroupDescription").hide();
$("#registrationAddGroupDescription" + $(this).val()).show(); $("#registrationAddGroupDescription" + $(this).val()).show();
}).trigger("change"); }).trigger("change");

View File

@ -1,29 +1,29 @@
<?php echo template::formOpen('registrationAddForm'); ?> <?php echo template::formOpen('registrationAddForm'); ?>
<div class="<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'layout']); ?>"> <div class="<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'layout']); ?>">
<?php echo template::text('registrationAddFirstname', [ <?php echo template::text('registrationAddFirstname', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Prénom' 'label' => 'Prénom'
]); ?> ]); ?>
<?php echo template::text('registrationAddLastname', [ <?php echo template::text('registrationAddLastname', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Nom' 'label' => 'Nom'
]); ?> ]); ?>
<?php echo template::text('registrationAddId', [ <?php echo template::text('registrationAddId', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Identifiant de connexion' 'label' => 'Identifiant de connexion'
]); ?> ]); ?>
<?php echo template::mail('registrationAddMail', [ <?php echo template::mail('registrationAddMail', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Adresse électronique' 'label' => 'Adresse électronique'
]); ?> ]); ?>
</div> </div>
<div class='submitContainer'> <div class='submitContainer'>
<div class="row"> <div class="row">
<div class="col2 offset10"> <div class="col2 offset10">
<?php echo template::submit('registrationAddSubmit', [ <?php echo template::submit('registrationAddSubmit', [
'value' => 'Envoyer' 'value' => 'Envoyer'
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>

View File

@ -1,17 +1,17 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * admin.css
*/ */

View File

@ -1,21 +1,21 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/** /**
* Confirmation de suppression * Confirmation de suppression
*/ */
$(".registrationUserDelete").on("click", function() { $(".registrationUserDelete").on("click", function() {
var _this = $(this); var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cet utilisateur ?", function() { return core.confirm("Êtes-vous sûr de vouloir supprimer cet utilisateur ?", function() {
$(location).attr("href", _this.attr("href")); $(location).attr("href", _this.attr("href"));
}); });
}); });

View File

@ -1,15 +1,15 @@
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('registrationUserBack', [ <?php echo template::button('registrationUserBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>
</div> </div>
<?php if($module::$users): ?> <?php if($module::$users): ?>
<?php echo template::table([3, 3, 2,21, 1, 1], $module::$users, ['Identifiant', 'Nom', 'Etat', 'Date', '', '']); ?> <?php echo template::table([3, 3, 2,21, 1, 1], $module::$users, ['Identifiant', 'Nom', 'Etat', 'Date', '', '']); ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Pas d\'inscription en attente.'); ?> <?php echo template::speech('Pas d\'inscription en attente.'); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -1,34 +1,34 @@
/** /**
* This file is part of Zwii. * This file is part of Zwii.
* *
* For full copyright and license information, please see the LICENSE * For full copyright and license information, please see the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
* *
* @author Rémi Jean <remi.jean@outlook.com> * @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com> * @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez * @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
.inputRowContainer1, .inputRowContainer1,
.inputRowContainer2, .inputRowContainer2,
.inputRowContainer4, .inputRowContainer4,
.inputColContainer { .inputColContainer {
display: grid; display: grid;
gap: 10px; gap: 10px;
} }
/* En lignes */ /* En lignes */
.inputRowContainer1 { .inputRowContainer1 {
grid-template-columns: repeat(1, 1fr); grid-template-columns: repeat(1, 1fr);
} }
.inputRowContainer2 { .inputRowContainer2 {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }
.inputRowContainer4 { .inputRowContainer4 {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }

View File

@ -1,23 +1,23 @@
<?php echo template::formOpen('registrationValidForm'); ?> <?php echo template::formOpen('registrationValidForm'); ?>
<h3>Email confirmé</h3> <h3>Email confirmé</h3>
<div class="<?php echo $this->getData(['module',$this->getUrl(0),'config','layout']); ?>"> <div class="<?php echo $this->getData(['module',$this->getUrl(0),'config','layout']); ?>">
<?php echo template::password('registrationValidPassword', [ <?php echo template::password('registrationValidPassword', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Mot de passe' 'label' => 'Mot de passe'
]); ?> ]); ?>
<?php echo template::password('registrationValidConfirmPassword', [ <?php echo template::password('registrationValidConfirmPassword', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Confirmation du mot de passe' 'label' => 'Confirmation du mot de passe'
]); ?> ]); ?>
</div> </div>
<div class='submitContainer'> <div class='submitContainer'>
<div class="row"> <div class="row">
<div class="col2 offset10"> <div class="col2 offset10">
<?php echo template::submit('registrationValidSubmit', [ <?php echo template::submit('registrationValidSubmit', [
'value' => 'Envoyer', 'value' => 'Envoyer',
'class' => 'green' 'class' => 'green'
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>