- (BOOL)storeInfo:(NSDictionary *)_info;
- (NSArray *)fetchAttachmentNames;
+- (BOOL)isValidAttachmentName:(NSString *)_name;
+- (BOOL)saveAttachment:(NSData *)_attachment withName:(NSString *)_name;
@end
+2004-10-26 Helge Hess <helge.hess@opengroupware.org>
+
+ * added new UIxMailEditorAttach component to manage draft attachments
+ (v0.9.46)
+
2004-10-25 Helge Hess <helge.hess@opengroupware.org>
* v0.9.45
UIxMailSortableTableHeader.m \
\
UIxMailEditor.m \
+ UIxMailEditorAttach.m \
UIxMailEditorAction.m \
UIxMailToSelection.m \
UIxMailAddressbook.m \
UIxMailSortableTableHeader.wox \
\
UIxMailEditor.wox \
+ UIxMailEditorAttach.wox \
UIxMailToSelection.wox \
UIxMailAddressbook.wox \
\
<table border="0" width="100%">
<tr>
<td class="compose_label" width="15%">
+ <!-- TODO: localize -->
<a rsrc:href="tbird_073_compose.png">Subject:</a>
</td>
<td width="85%"><input name="subject"
--- /dev/null
+/*
+ Copyright (C) 2004 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+// $Id$
+
+#include <SOGoUI/UIxComponent.h>
+
+/*
+ UIxMailEditorAction
+
+ An mail editor component which works on SOGoDraftObject's. This component
+ manages the attachments of a draft object.
+*/
+
+@class NSArray, NSString, NSData;
+
+@interface UIxMailEditorAttach : UIxComponent
+{
+ NSString *filePath1;
+ NSString *filePath2;
+ NSString *filePath3;
+ NSData *fileData1;
+ NSData *fileData2;
+ NSData *fileData3;
+}
+
+@end
+
+#include <SOGo/SoObjects/Mailer/SOGoDraftObject.h>
+#include "common.h"
+
+@implementation UIxMailEditorAttach
+
+- (void)dealloc {
+ [self->filePath1 release];
+ [self->filePath2 release];
+ [self->filePath3 release];
+ [self->fileData1 release];
+ [self->fileData2 release];
+ [self->fileData3 release];
+ [super dealloc];
+}
+
+/* accessors */
+
+- (void)setFilePath1:(NSString *)_value {
+ ASSIGNCOPY(self->filePath1, _value);
+}
+- (NSString *)filePath1 {
+ return self->filePath1;
+}
+
+- (void)setFilePath2:(NSString *)_value {
+ ASSIGNCOPY(self->filePath2, _value);
+}
+- (NSString *)filePath2 {
+ return self->filePath2;
+}
+
+- (void)setFilePath3:(NSString *)_value {
+ ASSIGNCOPY(self->filePath3, _value);
+}
+- (NSString *)filePath3 {
+ return self->filePath3;
+}
+
+- (void)setFileData1:(NSData *)_data {
+ ASSIGN(self->fileData1, _data);
+}
+- (NSData *)fileData1 {
+ return self->fileData1;
+}
+
+- (void)setFileData2:(NSData *)_data {
+ ASSIGN(self->fileData2, _data);
+}
+- (NSData *)fileData2 {
+ return self->fileData2;
+}
+
+- (void)setFileData3:(NSData *)_data {
+ ASSIGN(self->fileData3, _data);
+}
+- (NSData *)fileData3 {
+ return self->fileData3;
+}
+
+/* requests */
+
+- (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{
+ return YES;
+}
+
+/* operations */
+
+- (BOOL)saveFileData:(NSData *)_data name:(NSString *)_name {
+ [self logWithFormat:@"TODO: save attachment %@, length %d",
+ _name, [_data length]];
+ return NO;
+}
+
+/* actions */
+
+- (id)viewAttachmentsAction {
+ [self logWithFormat:@"view attachments ..."];
+ return self;
+}
+
+- (id)attachAction {
+ [self logWithFormat:@"should save ..."];
+
+ // TODO: error handling!
+
+ if ([self->fileData1 length] > 0)
+ [self saveFileData:self->fileData1 name:[self filePath1]];
+ if ([self->fileData2 length] > 0)
+ [self saveFileData:self->fileData2 name:[self filePath2]];
+ if ([self->fileData3 length] > 0)
+ [self saveFileData:self->fileData3 name:[self filePath3]];
+
+ return self;
+}
+
+@end /* UIxMailEditorAttach */
--- /dev/null
+<?xml version='1.0' standalone='yes'?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label"
+>
+ <head>
+ <title>Attach ...</title>
+
+ <meta name="description" content="SOGo Web Interface"/>
+ <meta name="author" content="SKYRIX Software AG"/>
+ <meta name="robots" content="stop"/>
+
+ <link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
+ <link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/>
+ <link href="mailto:info@skyrix.com" rev="made"/>
+ </head>
+
+ <body style="background-color: #D4D0C8;">
+ <form name="pageform" href="attach" sidInUrl="NO"
+ method="POST"
+ enctype="multipart/form-data">
+ <h4>Attach</h4>
+ <table border="0" width="98%">
+ <tr>
+ <td><input type="file" name="file1"
+ var:filePath="filePath1"
+ var:data="fileData1" /></td>
+ </tr>
+ <tr>
+ <td><input type="file" name="file2"
+ var:filePath="filePath2"
+ var:data="fileData2" /></td>
+ </tr>
+ <tr>
+ <td><input type="file" name="file3"
+ var:filePath="filePath3"
+ var:data="fileData3" /></td>
+ </tr>
+ </table>
+
+ <input type="submit" name="submit" value="attach" />
+ <br />
+
+ <h4>Attachments</h4>
+
+ <div style="border-top-color: white; border-top-width: 1; border-top-style: solid;"> </div>
+ <table border="0" width="98%">
+ <var:foreach list="clientObject.fetchAttachmentNames" item="item">
+ <tr>
+ <td><var:string value="item" /></td>
+ </tr>
+ </var:foreach>
+ </table>
+ </form>
+ </body>
+</html>
# $Id$
-SUBMINOR_VERSION:=45
+SUBMINOR_VERSION:=46
# v0.9.43 requires NGObjWeb v4.3.73
# v0.9.42 requires NGObjWeb v4.3.72
}
function clickedEditorAttach(sender) {
- document.pageform.action="save";
- document.pageform.submit();
- return true;
+ var urlstr;
+
+ urlstr = "viewAttachments";
+ window.open(urlstr, "SOGo_attach",
+ "width=320,height=320,resizable=1,scrollbars=1,toolbar=0," +
+ "location=0,directories=0,status=0,menubar=0,copyhistory=0");
+ return false; /* stop following the link */
}
+
function clickedEditorSave(sender) {
document.pageform.action="save";
document.pageform.submit();
{ link = "#"; target = "anais";
onclick = "openAnais(this);return false;";
cssClass = "tbicon_addressbook"; label = "Anais"; },
- { link = "#";
- onclick = "clickedEditorAttach(this);return false;";
+ { link = "#";
+ onclick = "clickedEditorAttach(this)";
cssClass = "tbicon_attach"; label = "Attach"; },
{ link = "#";
onclick = "clickedEditorSave(this);return false;";
pageName = "UIxMailEditor";
actionName = "save";
};
+ viewAttachments = {
+ protectedBy = "View";
+ pageName = "UIxMailEditorAttach";
+ actionName = "viewAttachments";
+ };
+ attach = {
+ protectedBy = "View";
+ pageName = "UIxMailEditorAttach";
+ actionName = "attach";
+ };
send = {
protectedBy = "View";
pageName = "UIxMailEditor";