]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1039 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 30 Mar 2007 22:14:39 +0000 (22:14 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 30 Mar 2007 22:14:39 +0000 (22:14 +0000)
12 files changed:
ChangeLog
SoObjects/Appointments/SOGoTaskObject.m
SoObjects/Mailer/SOGoMailAccount.m
UI/MailPartViewers/UIxMailPartHTMLViewer.m
UI/MailPartViewers/UIxMailPartICalViewer.m
UI/MailPartViewers/UIxMailPartImageViewer.m
UI/MailerUI/UIxMailTree.h
UI/MailerUI/UIxMailTree.m
UI/MailerUI/product.plist
UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox
UI/WebServerResources/SchedulerUI.css
UI/WebServerResources/UIxAclEditor.css

index 4091f7b80d11ee5ebb1b0619311ce2a7b3329833..1f675d5fb9dcd4583ec46ccb82843dd2791ed9b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2007-03-30  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount
+       -toManyRelationshipKeys]): don't put the predefined folders in the
+       list if they are returned by the server.
+
+       * UI/MailerUI/UIxMailTree.m ([UIxMailTree -flattenedNodes]): we no
+       longer store the "flattenedBlocks" in a dictionary since the
+       object will be deleted anyway and we don't need to put the folders
+       in cache.
+
+       * UI/MailPartViewers/UIxMailPartHTMLViewer.m
+       ([UIxMailPartHTMLViewer -_attachmentIds]): take the current
+       attachment path into account when computing the part urls.
+
 2007-03-29  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * UI/Contacts/UIxContactsListViewContainer.m
index 87dbef17e7d6ae4b81f8e458f37182f0b1d907c5..c364b922bf8ce17c54b8e029e9ec3762dc8f6fe6 100644 (file)
@@ -504,34 +504,4 @@ static NSString                  *mailTemplateDefaultLanguage = nil;
   return @"IPM.Task";
 }
 
-/* EMail Notifications */
-
-- (NSString *)homePageURLForPerson:(iCalPerson *)_person {
-  static AgenorUserManager *um      = nil;
-  static NSString          *baseURL = nil;
-  NSString *uid;
-
-  if (!um) {
-    WOContext *ctx;
-    NSArray   *traversalObjects;
-
-    um = [[AgenorUserManager sharedUserManager] retain];
-
-    /* generate URL from traversal stack */
-    ctx = [[WOApplication application] context];
-    traversalObjects = [ctx objectTraversalStack];
-    if ([traversalObjects count] >= 1) {
-      baseURL = [[[traversalObjects objectAtIndex:0] baseURLInContext:ctx]
-                                                     retain];
-    }
-    else {
-      [self warnWithFormat:@"Unable to create baseURL from context!"];
-      baseURL = @"http://localhost/";
-    }
-  }
-  uid = [um getUIDForEmail:[_person rfc822Email]];
-  if (!uid) return nil;
-  return [NSString stringWithFormat:@"%@%@", baseURL, uid];
-}
-
 @end /* SOGoTaskObject */
index 8f70346bd72d7bfb49cc4d6d2153bc76b4592182..8a362fddf26fb3794b679fdaf0262e6320dae993 100644 (file)
@@ -100,12 +100,25 @@ static BOOL     useAltNamespace       = NO;
   return rootFolderNames;
 }
 
