From: helge Date: Wed, 11 Aug 2004 15:13:25 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/trunk@181 d1b88da0-ebda-0310-925b-ed51d... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbdd9f0b965299b1de9dbc9f95e93ece32de5cb2;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/trunk@181 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/Appointments/SOGoGroupAppointmentFolder.m b/SOGo/SoObjects/Appointments/SOGoGroupAppointmentFolder.m index f8592fae..850822d2 100644 --- a/SOGo/SoObjects/Appointments/SOGoGroupAppointmentFolder.m +++ b/SOGo/SoObjects/Appointments/SOGoGroupAppointmentFolder.m @@ -37,6 +37,13 @@ to:(NSCalendarDate *)_endDate { #warning TODO: implement aggregation based on the container + NSArray *folders; + + if ((folders = [[self container] valueForKey:@"memberFolders"]) == nil) { + [self logWithFormat:@"ERROR: calendar container has no 'memberFolders'?!"]; + return nil; + } + return [NSArray array]; } diff --git a/SOGo/SoObjects/SOGo/SOGoGroupFolder.h b/SOGo/SoObjects/SOGo/SOGoGroupFolder.h index cef1d07c..ce8e5756 100644 --- a/SOGo/SoObjects/SOGo/SOGoGroupFolder.h +++ b/SOGo/SoObjects/SOGo/SOGoGroupFolder.h @@ -31,14 +31,25 @@ Child objects: */ +@class NSArray, NSDictionary; + @interface SOGoGroupFolder : SOGoObject { + NSDictionary *uidToFolder; + NSArray *folders; } /* accessors */ - (NSArray *)uids; +/* folder management */ + +- (NSArray *)memberFolders; +- (id)folderForUID:(NSString *)_uid; + +- (void)reset; + /* pathes */ @end diff --git a/SOGo/SoObjects/SOGo/SOGoGroupFolder.m b/SOGo/SoObjects/SOGo/SOGoGroupFolder.m index ca833a80..c0d66829 100644 --- a/SOGo/SoObjects/SOGo/SOGoGroupFolder.m +++ b/SOGo/SoObjects/SOGo/SOGoGroupFolder.m @@ -26,6 +26,7 @@ @implementation SOGoGroupFolder - (void)dealloc { + [self->uidToFolder release]; [super dealloc]; } @@ -36,6 +37,96 @@ return nil; } +/* folder management */ + +- (id)_primaryLookupFolderForUID:(NSString *)_uid inContext:(id)_ctx { + NSException *error = nil; + NSArray *path; + id ctx, result; + + /* create subcontext, so that we don't destroy our environment */ + + if ((ctx = [_ctx createSubContext]) == nil) { + [self logWithFormat:@"ERROR: could not create SOPE subcontext!"]; + return nil; + } + + /* build path */ + + path = [NSArray arrayWithObjects:&_uid count:1]; + + /* traverse path */ + + result = [[ctx application] traversePathArray:path inContext:ctx + error:&error acquire:NO]; + if (error != nil) { + [self logWithFormat:@"ERROR: folder lookup failed (uid=%@): %@", + _uid, error]; + return nil; + } + + [self logWithFormat:@"Note: got folder for uid %@ path %@: %@", + _uid, [path componentsJoinedByString:@"=>"], result]; + return result; +} + +- (void)_setupFolders { + WOContext *ctx; + NSMutableDictionary *md; + NSMutableArray *ma; + NSArray *luids; + unsigned i, count; + + if (self->uidToFolder != nil) + return; + if ((luids = [self uids]) == nil) + return; + + ctx = [[WOApplication application] context]; + + count = [luids count]; + ma = [NSMutableArray arrayWithCapacity:count + 1]; + md = [NSMutableDictionary dictionaryWithCapacity:count]; + + for (i = 0; i < count; i++) { + NSString *uid; + id folder; + + uid = [luids objectAtIndex:i]; + folder = [self _primaryLookupFolderForUID:uid inContext:ctx]; + + if ([folder isNotNull]) { + [md setObject:folder forKey:uid]; + [ma addObject:folder]; + } + else + [ma addObject:[NSNull null]]; + } + + /* fix results */ + self->uidToFolder = [md copy]; + self->folders = [[NSArray alloc] initWithArray:ma]; +} + +- (NSArray *)memberFolders { + [self _setupFolders]; + return self->folders; +} + +- (id)folderForUID:(NSString *)_uid { + [self _setupFolders]; + + if ([_uid length] == 0) + return nil; + + return [self->uidToFolder objectForKey:_uid]; +} + +- (void)reset { + [self->uidToFolder release]; self->uidToFolder = nil; + [self->folders release]; self->folders = nil; +} + /* SOPE */ - (BOOL)isFolderish { diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 7dff1c61..6b2f1f9b 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG This file is part of OpenGroupware.org. diff --git a/SOGo/UI/Scheduler/UIxAppointmentFormatter.h b/SOGo/UI/Scheduler/UIxAppointmentFormatter.h index 4202e770..481c8a38 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentFormatter.h +++ b/SOGo/UI/Scheduler/UIxAppointmentFormatter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG This file is part of OpenGroupware.org. diff --git a/SOGo/UI/Scheduler/UIxAppointmentFormatter.m b/SOGo/UI/Scheduler/UIxAppointmentFormatter.m index b2f937d1..d90a35af 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentFormatter.m +++ b/SOGo/UI/Scheduler/UIxAppointmentFormatter.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG This file is part of OpenGroupware.org. diff --git a/SOGo/UI/Scheduler/UIxCalBackForthNavView.m b/SOGo/UI/Scheduler/UIxCalBackForthNavView.m index 41942462..d8e76b36 100644 --- a/SOGo/UI/Scheduler/UIxCalBackForthNavView.m +++ b/SOGo/UI/Scheduler/UIxCalBackForthNavView.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDateLabel.m b/SOGo/UI/Scheduler/UIxCalDateLabel.m index 3b538afc..462472cf 100644 --- a/SOGo/UI/Scheduler/UIxCalDateLabel.m +++ b/SOGo/UI/Scheduler/UIxCalDateLabel.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG This file is part of OGo diff --git a/SOGo/UI/Scheduler/UIxCalDayChartview.m b/SOGo/UI/Scheduler/UIxCalDayChartview.m index 3938d9d7..7fd85aa9 100644 --- a/SOGo/UI/Scheduler/UIxCalDayChartview.m +++ b/SOGo/UI/Scheduler/UIxCalDayChartview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDayListview.m b/SOGo/UI/Scheduler/UIxCalDayListview.m index 146a0fd1..c4a5b011 100644 --- a/SOGo/UI/Scheduler/UIxCalDayListview.m +++ b/SOGo/UI/Scheduler/UIxCalDayListview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDayOverview.h b/SOGo/UI/Scheduler/UIxCalDayOverview.h index 335cd215..bc998aa1 100644 --- a/SOGo/UI/Scheduler/UIxCalDayOverview.h +++ b/SOGo/UI/Scheduler/UIxCalDayOverview.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDayOverview.m b/SOGo/UI/Scheduler/UIxCalDayOverview.m index 1d446bbf..3e3db0c7 100644 --- a/SOGo/UI/Scheduler/UIxCalDayOverview.m +++ b/SOGo/UI/Scheduler/UIxCalDayOverview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDayPrintview.m b/SOGo/UI/Scheduler/UIxCalDayPrintview.m index e564a5e1..648e5b48 100644 --- a/SOGo/UI/Scheduler/UIxCalDayPrintview.m +++ b/SOGo/UI/Scheduler/UIxCalDayPrintview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDayView.h b/SOGo/UI/Scheduler/UIxCalDayView.h index 7f899291..938f2d5c 100644 --- a/SOGo/UI/Scheduler/UIxCalDayView.h +++ b/SOGo/UI/Scheduler/UIxCalDayView.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalDayView.m b/SOGo/UI/Scheduler/UIxCalDayView.m index 89c1f190..5c3d14c6 100644 --- a/SOGo/UI/Scheduler/UIxCalDayView.m +++ b/SOGo/UI/Scheduler/UIxCalDayView.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m b/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m index 13fe3fae..2b61484b 100644 --- a/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m +++ b/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalMonthOverview.h b/SOGo/UI/Scheduler/UIxCalMonthOverview.h index 9e8a0aea..3a91da5d 100644 --- a/SOGo/UI/Scheduler/UIxCalMonthOverview.h +++ b/SOGo/UI/Scheduler/UIxCalMonthOverview.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalMonthPrintview.m b/SOGo/UI/Scheduler/UIxCalMonthPrintview.m index 87eeca31..95cf51a7 100644 --- a/SOGo/UI/Scheduler/UIxCalMonthPrintview.m +++ b/SOGo/UI/Scheduler/UIxCalMonthPrintview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalWeekChartview.m b/SOGo/UI/Scheduler/UIxCalWeekChartview.m index 7e5ce4bc..449c0de1 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekChartview.m +++ b/SOGo/UI/Scheduler/UIxCalWeekChartview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalWeekColumnsview.m b/SOGo/UI/Scheduler/UIxCalWeekColumnsview.m index e6f315ec..d9c121be 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekColumnsview.m +++ b/SOGo/UI/Scheduler/UIxCalWeekColumnsview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalWeekListview.m b/SOGo/UI/Scheduler/UIxCalWeekListview.m index 8cc0a78f..b98015f5 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekListview.m +++ b/SOGo/UI/Scheduler/UIxCalWeekListview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -20,18 +20,15 @@ */ // $Id$ - #include "UIxCalWeekView.h" -#include "common.h" @interface UIxCalWeekListview : UIxCalWeekView { - } @end +#include "common.h" @implementation UIxCalWeekListview - -@end +@end /* UIxCalWeekListview */ diff --git a/SOGo/UI/Scheduler/UIxCalWeekListview.wox b/SOGo/UI/Scheduler/UIxCalWeekListview.wox index 3d86219a..4f0b47b8 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekListview.wox +++ b/SOGo/UI/Scheduler/UIxCalWeekListview.wox @@ -9,13 +9,16 @@ title="name"> - +
+ diff --git a/SOGo/UI/Scheduler/UIxCalWeekOverview.h b/SOGo/UI/Scheduler/UIxCalWeekOverview.h index 24516bf5..b6d72d01 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekOverview.h +++ b/SOGo/UI/Scheduler/UIxCalWeekOverview.h @@ -1,23 +1,23 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OpenGroupware.org. + This file is part of OpenGroupware.org. - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - */ + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ // $Id$ #include "UIxCalWeekView.h" diff --git a/SOGo/UI/Scheduler/UIxCalWeekOverview.m b/SOGo/UI/Scheduler/UIxCalWeekOverview.m index 3b978eba..075ec939 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekOverview.m +++ b/SOGo/UI/Scheduler/UIxCalWeekOverview.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG This file is part of OpenGroupware.org. diff --git a/SOGo/UI/Scheduler/UIxCalWeekPrintview.m b/SOGo/UI/Scheduler/UIxCalWeekPrintview.m index 10685e13..76ab3d69 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekPrintview.m +++ b/SOGo/UI/Scheduler/UIxCalWeekPrintview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/UIxCalYearOverview.m b/SOGo/UI/Scheduler/UIxCalYearOverview.m index a0eb463d..16a8e71d 100644 --- a/SOGo/UI/Scheduler/UIxCalYearOverview.m +++ b/SOGo/UI/Scheduler/UIxCalYearOverview.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the diff --git a/SOGo/UI/Scheduler/common.h b/SOGo/UI/Scheduler/common.h index 093af0b3..bb109a4a 100644 --- a/SOGo/UI/Scheduler/common.h +++ b/SOGo/UI/Scheduler/common.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG This file is part of OpenGroupware.org. @@ -18,7 +18,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: common.h,v 1.1 2003/11/24 01:24:40 helge Exp $ +// $Id$ #import
-