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