Menu

#655 Recurring Events

open
5
2012-12-21
2009-11-12
cvolhard
No

Version 2.31

In functions/ical_parser.php $recurrence_d and $recurrence_t have to be unset like the other variables. Otherwise all following events will write their $uid into the $recurrence_delete array.

If a single event of a recurrence event changes the start date/time, both events are displayed.
Example:
You have a weekly event on monday at six o clock. If you change on of theses events to seven o clock, both events are displayed for this monday.

The following Code added to the end of ical_parser.php will hide the default recurrence (in this case, the event at six o clock)
foreach($recurrence_delete as $date => $day_array){
if(isset($master_array[$date])){
foreach($day_array as $time => $uid){
if(isset($master_array[$date][$time][$uid])){
unset($master_array[$date][$time][$uid]);
}
}
}
}

You need to change the functions/parse/end_event.php too.
Replace the following line (line 79)
if (isset($recurrence_d)) {

with

if (isset($recurrence_d) && ($recurrence_d != $start_date || $recurrence_t != $start_time)) {

this modification ensures that a changed event of a recurrence event with no changes at the start date/time will not be removed.

Because the changed event still uses the same uid like the recurrence event, there will be problems if you have two events of the same recurrence event at the same time. This can not be solved without changing the structure of the $master_array.

Discussion

  • Jason Oster

    Jason Oster - 2009-12-24

    I've fixed the unset($recurrence_d, $recurrence_t) in CVS.

    I'll have to investigate the changing-single-recurrence problem, though. As far as I'm aware, we haven't experienced anything like that. If you can provide some additional details (steps to reproduce, maybe?) that will help me out a lot! Thanks.

     
  • cvolhard

    cvolhard - 2010-01-08

    ics file with recurring event and a changed one

     
  • cvolhard

    cvolhard - 2010-01-08

    the attached Intern.ics displays the described problem. It contains a reccuring event on thursday. The event from the 28th is moved to the 27th (changed by Ligthning). Without my modifications both events are displayed. Looked for me like missing code, because the $recurrence_delete array is already setup.

     
  • gibler666

    gibler666 - 2010-12-08

    Yes I'm mystified by $recurrence_delete array as well.
    While it is correctly populating - there doesn't seem to be any code (I can find in 2.4 RC 7) to remove events from the master array.
    So I end up with an extra event when I change the time of one event out of a recurring series (with iCal 4.0.3). UIDs are the same for the series and the event with the changed time.

     

Log in to post a comment.