]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1307 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 17 Dec 2007 20:50:34 +0000 (20:50 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 17 Dec 2007 20:50:34 +0000 (20:50 +0000)
12 files changed:
ChangeLog
SOPE/sope-patchset-r1557.diff
SoObjects/Mailer/SOGoDraftObject.m
SoObjects/Mailer/SOGoMailBodyPart.h
SoObjects/Mailer/SOGoMailBodyPart.m
UI/MailPartViewers/UIxMailPartImageViewer.m
UI/MailPartViewers/UIxMailPartViewer.h
UI/MailPartViewers/UIxMailPartViewer.m
UI/MailerUI/UIxMailEditor.m
UI/Scheduler/UIxCalListingActions.m
UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox
UI/Templates/MailerUI/UIxMailEditor.wox

index 3d5fba87c2c287ae630983797f65a53f41b0bc46..2e2565e9337ec97b1c9ee28a53304e957015afe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,40 @@
-2007-12-17  Francis Lachapelle  <flachapelle@inverse.ca>
+2007-12-17  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
-       * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame
-       -composeAction]): fixed URL when no recipient is specified.
+       * UI/MailerUI/UIxMailEditor.m ([UIxMailEditor -attachmentNames]):
+       initialize "attachmentNames" if it was NOT initialized... I think
+       this was a typo.
 
-2007-12-17  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+       * SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject
+       -fetchMailForForwarding:sourceMail]): append the signature to
+       mails forwarded as attachment.
+
+       * UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer
+       -clientPart]): new method that returns the corresponding
+       SOGoMailPart instance.
+       ([UIxMailPartViewer -pathToAttachment]): simplified method, ensure
+       the filename is present. If the part has none, create one with the
+       "Untitled-" prefix. Add an extension if none is found.
+
+       * UI/MailPartViewers/UIxMailPartImageViewer.m
+       ([UIxMailPartImageViewer -pathToImage]): removed method since it
+       implementents exactly the same functionality as
+       [UIxMailPartViewer -pathToAttachment].
+
+       * SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
+       -filename]): new method that returns the filename to the current
+       part by taking the different mime implementations into account.
+       [SOGoMailBodyPart -isBodyPartKey:inContext:]: commented out method
+       because we need to handle the part recognition in a different way,
+       by using the prefix "part" for example. One day we will do that.
 
        * UI/Scheduler/NSArray+Scheduler.m ([NSMutableArray
        -reverseArray]): new category method.
 
+2007-12-17  Francis Lachapelle  <flachapelle@inverse.ca>
+
+       * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame
+       -composeAction]): fixed URL when no recipient is specified.
+
 2007-12-14  Ludovic Marcotte <ludovic@inverse.ca>
 
        * SoObjects/Appointments/SOGoCalendarComponent.m
index 85c2064b1b942bd4a86b77aee988b1fbbd80a49c..126d44d38c2a14efba635becf7bf35691b2503a1 100644 (file)
@@ -1,47 +1,3 @@
-Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
-===================================================================
---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1557)
-+++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail)
-@@ -713,6 +713,39 @@
-   return ms;
- }
-+/* GCSEOAdaptorChannel protocol */
-+static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n"    \
-+                                  @"  c_name VARCHAR (256) NOT NULL,\n"
-+                                  @"  c_content VARCHAR (100000) NOT NULL,\n"
-+                                  @"  c_creationdate INT4 NOT NULL,\n"
-+                                  @"  c_lastmodified INT4 NOT NULL,\n"
-+                                  @"  c_version INT4 NOT NULL,\n"
-+                                  @"  c_deleted INT4 NULL\n"
-+                                  @")");
-+static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \
-+                                     @"  c_uid VARCHAR (256) NOT NULL,\n"
-+                                     @"  c_object VARCHAR (256) NOT NULL,\n"
-+                                     @"  c_role VARCHAR (80) NOT NULL\n"
-+                                     @")");
-+
-+- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
-+{
-+  NSString *sql;
-+
-+  sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
-+
-+  return [self evaluateExpressionX: sql];
-+}
-+
-+- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
-+{
-+  NSString *sql;
-+
-+  sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
-+
-+  return [self evaluateExpressionX: sql];
-+}
-+
- @end /* PostgreSQL72Channel */
- @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
 Index: sope-mime/NGImap4/NGImap4Connection.m
 ===================================================================
 --- sope-mime/NGImap4/NGImap4Connection.m      (révision 1557)
