Merge branch '2013.10' into 2014.11
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 9 May 2016 11:58:32 +0000 (13:58 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 9 May 2016 11:58:32 +0000 (13:58 +0200)
tests/tine20/Calendar/Frontend/WebDAV/ContainerTest.php
tine20/Calendar/Frontend/WebDAV/Container.php

index 2cfa166..beb7ab2 100644 (file)
@@ -361,8 +361,10 @@ class Calendar_Frontend_WebDAV_ContainerTest extends PHPUnit_Framework_TestCase
         $container = new Calendar_Frontend_WebDAV_Container($this->objects['initialContainer']);
         
         $shares = $container->getShares();
-        
+
         $this->assertEquals(3, count($shares));
+        $this->assertEquals('urn:uuid:anyone', $shares[0]['href']);
+        $this->assertEquals('urn:uuid:' . Tinebase_Core::getUser()->contact_id, $shares[2]['href']);
     }
     
     /**
index da2d3d5..1d6b9d5 100644 (file)
@@ -343,6 +343,11 @@ class Calendar_Frontend_WebDAV_Container extends Tinebase_WebDav_Container_Abstr
     
     /**
      * (non-PHPdoc)
+     *
+     * changed href from URI format /path/to/targetid to urn:uuid:id format due to el capitano ical client
+     * see:
+     * https://service.metaways.net/Ticket/Display.html?id=145985
+     *
      * @see \Sabre\CalDAV\IShareableCalendar::getShares()
      */
     public function getShares()
@@ -361,7 +366,8 @@ class Calendar_Frontend_WebDAV_Container extends Tinebase_WebDav_Container_Abstr
             
             switch ($grant->account_type) {
                 case 'anyone':
-                    $href       = '/principals/groups/anyone';
+                    // was: '/principals/groups/anyone'
+                    $href       = 'urn:uuid:anyone';
                     $commonName = 'Anyone';
                     break;
                 
@@ -371,20 +377,25 @@ class Calendar_Frontend_WebDAV_Container extends Tinebase_WebDav_Container_Abstr
                     } catch (Tinebase_Exception_NotFound $tenf) {
                         continue;
                     }
-                     
-                    $href       = '/principals/groups/' . $list->list_id;
+
+                    // was: '/principals/groups/'
+                    $href       = 'urn:uuid:' . $list->list_id;
                     $commonName = $list->name;
                     
                     break;
                     
                 case 'user':
+                    if ((string)$this->_container->owner_id === (string)$grant->account_id) {
+                        continue;
+                    }
                     try {
                         $contact = Tinebase_User::getInstance()->getUserByPropertyFromSqlBackend('accountId', $grant->account_id);
                     } catch (Tinebase_Exception_NotFound $tenf) {
                         continue;
                     }
-                     
-                    $href       = '/principals/users/' . $contact->contact_id;
+
+                    // was: '/principals/users/'
+                    $href       = 'urn:uuid:' . $contact->contact_id;
                     $commonName = $contact->accountDisplayName;
                     break;
             }