-- (NSArray *)toManyRelationshipKeys {
-  NSArray *a, *b;
-  
-  a = [self additionalRootFolderNames];
-  b = [[self imap4Connection] subfoldersForURL:[self imap4URL]];
-  return [b count] > 0 ? [b arrayByAddingObjectsFromArray:a] : a;
+- (NSArray *) toManyRelationshipKeys
+{
+  NSMutableArray *folders;
+  NSArray *imapFolders, *additionalFolders;
+
+  folders = [NSMutableArray new];
+  [folders autorelease];
+
+  imapFolders = [[self imap4Connection] subfoldersForURL: [self imap4URL]];
+  additionalFolders = [self additionalRootFolderNames];
+  if ([imapFolders count] > 0)
+    [folders addObjectsFromArray: imapFolders];
+  if ([additionalFolders count] > 0)
+    {
+      [folders removeObjectsInArray: additionalFolders];
+      [folders addObjectsFromArray: additionalFolders];
+    }
+
+  return folders;
 }
 
 /* identity */
index 5203d85e5fbc77dc069b1323d68aa8d630d036cd..3fd047fe740fc6fb24138e19645ca89491a988a5 100644 (file)
   NSMutableDictionary *attachmentIds;
   UIxMailPartViewer *parent;
   unsigned int count, max;
+  NSMutableString *url;
   NSString *baseURL;
   NSArray *parts;
 
                          isEqualToString: @"UIxMailPartAlternativeViewer"])
     {
       baseURL = [[self clientObject] baseURLInContext: context];
+      url = [NSMutableString new];
+      [url appendString: baseURL];
+      [url appendFormat: @"/%@", [partPath componentsJoinedByString: @"/"]];
+      [url deleteCharactersInRange: NSMakeRange([url length] - 3, 2)];
       parts = [[parent bodyInfo] objectForKey: @"parts"];
       max = [parts count];
       for (count = 0; count < max; count++)
         [self _convertReferencesForPart: [parts objectAtIndex: count]
               withCount: count + 1
-              andBaseURL: baseURL
+              andBaseURL: url
               intoDictionary: attachmentIds];
+      [url release];
     }
 
-  NSLog(@"attc: '%@'", attachmentIds);
   return attachmentIds;
 }
 
index 0cac3f1bc82d3f6e7e9b6db89e9e836cc57f22d7..f8a0e549a44ed84938e9fcb70b6d61b9b90190d8 100644 (file)
   return self->attendee;
 }
 
+- (NSString *) _personForDisplay: (iCalPerson *) person
+{
+  return [NSString stringWithFormat: @"%@ <%@>",
+                  [person cnWithoutQuotes],
+                  [person rfc822Email]];
+}
+
+- (NSString *) attendeeForDisplay
+{
+  return [self _personForDisplay: attendee];
+}
+
 - (void)setItem:(id)_item {
   ASSIGN(self->item, _item);
 }
 
 /* derived fields */
 