@@ -153,7 +109,14 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
    return address;
  }
  
-@@ -1627,6 +1650,29 @@
+@@ -1620,13 +1643,35 @@
+   return str;
+ }
+-
+ static NSString *_parseBodyString(NGImap4ResponseParser *self,
+                                   BOOL _convertString)
+ {
    return _parseBodyDecodeString(self, _convertString, NO /* no decode */);
  }
  
@@ -183,7 +146,16 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
  static NSDictionary *_parseBodyParameterList(NGImap4ResponseParser *self)
  {
    NSMutableDictionary *list;
-@@ -1734,10 +1780,11 @@
+@@ -1646,7 +1691,7 @@
+       _consumeIfMatch(self, ' ');
+       value = _parseBodyDecodeString(self, YES, YES);
+-      [list setObject:value forKey:[key lowercaseString]];
++      if (value) [list setObject:value forKey:[key lowercaseString]];
+     }
+     _consumeIfMatch(self, ')');
+   }
+@@ -1734,10 +1779,11 @@
                      *encoding, *bodysize;
    NSDictionary        *parameterList;
    NSMutableDictionary *dict;
@@ -196,7 +168,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
    _consumeIfMatch(self, ' ');
    parameterList = _parseBodyParameterList(self);
    _consumeIfMatch(self, ' ');
-@@ -1762,7 +1809,8 @@
+@@ -1762,7 +1808,8 @@
      _consumeIfMatch(self, ' ');
      [dict setObject:_parseBodyString(self, YES) forKey:@"lines"];
    }
@@ -206,7 +178,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
      if (_la(self, 0) != ')') {
        _consumeIfMatch(self, ' ');
        _consumeIfMatch(self, '(');
-@@ -1805,14 +1853,9 @@
+@@ -1805,14 +1852,9 @@
              forKey: @"disposition"];
        if (_la(self, 0) != ')') {
          _consume(self,1);
@@ -224,7 +196,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
          if (_la(self, 0) != ')') {
            _consume(self,1);
            [dict setObject: _parseBodyString(self, YES)
-@@ -1829,6 +1872,7 @@
+@@ -1829,6 +1871,7 @@
  static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self,
                                         BOOL isBodyStructure) {
    NSMutableArray *parts;
@@ -232,7 +204,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
    NSString       *kind;
    NSMutableDictionary *dict;
  
-@@ -1854,14 +1898,9 @@
+@@ -1854,14 +1897,9 @@
              forKey: @"disposition"];
        if (_la(self, 0) != ')') {
          _consume(self,1);
@@ -250,7 +222,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
          if (_la(self, 0) != ')') {
            _consume(self,1);
            [dict setObject: _parseBodyString(self, YES)
-@@ -2170,6 +2209,21 @@
+@@ -2170,6 +2208,21 @@
    }
  }
  
@@ -1155,6 +1127,50 @@ Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m
    }
    return data;
  }
+Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
+===================================================================
+--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1557)
++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail)
+@@ -713,6 +713,39 @@
+   return ms;
+ }
++/* GCSEOAdaptorChannel protocol */
++static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n"    \
++                                  @"  c_name VARCHAR (256) NOT NULL,\n"
++                                  @"  c_content VARCHAR (100000) NOT NULL,\n"
++                                  @"  c_creationdate INT4 NOT NULL,\n"
++                                  @"  c_lastmodified INT4 NOT NULL,\n"
++                                  @"  c_version INT4 NOT NULL,\n"
++                                  @"  c_deleted INT4 NULL\n"
++                                  @")");
++static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \
++                                     @"  c_uid VARCHAR (256) NOT NULL,\n"
++                                     @"  c_object VARCHAR (256) NOT NULL,\n"
++                                     @"  c_role VARCHAR (80) NOT NULL\n"
++                                     @")");
++
++- (NSException *) createGCSFolderTableWithName: (NSString *) tableName
++{
++  NSString *sql;
++
++  sql = [NSString stringWithFormat: sqlFolderFormat, tableName];
++
++  return [self evaluateExpressionX: sql];
++}
++
++- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName
++{
++  NSString *sql;
++
++  sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName];
++
++  return [self evaluateExpressionX: sql];
++}
++
+ @end /* PostgreSQL72Channel */
+ @implementation PostgreSQL72Channel(PrimaryKeyGeneration)
 Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m
 ===================================================================
 --- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m   (révision 1557)
