From ce77d78e2703aba6b4650d56d2028dc0ce3c96d7 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 19 Apr 2012 18:16:50 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 5af155533446328556c907456566939affd0ae8f Monotone-Revision: 2684d8c1336cad3425d5075a447d817d5808948d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-04-19T18:16:50 --- ChangeLog | 2 ++ SoObjects/Appointments/SOGoAppointmentFolder.m | 14 +++++++++++++- UI/Scheduler/UIxCalFolderActions.h | 7 ++++--- UI/Scheduler/UIxCalFolderActions.m | 7 ++++--- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f351b9f0..6e1d523fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ is removed from the event during a PUT action (happens when you delete the last attendee of an event with iCal). This used to crash sogod. + * SoObjects/Appointments/SOGoAppointmentFolder.m (-importCalendar:) + Fixed the import process of broken all-day events (#1055) 2012-04-19 Francis Lachapelle diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 24bab7273..0b6f0fe37 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2796,8 +2796,20 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir else [event setDuration: @"PT1H"]; - [self errorWithFormat: @"Importing event with no end date; setting duration to %@", [event duration]]; + [self errorWithFormat: @"Importing event with no end date; setting duration to %@ for UID = %@", [event duration], [event uid]]; } + // + // We check for broken all-day events (like the ones coming from the "WebCalendar" tool) where + // the start date is equal to the end date. This clearly violates the RFC: + // + // 3.8.2.2. Date-Time End + // The value MUST be later in time than the value of the "DTSTART" property. + // + if ([event isAllDay] && [[event startDate] isEqual: [event endDate]]) + { + [event setEndDate: [[event startDate] dateByAddingYears: 0 months: 0 days: 1 hours: 0 minutes: 0 seconds: 0]]; + [self errorWithFormat: @"Fixed broken all-day event; setting end date to %@ for UID = %@", [event endDate], [event uid]]; + } if ([event recurrenceId]) { // Event is an occurrence of a repeating event diff --git a/UI/Scheduler/UIxCalFolderActions.h b/UI/Scheduler/UIxCalFolderActions.h index ff7b3d229..3a7645429 100644 --- a/UI/Scheduler/UIxCalFolderActions.h +++ b/UI/Scheduler/UIxCalFolderActions.h @@ -1,14 +1,15 @@ /* + Copyright (C) 2006-2012 Inverse inc. Copyright (C) 2004-2005 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. diff --git a/UI/Scheduler/UIxCalFolderActions.m b/UI/Scheduler/UIxCalFolderActions.m index 376accfc4..efcdf4c4b 100644 --- a/UI/Scheduler/UIxCalFolderActions.m +++ b/UI/Scheduler/UIxCalFolderActions.m @@ -1,14 +1,15 @@ /* + Copyright (C) 2006-2012 Inverse inc. Copyright (C) 2004-2005 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.