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, 'swap' => self::GROUP_VISITOR,
'suscribe' => self::GROUP_VISITOR, 'suscribe' => self::GROUP_VISITOR,
'unsuscribe' => self::GROUP_MEMBER, 'unsuscribe' => self::GROUP_MEMBER,
'index' => self::GROUP_EDITOR, 'index' => self::GROUP_EDITOR, // Fait
'edit' => self::GROUP_EDITOR, 'edit' => self::GROUP_EDITOR, // Fait
'manage' => self::GROUP_EDITOR, 'manage' => self::GROUP_EDITOR, // Fait
'users' => self::GROUP_EDITOR, // fait 'users' => self::GROUP_EDITOR, // fait
'usersAdd' => self::GROUP_EDITOR, 'usersAdd' => self::GROUP_EDITOR,//Fait
'usersDelete' => self::GROUP_EDITOR, 'usersDelete' => self::GROUP_EDITOR,//Fait
'usersHistoryExport' => self::GROUP_EDITOR, //fait 'usersHistoryExport' => self::GROUP_EDITOR, //fait
'userDelete' => self::GROUP_EDITOR, 'userDelete' => self::GROUP_EDITOR, //Fait
'userHistory' => self::GROUP_EDITOR, 'userHistory' => self::GROUP_EDITOR, //Fait
'userHistoryExport' => self::GROUP_EDITOR, 'userHistoryExport' => self::GROUP_EDITOR, //Fait
'backup' => self::GROUP_EDITOR, 'backup' => self::GROUP_EDITOR, // Fait
'restore' => self::GROUP_EDITOR, 'restore' => self::GROUP_EDITOR, //Fait
'clone' => self::GROUP_ADMIN, 'clone' => self::GROUP_ADMIN,
'add' => self::GROUP_ADMIN, 'add' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN, 'delete' => self::GROUP_ADMIN,

View File

@ -712,6 +712,12 @@ class user extends common
'users' => $this->getInput('profilEditCourseUsers', helper::FILTER_BOOLEAN), 'users' => $this->getInput('profilEditCourseUsers', helper::FILTER_BOOLEAN),
'userHistory' => $this->getInput('profilEditCourseUserHistory', helper::FILTER_BOOLEAN), 'userHistory' => $this->getInput('profilEditCourseUserHistory', helper::FILTER_BOOLEAN),
'userHistoryExport' => $this->getInput('profilEditCourseUserExport', 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); $(".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 // Désactive les éléments liés au blog
if (!$("#profilEditBlogComment").prop("checked")) { if (!$("#profilEditBlogComment").prop("checked")) {
$(".blogEditCommentOptions").prop("disabled", true); $(".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 // Gérer l'évènement sur les commentaires du blog
$("#profilEditBlogComment").change(function () { $("#profilEditBlogComment").change(function () {
if (!$(this).is(':checked')) { if (!$(this).is(':checked')) {
$(".blogEditCommentOptions").slideUp(); $(".blogEditCommentOptions").slideUp();
} else { } else {
$('.blogEditCommentOptions input[type="checkbox"]').prop('checked', false); $('.blogEditCommentOptions input[type="checkbox"]').prop("disabled", true);
$(".blogEditCommentOptions").slideDown(); $(".blogEditCommentOptions").slideDown();
} }
}); });

View File

@ -92,47 +92,60 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div id="courseContainer">
<div class="row"> <div class="row">
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseEdit', true, 'Éditer', [ <?php echo template::checkbox('profilEditCourseEdit', true, 'Éditer un espace', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'edit']) '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>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUsers', true, 'Participants', [ <?php echo template::checkbox('profilEditCourseUsers', true, 'Lister participants', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'users']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'users']),
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserHistory', true, 'Historique participant', [ <?php echo template::checkbox('profilEditCourseUserHistory', true, 'Voir historique d\'un participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistory']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistory']),
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserHistoryExport', true, 'Exporter historique participant', [ <?php echo template::checkbox('profilEditCourseUserHistoryExport', true, 'Exporter historique d\'un participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistoryExport']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistoryExport']),
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUsers', true, 'Participants', [ <?php echo template::checkbox('profilEditCourseUserDelete', true, 'Désinscrire un participant', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'users']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userDelete']),
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserHistory', true, 'Historique participant', [ <?php echo template::checkbox('profilEditCourseUsersAdd', true, 'Inscrire en masse', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistory']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'usersAdd']),
]); ?> ]); ?>
</div> </div>
<div class="col3"> <div class="col3 courseOptions">
<?php echo template::checkbox('profilEditCourseUserHistoryExport', true, 'Cloner', [ <?php echo template::checkbox('profilEditCourseUsersDelete', true, 'Désinscrire en masse', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'userHistoryExport']) 'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'course', 'usersDelete']),
]); ?> ]); ?>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>