From ae7ae4943a33391e82b07a6991bcc768ceb70e2c Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 15 Nov 2003 19:22:07 +0000 Subject: Fix for [ phpicalendar-Bugs-822211 ] repeating calendar event displays wrong --- config.inc.php | 2 +- functions/ical_parser.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config.inc.php b/config.inc.php index 0347f96..c98c840 100644 --- a/config.inc.php +++ b/config.inc.php @@ -12,7 +12,7 @@ $default_cal = $ALL_CALENDARS_COMBINED; // Exact filename of calendar withou $language = 'English'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish', 'Swedish', 'Portuguese', 'Catalan', 'Traditional_Chinese', 'Esperanto' $week_start_day = 'Sunday'; // Day of the week your week starts on $day_start = '0800'; // Start time for day grid -$day_end = '2000'; // End time for day grid +$day_end = '2400'; // End time for day grid $gridLength = '15'; // Grid distance in minutes for day view, multiples of 15 preferred $num_years = '3'; // Number of years to display in 'Jump to' $month_event_lines = '1'; // Number of lines to wrap each event title in month view, 0 means display all lines. diff --git a/functions/ical_parser.php b/functions/ical_parser.php index c46583c..6ea3baa 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -107,6 +107,7 @@ foreach ($cal_filelist as $filename) { $first_duration = TRUE; $count = 1000000; $valarm_set = FALSE; + $firstday = FALSE; $attendee = array(); $organizer = array(); @@ -246,15 +247,13 @@ foreach ($cal_filelist as $filename) { if ($start_date_tmp == $start_date) { $time_tmp = $hour.$minute; $start_time_tmp = $start_time; + $end_time_tmp = '0000'; } else { $time_tmp = '0000'; $start_time_tmp = '0000'; - } - if ($start_date_tmp == $end_date_tmp) { $end_time_tmp = $end_time; - } else { - $end_time_tmp = '2400'; } + $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'start_unixtime' => $start_unixtime, 'end_unixtime' => $end_unixtime, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee) ); $start_tmp = strtotime('+1 day',$start_tmp); @@ -580,23 +579,24 @@ foreach ($cal_filelist as $filename) { $end_date_tmp = date('Ymd',$end_unixtime_tmp); while ($start_tmp < $end_unixtime_tmp) { $start_date_tmp = date('Ymd',$start_tmp); - if ($start_date_tmp == $start_date) { + if (($start_date_tmp == $start_date) || ($firstday == FALSE)) { $time_tmp = $hour.$minute; $start_time_tmp = $start_time; + $end_time_tmp = '0000'; + $firstday = TRUE; } else { $time_tmp = '0000'; $start_time_tmp = '0000'; - } - if ($start_date_tmp == $end_date_tmp) { $end_time_tmp = $end_time; - } else { - $end_time_tmp = '2400'; + $firstday = FALSE; } + $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber); $start_tmp = strtotime('+1 day',$start_tmp); } } else { + // Let's double check the until to not write past it $until_check = $recur_data_date.$hour.$minute.'00'; if ($abs_until > $until_check) { @@ -631,7 +631,7 @@ foreach ($cal_filelist as $filename) { } // Clear event data now that it's been saved. - unset($start_time, $start_time_tmp, $end_time, $end_time_tmp, $start_unixtime, $start_unixtime_tmp, $end_unixtime, $end_unixtime_tmp, $summary, $length, $nbrOfOverlaps, $description, $status, $class, $location, $organizer, $attendee); + unset($time_tmp, $start_time, $start_time_tmp, $end_time, $end_time_tmp, $start_unixtime, $start_unixtime_tmp, $end_unixtime, $end_unixtime_tmp, $summary, $length, $nbrOfOverlaps, $description, $status, $class, $location, $organizer, $attendee); // Begin VTODO Support -- cgit v1.2.3