Merge branch 'MDL-37473' of git://github.com/srynot4sale/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 22 Jan 2013 03:14:19 +0000 (11:14 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 22 Jan 2013 03:14:19 +0000 (11:14 +0800)
lib/completionlib.php

index 4da22fa..235c4be 100644 (file)
@@ -1088,7 +1088,7 @@ class completion_info {
      * @return bool
      */
     public function is_tracked_user($userid) {
-        return is_enrolled(context_course::instance($this->course->id), $userid, '', true);
+        return is_enrolled(context_course::instance($this->course->id), $userid, 'moodle/course:isincompletionreports', true);
     }
 
     /**
@@ -1105,7 +1105,7 @@ class completion_info {
         global $DB;
 
         list($enrolledsql, $enrolledparams) = get_enrolled_sql(
-                context_course::instance($this->course->id), '', $groupid, true);
+                context_course::instance($this->course->id), 'moodle/course:isincompletionreports', $groupid, true);
         $sql  = 'SELECT COUNT(eu.id) FROM (' . $enrolledsql . ') eu JOIN {user} u ON u.id = eu.id';
         if ($where) {
             $sql .= " WHERE $where";