From a426eec7161e007411eea455e241435123cb0de6 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 16 Oct 2009 18:38:24 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 996b9175c23f4a62879cb172950b81df23cb973b Monotone-Revision: a74db01453c909399692b43b08ec1c2e4a21a2fa Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-10-16T18:38:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 +++++++++ UI/Scheduler/UIxComponentEditor.m | 23 ++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 221b80ce3..a1c850420 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-10-16 Francis Lachapelle + + * UI/Scheduler/UIxComponentEditor.m (-_loadRRules): the repeat + rule interval can be set unconditionally for weekly rules. When an + end date or repeat count is defined, the rule must be considered + "custom" in the web interface. + (_handleCustomRRule:): fixed a bug that would set a day mask even + when it was not defined. The day mask is optional in the RRULE definition. + 2009-10-15 Cyril Robert * SoObjects/Appointments/SOGoAppointmentFolders.m diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 096c41624..6e4c61102 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -351,6 +351,7 @@ iRANGE(2); else if ([rule frequency] == iCalRecurrenceFrequenceWeekly) { repeatType = @"1"; + [self setRepeat1: [NSString stringWithFormat: @"%d", [rule repeatInterval]]]; if (![rule byDayMask]) { @@ -361,7 +362,6 @@ iRANGE(2); } else { - [self setRepeat1: [NSString stringWithFormat: @"%d", [rule repeatInterval]]]; [self setRepeat2: [self _dayMaskToInteger: [rule byDayMask]]]; } } @@ -411,6 +411,7 @@ iRANGE(2); // We decode the proper end date, recurrences count, etc. if ([rule repeatCount]) { + repeat = @"CUSTOM"; [self setRange1: @"1"]; [self setRange2: [rule namedValue: @"count"]]; } @@ -418,6 +419,7 @@ iRANGE(2); { NSCalendarDate *date; + repeat = @"CUSTOM"; date = [[rule untilDate] copy]; [date setTimeZone: [[context activeUser] timeZone]]; [self setRange1: @"2"]; @@ -1681,14 +1683,17 @@ RANGE(2); [theRule setFrequency: iCalRecurrenceFrequenceWeekly]; [theRule setInterval: [self repeat1]]; - v = [[self repeat2] componentsSeparatedByString: @","]; - c = [v count]; - mask = 0; - - while (c--) - mask |= 1 << ([[v objectAtIndex: c] intValue]); - - [theRule setByDayMask: mask]; + if ([[self repeat2] length]) + { + v = [[self repeat2] componentsSeparatedByString: @","]; + c = [v count]; + mask = 0; + + while (c--) + mask |= 1 << ([[v objectAtIndex: c] intValue]); + + [theRule setByDayMask: mask]; + } } } break;