v44 format de l'historique

This commit is contained in:
Fred Tempez 2023-10-18 14:37:33 +02:00
parent 44856c03c6
commit b88e99e31d
4 changed files with 13 additions and 4 deletions

View File

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

View File

@ -672,10 +672,11 @@ class course extends common
$courseId = $this->getUrl(2);
$userId = $this->getUrl(3);
$history = $this->getData(['enrolment', $courseId, $userId]);
$pages = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/page.json'), true);
foreach ($history['history'] as $pageId => $time) {
self::$userHistory[$pageId] = [
helper::dateUTF8('%d %B %Y - %H:%M:%S', $time),
$this->getData(['page', $pageId, 'shortTitle']),
$pages['page'][$pageId]['shortTitle'],
];
}

View File

@ -15,6 +15,10 @@ $(document).ready((function () {
$('#dataTables').DataTable({
language: {
url: "core/vendor/datatables/french.json"
}
},
searching: false,
pageLength: 100,
lengthChange: false,
paging: false
});
}));

View File

@ -8,7 +8,11 @@
</div>
</div>
<?php if ($module::$userHistory): ?>
<?php echo template::table([6, 6], $module::$userHistory, ['Page', 'Dernière consultation de cette page'], ['id' => 'dataTables']); ?>
<div class="row textAlignCenter">
<div class="col8">
<?php echo template::table([6, 6], $module::$userHistory, ['Dernière consultation de cette page', 'Titre de la page'], ['id' => 'dataTables']); ?>
</div>
</div>
<?php else: ?>
<?php echo template::speech('Aucun historique'); ?>
<?php endif; ?>