Permalink
Browse files

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

Author: Matt Clarkson <mattc@catalyst.net.nz>
  • Loading branch information...
1 parent 9caa000 commit de0489fd9f992ad38bf5301ee989c45b86f3ee1c martinlanghoff committed May 6, 2007
Showing with 7 additions and 1 deletion.
  1. +7 −1 calendar/lib.php
View
@@ -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;
}
}

0 comments on commit de0489f

Please sign in to comment.