mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 14:43:31 +00:00
The collected address book will be created only if the user select it in the preferences. Fix labels.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
"Personal Address Book" = "Carnet d'adresses personnel";
|
||||
"Collected Address Book" = "Carnet d'adresses recueilli";
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
@interface SOGoContactFolders : SOGoParentFolder
|
||||
|
||||
- (NSString *) defaultFolderName;
|
||||
- (NSString *) collectedFolderName;
|
||||
|
||||
- (NSException *) renameLDAPAddressBook: (NSString *) sourceID
|
||||
withDisplayName: (NSString *) newDisplayName;
|
||||
|
||||
@@ -268,7 +268,7 @@ Class SOGoContactSourceFolderK;
|
||||
SOGoUser *currentUser;
|
||||
id <SOGoSource> source;
|
||||
|
||||
if ([sourceID isEqualToString: @"personal"] || [sourceID isEqualToString: @"collected"])
|
||||
if ([sourceID isEqualToString: @"personal"])
|
||||
result = [NSException exceptionWithHTTPStatus: 403
|
||||
reason: (@"folder '%@' cannot be deleted", sourceID)];
|
||||
else
|
||||
@@ -295,6 +295,11 @@ Class SOGoContactSourceFolderK;
|
||||
return [self labelForKey: @"Personal Address Book"];
|
||||
}
|
||||
|
||||
- (NSString *) collectedFolderName
|
||||
{
|
||||
return [self labelForKey: @"Collected Address Book"];
|
||||
}
|
||||
|
||||
- (NSArray *) toManyRelationshipKeys
|
||||
{
|
||||
NSMutableArray *keys;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
+ (Class) subFolderClass;
|
||||
|
||||
- (NSString *) defaultFolderName;
|
||||
- (NSString *) collectedFolderName;
|
||||
|
||||
- (NSException *) appendPersonalSources;
|
||||
- (void) removeSubFolder: (NSString *) subfolderName;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#import <DOM/DOMElement.h>
|
||||
#import <DOM/DOMProtocols.h>
|
||||
#import <SaxObjC/XMLNamespaces.h>
|
||||
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
|
||||
#import "NSObject+DAV.h"
|
||||
@@ -175,18 +175,18 @@ static SoSecurityManager *sm = nil;
|
||||
if ([roles containsObject: SoRole_Owner] ||
|
||||
(folderOwner && [folderOwner isResource]))
|
||||
{
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
if (folderType == 0)
|
||||
if (folderType == SOGoPersonalFolder)
|
||||
{
|
||||
folderName = @"personal";
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
[folder setDisplayName: [self defaultFolderName]];
|
||||
}
|
||||
else if (folderType == 1)
|
||||
else if (folderType == SOGoCollectedFolder)
|
||||
{
|
||||
folderName = @"Collected Address Book";
|
||||
folderName = @"collected";
|
||||
folder = [subFolderClass objectWithName: folderName inContainer: self];
|
||||
[folder setDisplayName: [self collectedFolderName]];
|
||||
}
|
||||
|
||||
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, folderName]];
|
||||
|
||||
if ([folder create])
|
||||
@@ -203,6 +203,8 @@ static SoSecurityManager *sm = nil;
|
||||
SOGoGCSFolder *folder;
|
||||
NSString *key;
|
||||
NSException *error;
|
||||
SOGoUserDefaults *ud;
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
if (!subFolderClass)
|
||||
subFolderClass = [[self class] subFolderClass];
|
||||
@@ -221,15 +223,16 @@ static SoSecurityManager *sm = nil;
|
||||
[subFolders setObject: folder forKey: key];
|
||||
}
|
||||
}
|
||||
if (folderType == 0)
|
||||
if (folderType == SOGoPersonalFolder)
|
||||
{
|
||||
if (![subFolders objectForKey: @"personal"])
|
||||
[self createSpecialFolder: SOGoPersonalFolder];
|
||||
}
|
||||
else if (folderType == 1)
|
||||
else if (folderType == SOGoCollectedFolder)
|
||||
{
|
||||
if (![subFolders objectForKey: @"collected"])
|
||||
[self createSpecialFolder: SOGoCollectedFolder];
|
||||
if ([[ud selectedAddressBook] isEqualToString:@"collected"])
|
||||
[self createSpecialFolder: SOGoCollectedFolder];
|
||||
}
|
||||
}
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user