Merge branch 'MDL-34228-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_...
authorDan Poltawski <dan@moodle.com>
Tue, 16 Oct 2012 08:19:33 +0000 (16:19 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 16 Oct 2012 08:19:33 +0000 (16:19 +0800)
lang/en/role.php
lib/completionlib.php
lib/db/access.php

index ffbdec3..f9ab6a9 100644 (file)
@@ -121,6 +121,7 @@ $string['course:changesummary'] = 'Change course summary';
 $string['course:enrolconfig'] = 'Configure enrol instances in courses';
 $string['course:enrolreview'] = 'Review course enrolments';
 $string['course:ignorefilesizelimits'] = 'Use files larger than any file size restrictions';
+$string['course:isincompletionreports'] = 'Be shown on completion reports';
 $string['course:manageactivities'] = 'Manage activities';
 $string['course:managefiles'] = 'Manage files';
 $string['course:managegrades'] = 'Manage grades';
index fcd5910..fcc6f58 100644 (file)
@@ -1069,7 +1069,8 @@ class completion_info {
         global $DB;
 
         list($enrolledsql, $params) = get_enrolled_sql(
-                context_course::instance($this->course->id), '', $groupid, true);
+                context_course::instance($this->course->id),
+                'moodle/course:isincompletionreports', $groupid, true);
 
         $sql = 'SELECT u.id, u.firstname, u.lastname, u.idnumber';
         if ($extracontext) {
index 121750c..f2027df 100644 (file)
@@ -979,6 +979,14 @@ $capabilities = array(
         )
     ),
 
+    'moodle/course:isincompletionreports' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_COURSE,
+        'archetypes' => array(
+            'student' => CAP_ALLOW,
+        ),
+    ),
+
     'moodle/course:viewscales' => array(
 
         'captype' => 'read',