Re: Ausnahmen in wiederkehrenden Terminen von Ressourcen

Matthias Teege <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab
Message-ID <20121009170712.GA22947__34976.4099847109$1349802475$gmane$org@mteege.de>
On 17:09 Tue 09 Oct, Torsten Grote wrote:

Hi,

> please note that [email protected] is an English speaking mailing list. 
> Most people here don't understand German.

yea, for sure. Hit enter too early ...
> 
> On Monday 01 October 2012 17:48:35 Matthias Teege wrote:
> > Kennt jemand das Problem und hat ggf. einen Fix dafür? Hier läuft
> > die 2.3.2 Community Edition.
> 
> This is quite old. Have you tried whether a more recent version such as 2.3.4 
> already solves this problem?

No I'm not sure where to find the 2.3.4 repo, but I fixed it:

Index: Kolab/Resource/Itip/Event/Vevent.php
===================================================================
--- Kolab/Resource/Itip/Event/Vevent.php
+++ Kolab/Resource/Itip/Event/Vevent.php
@@ -249,16 +249,31 @@
                     $object['alarm'] = -$trigger / 60;
                 }
             }
         }
 
+       // Exdate
+       $exdates = $this->_vevent->getAttribute('EXDATE', false);
+       if (!is_a($exdates, 'PEAR_ERROR')) {
+               if (!is_array($exdates[0])) {
+                       $exdates = array($exdates);
+               }
+       }
+
         // Recurrence
         $rrule_str = $this->_vevent->getAttribute('RRULE');
         if (!is_a($rrule_str, 'PEAR_Error')) {
             require_once 'Horde/Date/Recurrence.php';
             $recurrence = new Horde_Date_Recurrence(time());
             $recurrence->fromRRule20($rrule_str);
+
+           if (is_array($exdates)) {
+               for ($i = 0; $i < count($exdates); $i++) {
+                   $recurrence->addException($exdates[$i]['year'], $exdates[$i]['month'], $exdates[$i]['mday']);
+               }
+           }
+
             $object['recurrence'] = $recurrence->toHash();
         }
 
         return $object;
     }

Thanks
Matthias
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.