Fix handling of CONFIDENTIAL events.

This commit is contained in:
Andrew McMillan 2007-11-05 15:00:24 +13:00
parent e8c826524e
commit b7eae51e77
2 changed files with 15 additions and 2 deletions

View File

@ -64,9 +64,15 @@ else if ( $qry->rows > 1 ) {
$confidential = new iCalendar( array(
'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL',
'DTSTART' => $ical->Get('DTSTART'),
'DURATION' => $ical->Get('DURATION'),
'RRULE' => $ical->Get('RRULE')
) );
$duration = $ical->Get('DURATION');
if ( isset($duration) && $duration != "" ) {
$confidential->Set('DURATION', $duration );
}
else {
$confidential->Set('DTEND', $ical->Get('DTEND') );
}
$response .= $confidential->Render( false, $event->caldav_type );
}
elseif ( $c->hide_alarm ) {

View File

@ -71,13 +71,20 @@ function calendar_to_xml( $properties, $item ) {
if ( !is_numeric(strpos($item->permissions,'A')) && $session->user_no != $item->user_no ){
// the user is not admin / owner of this calendarlooking at his calendar and can not admin the other cal
if ( $item->class == 'CONFIDENTIAL' ) {
$ical = new iCalendar( array( "icalendar" => $caldav_data) );
// if the event is confidential we fake one that just says "Busy"
$confidential = new iCalendar( array(
'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL',
'DTSTART' => $ical->Get('DTSTART'),
'DURATION' => $ical->Get('DURATION'),
'RRULE' => $ical->Get('RRULE')
) );
$duration = $ical->Get('DURATION');
if ( isset($duration) && $duration != "" ) {
$confidential->Set('DURATION', $duration );
}
else {
$confidential->Set('DTEND', $ical->Get('DTEND') );
}
$caldav_data = $confidential->Render( true, $caldav_type );
}
elseif ( $c->hide_alarm ) {