mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-02-23 05:03:38 +00:00
Fix handling of CONFIDENTIAL events.
This commit is contained in:
parent
e8c826524e
commit
b7eae51e77
@ -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 ) {
|
||||
|
||||
@ -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 ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user