mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
calendar-timezone needs full vcalendar component, not just a vtimezone
This commit is contained in:
parent
ceaec3d3c1
commit
d898e6c627
@ -1047,7 +1047,7 @@ class calendar_groupdav extends groupdav_handler
|
||||
if ($this->groupdav->prop_requested('calendar-timezone'))
|
||||
{
|
||||
$props['calendar-timezone'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-timezone',
|
||||
calendar_timezones::user_timezone($user, 'component'));
|
||||
calendar_timezones::user_timezone($user));
|
||||
}
|
||||
return $props;
|
||||
}
|
||||
|
@ -373,10 +373,10 @@ class calendar_timezones
|
||||
* Query timezone of a given user, returns 'tzid' or VTIMEZONE 'component'
|
||||
*
|
||||
* @param int $user=null
|
||||
* @param string $type='component' everything tz2id supports
|
||||
* @param string $type='vcalendar' 'tzid' or everything tz2id supports, default 'vcalendar' = full vcalendar component
|
||||
* @return string
|
||||
*/
|
||||
public static function user_timezone($user=null, $type='component')
|
||||
public static function user_timezone($user=null, $type='vcalendar')
|
||||
{
|
||||
if (!$user || $user == $GLOBALS['egw_info']['user']['account_id'])
|
||||
{
|
||||
@ -390,9 +390,22 @@ class calendar_timezones
|
||||
}
|
||||
if (!$tzid) $tzid = egw_time::$server_timezone->getName();
|
||||
|
||||
if ($type != 'tzid')
|
||||
switch ($type)
|
||||
{
|
||||
return self::tz2id($tzid,$type);
|
||||
case 'vcalendar':
|
||||
include_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/lib/core.php';
|
||||
// checking type of $val, now we included the object definition (no need to always include it!)
|
||||
$vcal = new Horde_iCalendar;
|
||||
$vcal->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware Calendar '.$GLOBALS['egw_info']['apps']['calendar']['version'].'//'.
|
||||
strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']));
|
||||
self::add_vtimezone($vcal, $tzid);
|
||||
$tzid = $vcal->exportvCalendar('utf-8');
|
||||
break;
|
||||
case 'tzid':
|
||||
break;
|
||||
default:
|
||||
$tzid = self::tz2id($tzid,$type == 'vcalendar' ? 'component' : $type);
|
||||
break;
|
||||
}
|
||||
return $tzid;
|
||||
}
|
||||
|
@ -591,17 +591,17 @@ class infolog_groupdav extends groupdav_handler
|
||||
{
|
||||
// calendar description
|
||||
$displayname = translation::convert(lang('Tasks of'),translation::charset(),'utf-8').' '.$displayname;
|
||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-description',$displayname);
|
||||
$props['calendar-description'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-description',$displayname);
|
||||
// supported components, currently only VEVENT
|
||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'supported-calendar-component-set',array(
|
||||
$props['supported-calendar-component-set'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'supported-calendar-component-set',array(
|
||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'comp',array('name' => 'VCALENDAR')),
|
||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'comp',array('name' => 'VTODO')),
|
||||
));
|
||||
// supported reports
|
||||
$props[] = HTTP_WebDAV_Server::mkprop('supported-report-set',array(
|
||||
$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(
|
||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-query',''))),
|
||||
HTTP_WebDAV_Server::mkprop('supported-report',array(
|
||||
HTTP_WebDAV_Server::mkprop('report',array(
|
||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-multiget','')))))));
|
||||
|
||||
@ -609,7 +609,7 @@ class infolog_groupdav extends groupdav_handler
|
||||
if ($this->groupdav->prop_requested('calendar-timezone'))
|
||||
{
|
||||
$props['calendar-timezone'] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-timezone',
|
||||
calendar_timezones::user_timezone($user, 'component'));
|
||||
calendar_timezones::user_timezone($user));
|
||||
}
|
||||
return $props;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user