Monotone-Parent: 4f6055656f29743c9da3d3dcce84f449939717bf
Monotone-Revision: 60ad639c204e75de92c1111a09d2ecfe2cbd655b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-07-11T17:53:09 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
77d9730062
commit
fcd86bfa96
27
ChangeLog
27
ChangeLog
|
@ -1,5 +1,32 @@
|
|||
2006-07-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Templates/MailerUI/UIxMailView.wox: added a div of class
|
||||
"menu" and id "addressMenu" have the header email addresses
|
||||
display it with the new menu code in generic.js.
|
||||
|
||||
* UI/Templates/MailerUI/UIxMailPanelFrame.wox: same as below +
|
||||
replaced the body tables with a div of class "pageContent"
|
||||
(standardization across the page templates).
|
||||
|
||||
* UI/Templates/MailerUI/UIxMailMainFrame.wox: include
|
||||
productJavaScriptURL and pageJavaScriptURL (conditionnally) since
|
||||
those are now inherited from UIxPageFrame.
|
||||
|
||||
* UI/MailerUI/UIxMailView.js: new file specific to UIxMailView.
|
||||
|
||||
* UI/MailerUI/UIxMailToSelection.m ([UIxMailToSelection -to]): if
|
||||
a "mailto" URL parameter is detected and the "to" array is empty,
|
||||
initialize "to" with the value of "mailto" before returning it.
|
||||
|
||||
* UI/MailerUI/UIxMailEditorAction.m ([UIxMailEditorAction
|
||||
-composeAction]): rewrote method in a cleaner way and with usage
|
||||
of the URL extensions to NSString and NSDictionary (see below).
|
||||
Also, if a "mailto" url parameter is detected, pass it to the
|
||||
redirected url.
|
||||
|
||||
* UI/MailerUI/UIxMailMainFrame.m: subclassed from UIxPageFrame to
|
||||
reduce code.
|
||||
|
||||
* UI/Common/NSDictionary+URL.m ([NSDictionary -asURLParameters]):
|
||||
returns a parameter string to add to a base URL.
|
||||
|
||||
|
|
|
@ -88,3 +88,8 @@
|
|||
/* MailMoveToPopUp */
|
||||
|
||||
"MoveTo" = "Déplacer vers";
|
||||
|
||||
/* Address Popup menu */
|
||||
"Add to Address Book..." = "Ajouter au carnet d'adresses";
|
||||
"Compose Mail To" = "Écrire à";
|
||||
"Create Filter From Message..." = "Créer un filtre à partir du message...";
|
||||
|
|
|
@ -45,6 +45,7 @@ MailerUI_OBJC_FILES += \
|
|||
MailerUI_RESOURCE_FILES += \
|
||||
Version \
|
||||
product.plist \
|
||||
UIxMailView.js \
|
||||
Toolbars/*.toolbar \
|
||||
Images/*.png
|
||||
|
||||
|
|
|
@ -27,9 +27,12 @@
|
|||
#include <SoObjects/Mailer/SOGoMailObject.h>
|
||||
#include "common.h"
|
||||
|
||||
#import "../Common/NSString+URL.h"
|
||||
|
||||
@implementation UIxMailEditorAction
|
||||
|
||||
- (void)dealloc {
|
||||
- (void)dealloc
|
||||
{
|
||||
[self->newDraft release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -74,42 +77,63 @@
|
|||
|
||||
/* compose */
|
||||
|
||||
- (id)composeAction {
|
||||
- (id) composeAction
|
||||
{
|
||||
SOGoDraftsFolder *drafts;
|
||||
WOResponse *r;
|
||||
NSString *url;
|
||||
id accountFolder;
|
||||
|
||||
NSString *urlBase, *url;
|
||||
NSMutableDictionary *urlParams;
|
||||
id parameter;
|
||||
id returnValue;
|
||||
|
||||
drafts = [self draftsFolder];
|
||||
if (![drafts isNotNull])
|
||||
return [self didNotFindDraftsError];
|
||||
if ([drafts isKindOfClass:[NSException class]])
|
||||
return drafts;
|
||||
if ([drafts isNotNull])
|
||||
{
|
||||
if ([drafts isKindOfClass: [NSException class]])
|
||||
returnValue = drafts;
|
||||
else
|
||||
{
|
||||
urlBase = [drafts newObjectBaseURLInContext: [self context]];
|
||||
if ([urlBase isNotNull])
|
||||
{
|
||||
urlParams = [NSMutableDictionary new];
|
||||
[urlParams autorelease];
|
||||
|
||||
/* attach mail-account info */
|
||||
parameter
|
||||
= [[self clientObject] valueForKey: @"mailAccountFolder"];
|
||||
if (parameter && ![parameter isExceptionOrNull])
|
||||
[urlParams setObject: [parameter nameInContainer]
|
||||
forKey: @"account"];
|
||||
|
||||
parameter = [[self request] formValueForKey: @"mailto"];
|
||||
if (parameter)
|
||||
[urlParams setObject: parameter
|
||||
forKey: @"mailto"];
|
||||
|
||||
url = [urlBase composeURLWithAction: @"edit"
|
||||
parameters: urlParams
|
||||
andHash: NO];
|
||||
|
||||
/* perform redirect */
|
||||
|
||||
[self debugWithFormat:@"compose on %@: %@", drafts, url];
|
||||
|
||||
url = [drafts newObjectBaseURLInContext:[self context]];
|
||||
if (![url isNotNull])
|
||||
return [self couldNotCreateDraftError:drafts];
|
||||
|
||||
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
|
||||
url = [url stringByAppendingString:@"edit"];
|
||||
|
||||
/* attach mail-account info */
|
||||
|
||||
accountFolder = [[self clientObject] valueForKey:@"mailAccountFolder"];
|
||||
if (![accountFolder isExceptionOrNull]) {
|
||||
url = [url stringByAppendingString:@"?account="];
|
||||
url = [url stringByAppendingString:[accountFolder nameInContainer]];
|
||||
}
|
||||
|
||||
/* perform redirect */
|
||||
|
||||
[self debugWithFormat:@"compose on %@: %@", drafts, url];
|
||||
|
||||
r = [[self context] response];
|
||||
[r setStatus:302 /* moved */];
|
||||
[r setHeader:url forKey:@"location"];
|
||||
[self reset];
|
||||
return r;
|
||||
r = [[self context] response];
|
||||
[r setStatus: 302 /* move d */];
|
||||
[r setHeader: url forKey: @"location"];
|
||||
[self reset];
|
||||
|
||||
returnValue = r;
|
||||
}
|
||||
else
|
||||
returnValue = [self couldNotCreateDraftError: drafts];
|
||||
}
|
||||
}
|
||||
else
|
||||
returnValue = [self didNotFindDraftsError];
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/* creating new draft object */
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
*/
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
#include "../Common/UIxPageFrame.h"
|
||||
|
||||
@interface UIxMailMainFrame : UIxComponent
|
||||
@interface UIxMailMainFrame : UIxPageFrame
|
||||
{
|
||||
NSString *title;
|
||||
NSString *rootURL;
|
||||
NSString *userRootURL;
|
||||
id item;
|
||||
struct {
|
||||
int hideFolderTree:1;
|
||||
int hideFrame:1; /* completely disables all the frame around the comp. */
|
||||
|
@ -61,8 +61,6 @@ static NSString *treeRootClassName = nil;
|
|||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self->item release];
|
||||
[self->title release];
|
||||
[self->rootURL release];
|
||||
[self->userRootURL release];
|
||||
[super dealloc];
|
||||
|
@ -88,23 +86,6 @@ static NSString *treeRootClassName = nil;
|
|||
return self->mmfFlags.hideFrame ? YES : NO;
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)_value {
|
||||
ASSIGNCOPY(self->title, _value);
|
||||
}
|
||||
- (NSString *)title {
|
||||
if ([self->title length] == 0)
|
||||
return @"OpenGroupware.org";
|
||||
|
||||
return self->title;
|
||||
}
|
||||
|
||||
- (void)setItem:(id)_item {
|
||||
ASSIGN(self->item, _item);
|
||||
}
|
||||
- (id)item {
|
||||
return self->item;
|
||||
}
|
||||
|
||||
- (NSString *)pageFormURL {
|
||||
NSString *u;
|
||||
NSRange r;
|
||||
|
@ -161,13 +142,6 @@ static NSString *treeRootClassName = nil;
|
|||
return nil;
|
||||
}
|
||||
|
||||
/* notifications */
|
||||
|
||||
- (void)sleep {
|
||||
[self->item release]; self->item = nil;
|
||||
[super sleep];
|
||||
}
|
||||
|
||||
/* URL generation */
|
||||
// TODO: I think all this should be done by the clientObject?!
|
||||
// TODO: is the stuff below necessary at all in the mailer frame?
|
||||
|
@ -236,24 +210,6 @@ static NSString *treeRootClassName = nil;
|
|||
@"</script>", errorText];
|
||||
}
|
||||
|
||||
/* URLs */
|
||||
|
||||
- (NSString *)relativeHomePath {
|
||||
return [self relativePathToUserFolderSubPath:@""];
|
||||
}
|
||||
|
||||
- (NSString *)relativeCalendarPath {
|
||||
return [self relativePathToUserFolderSubPath:@"Calendar/"];
|
||||
}
|
||||
|
||||
- (NSString *)relativeContactsPath {
|
||||
return [self relativePathToUserFolderSubPath:@"Contacts/"];
|
||||
}
|
||||
|
||||
- (NSString *)relativeMailPath {
|
||||
return [self relativePathToUserFolderSubPath:@"Mail/"];
|
||||
}
|
||||
|
||||
@end /* UIxMailMainFrame */
|
||||
|
||||
@implementation UIxMailPanelFrame
|
||||
|
|
|
@ -102,11 +102,20 @@ static NSArray *headers = nil;
|
|||
|
||||
/* accessors */
|
||||
|
||||
- (void)setTo:(NSArray *)_to {
|
||||
- (void)setTo:(NSArray *)_to
|
||||
{
|
||||
_to = [self properlySplitAddresses:_to];
|
||||
ASSIGNCOPY(self->to, _to);
|
||||
}
|
||||
- (NSArray *)to {
|
||||
|
||||
- (NSArray *) to
|
||||
{
|
||||
NSString *mailto;
|
||||
|
||||
mailto = [self queryParameterForKey:@"mailto"];
|
||||
if ([mailto length] > 0 && ![to count])
|
||||
to = [NSArray arrayWithObject: mailto];
|
||||
|
||||
return self->to;
|
||||
}
|
||||
|
||||
|
@ -114,6 +123,7 @@ static NSArray *headers = nil;
|
|||
_cc = [self properlySplitAddresses:_cc];
|
||||
ASSIGNCOPY(self->cc, _cc);
|
||||
}
|
||||
|
||||
- (NSArray *)cc {
|
||||
return self->cc;
|
||||
}
|
||||
|
|
|
@ -306,15 +306,15 @@
|
|||
methods = {
|
||||
view = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailListView";
|
||||
pageName = "UIxMailListView";
|
||||
};
|
||||
getMail = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxMailListView";
|
||||
pageName = "UIxMailListView";
|
||||
};
|
||||
compose = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailEditorAction";
|
||||
actionClass = "UIxMailEditorAction";
|
||||
actionName = "compose";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -17,13 +17,21 @@
|
|||
<var:string value="title"/>
|
||||
</title>
|
||||
|
||||
<meta name="templatename" content="UIXMailMainFrame.wox"/>
|
||||
<meta name="description" content="SOGo Web Interface"/>
|
||||
<meta name="author" content="SKYRIX Software AG"/>
|
||||
<meta name="robots" content="stop"/>
|
||||
|
||||
<script rsrc:src="generic.js"> <!-- space required --></script>
|
||||
<script rsrc:src="mailer.js" > <!-- space required --></script>
|
||||
|
||||
|
||||
<var:if condition="hasProductSpecificJavaScript">
|
||||
<script var:src="productJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
<var:if condition="hasPageSpecificJavaScript">
|
||||
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/>
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<var:string value="title"/>
|
||||
</title>
|
||||
|
||||
<meta name="templatename" content="UIXMailPanelFrame.wox"/>
|
||||
<meta name="description" content="SOGo Web Interface"/>
|
||||
<meta name="author" content="SKYRIX Software AG"/>
|
||||
<meta name="robots" content="stop"/>
|
||||
|
@ -27,6 +28,13 @@
|
|||
/>
|
||||
<script rsrc:src="generic.js"> <!-- space required --></script>
|
||||
<script rsrc:src="mailer.js" > <!-- space required --></script>
|
||||
|
||||
<var:if condition="hasProductSpecificJavaScript">
|
||||
<script var:src="productJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
<var:if condition="hasPageSpecificJavaScript">
|
||||
<script var:src="pageJavaScriptURL"> <!-- space required --></script>
|
||||
</var:if>
|
||||
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="uix.css" />
|
||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css" />
|
||||
|
@ -36,7 +44,7 @@
|
|||
<link href="mailto:info@skyrix.com" rev="made"/>
|
||||
</head>
|
||||
|
||||
<body style="background-color: #D4D0C8;">
|
||||
<body>
|
||||
<!--
|
||||
Note: the 'href' is required, otherwise an element-id will get created
|
||||
-->
|
||||
|
@ -101,14 +109,10 @@
|
|||
</var:if>
|
||||
|
||||
<var:component className="UIxToolbar" />
|
||||
|
||||
<table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr class="vertframerow">
|
||||
<td width="100%" valign="top" class="vertframerow" colspan="2">
|
||||
<var:component-content/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="pageContent">
|
||||
<var:component-content/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
|
||||
|
|
|
@ -9,6 +9,21 @@
|
|||
className="UIxMailPanelFrame"
|
||||
title="panelTitle"
|
||||
>
|
||||
|
||||
<div class="menu" id="addressMenu">
|
||||
<ul id="sourceList">
|
||||
<li id="add_to_addressbook"
|
||||
onmousedown="return false;"
|
||||
onclick="newContactFromEmail(this);"><var:string label:value="Add to Address Book..."/></li>
|
||||
<li id="compose_mailto"
|
||||
onmousedown="return false;"
|
||||
onclick="newEmailTo(this);"><var:string label:value="Compose Mail To"/></li>
|
||||
<li id="create_filter"
|
||||
onmousedown="return false;"
|
||||
onclick="onMenuEntryClick(this, event);"><var:string label:value="Create Filter From Message..."/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- TODO: refactor address rendering into an own component(/element) -->
|
||||
|
||||
<!-- TODO: can we create own clientObject's for Kolab entities? Probably
|
||||
|
@ -36,7 +51,7 @@
|
|||
<td class="mailer_fieldvalue">
|
||||
<var:foreach list="clientObject.fromEnvelopeAddresses"
|
||||
item="currentAddress">
|
||||
<a var:href="currentAddressLink">
|
||||
<a var:href="currentAddressLink" onclick="onMenuClick(this, event, 'addressMenu');" oncontextmenu="onMenuClick(this, event, 'addressMenu');" onmousedown="return false;">
|
||||
<var:string value="currentAddress"
|
||||
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
|
||||
</var:foreach>
|
||||
|
@ -59,7 +74,7 @@
|
|||
<td class="mailer_fieldvalue">
|
||||
<var:foreach list="clientObject.toEnvelopeAddresses"
|
||||
item="currentAddress">
|
||||
<a var:href="currentAddressLink">
|
||||
<a var:href="currentAddressLink" onclick="onMenuClick(this, event, 'addressMenu');" oncontextmenu="onMenuClick(this, event, 'addressMenu');" onmousedown="return false;">
|
||||
<var:string value="currentAddress"
|
||||
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
|
||||
</var:foreach>
|
||||
|
@ -71,7 +86,7 @@
|
|||
<td class="mailer_fieldvalue">
|
||||
<var:foreach list="clientObject.ccEnvelopeAddresses"
|
||||
item="currentAddress">
|
||||
<a var:href="currentAddressLink">
|
||||
<a var:href="currentAddressLink" onclick="onMenuClick(this, event, 'addressMenu');" oncontextmenu="onMenuClick(this, event, 'addressMenu');" onmousedown="return false;">
|
||||
<var:string value="currentAddress"
|
||||
formatter="context.mailEnvelopeFullAddressFormatter" /></a>
|
||||
<br /> <!-- TODO: better to use li+CSS -->
|
||||
|
|
Loading…
Reference in New Issue