diff --git a/ChangeLog b/ChangeLog index 50917e67e..6125977db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-07 Wolfgang Sourdeau + + * UI/SOGoUI/UIxComponent.m ([UIxComponent -userFolderPath]): + return a path based on the object's context instead of the first + level in SOGo's object hierarchy... + 2006-09-06 Wolfgang Sourdeau * UI/Templates/SchedulerUI/UIxCalDayTable.wox: day columns can now diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 2c19171a5..e24e47d81 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -284,26 +284,29 @@ static BOOL uixDebugEnabled = NO; return [uri substringFromIndex: (r.location + 1)]; } -- (NSString *) _urlForTraversalObject: (int) traversal -{ - WOContext *ctx; - NSArray *traversalObjects; - NSString *url; - NSString *path; - - ctx = [self context]; - traversalObjects = [ctx objectTraversalStack]; - url = [[traversalObjects objectAtIndex: traversal] - baseURLInContext:ctx]; - path = [[NSURL URLWithString:url] path]; -// path = [path stringByAppendingPathComponent:[[ctx activeUser] login]]; - - return path; -} - - (NSString *) userFolderPath { - return [self _urlForTraversalObject: 1]; + WOContext *ctx; + NSString *url, *path; + NSEnumerator *objects; + SOGoObject *currentObject; + BOOL found; + + ctx = [self context]; + objects = [[ctx objectTraversalStack] objectEnumerator]; + currentObject = [objects nextObject]; + found = NO; + while (currentObject + && !found) + if ([currentObject isKindOfClass: [SOGoUserFolder class]]) + found = YES; + else + currentObject = [objects nextObject]; + + url = [currentObject baseURLInContext:ctx]; + path = [[NSURL URLWithString:url] path]; + + return path; } - (NSString *) applicationPath @@ -371,7 +374,7 @@ static BOOL uixDebugEnabled = NO; return rel; } - + /* date */ - (NSTimeZone *) viewTimeZone