Fix bug in hide_alarm handling.

This commit is contained in:
Andrew McMillan 2008-12-18 22:52:11 +13:00
parent a1aa782c17
commit 0fb962fd6c

View File

@ -102,13 +102,8 @@ function calendar_to_xml( $properties, $item ) {
elseif ( isset($c->hide_alarm) && $c->hide_alarm ) {
// Otherwise we hide the alarms (if configured to)
$ical = new iCalComponent( $caldav_data );
$timezones = $ical->GetComponents('VTIMEZONE',true);
$resources = $ical->GetComponents('VTIMEZONE',false);
foreach( $resources AS $k => $v ) {
$v->ClearComponents('VALARM');
}
$ical->SetComponents($timezones + $resources);
$caldav_data = $ical->render(true, $caldav_type );
$ical->ClearComponents( 'VALARM' );
$caldav_data = $ical->Render();
}
}
}