v43 Historique de progression

This commit is contained in:
Fred Tempez 2023-10-18 14:04:07 +02:00
parent f11f57da29
commit 44856c03c6
5 changed files with 63 additions and 8 deletions

View File

@ -50,7 +50,7 @@ class common
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '1.0.42';
const ZWII_VERSION = '1.0.43';
// URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/lms/';

View File

@ -475,7 +475,10 @@ class course extends common
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
$pageId,
helper::dateUTF8('%d %B %Y - %H:%M', $maxTime),
round(($viewPages * 100) / $sumPages, 1) . ' %',
template::button('userHistory' . $userId, [
'href' => helper::baseUrl() . 'course/userHistory/' . $courseId . '/' . $userId,
'value'=> round(($viewPages * 100) / $sumPages, 1) . ' %'
] ),
template::button('userDelete' . $userId, [
'class' => 'userDelete buttonRed',
'href' => helper::baseUrl() . 'course/userDelete/' . $courseId . '/' . $userId,
@ -497,7 +500,7 @@ class course extends common
// Valeurs en sortie
$this->addOutput([
'title' => sprintf(helper::translate('Aucun inscrit dans le cours %s'), $this->getData(['course', $courseId, 'title'])),
'title' => sprintf(helper::translate('Inscriptions dans le cours %s'), $this->getData(['course', $courseId, 'title'])),
'view' => 'user',
'vendor' => [
'datatables'
@ -668,17 +671,17 @@ class course extends common
$courseId = $this->getUrl(2);
$userId = $this->getUrl(3);
foreach ($this->getData(['history', $courseId, $userId]) as $pageId => $time) {
$history = $this->getData(['enrolment', $courseId, $userId]);
foreach ($history['history'] as $pageId => $time) {
self::$userHistory[$pageId] = [
helper::dateUTF8('%d %B %Y - %H:%M:%S', $time),
$this->getData(['page', $pageId, 'shortTitle']),
helper::dateUTF8('%d %B %Y - %H:%M', $time)
]
;
];
}
// Valeurs en sortie
$this->addOutput([
'title' => helper::translate('Historique'),
'title' => helper::translate('Historique ') . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
'view' => 'userHistory',
'vendor' => [
'datatables'

View File

@ -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 <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @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
*/

View File

@ -0,0 +1,20 @@
/**
* 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 <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2023, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.fr/
*/
$(document).ready((function () {
$('#dataTables').DataTable({
language: {
url: "core/vendor/datatables/french.json"
}
});
}));

View File

@ -0,0 +1,14 @@
<div class="row">
<div class="col1">
<?php echo template::button('courseUserHistoryBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'course/user/' . $this->getUrl(2),
'value' => template::ico('left')
]); ?>
</div>
</div>
<?php if ($module::$userHistory): ?>
<?php echo template::table([6, 6], $module::$userHistory, ['Page', 'Dernière consultation de cette page'], ['id' => 'dataTables']); ?>
<?php else: ?>
<?php echo template::speech('Aucun historique'); ?>
<?php endif; ?>