diff --git a/ChangeLog b/ChangeLog index d9c52c637..7b43649f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2011-10-21 Francis Lachapelle + + * SoObjects/SOGo/SOGoUserManager.m + (-_compactAndCompleteContacts:): add the key "isGroup" when defined. + + * UI/MainUI/SOGoUserHomePage.m (:_usersForResults:inDomain:): + add a boolean value in the returning array that identifies if the + user is actually a group. + + * UI/Common/UIxAclEditor.m (-currentUserClass): return the CSS + class that identifies the user as a single contact or list of contacts. + + * UI/WebServerResources/UIxContactsUserFolders.js + (addUserLineToTree): extract the new field that is set to 1 when + the user is actually a group. + + * UI/WebServerResources/UIxAclEditor.js (addUser): new argument to + to identify the type of user (person or group). + + * UI/WebServerResources/UIxMailToSelection.js + (expandContactListCallback): don't expand contacts without an + email address. + 2011-10-19 Wolfgang Sourdeau * OpenChange/MAPIStoreDraftsMessage.m (-getPrDisplayTo:inMemCtx:) diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 9fa124793..7113769c8 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -804,6 +804,7 @@ NSArray *newContacts; NSMutableArray *emails; NSString *uid, *email, *info; + NSNumber *isGroup; compactContacts = [NSMutableDictionary dictionary]; while ((userEntry = [contacts nextObject])) @@ -844,6 +845,9 @@ && ![[returnContact objectForKey: @"c_info"] length]) [returnContact setObject: info forKey: @"c_info"]; [self _fillContactMailRecords: returnContact]; + isGroup = [userEntry objectForKey: @"isGroup"]; + if (isGroup) + [returnContact setObject: isGroup forKey: @"isGroup"]; } } diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index e825a8bcd..27f6cfd89 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -96,9 +96,6 @@ aclsEnum = [[self aclsForObject] objectEnumerator]; while ((currentUID = [aclsEnum nextObject])) { - if ([currentUID hasPrefix: @"@"]) - // NOTE: don't remove the prefix if we want to identify the lists visually - currentUID = [currentUID substringFromIndex: 1]; if (!([currentUID isEqualToString: ownerLogin] || [currentUID isEqualToString: defaultUserID] || [currentUID isEqualToString: @"anonymous"])) @@ -117,20 +114,25 @@ - (NSString *) currentUser { - return currentUser; + return ([currentUser hasPrefix: @"@"] + ? [currentUser substringFromIndex: 1] + : currentUser); +} + +- (NSString *) currentUserClass +{ + return ([currentUser hasPrefix: @"@"] + ? @"normal-group" + : @"normal-user"); } - (NSString *) currentUserDisplayName { SOGoUserManager *um; - NSString *s; um = [SOGoUserManager sharedUserManager]; - s = ([currentUser hasPrefix: @"@"] - ? [currentUser substringFromIndex: 1] - : currentUser); - return [um getFullEmailForUID: s]; + return [um getFullEmailForUID: [self currentUser]]; } - (BOOL) canSubscribeUsers diff --git a/UI/MainUI/SOGoUserHomePage.m b/UI/MainUI/SOGoUserHomePage.m index 2d79eef0a..86a8f0a1d 100644 --- a/UI/MainUI/SOGoUserHomePage.m +++ b/UI/MainUI/SOGoUserHomePage.m @@ -326,7 +326,7 @@ NSMutableArray *jsonResponse, *jsonLine; NSArray *allUsers; int count, max; - BOOL activeUserIsInDomain; + BOOL activeUserIsInDomain, isGroup; login = [[context activeUser] login]; activeUserIsInDomain = ([domain length] == 0 || [[[context activeUser] domain] isEqualToString: domain]); @@ -352,6 +352,7 @@ [jsonLine addObject: uid]; [jsonLine addObject: [contact objectForKey: @"cn"]]; [jsonLine addObject: [contact objectForKey: @"c_email"]]; + [jsonLine addObject: [NSNumber numberWithBool: [[contact objectForKey: @"isGroup"] boolValue]]]; contactInfo = [contact objectForKey: @"c_info"]; if (contactInfo) [jsonLine addObject: contactInfo]; diff --git a/UI/Templates/UIxAclEditor.wox b/UI/Templates/UIxAclEditor.wox index b9ed8f443..d567d39d7 100644 --- a/UI/Templates/UIxAclEditor.wox +++ b/UI/Templates/UIxAclEditor.wox @@ -38,7 +38,7 @@