From ffa6aa7ecd9b5b7f962788ac8b191e2cd03b30d0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 31 Oct 2006 18:52:52 +0000 Subject: [PATCH] rollback Monotone-Parent: 2d120d90819b42e21a50956a14c0c5d130cfdf09 Monotone-Revision: 376221b991f7b0bee18cfede79614398e85e5b99 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-31T18:52:52 Monotone-Branch: ca.inverse.sogo --- Main/SOGo.m | 1 + .../sql/generate-folderinfo-sql-for-users.sh | 4 +- SoObjects/Appointments/GNUmakefile | 1 - .../Appointments/SOGoAppointmentObject.m | 32 ---- SoObjects/SOGo/SOGoAuthenticator.m | 1 - UI/Scheduler/UIxCalMonthView.h | 32 ---- UI/Scheduler/UIxCalMonthView.m | 177 ++---------------- UI/Templates/SchedulerUI/UIxCalMonthView.wox | 115 +++++++----- 8 files changed, 88 insertions(+), 275 deletions(-) diff --git a/Main/SOGo.m b/Main/SOGo.m index c4adbc410..1e361bc7d 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -124,6 +124,7 @@ static BOOL doCrashOnSessionCreate = NO; } - (id)lookupUser:(NSString *)_key inContext:(id)_ctx { + NSLog (@"lookupUser: %@", _key); return [[[NSClassFromString(@"SOGoUserFolder") alloc] initWithName:_key inContainer:self] autorelease]; diff --git a/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh b/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh index e059ff06e..ff659da4c 100755 --- a/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh +++ b/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh @@ -54,11 +54,11 @@ INSERT INTO SOGo_folder_info ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, c_location, c_quick_location, c_folder_type ) VALUES - ( '/Users/${USER_ID}/Contacts/personal', + ( '/Users/${USER_ID}/Contacts', 'Users', '${USER_ID}', 'Contacts', - 'personal', + NULL, 'Contacts', 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts', 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_quick', diff --git a/SoObjects/Appointments/GNUmakefile b/SoObjects/Appointments/GNUmakefile index c69e92686..a4b3ccaa7 100644 --- a/SoObjects/Appointments/GNUmakefile +++ b/SoObjects/Appointments/GNUmakefile @@ -11,7 +11,6 @@ Appointments_PRINCIPAL_CLASS = SOGoAppointmentsProduct Appointments_OBJC_FILES = \ Product.m \ NSArray+Appointments.m \ - iCalEntityObject+Agenor.m \ \ SOGoAppointmentObject.m \ SOGoTaskObject.m \ diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 4de627a55..b94239206 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -29,10 +29,7 @@ #import #import #import - #import "SOGoAptMailNotification.h" -#import "iCalEntityObject+Agenor.h" - #import "common.h" #import "NSArray+Appointments.h" @@ -510,7 +507,6 @@ static NSString *mailTemplateDefaultLanguage = nil; - (NSException *)saveContentString:(NSString *)_iCalString { return [self saveContentString:_iCalString baseSequence:0]; } - - (NSException *)delete { return [self deleteWithBaseSequence:0]; } @@ -614,34 +610,6 @@ static NSString *mailTemplateDefaultLanguage = nil; return [self serverTimeZone]; } -- (NSException *) saveContentString: (NSString *) contentString - baseVersion: (unsigned int) baseVersion -{ - NSString *newContentString, *oldContentString; - iCalCalendar *eventCalendar; - iCalEvent *event; - NSArray *organizers; - - oldContentString = [self iCalString]; - if (oldContentString) - newContentString = contentString; - else - { - eventCalendar = [iCalCalendar parseSingleFromSource: contentString]; - event = [self firstEventFromCalendar: eventCalendar]; - organizers = [event childrenWithTag: @"organizer"]; - if ([organizers count]) - newContentString = contentString; - else - { - [event setOrganizerWithUid: [self ownerInContext: nil]]; - newContentString = [eventCalendar versitString]; - } - } - - return [super saveContentString: newContentString - baseVersion: baseVersion]; -} - (void)sendEMailUsingTemplateNamed:(NSString *)_pageName forOldAppointment:(iCalEvent *)_oldApt diff --git a/SoObjects/SOGo/SOGoAuthenticator.m b/SoObjects/SOGo/SOGoAuthenticator.m index 984da8e47..1c2d9073d 100644 --- a/SoObjects/SOGo/SOGoAuthenticator.m +++ b/SoObjects/SOGo/SOGoAuthenticator.m @@ -73,7 +73,6 @@ static SOGoAuthenticator *auth = nil; { BOOL result; - return YES; if ([authMethod isEqualToString: @"LDAP"]) result = [self LDAPCheckLogin: _login password: _pwd]; else diff --git a/UI/Scheduler/UIxCalMonthView.h b/UI/Scheduler/UIxCalMonthView.h index 992f89079..079f33274 100644 --- a/UI/Scheduler/UIxCalMonthView.h +++ b/UI/Scheduler/UIxCalMonthView.h @@ -13,10 +13,6 @@ @interface UIxCalMonthView : UIxCalView { - int dayIndex; - int dayOfWeek; - int weekOfYear; - NSCalendarDate *currentWeekStart; } - (NSCalendarDate *)startOfMonth; @@ -24,34 +20,6 @@ - (NSDictionary *)prevMonthQueryParameters; - (NSDictionary *)nextMonthQueryParameters; -- (void)setDayIndex:(int)_idx; -- (int)dayIndex; -- (void)setDayOfWeek:(int)_day; -- (int)dayOfWeek; - -- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date; -- (NSCalendarDate *)currentWeekStartDate; -- (void)setWeekOfYear:(int)_week; -- (int)weekOfYear; -- (int)year; -- (int)month; -- (NSString *)localizedDayOfWeekName; -- (NSDictionary *)currentWeekQueryParameters; - - -/* style sheet */ - - -- (NSString *)weekStyle; - -- (NSString *)contentStyle; - - -/* appointments */ - - -- (NSArray *)appointments; - @end #endif /* __SOGo_UIxCalMonthView_H__ */ diff --git a/UI/Scheduler/UIxCalMonthView.m b/UI/Scheduler/UIxCalMonthView.m index 316710362..a367ba9a0 100644 --- a/UI/Scheduler/UIxCalMonthView.m +++ b/UI/Scheduler/UIxCalMonthView.m @@ -1,28 +1,13 @@ // $Id: UIxCalMonthView.m 191 2004-08-12 16:28:32Z helge $ -#import -#import -#import -#import - -#import -#import - -#import - -#import - -#import "UIxCalMonthView.h" +#include +#include "UIxCalMonthView.h" +#include "common.h" @implementation UIxCalMonthView -- (void)dealloc { - [self->currentWeekStart release]; - [super dealloc]; -} - - (NSCalendarDate *)startOfMonth { - return [[[self selectedDate] firstDayOfMonth] beginOfDay]; + return [[[super startDate] firstDayOfMonth] beginOfDay]; } - (NSCalendarDate *)startDate { @@ -41,158 +26,20 @@ /* URLs */ -- (NSDictionary *) _monthQueryParametersWithOffset: (int) monthsOffset -{ +- (NSDictionary *)prevMonthQueryParameters { NSCalendarDate *date; - - date = [[self startOfMonth] dateByAddingYears: 0 months: monthsOffset days: 0 - hours:0 minutes:0 seconds:0]; + + date = [[self startOfMonth] dateByAddingYears:0 months:-1 days:0 + hours:0 minutes:0 seconds:0]; return [self queryParametersBySettingSelectedDate:date]; } -- (NSDictionary *) monthBeforePrevMonthQueryParameters -{ - return [self _monthQueryParametersWithOffset: -14]; -} - -- (NSDictionary *) prevMonthQueryParameters -{ - return [self _monthQueryParametersWithOffset: -7]; -} - -- (NSDictionary *) nextMonthQueryParameters -{ - return [self _monthQueryParametersWithOffset: 7]; -} - -- (NSDictionary *) monthAfterNextMonthQueryParameters -{ - return [self _monthQueryParametersWithOffset: 14]; -} - -- (NSString *) _monthNameWithOffsetFromThisMonth: (int) offset -{ +- (NSDictionary *)nextMonthQueryParameters { NSCalendarDate *date; - - date = [[self startOfMonth] dateByAddingYears: 0 months: offset days: 0 - hours:0 minutes:0 seconds:0]; - - return [self localizedNameForMonthOfYear: [date monthOfYear]]; -} - -- (NSString *) monthBeforeLastMonthName -{ - return [self _monthNameWithOffsetFromThisMonth: -2]; -} - -- (NSString *) lastMonthName -{ - return [self _monthNameWithOffsetFromThisMonth: -1]; -} - -- (NSString *) currentMonthName -{ - return [self _monthNameWithOffsetFromThisMonth: 0]; -} - -- (NSString *) nextMonthName -{ - return [self _monthNameWithOffsetFromThisMonth: 1]; -} - -- (NSString *) monthAfterNextMonthName -{ - return [self _monthNameWithOffsetFromThisMonth: 2]; -} - -- (void)configureFormatters { - [super configureFormatters]; - - [self->aptFormatter setShortTitleOnly]; - [self->privateAptFormatter setPrivateTitleOnly]; -} - -- (void)setDayIndex:(int)_idx { - self->dayIndex = _idx; -} - -- (int)dayIndex { - return self->dayIndex; -} - -- (void)setDayOfWeek:(int)_day { - self->dayOfWeek = _day; -} - -- (int)dayOfWeek { - return self->dayOfWeek; -} - -- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date { - ASSIGN(self->currentWeekStart, _date); -} - -- (NSCalendarDate *)currentWeekStartDate { - return self->currentWeekStart; -} - -- (void)setWeekOfYear:(int)_week { - NSCalendarDate *date; - self->weekOfYear = _week; - if(_week == 52 || _week == 53) - date = [[self startOfMonth] mondayOfWeek]; - else - date = [self startOfMonth]; - date = [date mondayOfWeek:_week]; - [self setCurrentWeekStartDate:date]; -} - -- (int)weekOfYear { - return self->weekOfYear; -} - -- (int)year { - return [[self startOfMonth] yearOfCommonEra]; -} - -- (int)month { - return [[self startOfMonth] monthOfYear]; -} - -- (NSString *)localizedDayOfWeekName { - return [self localizedNameForDayOfWeek:self->dayOfWeek]; -} - -- (NSDictionary *)currentWeekQueryParameters { - return [self queryParametersBySettingSelectedDate:self->currentWeekStart]; -} - - -/* style sheet */ - - -- (NSString *)weekStyle { - if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]]) - return @"monthoverview_week_hilite"; - return @"monthoverview_week"; -} - -- (NSString *)contentStyle { - if([self->currentDay isToday]) - return @"monthoverview_content_hilite"; - else if([self->currentDay monthOfYear] != [[self startOfMonth] monthOfYear]) - return @"monthoverview_content_dimmed"; - return @"monthoverview_content"; -} - - -/* appointments */ - - -- (NSArray *)appointments { - return [self fetchCoreAppointmentsInfos]; + date = [[self startOfMonth] dateByAddingYears:0 months:1 days:0 + hours:0 minutes:0 seconds:0]; + return [self queryParametersBySettingSelectedDate:date]; } @end /* UIxCalMonthView */ - diff --git a/UI/Templates/SchedulerUI/UIxCalMonthView.wox b/UI/Templates/SchedulerUI/UIxCalMonthView.wox index a32c3f5b0..b23a6f9ca 100644 --- a/UI/Templates/SchedulerUI/UIxCalMonthView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMonthView.wox @@ -1,49 +1,80 @@ + - - - - - - -
- -
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + +
+
+