Projects
Kolab:16:Testing:Candidate
roundcubemail-plugins-kolab
0001-Fix-missing-first-occurrence-of-an-event-w...
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-missing-first-occurrence-of-an-event-when-moved-.patch of Package roundcubemail-plugins-kolab (Revision 22)
Currently displaying revision
22
,
Show latest
From b5991f4251c9be9b12230887427571b110101e42 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <machniak@kolabsys.com> Date: Mon, 14 May 2018 08:56:08 +0200 Subject: [PATCH] Fix missing first occurrence of an event when moved to another day (Bifrost#T103344) --- plugins/calendar/drivers/kolab/kolab_calendar.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php index d6500ab9..a7bab9d6 100644 --- a/plugins/calendar/drivers/kolab/kolab_calendar.php +++ b/plugins/calendar/drivers/kolab/kolab_calendar.php @@ -317,7 +317,6 @@ class kolab_calendar extends kolab_storage_folder_api if ($event['start'] <= $end && $event['end'] >= $start) { unset($event['_attendees']); $add = true; - // skip the first instance of a recurring event if listed in exdate if ($virtual && !empty($event['recurrence']['EXDATE'])) { $event_date = $event['start']->format('Ymd'); @@ -594,10 +593,11 @@ class kolab_calendar extends kolab_storage_folder_api /** * Create instances of a recurring event * - * @param array Hash array with event properties - * @param object DateTime Start date of the recurrence window - * @param object DateTime End date of the recurrence window - * @param string ID of a specific recurring event instance + * @param array $event Hash array with event properties + * @param DateTime $start Start date of the recurrence window + * @param DateTime $end End date of the recurrence window + * @param string $event_id ID of a specific recurring event instance + * * @return array List of recurring event instances */ public function get_recurring_events($event, $start, $end = null, $event_id = null) @@ -607,6 +607,7 @@ class kolab_calendar extends kolab_storage_folder_api $rec = $this->storage->get_object($event['id']); $object = $rec['_formatobj']; } + if (!is_object($object)) return array(); @@ -658,6 +659,16 @@ class kolab_calendar extends kolab_storage_folder_api return array($this->events[$event_id]); } + // Check first occurrence, it might have been moved + if ($first = $exdata[$event['start']->format('Ymd')]) { + // return it only if not already in the result, but in the requested period + if (!($event['start'] <= $end && $event['end'] >= $start) + && ($first['start'] <= $end && $first['end'] >= $start) + ) { + $events[] = $first; + } + } + // use libkolab to compute recurring events $recurrence = new kolab_date_recurrence($object); -- 2.14.3
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.