From 01e605ba685304068b0ecbfe5630d40ac4c77ca7 Mon Sep 17 00:00:00 2001 From: znek Date: Sun, 15 Aug 2004 12:46:44 +0000 Subject: [PATCH] work in progress git-svn-id: http://svn.opengroupware.org/SOGo/trunk@218 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SOGo.xcode/project.pbxproj | 57 +++++++++++++++++++++++- SOGo/UI/Scheduler/ChangeLog | 17 +++++++ SOGo/UI/Scheduler/GNUmakefile | 1 + SOGo/UI/Scheduler/UIxAppointmentEditor.m | 18 +------- SOGo/UI/Scheduler/UIxCalView.m | 31 ++++++++++--- SOGo/UI/Scheduler/UIxCalWeekOverview.wox | 8 +++- SOGo/UI/Scheduler/UIxComponent+Agenor.h | 37 +++++++++++++++ SOGo/UI/Scheduler/UIxComponent+Agenor.m | 44 ++++++++++++++++++ 8 files changed, 188 insertions(+), 25 deletions(-) create mode 100644 SOGo/UI/Scheduler/UIxComponent+Agenor.h create mode 100644 SOGo/UI/Scheduler/UIxComponent+Agenor.m diff --git a/SOGo/SOGo.xcode/project.pbxproj b/SOGo/SOGo.xcode/project.pbxproj index d051677a..c432df32 100644 --- a/SOGo/SOGo.xcode/project.pbxproj +++ b/SOGo/SOGo.xcode/project.pbxproj @@ -343,6 +343,8 @@ AD071CE606CD2ACE00A9EEF4, AD071CEC06CD2ACE00A9EEF4, AD071CED06CD2ACE00A9EEF4, + AD73BE4A06CF88BF00226A2D, + AD73BE4B06CF88BF00226A2D, AD071D1206CD2BCB00A9EEF4, AD071D1306CD2BCB00A9EEF4, ); @@ -531,6 +533,54 @@ refType = 4; sourceTree = ""; }; + AD73BE4A06CF88BF00226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = SOGoAppointmentICalRenderer.h; + refType = 4; + sourceTree = ""; + }; + AD73BE4B06CF88BF00226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = SOGoAppointmentICalRenderer.m; + refType = 4; + sourceTree = ""; + }; + AD73BE6106CF8CC500226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "UIxComponent+Agenor.h"; + refType = 4; + sourceTree = ""; + }; + AD73BE6206CF8CC500226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = "UIxComponent+Agenor.m"; + refType = 4; + sourceTree = ""; + }; + AD73BE7D06CF90EA00226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "NSCalendarDate+UIx.h"; + refType = 4; + sourceTree = ""; + }; + AD73BE7E06CF90EA00226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = "NSCalendarDate+UIx.m"; + refType = 4; + sourceTree = ""; + }; ADCDE53106ADA8AC00BFCE2B = { fileEncoding = 5; isa = PBXFileReference; @@ -1783,11 +1833,12 @@ E87208930692E3D30099CBBD = { explicitFileType = sourcecode.make; fileEncoding = 4; + indentWidth = 8; isa = PBXFileReference; path = GNUmakefile; refType = 4; sourceTree = ""; - tabWidth = 4; + tabWidth = 8; }; E87208940692E3D30099CBBD = { explicitFileType = sourcecode.make; @@ -2121,8 +2172,12 @@ E872090B0692E3D30099CBBD, E87209020692E3D30099CBBD, E87209030692E3D30099CBBD, + AD73BE7D06CF90EA00226A2D, + AD73BE7E06CF90EA00226A2D, AD071B3C06CCFA2000A9EEF4, AD071B3D06CCFA2000A9EEF4, + AD73BE6106CF8CC500226A2D, + AD73BE6206CF8CC500226A2D, ); isa = PBXGroup; name = Classes; diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index cfc807ff..8c333dbb 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,20 @@ +2004-08-14 Marcus Mueller + + * v0.9.38 + + * UIxComponent+Agenor.[hm]: -cnForUser and -emailForUser require the + AgenorUserManager from Logic. + + * UIxAppointmentEditor.m: refactored -cnForUser and -emailForUser, + moved to extra category. + + * UIxCalWeekView.wox: added custom style if apt belongs to user. + + * UIxCalView.m: added some extra logic in redirect, provided extra + style sheet selector for appointments. + + * GNUmakefile: added new files + 2004-08-14 Marcus Mueller * v0.9.37 diff --git a/SOGo/UI/Scheduler/GNUmakefile b/SOGo/UI/Scheduler/GNUmakefile index 4828361d..49b2c924 100644 --- a/SOGo/UI/Scheduler/GNUmakefile +++ b/SOGo/UI/Scheduler/GNUmakefile @@ -15,6 +15,7 @@ SchedulerUI_OBJC_FILES = \ UIxAppointmentFormatter.m \ iCalPerson+UIx.m \ NSCalendarDate+UIx.m \ + UIxComponent+Agenor.m \ \ UIxCalView.m \ UIxCalDayView.m \ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 12c296cb..99b326d6 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -37,9 +37,6 @@ - (NSString *)iCalStringTemplate; - (NSString *)iCalString; -- (NSString *)emailForUser; -- (NSString *)cnForUser; - - (NSString *)_completeURIForMethod:(NSString *)_method; - (iCalPerson *)getOrganizer; @@ -55,6 +52,7 @@ #include #include #include "iCalPerson+UIx.h" +#include "UIxComponent+Agenor.h" @interface NSDate(UsedPrivates) - (NSString *)icalString; // TODO: this is in NGiCal @@ -224,20 +222,6 @@ /* email, cn */ -- (NSString *)emailForUser { - NSString *uid; - - uid = [[self user] login]; - return [[AgenorUserManager sharedUserManager] getEmailForUID:uid]; -} - -- (NSString *)cnForUser { - NSString *uid; - - uid = [[self user] login]; - return [[AgenorUserManager sharedUserManager] getCNForUID:uid]; -} - - (NSString *)combinedCNAndEmailForUser { return [NSString stringWithFormat:@"%@;%@", [self emailForUser], diff --git a/SOGo/UI/Scheduler/UIxCalView.m b/SOGo/UI/Scheduler/UIxCalView.m index 9cef50ae..066f6c57 100644 --- a/SOGo/UI/Scheduler/UIxCalView.m +++ b/SOGo/UI/Scheduler/UIxCalView.m @@ -7,6 +7,7 @@ #include "SoObjects/Appointments/SOGoAppointmentFolder.h" #include #include +#include @interface UIxCalView (PrivateAPI) - (NSString *)_userFolderURI; @@ -92,11 +93,20 @@ static BOOL shouldDisplayWeekend = NO; return title; } -/* TODO: remove this */ - (NSString *)tooltipForApt { return [[self aptTooltipFormatter] stringForObjectValue:self->appointment]; } +- (BOOL)isMyApt { + return YES; +} + +- (NSString *)aptStyle { + if(![self isMyApt]) + return @"other_apt"; + return nil; +} + - (NSCalendarDate *)referenceDateForFormatter { return [self selectedDate]; } @@ -214,7 +224,6 @@ static BOOL shouldDisplayWeekend = NO; stringByAppendingString:@"/view"]; } - /* backend */ /* resource URLs (TODO?) */ @@ -401,10 +410,11 @@ static BOOL shouldDisplayWeekend = NO; - (id)redirectForUIDsAction { NSMutableString *uri; - NSString *uidsString, *loc, *prevMethod; + NSString *uidsString, *loc, *prevMethod, *userFolderID; WORequest *req; id r; BOOL useGroups; + unsigned index; req = [[self context] request]; @@ -418,8 +428,19 @@ static BOOL shouldDisplayWeekend = NO; uri = [[NSMutableString alloc] initWithString:[self _userFolderURI]]; /* if we have more than one entry, use groups - otherwise don't */ useGroups = [uidsString rangeOfString:@","].length > 0; - + userFolderID = [uri lastPathComponent]; if(useGroups) { + NSArray *uids; + + uids = [uidsString componentsSeparatedByString:@","]; + /* guarantee that our id is the first */ + if(((index = [uids indexOfObject:userFolderID]) != NSNotFound) && + (index != 0)) { + uids = [[uids mutableCopy] autorelease]; + [(NSMutableArray *)uids removeObjectAtIndex:index]; + [(NSMutableArray *)uids insertObject:userFolderID atIndex:0]; + uidsString = [uids componentsJoinedByString:@","]; + } [uri appendString:@"Groups/_custom_"]; [uri appendString:uidsString]; [uri appendString:@"/"]; @@ -427,7 +448,7 @@ static BOOL shouldDisplayWeekend = NO; else { /* check if lastPathComponent is the base that we want to have */ if((([uidsString length] != 0) && - (![[uri lastPathComponent] isEqualToString:uidsString]))) { + (![userFolderID isEqualToString:uidsString]))) { NSRange r; /* uri ends with an '/', so we have to adjust the range a little */ diff --git a/SOGo/UI/Scheduler/UIxCalWeekOverview.wox b/SOGo/UI/Scheduler/UIxCalWeekOverview.wox index a00b2357..603b8365 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekOverview.wox +++ b/SOGo/UI/Scheduler/UIxCalWeekOverview.wox @@ -165,8 +165,10 @@ @@ -174,8 +176,10 @@
diff --git a/SOGo/UI/Scheduler/UIxComponent+Agenor.h b/SOGo/UI/Scheduler/UIxComponent+Agenor.h new file mode 100644 index 00000000..9e4c2145 --- /dev/null +++ b/SOGo/UI/Scheduler/UIxComponent+Agenor.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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. + + 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$ + + +#ifndef __UIxComponent_Agenor_H_ +#define __UIxComponent_Agenor_H_ + + +#import + + +@interface UIxComponent (Agenor) +/* email, cn */ +- (NSString *)emailForUser; +- (NSString *)cnForUser; +@end + +#endif /* __UIxComponent_Agenor_H_ */ diff --git a/SOGo/UI/Scheduler/UIxComponent+Agenor.m b/SOGo/UI/Scheduler/UIxComponent+Agenor.m new file mode 100644 index 00000000..2240b5df --- /dev/null +++ b/SOGo/UI/Scheduler/UIxComponent+Agenor.m @@ -0,0 +1,44 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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. + + 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 "UIxComponent+Agenor.h" +#include +#include "common.h" + +@implementation UIxComponent (Agenor) + +- (NSString *)emailForUser { + NSString *uid; + + uid = [[self user] login]; + return [[AgenorUserManager sharedUserManager] getEmailForUID:uid]; +} + +- (NSString *)cnForUser { + NSString *uid; + + uid = [[self user] login]; + return [[AgenorUserManager sharedUserManager] getCNForUID:uid]; +} + +@end -- 2.39.5