]> source.dussan.org Git - nextcloud-server.git/commitdiff
convert through caldav transmitted rgba calendarcolor to rgb
authorGeorg Ehrke <dev@georgswebsite.de>
Thu, 26 Jul 2012 12:46:03 +0000 (14:46 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Thu, 26 Jul 2012 12:48:00 +0000 (14:48 +0200)
apps/calendar/lib/connector_sabre.php

index 263fb7ffde555b0dfa79ba298ec0037edb1f7eb4..8eea06da7e271a59ac5662ded909de09556d96d5 100644 (file)
@@ -105,6 +105,9 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
                if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
                if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0;
                if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
+               if(!is_null($newValues['calendarcolor']) && strlen($newValues['calendarcolor']) == 9){
+                       $newValues['calendarcolor'] = substr($newValues['calendarcolor'], 0, 7);
+               }
                
                return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
        }
@@ -192,7 +195,10 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
                if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
                if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null;
                if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
-
+               if(!is_null($newValues['calendarcolor']) && strlen($newValues['calendarcolor']) == 9){
+                       $newValues['calendarcolor'] = substr($newValues['calendarcolor'], 0, 7);
+               }
+               
                OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
 
                return true;