mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-04 20:40:14 +01:00
* CalDAV: Apply other users' calendar color, too
This commit is contained in:
parent
12a7d6534f
commit
c59cb90742
@ -867,15 +867,6 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
|
|||||||
*/
|
*/
|
||||||
static function extra_properties(array $props=array(), $displayname, $base_uri=null)
|
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
|
// calendar description
|
||||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-description',$displayname);
|
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-description',$displayname);
|
||||||
/*
|
/*
|
||||||
@ -912,7 +903,6 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
|
|||||||
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'supported-calendar-data',array(
|
$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/calendar', 'version'=> '2.0')),
|
||||||
HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-data', array('content-type' => 'text/x-calendar', 'version'=> '1.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',$display_color);
|
|
||||||
//$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALENDARSERVER,'publish-url',array(
|
//$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALENDARSERVER,'publish-url',array(
|
||||||
// HTTP_WebDAV_Server::mkprop('href',$base_uri.'/calendar/')));
|
// HTTP_WebDAV_Server::mkprop('href',$base_uri.'/calendar/')));
|
||||||
|
|
||||||
|
@ -385,14 +385,32 @@ class groupdav extends HTTP_WebDAV_Server
|
|||||||
function _properties($app,$no_extra_types=false,$user=null,$path='/')
|
function _properties($app,$no_extra_types=false,$user=null,$path='/')
|
||||||
{
|
{
|
||||||
if ($this->debug) error_log(__METHOD__."(app='$app', no_extra_types=$no_extra_types, user='$user', path='$path')");
|
if ($this->debug) error_log(__METHOD__."(app='$app', no_extra_types=$no_extra_types, user='$user', path='$path')");
|
||||||
|
$user_preferences = $GLOBALS['egw_info']['user']['preferences'];
|
||||||
if ($user)
|
if ($user)
|
||||||
{
|
{
|
||||||
$account_lid = $this->accounts->id2name($user);
|
$account_lid = $this->accounts->id2name($user);
|
||||||
|
if ($user >= 0 && $GLOBALS['egw']->preferences->account_id != $user)
|
||||||
|
{
|
||||||
|
$GLOBALS['egw']->preferences->__construct($user);
|
||||||
|
$user_preferences = $GLOBALS['egw']->preferences->read_repository();
|
||||||
|
$GLOBALS['egw']->preferences->__construct($GLOBALS['egw_info']['user']['account_lid']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$account_lid = $GLOBALS['egw_info']['user']['account_lid'];
|
$account_lid = $GLOBALS['egw_info']['user']['account_lid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strlen($user_preferences['calendar']['display_color']) == 9 &&
|
||||||
|
$user_preferences['calendar']['display_color'][0] == '#')
|
||||||
|
{
|
||||||
|
$display_color = $user_preferences['calendar']['display_color'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$display_color = '#0040A0FF';
|
||||||
|
}
|
||||||
|
|
||||||
$account = $this->accounts->read($account_lid);
|
$account = $this->accounts->read($account_lid);
|
||||||
$displayname = $GLOBALS['egw']->translation->convert($account['account_fullname'],
|
$displayname = $GLOBALS['egw']->translation->convert($account['account_fullname'],
|
||||||
$GLOBALS['egw']->translation->charset(),'utf-8');
|
$GLOBALS['egw']->translation->charset(),'utf-8');
|
||||||
@ -433,6 +451,7 @@ class groupdav extends HTTP_WebDAV_Server
|
|||||||
// OUTBOX URLs of the current user
|
// OUTBOX URLs of the current user
|
||||||
$props[] = self::mkprop(groupdav::CALDAV,'schedule-outbox-URL',
|
$props[] = self::mkprop(groupdav::CALDAV,'schedule-outbox-URL',
|
||||||
array(self::mkprop(groupdav::DAV,'href',$this->base_uri.'/calendar/')));
|
array(self::mkprop(groupdav::DAV,'href',$this->base_uri.'/calendar/')));
|
||||||
|
$props[] = self::mkprop(groupdav::ICAL,'calendar-color',$display_color);
|
||||||
break;
|
break;
|
||||||
case 'infolog':
|
case 'infolog':
|
||||||
$props[] = self::mkprop(groupdav::CALDAV,'calendar-home-set',array(
|
$props[] = self::mkprop(groupdav::CALDAV,'calendar-home-set',array(
|
||||||
|
Loading…
Reference in New Issue
Block a user