Monotone-Parent: 53787a178138e23c283a66af023cbddab3f3c417

Monotone-Revision: d74fd5d68d5fae10363904ec274b94033ae33c2c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-11-19T22:44:12
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-11-19 22:44:12 +00:00
parent e357be66f1
commit 2cbc2ba742
19 changed files with 143 additions and 14 deletions

View File

@ -1,5 +1,21 @@
2007-11-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/PreferencesUI/UIxPreferences.m ([UIxPreferences -signature]):
returns the signature for the default identity of the default
accouunt...
([UIxPreferences -setSignature:newSignature]): accessor that sets
the default signature.
* UI/MailerUI/UIxMailAccountActions.m ([UIxMailAccountActions
-composeAction]): append the message signature to the new draft.
* SoObjects/Mailer/SOGoMailReply.m ([SOGoMailReply -signature]):
same as above.
* SoObjects/Mailer/SOGoMailForward.m ([SOGoMailForward
-signature]): new method that takes the user's signature and put
it at the end of the message, if exists.
* UI/Common/UIxPageFrame.m ([UIxPageFrame -isSuperUser]): new
accessor that forwards the call to the active user.

View File

@ -6,3 +6,5 @@ From: <#from/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences>
<#messageBody/>
<#signature/>

View File

@ -67,3 +67,8 @@ messageBody: WOString {
value = messageBody;
escapeHTML = NO;
}
signature: WOString {
value = signature;
escapeHTML = NO;
}

View File

@ -1,3 +1,5 @@
On <#date/>, <#from/> wrote:
<#messageBody/>
<#signature/>

View File

@ -12,3 +12,8 @@ messageBody: WOString {
value = messageBody;
escapeHTML = NO;
}
signature: WOString {
value = signature;
escapeHTML = NO;
}

View File

@ -149,6 +149,19 @@
return [sourceMail contentForEditing];
}
- (NSString *) signature
{
NSString *signature, *mailSignature;
signature = [[context activeUser] signature];
if ([signature length])
mailSignature = [NSString stringWithFormat: @"--\r\n%@", signature];
else
mailSignature = @"";
return mailSignature;
}
@end
@implementation SOGoMailEnglishForward

View File

@ -6,3 +6,5 @@ De: <#from/>
<#hasCc>Copie: <#cc/></#hasCc><#hasNewsGroups>Forums de discussion: <#newsgroups/></#hasNewsGroups><#hasReferences>Références: <#references/></#hasReferences>
<#messageBody/>
<#signature/>

View File

@ -67,3 +67,8 @@ messageBody: WOString {
value = messageBody;
escapeHTML = NO;
}
signature: WOString {
value = signature;
escapeHTML = NO;
}

View File

@ -1,3 +1,5 @@
Le <#date/>, <#from/> a écrit:
<#messageBody/>
<#signature/>

View File

@ -12,3 +12,8 @@ messageBody: WOString {
value = messageBody;
escapeHTML = NO;
}
signature: WOString {
value = signature;
escapeHTML = NO;
}

View File

@ -6,3 +6,5 @@ Sender: <#from/>
<#hasCc>Kopie: <#cc/></#hasCc><#hasNewsGroups>Newsgroup: <#newsgroups/></#hasNewsGroups><#hasReferences>Referenzen: <#references/></#hasReferences>
<#messageBody/>
<#signature/>

View File

@ -67,3 +67,8 @@ messageBody: WOString {
value = messageBody;
escapeHTML = NO;
}
signature: WOString {
value = signature;
escapeHTML = NO;
}

View File

@ -1,3 +1,5 @@
On <#date/>, <#from/> wrote:
<#messageBody/>
<#signature/>

View File

@ -12,3 +12,8 @@ messageBody: WOString {
value = messageBody;
escapeHTML = NO;
}
signature: WOString {
value = signature;
escapeHTML = NO;
}

View File

@ -73,6 +73,19 @@
return [[sourceMail contentForEditing] stringByApplyingMailQuoting];
}
- (NSString *) signature
{
NSString *signature, *mailSignature;
signature = [[context activeUser] signature];
if ([signature length])
mailSignature = [NSString stringWithFormat: @"--\r\n%@", signature];
else
mailSignature = @"";
return mailSignature;
}
@end
@implementation SOGoMailEnglishReply

View File

