Skip to content

Commit

Permalink
Fixed a whole bunch of warnings and minor bugs, which all shared a co…
Browse files Browse the repository at this point in the history
…mmon cause:

The preferences screens weren't handling filter changes correctly.
  • Loading branch information
defacer committed Apr 20, 2004
1 parent 5627277 commit 053c98c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ function calendar_filter_controls($type) {
case 'upcoming':
$getvars = '';
break;
case 'prefs':
$getvars = '&from=prefs&pref='.$_GET['edit'];
break;
case 'event':
global $day, $mon, $yr;
$getvars = '&from=event&id='.$_GET['id'];
Expand Down
2 changes: 1 addition & 1 deletion calendar/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);

echo calendar_filter_controls($_GET['view']);
echo calendar_filter_controls('prefs');
echo '<p>';
echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
Expand Down
5 changes: 4 additions & 1 deletion calendar/set.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@
}

switch($_GET['from']) {
case 'prefs':
redirect($CFG->wwwroot.'/calendar/preferences.php?edit='.$_GET['pref']);
break;
case 'month':
redirect($CFG->wwwroot.'/calendar/view.php?view=month&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
redirect($CFG->wwwroot.'/calendar/view.php?view=month&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
break;
case 'upcoming':
redirect($CFG->wwwroot.'/calendar/view.php?view=upcoming&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
Expand Down

0 comments on commit 053c98c

Please sign in to comment.