@@ -1515,6 +1531,27 @@ Index: sope-appserver/NGObjWeb/WOContext.m
    if ((serverURL = [rq headerForKey:@"x-webobjects-server-url"]) == nil) {
      if ((host = [rq headerForKey:@"host"]))
        serverURL = [@"http://" stringByAppendingString:host];
+Index: sope-appserver/NGObjWeb/DAVPropMap.plist
+===================================================================
+--- sope-appserver/NGObjWeb/DAVPropMap.plist   (révision 1557)
++++ sope-appserver/NGObjWeb/DAVPropMap.plist   (copie de travail)
+@@ -123,11 +123,14 @@
+   /* CalDAV */
+   "{urn:ietf:params:xml:ns:caldav}calendar-home-set" = davCalendarHomeSet;
++  "{urn:ietf:params:xml:ns:caldav}calendar-user-address-set" = davCalendarUserAddressSet;
++  "{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL" = davCalendarScheduleInboxURL;
++  "{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL" = davCalendarScheduleOutboxURL;
+   /* Apple CalServer */
+-  "{http://apple.com/ns/calendarserver/}dropbox-home-URL" =
++  "{http://calendarserver.org/ns/}dropbox-home-URL" =
+     davDropboxHomeURL;
+-  "{http://apple.com/ns/calendarserver/}notifications-URL" =
++  "{http://calendarserver.org/ns/}notifications-URL" =
+     davNotificationsURL;
+   "{com.apple.ical:}calendarcolor" = davCalendarColor;
+ }
 Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m
 ===================================================================
 --- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m  (révision 1557)
index 8a9215627f1d5453334b1adb545d68022550ba45..2e210e011a4115b8dd41f6e9ab13983e96213255 100644 (file)
@@ -634,6 +634,7 @@ static BOOL        showTextAttachmentsInline  = NO;
 {
   NSDictionary *info, *attachment;
   SOGoUser *currentUser;
+  NSString *signature;
 
   [sourceMail fetchCoreInfos];
   
@@ -659,6 +660,9 @@ static BOOL        showTextAttachmentsInline  = NO;
     {
   // TODO: use subject for filename?
 //   error = [newDraft saveAttachment:content withName:@"forward.mail"];
+      signature = [currentUser signature];
+      if ([signature length])
+       [self setText: [NSString stringWithFormat: @"\n-- \n%@", signature]];
       attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                                   [sourceMail filenameForForward], @"filename",
                                 @"message/rfc822", @"mimetype",
@@ -666,6 +670,7 @@ static BOOL        showTextAttachmentsInline  = NO;
       [self saveAttachment: [sourceMail content]
            withMetadata: attachment];
     }
+
   [self storeInfo];
 }
 
index 4234074d0ee0e251c10c273cc88bcf43d45540dd..76cc84dbadfdc9ed4ca34a0d6d9ee8af3f01cc3b 100644 (file)
@@ -53,6 +53,7 @@
 - (NSString *) bodyPartName;
 - (NSArray *) bodyPartPath;
 - (NSString *) bodyPartIdentifier;
+- (NSString *) filename;
 
 /* part info */
 
index 6fac084d8f9db02d3d6d609029ee8a5a30b8ebb3..970abbb8d7e53e26806c3f8cc529ce11c2bdd34d 100644 (file)
@@ -73,9 +73,9 @@ static BOOL debugOn = NO;
 
 - (void) dealloc
 {
-  [self->partInfo   release];
-  [self->identifier release];
-  [self->pathToPart release];
+  [partInfo   release];
+  [identifier release];
+  [pathToPart release];
   [super dealloc];
 }
 
@@ -108,8 +108,8 @@ static BOOL debugOn = NO;
   NSMutableArray *p;
   id obj;
   
-  if (self->pathToPart != nil)
-    return [self->pathToPart isNotNull] ? self->pathToPart : nil;
+  if (pathToPart != nil)
+    return [pathToPart isNotNull] ? pathToPart : nil;
   
   p = [[NSMutableArray alloc] initWithCapacity:8];
   for (obj = self; [obj isKindOfClass:[SOGoMailBodyPart class]]; 
@@ -117,18 +117,18 @@ static BOOL debugOn = NO;
     [p insertObject:[obj bodyPartName] atIndex:0];
   }
   
-  self->pathToPart = [p copy];
+  pathToPart = [p copy];
   [p release];
