diff --git a/core/module/course/course.php b/core/module/course/course.php index 0911cb6..a35a021 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -29,6 +29,7 @@ class course extends common 'user' => self::GROUP_ADMIN, 'userAdd' => self::GROUP_ADMIN, 'userDelete' => self::GROUP_ADMIN, + 'userDeleteAll' => self::GROUP_ADMIN, ]; public static $courseAccess = [ @@ -430,6 +431,30 @@ class course extends common } } + /** + * Désinscription de tous les utilisateurs + */ + public function userDeleteAll() + { + // Accès refusé + if ( + $this->getUser('permission', __CLASS__, __FUNCTION__) !== true + ) { + // Valeurs en sortie + $this->addOutput([ + 'access' => false + ]); + } else { + $this->setData(['enrolment', $this->getUrl(2), array()]); + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . 'course/user/' . $this->getUrl(2), + 'notification' => helper::translate('Cours réinitialisé'), + 'state' => true + ]); + } + } + /* * Traitement du changement de langue */ diff --git a/core/module/course/view/user/user.js.php b/core/module/course/view/user/user.js.php index edc1f1f..09ce1a7 100644 --- a/core/module/course/view/user/user.js.php +++ b/core/module/course/view/user/user.js.php @@ -10,4 +10,15 @@ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @link http://zwiicms.fr/ */ -$(".userDelete").on("click", (function () { var _this = $(this); return message = "", core.confirm(message, (function () { $(location).attr("href", _this.attr("href")) })) })); \ No newline at end of file +(".userDelete").on("click", (function() { + var _this = $(this); + return message = "", core.confirm(message, (function() { + $(location).attr("href", _this.attr("href")) + })) +})); +(".userDeleteAll").on("click", (function() { + var _this = $(this); + return message = "", core.confirm(message, (function() { + $(location).attr("href", _this.attr("href")) + })) +})); \ No newline at end of file diff --git a/core/module/course/view/user/user.php b/core/module/course/view/user/user.php index a543ccb..6f5f43c 100644 --- a/core/module/course/view/user/user.php +++ b/core/module/course/view/user/user.php @@ -6,17 +6,24 @@ 'value' => template::ico('left') ]); ?> -