]> err.no Git - scalable-opengroupware.org/commitdiff
added some attach functionality
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 25 Oct 2004 23:04:35 +0000 (23:04 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 25 Oct 2004 23:04:35 +0000 (23:04 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@423 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SoObjects/Mailer/SOGoDraftObject.h
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/GNUmakefile
SOGo/UI/Mailer/UIxMailEditor.wox
SOGo/UI/Mailer/UIxMailEditorAttach.m [new file with mode: 0644]
SOGo/UI/Mailer/UIxMailEditorAttach.wox [new file with mode: 0644]
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/mailer.js
SOGo/UI/Mailer/product.plist

index 6e4cda410344011b2600394db4ca94c8159041ab..9107366ce0d7e8b6dbd197315c250a09d933d1f4 100644 (file)
@@ -47,6 +47,8 @@
 - (BOOL)storeInfo:(NSDictionary *)_info;
 
 - (NSArray *)fetchAttachmentNames;
+- (BOOL)isValidAttachmentName:(NSString *)_name;
+- (BOOL)saveAttachment:(NSData *)_attachment withName:(NSString *)_name;
 
 @end
 
index 75de65408958581b96f922451cc2d6853ec98908..121db387ad293b1eec709a34124976929e6c1426 100644 (file)
@@ -1,3 +1,8 @@
+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
index fe9ba40ced78f618353a450416e80e055eeb2ebe..35fce169ad8c32fdd7eb230acaf0aa0ccb73466b 100644 (file)
@@ -28,6 +28,7 @@ MailerUI_OBJC_FILES += \
        UIxMailSortableTableHeader.m    \
        \
        UIxMailEditor.m                 \
+       UIxMailEditorAttach.m           \
        UIxMailEditorAction.m           \
        UIxMailToSelection.m            \
        UIxMailAddressbook.m            \
@@ -54,6 +55,7 @@ MailerUI_RESOURCE_FILES += \
        UIxMailSortableTableHeader.wox  \
        \
        UIxMailEditor.wox               \
+       UIxMailEditorAttach.wox         \
        UIxMailToSelection.wox          \
        UIxMailAddressbook.wox          \
        \
index e23d3faf5d23ac4066ae8df02c0d629acbe2ba58..2c685d774a6548d65fc17d04e9287d7dee0a8b6b 100644 (file)
@@ -34,6 +34,7 @@
     <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" 
diff --git a/SOGo/UI/Mailer/UIxMailEditorAttach.m b/SOGo/UI/Mailer/UIxMailEditorAttach.m
new file mode 100644 (file)
index 0000000..5452584
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+  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 */
diff --git a/SOGo/UI/Mailer/UIxMailEditorAttach.wox b/SOGo/UI/Mailer/UIxMailEditorAttach.wox
new file mode 100644 (file)
index 0000000..fbb566d
--- /dev/null
@@ -0,0 +1,58 @@
+<?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>
index cd774cc61a29ee5b45392c598b63d772adc8f47b..1493e282d825f586287c9658e418c2fc4deb9840 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 
-SUBMINOR_VERSION:=45
+SUBMINOR_VERSION:=46
 
 # v0.9.43 requires NGObjWeb v4.3.73
 # v0.9.42 requires NGObjWeb v4.3.72
index 821b78e2f51676bfe9fa859d230474c1dfed610b..c88ffa33a1ea3b19a236ef01819ae201fb2a1308 100644 (file)
@@ -72,10 +72,15 @@ function clickedEditorSend(sender) {
 }
 
 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();
index ec3fe7cb5b1bcd2745d439ecc45bb4f7f8ffde23..fa2974752cc2a047cc72c3c42e56c3364c48bb58 100644 (file)
               { 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";