From f8b0ee68bfb1b09684a160d8e02ef5540d6cd27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Tue, 16 May 2017 07:27:00 +0200 Subject: [PATCH] MDL-58756 stats: Use multilang with role . --- lib/statslib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/statslib.php b/lib/statslib.php index 42cd8237bc2..3ba1cbf7c15 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -1156,7 +1156,8 @@ function stats_get_parameters($time,$report,$courseid,$mode,$roleid=0) { case STATS_REPORT_ACTIVITYBYROLE; $param->fields = 'stat1 AS line1, stat2 AS line2'; $param->stattype = 'activity'; - $rolename = $DB->get_field('role','name', array('id'=>$roleid)); + $role = $DB->get_record('role', array('id' => $roleid)); + $rolename = role_get_name($role, context_course::instance($courseid)); $param->line1 = $rolename . get_string('statsreads'); $param->line2 = $rolename . get_string('statswrites'); if ($courseid == SITEID) {