From 3b88a4441cbe84a25e6eaea1cb58eb215aa38e91 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 15 Jun 2017 11:58:22 +1200 Subject: [PATCH] Fixes #266 - groupmemembersonly setting removed by MDL-44725 --- classes/structure.php | 4 ++-- lib.php | 2 -- renderer.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/classes/structure.php b/classes/structure.php index 491b8bd..a050109 100644 --- a/classes/structure.php +++ b/classes/structure.php @@ -578,7 +578,7 @@ class mod_attendance_structure { if ($page) { $usersperpage = $this->pageparams->perpage; - if (!empty($CFG->enablegroupmembersonly) and $this->cm->groupmembersonly) { + if (!empty($this->cm->groupingid)) { $startusers = ($page - 1) * $usersperpage; if ($groupid == 0) { $groups = array_keys(groups_get_all_groups($this->cm->course, 0, $this->cm->groupingid, 'g.id')); @@ -595,7 +595,7 @@ class mod_attendance_structure { $orderby, $startusers, $usersperpage); } } else { - if (!empty($CFG->enablegroupmembersonly) and $this->cm->groupmembersonly) { + if (!empty($this->cm->groupingid)) { if ($groupid == 0) { $groups = array_keys(groups_get_all_groups($this->cm->course, 0, $this->cm->groupingid, 'g.id')); } else { diff --git a/lib.php b/lib.php index c48f801..c4cabde 100644 --- a/lib.php +++ b/lib.php @@ -39,8 +39,6 @@ function attendance_supports($feature) { return true; case FEATURE_GROUPINGS: return true; - case FEATURE_GROUPMEMBERSONLY: - return true; case FEATURE_MOD_INTRO: return true; case FEATURE_BACKUP_MOODLE2: diff --git a/renderer.php b/renderer.php index 325ab87..581f83c 100644 --- a/renderer.php +++ b/renderer.php @@ -412,7 +412,7 @@ class mod_attendance_renderer extends plugin_renderer_base { } } - if (!empty($CFG->enablegroupmembersonly) and $takedata->cm->groupmembersonly) { + if (!empty($takedata->cm->groupingid)) { if ($group == 0) { $groups = array_keys(groups_get_all_groups($takedata->cm->course, 0, $takedata->cm->groupingid, 'g.id')); } else {