calendar: fixed group event display when only one course being viewed

Author: Matt Clarkson <mattc@catalyst.net.nz>
This commit is contained in:
martinlanghoff 2007-05-06 04:38:24 +00:00
parent 6b4aeb314b
commit b8227b8827

View File

@ -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;
}
}