From 3e7ca6b3b1cfe37264bf449ea11b4ce4059b0947 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 18 Dec 2009 17:13:39 +0000 Subject: [PATCH] grader report: MDL-21159 Link to user report does not respect $CFG->grade_profilereport setting. Also, the report was generating invalid XHTML. --- grade/report/grader/lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index c81df24c22..9220246f92 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -537,7 +537,7 @@ class grade_report_grader extends grade_report { $colspan = 1; - if (has_capability('gradereport/user:view', $this->context)) { + if (has_capability('gradereport/'.$CFG->grade_profilereport.':view', $this->context)) { $colspan++; } @@ -564,7 +564,7 @@ class grade_report_grader extends grade_report { $studentheader->scope = 'col'; $studentheader->header = true; $studentheader->id = 'studentheader'; - if (has_capability('gradereport/user:view', $this->context)) { + if (has_capability('gradereport/'.$CFG->grade_profilereport.':view', $this->context)) { $studentheader->colspan = 2; } $studentheader->text = $arrows['studentname']; @@ -608,14 +608,14 @@ class grade_report_grader extends grade_report { $userrow->cells[] = $usercell; - if (has_capability('gradereport/user:view', $this->context)) { + if (has_capability('gradereport/'.$CFG->grade_profilereport.':view', $this->context)) { $userreportcell = new html_table_cell(); $userreportcell->add_class('userreport'); $userreportcell->header = true; $a->user = fullname($user); $strgradesforuser = get_string('gradesforuser', 'grades', $a); $userreporticon = new moodle_action_icon(); - $userreporticon->link->url = new moodle_url($CFG->wwwroot.'/grade/report/user/index.php', array('userid' => $user->id, 'id' => $this->course->id)); + $userreporticon->link->url = new moodle_url($CFG->wwwroot.'/grade/report/'.$CFG->grade_profilereport.'/index.php', array('userid' => $user->id, 'id' => $this->course->id)); $userreporticon->image->add_class('iconsmall'); $userreporticon->image->src = $OUTPUT->pix_url('t/grades'); $userreporticon->image->alt = $strgradesforuser; -- 2.39.5