From 90e487a7abc2b090d2093ac8ff43de07000558fd Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Sat, 3 Sep 2011 17:53:20 +0400 Subject: [PATCH] Fixed bug with displaying SESSIONS_TYPE_SELECTOR for attendances with groupmode 'Separate' --- locallib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/locallib.php b/locallib.php index 08f907a..e031a81 100644 --- a/locallib.php +++ b/locallib.php @@ -255,6 +255,8 @@ class att_page_with_filter_controls { $this->sesstype = $SESSION->attsessiontype[$this->cm->course]; } } + + $this->calc_sessgroupslist(); } private function calc_sessgroupslist() { @@ -272,7 +274,7 @@ class att_page_with_filter_controls { } if ($allowedgroups) { - if ($groupmode == VISIBLEGROUPS or $this->perm->can_access_all_groups()) { + if ($groupmode == VISIBLEGROUPS or has_capability('moodle/site:accessallgroups', $PAGE->context)) { $this->sessgroupslist[self::SESSTYPE_ALL] = get_string('all', 'attforblock'); } if ($groupmode == VISIBLEGROUPS) { @@ -327,7 +329,7 @@ class att_view_page_params extends att_page_with_filter_controls { class att_manage_page_params extends att_page_with_filter_controls { public function __construct() { - $this->selectortype = self::SELECTOR_SESS_TYPE; + $this->selectortype = att_page_with_filter_controls::SELECTOR_SESS_TYPE; } public function get_significant_params() {