Skip to content

Commit

Permalink
merged: fixing warnings in stats lib - rather than doing an include_o…
Browse files Browse the repository at this point in the history
…nce and noticing for every missing mod, check the file exists first from MOODLE_16_STABLE, and fixed up some weirdness in the reports
  • Loading branch information
mjollnir_ committed Apr 11, 2007
1 parent 8a4f91b commit 77d5965
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions course/report/stats/graph.php
Expand Up @@ -103,6 +103,16 @@
$times[$stat->timeend] = userdate($stat->timeend,get_string('strftimedate'),$CFG->timezone); $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; $nonzeroroleid = 0;
foreach (array_keys($data) as $roleid) { foreach (array_keys($data) as $roleid) {
if ($roleid == 0) { if ($roleid == 0) {
Expand Down
9 changes: 8 additions & 1 deletion course/report/stats/report.php
Expand Up @@ -175,6 +175,13 @@
$rolesdata[$roleid] = 0; $rolesdata[$roleid] = 0;
} }
} }
else {
foreach (array_keys($roles) as $r) {
if (!array_key_exists($r, $rolesdata)) {
$rolesdata[$r] = 0;
}
}
}
krsort($rolesdata); krsort($rolesdata);
$row = array_merge(array($times[$time]),$rolesdata); $row = array_merge(array($times[$time]),$rolesdata);
if (empty($CFG->loglifetime) || ($stat->timeend-(60*60*24)) >= (time()-60*60*24*$CFG->loglifetime)) { if (empty($CFG->loglifetime) || ($stat->timeend-(60*60*24)) >= (time()-60*60*24*$CFG->loglifetime)) {
Expand All @@ -197,4 +204,4 @@
} }
} }


?> ?>

0 comments on commit 77d5965

Please sign in to comment.