@ -24,16 +24,18 @@
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOResponse.h>
#import <NGImap4/NGImap4Connection.h>
#import <SoObjects/Mailer/SOGoMailAccount.h>
#import <SoObjects/Mailer/SOGoDraftObject.h>
#import <SoObjects/Mailer/SOGoDraftsFolder.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
#import <SoObjects/SOGo/NSObject+Utilities.h>
#import <SoObjects/SOGo/NSString+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
#import "../Common/WODirectAction+SOGo.h"
@ -143,22 +145,35 @@
{
SOGoDraftsFolder *drafts;
SOGoDraftObject *newDraftMessage;
NSString *urlBase, *url, *value;
NSString *urlBase, *url, *value, *signature;
NSArray *mailTo;
BOOL save;
drafts = [[self clientObject] draftsFolderInContext: context];
newDraftMessage = [drafts newDraft];
save = NO;
value = [[self request] formValueForKey: @"mailto"];
if ([value length] > 0)
{
mailTo = [NSArray arrayWithObject: value];
[newDraftMessage setHeaders: [NSDictionary dictionaryWithObject: mailTo
forKey: @"to"]];
[newDraftMessage storeInfo];
[newDraftMessage
setHeaders: [NSDictionary dictionaryWithObject: mailTo
forKey: @"to"]];
save = YES;
}
signature = [[context activeUser] signature];
if ([signature length])
{
[newDraftMessage
setText: [NSString stringWithFormat: @"\r\n--\r\n%@", signature]];
save = YES;
}
if (save)
[newDraftMessage storeInfo];
urlBase = [newDraftMessage baseURLInContext: context];
url = [urlBase composeURLWithAction: @"edit"
parameters: nil

View File

@ -28,6 +28,7 @@
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WORequest.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
@ -472,7 +473,12 @@ static BOOL shouldDisplayPasswordChange = NO;
// string="itemIdentityText" selection="defaultIdentity"/></label>
- (NSArray *) identitiesList
{
return [user allIdentities];
NSDictionary *primaryAccount;
#warning we manage only one account per user at this time...
primaryAccount = [[user mailAccounts] objectAtIndex: 0];
return [primaryAccount objectForKey: @"identities"];
}
- (NSString *) itemIdentityText
@ -480,9 +486,9 @@ static BOOL shouldDisplayPasswordChange = NO;
return [item keysWithFormat: @"%{fullName} <%{email}>"];
}
- (NSDictionary *) defaultIdentity
- (NSMutableDictionary *) defaultIdentity
{
NSDictionary *currentIdentity, *defaultIdentity;
NSMutableDictionary *currentIdentity, *defaultIdentity;
NSEnumerator *identities;
defaultIdentity = nil;
@ -496,6 +502,19 @@ static BOOL shouldDisplayPasswordChange = NO;
return defaultIdentity;
}
- (NSString *) signature
{
return [[self defaultIdentity] objectForKey: @"signature"];
}
- (void) setSignature: (NSString *) newSignature
{
[[self defaultIdentity] setObject: newSignature
forKey: @"signature"];
[userDefaults setObject: [user mailAccounts]
forKey: @"MailAccounts"];
}
- (id <WOActionResults>) defaultAction
{
id <WOActionResults> results;

View File

@ -19,8 +19,8 @@
label:value="Calendar Options"/></li>
<li target="mailOptionsView"><var:string
label:value="Mail Options"/></li>
<!-- <li target="identitiesView"><var:string
label:value="Identities"/></li> -->
<li target="identitiesView"><var:string
label:value="Identities"/></li>
<var:if condition="shouldDisplayPasswordChange">
<li target="passwordView"><var:string label:value="Password"/></li>
</var:if>
@ -97,10 +97,13 @@
</label> -->
</div>
<div id="identitiesView" class="tab">
<var:multiselection id="identitiesList" item="item"
string="itemIdentityText" selection="defaultIdentity">
<!--<var:multiselection const:id="identitiesList" item="item"
list="identitiesList" displayString="itemIdentityText">
</var:multiselection>
<br/>
<br/>-->
<var:string label:value="Signature:"/><br/>
<textarea const:id="signature" const:name="signature"
var:value="signature"/>
</div>
<var:if condition="shouldDisplayPasswordChange">
<div id="passwordView" class="tab">

View File

@ -22,3 +22,11 @@ DIV#mailOptionsView TEXTAREA
DIV#passwordView
{ padding-top: 3em;
padding-right: 10em; }
DIV#identitiesView
{ padding-top: 5px;
padding-left: 5px; }
#signature
{ width: 380px;
height: 125px; }