Use folder annotations to save calendar colors according to KEP #12

This commit is contained in:
Thomas 2011-09-30 17:28:29 +02:00
parent 95f0d84cfe
commit 60502d4763
2 changed files with 3 additions and 4 deletions

View file

@ -155,11 +155,10 @@ class kolab_calendar
{ {
// color is defined in folder METADATA // color is defined in folder METADATA
// FIXME: Kolab_Folder::getKolabAttribute() only reads value.shared; value.priv should be considered first // FIXME: Kolab_Folder::getKolabAttribute() only reads value.shared; value.priv should be considered first
/* DISABLED until KEP #12 is approved
if ($color = $this->storage->_folder->getKolabAttribute('color')) { if ($color = $this->storage->_folder->getKolabAttribute('color')) {
return $color; return $color;
} }
*/
// calendar color is stored in user prefs (temporary solution) // calendar color is stored in user prefs (temporary solution)
$prefs = $this->cal->rc->config->get('kolab_calendars', array()); $prefs = $this->cal->rc->config->get('kolab_calendars', array());

View file

@ -318,14 +318,14 @@ class kolab_driver extends calendar_driver
// save color in METADATA // save color in METADATA
// TODO: also save 'showalarams' and other properties here // TODO: also save 'showalarams' and other properties here
/* DISABLED until KEP #12 is approved
if ($result && $prop['color']) { if ($result && $prop['color']) {
if (!($meta_saved = $this->rc->imap->set_metadata($folder, array('/shared/vendor/kolab/color' => $prop['color'])))) // try in shared namespace if (!($meta_saved = $this->rc->imap->set_metadata($folder, array('/shared/vendor/kolab/color' => $prop['color'])))) // try in shared namespace
$meta_saved = $this->rc->imap->set_metadata($folder, array('/private/vendor/kolab/color' => $prop['color'])); // try in private namespace $meta_saved = $this->rc->imap->set_metadata($folder, array('/private/vendor/kolab/color' => $prop['color'])); // try in private namespace
if ($meta_saved) if ($meta_saved)
unset($prop['color']); // unsetting will prevent fallback to local user prefs unset($prop['color']); // unsetting will prevent fallback to local user prefs
} }
*/
return $result ? $folder : false; return $result ? $folder : false;
} }