]> git.mxchange.org Git - friendica-addons.git/commitdiff
Update Changelog, + CalDAV-related bugfix
authorTobias Hößl <tobias@hoessl.eu>
Sat, 28 Jul 2012 10:58:12 +0000 (10:58 +0000)
committerTobias Hößl <tobias@hoessl.eu>
Sat, 28 Jul 2012 10:58:12 +0000 (10:58 +0000)
dav/Changelog.txt
dav/common/dav_caldav_backend_private.inc.php
dav/dav_caldav_backend_virtual_friendica.inc.php
dav/main.php

index a252673e19935f52970b3b434a20bd25ffab2b4a..90117b718300b6e87711c04d5aa121df4f2c5e85 100644 (file)
@@ -1,7 +1,9 @@
-v0.2.0-pre
+v0.2.0
 ======
-[FEATURE] Multiple private Calendars can be created.
+[FEATURE] Multiple private Calendars can be created. Each calendar can have its own default color; single events of a calendar can override this setting.
 [FEATURE] Support for recurring events.
+[FEATURE] ICS files can be imported to and exported from a calendar.
+[FEATURE] Notification by e-mail is supported.
 [COMPATIBILITY] When creating or updating an event using CalDAV, the etag is returned.
 
 v0.1.1
index 6ca24c28e0afe1d81e265300d1522c65a6ebd468..5356280a42c225a98797836306aafb272dfd1b0d 100644 (file)
@@ -34,7 +34,8 @@ class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
         * @static
         * @return string
         */
-       public static function getBackendTypeName() {
+       public static function getBackendTypeName()
+       {
                return t("Private Events");
        }
 
@@ -110,9 +111,9 @@ class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
         */
        public function listItemsByRange($calendarId, $sd, $ed, $base_path)
        {
-               $calendar = Sabre_CalDAV_Backend_Common::loadCalendarById($calendarId);
-               $von      = wdcal_php2MySqlTime($sd);
-               $bis      = wdcal_php2MySqlTime($ed);
+               $calendar       = Sabre_CalDAV_Backend_Common::loadCalendarById($calendarId);
+               $von            = wdcal_php2MySqlTime($sd);
+               $bis            = wdcal_php2MySqlTime($ed);
                $timezoneOffset = date("P");
 
                // @TODO Events, die früher angefangen haben, aber noch andauern
@@ -166,12 +167,17 @@ class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
                        if (!isset($cal["uri"])) throw new DAVVersionMismatchException();
                        if (in_array($cal["uri"], $GLOBALS["CALDAV_PRIVATE_SYSTEM_CALENDARS"])) continue;
 
+                       $components = array();
+                       if ($cal["has_vevent"]) $components[] = "VEVENT";
+                       if ($cal["has_vtodo"]) $components[] = "VTODO";
+
                        $dat = array(
-                               "id"                                                      => $cal["id"],
-                               "uri"                                                     => $cal["uri"],
-                               "principaluri"                                            => $principalUri,
-                               '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag' => $cal['ctag'] ? $cal['ctag'] : '0',
-                               "calendar_class"                                          => "Sabre_CalDAV_Calendar",
+                               "id"                                                                       => $cal["id"],
+                               "uri"                                                                      => $cal["uri"],
+                               "principaluri"                                                             => $principalUri,
+                               '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag'                  => $cal['ctag'] ? $cal['ctag'] : '0',
+                               '{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre_CalDAV_Property_SupportedCalendarComponentSet($components),
+                               "calendar_class"                                                           => "Sabre_CalDAV_Calendar",
                        );
                        foreach ($this->propertyMap as $key=> $field) $dat[$key] = $cal[$field];
 
@@ -191,7 +197,7 @@ class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
         * @param string $principalUri
         * @param string $calendarUri
         * @param array $properties
-        * @throws Sabre_DAV_Exception
+        * @throws Sabre_DAV_Exception|Sabre_DAV_Exception_Conflict
         * @return string|void
         */
        public function createCalendar($principalUri, $calendarUri, array $properties)
@@ -200,7 +206,7 @@ class Sabre_CalDAV_Backend_Private extends Sabre_CalDAV_Backend_Common
                $uid = dav_compat_principal2uid($principalUri);
 
                $r = q("SELECT * FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, CALDAV_NAMESPACE_PRIVATE, $uid, dbesc($calendarUri));
-               if (count($r) > 0) throw new Sabre_DAV_Exception("A calendar with this URI already exists");
+               if (count($r) > 0) throw new Sabre_DAV_Exception_Conflict("A calendar with this URI already exists");
 
                $keys = array("`namespace`", "`namespace_id`", "`ctag`", "`uri`");
                $vals = array(CALDAV_NAMESPACE_PRIVATE, IntVal($uid), 1, "'" . dbesc($calendarUri) . "'");
index 4f761da1aed0acb22a8cc6b929a0d731733fde18..9178aaabb315b44b0487150dcab72f1cc9f16817 100644 (file)
@@ -226,6 +226,7 @@ class Sabre_CalDAV_Backend_Friendica extends Sabre_CalDAV_Backend_Virtual
                                "uri"                                                     => $cal["uri"],
                                "principaluri"                                            => $principalUri,
                                '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag' => $cal['ctag'] ? $cal['ctag'] : '0',
+                               '{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre_CalDAV_Property_SupportedCalendarComponentSet(array("VEVENT")),
                                "calendar_class"                                          => "Sabre_CalDAV_Calendar_Virtual",
                        );
                        foreach ($this->propertyMap as $key=> $field) $dat[$key] = $cal[$field];
index 86c365c0a52f9fd11c32779e35e2e65cbe4cb14f..03f342bd2ef83b3ba0ea8a679d129dc001cd616d 100644 (file)
@@ -67,7 +67,7 @@ function dav_init(&$a)
 
        dav_include_files();
 
-       if (true) {
+       if (false) {
                dbg(true);
                error_reporting(E_ALL);
                ini_set("display_errors", 1);