+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
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 */
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 */
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;
}
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 */
/* 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;
}
{
NSString *rootClassName;
NSString *treeFolderAction;
- NSMutableDictionary *flattenedNodes;
+ NSMutableArray *flattenedNodes;
id rootNodes;
id item;
}
{
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];
}
/* 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 {
- (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
- (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];
atSerial: 1
forParent: 0
withRootName: @""
- toArray: flattenedBlocks];
-
- [flattenedNodes setObject: flattenedBlocks forKey: userKey];
+ toArray: flattenedNodes];
// max = [flattenedBlocks count];
// for (count = 0; count < max; count++)
// {
// }
}
- 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];
}
-{ /* -*-cperl-*- */
+{ /* -*-javascript-*- */
requires = ( MAIN, CommonUI, Mailer ); /* , Sieve */
publicResources = (
pageName = "UIxMailListView";
actionName = "expunge";
};
-
createFolder = {
protectedBy = "View";
pageName = "UIxMailListView";
</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">
<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>
UL#tasksList, UL#calendarList
{ cursor: default;
- margin: .25px;
+ margin: .25em;
padding: 0px;
overflow: auto;
border-bottom: 1px solid #fff;
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;
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