[Incomplete] Add overridden components into event expansion.

We need to make sure this only inserts overrides that are within
the expansion period, or which override events within the expansion
period, but this quick hack is better than not doing it at all!
This commit is contained in:
Andrew McMillan 2011-08-25 15:07:04 +12:00
parent 05badd4d3a
commit a6c23f3e1a

View File

@ -1106,9 +1106,18 @@ function expand_event_instances( $vResource, $range_start = null, $range_end = n
$component->AddProperty('DURATION', $duration );
if ( $has_repeats && $dtstart->FloatOrUTC($return_floating_times) != $utc )
$component->AddProperty('RECURRENCE-ID', $utc, ($is_date ? array('VALUE' => 'DATE') : null) );
$new_components[] = $component;
$new_components[$utc] = $component;
}
// Add overriden instances
foreach( $components AS $k => $comp ) {
$p = $comp->GetProperty('RECURRENCE-ID');
if (isset($p) && $p->Value() != '') {
$new_components[$p->Value()] = $comp;
if ( DEBUG_RRULE ) printf( "Replacing overridden instance at %s\n", $p->Value());
}
}
$vResource->SetComponents($new_components);
return $vResource;