From f1bd8617099ca025b49797cf4f6aeef7e4c35dee Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 7 May 2008 02:58:44 +0000 Subject: [PATCH] "MDL-14668, fix course full name in activity reports, see tracker" --- course/lib.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/course/lib.php b/course/lib.php index 1ab955dfe..b69922dd5 100644 --- a/course/lib.php +++ b/course/lib.php @@ -232,13 +232,16 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per if ($course->id == SITEID) { $courses[0] = ''; - if ($ccc = get_courses('all', 'c.id ASC', 'c.id,c.shortname')) { + if ($ccc = get_courses('all', 'c.id ASC', + 'c.id,c.shortname,c.fullname')) { foreach ($ccc as $cc) { - $courses[$cc->id] = $cc->shortname; + $courses[$cc->id]['shortname'] = $cc->shortname; + $courses[$cc->id]['fullname'] = $cc->fullname; } } } else { - $courses[$course->id] = $course->shortname; + $courses[$course->id]['shortname'] = $course->shortname; + $courses[$course->id]['fullname'] = $course->fullname; } $totalcount = $logs['totalcount']; @@ -311,7 +314,8 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per if (empty($log->course)) { echo get_string('site') . "\n"; } else { - echo " wwwroot}/course/view.php?id={$log->course}\">". format_string($courses[$log->course])."\n"; + echo " wwwroot}/course/view.php?id={$log->course}\">". + format_string($courses[$log->course]['shortname'])."\n"; } echo "\n"; } @@ -320,9 +324,9 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per echo "\n"; link_to_popup_window("/iplookup/index.php?ip=$log->ip&user=$log->userid", 'iplookup',$log->ip, 440, 700); echo "\n"; - $fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id))); echo "\n"; - echo " wwwroot/user/view.php?id={$log->userid}&course={$log->course}\">$fullname\n"; + echo " wwwroot/course/view.php?id={$log->userid}&course={$log->course}\">". + format_string($courses[$log->course]['fullname'])."\n"; echo "\n"; echo "\n"; $displayaction="$log->module $log->action"; -- 2.11.4.GIT