From: martinlanghoff Date: Sun, 6 May 2007 04:38:24 +0000 (+0000) Subject: calendar: fixed group event display when only one course being viewed X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b8227b8827bdacfb15dfb907c839761e2ea4d5e9;p=moodle.git calendar: fixed group event display when only one course being viewed Author: Matt Clarkson --- diff --git a/calendar/lib.php b/calendar/lib.php index 08565a562b..5c43b3b020 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1145,7 +1145,13 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU // If the user is an editing teacher in there, if(!empty($USER->id) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $courseid))) { // If this course has groups, show events from all of them - if(isset($SESSION->cal_courses_shown[$courseid]) && ($SESSION->cal_courses_shown[$courseid]->groupmode != NOGROUPS || !$SESSION->cal_courses_shown[$courseid]->groupmodeforce)) { + if(is_int($groupeventsfrom)) { + $courserecord = get_record('course', 'id', $courseid); + if ($courserecord->groupmode != NOGROUPS || !$courserecord->groupmodeforce) { + $groupids[] = $courseid; + } + } + else if(isset($SESSION->cal_courses_shown[$courseid]) && ($SESSION->cal_courses_shown[$courseid]->groupmode != NOGROUPS || !$SESSION->cal_courses_shown[$courseid]->groupmodeforce)) { $groupids[] = $courseid; } }