Compare commits
14 Commits
d43a78d307
...
bb93b1b313
Author | SHA1 | Date |
---|---|---|
Fred Tempez | bb93b1b313 | |
Fred Tempez | 195ed682f6 | |
Fred Tempez | ae71b9649d | |
Fred Tempez | 71418548e7 | |
Fred Tempez | 03c7e0a7fa | |
Fred Tempez | 6bc8636692 | |
Fred Tempez | c0d14596a7 | |
Fred Tempez | 6a72676c7c | |
Fred Tempez | 44c4997436 | |
Fred Tempez | cce73886a2 | |
Fred Tempez | b9733d7391 | |
Fred Tempez | 56ff0580a1 | |
Fred Tempez | 5b9f86fb38 | |
Fred Tempez | deedb002e8 |
|
@ -423,13 +423,22 @@ class core extends common
|
|||
)
|
||||
) {
|
||||
// Stocke l'historique des pages vues
|
||||
/*
|
||||
$data = is_array($this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)]))
|
||||
? array_merge([time()], $this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)]))
|
||||
: [time()];
|
||||
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0), $data]);
|
||||
*/
|
||||
// Stocke la dernière page vue et sa date de consultation
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)]);
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'datePageView', time()]);
|
||||
|
||||
// Stocke le rapport en CSV
|
||||
$file = fopen(self::DATA_DIR . self::$siteContent . '/report.csv', 'a+');
|
||||
fputcsv($file, [ $this->getUser('id'), $this->getUrl(0) ,time()], ';');
|
||||
fclose($file);
|
||||
|
||||
}
|
||||
|
||||
// Journalisation
|
||||
|
|
|
@ -51,7 +51,7 @@ class common
|
|||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.7.09';
|
||||
const ZWII_VERSION = '1.8.00-dev';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||
|
|
|
@ -10,7 +10,7 @@ if (
|
|||
) {
|
||||
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
|
||||
foreach (['1', '2'] as $group) {
|
||||
foreach ( array_keys($this->getData(['profil', $group])) as $profil) {
|
||||
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
|
||||
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
|
||||
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
|
||||
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
|
||||
|
@ -20,4 +20,29 @@ if (
|
|||
}
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 1700]);
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 1800
|
||||
) {
|
||||
// Parcourir la structure pour écrire dans les fichiers CSV
|
||||
foreach ($this->getData(['enrolment']) as $courseId => $users) {
|
||||
$filename = self::DATA_DIR . $courseId . '/report.csv';
|
||||
$fp = fopen($filename, 'w');
|
||||
foreach ($users as $userId => $userData) {
|
||||
$history = array_key_exists('history', $userData) ? $userData['history'] : null;
|
||||
|
||||
if (is_array($history)) {
|
||||
foreach ($history as $pageId => $timestamps) {
|
||||
foreach ($timestamps as $timestamp) {
|
||||
fputcsv($fp, [$userId, $pageId, $timestamp], ';');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->deleteData(['enrolment', $courseId, $userId, 'history']);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 1800]);
|
||||
}
|
|
@ -26,10 +26,10 @@ class course extends common
|
|||
'users' => self::GROUP_EDITOR, // fait
|
||||
'usersAdd' => self::GROUP_EDITOR, //Fait
|
||||
'usersDelete' => self::GROUP_EDITOR, //Fait
|
||||
'usersHistoryExport' => self::GROUP_EDITOR, //fait
|
||||
'usersReportExport' => self::GROUP_EDITOR, //fait
|
||||
'userDelete' => self::GROUP_EDITOR, //Fait
|
||||
'userHistory' => self::GROUP_EDITOR, //Fait
|
||||
'userHistoryExport' => self::GROUP_EDITOR, //Fait
|
||||
'userReport' => self::GROUP_EDITOR, //Fait
|
||||
'userReportExport' => self::GROUP_EDITOR, //Fait
|
||||
'backup' => self::GROUP_EDITOR, // Fait
|
||||
'restore' => self::GROUP_EDITOR, //Fait
|
||||
'clone' => self::GROUP_ADMIN,
|
||||
|
@ -74,7 +74,7 @@ class course extends common
|
|||
public static $pagesList = ['accueil' => 'Accueil'];
|
||||
|
||||
|
||||
public static $userHistory = [];
|
||||
public static $userReport = [];
|
||||
|
||||
public static $userGraph = [];
|
||||
|
||||
|
@ -639,31 +639,19 @@ class course extends common
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Liste des inscrits dans le contenu sélectionné.
|
||||
$users = $this->getData(['enrolment', $courseId]);
|
||||
|
||||
$reports = $this->getReport($courseId);
|
||||
|
||||
if (is_array($users)) {
|
||||
// Tri du tableau par défaut par $userId
|
||||
ksort($users);
|
||||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Date et heure de la dernière page vue
|
||||
// Compatibilité anciennes versions
|
||||
if (
|
||||
$this->getData(['enrolment', $courseId, $userId, 'lastPageView']) === null
|
||||
or $this->getData(['enrolment', $courseId, $userId, 'datePageView']) === null
|
||||
) {
|
||||
if (!empty ($userValue['history'])) {
|
||||
$maxTime = max($userValue['history']);
|
||||
$lastPageId = array_search($maxTime, $userValue['history']);
|
||||
$this->setData(['enrolment', $courseId, $userId, 'lastPageView', $lastPageId]);
|
||||
$this->setData(['enrolment', $courseId, $userId, 'datePageView', $maxTime]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Compte les rôles valides
|
||||
if (isset ($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
|
@ -694,28 +682,28 @@ class course extends common
|
|||
}
|
||||
|
||||
// Progression
|
||||
$viewPages = $this->getData(['enrolment', $courseId, $userId, 'history']) !== null ?
|
||||
count(array_keys($this->getData(['enrolment', $courseId, $userId, 'history']))) :
|
||||
$viewPages = array_key_exists($userId, $reports) ?
|
||||
count($reports[$userId]) :
|
||||
0;
|
||||
|
||||
// Construction du tableau
|
||||
self::$courseUsers[] = [
|
||||
//$userId,
|
||||
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
isset ($pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])]['title'])
|
||||
? $pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])]['title']
|
||||
isset($pages[$userValue['lastPageView']]['title'])
|
||||
? $pages[$userValue['lastPageView']]['title']
|
||||
: '',
|
||||
$this->getData(['enrolment', $courseId, $userId, 'datePageView'])
|
||||
? helper::dateUTF8('%d/%m/%Y', $this->getData(['enrolment', $courseId, $userId, 'datePageView']))
|
||||
$userValue['datePageView']
|
||||
? helper::dateUTF8('%d/%m/%Y', $userValue['datePageView'])
|
||||
: '',
|
||||
$this->getData(['enrolment', $courseId, $userId, 'datePageView'])
|
||||
? helper::dateUTF8('%H:%M', $this->getData(['enrolment', $courseId, $userId, 'datePageView']))
|
||||
$userValue['datePageView']
|
||||
? helper::dateUTF8('%H:%M', $userValue['datePageView'])
|
||||
: '',
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
template::button('userHistory' . $userId, [
|
||||
'href' => helper::baseUrl() . 'course/userHistory/' . $courseId . '/' . $userId,
|
||||
'value' => !empty ($userValue['history']) ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%',
|
||||
'disable' => empty ($userValue['history'])
|
||||
template::button('userReport' . $userId, [
|
||||
'href' => helper::baseUrl() . 'course/userReport/' . $courseId . '/' . $userId,
|
||||
'value' => $viewPages ? min(round(($viewPages * 100) / $sumPages, 1), 100) . ' %' : '0%',
|
||||
'disable' => empty($viewPages)
|
||||
]),
|
||||
template::button('userDelete' . $userId, [
|
||||
'class' => 'userDelete buttonRed',
|
||||
|
@ -765,7 +753,7 @@ class course extends common
|
|||
|
||||
// Inscription des utilisateurs cochés
|
||||
if (
|
||||
isset ($_POST['courseUsersAddSubmit'])
|
||||
isset($_POST['courseUsersAddSubmit'])
|
||||
) {
|
||||
foreach ($_POST as $keyPost => $valuePost) {
|
||||
// Exclure les variables post qui ne sont pas des userId et ne traiter que les non inscrits
|
||||
|
@ -821,15 +809,15 @@ class course extends common
|
|||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset ($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
if (
|
||||
isset ($_POST['courseFilterGroup'])
|
||||
|| isset ($_POST['courseFilterFirstName'])
|
||||
|| isset ($_POST['courseFilterLastName'])
|
||||
isset($_POST['courseFilterGroup'])
|
||||
|| isset($_POST['courseFilterFirstName'])
|
||||
|| isset($_POST['courseFilterLastName'])
|
||||
) {
|
||||
|
||||
// Groupe et profils
|
||||
|
@ -934,7 +922,7 @@ class course extends common
|
|||
|
||||
// Inscription des utilisateurs cochés
|
||||
if (
|
||||
isset ($_POST['courseUsersDeleteSubmit'])
|
||||
isset($_POST['courseUsersDeleteSubmit'])
|
||||
) {
|
||||
foreach ($_POST as $keyPost => $valuePost) {
|
||||
// Exclure les variables post qui ne sont pas des userId et ne traiter que les non inscrits
|
||||
|
@ -984,15 +972,15 @@ class course extends common
|
|||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset ($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
if (
|
||||
isset ($_POST['courseFilterGroup'])
|
||||
|| isset ($_POST['courseFilterFirstName'])
|
||||
|| isset ($_POST['courseFilterLastName'])
|
||||
isset($_POST['courseFilterGroup'])
|
||||
|| isset($_POST['courseFilterFirstName'])
|
||||
|| isset($_POST['courseFilterLastName'])
|
||||
) {
|
||||
|
||||
// Groupe et profils
|
||||
|
@ -1164,7 +1152,7 @@ class course extends common
|
|||
/**
|
||||
* Liste les pages consultées par un utilisateur
|
||||
*/
|
||||
public function userHistory()
|
||||
public function userReport()
|
||||
{
|
||||
|
||||
// Espace sélectionné
|
||||
|
@ -1181,17 +1169,18 @@ class course extends common
|
|||
}
|
||||
|
||||
$userId = $this->getUrl(3);
|
||||
$h = $this->getData(['enrolment', $courseId, $userId, 'history']);
|
||||
$h = $this->getReport($courseId, $userId);
|
||||
$h = $h[$userId];
|
||||
|
||||
// Inversion des clés et des valeurs
|
||||
$history = array();
|
||||
$report = array();
|
||||
foreach ($h as $key => $values) {
|
||||
foreach ($values as $value) {
|
||||
$history[$value] = $key;
|
||||
$report[$value] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($history);
|
||||
ksort($report);
|
||||
|
||||
// Liste des pages contenues dans cet espace et exclure les barres et les pages masquées
|
||||
$p = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/page.json'), true);
|
||||
|
@ -1207,11 +1196,11 @@ class course extends common
|
|||
$topTime = 0;
|
||||
$lastView = 0;
|
||||
|
||||
foreach ($history as $time => $pageId) {
|
||||
if (isset ($pages[$pageId]['title'])) {
|
||||
foreach ($report as $time => $pageId) {
|
||||
if (isset($pages[$pageId]['title'])) {
|
||||
$lastView = ($lastView === 0) ? $time : $lastView;
|
||||
$diff = $time - $lastView;
|
||||
self::$userHistory[] = [
|
||||
self::$userReport[] = [
|
||||
html_entity_decode($pages[$pageId]['title']),
|
||||
$time,
|
||||
($diff < 1800) ? sprintf("%d' %d''", floor($diff / 60), $diff % 60) : "Non significatif",
|
||||
|
@ -1224,22 +1213,22 @@ class course extends common
|
|||
];
|
||||
}
|
||||
$lastView = $time;
|
||||
$floorTime = isset ($floorTime) && $floorTime < $time ? $floorTime : $time;
|
||||
$topTime = isset ($topTime) && $topTime > $time ? $topTime : $time;
|
||||
$floorTime = isset($floorTime) && $floorTime < $time ? $floorTime : $time;
|
||||
$topTime = isset($topTime) && $topTime > $time ? $topTime : $time;
|
||||
}
|
||||
}
|
||||
|
||||
// Décale les temps de consultation
|
||||
for ($i = 0; $i < count(self::$userHistory) - 1; $i++) {
|
||||
self::$userHistory[$i][2] = self::$userHistory[$i + 1][2];
|
||||
for ($i = 0; $i < count(self::$userReport) - 1; $i++) {
|
||||
self::$userReport[$i][2] = self::$userReport[$i + 1][2];
|
||||
}
|
||||
// Décale les temps de consultation
|
||||
for ($i = 0; $i < count(self::$userGraph) - 1; $i++) {
|
||||
self::$userHistory[$i][1] = self::$userHistory[$i + 1][1];
|
||||
self::$userReport[$i][1] = self::$userReport[$i + 1][1];
|
||||
}
|
||||
|
||||
// Formate le timestamp
|
||||
array_walk(self::$userHistory, function (&$item) {
|
||||
array_walk(self::$userReport, function (&$item) {
|
||||
$item[1] = helper::dateUTF8('%d/%m/%Y %H:%M:%S', $item[1]);
|
||||
});
|
||||
|
||||
|
@ -1257,7 +1246,7 @@ class course extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Historique ') . $this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
|
||||
'view' => 'userHistory',
|
||||
'view' => 'userReport',
|
||||
'vendor' => [
|
||||
"plotly"
|
||||
]
|
||||
|
@ -1265,7 +1254,7 @@ class course extends common
|
|||
|
||||
}
|
||||
|
||||
public function usersHistoryExport()
|
||||
public function usersReportExport()
|
||||
{
|
||||
|
||||
$courseId = $this->getUrl(2);
|
||||
|
@ -1319,7 +1308,7 @@ class course extends common
|
|||
$this->getData(['enrolment', $courseId, $userId, 'lastPageView']) === null
|
||||
or $this->getData(['enrolment', $courseId, $userId, 'datePageView']) === null
|
||||
) {
|
||||
if (!empty ($userValue['history'])) {
|
||||
if (!empty($userValue['history'])) {
|
||||
$maxTime = max($userValue['history']);
|
||||
$lastPageId = array_search($maxTime, $userValue['history']);
|
||||
$this->setData(['enrolment', $courseId, $userId, 'lastPageView', $lastPageId]);
|
||||
|
@ -1337,7 +1326,7 @@ class course extends common
|
|||
$userId,
|
||||
$this->getData(['user', $userId, 'firstname']),
|
||||
$this->getData(['user', $userId, 'lastname']),
|
||||
isset ($pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])])
|
||||
isset($pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])])
|
||||
? $pages[$this->getData(['enrolment', $courseId, $userId, 'lastPageView'])]
|
||||
: $this->getData(['enrolment', $courseId, $userId, 'lastPageView']) . ' (supprimée)',
|
||||
helper::dateUTF8('%d/%d/%Y', $this->getData(['enrolment', $courseId, $userId, 'datePageView'])),
|
||||
|
@ -1371,7 +1360,7 @@ class course extends common
|
|||
}
|
||||
}
|
||||
|
||||
public function userHistoryExport()
|
||||
public function userReportExport()
|
||||
{
|
||||
|
||||
$courseId = $this->getUrl(2);
|
||||
|
@ -1388,17 +1377,18 @@ class course extends common
|
|||
}
|
||||
|
||||
// Traitement de l'historique
|
||||
$h = $this->getData(['enrolment', $courseId, $userId, 'history']);
|
||||
$h = $this->getReport($courseId, $userId);
|
||||
$h = $h[$userId];
|
||||
|
||||
// Inversion des clés et des valeurs
|
||||
$history = array();
|
||||
$report = array();
|
||||
foreach ($h as $key => $values) {
|
||||
foreach ($values as $value) {
|
||||
$history[$value] = $key;
|
||||
$report[$value] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($history);
|
||||
ksort($report);
|
||||
|
||||
// Liste des pages contenues dans cet espace et exclure les barres et les pages masquées
|
||||
$p = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/page.json'), true);
|
||||
|
@ -1412,33 +1402,33 @@ class course extends common
|
|||
|
||||
$lastView = 0;
|
||||
|
||||
foreach ($history as $time => $pageId) {
|
||||
if (isset ($pages[$pageId]['title'])) {
|
||||
foreach ($report as $time => $pageId) {
|
||||
if (isset($pages[$pageId]['title'])) {
|
||||
$lastView = ($lastView === 0) ? $time : $lastView;
|
||||
$diff = $time - $lastView;
|
||||
self::$userHistory[] = [
|
||||
self::$userReport[] = [
|
||||
$pageId,
|
||||
html_entity_decode($pages[$pageId]['title']),
|
||||
$time,
|
||||
($diff < 1800) ? sprintf("%d' %d''", floor($diff / 60), $diff % 60) : "Non significatif",
|
||||
];
|
||||
$lastView = $time;
|
||||
$floorTime = isset ($floorTime) && $floorTime < $time ? $floorTime : $time;
|
||||
$topTime = isset ($topTime) && $topTime > $time ? $topTime : $time;
|
||||
$floorTime = isset($floorTime) && $floorTime < $time ? $floorTime : $time;
|
||||
$topTime = isset($topTime) && $topTime > $time ? $topTime : $time;
|
||||
}
|
||||
}
|
||||
|
||||
// Décale les temps de consultation
|
||||
for ($i = 0; $i < count(self::$userHistory) - 1; $i++) {
|
||||
self::$userHistory[$i][3] = self::$userHistory[$i + 1][3];
|
||||
for ($i = 0; $i < count(self::$userReport) - 1; $i++) {
|
||||
self::$userReport[$i][3] = self::$userReport[$i + 1][3];
|
||||
}
|
||||
// Formate le timestamp
|
||||
array_walk(self::$userHistory, function (&$item) {
|
||||
array_walk(self::$userReport, function (&$item) {
|
||||
$item[2] = helper::dateUTF8('%d/%m/%Y %H:%M:%S', $item[2]);
|
||||
});
|
||||
|
||||
// Ajoute les entêtes
|
||||
self::$userHistory = array_merge([0 => ['PageId', 'Page Titre', 'Consultation Date', 'Temps Consultation']], self::$userHistory);
|
||||
self::$userReport = array_merge([0 => ['PageId', 'Page Titre', 'Consultation Date', 'Temps Consultation']], self::$userReport);
|
||||
|
||||
// Dossier d'export
|
||||
if (is_dir(self::FILE_DIR . 'source/' . $courseId) === false) {
|
||||
|
@ -1451,7 +1441,7 @@ class course extends common
|
|||
|
||||
$file = fopen($filename, 'w');
|
||||
|
||||
foreach (self::$userHistory as $keys => $values) {
|
||||
foreach (self::$userReport as $keys => $values) {
|
||||
$data = $values;
|
||||
// Écrire la ligne dans le fichier CSV
|
||||
fputcsv($file, $data, ';');
|
||||
|
@ -1461,7 +1451,7 @@ class course extends common
|
|||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'course/userHistory/' . $courseId . '/' . $userId,
|
||||
'redirect' => helper::baseUrl() . 'course/userReport/' . $courseId . '/' . $userId,
|
||||
'notification' => 'Création ' . basename($filename) . ' dans le dossier "Export"',
|
||||
'state' => true,
|
||||
]);
|
||||
|
@ -1895,4 +1885,46 @@ class course extends common
|
|||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lit le contenu des fichiers de traces au format CS et renvoie un tableau associatif
|
||||
*/
|
||||
private function getReport($courseId, $userId = null)
|
||||
{
|
||||
// Remplacez 'chemin/vers/votre/fichier.csv' par le chemin réel de votre fichier CSV
|
||||
$file = fopen(self::DATA_DIR . $courseId . '/report.csv', "r");
|
||||
|
||||
$data = array();
|
||||
|
||||
// Lire ligne par ligne
|
||||
while (($line = fgetcsv($file, 1000, ";")) !== false) {
|
||||
$name = $line[0];
|
||||
$pageId = $line[1];
|
||||
$timestamp = $line[2];
|
||||
// Filtre userId
|
||||
// if (!is_null($userId) && $name === $userId) {
|
||||
// Initialiser le tableau si nécessaire
|
||||
if (!isset($data[$name][$pageId])) {
|
||||
$data[$name][$pageId] = array();
|
||||
}
|
||||
// Ajouter le timestamp
|
||||
$data[$name][$pageId][] = $timestamp;
|
||||
// }
|
||||
}
|
||||
|
||||
// Fermer le fichier
|
||||
fclose($file);
|
||||
|
||||
// Trier les timestamps
|
||||
foreach ($data as &$userData) {
|
||||
foreach ($userData as &$pageData) {
|
||||
sort($pageData);
|
||||
}
|
||||
}
|
||||
|
||||
// Afficher le JSON;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -58,6 +58,7 @@
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$userHistory): ?>
|
||||
<?php if ($module::$userReport): ?>
|
||||
<div class="row">
|
||||
<div class="col4 offset2">
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === self::COURSE_ACCESS_DATE): ?>
|
||||
|
@ -46,7 +46,7 @@
|
|||
</div>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col8">
|
||||
<?php echo template::table([6, 3, 3], $module::$userHistory, ['Page', 'Début de Consultation', 'Temps consultation']); ?>
|
||||
<?php echo template::table([6, 3, 3], $module::$userReport, ['Page', 'Début de Consultation', 'Temps consultation']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
|
@ -16,3 +16,7 @@
|
|||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
tr {
|
||||
cursor: pointer;
|
||||
}
|
|
@ -13,6 +13,13 @@
|
|||
|
||||
$(document).ready((function () {
|
||||
|
||||
$('tr').click(function(){
|
||||
// Cochez ou décochez la case à cocher dans cette ligne
|
||||
$(this).find('input[type="checkbox"]').prop('checked', function(i, val){
|
||||
return !val; // Inverse l'état actuel de la case à cocher
|
||||
});
|
||||
});
|
||||
|
||||
$('#courseUserAddSelectAll').on('click', function() {
|
||||
$('.checkboxSelect').prop('checked', true);
|
||||
saveCheckboxState();
|
||||
|
|
|
@ -20,3 +20,7 @@
|
|||
#courseUsersDeleteSubmit {
|
||||
background-color: rgba(217, 95, 78, 1);
|
||||
}
|
||||
|
||||
tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,13 @@
|
|||
|
||||
$(document).ready((function () {
|
||||
|
||||
$('tr').click(function () {
|
||||
// Cochez ou décochez la case à cocher dans cette ligne
|
||||
$(this).find('input[type="checkbox"]').prop('checked', function (i, val) {
|
||||
return !val; // Inverse l'état actuel de la case à cocher
|
||||
});
|
||||
});
|
||||
|
||||
$('#courseUserDeleteSelectAll').on('click', function () {
|
||||
$('.checkboxSelect').prop('checked', true);
|
||||
saveCheckboxState();
|
||||
|
|
Loading…
Reference in New Issue