merge of '36df3bcfd6c56f483f2676ceb6b6757a6506dbb7'

and 'f12c75a72aac13edc9728fe5a656c622487836dd'

Monotone-Parent: 36df3bcfd6c56f483f2676ceb6b6757a6506dbb7
Monotone-Parent: f12c75a72aac13edc9728fe5a656c622487836dd
Monotone-Revision: 0c622c14bea584c75539ec4bf9d8ca29899745ef

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-14T22:05:54
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-14 22:05:54 +00:00
80 changed files with 1299 additions and 1111 deletions
@@ -105,6 +105,8 @@
"Are you sure you want to delete the selected address book?"
= "Are you sure you want to delete the selected address book?";
"Address Book Name" = "Address Book Name";
"You cannot subscribe to a folder that you own!"
= "You cannot subscribe to a folder that you own!";
"Unable to subscribe to that folder!"
@@ -125,4 +127,4 @@
= "This person can erase cards from this addressbook.";
"The selected contact has no email address."
= "The selected contact has no email address.";
= "The selected contact has no email address.";
+3 -1
View File
@@ -118,6 +118,8 @@
"Are you sure you want to delete the selected address book?"
= "Voulez-vous vraiment supprimer le carnet d'adresses sélectionné ?";
"Address Book Name" = "Nom du carnet d'adresses";
"You cannot subscribe to a folder that you own!"
= "Vous ne pouvez pas vous inscrire à un dossier qui vous appartient!";
"Unable to subscribe to that folder!"
@@ -138,4 +140,4 @@
= "Cette personne peut effacer des fiches de ce carnet d'adresses.";
"The selected contact has no email address."
= "Cette personne n'a pas d'adresse courriel."
= "Cette personne n'a pas d'adresse courriel."
@@ -109,6 +109,8 @@
"Are you sure you want to delete the selected address book?"
= "Voulez-vous vraiment supprimer le carnet d'adresses sélectionné ?";
"Address Book Name" = "Address Book Name";
"You cannot subscribe to a folder that you own!"
= "Vous ne pouvez pas vous inscrire à un dossier qui vous appartient!";
"Unable to subscribe to that folder!"
+2 -2
View File
@@ -584,8 +584,8 @@
id <SOGoContactFolder> co;
co = [self clientObject];
if ([[co class] respondsToSelector: @selector (globallyUniqueObjectId)])
objectId = [[[self clientObject] class] globallyUniqueObjectId];
if ([co respondsToSelector: @selector (globallyUniqueObjectId)])
objectId = [co globallyUniqueObjectId];
else
objectId = nil;
+63 -83
View File
@@ -52,8 +52,7 @@
WORequest *request;
folders = [self clientObject];
action = [NSString stringWithFormat: @"../personal/%@",
actionName];
action = [NSString stringWithFormat: @"../personal/%@", actionName];
request = [[self context] request];
@@ -74,25 +73,6 @@
return [self _selectActionForApplication: @"new"];
}
- (id <WOActionResults>) newAbAction
{
id <WOActionResults> response;
NSString *name;
name = [self queryParameterForKey: @"name"];
if ([name length] > 0)
{
response = [[self clientObject] newFolderWithName: name];
if (!response)
response = [self responseWith204];
}
else
response = [NSException exceptionWithHTTPStatus: 400
reason: @"The name is missing"];
return response;
}
- (id) selectForMailerAction
{
return [self _selectActionForApplication: @"mailer-contacts"];
@@ -193,50 +173,55 @@
return result;
}
- (NSArray *) _gcsFoldersFromFolder: (SOGoContactFolders *) contactFolders
- (NSArray *) _subFoldersFromFolder: (SOGoParentFolder *) parentFolder
{
NSMutableArray *gcsFolders;
NSEnumerator *contactSubfolders;
SOGoContactGCSFolder *currentContactFolder;
NSString *folderName, *displayName;
NSMutableArray *folders;
NSEnumerator *subfolders;
SOGoFolder *currentFolder;
NSString *folderName;
NSMutableDictionary *currentDictionary;
SoSecurityManager *securityManager;
gcsFolders = [NSMutableArray new];
[gcsFolders autorelease];
securityManager = [SoSecurityManager sharedSecurityManager];
// return (([securityManager validatePermission: SoPerm_AccessContentsInformation
// onObject: contactFolder
// inContext: context] == nil)
contactSubfolders = [[contactFolders subFolders] objectEnumerator];
currentContactFolder = [contactSubfolders nextObject];
while (currentContactFolder)
folders = [NSMutableArray new];
[folders autorelease];
subfolders = [[parentFolder subFolders] objectEnumerator];
currentFolder = [subfolders nextObject];
while (currentFolder)
{
if ([currentContactFolder
isKindOfClass: [SOGoContactGCSFolder class]])
if (![securityManager validatePermission: SOGoPerm_AccessObject
onObject: currentFolder inContext: context])
{
displayName = [[currentContactFolder ocsFolder] folderName];
if (displayName)
{
folderName = [NSString stringWithFormat: @"/Contacts/%@",
[currentContactFolder nameInContainer]];
currentDictionary
= [NSMutableDictionary dictionaryWithCapacity: 3];
[currentDictionary setObject: displayName forKey: @"displayName"];
[currentDictionary setObject: folderName forKey: @"name"];
[currentDictionary setObject: @"contact" forKey: @"type"];
[gcsFolders addObject: currentDictionary];
}
folderName = [NSString stringWithFormat: @"/%@/%@",
[parentFolder nameInContainer],
[currentFolder nameInContainer]];
currentDictionary
= [NSMutableDictionary dictionaryWithCapacity: 3];
[currentDictionary setObject: [currentFolder displayName]
forKey: @"displayName"];
[currentDictionary setObject: folderName forKey: @"name"];
[currentDictionary setObject: [currentFolder folderType]
forKey: @"type"];
[folders addObject: currentDictionary];
}
currentContactFolder = [contactSubfolders nextObject];
currentFolder = [subfolders nextObject];
}
return gcsFolders;
return folders;
}
- (NSArray *) _foldersForUID: (NSString *) uid
ofType: (NSString *) folderType
{
NSObject *topFolder, *userFolder;
SOGoContactFolders *contactFolders;
SOGoParentFolder *parentFolder;
NSMutableArray *folders;
NSMutableDictionary *currentDictionary;
folders = [NSMutableArray new];
[folders autorelease];
@@ -245,23 +230,19 @@
userFolder = [topFolder lookupName: uid inContext: context acquire: NO];
/* FIXME: should be moved in the SOGo* classes. Maybe by having a SOGoFolderManager. */
#warning this might need adjustments whenever we permit multiple calendar folders per-user
if ([folderType length] == 0 || [folderType isEqualToString: @"calendar"])
{
currentDictionary = [NSMutableDictionary new];
[currentDictionary autorelease];
[currentDictionary setObject: [self labelForKey: @"Calendar"]
forKey: @"displayName"];
[currentDictionary setObject: @"/Calendar" forKey: @"name"];
[currentDictionary setObject: @"calendar" forKey: @"type"];
[folders addObject: currentDictionary];
parentFolder = [userFolder lookupName: @"Calendar"
inContext: context acquire: NO];
[folders
addObjectsFromArray: [self _subFoldersFromFolder: parentFolder]];
}
if ([folderType length] == 0 || [folderType isEqualToString: @"contact"])
{
contactFolders = [userFolder lookupName: @"Contacts"
inContext: context acquire: NO];
parentFolder = [userFolder lookupName: @"Contacts"
inContext: context acquire: NO];
[folders
addObjectsFromArray: [self _gcsFoldersFromFolder: contactFolders]];
addObjectsFromArray: [self _subFoldersFromFolder: parentFolder]];
}
return folders;
@@ -352,31 +333,30 @@
return result;
}
- (SOGoContactGCSFolder *) contactFolderForUID: (NSString *) uid
{
SOGoFolder *upperContainer;
SOGoUserFolder *userFolder;
SOGoContactFolders *contactFolders;
SOGoContactGCSFolder *contactFolder;
SoSecurityManager *securityManager;
// - (SOGoContactGCSFolder *) contactFolderForUID: (NSString *) uid
// {
// SOGoFolder *upperContainer;
// SOGoUserFolder *userFolder;
// SOGoContactFolders *contactFolders;
// SOGoContactGCSFolder *contactFolder;
// SoSecurityManager *securityManager;
upperContainer = [[[self clientObject] container] container];
userFolder = [SOGoUserFolder objectWithName: uid
inContainer: upperContainer];
contactFolders = [SOGoContactFolders objectWithName: @"Contacts"
inContainer: userFolder];
contactFolder = [SOGoContactGCSFolder objectWithName: @"personal"
inContainer: contactFolders];
[contactFolder
setOCSPath: [NSString stringWithFormat: @"/Users/%@/Contacts/personal", uid]];
[contactFolder setOwner: uid];
// upperContainer = [[[self clientObject] container] container];
// userFolder = [SOGoUserFolder objectWithName: uid
// inContainer: upperContainer];
// contactFolders = [SOGoUserFolder lookupName: @"Contacts"
// inContext: context
// acquire: NO];
// contactFolder = [contactFolders lookupName: @"personal"
// inContext: context
// acquire: NO];
securityManager = [SoSecurityManager sharedSecurityManager];
// securityManager = [SoSecurityManager sharedSecurityManager];
return (([securityManager validatePermission: SoPerm_AccessContentsInformation
onObject: contactFolder
inContext: context] == nil)
? contactFolder : nil);
}
// return (([securityManager validatePermission: SoPerm_AccessContentsInformation
// onObject: contactFolder
// inContext: context] == nil)
// ? contactFolder : nil);
// }
@end
-19
View File
@@ -81,25 +81,6 @@
return selectorComponentClass;
}
- (id <WOActionResults>) deleteAction
{
id <WOActionResults> result;
NSException <WOActionResults> *ex;
WOResponse *response;
ex = [[self clientObject] delete];
if (ex)
result = ex;
else
{
response = [context response];
[response setStatus: 200];
result = response;
}
return result;
}
- (NSString *) defaultSortKey
{
return @"displayName";
+1 -11
View File
@@ -31,28 +31,18 @@
@interface UIxContactsListViewContainer : UIxComponent
{
NSString *foldersPrefix;
NSString *selectorComponentClass;
NSString *currentAdditionalFolder;
NSDictionary *additionalFolders;
id currentFolder;
}
- (void) setCurrentFolder: (id) folder;
- (NSString *) foldersPrefix;
- (NSArray *) contactFolders;
- (NSString *) currentContactFolderId;
- (NSString *) currentContactFolderOwner;
- (NSString *) currentContactFolderName;
- (NSArray *) additionalFolders;
- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder;
- (NSString *) currentAdditionalFolder;
- (NSString *) currentAdditionalFolderName;
@end
#endif /* UIXCONTACTSLISTVIEWCONTAINERBASE_H */
+3 -62
View File
@@ -41,20 +41,12 @@
{
if ((self = [super init]))
{
foldersPrefix = nil;
selectorComponentClass = nil;
additionalFolders = nil;
}
return self;
}
- (void) dealloc
{
[additionalFolders release];
[super dealloc];
}
- (void) setSelectorComponentClass: (NSString *) aComponentClass
{
selectorComponentClass = aComponentClass;
@@ -86,30 +78,6 @@
currentFolder = folder;
}
- (NSString *) foldersPrefix
{
NSMutableArray *folders;
SOGoObject *currentObject;
if (!foldersPrefix)
{
folders = [NSMutableArray new];
[folders autorelease];
currentObject = [[self clientObject] container];
while (![currentObject isKindOfClass: [SOGoContactFolders class]])
{
[folders insertObject: [currentObject nameInContainer] atIndex: 0];
currentObject = [currentObject container];
}
foldersPrefix = [folders componentsJoinedByString: @"/"];
[foldersPrefix retain];
}
return foldersPrefix;
}
- (NSArray *) contactFolders
{
SOGoContactFolders *folderContainer;
@@ -121,8 +89,7 @@
- (NSString *) currentContactFolderId
{
return [NSString stringWithFormat: @"%@/%@",
[self foldersPrefix],
return [NSString stringWithFormat: @"/%@",
[currentFolder nameInContainer]];
}
@@ -131,35 +98,9 @@
return [currentFolder displayName];
}
- (NSArray *) additionalFolders
- (NSString *) currentContactFolderOwner
{
NSUserDefaults *ud;
if (!additionalFolders)
{
ud = [[context activeUser] userSettings];
additionalFolders
= [[ud objectForKey: @"Contacts"] objectForKey: @"SubscribedFolders"];
[additionalFolders retain];
}
return [additionalFolders allKeys];
}
- (void) setCurrentAdditionalFolder: (NSString *) newCurrentAdditionalFolder
{
currentAdditionalFolder = newCurrentAdditionalFolder;
}
- (NSString *) currentAdditionalFolder
{
return currentAdditionalFolder;
}
- (NSString *) currentAdditionalFolderName
{
return [[additionalFolders objectForKey: currentAdditionalFolder]
objectForKey: @"displayName"];
return [currentFolder ownerInContext: context];
}
- (BOOL) hasContactSelectionButtons
-10
View File
@@ -17,11 +17,6 @@
pageName = "UIxContactFoldersView";
actionName = "new";
};
newAb = {
protectedBy = "View";
pageName = "UIxContactFoldersView";
actionName = "newAb";
};
mailer-contacts = {
protectedBy = "View";
pageName = "UIxContactFoldersView";
@@ -87,11 +82,6 @@
pageName = "UIxContactsListView";
actionName = "mailerContacts";
};
delete = {
protectedBy = "SaveAcls"; /* a hack to force "owner" */
pageName = "UIxContactsListView";
actionName = "delete";
};
userRights = {
protectedBy = "ReadAcls";
pageName = "UIxContactsUserRightsEditor";