From f10f1b7bdcf7ab3fdb8863b867a45e2676ae39c3 Mon Sep 17 00:00:00 2001 From: defacer Date: Fri, 21 May 2004 13:51:02 +0000 Subject: [PATCH] * Removed one obsolete function * Changed the expired events' color to dimmed * Added "new event" button in upcoming events screen * Small improvement (more robust) in redirection from set.php to upcoming events --- calendar/lib.php | 4 ++-- calendar/set.php | 2 +- calendar/view.php | 31 +++++++++++++------------------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index d6a1aadfac..0e5e32a25a 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -307,8 +307,8 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve $time = calendar_time_representation($event->timestart + $event->timeduration); // This var always has the printable time representation - $eventtime = ''.get_string('expired', 'calendar').' '. - calendar_get_link_tag($day, CALENDAR_URL.'view.php?view=day&', $enddate['mday'], $enddate['mon'], $enddate['year']).' ('.$time.')'; + $eventtime = ''.$day.' ('.$time.')'; + } else if($event->timeduration) { // It has a duration diff --git a/calendar/set.php b/calendar/set.php index 108386cf04..b4c710287c 100644 --- a/calendar/set.php +++ b/calendar/set.php @@ -89,7 +89,7 @@ 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']); + redirect($CFG->wwwroot.'/calendar/view.php?view=upcoming'); break; case 'day': redirect($CFG->wwwroot.'/calendar/view.php?view=day&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']); diff --git a/calendar/view.php b/calendar/view.php index 8867e2d81f..dd97d8fcd3 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -164,20 +164,6 @@ print_footer(); -function calendar_show_event($event) { - // In this case, we haven't been given month, day, year. So we 'll have to - // get them from the event date, and return them to the main function. - - $startdate = usergetdate($event->timestart); // This is only to be returned - $coursecache = array(); - - print_side_block_start(get_string('eventview', 'calendar'), '', 'mycalendar'); - calendar_print_event_table($event, $event->timestart, $event->timestart + $event->timeduration, $coursecache, true); - print_side_block_end(); - - return $startdate; // We need this to set "current" day, month, year -} - function calendar_show_day($d, $m, $y, $courses, $groups, $users) { global $CFG, $THEME; @@ -512,12 +498,21 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $ $events = calendar_get_upcoming($courses, $groups, $users, $futuredays, $maxevents); $numevents = count($events); - if(!$numevents) { - // There are no events in the specified time period - return; + // New event button + if(isguest()) { + $text = get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming'); + } + else { + $text = '
'.get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming').'
'; + $text.= '
'; + $text.= ''; + $text.= ''; + $text.= ''; + $text.= ''; + $text.= '
'; } - print_side_block_start(get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming'), '', 'mycalendar'); + print_side_block_start($text, '', 'mycalendar'); for($i = 0; $i < $numevents; ++$i) { echo '

'; if(!empty($events[$i]->icon)) { -- 2.39.5