forked from extern/egroupware
Improve iPhone iCal support
This commit is contained in:
parent
d4985709c5
commit
44c3c7eb9a
@ -475,7 +475,7 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
|
||||
function put(&$options,$id,$user=null)
|
||||
{
|
||||
if ($this->debug) error_log(__METHOD__."($id, $user)".print_r($options,true));
|
||||
|
||||
|
||||
$return_no_access = true; // as handled by importVCal anyway and allows it to set the status for participants
|
||||
$oldEvent = $this->_common_get_put_delete('PUT',$options,$id,$return_no_access);
|
||||
if (!is_null($oldEvent) && !is_array($oldEvent))
|
||||
@ -867,6 +867,15 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
|
||||
*/
|
||||
static function extra_properties(array $props=array(), $displayname, $base_uri=null)
|
||||
{
|
||||
if (strlen($GLOBALS['egw_info']['user']['preferences']['calendar']['display_color']) == 9 &&
|
||||
$GLOBALS['egw_info']['user']['preferences']['calendar']['display_color'][0] == '#')
|
||||
{
|
||||
$display_color = $GLOBALS['egw_info']['user']['preferences']['calendar']['display_color'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$display_color = '#0040A0FF';
|
||||
}
|
||||
// calendar description
|
||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-description',$displayname);
|
||||
/*
|
||||
@ -903,7 +912,7 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
|
||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'supported-calendar-data',array(
|
||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-data', array('content-type' => 'text/calendar', 'version'=> '2.0')),
|
||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-data', array('content-type' => 'text/x-calendar', 'version'=> '1.0'))));
|
||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::ICAL,'calendar-color','#0040A0FF'); // TODO: make it configurable
|
||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::ICAL,'calendar-color',$display_color);
|
||||
//$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALENDARSERVER,'publish-url',array(
|
||||
// HTTP_WebDAV_Server::mkprop('href',$base_uri.'/calendar/')));
|
||||
|
||||
@ -920,7 +929,7 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
|
||||
{
|
||||
$handler = new calendar_ical();
|
||||
$handler->setSupportedFields('GroupDAV',$this->agent);
|
||||
if ($this->debug > 1) error_log("ical Handler called:" . $this->agent);
|
||||
if ($this->debug > 1) error_log("ical Handler called: " . $this->agent);
|
||||
return $handler;
|
||||
}
|
||||
}
|
||||
|
@ -410,6 +410,16 @@ class calendar_hooks
|
||||
'xmlrpc' => True,
|
||||
'admin' => False
|
||||
),
|
||||
'display_color' => array(
|
||||
'type' => 'input',
|
||||
'size' => 9,
|
||||
'label' => 'Select a color for this calendar',
|
||||
'name' => 'display_color',
|
||||
'help' => 'The Apple iCal Apps use this color to display events from this calendar.',
|
||||
'forced' => '#0040A0FF',
|
||||
'xmlrpc' => True,
|
||||
'admin' => False
|
||||
),
|
||||
'default_private' => array(
|
||||
'type' => 'check',
|
||||
'label' => 'Set new events to private',
|
||||
|
@ -619,8 +619,19 @@ class calendar_ical extends calendar_boupdate
|
||||
$rrule = $rriter->generate_rrule($version);
|
||||
if ($event['recur_enddate'])
|
||||
{
|
||||
$length = ($event['end'] - $event['start']) / 2;
|
||||
$rrule['UNTIL']->modify($length . ' second');
|
||||
if ($this->productManufacturer == 'groupdav' && $this->productName == 'iphone')
|
||||
{
|
||||
// Fix iPhone issue
|
||||
$length = ($event['end'] - $event['start']);
|
||||
$rrule['UNTIL']->modify($length . ' second');
|
||||
$rrule['UNTIL']->setTime(23, 59, 59);
|
||||
}
|
||||
else
|
||||
{
|
||||
$length = ($event['end'] - $event['start']) / 2;
|
||||
$rrule['UNTIL']->modify($length . ' second');
|
||||
}
|
||||
|
||||
if (!$tzid || $version != '1.0')
|
||||
{
|
||||
if (!isset(self::$tz_cache['UTC']))
|
||||
|
@ -341,6 +341,7 @@ abstract class groupdav_handler
|
||||
// identify the agent (GroupDAV client) from the HTTP_USER_AGENT header
|
||||
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
foreach(array(
|
||||
'iphone' => 'iphone', // Apple iPhone iCal
|
||||
'davkit' => 'davkit', // Apple iCal
|
||||
'cfnetwork' => 'cfnetwork', // Apple Addressbook
|
||||
'bionicmessage.net' => 'funambol', // funambol GroupDAV connector from bionicmessage.net
|
||||
@ -372,6 +373,9 @@ abstract class groupdav_handler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($debug) error_log(__METHOD__."GroupDAV client: $agent");
|
||||
|
||||
return $agent;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user