]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16568 Hiding courses with showgrades set to 0. Merging from MOODLE_19_STABLE
authornicolasconnault <nicolasconnault>
Mon, 13 Oct 2008 12:35:23 +0000 (12:35 +0000)
committernicolasconnault <nicolasconnault>
Mon, 13 Oct 2008 12:35:23 +0000 (12:35 +0000)
grade/report/overview/lib.php

index c76832dfa8465497ffe21fa52f7c4b3a3fe55021..bc66392f5aeb894e41e71b51f7dae17b10ec902a 100644 (file)
@@ -113,10 +113,13 @@ class grade_report_overview extends grade_report {
         global $CFG;
 
         // MDL-11679, only show 'mycourses' instead of all courses
-        if ($courses = get_my_courses($this->user->id, 'c.sortorder ASC', 'id, shortname')) {
+        if ($courses = get_my_courses($this->user->id, 'c.sortorder ASC', 'id, shortname, showgrades')) {
             $numusers = $this->get_numusers(false);
 
             foreach ($courses as $course) {
+                if (!$course->showgrades) {
+                    continue;
+                }
                 $courselink = '<a href="'.$CFG->wwwroot.'/grade/report/user/index.php?id='.$course->id.'">'.$course->shortname.'</a>';
 
                 // Get course grade_item