diff --git a/core/module/course/course.php b/core/module/course/course.php index 33c403c..59bc9fa 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -27,6 +27,7 @@ class course extends common 'categoryAdd' => self::GROUP_ADMIN, 'categoryDelete' => self::GROUP_ADMIN, 'user' => self::GROUP_ADMIN, + 'userAdd' => self::GROUP_ADMIN, ]; public static $courseAccess = [ @@ -46,6 +47,8 @@ class course extends common public static $courseCategories = []; + public static $courseUsers = []; + public static $courses = []; public static $swapMessage = []; @@ -69,6 +72,11 @@ class course extends common $author, $description, '' . $categorieUrl . '', + template::button('categoryUser' . $courseId, [ + 'href' => helper::baseUrl() . 'course/user/' . $courseId, + 'value' => template::ico('users'), + 'help' => 'Inscrits' + ]), template::button('courseEdit' . $courseId, [ 'href' => helper::baseUrl() . 'course/edit/' . $courseId, 'value' => template::ico('pencil'), @@ -295,7 +303,7 @@ class course extends common } // Valeurs en sortie $this->addOutput([ - 'title' => helper::translate('Catégorie'), + 'title' => helper::translate('Catégorie de cours'), 'view' => 'category' ]); } @@ -351,6 +359,41 @@ class course extends common ]); } + public function user() + { + $users = $this->getData(['enrolment', $this->getUrl(2)]); + ksort($users); + foreach ($users as $userId => $userValue) { + self::$courseUsers[] = [ + $userId, + $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']), + $userValue['lastPageId'], + helper::dateUTF8('%d %B %Y - %H:%M',$userValue['lastDateVisited']), + template::button('courseDelete' . $userId, [ + 'class' => 'categoryDelete buttonRed', + 'href' => helper::baseUrl() . 'course/categoryDelete/' . $userId, + 'value' => template::ico('trash'), + 'help' => 'Supprimer' + ]) + ]; + } + + // Valeurs en sortie + $this->addOutput([ + 'title' => helper::translate('Inscrits'), + 'view' => 'user' + ]); + } + + public function userAdd() + { + // Valeurs en sortie + $this->addOutput([ + 'title' => helper::translate('Inscrire'), + 'view' => 'userAdd' + ]); + } + /* * Traitement du changement de langue */ diff --git a/core/module/course/view/category/category.php b/core/module/course/view/category/category.php index 4d0cd9d..bff038b 100644 --- a/core/module/course/view/category/category.php +++ b/core/module/course/view/category/category.php @@ -1,13 +1,13 @@