0011518: fix activesync/caldav first instance exception handling
authorCornelius Weiß <c.weiss@metaways.de>
Wed, 23 Dec 2015 14:15:16 +0000 (15:15 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 4 Jan 2016 15:44:46 +0000 (16:44 +0100)
* cope with base_event_id in base_event
* compare exdates in right tz

https://forge.tine20.org/view.php?id=11518

Change-Id: Iebc0e25de7f4aad2b6ad86c0923b2db6eadac1c8
Reviewed-on: http://gerrit.tine20.com/customers/2531
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Calendar/Frontend/WebDAV/EventTest.php
tests/tine20/Calendar/Import/files/lightning_repeating_exdate_mozlastack.ics
tests/tine20/Calendar/Import/files/lightning_repeating_group_first_instance_exception.ics [new file with mode: 0644]
tine20/Calendar/Controller/Event.php
tine20/Calendar/Controller/MSEventFacade.php
tine20/Calendar/Convert/Event/VCalendar/Abstract.php

index 35a8ee5..2e21e40 100644 (file)
@@ -565,6 +565,72 @@ class Calendar_Frontend_WebDAV_EventTest extends Calendar_TestCase
         $this->assertCount(1, $record->attendee->filter('user_id', $contact->getId()), 'attendee must not change');
     }
 
+    public function testPutEventWithRecurExceptions()
+    {
+        $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13';
+
+        $vcalendar = self::getVCalendar(dirname(__FILE__) . '/../../Import/files/lightning_repeating_exdate_mozlastack.ics');
+        $id = Tinebase_Record_Abstract::generateUID();
+        $targetContainer = $this->objects['initialContainer'];
+
+        $event = Calendar_Frontend_WebDAV_Event::create($targetContainer, "$id.ics", $vcalendar);
+        $record = $event->getRecord();
+
+        $eventToUpdate = new Calendar_Frontend_WebDAV_Event($targetContainer, $id);
+        $vcalendarToUpdate = stream_get_contents($eventToUpdate->get());
+        $vcalendarToUpdate = str_replace("abendessen später am heiligabend", "vesper später am heiligabend", $vcalendarToUpdate);
+//        echo $vcalendarToUpdate;
+        $eventToUpdate->put($vcalendarToUpdate);
+
+        $updatedRecord = Calendar_Controller_MSEventFacade::getInstance()->get($id);
+        $xmas = $updatedRecord->exdate->filter('summary', '/^vesper.*/', true)->getFirstRecord();
+        $this->assertNotNull($xmas, print_r($updatedRecord->toArray(), true));
+    }
+
+    public function testPutEventWithRecurFirstInstanceException()
+    {
+        $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13';
+
+        $vcalendar = file_get_contents(dirname(__FILE__) . '/../../Import/files/lightning_repeating_group_first_instance_exception.ics');
+        $vcalendar = str_replace("d981a72be8f21808b588daa0e8644046c634250f", Tinebase_Group::getInstance()->getDefaultGroup()->list_id, $vcalendar);
+
+        $id = Tinebase_Record_Abstract::generateUID();
+        $targetContainer = $this->objects['initialContainer'];
+
+        $event = Calendar_Frontend_WebDAV_Event::create($targetContainer, "$id.ics", $vcalendar);
+
+        // sometimes base_event_id is set for base_events;
+        $record = $event->getRecord();
+        $record->base_event_id = $record->getId();
+        Calendar_Controller_Event::getInstance()->update($record);
+
+        $eventToUpdate = new Calendar_Frontend_WebDAV_Event($targetContainer, $id);
+        $vcalendarToUpdate = stream_get_contents($eventToUpdate->get());
+        $eventToUpdate->put($vcalendarToUpdate);
+    }
+
+    public function testPutEventWithRecurExceptionsExternalOrganizer()
+    {
+        $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13';
+
+        $vcalendar = self::getVCalendar(dirname(__FILE__) . '/../../Import/files/lightning_repeating_exdate_mozlastack.ics');
+        $vcalendar = str_replace("sclever", "external", $vcalendar);
+//        echo $vcalendar;
+
+        $id = Tinebase_Record_Abstract::generateUID();
+        $targetContainer = $this->objects['initialContainer'];
+
+        $event = Calendar_Frontend_WebDAV_Event::create($targetContainer, "$id.ics", $vcalendar);
+        $record = $event->getRecord();
+
+        $loadedEvent = new Calendar_Frontend_WebDAV_Event($targetContainer, $id);
+        $loadedRecord = $loadedEvent->getRecord();
+//        echo stream_get_contents($loadedEvent->get());
+
+        $xmas = $loadedRecord->exdate->filter('summary', '/.*heiligabend$/', true)->getFirstRecord();
+        $this->assertNotNull($xmas, print_r($loadedRecord->toArray(), true));
+    }
+
     /**
      * test deleting attachment from existing event
      */
