From f2acf7707f6ec51b9413f6139860c4cb9ec1daf2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 30 Jan 2012 23:53:06 +0000 Subject: [PATCH] outbox supports VFREEBUSY too, it is required from OS X iCal to autocomplete locations --- calendar/inc/class.calendar_groupdav.inc.php | 15 +++++++++++---- phpgwapi/inc/class.groupdav.inc.php | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index 71df245e70..09ea89dda3 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -1163,20 +1163,27 @@ class calendar_groupdav extends groupdav_handler * @param string $displayname * @param string $base_uri=null base url of handler * @param int $user=null account_id of owner of current collection + * @param string $path=null path of the collection * @return array */ - public function extra_properties(array $props=array(), $displayname, $base_uri=null, $user=null) + public function extra_properties(array $props=array(), $displayname, $base_uri=null, $user=null, $path=null) { if (!isset($props['calendar-description'])) { // default calendar description: can be overwritten via PROPPATCH, in which case it's already set $props['calendar-description'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-description',$displayname); } - // supported components, currently only VEVENT - $props['supported-calendar-component-set'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'supported-calendar-component-set',array( + $supported_components = array( HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'comp',array('name' => 'VCALENDAR')), HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'comp',array('name' => 'VEVENT')), - )); + ); + // outbox supports VFREEBUSY too, it is required from OS X iCal to autocomplete locations + if (substr($path,-8) == '/outbox/') + { + $supported_components[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'comp',array('name' => 'VFREEBUSY')); + } + $props['supported-calendar-component-set'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV, + 'supported-calendar-component-set',$supported_components); $props['supported-report-set'] = HTTP_WebDAV_Server::mkprop('supported-report-set',array( HTTP_WebDAV_Server::mkprop('supported-report',array( HTTP_WebDAV_Server::mkprop('report',array( diff --git a/phpgwapi/inc/class.groupdav.inc.php b/phpgwapi/inc/class.groupdav.inc.php index bac8c02596..9ab7b5db63 100644 --- a/phpgwapi/inc/class.groupdav.inc.php +++ b/phpgwapi/inc/class.groupdav.inc.php @@ -851,7 +851,7 @@ class groupdav extends HTTP_WebDAV_Server { if (method_exists($handler,'extra_properties')) { - $props = $handler->extra_properties($props,$this->account_name($account),$this->base_uri,$user); + $props = $handler->extra_properties($props,$this->account_name($account),$this->base_uri,$user,$path); } // add ctag if handler implements it if (method_exists($handler,'getctag') && $this->prop_requested('getctag') === true)