From 052280f728c22060845c331ff8874e11129ea562 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 21 Oct 2023 13:55:14 +0200 Subject: [PATCH] v52 bette datatables --- core/core.php | 2 +- core/module/course/course.php | 8 ++++-- core/module/course/view/index/index.js.php | 27 +++++++++++++++++++ core/module/course/view/index/index.php | 2 +- core/module/course/view/user/user.js.php | 1 + core/module/course/view/user/user.php | 2 +- .../course/view/userHistory/userHistory.php | 2 +- 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/core/core.php b/core/core.php index bdfa6f0..78a2447 100644 --- a/core/core.php +++ b/core/core.php @@ -50,7 +50,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '1.0.51'; + const ZWII_VERSION = '1.0.52'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/lms/'; diff --git a/core/module/course/course.php b/core/module/course/course.php index b9df5d8..0aa4571 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -108,7 +108,10 @@ class course extends common // Valeurs en sortie $this->addOutput([ 'title' => helper::translate('Cours'), - 'view' => 'index' + 'view' => 'index', + 'vendor' => [ + 'datatables' + ] ]); } @@ -423,6 +426,7 @@ class course extends common foreach ($data['page'] as $pageId => $pageData) { if ($pageData['position'] > 0) { $sumPages++; + $pages[$pageId] = $pageData['title']; } } @@ -474,7 +478,7 @@ class course extends common self::$courseUsers[] = [ $userId, $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']), - $pageId, + $pages[$pageId], helper::dateUTF8('%d %B %Y - %H:%M', $maxTime), template::button('userHistory' . $userId, [ 'href' => helper::baseUrl() . 'course/userHistory/' . $courseId . '/' . $userId, diff --git a/core/module/course/view/index/index.js.php b/core/module/course/view/index/index.js.php index bbd1649..b6145fb 100644 --- a/core/module/course/view/index/index.js.php +++ b/core/module/course/view/index/index.js.php @@ -22,4 +22,31 @@ $(document).ready(function () { $(location).attr("href", _this.attr("href")); }); }); + $('#dataTables').DataTable({ + language: { + url: "core/vendor/datatables/french.json" + }, + "columnDefs": [ + { + target: 3, + orderable: false, + searchable: false + }, + { + target: 4, + orderable: false, + searchable: false + }, + { + target: 5, + orderable: false, + searchable: false + }, + { + target: 6, + orderable: false, + searchable: false + } + ] + }); }); \ No newline at end of file diff --git a/core/module/course/view/index/index.php b/core/module/course/view/index/index.php index 39e1db4..5579a67 100644 --- a/core/module/course/view/index/index.php +++ b/core/module/course/view/index/index.php @@ -22,7 +22,7 @@ - + 'dataTables']); ?> diff --git a/core/module/course/view/user/user.js.php b/core/module/course/view/user/user.js.php index d91a3b9..7818d67 100644 --- a/core/module/course/view/user/user.js.php +++ b/core/module/course/view/user/user.js.php @@ -35,6 +35,7 @@ $(document).ready((function () { "columnDefs": [ { target: 5, + orderable: false, searchable: false } ] diff --git a/core/module/course/view/user/user.php b/core/module/course/view/user/user.php index 65ef228..bdffab2 100644 --- a/core/module/course/view/user/user.php +++ b/core/module/course/view/user/user.php @@ -40,7 +40,7 @@ - 'dataTables']); ?> + 'dataTables']); ?> \ No newline at end of file diff --git a/core/module/course/view/userHistory/userHistory.php b/core/module/course/view/userHistory/userHistory.php index 06ca9ed..b41abe8 100644 --- a/core/module/course/view/userHistory/userHistory.php +++ b/core/module/course/view/userHistory/userHistory.php @@ -10,7 +10,7 @@
- 'dataTables']); ?> + 'dataTables']); ?>