Permalink
Browse files

MDL-9059, admins don't see group event in course

  • Loading branch information...
toyomoyo
toyomoyo committed Oct 16, 2007
1 parent 01c48af commit 4e39b6ff35c3206a91c68a095d2b17ce76165666
Showing with 11 additions and 0 deletions.
  1. +11 −0 blocks/calendar_month/block_calendar_month.php
@@ -45,6 +45,12 @@ function get_content() {
// We 'll need this later
calendar_set_referring_course($courseshown);
// MDL-9059, set to show this course when admins go into a course, then unset it.
if ($COURSE->id != SITEID && !isset($SESSION->cal_courses_shown[$COURSE->id]) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM))) {
$courseset = true;
$SESSION->cal_courses_shown[$COURSE->id] = $COURSE;
}
// Be VERY careful with the format for default courses arguments!
// Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
calendar_set_filters($courses, $group, $user, $filtercourse, $filtercourse);
@@ -63,6 +69,11 @@ function get_content() {
$this->content->text .= '<div class="filters">'.calendar_filter_controls('course', '', $COURSE).'</div>';
}
// MDL-9059, unset this so that it doesn't stay in session
if ($courseset) {
unset($SESSION->cal_courses_shown[$COURSE->id]);
}
return $this->content;
}

0 comments on commit 4e39b6f

Please sign in to comment.