From ea017e67b6119880b8745514f9a2014a6270b2d0 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 23 Dec 2008 18:39:36 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 18e33d0c1964c0a62a8a43c69d2300477fb492b5 Monotone-Revision: 2d01f07e3065ada858d69113aed1fd68f365ab66 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-12-23T18:39:36 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ NEWS | 2 ++ UI/Scheduler/UIxAppointmentEditor.m | 32 +++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 018d59cea..51798e501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-23 Francis Lachapelle + + * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor + -_adjustRecurrentRules]): new method to adjust the until date of a + recurrent rule using the start time of the event. + 2008-12-21 Ludovic Marcotte * Added the "sent-by" field to all invitation diff --git a/NEWS b/NEWS index 882f9ca99..635565095 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ - improved drag handles behavior - added support for LDAP-based configuration - improved init script when killing proccesses +- improved the ACL editor of the calendar web module +- fixed handling of timezones in daily and weekly events 1.0-20080826 (1.0 rc8) ---------------------- diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 11340aee8..a7583996e 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -23,6 +23,7 @@ #include #import +#import #import #import @@ -41,6 +42,7 @@ #import #import #import +#import #import #import #import @@ -271,6 +273,30 @@ return result; } +- (void) _adjustRecurrentRules +{ + iCalRecurrenceRule *rule; + NSEnumerator *rules; + NSCalendarDate *untilDate; + + rules = [[event recurrenceRules] objectEnumerator]; + while ((rule = [rules nextObject])) + { + untilDate = [rule untilDate]; + if (untilDate) + { + // The until date must match the time of the start date + untilDate = [untilDate dateByAddingYears:0 + months:0 + days:0 + hours:[[event startDate] hourOfDay] + minutes:[[event startDate] minuteOfHour] + seconds:0]; + [rule setUntilDate: untilDate]; + } + } +} + - (id ) saveAction { SOGoAppointmentFolder *previousCalendar; @@ -305,6 +331,9 @@ } else { + if ([event hasRecurrenceRules]) + [self _adjustRecurrentRules]; + // The event was modified -- save it. [co saveComponent: event]; @@ -330,14 +359,12 @@ { WOResponse *result; NSDictionary *data; - SOGoAppointmentFolder *co; SOGoDateFormatter *dateFormatter; SOGoUser *user; NSCalendarDate *startDate; result = [context response]; user = [context activeUser]; - co = [self clientObject]; dateFormatter = [user dateFormatterInContext: context]; [self event]; @@ -353,6 +380,7 @@ [event location], @"location", [event comment], @"description", nil]; + [result appendContentString: [data jsonRepresentation]]; [startDate release];