mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-01 16:11:20 +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(
|
$confidential = new iCalendar( array(
|
||||||
'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL',
|
'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL',
|
||||||
'DTSTART' => $ical->Get('DTSTART'),
|
'DTSTART' => $ical->Get('DTSTART'),
|
||||||
'DURATION' => $ical->Get('DURATION'),
|
|
||||||
'RRULE' => $ical->Get('RRULE')
|
'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 );
|
$response .= $confidential->Render( false, $event->caldav_type );
|
||||||
}
|
}
|
||||||
elseif ( $c->hide_alarm ) {
|
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 ){
|
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
|
// the user is not admin / owner of this calendarlooking at his calendar and can not admin the other cal
|
||||||
if ( $item->class == 'CONFIDENTIAL' ) {
|
if ( $item->class == 'CONFIDENTIAL' ) {
|
||||||
|
$ical = new iCalendar( array( "icalendar" => $caldav_data) );
|
||||||
// if the event is confidential we fake one that just says "Busy"
|
// if the event is confidential we fake one that just says "Busy"
|
||||||
$confidential = new iCalendar( array(
|
$confidential = new iCalendar( array(
|
||||||
'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL',
|
'SUMMARY' => translate('Busy'), 'CLASS' => 'CONFIDENTIAL',
|
||||||
'DTSTART' => $ical->Get('DTSTART'),
|
'DTSTART' => $ical->Get('DTSTART'),
|
||||||
'DURATION' => $ical->Get('DURATION'),
|
|
||||||
'RRULE' => $ical->Get('RRULE')
|
'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 );
|
$caldav_data = $confidential->Render( true, $caldav_type );
|
||||||
}
|
}
|
||||||
elseif ( $c->hide_alarm ) {
|
elseif ( $c->hide_alarm ) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user