MDL-64063 core_calendar: events by time considers enrolment status.
[moodle.git] / calendar / classes / local / event / data_access / event_vault.php
index 121a113..3d59208 100644 (file)
@@ -197,11 +197,12 @@ class event_vault implements event_vault_interface {
         $timesortfrom = null,
         $timesortto = null,
         event_interface $afterevent = null,
-        $limitnum = 20
+        $limitnum = 20,
+        $limittononsuspendedevents = false
     ) {
         $courseids = array_map(function($course) {
             return $course->id;
-        }, enrol_get_all_users_courses($user->id));
+        }, enrol_get_all_users_courses($user->id, $limittononsuspendedevents));
 
         $groupids = array_reduce($courseids, function($carry, $courseid) use ($user) {
             $groupings = groups_get_user_groups($courseid, $user->id);