? 0001-mnet-MDL-18720-pass-the-right-parameters-to-mnet-log.patch ? MDL-18720-2.0.patch.txt ? b ? debugging.ptch ? mnetfields.diff ? ora.patch.txt ? portfolio.patch ? session.patch ? up.diff ? lib/editor/tinymce/jscripts/tiny_mce/plugins/table/js ? lib/portfolio/formats/leap2a/test.php ? mod/data/temp ? repository/.lib.php.swp ? repository/remotemoodle/.repository.class.php.swp Index: course/lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/lib.php,v retrieving revision 1.719 diff -u -r1.719 lib.php --- course/lib.php 17 Feb 2010 16:59:42 -0000 1.719 +++ course/lib.php 18 Feb 2010 01:38:34 -0000 @@ -122,7 +122,17 @@ } -function build_mnet_logs_array($hostid, $course, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='', +/** + * builds up the array of information to draw logs with + * + * @param int $hostid the id of the remote host + * @param int $courseid + * + * @return array + * + * @todo document this function - in particular whether the parameters relate to local or remote objects + */ +function build_mnet_logs_array($hostid, $courseid, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='', $modname="", $modid=0, $modaction="", $groupid=0) { global $CFG, $DB; @@ -157,13 +167,13 @@ WHERE "; $params = array(); - $where .= "l.hostid = :hostid"; + $where = "l.hostid = :hostid"; $params['hostid'] = $hostid; // TODO: Is 1 really a magic number referring to the sitename? - if ($course != SITEID || $modid != 0) { + if ($courseid != SITEID || $modid != 0) { $where .= " AND l.course=:courseid"; - $params['courseid'] = $course; + $params['courseid'] = $courseid; } if ($modname) { @@ -424,12 +434,20 @@ } +/** + * prints the logs shipped over mnet + * + * @param int $hostid the id of the remote host + * @param stdclass $course + * + * @todo document this function - in particular whether the parameters relate to local or remote objects + */ function print_mnet_log($hostid, $course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0) { global $CFG, $DB, $OUTPUT; - if (!$logs = build_mnet_logs_array($hostid, $course, $user, $date, $order, $page*$perpage, $perpage, + if (!$logs = build_mnet_logs_array($hostid, $course->id, $user, $date, $order, $page*$perpage, $perpage, $modname, $modid, $modaction, $groupid)) { echo $OUTPUT->notification("No logs found!"); echo $OUTPUT->footer(); @@ -3861,4 +3879,4 @@ $eventdata->smallmessage = ''; message_send($eventdata); } -} \ No newline at end of file +} Index: course/report/log/index.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/report/log/index.php,v retrieving revision 1.34 diff -u -r1.34 index.php --- course/report/log/index.php 16 Jan 2010 15:40:09 -0000 1.34 +++ course/report/log/index.php 18 Feb 2010 01:38:34 -0000 @@ -112,7 +112,7 @@ "index.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&group=$group", $modname, $modid, $modaction, $group); } else { - print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group); + print_mnet_log($hostid, $course, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group); } break; case 'downloadascsv':