[Kolab-devel] Ausnahmen in wiederkehrenden Terminen von Ressourcen
Matthias Teege
matthias-kolab-dev at mteege.de
Tue Oct 9 19:07:12 CEST 2012
On 17:09 Tue 09 Oct, Torsten Grote wrote:
Hi,
> please note that kolab-devel at kolab.org 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
More information about the devel
mailing list