]> err.no Git - scalable-opengroupware.org/commitdiff
more mailer changes
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 11 Oct 2004 15:11:48 +0000 (15:11 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 11 Oct 2004 15:11:48 +0000 (15:11 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@379 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SoObjects/Mailer/ChangeLog
SOGo/SoObjects/Mailer/SOGoDraftsFolder.h
SOGo/SoObjects/Mailer/SOGoDraftsFolder.m
SOGo/SoObjects/Mailer/Version
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/UIxMailEditorAction.m
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/mailer.css
SOGo/UI/Mailer/product.plist

index f850c3750fadeb02aa8d9aec7adc40573f9965be..2198a063b9f6b831115e22e4e7d32b31851102af 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-11  Helge Hess  <helge.hess@opengroupware.org>
 
+       * SOGoDraftsFolder.m: added methods to deal with new draft objects
+         (v0.9.33)
+
        * started SOGoDraftObject (v0.9.32)
 
 2004-10-10  Helge Hess  <helge.hess@opengroupware.org>
index 9d6ab06c941cb33f05f7ff8e49a568acf996faf5..b938b1ddf19ee852c8e8615bc208fd987921591d 100644 (file)
 {
 }
 
+/* new objects */
+
+- (NSString *)makeNewObjectNameInContext:(id)_ctx;
+- (NSString *)newObjectBaseURLInContext:(id)_ctx;
+- (id)newObjectInContext:(id)_ctx;
+
 @end
 
 #endif /* __Mailer_SOGoDraftsFolder_H__ */
index d15cb76ac4352ac8ad25583a87ef50e5a48881fc..80cf46d70ed95175160595f66017a2c59d2f5e97 100644 (file)
@@ -25,6 +25,7 @@
 #include <SOGo/SOGoUserFolder.h>
 #include <NGExtensions/NSFileManager+Extensions.h>
 #include "common.h"
+#include <unistd.h>
 
 @implementation SOGoDraftsFolder
 
@@ -40,6 +41,30 @@ static NSString *spoolFolder = nil;
   NSLog(@"Note: using SOGo mail spool folder: %@", spoolFolder);
 }
 
+/* new objects */
+
+- (NSString *)makeNewObjectNameInContext:(id)_ctx {
+  static int counter = 1; // THREAD
+  return [NSString stringWithFormat:@"draft_%08d_%08x", getpid(), counter++];
+}
+
+- (NSString *)newObjectBaseURLInContext:(id)_ctx {
+  NSString *s, *n;
+  
+  n = [self makeNewObjectNameInContext:_ctx];
+  if (![n isNotNull]) return nil;
+  
+  s = [self baseURLInContext:_ctx];
+  if (![s isNotNull]) return nil;
+  if (![s hasSuffix:@"/"]) s = [s stringByAppendingString:@"/"];
+  return [s stringByAppendingString:n];
+}
+
+- (id)newObjectInContext:(id)_ctx {
+  return [self lookupName:[self makeNewObjectNameInContext:_ctx]
+              inContext:_ctx acquire:NO];
+}
+
 /* draft folder functionality */
 
 - (NSFileManager *)spoolFileManager {
index 97a71362c3bf0ddb41e2363c8153f42f36284c9c..a416fb2da5b737d088c2e68031da10b3fd57ee26 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=32
+SUBMINOR_VERSION:=33
index e36606c775f83a017e314d0ab7e9530f8dc97eee..191c64c5257bc386b8aaaae277edd102f2a38e27 100644 (file)
@@ -1,6 +1,18 @@
 2004-10-11  Helge Hess  <helge.hess@opengroupware.org>
 
-       * started UIxMailEditorAction object which will contains all the
+       * v0.9.29
+
+       * product.plist: trigger UIxMailEditorAction for compose instead of
+         returning the mail editor page, mapped missing toolbar actions
+
+       * UIxMailEditorAction.m: implemented -compose as a redirect to a new
+         object in the account draft folder
+
+       * UIxMailListView.wox: reduced subject width to 50%
+
+       * mailer.css: added send icon class, icon itself still missing
+
+       * started UIxMailEditorAction object which will contain all the
          redirects from the buttons to the mail editor (working on draft
          objects in the drafts folder) (v0.9.28)
 
index d5aa505fe4164f8b25d986e91356be3efc408438..69d64667273a98f1ec6be8ceea3892d1e0060e16 100644 (file)
 @end
 
 #include <SOGo/SoObjects/Mailer/SOGoDraftsFolder.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailAccount.h>
 #include "common.h"
 
 @implementation UIxMailEditorAction
 
+/* lookups */
+
+- (SOGoDraftsFolder *)draftsFolder {
+  /* 
+     Note: we cannot use acquisition to find the nearest drafts folder, because
+           the IMAP4 server might contains an own Drafts folder.
+  */
+  SOGoDraftsFolder *drafts;
+  id client;
+  
+  client = [self clientObject];
+  drafts = [[client mailAccountFolder]
+                   lookupName:@"Drafts" inContext:[self context] acquire:NO];
+  return drafts;
+}
+
 /* errors */
 
 - (id)didNotFindDraftsError {
   return [@"did not find drafts folder in object: "
           stringByAppendingString:[[self clientObject] description]];
 }
+- (id)couldNotCreateDraftError:(SOGoDraftsFolder *)_draftsFolder {
+  return [@"could not create a new draft in folder: "
+          stringByAppendingString:[_draftsFolder description]];
+}
 
 /* actions */
 
 - (id)composeAction {
   SOGoDraftsFolder *drafts;
-  id client;
+  WOResponse *r;
+  NSString   *url;
   
-  client = [self clientObject];
-  drafts = [client lookupName:@"Drafts" inContext:[self context] acquire:YES];
+  drafts = [self draftsFolder];
   if (![drafts isNotNull])
     return [self didNotFindDraftsError];
   if ([drafts isKindOfClass:[NSException class]])
     return drafts;
   
-  [self logWithFormat:@"compose on %@: %@", client, drafts];
-  return nil;
+  url = [drafts newObjectBaseURLInContext:[self context]];
+  if (![url isNotNull])
+    return [self couldNotCreateDraftError:drafts];
+  
+  if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
+  url = [url stringByAppendingString:@"edit"];
+  
+  [self logWithFormat:@"compose on %@: %@", drafts, url];
+  
+  r = [[self context] response];
+  [r setStatus:302 /* moved */];
+  [r setHeader:url forKey:@"location"];
+  return r;
 }
 
 @end /* UIxMailEditorAction */
index 5d90729cccdceb589f15b22915d2db16c6604596..f30e5e511b57fe195dc1bcd05d7f40e40ac03312 100644 (file)
@@ -27,7 +27,7 @@
         <tr class="tableview">
          <!-- TODO: see AB for sorting -->
           
-          <td class="tbtv_headercell" width="60%">
+          <td class="tbtv_headercell" width="50%">
            <a href="view" _sort="subject">
               <var:string label:value="Subject" />
               <var:if condition="imap4SortKey" const:value="SUBJECT">
index 42d0a3b80cd7c5cbc793862161337200792359c1..3631f8fc66cdf21de4aff18dbdf3b1e05e3abf16 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=28
+SUBMINOR_VERSION:=29
index 8af0f0d47f29c9a505f749ead3e50f8151776ed1..078243475192ccbc312c1a758afd4afab2b2141d 100644 (file)
 .tbicon_print       { background-image: url(tbtb_print.png);       }
 .tbicon_stop        { background-image: url(tbtb_deletedoc.png);   }
 
+/* TODO: add proper compose icons! */
+.tbicon_send        { background-image: url(tbtb_compose.png);   }
 
 /* mail tableview */
 
index 124b7c93a0e3c0b73f93249836918ba96efdb598..7c42053caf859508cf65237f94108d0c5ffbb2a5 100644 (file)
                 cssClass = "tbicon_addressbook"; label = "Addressbook"; }
             ),
             ( /* second group */
-              { link = "#"; 
+              { link = "reply"; 
                 cssClass = "tbicon_reply";    label = "Reply";     },
-              { link = "#"; 
+              { link = "replyall"; 
                 cssClass = "tbicon_replyall"; label = "Reply All"; },
-              { link = "#"; cssClass = "tbicon_forward";  label = "Forward";   },
+              { link = "forward"; 
+                cssClass = "tbicon_forward";  label = "Forward";   },
             ),
             ( /* third group */
               { link = "#"; 
           pageName    = "UIxMailView"; 
           actionName  = "delete";
         };
+        junk = { 
+          protectedBy = "View";
+          pageName    = "UIxMailView"; 
+          actionName  = "junk";
+        };
         edit = { 
           protectedBy = "View";
           pageName    = "UIxMailEditor"; 
         };
-        save = { 
+
+        compose = {
           protectedBy = "View";
-          pageName    = "UIxMailEditor"; 
-          actionName  = "save";
+          actionClass = "UIxMailEditorAction"; 
+         actionName  = "compose";
+        };
+        reply = {
+          protectedBy = "View";
+          actionClass = "UIxMailEditorAction"; 
+         actionName  = "reply";
+        };
+        replyall = {
+          protectedBy = "View";
+          actionClass = "UIxMailEditorAction"; 
+         actionName  = "replyall";
+        };
+        forward = {
+          protectedBy = "View";
+          actionClass = "UIxMailEditorAction"; 
+         actionName  = "forward";
         };
       };
     };
           pageName    = "UIxMailListView"; 
         };
         compose = {
+          protectedBy = "View";
+          actionClass = "UIxMailEditorAction"; 
+         actionName  = "compose";
+        };
+      };
+    };
+
+    SOGoDraftObject = {
+      slots = {
+        toolbar = { /* need the 'send' toolbar here */
+          protectedBy = "View";
+          value = ( /* the toolbar groups */
+            ( /* first group */
+              { link  = "send";
+                cssClass = "tbicon_send"; 
+                label = "Send"; },
+              { link  = "contacts"; target = "addressbook";
+                cssClass = "tbicon_addressbook"; label = "Contacts"; },
+            )
+          );
+        };
+      };
+      methods = {
+        view = { /* somewhat hackish */
+          protectedBy = "View";
+          pageName    = "UIxMailEditor"; 
+        };
+        edit = {
           protectedBy = "View";
           pageName    = "UIxMailEditor"; 
         };