]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1214 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 1 Nov 2007 20:23:45 +0000 (20:23 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 1 Nov 2007 20:23:45 +0000 (20:23 +0000)
14 files changed:
ChangeLog
SoObjects/Mailer/GNUmakefile
SoObjects/Mailer/SOGoDraftObject.m
SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html [new file with mode: 0644]
SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod [new file with mode: 0644]
SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html [new file with mode: 0644]
SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod [new file with mode: 0644]
SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html [new file with mode: 0644]
SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod [new file with mode: 0644]
SoObjects/Mailer/SOGoMailObject+Draft.m
SoObjects/Mailer/SOGoMailReply.h [new file with mode: 0644]
SoObjects/Mailer/SOGoMailReply.m [new file with mode: 0644]
UI/MailerUI/UIxMailListView.m
UI/WebServerResources/generic.css

index 2278ba7c161f54b8e76dfa4f90e528b68c0a1ca7..d3aeb5bc18a6933e4e70dec28635e15faf3595e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2007-11-01  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
+       * SoObjects/Mailer/SOGoMailObject+Draft.m ([SOGoMailObject
+       -contentForReply]): make use of the SOGoMailReply WO page.
+
+       * SoObjects/Mailer/SOGoMailReply.[hm]: new class module copied
+       from SOGoMailForward to handle mail replies instead. Only three
+       methods remaining: date, from and messageBody. The latter is
+       quoted properly.
+
+       * SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject
+       -fetchMailForForwarding:sourceMail]): fetch attachments for
+       forwarded messages.
+
+       * UI/MailerUI/UIxMailListView.m ([UIxMailListView
+       -hasMessageAttachment]): initialize hasAttachment with "NO" to
+       avoid false positives.
+
        * OGoContentStore/OCSiCalFieldExtractor.m ([OCSiCalFieldExtractor -extractQuickFieldsFromEvent:_event])
        ([OCSiCalFieldExtractor -extractQuickFieldsFromTodo:_task]):
        set title to an empty string where the event/task summary is null.
index 82e9dfb1f9c846dcb048175a20e048fa061e4721..6be6f8a4f72925246341982b5d6a842328f69c9f 100644 (file)
@@ -31,6 +31,7 @@ Mailer_OBJC_FILES += \
        SOGoVCardMailBodyPart.m         \
        \
        SOGoMailForward.m               \
+       SOGoMailReply.m                 \
        \
        NSData+Mail.m                   \
        NSString+Mail.m
@@ -42,7 +43,10 @@ Mailer_RESOURCE_FILES += \
 Mailer_RESOURCE_FILES += \
        SOGoMailEnglishForward.wo \
        SOGoMailFrenchForward.wo \
-       SOGoMailGermanForward.wo
+       SOGoMailGermanForward.wo \
+       SOGoMailEnglishReply.wo \
+       SOGoMailFrenchReply.wo \
+       SOGoMailGermanReply.wo
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/sope-gdl1/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/sope-gdl1/GDLContentStore/obj/
index 77a1f58c4b00423b75c6da55218b03c31de6e5a7..34ee165c0d8829257e93b054dc6bf8b9228bfef7 100644 (file)
@@ -187,7 +187,7 @@ static BOOL        showTextAttachmentsInline  = NO;
       if (headerValue)
        [headers setObject: headerValue
                 forKey: headerKeys[count]];
-      else
+      else if ([headers objectForKey: headerKeys[count]])
        [headers removeObjectForKey: headerKeys[count]];
     }
 
@@ -569,7 +569,11 @@ static BOOL        showTextAttachmentsInline  = NO;
   /* attach message */
   currentUser = [context activeUser];
   if ([[currentUser messageForwarding] isEqualToString: @"inline"])
