mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-18 13:13:31 +00:00
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:
@@ -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...";
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|
||||||
url = [drafts newObjectBaseURLInContext:[self context]];
|
/* attach mail-account info */
|
||||||
if (![url isNotNull])
|
parameter
|
||||||
return [self couldNotCreateDraftError:drafts];
|
= [[self clientObject] valueForKey: @"mailAccountFolder"];
|
||||||
|
if (parameter && ![parameter isExceptionOrNull])
|
||||||
|
[urlParams setObject: [parameter nameInContainer]
|
||||||
|
forKey: @"account"];
|
||||||
|
|
||||||
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
|
parameter = [[self request] formValueForKey: @"mailto"];
|
||||||
url = [url stringByAppendingString:@"edit"];
|
if (parameter)
|
||||||
|
[urlParams setObject: parameter
|
||||||
|
forKey: @"mailto"];
|
||||||
|
|
||||||
/* attach mail-account info */
|
url = [urlBase composeURLWithAction: @"edit"
|
||||||
|
parameters: urlParams
|
||||||
|
andHash: NO];
|
||||||
|
|
||||||
accountFolder = [[self clientObject] valueForKey:@"mailAccountFolder"];
|
/* perform redirect */
|
||||||
if (![accountFolder isExceptionOrNull]) {
|
|
||||||
url = [url stringByAppendingString:@"?account="];
|
|
||||||
url = [url stringByAppendingString:[accountFolder nameInContainer]];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* perform redirect */
|
[self debugWithFormat:@"compose on %@: %@", drafts, url];
|
||||||
|
|
||||||
[self debugWithFormat:@"compose on %@: %@", drafts, url];
|
r = [[self context] response];
|
||||||
|
[r setStatus: 302 /* move d */];
|
||||||
|
[r setHeader: url forKey: @"location"];
|
||||||
|
[self reset];
|
||||||
|
|
||||||
r = [[self context] response];
|
returnValue = r;
|
||||||
[r setStatus:302 /* moved */];
|
}
|
||||||
[r setHeader:url forKey:@"location"];
|
else
|
||||||
[self reset];
|
returnValue = [self couldNotCreateDraftError: drafts];
|
||||||
return r;
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
returnValue = [self didNotFindDraftsError];
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* creating new draft object */
|
/* creating new draft object */
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<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"/>
|
||||||
@@ -24,6 +25,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"/>
|
||||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/>
|
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css"/>
|
||||||
|
|||||||
@@ -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"/>
|
||||||
@@ -28,6 +29,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" />
|
||||||
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.css" />
|
<link type="text/css" rel="stylesheet" rsrc:href="mailer-toolbar.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
|
||||||
-->
|
-->
|
||||||
@@ -102,13 +110,9 @@
|
|||||||
|
|
||||||
<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" />
|
||||||
|
|||||||
@@ -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 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user