From: defacer Date: Mon, 24 May 2004 09:20:01 +0000 (+0000) Subject: Preliminary fix for bug 1451 (needs some more work). X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=227bc46b519d4bb5a0d6c2e8cc8811153d999387;p=moodle.git Preliminary fix for bug 1451 (needs some more work). Also a couple of notices removed. --- diff --git a/blocks/calendar_upcoming/block_calendar_upcoming.php b/blocks/calendar_upcoming/block_calendar_upcoming.php index 1e4540261c..4be9cf69fc 100644 --- a/blocks/calendar_upcoming/block_calendar_upcoming.php +++ b/blocks/calendar_upcoming/block_calendar_upcoming.php @@ -21,7 +21,7 @@ class CourseBlock_calendar_upcoming extends MoodleBlock { $this->content = New object; $this->content->text = ''; - $this->content->footer = '
'.get_string('gotocalendar', 'calendar').'...'; + $this->content->footer = '
'.get_string('gotocalendar', 'calendar').'...'; $this->content->footer .= '
'.get_string('newevent', 'calendar').'...'; if($this->course === NULL) { diff --git a/calendar/lib.php b/calendar/lib.php index f176cb9b24..d6a3218234 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -530,7 +530,7 @@ function calendar_top_controls($type, $data) { $prevlink = calendar_get_link_tag('<<', 'view.php?id='.$data['id'].'&', 0, $prevmonth, $prevyear); $content .= ''; $content .= '\n"; - $content .= '\n"; + $content .= '\n"; $content .= '\n"; $content .= '
'.$prevlink."'.strftime(get_string('strftimemonthyear'), $time)."'.strftime(get_string('strftimemonthyear'), $time)."'.$nextlink."
'; break; diff --git a/calendar/view.php b/calendar/view.php index 9f6dfc3f1b..7134019724 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -47,6 +47,7 @@ require_login(); optional_variable($_GET['view'], 'upcoming'); + optional_variable($_GET['course'], 0); optional_variable($_GET['cal_d']); optional_variable($_GET['cal_m']); optional_variable($_GET['cal_y']); @@ -90,6 +91,13 @@ break; } + // If a course has been supplied in the URL, change the filters to show that one + if(!empty($_GET['course'])) { + if(is_numeric($_GET['course']) && $_GET['course'] > 0 && record_exists('course', 'id', $_GET['course'])) { + $SESSION->cal_courses_shown = $_GET['course']; + } + } + if(isguest($USER->id)) { $defaultcourses = calendar_get_default_courses(); calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses); @@ -211,7 +219,7 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) { foreach ($events as $event) { if ($event->timestart >= $starttime && $event->timestart <= $endtime) { // Print it now unset($event->time); - calendar_print_event($event); + calendar_print_event($event); } else { // Save this for later $underway[] = $event; @@ -222,7 +230,7 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) { if (!empty($underway)) { echo '

'.get_string('spanningevents', 'calendar').':

'; foreach ($underway as $event) { - calendar_print_event($event); + calendar_print_event($event); } } } @@ -494,8 +502,10 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $ $text = '
'.get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming').'
'; $text.= '
'; $text.= ''; + /* $text.= ''; $text.= ''; + */ $text.= ''; $text.= '
'; } @@ -558,11 +568,11 @@ function calendar_print_event($event) { $editlink = "$CFG->wwwroot/mod/$event->modulename/view.php?id=$event->cmid"; $deletelink = "$CFG->wwwroot/course/mod.php?delete=$event->cmid"; } - echo ' '.get_string('tt_editevent', 'calendar').''.get_string('tt_editevent', 'calendar').''; - echo ' '.get_string('tt_deleteevent', 'calendar').''.get_string('tt_deleteevent', 'calendar').''; echo ''; } @@ -598,7 +608,7 @@ function calendar_course_filter_selector($getvars = '') { $selected = ''; } - $form = popup_form(CALENDAR_URL.'set.php?var=setcourse&'.$getvars.'&id=', + $form = popup_form(CALENDAR_URL.'set.php?var=setcourse&'.$getvars.'&id=', $courseoptions, 'cal_course_flt', $selected, '', '', '', true); return str_replace('