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";