]> err.no Git - scalable-opengroupware.org/commitdiff
added emitter selection to mail compose panel
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 8 Jul 2005 14:27:38 +0000 (14:27 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 8 Jul 2005 14:27:38 +0000 (14:27 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@706 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/Main/SOGoAuthenticator.m
SOGo/UI/MailerUI/ChangeLog
SOGo/UI/MailerUI/UIxMailEditor.m
SOGo/UI/MailerUI/Version
SOGo/UI/Templates/MailerUI/UIxMailEditor.wox

index 52de901c32aa3f624416006d54e45d7c81996c9f..e40cec1a817f54e49ea29a72d057b20074290e76 100644 (file)
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
 
 #include "SOGoAuthenticator.h"
 #include "common.h"
@@ -33,10 +32,6 @@ static SOGoAuthenticator *auth = nil; // THREAD
   return auth;
 }
 
-- (void)dealloc {
-  [super dealloc];
-}
-
 /* check credentials */
 
 - (BOOL)checkLogin:(NSString *)_login password:(NSString *)_pwd {
index e16806c5659db4413207585fa0fbd8a3ef210bbf..9a712bfe1ad6f019e3e45d054c646a1e64c84880 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-08  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailEditor.m: added from-selection popup, list discovery via
+         AgenorUserManager (aka LDAP) (v0.9.135)
+
 2005-07-08  Helge Hess  <helge.hess@opengroupware.org>
 
        * UIxMailEditor.m: use WOContext method from libSOGo to detect
index 551d2491fb0a53e649b8fc0b66dd76ea1339beb2..b9277bccaba9bba69c99097c11435d4a4049182b 100644 (file)
@@ -37,6 +37,8 @@
   NSArray  *bcc;
   NSString *subject;
   NSString *text;
+  NSArray  *fromEMails;
+  NSString *from;
   SOGoMailFolder *sentFolder;
 }
 
@@ -46,6 +48,7 @@
 #include <SoObjects/Mailer/SOGoMailFolder.h>
 #include <SoObjects/Mailer/SOGoMailAccount.h>
 #include <SoObjects/SOGo/WOContext+Agenor.h>
+#include <SoObjects/SOGo/AgenorUserManager.h>
 #include <NGMail/NGMimeMessage.h>
 #include <NGMail/NGMimeMessageGenerator.h>
 #include "common.h"
@@ -104,6 +107,8 @@ static NSArray      *infoKeys = nil;
 
 - (void)dealloc {
   [self->sentFolder release];
+  [self->fromEMails release];
+  [self->from    release];
   [self->text    release];
   [self->subject release];
   [self->to      release];
@@ -114,11 +119,15 @@ static NSArray      *infoKeys = nil;
 
 /* accessors */
 
-- (void)setFrom:(NSString *)_ignore {
+- (void)setFrom:(NSString *)_value {
+  ASSIGNCOPY(self->from, _value);
 }
 - (NSString *)from {
-  return [self emailForUser];
+  if (![self->from isNotNull])
+    return [self emailForUser];
+  return self->from;
 }
+
 - (void)setReplyTo:(NSString *)_ignore {
 }
 - (NSString *)replyTo {
@@ -161,6 +170,36 @@ static NSArray      *infoKeys = nil;
   return [self->bcc isNotNull] ? self->bcc : [NSArray array];
 }
 
+/* from addresses */
+
+- (NSArray *)fromEMails {
+  NSString *primary, *uid;
+  NSArray  *shares;
+  
+  if (self->fromEMails != nil) 
+    return self->fromEMails;
+  
+  uid     = [[self user] login];
+  primary = [self emailForUser];
+  if (![[self context] isAccessFromIntranet]) {
+    self->fromEMails = [[NSArray alloc] initWithObjects:&primary count:1];
+    return self->fromEMails;
+  }
+  
+  shares = 
+    [[AgenorUserManager sharedUserManager] getSharedMailboxEMailsForUID:uid];
+  if ([shares count] == 0)
+    self->fromEMails = [[NSArray alloc] initWithObjects:&primary count:1];
+  else {
+    id tmp;
+
+    tmp = [[NSArray alloc] initWithObjects:&primary count:1];
+    self->fromEMails = [[tmp arrayByAddingObjectsFromArray:shares] copy];
+    [tmp release]; tmp = nil;
+  }
+  return self->fromEMails;
+}
+
 /* title */
 
 - (NSString *)panelTitle {
index 2b0ec3eb3b5a462ef67c9095804569d9cd788d0d..ebc04838e132a603df0b89d11ebaa309c4a61b75 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=134
+SUBMINOR_VERSION:=135
 
 # v0.9.134 requires libSOGo          v0.9.41
 # v0.9.100 requires libNGMime        v4.5.213
index 5196c0e60982309b5d0c9cf8cc2d89bfcb37d244..df3b8dcb4fa94fb9e1ad84c269d627f31dad7875 100644 (file)
 >
  <div id="compose_panel">
 
-<!-- we don't support multiple accounts ...
-  <div id="compose_fromline">
-    From:
-    [always a popup on Thunderbird]
-    <select name="totype_00" style="width: 90%;">
-      <option value="to" selected="selected">xxx@yyy.com</option>
-    </select>
-  </div>
--->
-  
   <var:if condition="showInternetMarker">
     <div id="compose_internetmarker">
       <var:string
     />
   </div>
 
+  <!-- moved below to selection to make it look better -->
+  <div id="compose_fromline">
+    <table border="0" width="100%">
+      <tr>
+        <td class="compose_label" width="20%">
+          <var:string label:value="From" />:
+        </td>
+        <td width="80%">
+          <var:popup const:name="from" list="fromEMails" item="item"
+                     selection="from"
+                     const:style="width: 100%; font-size: 8pt;"
+            />
+        </td>
+      </tr>
+    </table>
+  </div>
+
   <div id="compose_subject">
     <table border="0" width="100%">
       <tr>
-        <td class="compose_label" width="15%">
+        <td class="compose_label" width="20%">
           <var:string label:value="Subject" />:
         </td>
-        <td width="85%"><input name="subject" 
+        <td width="80%"><input name="subject" 
                                id="compose_subject_input" type="text" 
                               var:value="subject" /></td>
       </tr>