index 2237d0b..af163b8 100644 (file)
@@ -46,7 +46,6 @@ SEQUENCE:13
 CLASS:PUBLIC
 TRANSP:OPAQUE
 X-MOZ-SNOOZE-TIME;VALUE=DATE-TIME:20140108T123128Z
-X-TINE20-CONTAINER:4
 X-MOZ-GENERATION:1
 BEGIN:VALARM
 ACTION:DISPLAY
@@ -78,7 +77,6 @@ DTEND;TZID=Europe/Berlin:20131224T200000
 SEQUENCE:3
 CLASS:PUBLIC
 TRANSP:OPAQUE
-X-TINE20-CONTAINER:4
 END:VEVENT
 BEGIN:VEVENT
 CREATED:20140108T135658Z
@@ -107,7 +105,6 @@ SEQUENCE:0
 CLASS:PUBLIC
 TRANSP:OPAQUE
 X-MOZ-SNOOZE-TIME;VALUE=DATE-TIME:20140108T123128Z
-X-TINE20-CONTAINER:4
 BEGIN:VALARM
 ACTION:DISPLAY
 TRIGGER;VALUE=DURATION:-P1D
@@ -142,7 +139,6 @@ DTEND;TZID=Europe/Berlin:20131227T200000
 SEQUENCE:1
 CLASS:PUBLIC
 TRANSP:OPAQUE
-X-TINE20-CONTAINER:4
 BEGIN:VALARM
 ACTION:DISPLAY
 TRIGGER;VALUE=DURATION:-PT15M
@@ -176,7 +172,6 @@ SEQUENCE:1
 CLASS:PUBLIC
 TRANSP:OPAQUE
 X-MOZ-SNOOZE-TIME;VALUE=DATE-TIME:20140108T121614Z
-X-TINE20-CONTAINER:4
 BEGIN:VALARM
 ACTION:DISPLAY
 TRIGGER;VALUE=DURATION:-P1D
