]> err.no Git - scalable-opengroupware.org/commitdiff
mailer improvements
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sat, 2 Oct 2004 20:11:06 +0000 (20:11 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sat, 2 Oct 2004 20:11:06 +0000 (20:11 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@342 d1b88da0-ebda-0310-925b-ed51d893ca5b

15 files changed:
SOGo/SoObjects/Mailer/ChangeLog
SOGo/SoObjects/Mailer/SOGoMailFolder.h
SOGo/SoObjects/Mailer/SOGoMailFolder.m
SOGo/SoObjects/Mailer/SOGoMailManager.m
SOGo/SoObjects/Mailer/Version
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/UIxMailListView.m
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/UIxMailMainFrame.m
SOGo/UI/Mailer/UIxMailMainFrame.wox
SOGo/UI/Mailer/UIxMailView.m
SOGo/UI/Mailer/UIxMailView.wox
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/mailer.css
SOGo/UI/Mailer/product.plist

index 793d2f22b663de3bccaa39229078b856ab3b1dea..325083a26c8cf41028064c4e41e810a432874854 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-02  Helge Hess  <helge.hess@opengroupware.org>
+
+       * SOGoMailFolder.[hm]: removed ability to restrict UID fetch range,
+         need to fetch all (qualifier matching!) UIDs anyway (v0.9.19)
+
 2004-10-01  Helge Hess  <helge.hess@opengroupware.org>
 
        * more work on fetching mails (v0.9.18)
index 82ac0d5d28ee6d60993055e7ec34597f6457eafe..4b622cab16759212ff4539a1cb4a6e0e364f8743 100644 (file)
@@ -42,8 +42,7 @@
 
 /* messages */
 
-- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so
-  range:(NSRange)_r;
+- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so;
 - (NSArray *)fetchUIDs:(NSArray *)_uids parts:(NSArray *)_parts;
 
 @end
index 2d1c9dab6a54b4f1a6b6fd5047756be4a89cf29b..5025b04991b3928cf73c1204057c208b3313aeb9 100644 (file)
 
 /* messages */
 
-- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so
-  range:(NSRange)_r
-{
+- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so {
   return [[self mailManager] fetchUIDsInURL:[self imap4URL]
-                            qualifier:_q sortOrdering:_so range:_r
+                            qualifier:_q sortOrdering:_so
+                            range:NSMakeRange(0, 100000)
                             password:[self imap4Password]];
 }
 
index 39efa9768b16588476a5a55678cf3874733230f0..f65ae96cc406bf1ba43eb8db0bf470747cc6b3dd 100644 (file)
@@ -375,9 +375,22 @@ static NSTimeInterval PoolScanInterval = 5 * 60;
 - (NSArray *)fetchUIDs:(NSArray *)_uids inURL:(NSURL *)_url
   parts:(NSArray *)_parts password:(NSString *)_pwd
 {
+  /*
+    Allowed fetch keys:
+      UID
+      BODY.PEEK[<section>]<<partial>>
+      BODYSTRUCTURE
+      ENVELOPE        [this is a parsed header, but does not include type]
+      FLAGS
+      INTERNALDATE
+      RFC822
+      RFC822.HEADER
+      RFC822.SIZE
+      RFC822.TEXT
+  */
   NGImap4Client *client;
   NSDictionary  *result;
-
+  
   if (_uids == nil)
     return nil;
   if ([_uids count] == 0)
index cd35ad0fc7134df7fcc93aab18344f258f338c2b..93c8cd1ddfe4862984d2fe8dffb82de3a02d010b 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=18
+SUBMINOR_VERSION:=19
index 5162ee9908e8a271b90e4c5c62afc057822cc387..ac900420134ec048b75a0f74e0b1872c6cd4255b 100644 (file)
@@ -1,5 +1,7 @@
 2004-10-02  Helge Hess  <helge.hess@opengroupware.org>
 
+       * more work on UI (v0.9.9)
+
        * added formatters for mail list (v0.9.8)
 
        * v0.9.7
index cc86c77775e5eeb46b0f4eac7855f62ca7a4b0c3..3b256fea31c455a0fc5255322ccc57e789d57bfd 100644 (file)
@@ -25,6 +25,8 @@
 
 @interface UIxMailListView : UIxComponent
 {
+  NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
+  NSArray *messages;
   id message;
 }
 
 @implementation UIxMailListView
 
 - (void)dealloc {
-  [self->message release];
+  [self->sortedUIDs release];
+  [self->messages   release];
+  [self->message    release];
   [super dealloc];
 }
 
 /* notifications */
 
 - (void)sleep {
-  [self->message release]; self->message = nil;
+  [self->sortedUIDs release]; self->sortedUIDs = nil;
+  [self->messages   release]; self->messages = nil;
+  [self->message    release]; self->message  = nil;
+  [self logWithFormat:@"SLEEP"];
   [super sleep];
 }
 
   return [[[self message] valueForKey:@"uid"] stringValue];
 }
 
-- (NSArray *)messages {
-  NSArray *uids;
-  NSArray *msgs;
+/* fetching messages */
+
+- (NSArray *)fetchKeys {
+  /* Note: see SOGoMailManager.m for allowed IMAP4 keys */
+  static NSArray *keys = nil;
+  if (keys == nil) 
+    keys = [[NSArray alloc] initWithObjects:@"FLAGS", @"ENVELOPE", nil];
+  return keys;
+}
+
+- (id)qualifier {
+  return nil;
+}
+
+- (NSString *)imap4SortKey {
+  return @"SUBJECT";
+}
 
-  uids = [[self clientObject] fetchUIDsMatchingQualifier:nil
-                             sortOrdering:@"SUBJECT"
-                             range:NSMakeRange(0, 50)];
+- (NSRange)fetchRange {
+  return NSMakeRange(0, 50);
+}
+
+- (NSArray *)sortedUIDs {
+  if (self->sortedUIDs != nil)
+    return self->sortedUIDs;
+  
+  self->sortedUIDs 
+    = [[[self clientObject] fetchUIDsMatchingQualifier:[self qualifier]
+                           sortOrdering:[self imap4SortKey]] retain];
+  return self->sortedUIDs;
+}
+- (unsigned int)totalMessageCount {
+  return [self->sortedUIDs count];
+}
+- (BOOL)showsAllMessages {
+  return ([[self sortedUIDs] count] <= [self fetchRange].length) ? YES : NO;
+}
+
+- (NSRange)fetchBlock {
+  NSRange  r;
+  unsigned len;
+  NSArray  *uids;
+  
+  r    = [self fetchRange];
+  uids = [self sortedUIDs];
+
+  /* only need to restrict if we have a lot */
+  if ((len = [uids count]) <= r.length) {
+    r.location = 0;
+    r.length   = len;
+    return r;
+  }
   
-  [self logWithFormat:@"#UIDs: %d", [uids count]];
-
-  /*
-    Allowed fetch keys:
-      UID
-      BODY.PEEK[<section>]<<partial>>
-      BODYSTRUCTURE
-      ENVELOPE        [this is a parsed header, but does not include type]
-      FLAGS
-      INTERNALDATE
-      RFC822
-      RFC822.HEADER
-      RFC822.SIZE
-      RFC822.TEXT
-  */
+  if (len < r.location) {
+#warning CHECK CONDITION (< vs <=)
+    /* out of range, recover at first block */
+    r.location = 0;
+    return r;
+  }
   
-  msgs = [[self clientObject] fetchUIDs:uids 
-                             parts:[NSArray arrayWithObjects:
-                                              @"FLAGS",
-                                              @"ENVELOPE",
-                                            nil]];
-  [self logWithFormat:@"  msg #%d", [[msgs valueForKey:@"fetch"] count]];
-  return [msgs valueForKey:@"fetch"];
+  if (r.location + r.length > len)
+    r.length = len - r.location;
+  return r;
+}
+- (unsigned int)firstMessageNumber {
+  return [self fetchBlock].location + 1;
+}
+- (unsigned int)lastMessageNumber {
+  NSRange r;
+  
+  r = [self fetchBlock];
+  return r.location + r.length;
+}
+- (BOOL)hasPrevious {
+  return [self fetchBlock].location == 0 ? NO : YES;
+}
+- (BOOL)hasNext {
+  NSRange r = [self fetchBlock];
+  return r.location + r.length >= [[self sortedUIDs] count] ? NO : YES;
+}
+
+- (NSArray *)messages {
+  NSArray  *uids;
+  NSArray  *msgs;
+  NSRange  r;
+  unsigned len;
+  
+  if (self->messages != nil)
+    return self->messages;
+  
+  r    = [self fetchBlock];
+  uids = [self sortedUIDs];
+  if ((len = [uids count]) > r.length)
+    /* only need to restrict if we have a lot */
+    uids = [uids subarrayWithRange:r];
+  
+  msgs = [[self clientObject] fetchUIDs:uids parts:[self fetchKeys]];
+  self->messages = [[msgs valueForKey:@"fetch"] retain];
+  return self->messages;
 }
 
 /* URL processing */
   return [self redirectToLocation:@"view"];
 }
 
+- (id)getMailAction {
+  // TODO: we might want to flush the caches?
+  return [self redirectToLocation:@"view"];
+}
+
 @end /* UIxMailListView */
index 1ab00da64b35ea38ae70c39db9de3ec960851a48..bed43b2bac9cdb046e34314a2e61fdd4a949830a 100644 (file)
             <a href="?sort=date"><var:string label:value="Date" /></a>
           </td>
         </tr>
-
+        <tr class="tableview">
+          <td colspan="4" class="tbtv_navcell" align="right">
+            <var:if condition="showsAllMessages">
+              <var:string value="sortedUIDs.count" />
+              <var:string label:value="messages" />
+            </var:if>
+            
+            <var:if condition="showsAllMessages" const:negate="YES">
+              <var:if condition="hasPrevious">
+                <a href="prevBlock">prev</a> |
+              </var:if>
+  
+              <var:string value="firstMessageNumber"/>
+              <var:string label:value="to" />
+              <var:string value="lastMessageNumber"/>
+              <var:string label:value="of" />
+              <var:string value="sortedUIDs.count" />
+  
+              <var:if condition="hasNext">
+                | <a href="nextBlock">next</a>
+              </var:if>
+            </var:if>
+          </td>
+        </tr>
+        
         <var:foreach list="messages" item="message">
           <tr class="tableview">
             <td>
index 025a8d7f9e073eaf389840386042ffeef1d650f0..d545c4fba25c280015b1fc752ce83317fad91967 100644 (file)
@@ -27,7 +27,8 @@
   NSString *title;
   NSString *rootURL;
   NSString *userRootURL;
-  id item;
+  id       item;
+  BOOL     hideFolderTree;
 }
 
 - (NSString *)rootURL;
 
 /* accessors */
 
+- (void)setHideFolderTree:(BOOL)_flag {
+   self->hideFolderTree = _flag;
+}
+- (BOOL)hideFolderTree {
+  return self->hideFolderTree;
+}
+
 - (void)setTitle:(NSString *)_value {
   ASSIGNCOPY(self->title, _value);
 }
index 4e91dc6c675b2c81ff0cfe311000719098ffe9e3..100339b94f8b2a02c56388a3064ace3293e25743 100644 (file)
 -->
           <table border="0">
             <tr>
-              <td class="tb_icon"><a href="#" class="tbicon_getmail"> </a></td>
-              <td class="tb_icon"><a href="#" class="tbicon_compose"> </a></td>
-              <td class="tb_icon"><a href="#" class="tbicon_addressbook"> </a></td>
+              <td class="tb_icon"
+                  ><a href="getMail" class="tbicon_getmail"> </a></td>
+              <td class="tb_icon"><a href="compose" target="_blank" 
+                  class="tbicon_compose"> </a></td>
+              <td class="tb_icon"><a href="addressbook" target="addressbook"
+                  class="tbicon_addressbook"> </a></td>
               <td class="tb_spacer"> </td>
+
+              <!-- TODO: should do a form submit? -->
               <td class="tb_icon"><a href="#" class="tbicon_reply"   > </a></td>
               <td class="tb_icon"><a href="#" class="tbicon_replyall"> </a></td>
               <td class="tb_icon"><a href="#" class="tbicon_forward" > </a></td>
               <td class="tb_spacer"> </td>
+
               <td class="tb_icon"><a href="#" class="tbicon_delete"> </a></td>
               <td class="tb_icon"><a href="#" class="tbicon_junk"  > </a></td>
               <td class="tb_spacer"> </td>
+
               <td class="tb_icon"><a href="#" class="tbicon_print"> </a></td>
               <td class="tb_icon"><a href="#" class="tbicon_stop" > </a></td>
             </tr>
       </tr>
       <tr class="vertframerow">
         <td width="100%" valign="top" class="vertframerow" colspan="2">
-          <table width="100%">
-            <tr>
-              <td width="25%" valign="top" class="foldercell">
-                <div class="titlediv">Folders</div>
-                <div style="height: 95%">
-                  <div class="embedwhite_out">
-                    <div class="embedwhite_in">
-                      <var:component className="UIxMailTree" />
+          <var:if condition="hideFolderTree">
+            <var:component-content/>
+          </var:if>
+          
+          <var:if condition="hideFolderTree" const:negate="YES">
+            <table width="100%">
+              <tr>
+                <td width="25%" valign="top" class="foldercell">
+                  <div class="titlediv">Folders</div>
+                  <div style="height: 95%">
+                    <div class="embedwhite_out">
+                      <div class="embedwhite_in">
+                        <var:component className="UIxMailTree" />
+                      </div>
                     </div>
                   </div>
-                </div>
-              </td>
-              <td style="width: 6px;"> </td>
-              <td valign="top" class="contentcell">
-                <var:component-content/>
-              </td>
-            </tr>
-          </table>
+                </td>
+                <td style="width: 6px;"> </td>
+                <td valign="top" class="contentcell">
+                  <var:component-content/>
+                </td>
+              </tr>
+            </table>
+          </var:if>
         </td>
       </tr>
     </table>
index e04f18b5a3a3a857cfaf92a262142a27c7361566..0341e336698463d23c041653932332cad77515aa 100644 (file)
@@ -59,4 +59,9 @@
   return [self redirectToLocation:url];
 }
 
+- (id)getMailAction {
+  // TODO: we might want to flush the caches?
+  return [self redirectToLocation:@"view"];
+}
+
 @end /* UIxMailView */
index 3ef7f9ecc4b3458770eb0a0220fba3ef98736a92..95dae8aea1e6943c060c3d28171e8f5dc3efe577 100644 (file)
@@ -6,10 +6,40 @@
   xmlns:uix="OGo:uix"
   xmlns:rsrc="OGo:url"
   xmlns:label="OGo:label"
-  className="UIxPageFrame"
+  className="UIxMailMainFrame"
   title="name"
+  const:hideFolderTree="1"
 >
-  <h4>Mail View</h4>
+  <table class="mailer_fieldtable">
+    <tr class="mailer_fieldrow">
+      <td class="mailer_fieldname" ><var:string label:value="Subject"/>:</td>
+      <td class="mailer_subjectfieldvalue">Re: Statuslist</td>
+    </tr>
+    <tr class="mailer_fieldrow">
+      <td class="mailer_fieldname" ><var:string label:value="From"/>:</td>
+      <td class="mailer_fieldvalue">
+        <!-- compose link? -->
+        <a href="#">Maxime Wacker [mwacker@linagora.com]</a>
+      </td>
+    </tr>
+    <tr class="mailer_fieldrow">
+      <td class="mailer_fieldname" ><var:string label:value="Date"/>:</td>
+      <td class="mailer_fieldvalue">08.09.2004 15:32</td>
+    </tr>
+    <tr class="mailer_fieldrow">
+      <td class="mailer_fieldname" ><var:string label:value="To"/>:</td>
+      <td class="mailer_fieldvalue">
+        <!-- compose link? -->
+        <a href="#">Helge Hess [helge.hess@skyrix.com]</a>
+      </td>
+    </tr>
+  </table>
+  
+  <div class="mailer_mailcontent">
+    a b c<br />
+    <img rsrc:src="tbird_073_viewer.png" />
+  </div>
+<!--
   <a rsrc:href="tbird_073_viewer.png">screenshot</a>
-
+-->
 </var:component>
index 28292b549059af8a6800e33ac74ed5ab727067ed..81be7eb6e79defb0b93e0ca78f8a44c310c033c2 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=8
+SUBMINOR_VERSION:=9
index 1275fb3e1008638b9db8653481a577ab96736521..29cfbfa6cb2b1c0fdec3e644c2a74ae751a72cd5 100644 (file)
@@ -137,11 +137,26 @@ td.tb_icon a {
 /* mail tableview */
 
 .tableview { 
-  font-size:   9pt;
-  font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  font-size:      9pt;
+  font-family:    Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
   vertical-align: top;
 }
 
+td.tbtv_navcell { 
+  border-width:        1;
+  border-style:        solid;
+  border-top-color:    white;
+  border-left-color:   white;
+  border-bottom-color: #808080;
+  border-right-color:  #808080;
+  padding-top:         4px;
+  padding-bottom:      3px;
+  padding-left:        4px;
+  padding-right:       4px;
+  
+  background-color:    #D4D0C8;
+}
+
 td.tbtv_headercell { 
   border-width:        1;
   border-style:        solid;
@@ -224,3 +239,38 @@ div.mailer_unreadicon a {
   margin:  0px auto;
   display: block;
 }
+
+/* fields (key/value UI), eg used in mail viewer */
+
+table.mailer_fieldtable { 
+  width: 100%;
+
+  border-bottom-color: #808080;
+  border-bottom-width: 1;
+  border-bottom-style: solid;
+}
+tr.mailer_fieldrow { 
+  font-size:   9pt;
+  font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+}
+td.mailer_fieldname {
+  padding-left: 24px;
+  text-align:   right;
+  font-weight:  bold;
+}
+td.mailer_fieldvalue {
+  width: 95%;
+}
+td.mailer_subjectfieldvalue {
+  font-weight: bold;
+}
+td.mailer_fieldvalue a {
+  text-decoration: underline;
+}
+
+div.mailer_mailcontent { 
+  border-top-color: white;
+  border-top-width: 1;
+  border-top-style: solid;
+  background-color: white;
+}
index 492458f98549bc23660dee98d29b06ebec169060..6ce95d4adb0a3217a514a0df71fd6b6166ec5d65 100644 (file)
           pageName    = "UIxMailListView"; 
           actionName  = "markMessageRead";
         };
+        getMail = {
+          protectedBy = "View";
+          pageName    = "UIxMailListView"; 
+          actionName  = "getMail";
+        };
       };
     };
 
           protectedBy = "View";
           pageName    = "UIxMailView"; 
         };
+
+        getMail = {
+          protectedBy = "View";
+          pageName    = "UIxMailView"; 
+          actionName  = "getMail";
+        };
+
         delete = { 
           protectedBy = "View";
           pageName    = "UIxMailView";