-    [self setText: [sourceMail contentForInlineForward]];
+    {
+      [self setText: [sourceMail contentForInlineForward]];
+      [self _fetchAttachments: [sourceMail fetchFileAttachmentKeys]
+           fromMail: sourceMail];
+    }
   else
     {
   // TODO: use subject for filename?
diff --git a/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html b/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html
new file mode 100644 (file)
index 0000000..e0274ea
--- /dev/null
@@ -0,0 +1,3 @@
+On <#date/>, <#from/> wrote:
+
+<#messageBody/>
diff --git a/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod b/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod
new file mode 100644 (file)
index 0000000..830cd7a
--- /dev/null
@@ -0,0 +1,14 @@
+date: WOString {
+  value = date;
+  escapeHTML = NO;
+}
+
+from: WOString {
+  value = from;
+  escapeHTML = NO;
+}
+
+messageBody: WOString {
+  value = messageBody;
+  escapeHTML = NO;
+}
diff --git a/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html b/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html
new file mode 100644 (file)
index 0000000..406f945
--- /dev/null
@@ -0,0 +1,3 @@
+Le <#date/>, <#from/> a écrit:
+
+<#messageBody/>
diff --git a/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod b/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod
new file mode 100644 (file)
index 0000000..830cd7a
--- /dev/null
@@ -0,0 +1,14 @@
+date: WOString {
+  value = date;
+  escapeHTML = NO;
+}
+
+from: WOString {
+  value = from;
+  escapeHTML = NO;
+}
+
+messageBody: WOString {
+  value = messageBody;
+  escapeHTML = NO;
+}
diff --git a/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html b/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html
new file mode 100644 (file)
index 0000000..e0274ea
--- /dev/null
@@ -0,0 +1,3 @@
+On <#date/>, <#from/> wrote:
+
+<#messageBody/>
diff --git a/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod b/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod
new file mode 100644 (file)
index 0000000..830cd7a
--- /dev/null
@@ -0,0 +1,14 @@
+date: WOString {
+  value = date;
+  escapeHTML = NO;
+}
+
+from: WOString {
+  value = from;
+  escapeHTML = NO;
+}
+
+messageBody: WOString {
+  value = messageBody;
+  escapeHTML = NO;
+}
index 66ffa44476013aecf456810318655a9aa925bda2..0ce4da0d9e43b3da26956a49dd339037f06bda3c 100644 (file)
@@ -33,6 +33,7 @@
 #import "NSString+Mail.h"
 #import "SOGoMailForward.h"
 #import "SOGoMailObject+Draft.h"
+#import "SOGoMailReply.h"
 
 #define maxFilenameLength 64
 
 
 - (NSString *) contentForReply
 {
-  return [[self contentForEditing] stringByApplyingMailQuoting];
+  SOGoUser *currentUser;
+  NSString *pageName;
+  SOGoMailReply *page;
+
+  currentUser = [context activeUser];
+  pageName = [NSString stringWithFormat: @"SOGoMail%@Reply",
+                      [currentUser language]];
+  page = [[WOApplication application] pageWithName: pageName
+                                     inContext: context];
+  [page setRepliedMail: self];
+
+  return [[page generateResponse] contentAsString];
 }
 
 - (NSString *) filenameForForward
diff --git a/SoObjects/Mailer/SOGoMailReply.h b/SoObjects/Mailer/SOGoMailReply.h
new file mode 100644 (file)
index 0000000..8f13fca
--- /dev/null
@@ -0,0 +1,50 @@
+/* SOGoMailReply.h - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef SOGOMAILREPLY_H
+#define SOGOMAILREPLY_H
+
+#import <NGObjWeb/SoComponent.h>
+
+@class SOGoMailObject;
+
+@interface SOGoMailReply : SoComponent
+{
+  SOGoMailObject *sourceMail;
+  NSString *field;
+  NSString *currentValue;
+}
+
+- (void) setRepliedMail: (SOGoMailObject *) newSourceMail;
+
+@end
+
+@interface SOGoMailEnglishReply : SOGoMailReply
+@end
+
+@interface SOGoMailFrenchReply : SOGoMailReply
+@end
+
+@interface SOGoMailGermanReply : SOGoMailReply
+@end
+
+#endif /* SOGOMAILREPLY_H */
diff --git a/SoObjects/Mailer/SOGoMailReply.m b/SoObjects/Mailer/SOGoMailReply.m
new file mode 100644 (file)
index 0000000..d2e939d
--- /dev/null
@@ -0,0 +1,84 @@
+/* SOGoMailReply.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <NGObjWeb/WOContext+SoObjects.h>
+
+#import <SoObjects/SOGo/SOGoDateFormatter.h>
+#import <SoObjects/SOGo/SOGoUser.h>
+
+#import "SOGoMailObject+Draft.h"
+#import "SOGoMailReply.h"
+
+@implementation SOGoMailReply
+
+- (id) init
+{
+  if ((self = [super init]))
+    {
+      sourceMail = nil;
+      currentValue = nil;
+    }
+
+  return self;
+}
+
+- (void) dealloc
+{
+  [sourceMail release];
+  [currentValue release];
+  [super dealloc];
+}
+
+- (void) setRepliedMail: (SOGoMailObject *) newSourceMail
+{
+  ASSIGN (sourceMail, newSourceMail);
+}
+
+- (NSString *) date
+{
+  SOGoDateFormatter *formatter;
+
+  formatter = [[context activeUser] dateFormatterInContext: context];
+
+  return [formatter formattedDateAndTime: [sourceMail date]];
+}
+
+- (NSString *) from
+{
+  return [[sourceMail mailHeaders] objectForKey: @"from"];
+}
+
+- (NSString *) messageBody
+{
+  return [[sourceMail contentForEditing] stringByApplyingMailQuoting];
+}
+
+@end
+
+@implementation SOGoMailEnglishReply
+@end
+
+@implementation SOGoMailFrenchReply
+@end
+
+@implementation SOGoMailGermanReply
+@end
index 6f7767d4cee13f863fe6c353ccc5b08e3d497df6..2ccc79b262ebaba7550ed534d0a966b79689b5b3 100644 (file)
   NSDictionary *currentDisp;
   BOOL hasAttachment;
 
+  hasAttachment = NO;
+
   parts = [[message objectForKey: @"body"] objectForKey: @"parts"];
   if ([parts count] > 1)
     {
        hasAttachment = ([[currentDisp objectForKey: @"type"]
                           isEqualToString: @"ATTACHMENT"]);
     }
-  else
-    hasAttachment = NO;
 
   return hasAttachment;
 }
index e3712550e3aebf448a7eb0fd6ef874c2519c40af..39dc38ddb0548e2dadd57630395f5a89b12f7581 100644 (file)
@@ -281,6 +281,7 @@ SPAN.toolbarButton:active
 { visibility: hidden;
   position: absolute;
   z-index: 1000;
+  top: -1000px;
   background-color: #d6cfc6;
   color: #000;
   margin: 0px;