From c522130c25d4e77a2bd9a646e19f7259cda7a877 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 11 Jul 2012 19:50:56 +0000 Subject: [PATCH 1/3] Added missing strings for calendar notifications. Monotone-Parent: 740654a1f1be6a68843349cf438d5a87445f489e Monotone-Revision: b456b18f292850c6fefa107c0ca59bded3a6e6a3 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-07-11T19:50:56 --- UI/Scheduler/English.lproj/Localizable.strings | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 66f4982a0..00420ef65 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -537,6 +537,10 @@ vtodo_class2 = "(Confidential task)"; "Show alarms" = "Show alarms"; "Show tasks" = "Show tasks"; +"Receive a mail when I modify my calendar" = "Receive a mail when I modify my calendar"; +"Receive a mail when someone else modifies my calendar" = "Receive a mail when someone else modifies my calendar"; +"When I modify my calendar, send a mail to:" = "When I modify my calendar, send a mail to:"; + "Links to this Calendar" = "Links to this Calendar"; "Authenticated User Access" = "Authenticated User Access"; "CalDAV URL" = "CalDAV URL"; From d965eec0515a56b819050ecba8b4319d62b988de Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 11 Jul 2012 19:53:45 +0000 Subject: [PATCH 2/3] Minor improvements to the preferences window. Monotone-Parent: b456b18f292850c6fefa107c0ca59bded3a6e6a3 Monotone-Revision: 1fae890d6e269d7918982811c46400a4ff38745d Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-07-11T19:53:45 --- UI/Templates/PreferencesUI/UIxPreferences.wox | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index ec86d3afa..67b04f350 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -304,12 +304,12 @@
- - - -