-- (NSString *)organizerDisplayName {
+- (NSString *) organizerDisplayName
+{
   iCalPerson *organizer;
-  NSString   *cn;
-  
-  if ((organizer = [[self authorativeEvent] organizer]) != nil) {
-    cn = [organizer valueForKey:@"cnWithoutQuotes"];
-    if ([cn isNotNull] && [cn length] > 0)
-      return cn;
-    
-    cn = [organizer valueForKey:@"rfc822Email"];
-    if ([cn isNotNull] && [cn length] > 0)
-      return cn;
-    
-    return @"[error: unable to derive organizer name]";
-  }
+  NSString *value;
+
+  organizer = [[self authorativeEvent] organizer];
+  if (organizer)
+    value = [self _personForDisplay: organizer];
+  else
+    value = @"[todo: no organizer set, use 'from']";
 
-  return @"[todo: no organizer set, use 'from']";
+  return value;
 }
 
 /* replies */
index deb7252edab45623c428480f9ba6a720a5f4de2a..b975a3248ced92f36b4c7097d6cd254b7e5a4366 100644 (file)
 
 /* URLs */
 
-- (NSString *)pathToImage {
-  NSString *url;
+- (NSString *) pathToImage
+{
+  NSMutableString *url;
   NSString *s;
-  
-  url = [[self clientObject] baseURLInContext:[self context]];
-  if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
+
+  s = [[self clientObject] baseURLInContext: [self context]];
+  url = [NSMutableString stringWithString: s];
+  if (![url hasSuffix: @"/"])
+    [url appendString: @"/"];
 
   s = [[self partPath] componentsJoinedByString:@"/"];
-  url = [url stringByAppendingString:s];
+  [url appendString: s];
 
-  if ((s = [self preferredPathExtension]) != nil) {
-    url = [url stringByAppendingString:@"."];
-    url = [url stringByAppendingString:s];
-  }
+  s = [self preferredPathExtension];
+  if (s)
+    [url appendFormat: @".%@", s];
   
   return url;
 }
index dcea0a403cac1cfa7ece92f5cc434c31b57070c7..b2c6a6af945f06ee4b050f69a0ce9cbcbe0414cf 100644 (file)
@@ -31,7 +31,7 @@
 {
   NSString *rootClassName;
   NSString *treeFolderAction;
-  NSMutableDictionary *flattenedNodes;
+  NSMutableArray *flattenedNodes;
   id rootNodes;
   id item;
 }
index 1cb06352cd4502ae75dad7c86488716847cdc910..0204d4fd988de7f82965ab36fe7b0d93ae3d6244 100644 (file)
@@ -60,17 +60,18 @@ static BOOL debugBlocks = NO;
 {
   if ((self = [super init]))
     {
-      flattenedNodes = [NSMutableDictionary new];
+      flattenedNodes = nil;
     }
+
   return self;
 }
 
 - (void) dealloc
 {
-  [self->treeFolderAction release];
-  [self->rootClassName    release];
-  [self->rootNodes release];
-  [self->item      release];
+  [treeFolderAction release];
+  [rootClassName release];
+  [rootNodes release];
+  [item release];
   [flattenedNodes release];
   [super dealloc];
 }
@@ -94,24 +95,24 @@ static BOOL debugBlocks = NO;
 /* accessors */
 
 - (void)setRootClassName:(id)_rootClassName {
-  ASSIGNCOPY(self->rootClassName, _rootClassName);
+  ASSIGNCOPY(rootClassName, _rootClassName);
 }
 - (id)rootClassName {
-  return self->rootClassName;
+  return rootClassName;
 }
 
 - (void)setItem:(id)_item {
-  ASSIGN(self->item, _item);
+  ASSIGN(item, _item);
 }
 - (id)item {
-  return self->item;
+  return item;
 }
 
 - (void)setTreeFolderAction:(NSString *)_action {
-  ASSIGNCOPY(self->treeFolderAction, _action);
+  ASSIGNCOPY(treeFolderAction, _action);
 }
 - (NSString *)treeFolderAction {
-  return self->treeFolderAction;
+  return treeFolderAction;
 }
 
 - (NSString *)itemIconName {
@@ -556,17 +557,17 @@ static BOOL debugBlocks = NO;
 - (NSArray *)rootNodes {
   UIxMailTreeBlock *navNode;
   
-  if (self->rootNodes != nil)
-    return self->rootNodes;
+  if (rootNodes != nil)
+    return rootNodes;
   
   navNode = [self buildNavigationNodesForObject:[self clientObject]];
   
   if ([navNode hasChildren] && [navNode areChildrenLoaded])
-    self->rootNodes = [[navNode children] retain];
+    rootNodes = [[navNode children] retain];
   else if (navNode)
-    self->rootNodes = [[NSArray alloc] initWithObjects:&navNode count:1];
+    rootNodes = [[NSArray alloc] initWithObjects:&navNode count:1];
   
-  return self->rootNodes;
+  return rootNodes;
 }
 
 - (int) addNodes: (NSArray *) nodes
@@ -604,17 +605,13 @@ static BOOL debugBlocks = NO;
 
 - (NSArray *) flattenedNodes
 {
-  NSMutableArray *flattenedBlocks = nil;
-  NSString *userKey;
   UIxMailTreeBlock *rootNode; // , *curNode;
   id mailAccounts;
 //   unsigned int count, max;
 
-  userKey = [[self user] login];
-  flattenedBlocks = [flattenedNodes objectForKey: userKey];
-  if (!flattenedBlocks)
+  if (!flattenedNodes)
     {
-      flattenedBlocks = [NSMutableArray new];
+      flattenedNodes = [NSMutableArray new];
 
       if (![[self clientObject] isKindOfClass: NSClassFromString(@"SOGoMailAccounts")])
        mailAccounts = [[self clientObject] mailAccountsFolder];
@@ -626,9 +623,7 @@ static BOOL debugBlocks = NO;
            atSerial: 1
            forParent: 0
            withRootName: @""
-           toArray: flattenedBlocks];
-
-      [flattenedNodes setObject: flattenedBlocks forKey: userKey];
+           toArray: flattenedNodes];
 //       max = [flattenedBlocks count];
 //       for (count = 0; count < max; count++)
 //     {
@@ -637,14 +632,15 @@ static BOOL debugBlocks = NO;
 //     }
     }
 
-  return flattenedBlocks;
+  return flattenedNodes;
 }
 
 /* notifications */
 
-- (void)sleep {
-  [self->item      release]; self->item      = nil;
-  [self->rootNodes release]; self->rootNodes = nil;
+- (void) sleep
+{
+  [item release]; item = nil;
+  [rootNodes release]; rootNodes = nil;
   [super sleep];
 }
 
index 36638339accf30e51d0108879a2ede239c53db71..6a0803aad0672962d0ff102bd640d741f1480c08 100644 (file)
@@ -1,4 +1,4 @@
-{ /* -*-cperl-*- */
+{ /* -*-javascript-*- */
   requires = ( MAIN, CommonUI, Mailer ); /* , Sieve */
 
   publicResources = (
           pageName    = "UIxMailListView";
           actionName  = "expunge";
         };
-
         createFolder = {
           protectedBy = "View";
           pageName    = "UIxMailListView";
index 22987fc7e86e3659caad04caa55ccc33f835260a..72a2fc92d02a144589f4f753434ce186f3cdcd9b 100644 (file)
@@ -33,7 +33,7 @@
     </legend>
     
     
-    <var:if condition="inCalendar.method" const:value="REQUEST">
+    <!-- var:if condition="inCalendar.method" const:value="REQUEST" -->
       <!-- sent to attendees to propose or update a meeting -->
       <var:if condition="isLoggedInUserAnAttendee">
         <p class="uix_ical_toolbar">
@@ -61,7 +61,7 @@
           <var:string label:value="request_info_no_attendee" />
         </p>
       </var:if>
-    </var:if>
+    <!-- var:if -->
 
     
     <var:if condition="inCalendar.method" const:value="REPLY">
           <td valign="top"><var:string label:value="Attendees"/>:</td>
           <td>
             <var:foreach list="authorativeEvent.participants" item="attendee">
-              <a var:href="attendee.email"
-                 ><var:string value="attendee.cnForDisplay" /></a>
+              <a var:href="attendee.email"><var:string value="attendeeForDisplay"/></a>
               (<var:string label:value="$attendee.partStatWithDefault" />)
               <br />
             </var:foreach>
index adc757af6066be9a8bd58efa38c7f087f8493e8f..abc6070b9cef71949f3ed95cfab83ecc22e1f865 100644 (file)
@@ -56,7 +56,7 @@ DIV.colorBox
 
 UL#tasksList, UL#calendarList
 { cursor: default;
-  margin: .25px;
+  margin: .25em;
   padding: 0px;
   overflow: auto;
   border-bottom: 1px solid #fff;
index 3439d4afe6090c1b11dc39c66fafb3d8b27a2b0e..9ed9f66c10b5373cd37e6ce0af0021fade576e12 100644 (file)
@@ -12,13 +12,14 @@ DIV.acls UL
   width: 100%; }
 
 DIV#userRoles
-{ height: 7em;
+{ height: 8em;
   padding-bottom: 2em; }
 
 UL#userList
 { cursor: default;
-  margin: .25px;
+  margin: .25em;
   padding: 0px;
+  white-space: nowrap;
   overflow: auto;
   border-bottom: 1px solid #fff;
   border-right: 1px solid #fff;
@@ -31,13 +32,12 @@ UL#userList
   list-style-image: none; }
 
 UL#userList > LI._selected
-{ 
-  background: #4b6983 !important;
-  color: #fff !important;
-}
+{ background: #4b6983 !important;
+  color: #fff !important; }
 
 SELECT#userRoleDropDown
 { visibility: hidden;
+  margin-top: 1em;
   margin-left: 2em; }
 
 SPAN.legend