From d7601f5d27b399fb9f7b203f01260e49e77c39c4 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 3 Aug 2006 21:34:19 +0000 Subject: [PATCH] Monotone-Parent: c4b57bd1cf368f4918027a1afcabf6f86bae1404 Monotone-Revision: 70ab4ae0cde514bb9351f75f64a1d92afee561ec Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-03T21:34:19 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 11 +++++++++++ UI/MailerUI/UIxMailAccountsView.m | 31 +++++++++++++++++++++++++++++++ UI/MailerUI/product.plist | 5 +++++ 3 files changed, 47 insertions(+) diff --git a/ChangeLog b/ChangeLog index 709c4b912..8fe97d257 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-08-03 Wolfgang Sourdeau + * UI/MailerUI/UIxMailAccountsView.m ([UIxMailAccountsView + -composeAction]): new action method that permits external object + to write a message from the default (primary) account. + + * UI/Contacts/UIxContactEditorBase.m ([UIxContactEditorBase + -initSnapshot]): new method with code taken from "defaultAction" + but needed for others. + ([UIxContactEditorBase -writeAction]): new action designed to + compose the correct URL needed to obtain the MailerUI's email + editor with the correct "mailto" parameter. + * UI/Common/UIxSortableTableHeader.m: moved from MailerUI to Common so that other modules can use it. diff --git a/UI/MailerUI/UIxMailAccountsView.m b/UI/MailerUI/UIxMailAccountsView.m index 43dc81194..9613ed87b 100644 --- a/UI/MailerUI/UIxMailAccountsView.m +++ b/UI/MailerUI/UIxMailAccountsView.m @@ -20,6 +20,7 @@ */ #include +#include @interface UIxMailAccountsView : UIxComponent { @@ -54,4 +55,34 @@ return actionResult; } +- (id) composeAction +{ + NSArray *c; + NSString *inbox, *url, *parameter; + NSMutableDictionary *urlParams; + id actionResult; + + c = [[self clientObject] toManyRelationshipKeys]; + if ([c count] > 0) + { + urlParams = [NSMutableDictionary new]; + [urlParams autorelease]; + + parameter = [self queryParameterForKey: @"mailto"]; + if (parameter) + [urlParams setObject: parameter + forKey: @"mailto"]; + inbox = [NSString stringWithFormat: @"%@/INBOX", + [c objectAtIndex: 0]]; + url = [inbox composeURLWithAction: @"compose" + parameters: urlParams + andHash: NO]; + actionResult = [self redirectToLocation: url]; + } + else + actionResult = self; + + return actionResult; +} + @end /* UIxMailAccountsView */ diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 529562c64..6eca7c7c1 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -236,6 +236,11 @@ protectedBy = "View"; pageName = "UIxMailAccountsView"; }; + compose = { + protectedBy = "View"; + pageName = "UIxMailAccountsView"; + actionName = "compose"; + }; getMail = { protectedBy = "View"; pageName = "UIxMailAccountsView";