From 08b62198a4fd95ff0dd3b15a85428a7c29eaabf2 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 21 Aug 2006 17:45:35 +0000 Subject: [PATCH] Monotone-Parent: 188f677989080c34ae076500016b9830247f2cbe Monotone-Revision: 20ca7f13f9a91f5f53ebdc147c167f8c3c8704d1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-21T17:45:35 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ UI/Contacts/UIxContactEditorBase.m | 2 +- UI/Contacts/UIxContactFoldersView.m | 15 +++++++++++++++ UI/Contacts/product.plist | 5 +++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 24da98a58..249b121df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-08-21 Wolfgang Sourdeau + * UI/Contacts/UIxContactEditorBase.m: invokes + globallyUniqueObjectId on the clientobject's class instead of the + hardcoded "SOGoFolder". + + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView + -newAction]): redirect the "new" action to the personal (default) + contact folder. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject +objectWithName:inContainer:]): new constructor. diff --git a/UI/Contacts/UIxContactEditorBase.m b/UI/Contacts/UIxContactEditorBase.m index 5f1bf6c4d..69b8241a3 100644 --- a/UI/Contacts/UIxContactEditorBase.m +++ b/UI/Contacts/UIxContactEditorBase.m @@ -299,7 +299,7 @@ */ NSString *uri, *objectId, *nextMethod; - objectId = [NSClassFromString(@"SOGoContactFolder") globallyUniqueObjectId]; + objectId = [[[self clientObject] class] globallyUniqueObjectId]; if ([objectId length] == 0) { return [NSException exceptionWithHTTPStatus:500 /* Internal Error */ reason:@"could not create a unique ID"]; diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 8fa4f22dd..8b1ffccc9 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -38,6 +38,21 @@ return [self redirectToLocation: [folders defaultSourceName]]; } +- (id) newAction +{ + SOGoContactFolders *folders; + NSString *url, *contactEmail; + + folders = [self clientObject]; + contactEmail = [self queryParameterForKey: @"contactEmail"]; + + url = [NSString stringWithFormat: @"%@/new?contactEmail=%@", + [folders defaultSourceName], + contactEmail]; + + return [self redirectToLocation: url]; +} + - (id) selectAction { SOGoContactFolders *folders; diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index e57786c48..5bf01aaeb 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -14,6 +14,11 @@ protectedBy = "View"; pageName = "UIxContactFoldersView"; }; + new = { + protectedBy = "View"; + pageName = "UIxContactFoldersView"; + actionName = "new"; + }; select = { protectedBy = "View"; pageName = "UIxContactFoldersView";