-  return self->pathToPart;
+  return pathToPart;
 }
 
 - (NSString *)bodyPartIdentifier {
-  if (self->identifier != nil)
-    return [self->identifier isNotNull] ? self->identifier : nil;
+  if (identifier != nil)
+    return [identifier isNotNull] ? identifier : nil;
   
-  self->identifier =
+  identifier =
     [[[self bodyPartPath] componentsJoinedByString:@"."] copy];
-  return self->identifier;
+  return identifier;
 }
 
 - (NSURL *)imap4URL {
@@ -139,12 +139,12 @@ static BOOL debugOn = NO;
 /* part info */
 
 - (id)partInfo {
-  if (self->partInfo != nil)
-    return [self->partInfo isNotNull] ? self->partInfo : nil;
+  if (partInfo != nil)
+    return [partInfo isNotNull] ? partInfo : nil;
 
-  self->partInfo =
+  partInfo =
     [[[self mailObject] lookupInfoForBodyPart:[self bodyPartPath]] retain];
-  return self->partInfo;
+  return partInfo;
 }
 
 /* name lookup */
@@ -160,25 +160,40 @@ static BOOL debugOn = NO;
   return [clazz objectWithName: _key inContainer: self];
 }
 
+- (NSString *) filename
+{
+  NSString *filename;
+  NSDictionary *parameters;
+
+  [self partInfo];
+
+  filename = [[partInfo objectForKey: @"parameterList"]
+              objectForKey: @"name"];
+  if (!filename)
+    {
+      parameters = [[partInfo objectForKey: @"disposition"]
+                    objectForKey: @"parameterList"];
+      filename = [parameters objectForKey: @"filename"];
+    }
+
+  return filename;
+}
+
 /* We overwrite the super's class method in order to make sure
    we aren't dealing with our actual filename as the _key. That
    could lead to problems if we weren't doing this as our filename
    could start with a digit, leading to a wrong assumption in
    the super class
 */
-- (BOOL)isBodyPartKey:(NSString *)_key inContext:(id)_ctx
-{
-  NSString *s;
-  
-  s = [[[self partInfo] objectForKey: @"parameterList"] objectForKey: @"name"];
+// - (BOOL)isBodyPartKey:(NSString *)_key inContext:(id)_ctx
+// {
+//   NSString *s;
 
-  if (!s)
-    s = [[[[self partInfo] objectForKey: @"disposition"] objectForKey: @"parameterList"] objectForKey: @"filename"];
-  
-  if (s && [s isEqualToString: _key]) return NO;
+//   s = [self filename];
+//   if (s && [s isEqualToString: _key]) return NO;
 
-  return [super isBodyPartKey: _key  inContext: _ctx];
-}
+//   return [super isBodyPartKey: _key  inContext: _ctx];
+// }
 
 - (id) lookupName: (NSString *) _key
        inContext: (id) _ctx
@@ -355,16 +370,13 @@ static BOOL debugOn = NO;
   [r setHeader: [NSString stringWithFormat:@"%d", [data length]]
      forKey: @"content-length"];
   
-  if (asAttachment) {
-    fileName = [[[self partInfo] objectForKey: @"parameterList"] objectForKey: @"name"];
-    if (!fileName)
-      fileName = [[[[self partInfo] objectForKey: @"disposition"]
-                   objectForKey: @"parameterList"] 
-                  objectForKey: @"filename"];
-    if ([fileName length])
-      [r setHeader: [NSString stringWithFormat: @"attachment; filename=%@", fileName]
-        forKey: @"content-disposition"];
-  }
+  if (asAttachment)
+    {
+      fileName = [self filename];
+      if ([fileName length])
+       [r setHeader: [NSString stringWithFormat: @"attachment; filename=%@", fileName]
+          forKey: @"content-disposition"];
+    }
 
   if ((etag = [self davEntityTag]) != nil)
     [r setHeader:etag forKey:@"etag"];
index cb9b82e5ddcbde902b0d90c5f5cf2f2160055c87..bb05b1a2fb5c7555f70862c1c42620378e6ca321 100644 (file)
@@ -19,6 +19,8 @@
   02111-1307, USA.
 */
 
+#import <SoObjects/Mailer/SOGoMailBodyPart.h>
+
 #import "UIxMailPartViewer.h"
 
 @interface UIxMailPartImageViewer : UIxMailPartViewer
 
 @implementation UIxMailPartImageViewer
 
