From e70b3cdf8e1e3804909020d60e371ec1d67f1bbd Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 19 Feb 2010 19:04:19 +0000 Subject: [PATCH] Monotone-Parent: cf8164b6f952e813c169ac20422479f98450cc37 Monotone-Revision: bafb19936650e4226152d9b06d89e2cefc8d9c5b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-02-19T19:04:19 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Scheduler/UIxCalListingActions.m | 29 +++++++++++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b51fa54b..8aed60c5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-02-19 Wolfgang Sourdeau + * UI/Scheduler/UIxCalListingActions.m (:): + _fetchFields:forComponentOfType: mark events of remote calendars + as non-editable. + * UI/Common/UIxPageFrame.m (-userIdentification): ancient "userEmail" method, with a more generic name. Also we now return the user's complete name. diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index bd2de42f7..19b6d4f41 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -51,6 +51,7 @@ #import #import #import +#import #import #import @@ -316,7 +317,7 @@ static NSArray *tasksFields = nil; SOGoAppointmentFolders *clientObject; SOGoUser *ownerUser; NSString *owner, *role; - BOOL isErasable; + BOOL isErasable, *folderIsRemote; infos = [NSMutableArray array]; marker = [NSNull null]; @@ -328,6 +329,8 @@ static NSArray *tasksFields = nil; if ([currentFolder isActive] && (![component isEqualToString: @"vtodo"] || [currentFolder showCalendarTasks])) { + folderIsRemote + = [currentFolder isKindOfClass: [SOGoWebAppointmentFolder class]]; currentInfos = [[currentFolder fetchCoreInfosFrom: startDate to: endDate @@ -341,17 +344,23 @@ static NSArray *tasksFields = nil; { if ([fields containsObject: @"editable"]) { - role = - [currentFolder roleForComponentsWithAccessClass: - [[newInfo objectForKey: @"c_classification"] intValue] - forUser: userLogin]; - if ([role isEqualToString: @"ComponentModifier"] - || [role length] == 0) - [newInfo setObject: [NSNumber numberWithInt: 1] - forKey: @"editable"]; - else + if (folderIsRemote) [newInfo setObject: [NSNumber numberWithInt: 0] forKey: @"editable"]; + else + { + role = + [currentFolder roleForComponentsWithAccessClass: + [[newInfo objectForKey: @"c_classification"] intValue] + forUser: userLogin]; + if ([role isEqualToString: @"ComponentModifier"] + || [role length] == 0) + [newInfo setObject: [NSNumber numberWithInt: 1] + forKey: @"editable"]; + else + [newInfo setObject: [NSNumber numberWithInt: 0] + forKey: @"editable"]; + } } if ([fields containsObject: @"ownerIsOrganizer"]) {