From: Jan Schneider Date: Wed, 10 Nov 2010 17:10:25 +0000 (+0100) Subject: Export all recurrence exceptions in one property instead of multiple properties.... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3ebf92435f24b15b9e23e60d5651dec9b22aa28d;p=horde.git Export all recurrence exceptions in one property instead of multiple properties. Seems to work better with some clients, noteably Nokia phones. --- diff --git a/horde/docs/CHANGES b/horde/docs/CHANGES index 79e924823..b849cb171 100644 --- a/horde/docs/CHANGES +++ b/horde/docs/CHANGES @@ -55,6 +55,7 @@ v4.0-cvs v3.3.11-cvs ----------- +[jan] Fix exporting recurrence exceptions to vCalendar 1.0. [jan] Skip event status synchronization with Outlook, which is broken. [jan] Don't send SIF data to recent Funambol clients, unless requested. [jan] Log all queries and errors by the history library. diff --git a/kronolith/docs/CHANGES b/kronolith/docs/CHANGES index 013255c8b..33a7da39d 100644 --- a/kronolith/docs/CHANGES +++ b/kronolith/docs/CHANGES @@ -46,7 +46,7 @@ v3.0-git v2.3.6-cvs ---------- - +[jan] Export recurrence exceptions in a more portable way. ------ diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 271050315..447df9a33 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -776,13 +776,16 @@ abstract class Kronolith_Event } /* The remaining exceptions represent deleted recurrences */ + $exdates = array(); foreach ($exceptions as $exception) { if (!empty($exception)) { list($year, $month, $mday) = sscanf($exception, '%04d%02d%02d'); - $exdate = new Horde_Date($year, $month, $mday); - $vEvent->setAttribute('EXDATE', array($exdate)); + $exdates[] = new Horde_Date($year, $month, $mday); } } + if ($exdates) { + $vEvent->setAttribute('EXDATE', $exdates); + } } array_unshift($vEvents, $vEvent); diff --git a/kronolith/lib/tests/toicalendar.phpt b/kronolith/lib/tests/toicalendar.phpt index 03d19c3d7..d676bd53e 100644 --- a/kronolith/lib/tests/toicalendar.phpt +++ b/kronolith/lib/tests/toicalendar.phpt @@ -40,6 +40,7 @@ $object->recurrence = new Horde_Date_Recurrence($object->start); $object->recurrence->setRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE); $object->recurrence->setRecurInterval(1); $object->recurrence->addException(2007, 4, 15); +$object->recurrence->addException(2007, 6, 15); $object->attendees = array('juergen@example.com' => array('attendance' => Kronolith::PART_REQUIRED, @@ -139,7 +140,7 @@ ATTENDEE;EXPECT=FYI;STATUS=DECLINED:Jack Doe ATTENDEE;EXPECT=FYI;STATUS=TENTATIVE:jenny@example.com AALARM:20070315T120020Z RRULE:MD1 15 #0 -EXDATE:20070415T111020Z +EXDATE:20070415T111020Z;20070615T111020Z END:VEVENT END:VCALENDAR @@ -164,7 +165,7 @@ ATTENDEE;ROLE=NON-PARTICIPANT;PARTSTAT=DECLINED;CN=Jack Doe:mailto:jack@example.com ATTENDEE;ROLE=NON-PARTICIPANT;PARTSTAT=TENTATIVE:mailto:jenny@example.com RRULE:FREQ=MONTHLY;INTERVAL=1 -EXDATE:20070415T111020Z +EXDATE:20070415T111020Z,20070615T111020Z BEGIN:VALARM ACTION:DISPLAY TRIGGER;VALUE=DURATION:-PT10M