merged: fixing warnings in stats lib - rather than doing an include_once and noticing for every missing mod, check the file exists first from MOODLE_16_STABLE, and fixed up some weirdness in the reports

This commit is contained in:
mjollnir_
2007-04-11 23:59:11 +00:00
parent 8a4f91b671
commit 77d5965638
2 changed files with 18 additions and 1 deletions
+10
View File
@@ -103,6 +103,16 @@
$times[$stat->timeend] = userdate($stat->timeend,get_string('strftimedate'),$CFG->timezone);
}
}
foreach (array_keys($times) as $t) {
foreach ($data as $roleid => $stuff) {
if (!array_key_exists($t, $stuff)) {
$data[$roleid][$t] = 0;
}
}
}
foreach ($data as $role => $stuff) {
ksort($data[$role]);
}
$nonzeroroleid = 0;
foreach (array_keys($data) as $roleid) {
if ($roleid == 0) {
+8 -1
View File
@@ -175,6 +175,13 @@
$rolesdata[$roleid] = 0;
}
}
else {
foreach (array_keys($roles) as $r) {
if (!array_key_exists($r, $rolesdata)) {
$rolesdata[$r] = 0;
}
}
}
krsort($rolesdata);
$row = array_merge(array($times[$time]),$rolesdata);
if (empty($CFG->loglifetime) || ($stat->timeend-(60*60*24)) >= (time()-60*60*24*$CFG->loglifetime)) {
@@ -197,4 +204,4 @@
}
}
?>
?>