-/* URLs */
-
-- (NSString *) pathToImage
-{
-  NSMutableString *url;
-  NSString *s;
-
-  s = [[self clientObject] baseURLInContext: [self context]];
-  url = [NSMutableString stringWithString: s];
-  if (![url hasSuffix: @"/"])
-    [url appendString: @"/"];
-
-  s = [[self partPath] componentsJoinedByString:@"/"];
-  [url appendString: s];
-
-  s = [self preferredPathExtension];
-  if (s)
-    [url appendFormat: @".%@", s];
-  
-  return url;
-}
-
 @end /* UIxMailPartImageViewer */
index 5cd259441a53924956ee05196b60cc753b9c3e3e..fd04232030989f763f8f566c43e942b8c623f79d 100644 (file)
   content.
 */
 
-@class NSData, NSArray, NSFormatter;
+@class NSArray;
+@class NSData;
+@class NSFormatter;
+
+@class SOGoMailBodyPart;
 
 @interface UIxMailPartViewer : UIxComponent
 {
@@ -58,6 +62,8 @@
 - (void)setBodyInfo:(id)_info;
 - (id)bodyInfo;
 
+- (SOGoMailBodyPart *) clientPart;
+
 - (NSData *)flatContent;
 - (NSData *)decodedFlatContent;
 - (NSString *)flatContentAsString;
index f3a44db78af44bc69799e3e3d69241001ea14f49..96b9e50a6ed820750c13d177182c369d5987f0e4 100644 (file)
   return [self flatContent];
 }
 
-- (NSData *) content
+- (SOGoMailBodyPart *) clientPart
 {
-  NSData *content;
-  NSEnumerator *parts;
   id currentObject;
   NSString *currentPart;
-
-  content = nil;
+  NSEnumerator *parts;
 
   currentObject = [self clientObject];
   parts = [partPath objectEnumerator];
-  currentPart = [parts nextObject];
-  while (currentPart)
-    {
-      currentObject = [currentObject lookupName: currentPart
-                                    inContext: context
-                                    acquire: NO];
-      currentPart = [parts nextObject];
-    }
+  while ((currentPart = [parts nextObject]))
+    currentObject = [currentObject lookupName: currentPart
+                                  inContext: context
+                                  acquire: NO];
 
-  content = [currentObject fetchBLOB];
+  return currentObject;
+}
 
-  return content;
+- (NSData *) content
+{
+  return [[self clientPart] fetchBLOB];
 }
 
 - (NSString *) flatContentAsString
   return url;
 }
 
-- (NSString *) pathToAttachment
+- (NSString *) _filenameForAttachment: (SOGoMailBodyPart *) bodyPart
 {
-  /* this generates a more beautiful 'download' URL for a part */
-  NSString *fn;
-  NSMutableString *url;
+  NSMutableString *filename;
+  NSString *extension;
+
+  filename = [NSMutableString stringWithString: [bodyPart filename]];
+  if (![filename length])
+    [filename appendFormat: @"%@-%@",
+             [self labelForKey: @"Untitled"],
+             [bodyPart nameInContainer]];
 
-  fn = [self filename];
-  if ([fn length] > 0)
+  if (![[filename pathExtension] length])
     {
-      /* get basic URL */
-      url = [NSMutableString stringWithString: [self pathToAttachmentObject]];
-  
-      /* 
-        If we have an attachment name, we attach it, this is properly handled by
-        SOGoMailBodyPart.
-      */
-  
-      if (![url hasSuffix: @"/"])
-       [url appendString: @"/"];
-      if (isdigit([url characterAtIndex: 0]))
-       [url appendString: @"fn-"];
-      [url appendString: [fn stringByEscapingURL]];
-      // TODO: should we check for a proper extension?
+      extension = [self preferredPathExtension];
+      if (extension)
+       [filename appendFormat: @".%@", extension];
     }
-  else
-    url = nil;
+
+  return [filename stringByEscapingURL];
+}
+
+- (NSString *) pathToAttachment
+{
+  NSMutableString *url;
+  NSString *s;
+  SOGoMailBodyPart *bodyPart;
+
+  bodyPart = [self clientPart];
+  s = [bodyPart baseURLInContext: [self context]];
+  url = [NSMutableString stringWithString: s];
+  if (![url hasSuffix: @"/"])
+    [url appendString: @"/"];
+
+//   s = [[self partPath] componentsJoinedByString: @"/"];
+  [url appendString: [self _filenameForAttachment: bodyPart]];
 
   return url;
 }