- - +
From 87a7732361e9d0089f5761b11fc8d963ccded448 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 12 Jul 2012 15:03:38 +0000 Subject: [PATCH 3/3] applied changes from c6b25920d896b2d19d0ef40a4cadee46c87bba2d through fcec9822c0aaee8cefba77d0f50a8582b33fa3f0 Monotone-Parent: 975e40192e290b5aa4bc5c5b99a12b299d84fa5a Monotone-Revision: 4d39a71900cc87ae1185f268c1c35a5a4b086b1d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-07-12T15:03:38 --- ChangeLog | 20 ++++ .../Appointments/SOGoAppointmentFolder.m | 110 +++++++++++++++--- SoObjects/SOGo/SOGoObject.h | 4 + SoObjects/SOGo/SOGoObject.m | 30 +++++ 4 files changed, 145 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb773ecb3..66c9d257e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,26 @@ show the notification options if it's a web calendar or if the active user isn't the owner of the calendar. +2012-07-10 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolder.m + (-davNotifyOnPersonalModifications) + (-setDavNotifyOnPersonalModifications:) + (-davNotifyOnExternalModifications) + (-setDavNotifyOnExternalModifications:) + (-davNotifyUserOnPersonalModifications) + (-setDavNotifyUserOnPersonalModifications:) + (-davNotifiedUserOnPersonalModifications) + (-setDavNotifiedUserOnPersonalModifications:): new dav accessors. + + + * SoObjects/SOGo/SOGoObject.m (-davBooleanForResult:): new method + that returns a valid DAV boolean from a BOOL. + (-isValidDAVBoolean:): new method that validates the value as a + DAV boolean. + (-resultForDAVBoolean:): new method that returns a BOOL from a DAV + boolean. + 2012-07-09 Ludovic Marcotte * Dropped old templates (SOGoAptMailDeletionReceipt.wox diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 864d0ec26..29a64b77b 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -455,7 +455,7 @@ static NSNumber *sharedYes = nil; // We MUST keep the 'NO' value here, because we will always // fallback to the domain defaults otherwise. // -- (BOOL) _setNotificationValue: (BOOL) b +- (void) _setNotificationValue: (BOOL) b forKey: (NSString *) theKey { [self setFolderPropertyValue: [NSNumber numberWithBool: b] @@ -1005,7 +1005,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir rules = [cycleinfo objectForKey: @"rules"]; exRules = [cycleinfo objectForKey: @"exRules"]; exDates = [cycleinfo objectForKey: @"exDates"]; - eventTimeZone = allDayTimeZone = tz = nil; + eventTimeZone = nil; + allDayTimeZone = nil; + tz = nil; row = [self fixupRecord: theRecord]; [row removeObjectForKey: @"c_cycleinfo"]; @@ -1062,7 +1064,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir } } - tz = eventTimeZone? eventTimeZone : allDayTimeZone; +#warning this code is ugly: we should not mix objects with different types as\ + it reduces readability + tz = eventTimeZone ? eventTimeZone : allDayTimeZone; if (tz) { // Adjust the exception dates @@ -2250,28 +2254,18 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir - (NSString *) davCalendarShowAlarms { - NSString *boolean; - - if ([self showCalendarAlarms]) - boolean = @"true"; - else - boolean = @"false"; - - return boolean; + return [self davBooleanForResult: [self showCalendarAlarms]]; } - (NSException *) setDavCalendarShowAlarms: (id) newBoolean { NSException *error; - error = nil; - - if ([newBoolean isEqualToString: @"true"] - || [newBoolean isEqualToString: @"1"]) - [self setShowCalendarAlarms: YES]; - else if ([newBoolean isEqualToString: @"false"] - || [newBoolean isEqualToString: @"0"]) - [self setShowCalendarAlarms: NO]; + if ([self isValidDAVBoolean: newBoolean]) + { + [self setShowCalendarAlarms: [self resultForDAVBoolean: newBoolean]]; + error = nil; + } else error = [NSException exceptionWithHTTPStatus: 400 reason: @"Bad boolean value."]; @@ -2279,6 +2273,84 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir return error; } +- (NSString *) davNotifyOnPersonalModifications +{ + return [self davBooleanForResult: [self notifyOnPersonalModifications]]; +} + +- (NSException *) setDavNotifyOnPersonalModifications: (NSString *) newBoolean +{ + NSException *error; + + if ([self isValidDAVBoolean: newBoolean]) + { + [self setNotifyOnPersonalModifications: + [self resultForDAVBoolean: newBoolean]]; + error = nil; + } + else + error = [NSException exceptionWithHTTPStatus: 400 + reason: @"Bad boolean value."]; + + return error; +} + +- (NSString *) davNotifyOnExternalModifications +{ + return [self davBooleanForResult: [self notifyOnExternalModifications]]; +} + +- (NSException *) setDavNotifyOnExternalModifications: (NSString *) newBoolean +{ + NSException *error; + + if ([self isValidDAVBoolean: newBoolean]) + { + [self setNotifyOnExternalModifications: + [self resultForDAVBoolean: newBoolean]]; + error = nil; + } + else + error = [NSException exceptionWithHTTPStatus: 400 + reason: @"Bad boolean value."]; + + return error; +} + +- (NSString *) davNotifyUserOnPersonalModifications +{ + return [self davBooleanForResult: [self notifyUserOnPersonalModifications]]; +} + +- (NSException *) setDavNotifyUserOnPersonalModifications: (NSString *) newBoolean +{ + NSException *error; + + if ([self isValidDAVBoolean: newBoolean]) + { + [self setNotifyUserOnPersonalModifications: + [self resultForDAVBoolean: newBoolean]]; + error = nil; + } + else + error = [NSException exceptionWithHTTPStatus: 400 + reason: @"Bad boolean value."]; + + return error; +} + +- (NSString *) davNotifiedUserOnPersonalModifications +{ + return [self notifiedUserOnPersonalModifications]; +} + +- (NSException *) setDavNotifiedUserOnPersonalModifications: (NSString *) theUser +{ + [self setNotifiedUserOnPersonalModifications: theUser]; + + return nil; +} + /* vevent UID handling */ - (NSString *) resourceNameForEventUID: (NSString *) uid diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index dc26fd78e..172f45a60 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -166,6 +166,10 @@ parameters: (NSArray *) params; /* utilities */ +- (NSString *) davBooleanForResult: (BOOL) result; +- (BOOL) isValidDAVBoolean: (NSString *) davBoolean; +- (BOOL) resultForDAVBoolean: (NSString *) davBoolean; + - (NSString *) labelForKey: (NSString *) key; /* description */ diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 8736cf050..44cc83647 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -27,6 +27,7 @@ #import #import #import +#import #import #import #import @@ -1582,6 +1583,35 @@ return exception; } +- (NSString *) davBooleanForResult: (BOOL) result +{ + return (result ? @"true" : @"false"); +} + +- (BOOL) isValidDAVBoolean: (NSString *) davBoolean +{ + static NSSet *validBooleans = nil; + + if (!validBooleans) + { + validBooleans = [NSSet setWithObjects: @"true", @"false", @"1", @"0", + nil]; + [validBooleans retain]; + } + + return [validBooleans containsObject: davBoolean]; +} + +- (BOOL) resultForDAVBoolean: (NSString *) davBoolean +{ + BOOL result; + + result = ([davBoolean isEqualToString: @"true"] + || [davBoolean isEqualToString: @"1"]); + + return result; +} + - (NSString *) labelForKey: (NSString *) key { return [self labelForKey: key inContext: context];