Projects
Kolab:3.4
kolab-freebusy
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 41
View file
kolab-freebusy.spec
Changed
@@ -23,7 +23,7 @@ Name: kolab-freebusy Version: 1.0.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Kolab Free/Busy Web Presentation Layer Group: Applications/Internet @@ -32,6 +32,8 @@ Source0: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}+dep.tar.gz Source1: kolab-freebusy.logrotate +Patch0001: 0001-Consider-recurrence-exceptions-when-computing-busy-t.patch + BuildArch: noarch %if 0%{?suse_version} @@ -58,6 +60,8 @@ %prep %setup -q +%patch0001 -p1 + %build %install @@ -134,6 +138,9 @@ %attr(0770,root,%{httpd_group}) %{_localstatedir}/log/%{name} %changelog +* Sun Feb 22 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0.7-2 +- Correctly render Free/Busy for recurring events with exceptions (#4665) + * Sun Feb 15 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0.7-1 - Release of version 1.0.7
View file
0001-Consider-recurrence-exceptions-when-computing-busy-t.patch
Added
@@ -0,0 +1,177 @@ +From 64f2b531c46cd1aeeb894acfdfae375d1f4cb190 Mon Sep 17 00:00:00 2001 +From: Thomas Bruederli <bruederli@kolabsys.com> +Date: Fri, 20 Feb 2015 16:28:50 +0100 +Subject: [PATCH] Consider recurrence exceptions when computing busy times + (#4665) + +--- + composer-dist.json | 14 ++++++ + composer.json | 2 +- + lib/Kolab/FreeBusy/SourceIMAP.php | 91 ++++++++++++++++++++++++++++----------- + 3 files changed, 81 insertions(+), 26 deletions(-) + create mode 100644 composer-dist.json + +diff --git a/composer-dist.json b/composer-dist.json +new file mode 100644 +index 0000000..e0423c9 +--- /dev/null ++++ b/composer-dist.json +@@ -0,0 +1,14 @@ ++{ ++ "name": "kolab/free-busy", ++ "description": "Kolab Free/Busy Service", ++ "license": "AGPL-3.0", ++ "version": "1.0.5", ++ "autoload": { ++ "psr-0": { ++ "": "/usr/share/pear/" ++ }, ++ "psr-4": { ++ "": "/usr/share/php/" ++ } ++ } ++} +diff --git a/composer.json b/composer.json +index 461c052..1efbef6 100644 +--- a/composer.json ++++ b/composer.json +@@ -2,7 +2,7 @@ + "name": "kolab/free-busy", + "description": "Kolab Free/Busy Service", + "license": "AGPL-3.0", +- "version": "1.0.6", ++ "version": "1.0.7", + "repositories": [ + { + "type": "pear", +diff --git a/lib/Kolab/FreeBusy/SourceIMAP.php b/lib/Kolab/FreeBusy/SourceIMAP.php +index 6f116b7..e0de62b 100644 +--- a/lib/Kolab/FreeBusy/SourceIMAP.php ++++ b/lib/Kolab/FreeBusy/SourceIMAP.php +@@ -5,7 +5,7 @@ + * + * @author Thomas Bruederli <bruederli@kolabsys.com> + * +- * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com> ++ * Copyright (C) 2013-2015, Kolab Systems AG <contact@kolabsys.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as +@@ -171,15 +171,9 @@ class SourceIMAP extends Source + } + } + // skip declined events +- else if (is_array($event['attendees'])) { +- foreach ($event['attendees'] as $attendee) { +- if (in_array($attendee['email'], $user_email)) { +- if ($attendee['status'] == 'DECLINED') { +- $log->debug('Skip declined event', array($event['uid'], $event['title'])); +- continue 2; +- } +- } +- } ++ else if (is_array($event['attendees']) && !$this->check_participation($event, $user_email)) { ++ $log->debug('Skip declined event', array($event['uid'], $event['title'])); ++ continue; + } + + // translate all-day dates into absolute UTC times +@@ -204,21 +198,7 @@ class SourceIMAP extends Source + } + + // copied from libvcalendar::_to_ical() +- $ve = VObject\Component::create('VEVENT'); +- $ve->UID = $event['uid']; +- +- if (!empty($event['start'])) +- $ve->add(\libvcalendar::datetime_prop('DTSTART', $event['start'], false, false)); +- if (!empty($event['end'])) +- $ve->add(\libvcalendar::datetime_prop('DTEND', $event['end'], false, false)); +- +- if (!empty($event['free_busy'])) +- $ve->add('TRANSP', $event['free_busy'] == 'free' ? 'TRANSPARENT' : 'OPAQUE'); +- +- if ($event['free_busy'] == 'tentative') +- $ve->add('STATUS', 'TENTATIVE'); +- else if (!empty($event['status'])) +- $ve->add('STATUS', $event['status']); ++ $ve = $this->to_vevent($event); + + if ($event['recurrence']) { + if ($exdates = $event['recurrence']['EXDATE']) +@@ -229,6 +209,23 @@ class SourceIMAP extends Source + if ($event['recurrence']['FREQ']) + $ve->add('RRULE', \libcalendaring::to_rrule($event['recurrence'])); + ++ // consider recurrence exceptions ++ if (is_array($event['recurrence']['EXCEPTIONS'])) { ++ foreach ($event['recurrence']['EXCEPTIONS'] as $i => $exception) { ++ // register exdate for this occurrence ++ if ($exception['recurrence_date'] instanceof \DateTime) { ++ $exdates[] = $exception['recurrence_date']; ++ } ++ // add exception to vcalendar container ++ if (!$exception['cancelled'] && $this->check_participation($exception, $user_email)) { ++ $vex = $this->to_vevent($exception); ++ $vex->UID = $event['uid'] . '-' . $i; ++ $calendar->add($vex); ++ $log->debug("Adding event exception for processing:\n" . $vex->serialize()); ++ } ++ } ++ } ++ + // add EXDATEs each one per line (for Thunderbird Lightning) + if ($exdates) { + foreach ($exdates as $ex) { +@@ -333,4 +330,48 @@ class SourceIMAP extends Source + + $imap->close(); + } ++ ++ /** ++ * Helper method to build a Sabre/VObject from the gieven event data ++ */ ++ private function to_vevent($event) ++ { ++ // copied from libvcalendar::_to_ical() ++ $ve = VObject\Component::create('VEVENT'); ++ $ve->UID = $event['uid']; ++ ++ if (!empty($event['start'])) ++ $ve->add(\libvcalendar::datetime_prop('DTSTART', $event['start'], false, false)); ++ if (!empty($event['end'])) ++ $ve->add(\libvcalendar::datetime_prop('DTEND', $event['end'], false, false)); ++ ++ if (!empty($event['free_busy'])) ++ $ve->add('TRANSP', $event['free_busy'] == 'free' ? 'TRANSPARENT' : 'OPAQUE'); ++ ++ if ($event['free_busy'] == 'tentative') ++ $ve->add('STATUS', 'TENTATIVE'); ++ else if (!empty($event['status'])) ++ $ve->add('STATUS', $event['status']); ++ ++ return $ve; ++ } ++ ++ /** ++ * Helper method to check the participation status of the requested user ++ */ ++ private function check_participation($event, $user_email) ++ { ++ $result = true; ++ ++ if (is_array($event['attendees'])) { ++ foreach ($event['attendees'] as $attendee) { ++ if (in_array($attendee['email'], $user_email) && $attendee['status'] == 'DECLINED') { ++ $result = false; ++ break; ++ } ++ } ++ } ++ ++ return $result; ++ } + } +-- +2.1.0 +
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +kolab-freebusy (1.0.7-0~kolab2) unstable; urgency=low + + * Correctly render Free/Busy for recurring events with exceptions (#4665) + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Sun, 22 Feb 2015 12:00:22 +0200 + kolab-freebusy (1.0.7-0~kolab1) unstable; urgency=low * Release of version 1.0.7
View file
debian.series
Changed
@@ -0,0 +1,1 @@ +0001-Consider-recurrence-exceptions-when-computing-busy-t.patch -p1
View file
kolab-freebusy.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-freebusy Binary: kolab-freebusy Architecture: all -Version: 1.0.7-0~kolab1 +Version: 1.0.7-0~kolab2 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Homepage: http://www.kolab.org Standards-Version: 3.9.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
.