$prevlink = calendar_get_link_tag('<<', 'view.php?id='.$data['id'].'&', 0, $prevmonth, $prevyear);
$content .= '<table class="generaltable" style="width: 100%;"><tr>';
$content .= '<td style="text-align: left; width: 12%;">'.$prevlink."</td>\n";
- $content .= '<td style="text-align: center;"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month&', 1, $data['m'], $data['y']).'">'.strftime(get_string('strftimemonthyear'), $time)."</a></td>\n";
+ $content .= '<td style="text-align: center;"><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=month&course='.$data['id'].'&', 1, $data['m'], $data['y']).'">'.strftime(get_string('strftimemonthyear'), $time)."</a></td>\n";
$content .= '<td style="text-align: right; width: 12%;">'.$nextlink."</td>\n";
$content .= '</tr></table>';
break;
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']);
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);
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;
if (!empty($underway)) {
echo '<p style="text-align: center;"><strong>'.get_string('spanningevents', 'calendar').':</strong></p>';
foreach ($underway as $event) {
- calendar_print_event($event);
+ calendar_print_event($event);
}
}
}
$text = '<div style="float: left;">'.get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming').'</div><div style="float: right;">';
$text.= '<form style="display: inline;" action="'.CALENDAR_URL.'event.php" method="get">';
$text.= '<input type="hidden" name="action" value="new" />';
+ /*
$text.= '<input type="hidden" name="cal_m" value="'.$m.'" />';
$text.= '<input type="hidden" name="cal_y" value="'.$y.'" />';
+ */
$text.= '<input type="submit" value="'.get_string('newevent', 'calendar').'" />';
$text.= '</form></div>';
}
$editlink = "$CFG->wwwroot/mod/$event->modulename/view.php?id=$event->cmid";
$deletelink = "$CFG->wwwroot/course/mod.php?delete=$event->cmid";
}
- echo ' <a href="'.$editlink.'"><img
- src="'.$CFG->pixpath.'/t/edit.gif" alt="'.get_string('tt_editevent', 'calendar').'"
+ echo ' <a href="'.$editlink.'"><img
+ src="'.$CFG->pixpath.'/t/edit.gif" alt="'.get_string('tt_editevent', 'calendar').'"
title="'.get_string('tt_editevent', 'calendar').'" /></a>';
- echo ' <a href="'.$deletelink.'"><img
- src="'.$CFG->pixpath.'/t/delete.gif" alt="'.get_string('tt_deleteevent', 'calendar').'"
+ echo ' <a href="'.$deletelink.'"><img
+ src="'.$CFG->pixpath.'/t/delete.gif" alt="'.get_string('tt_deleteevent', 'calendar').'"
title="'.get_string('tt_deleteevent', 'calendar').'" /></a>';
echo '</div>';
}
$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('<form', '<form style="display: inline;"', $form);