index c9c41dc2c6fea39ecd6b1a1206f662bcc3147b8c..fd45643ca9a143f00de065c32f79d315f1ed290f 100644 (file)
@@ -396,11 +396,11 @@ static NSArray *infoKeys = nil;
 {
   NSArray *a;
 
-  if (attachmentNames)
+  if (!attachmentNames)
     {
       a = [[self clientObject] fetchAttachmentNames];
-      a = [a sortedArrayUsingSelector: @selector (compare:)];
-      attachmentNames = [a copy];
+      ASSIGN (attachmentNames,
+             [a sortedArrayUsingSelector: @selector (compare:)]);
     }
 
   return attachmentNames;
index a44c818f8c8f314b2b92865d9edef666d29f2cf7..04e3355d3119061a2993232612e592baf2f54cd8 100644 (file)
            {
              [newInfo setObject: [currentFolder nameInContainer]
                       forKey: @"c_folder"];
+             [newInfo setObject: [currentFolder ownerInContext: context]
+                      forKey: @"c_owner"];
              if (![[newInfo objectForKey: @"c_title"] length])
                [self _fixComponentTitle: newInfo withType: component];
              [infos addObject: [newInfo objectsForKeys: fields
   newEvents = [NSMutableArray array];
   fields = [NSArray arrayWithObjects: @"c_name", @"c_folder", @"c_status",
                    @"c_title", @"c_startdate", @"c_enddate", @"c_location",
-                   @"c_isallday", @"c_classification", @"c_partmails", @"c_partstates", nil];
+                   @"c_isallday", @"c_classification", @"c_partmails", @"c_partstates",
+                   @"c_owner", nil];
   events = [[self _fetchFields: fields
                  forComponentOfType: @"vevent"] objectEnumerator];
-  user = [[self context] activeUser];
   oldEvent = [events nextObject];
   while (oldEvent)
     {
        participants = [[oldEvent objectAtIndex: 9] componentsSeparatedByString: @"\n"];
        states = [[oldEvent objectAtIndex: 10] componentsSeparatedByString: @"\n"];
        for (i = 0; i < [participants count]; i++) {
+         user = [SOGoUser userWithLogin: [oldEvent objectAtIndex: 11] roles: nil];
          participant = [participants objectAtIndex: i];
          if ([user hasEmail: participant]) {
            switch ([[states objectAtIndex: i] intValue]) {
       if (participants == nil || i == [participants count])
        [newEvent replaceObjectAtIndex: 9 withObject: @""];
       [newEvent removeObjectAtIndex: 10];
+      [newEvent removeObjectAtIndex: 11];
 
       [newEvents addObject: newEvent];
       
index 1590d7a043de65aaa92182d85d1f99f29d05b373..57da0493f6f8d9350d5537eb3e3c39ec438e6cc2 100644 (file)
@@ -3,7 +3,7 @@
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:var="http://www.skyrix.com/od/binding"
   
-  var:src="pathToImage"
+  var:src="pathToAttachment"
   var:title="filenameForDisplay"
   class="mailer_imagecontent"
 ></img>
index 4609c7b9c962a012374981b252d2142872087dec..abda2830b21ce7aa61566f42d45b32c0eb97abaf 100644 (file)
   </div>
 
   <form const:href="send" name="pageform" enctype="multipart/form-data">
-      <div id="attachmentsArea">
-       <var:string label:value="Attachments:" />
-       <ul id="attachments">
-         <var:foreach list="attachmentNames" item="attachmentName"
-           ><li><img rsrc:src="attachment.gif"
-               /><var:string value="attachmentName"
-               /></li></var:foreach>
-       </ul>
-      </div>
+    <div id="attachmentsArea">
+      <var:string label:value="Attachments:" />
+      <ul id="attachments">
+       <var:foreach list="attachmentNames" item="attachmentName"
+         ><li><img rsrc:src="attachment.gif"
+             /><var:string value="attachmentName"
+             /></li></var:foreach>
+      </ul>
+    </div>
     <div id="headerArea">
       <span class="headerField"><var:string label:value="From" />:</span>
       <var:popup const:name="from"
        ><span class="headerField"><var:string label:value="Subject"
            />:</span
          >
-         <input name="subject"
-           type="text"
-           class="textField"
-           var:value="subject"
-           /></div>
-    <!-- separator line --><hr/>
+       <input name="subject"
+         type="text"
+         class="textField"
+         var:value="subject"
+         /></div>
+      <!-- separator line --><hr/>
     </div>
     <textarea id="text" name="text" rows="30" var:value="text"/>
     <!-- img rsrc:src="tbird_073_compose.png" alt="screenshot" / -->