Adding simple differentiation between own calendars (and events) and shared.

This commit is contained in:
Bogomil Shopov (Kolab Systems) 2011-06-19 14:46:38 +03:00
parent 0a3738a0f9
commit 345956c42a
2 changed files with 8 additions and 3 deletions

View file

@ -90,10 +90,13 @@ class kolab_calendar
/**
* Return color to display this calendar
*/
public function get_color()
public function get_color($owner)
{
// TODO: read color from backend (not yet supported)
return '0000dd';
//temporary color deffirence between own calendars and the rest
if ($owner == $_SESSION['username'])
return 'd63355';
return '1f9ebe';
}
@ -135,6 +138,7 @@ class kolab_calendar
// resolve recurring events (maybe move to _fetch_events() for general use?)
if ($event['recurrence']) {
$recurrence = new Horde_Date_Recurrence($event['start']);
$recurrence->fromRRule20(calendar::to_rrule($event['recurrence']));
@ -169,6 +173,7 @@ class kolab_calendar
* Create a new event record
*
* @see Driver:new_event()
*
* @return mixed The created record ID on success, False on error
*/
public function insert_event($event)

View file

@ -71,7 +71,7 @@ class kolab_driver extends calendar_driver
'id' => $calendar->id,
'name' => $calendar->get_name(),
'editname' => $calendar->get_foldername(),
'color' => $calendar->get_color(),
'color' => $calendar->get_color($c_folder->_owner),
'readonly' => $c_folder->_owner != $_SESSION['username'],
);
}