From: toyomoyo Date: Thu, 11 Oct 2007 05:24:12 +0000 (+0000) Subject: MDL-10353, calender redirection broken when editting and exporting X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b426fd83230cc6e275e4b705f433ed94d63905c4;p=moodle.git MDL-10353, calender redirection broken when editting and exporting --- diff --git a/calendar/export.php b/calendar/export.php index c97dd274c2..37a2cbf611 100644 --- a/calendar/export.php +++ b/calendar/export.php @@ -9,12 +9,7 @@ $action = optional_param('action', '', PARAM_ALPHA); $day = optional_param('cal_d', 0, PARAM_INT); $mon = optional_param('cal_m', 0, PARAM_INT); $yr = optional_param('cal_y', 0, PARAM_INT); - -if (isset($SESSION->cal_course_referer)) { - $course = $SESSION->cal_course_referer; -} else { - $course = optional_param('course', 0, PARAM_INT); -} +$courseid = optional_param('course', 0, PARAM_INT); require_login(); @@ -43,8 +38,12 @@ if(!checkdate($mon, $day, $yr)) { } $time = make_timestamp($yr, $mon, $day); -$SESSION->cal_courses_shown = calendar_get_default_courses(true); -calendar_set_referring_course(0); +if (empty($USER->id) or isguest()) { + $defaultcourses = calendar_get_default_courses(); + calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses); +} else { + calendar_set_filters($courses, $groups, $users); +} if (empty($USER->id) or isguest()) { $defaultcourses = calendar_get_default_courses(); diff --git a/calendar/view.php b/calendar/view.php index 3e382199cc..506903488f 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -607,6 +607,7 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $ echo '
'; foreach ($events as $event) { + $event->calendarcourseid = $courseid; calendar_print_event($event); } echo '
';