mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 08:23:28 +00:00
Monotone-Parent: 53787a178138e23c283a66af023cbddab3f3c417
Monotone-Revision: d74fd5d68d5fae10363904ec274b94033ae33c2c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-19T22:44:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user