1.6.00 permissions pour le contrôle des espaces pour les éditeurs

This commit is contained in:
Fred Tempez 2024-02-13 12:51:17 +01:00
parent 0c8569f7cf
commit e9e39f5a03
4 changed files with 87 additions and 51 deletions

View File

@ -20,18 +20,18 @@ class course extends common
'swap' => self::GROUP_VISITOR,
'suscribe' => self::GROUP_VISITOR,
'unsuscribe' => self::GROUP_MEMBER,
'index' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'manage' => self::GROUP_EDITOR,
'index' => self::GROUP_EDITOR, // Fait
'edit' => self::GROUP_EDITOR, // Fait
'manage' => self::GROUP_EDITOR, // Fait
'users' => self::GROUP_EDITOR, // fait
'usersAdd' => self::GROUP_EDITOR,
'usersDelete' => self::GROUP_EDITOR,
'usersAdd' => self::GROUP_EDITOR,//Fait
'usersDelete' => self::GROUP_EDITOR,//Fait
'usersHistoryExport' => self::GROUP_EDITOR, //fait
'userDelete' => self::GROUP_EDITOR,
'userHistory' => self::GROUP_EDITOR,
'userHistoryExport' => self::GROUP_EDITOR,
'backup' => self::GROUP_EDITOR,
'restore' => self::GROUP_EDITOR,
'userDelete' => self::GROUP_EDITOR, //Fait
'userHistory' => self::GROUP_EDITOR, //Fait
'userHistoryExport' => self::GROUP_EDITOR, //Fait
'backup' => self::GROUP_EDITOR, // Fait
'restore' => self::GROUP_EDITOR, //Fait
'clone' => self::GROUP_ADMIN,
'add' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,

View File

@ -712,6 +712,12 @@ class user extends common
'users' => $this->getInput('profilEditCourseUsers', helper::FILTER_BOOLEAN),
'userHistory' => $this->getInput('profilEditCourseUserHistory', helper::FILTER_BOOLEAN),
'userHistoryExport' => $this->getInput('profilEditCourseUserExport', helper::FILTER_BOOLEAN),
'userAdd' => $this->getInput('profilEditCourseUserAdd', helper::FILTER_BOOLEAN),
'userDelete' => $this->getInput('profilEditCourseUserDelete', helper::FILTER_BOOLEAN),
'usersDelete' => $this->getInput('profilEditCourseUsersDelete', helper::FILTER_BOOLEAN),
'edit' => $this->getInput('profilEditCourseEdit', helper::FILTER_BOOLEAN),
'backup' => $this->getInput('profilEditCourseBackup', helper::FILTER_BOOLEAN),
'restore' => $this->getInput('profilEditCourseRestore', helper::FILTER_BOOLEAN),
]
];

View File

@ -18,6 +18,13 @@ $(document).ready(function () {
$(".filemanager").prop("disabled", true);
}
// Désactive les éléments liés aux espaces
if (!$("#profilEditCourseIndex").prop("checked")) {
$("#courseContainer").slideUp();
} else {
$("#courseContainer").slideDown();
}
// Désactive les éléments liés au blog
if (!$("#profilEditBlogComment").prop("checked")) {
$(".blogEditCommentOptions").prop("disabled", true);
@ -63,12 +70,22 @@ $(document).ready(function () {
}
});
// Gérer l'évènement sur les options des espaces
$("#profilEditCourseIndex").change(function () {
if (!$(this).is(':checked')) {
$('.courseOptions input[type="checkbox"]').prop('checked', false);
$("#courseContainer").slideUp();
} else {
$("#courseContainer").slideDown();
}
});
// Gérer l'évènement sur les commentaires du blog
$("#profilEditBlogComment").change(function () {
if (!$(this).is(':checked')) {
$(".blogEditCommentOptions").slideUp();
} else {
$('.blogEditCommentOptions input[type="checkbox"]').prop('checked', false);
$('.blogEditCommentOptions input[type="checkbox"]').prop("disabled", true);
$(".blogEditCommentOptions").slideDown();
}
});

View File

@ -27,9 +27,9 @@
'label' => 'Nom du profil',
'value' => helper::translate($this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'name']))
]); ?>
</div>
<div class="col6">
<?php echo template::select('profilEditProfil', $module::$profils, [
</div>
<div class="col6">
<?php echo template::select('profilEditProfil', $module::$profils, [
'label' => 'Hiérarchie',
'help' => 'Rang 9 > rang 1. Le profil de rang 1 n\'est pas modifiable.',
'selected' => $this->getUrl(3),
@ -92,46 +92,59 @@
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditCourseEdit', true, 'Éditer', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'edit'])
]); ?>
<div id="courseContainer">
<div class="row">
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseEdit', true, 'Éditer un espace', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'edit']),
]); ?>
</div>
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseBackup', true, 'Sauvegarder un espace', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'backup']),
]); ?>
</div>
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseRestore', true, 'Restaurer un espace', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'restore']),
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditCourseUsers', true, 'Participants', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'users'])
]); ?>
<div class="row">
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUsers', true, 'Lister participants', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'users']),
]); ?>
</div>
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserHistory', true, 'Voir historique d\'un participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistory']),
]); ?>
</div>
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserHistoryExport', true, 'Exporter historique d\'un participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistoryExport']),
]); ?>
</div>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditCourseUserHistory', true, 'Historique participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistory'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditCourseUserHistoryExport', true, 'Exporter historique participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistoryExport'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditCourseUsers', true, 'Participants', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'users'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditCourseUserHistory', true, 'Historique participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistory'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditCourseUserHistoryExport', true, 'Cloner', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistoryExport'])
]); ?>
<div class="row">
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserDelete', true, 'Désinscrire un participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userDelete']),
]); ?>
</div>
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUsersAdd', true, 'Inscrire en masse', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'usersAdd']),
]); ?>
</div>
<div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUsersDelete', true, 'Désinscrire en masse', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'usersDelete']),
]); ?>
</div>
</div>
</div>
</div>
</div>