diff --git a/SoObjects/SOGo/SOGoGCSFolder.h b/SoObjects/SOGo/SOGoGCSFolder.h index 578bb7157..6a3f56fa7 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.h +++ b/SoObjects/SOGo/SOGoGCSFolder.h @@ -77,6 +77,9 @@ - (id) folderPropertyValueInCategory: (NSString *) theKey forUser: (SOGoUser *) theUser; +- (BOOL) synchronize; +- (void) setSynchronize: (BOOL) new; + /* lower level fetches */ - (void) deleteEntriesWithIds: (NSArray *) ids; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 703030fd7..8e245bd9a 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -301,6 +301,29 @@ static NSArray *childRecordFields = nil; return name; } +- (BOOL) synchronize +{ + NSNumber *synchronize; + + synchronize = [self folderPropertyValueInCategory: @"FolderSynchronize"]; + + return [synchronize boolValue]; +} + +- (void) setSynchronize: (BOOL) new +{ + NSNumber *synchronize; + + if (new) + synchronize = [NSNumber numberWithBool: YES]; + else + synchronize = nil; + + [self setFolderPropertyValue: synchronize + inCategory: @"FolderSynchronize"]; +} + + /* This method fetches the display name defined by the owner, but is also the fallback when a subscriber has not redefined the display name yet in their environment. */ diff --git a/UI/Scheduler/UIxCalendarProperties.m b/UI/Scheduler/UIxCalendarProperties.m index 40250ba03..ee496d1ff 100644 --- a/UI/Scheduler/UIxCalendarProperties.m +++ b/UI/Scheduler/UIxCalendarProperties.m @@ -68,6 +68,7 @@ * @apiParam {Number} includeInFreeBusy 1 if calendar must be include in freebusy * @apiParam {Number} showCalendarAlarms 1 if alarms must be enabled * @apiParam {Number} showCalendarTasks 1 if tasks must be enabled + * @apiParam {Number} synchronize 1 if we enable EAS synchronization for this calendar * @apiParam {Number} reloadOnLogin 1 if calendar is a Web calendar that must be reload when user logins * @apiParam {Object} [notifications] Notification (if active user is the calendar's owner) * @apiParam {Number} notifications.notifyOnPersonalModifications 1 if a mail is sent for each modification made by the owner @@ -108,6 +109,10 @@ if ([o isKindOfClass: [NSNumber class]]) [calendar setShowCalendarTasks: [o boolValue]]; + o = [params objectForKey: @"synchronize"]; + if ([o isKindOfClass: [NSNumber class]]) + [calendar setSynchronize: [o boolValue]]; + values = [params objectForKey: @"notifications"]; if ([values isKindOfClass: [NSDictionary class]]) { diff --git a/UI/Scheduler/UIxCalendarSelector.m b/UI/Scheduler/UIxCalendarSelector.m index df081ca6c..86a709684 100644 --- a/UI/Scheduler/UIxCalendarSelector.m +++ b/UI/Scheduler/UIxCalendarSelector.m @@ -99,7 +99,7 @@ _intValueFromHex (NSString *hexString) NSNumber *isActive, *fActiveTasks; SOGoAppointmentFolders *co; SOGoAppointmentFolder *folder; - BOOL reloadOnLogin; + BOOL reloadOnLogin, synchronize; if (!calendars) { @@ -133,6 +133,16 @@ _intValueFromHex (NSString *hexString) [calendar setObject: [NSNumber numberWithBool: [folder showCalendarAlarms]] forKey: @"showCalendarAlarms"]; [calendar setObject: [NSNumber numberWithBool: [folder showCalendarTasks]] forKey: @"showCalendarTasks"]; + if ([folder isKindOfClass: [SOGoWebAppointmentFolder class]]) + synchronize = NO; + else + synchronize = [folder synchronize]; + + if ([[folder nameInContainer] isEqualToString: @"personal"]) + synchronize = YES; + + [calendar setObject: [NSNumber numberWithBool: synchronize] forKey: @"synchronize"]; + if ([folder isWebCalendar]) { urls = [NSMutableDictionary dictionaryWithObject: [folder folderPropertyValueInCategory: @"WebCalendars"] diff --git a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox index bfcd079a5..440eb7693 100644 --- a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox +++ b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox @@ -25,7 +25,7 @@ - + + + + -
+