v28 historique plutôt que dernière page vue
This commit is contained in:
parent
a51f4d9be0
commit
3f754ee994
@ -467,7 +467,7 @@ class core extends common
|
||||
exit();
|
||||
}
|
||||
|
||||
// Sauvegarde la dernière page visitée par l'utilisateur connecté
|
||||
// Sauvegarde la dernière page visitée par l'utilisateur connecté et enregistre l'historique des consultations
|
||||
if (
|
||||
$this->getUser('id')
|
||||
&& self::$siteContent !== 'home'
|
||||
@ -477,10 +477,8 @@ class core extends common
|
||||
$this->getUser('group') < self::GROUP_ADMIN
|
||||
|| $this->getUser('id') !== $this->getData(['course', self::$siteContent, 'author'])
|
||||
)
|
||||
|
||||
) {
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'lastPageId', $this->getUrl(0)]);
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'dateVisit', time()]);
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0), time()]);
|
||||
}
|
||||
|
||||
// Journalisation
|
||||
|
@ -50,7 +50,7 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.0.27';
|
||||
const ZWII_VERSION = '1.0.28';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/lms/';
|
||||
|
@ -377,11 +377,14 @@ class course extends common
|
||||
$users = $this->getData(['enrolment', $this->getUrl(2)]);
|
||||
ksort($users);
|
||||
foreach ($users as $userId => $userValue) {
|
||||
$history = $userValue['history'];
|
||||
$maxTime = max($history);
|
||||
$pageId = array_search($maxTime, $history);
|
||||
self::$courseUsers[] = [
|
||||
$userId,
|
||||
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
$userValue['lastPageId'],
|
||||
helper::dateUTF8('%d %B %Y - %H:%M', $userValue['dateVisit']),
|
||||
$pageId,
|
||||
helper::dateUTF8('%d %B %Y - %H:%M', $maxTime),
|
||||
template::button('userDelete' . $userId, [
|
||||
'class' => 'userDelete buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/userDelete/'. $this->getUrl(2) . '/' . $userId,
|
||||
@ -479,8 +482,9 @@ class course extends common
|
||||
&& $this->courseIsAvailable($courseId)
|
||||
) {
|
||||
// Récupérer la dernière page visitée par cet utilisateur si elle existe
|
||||
if ($this->getData(['enrolment', $courseId, $userId, 'lastPageId'])) {
|
||||
$redirect .= $this->getData(['enrolment', $courseId, $userId, 'lastPageId']);
|
||||
$maxTime = max($this->getData(['enrolment', $courseId, $userId, 'history']));
|
||||
if ($maxTime) {
|
||||
$redirect .= array_search($maxTime,$this->getData(['enrolment', $courseId, $userId, 'history']));
|
||||
} else {
|
||||
// Sinon la page d'accueil par défaut du module
|
||||
$redirect .= $this->getData(['course', $courseId, 'homePageId']);
|
||||
@ -660,8 +664,7 @@ class course extends common
|
||||
$courseId,
|
||||
$userId,
|
||||
[
|
||||
'lastPageId' => '',
|
||||
'dateVisit' => 0
|
||||
'history' => [],
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user