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 @@
- 'buttonGrey', 'href' => helper::baseUrl() . 'course', 'value' => template::ico('left') ]); ?>
- 'buttonGreen', 'href' => helper::baseUrl() . 'course/categoryAdd', 'value' => template::ico('plus') diff --git a/core/module/course/view/index/index.php b/core/module/course/view/index/index.php index 3caf7c7..39e1db4 100644 --- a/core/module/course/view/index/index.php +++ b/core/module/course/view/index/index.php @@ -6,14 +6,7 @@ 'value' => template::ico('left') ]); ?>
-
- helper::baseUrl() . 'course/user', - 'value' => template::ico('users'), - 'help' => 'Etudiants inscrits' - ]); ?> -
-
+
helper::baseUrl() . 'course/category', 'value' => template::ico('table'), @@ -29,7 +22,7 @@
- + diff --git a/core/module/course/view/user/user.php b/core/module/course/view/user/user.php index e69de29..50836d9 100644 --- a/core/module/course/view/user/user.php +++ b/core/module/course/view/user/user.php @@ -0,0 +1,22 @@ +
+
+ 'buttonGrey', + 'href' => helper::baseUrl() . 'course', + 'value' => template::ico('left') + ]); ?> +
+
+ 'buttonGreen', + 'href' => helper::baseUrl() . 'course/userAdd', + 'value' => template::ico('plus') + ]); ?> +
+
+ + + + + + \ No newline at end of file diff --git a/core/module/course/view/userAdd/userAdd.css b/core/module/course/view/userAdd/userAdd.css new file mode 100644 index 0000000..ec84629 --- /dev/null +++ b/core/module/course/view/userAdd/userAdd.css @@ -0,0 +1,18 @@ +/** + * This file is part of Zwii. + * + * For full copyright and license information, please see the LICENSE + * file that was distributed with this source code. + * + * @author Rémi Jean + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @copyright Copyright (C) 2018-2023, Frédéric Tempez + * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International + * @link http://zwiicms.fr/ + */ + + +/** NE PAS EFFACER +* admin.css +*/ \ No newline at end of file diff --git a/core/module/course/view/userAdd/userAdd.php b/core/module/course/view/userAdd/userAdd.php new file mode 100644 index 0000000..fdb8e1c --- /dev/null +++ b/core/module/course/view/userAdd/userAdd.php @@ -0,0 +1,22 @@ + +
+
+ 'buttonGrey', + 'href' => helper::baseUrl() . 'course', + 'value' => template::ico('left') + ]); ?> +
+
+ +
+
+
+
+
+

+ +

+
+
+
\ No newline at end of file