diff --git a/tests/tine20/Calendar/Import/files/lightning_repeating_group_first_instance_exception.ics b/tests/tine20/Calendar/Import/files/lightning_repeating_group_first_instance_exception.ics
new file mode 100644 (file)
index 0000000..dfc8af5
--- /dev/null
@@ -0,0 +1,334 @@
+BEGIN:VCALENDAR
+PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+TZID:Europe/Berlin
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+CREATED:20151123T164053Z
+LAST-MODIFIED:20151223T085247Z
+DTSTAMP:20151223T085247Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+RRULE:FREQ=WEEKLY;UNTIL=20151125T235959Z;BYDAY=WE
+EXDATE:20151230T093000Z
+EXDATE:20151216T093000Z
+X-MOZ-LASTACK:20151223T085247Z
+DTSTART;TZID=Europe/Berlin:20151125T103000
+DTEND;TZID=Europe/Berlin:20151125T113000
+CLASS:PUBLIC
+SEQUENCE:40
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-MOZ-SNOOZE-TIME:20151125T084120Z
+X-TINE20-CONTAINER:90
+X-MOZ-GENERATION:1
+BEGIN:VALARM
+ACTION:DISPLAY
+TRIGGER;VALUE=DURATION:-PT1H
+DESCRIPTION:MA Besprechung
+X-LIC-ERROR;X-LIC-ERRORTYPE=PROPERTY-PARSE-ERROR:Parse error in property n
+ ame: ACKNOWLEDGED
+END:VALARM
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20151125T084946Z
+LAST-MODIFIED:20151222T133420Z
+DTSTAMP:20151222T135738Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+RECURRENCE-ID;TZID=Europe/Berlin:20151125T103000
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+DTSTART;TZID=Europe/Berlin:20151125T103000
+DTEND;TZID=Europe/Berlin:20151125T113000
+CLASS:PUBLIC
+SEQUENCE:4
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-TINE20-CONTAINER:90
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20151222T132525Z
+LAST-MODIFIED:20151222T133450Z
+DTSTAMP:20151222T135738Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+RECURRENCE-ID;TZID=Europe/Berlin:20151202T103000
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+DTSTART;TZID=Europe/Berlin:20151202T103000
+DTEND;TZID=Europe/Berlin:20151202T113000
+CLASS:PUBLIC
+SEQUENCE:2
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-TINE20-CONTAINER:90
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20151222T132545Z
+LAST-MODIFIED:20151222T133545Z
+DTSTAMP:20151222T135738Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+RECURRENCE-ID;TZID=Europe/Berlin:20151209T103000
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+DTSTART;TZID=Europe/Berlin:20151209T103000
+DTEND;TZID=Europe/Berlin:20151209T113000
+CLASS:PUBLIC
+SEQUENCE:2
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-TINE20-CONTAINER:90
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20151215T170512Z
+LAST-MODIFIED:20151222T133129Z
+DTSTAMP:20151222T135738Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+RECURRENCE-ID;TZID=Europe/Berlin:20151223T103000
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+
+X-MOZ-LASTACK:20151209T083009Z
+DTSTART;TZID=Europe/Berlin:20151223T103000
+DTEND;TZID=Europe/Berlin:20151223T113000
+CLASS:PUBLIC
+SEQUENCE:3
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-MOZ-SNOOZE-TIME:20151125T084120Z
+X-TINE20-CONTAINER:90
+BEGIN:VALARM
+ACTION:DISPLAY
+TRIGGER;VALUE=DURATION:-PT1H
+DESCRIPTION:MA Besprechung
+X-LIC-ERROR;X-LIC-ERRORTYPE=PROPERTY-PARSE-ERROR:Parse error in property n
+ ame: ACKNOWLEDGED
+END:VALARM
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20151215T170623Z
+LAST-MODIFIED:20151215T170623Z
+DTSTAMP:20151222T135738Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+RECURRENCE-ID;TZID=Europe/Berlin:20160106T103000
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+X-MOZ-LASTACK:20151209T083009Z
+DTSTART;TZID=Europe/Berlin:20160106T103000
+DTEND;TZID=Europe/Berlin:20160106T113000
+CLASS:PUBLIC
+SEQUENCE:1
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-MOZ-SNOOZE-TIME:20151125T084120Z
+X-TINE20-CONTAINER:90
+BEGIN:VALARM
+ACTION:DISPLAY
+TRIGGER;VALUE=DURATION:-PT1H
+DESCRIPTION:MA Besprechung
+X-LIC-ERROR;X-LIC-ERRORTYPE=PROPERTY-PARSE-ERROR:Parse error in property n
+ ame: ACKNOWLEDGED
+END:VALARM
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20151215T170737Z
+LAST-MODIFIED:20151215T170737Z
+DTSTAMP:20151222T135738Z
+UID:ac714fd2aaee06a7d1ebe69710a8317bbc38ffd7
+SUMMARY:MA Besprechung
+STATUS:CONFIRMED
+RECURRENCE-ID;TZID=Europe/Berlin:20160113T103000
+ORGANIZER;CN="Admin Account, Tine 2.0";EMAIL=unittest@tine20.org:mailto:uni
+ ttest@tine20.org
+ATTENDEE;CN="McBlack, James";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=R
+ EQ-PARTICIPANT;RSVP=FALSE;EMAIL=jmcblack@tine20.org:mailto:jmcblack@tine20
+ .org
+ATTENDEE;CN="Admin Account, Tine 2.0";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTI
+ ON;ROLE=REQ-PARTICIPANT;RSVP=FALSE;EMAIL=unittest@tine20.org:mailto:unitte
+ st@tine20.org
+ATTENDEE;CN="Wright, Roberta";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
+ REQ-PARTICIPANT;RSVP=FALSE;EMAIL=rwright@tine20.org:mailto:rwright@tine20.
+ org
+ATTENDEE;CN="Wulf, Paul";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-P
+ ARTICIPANT;RSVP=FALSE;EMAIL=pwulf@tine20.org:mailto:pwulf@tine20.org
+ATTENDEE;CN="Smith, John";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
+ PARTICIPANT;RSVP=FALSE;EMAIL=jsmith@tine20.org:mailto:jsmith@tine20.org
+ATTENDEE;CN="Clever, Susan";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=RE
+ Q-PARTICIPANT;RSVP=FALSE;EMAIL=sclever@tine20.org:mailto:sclever@tine20.or
+ g
+ATTENDEE;CN=Users;CUTYPE=GROUP;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;R
+ SVP=FALSE:urn:uuid:d981a72be8f21808b588daa0e8644046c634250f
+X-MOZ-LASTACK:20151209T083009Z
+DTSTART;TZID=Europe/Berlin:20160113T103000
+DTEND;TZID=Europe/Berlin:20160113T113000
+CLASS:PUBLIC
+SEQUENCE:1
+DESCRIPTION:https://team.t20.org/sites/tine/TeamSeite/TINE%20Mitarbeiter/A
+ genda-Mitarbeiter.aspx
+LOCATION:-134
+TRANSP:OPAQUE
+X-CALENDARSERVER-ACCESS:PUBLIC
+X-MOZ-SNOOZE-TIME:20151125T084120Z
+X-TINE20-CONTAINER:90
+BEGIN:VALARM
+ACTION:DISPLAY
+TRIGGER;VALUE=DURATION:-PT1H
+DESCRIPTION:MA Besprechung
+X-LIC-ERROR;X-LIC-ERRORTYPE=PROPERTY-PARSE-ERROR:Parse error in property n
+ ame: ACKNOWLEDGED
+END:VALARM
+END:VEVENT
+END:VCALENDAR
index 1816175..84bbd27 100644 (file)
@@ -1212,7 +1212,7 @@ class Calendar_Controller_Event extends Tinebase_Controller_Record_Abstract impl
     }
 
     /**
-     * returns all persistent recur exceptions of recur series identified by uid of given event
+     * returns all persistent recur exceptions of recur series
      * 
      * NOTE: deleted instances are saved in the base events exception property
      * NOTE: returns all exceptions regardless of current filters and access restrictions
@@ -1228,6 +1228,7 @@ class Calendar_Controller_Event extends Tinebase_Controller_Record_Abstract impl
 
         $exceptionFilter = new Calendar_Model_EventFilter(array(
             array('field' => 'base_event_id', 'operator' => 'equals',  'value' => $baseEventId),
+            array('field' => 'recurid',       'operator' => 'notnull', 'value' => NULL)
         ));
         
         if ($_eventFilter instanceof Calendar_Model_EventFilter) {
index 183cf0a..4c41e31 100644 (file)
@@ -351,7 +351,7 @@ class Calendar_Controller_MSEventFacade implements Tinebase_Controller_Record_In
         
         $currentPersistentExceptions = $_event->rrule ? $this->_eventController->getRecurExceptions($_event, FALSE) : new Tinebase_Record_RecordSet('Calendar_Model_Event');
         $newPersistentExceptions = $exceptions->filter('is_deleted', 0);
-        
+
         $migration = $this->_getExceptionsMigration($currentPersistentExceptions, $newPersistentExceptions);
 
         $this->_eventController->delete($migration['toDelete']->getId());
index 56311f7..6bbe383 100644 (file)
@@ -216,8 +216,11 @@ class Calendar_Convert_Event_VCalendar_Abstract extends Tinebase_Convert_VCalend
         }
 
         $class = $event->class == Calendar_Model_Event::CLASS_PUBLIC ? 'PUBLIC' : 'CONFIDENTIAL';
-        $vcalendar->add('X-CALENDARSERVER-ACCESS', $class);
         $vevent->add('X-CALENDARSERVER-ACCESS', $class);
+        if (! $_event->isRecurException()) {
+            // add one time only
+            $vcalendar->add('X-CALENDARSERVER-ACCESS', $class);
+        }
 
         // categories
         if (!isset($event->tags)) {
@@ -588,7 +591,8 @@ class Calendar_Convert_Event_VCalendar_Abstract extends Tinebase_Convert_VCalend
     protected function _getRecurException(Tinebase_Record_RecordSet $oldExdates,Sabre\VObject\Component\VEvent $vevent)
     {
         // we need to use the user timezone here if this is a DATE (like this: RECURRENCE-ID;VALUE=DATE:20140429)
-        $exDate = Calendar_Convert_Event_VCalendar_Abstract::getUTCDateFromStringInUsertime((string) $vevent->{'RECURRENCE-ID'});
+        $exDate = $this->_convertToTinebaseDateTime($vevent->{'RECURRENCE-ID'});
+        $exDate->setTimezone('UTC');
         $exDateString = $exDate->format('Y-m-d H:i:s');
 
         foreach ($oldExdates as $id => $oldExdate) {