Monotone-Parent: 4f6055656f29743c9da3d3dcce84f449939717bf

Monotone-Revision: 60ad639c204e75de92c1111a09d2ecfe2cbd655b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-07-11T17:53:09
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-07-11 17:53:09 +00:00
parent 77d9730062
commit fcd86bfa96
10 changed files with 147 additions and 97 deletions
+27
View File
@@ -1,5 +1,32 @@
2006-07-11 Wolfgang Sourdeau <wsourdeau@inverse.ca> 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]): * UI/Common/NSDictionary+URL.m ([NSDictionary -asURLParameters]):
returns a parameter string to add to a base URL. returns a parameter string to add to a base URL.
@@ -88,3 +88,8 @@
/* MailMoveToPopUp */ /* MailMoveToPopUp */
"MoveTo" = "Déplacer vers"; "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...";
+1
View File
@@ -45,6 +45,7 @@ MailerUI_OBJC_FILES += \
MailerUI_RESOURCE_FILES += \ MailerUI_RESOURCE_FILES += \
Version \ Version \
product.plist \ product.plist \
UIxMailView.js \
Toolbars/*.toolbar \ Toolbars/*.toolbar \
Images/*.png Images/*.png
+57 -33
View File
@@ -27,9 +27,12 @@
#include <SoObjects/Mailer/SOGoMailObject.h> #include <SoObjects/Mailer/SOGoMailObject.h>
#include "common.h" #include "common.h"
#import "../Common/NSString+URL.h"
@implementation UIxMailEditorAction @implementation UIxMailEditorAction
- (void)dealloc { - (void)dealloc
{
[self->newDraft release]; [self->newDraft release];
[super dealloc]; [super dealloc];
} }
@@ -74,42 +77,63 @@
/* compose */ /* compose */
- (id)composeAction { - (id) composeAction
{
SOGoDraftsFolder *drafts; SOGoDraftsFolder *drafts;
WOResponse *r; WOResponse *r;
NSString *url; NSString *urlBase, *url;
id accountFolder; NSMutableDictionary *urlParams;
id parameter;
id returnValue;
drafts = [self draftsFolder]; drafts = [self draftsFolder];
if (![drafts isNotNull]) if ([drafts isNotNull])
return [self didNotFindDraftsError]; {
if ([drafts isKindOfClass:[NSException class]]) if ([drafts isKindOfClass: [NSException class]])
return drafts; 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]]; r = [[self context] response];
if (![url isNotNull]) [r setStatus: 302 /* move d */];
return [self couldNotCreateDraftError:drafts]; [r setHeader: url forKey: @"location"];
[self reset];
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
url = [url stringByAppendingString:@"edit"]; returnValue = r;
}
/* attach mail-account info */ else
returnValue = [self couldNotCreateDraftError: drafts];
accountFolder = [[self clientObject] valueForKey:@"mailAccountFolder"]; }
if (![accountFolder isExceptionOrNull]) { }
url = [url stringByAppendingString:@"?account="]; else
url = [url stringByAppendingString:[accountFolder nameInContainer]]; returnValue = [self didNotFindDraftsError];
}
return returnValue;
/* 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;
} }
/* creating new draft object */ /* creating new draft object */
+2 -46
View File
@@ -20,13 +20,13 @@
*/ */
#include <SOGoUI/UIxComponent.h> #include <SOGoUI/UIxComponent.h>
#include "../Common/UIxPageFrame.h"
@interface UIxMailMainFrame : UIxComponent @interface UIxMailMainFrame : UIxPageFrame
{ {
NSString *title; NSString *title;
NSString *rootURL; NSString *rootURL;
NSString *userRootURL; NSString *userRootURL;
id item;
struct { struct {
int hideFolderTree:1; int hideFolderTree:1;
int hideFrame:1; /* completely disables all the frame around the comp. */ int hideFrame:1; /* completely disables all the frame around the comp. */
@@ -61,8 +61,6 @@ static NSString *treeRootClassName = nil;
} }
- (void)dealloc { - (void)dealloc {
[self->item release];
[self->title release];
[self->rootURL release]; [self->rootURL release];
[self->userRootURL release]; [self->userRootURL release];
[super dealloc]; [super dealloc];
@@ -88,23 +86,6 @@ static NSString *treeRootClassName = nil;
return self->mmfFlags.hideFrame ? YES : NO; 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 *)pageFormURL {
NSString *u; NSString *u;
NSRange r; NSRange r;
@@ -161,13 +142,6 @@ static NSString *treeRootClassName = nil;
return nil; return nil;
} }
/* notifications */
- (void)sleep {
[self->item release]; self->item = nil;
[super sleep];
}
/* URL generation */ /* URL generation */
// TODO: I think all this should be done by the clientObject?! // TODO: I think all this should be done by the clientObject?!
// TODO: is the stuff below necessary at all in the mailer frame? // TODO: is the stuff below necessary at all in the mailer frame?
@@ -236,24 +210,6 @@ static NSString *treeRootClassName = nil;
@"</script>", errorText]; @"</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 */ @end /* UIxMailMainFrame */
@implementation UIxMailPanelFrame @implementation UIxMailPanelFrame
+12 -2
View File
@@ -102,11 +102,20 @@ static NSArray *headers = nil;
/* accessors */ /* accessors */
- (void)setTo:(NSArray *)_to { - (void)setTo:(NSArray *)_to
{
_to = [self properlySplitAddresses:_to]; _to = [self properlySplitAddresses:_to];
ASSIGNCOPY(self->to, _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; return self->to;
} }
@@ -114,6 +123,7 @@ static NSArray *headers = nil;
_cc = [self properlySplitAddresses:_cc]; _cc = [self properlySplitAddresses:_cc];
ASSIGNCOPY(self->cc, _cc); ASSIGNCOPY(self->cc, _cc);
} }
- (NSArray *)cc { - (NSArray *)cc {
return self->cc; return self->cc;
} }
+3 -3
View File
@@ -306,15 +306,15 @@
methods = { methods = {
view = { view = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
}; };
getMail = { getMail = {
protectedBy = "View"; protectedBy = "View";
pageName = "UIxMailListView"; pageName = "UIxMailListView";
}; };
compose = { compose = {
protectedBy = "View"; protectedBy = "View";
actionClass = "UIxMailEditorAction"; actionClass = "UIxMailEditorAction";
actionName = "compose"; actionName = "compose";
}; };
}; };
+9 -1
View File
@@ -17,13 +17,21 @@
<var:string value="title"/> <var:string value="title"/>
</title> </title>
<meta name="templatename" content="UIXMailMainFrame.wox"/>
<meta name="description" content="SOGo Web Interface"/> <meta name="description" content="SOGo Web Interface"/>
<meta name="author" content="SKYRIX Software AG"/> <meta name="author" content="SKYRIX Software AG"/>
<meta name="robots" content="stop"/> <meta name="robots" content="stop"/>
<script rsrc:src="generic.js"> <!-- space required --></script> <script rsrc:src="generic.js"> <!-- space required --></script>
<script rsrc:src="mailer.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="uix.css"/>
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/> <link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/>
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/> <link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/>
+13 -9
View File
@@ -17,6 +17,7 @@
<var:string value="title"/> <var:string value="title"/>
</title> </title>
<meta name="templatename" content="UIXMailPanelFrame.wox"/>
<meta name="description" content="SOGo Web Interface"/> <meta name="description" content="SOGo Web Interface"/>
<meta name="author" content="SKYRIX Software AG"/> <meta name="author" content="SKYRIX Software AG"/>
<meta name="robots" content="stop"/> <meta name="robots" content="stop"/>
@@ -27,6 +28,13 @@
/> />
<script rsrc:src="generic.js"> <!-- space required --></script> <script rsrc:src="generic.js"> <!-- space required --></script>
<script rsrc:src="mailer.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="uix.css" />
<link type="text/css" rel="stylesheet" rsrc:href="mailer.css" /> <link type="text/css" rel="stylesheet" rsrc:href="mailer.css" />
@@ -36,7 +44,7 @@
<link href="mailto:info@skyrix.com" rev="made"/> <link href="mailto:info@skyrix.com" rev="made"/>
</head> </head>
<body style="background-color: #D4D0C8;"> <body>
<!-- <!--
Note: the 'href' is required, otherwise an element-id will get created Note: the 'href' is required, otherwise an element-id will get created
--> -->
@@ -101,14 +109,10 @@
</var:if> </var:if>
<var:component className="UIxToolbar" /> <var:component className="UIxToolbar" />
<table border="0" width="100%" cellspacing="0" cellpadding="2"> <div class="pageContent">
<tr class="vertframerow"> <var:component-content/>
<td width="100%" valign="top" class="vertframerow" colspan="2"> </div>
<var:component-content/>
</td>
</tr>
</table>
</form> </form>
<var:string value="errorAlertJavaScript" const:escapeHTML="NO" /> <var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
+18 -3
View File
@@ -9,6 +9,21 @@
className="UIxMailPanelFrame" className="UIxMailPanelFrame"
title="panelTitle" 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: refactor address rendering into an own component(/element) -->
<!-- TODO: can we create own clientObject's for Kolab entities? Probably <!-- TODO: can we create own clientObject's for Kolab entities? Probably
@@ -36,7 +51,7 @@
<td class="mailer_fieldvalue"> <td class="mailer_fieldvalue">
<var:foreach list="clientObject.fromEnvelopeAddresses" <var:foreach list="clientObject.fromEnvelopeAddresses"
item="currentAddress"> 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" <var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a> formatter="context.mailEnvelopeFullAddressFormatter" /></a>
</var:foreach> </var:foreach>
@@ -59,7 +74,7 @@
<td class="mailer_fieldvalue"> <td class="mailer_fieldvalue">
<var:foreach list="clientObject.toEnvelopeAddresses" <var:foreach list="clientObject.toEnvelopeAddresses"
item="currentAddress"> 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" <var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a> formatter="context.mailEnvelopeFullAddressFormatter" /></a>
</var:foreach> </var:foreach>
@@ -71,7 +86,7 @@
<td class="mailer_fieldvalue"> <td class="mailer_fieldvalue">
<var:foreach list="clientObject.ccEnvelopeAddresses" <var:foreach list="clientObject.ccEnvelopeAddresses"
item="currentAddress"> 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" <var:string value="currentAddress"
formatter="context.mailEnvelopeFullAddressFormatter" /></a> formatter="context.mailEnvelopeFullAddressFormatter" /></a>
<br /> <!-- TODO: better to use li+CSS --> <br /> <!-- TODO: better to use li+CSS -->