mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 16:35:10 +00:00
(feat) handle links to addressbooks like we do for calendars
also included missing template commit for calendar
This commit is contained in:
@@ -275,12 +275,19 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
return [[self queryParameterForKey: @"popup"] boolValue];
|
||||
}
|
||||
|
||||
- (BOOL) isPublicAccessEnabled
|
||||
{
|
||||
// NOTE: This method is the same found in Common/UIxAclEditor.m
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess];
|
||||
}
|
||||
|
||||
- (NSString *) contactFolders
|
||||
{
|
||||
SOGoContactFolders *folderContainer;
|
||||
NSArray *folders;
|
||||
NSMutableArray *foldersAttrs;
|
||||
NSMutableDictionary *urls;
|
||||
NSDictionary *folderAttrs;
|
||||
NSArray *folders;
|
||||
id currentFolder;
|
||||
int max, i;
|
||||
|
||||
@@ -291,9 +298,25 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
folders = [folderContainer subFolders];
|
||||
max = [folders count];
|
||||
foldersAttrs = [NSMutableArray arrayWithCapacity: max];
|
||||
urls = nil;
|
||||
|
||||
for (i = 0; i < max; i++)
|
||||
{
|
||||
currentFolder = [folders objectAtIndex: i];
|
||||
|
||||
if ([currentFolder respondsToSelector: @selector(cardDavURL)])
|
||||
{
|
||||
urls = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
[currentFolder cardDavURL], @"cardDavURL",
|
||||
nil];
|
||||
if ([self isPublicAccessEnabled])
|
||||
{
|
||||
[urls setObject: [currentFolder publicCardDavURL] forKey: @"publicCardDavURL"];
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: keep urls as the last key/value here, to avoid chopping the dictionary
|
||||
// if it is not a GCS folder
|
||||
folderAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSString stringWithFormat: @"%@", [currentFolder nameInContainer]], @"id",
|
||||
[currentFolder displayName], @"name",
|
||||
@@ -301,6 +324,7 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
[NSNumber numberWithBool: [currentFolder isKindOfClass: SOGoGCSFolderK]], @"isEditable",
|
||||
[NSNumber numberWithBool: [currentFolder isKindOfClass: SOGoContactSourceFolderK]
|
||||
&& ![currentFolder isPersonalSource]], @"isRemote",
|
||||
urls, @"urls",
|
||||
nil];
|
||||
[foldersAttrs addObject: folderAttrs];
|
||||
}
|
||||
@@ -419,12 +443,6 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK;
|
||||
return [super defaultAction];
|
||||
}
|
||||
|
||||
- (BOOL) isPublicAccessEnabled
|
||||
{
|
||||
// NOTE: This method is the same found in Common/UIxAclEditor.m
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] enablePublicAccess];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface UIxContactViewTemplate : UIxComponent
|
||||
|
||||
Reference in New Issue
Block a user