diff --git a/ChangeLog b/ChangeLog index 5a55de968..523c8becc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-09-08 Wolfgang Sourdeau + * UI/SOGoUI/UIxComponent.[hm]: removed the "viewTimeZone" ivar and + method. Removed the "backendTimeZone" method. + * UI/MainUI/SOGoUserHomePage.[hm]: made a subclass of UIxComponent instead of SoComponent. diff --git a/UI/SOGoUI/UIxComponent.h b/UI/SOGoUI/UIxComponent.h index c8a3911ba..c30d43432 100644 --- a/UI/SOGoUI/UIxComponent.h +++ b/UI/SOGoUI/UIxComponent.h @@ -22,7 +22,10 @@ #ifndef __UIxComponent_H_ #define __UIxComponent_H_ -#include +#import +#import + +#import /* UIxComponent @@ -37,7 +40,6 @@ @interface UIxComponent : SoComponent { NSMutableDictionary *queryParameters; - NSTimeZone *viewTimeZone; NSCalendarDate *_selectedDate; } @@ -62,8 +64,6 @@ - (NSString *)relativePathToUserFolderSubPath:(NSString *)_sub; /* date selection */ -- (NSTimeZone *)viewTimeZone; -- (NSTimeZone *)backendTimeZone; - (NSCalendarDate *)selectedDate; - (NSString *)dateStringForDate:(NSCalendarDate *)_date; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index e24e47d81..13ba53f23 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -23,6 +23,7 @@ #import "SOGoJSStringFormatter.h" #import "NSString+URL.h" #import "common.h" + #import #import @@ -37,8 +38,6 @@ @implementation UIxComponent -static NSTimeZone *GMT = nil; - static NSMutableArray *dayLabelKeys = nil; static NSMutableArray *abbrDayLabelKeys = nil; static NSMutableArray *monthLabelKeys = nil; @@ -59,9 +58,6 @@ static BOOL uixDebugEnabled = NO; uixDebugEnabled = [ud boolForKey:@"SOGoUIxDebugEnabled"]; - if (!GMT) - GMT = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain]; - if (dayLabelKeys == nil) { dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7]; [dayLabelKeys addObject:@"Sunday"]; @@ -115,7 +111,6 @@ static BOOL uixDebugEnabled = NO; { if ((self = [super init])) { - viewTimeZone = nil; _selectedDate = nil; } @@ -125,8 +120,6 @@ static BOOL uixDebugEnabled = NO; - (void) dealloc { [self->queryParameters release]; - if (viewTimeZone) - [viewTimeZone release]; if (_selectedDate) [_selectedDate release]; [super dealloc]; @@ -377,28 +370,6 @@ static BOOL uixDebugEnabled = NO; /* date */ -- (NSTimeZone *) viewTimeZone -{ - NSUserDefaults *userPrefs; - SOGoUser *currentUser; - - if (!viewTimeZone) - { - currentUser = [[self context] activeUser]; - userPrefs = [currentUser userDefaults]; - viewTimeZone = [NSTimeZone timeZoneWithName: - [userPrefs stringForKey: @"timezonename"]]; - [viewTimeZone retain]; - } - - return viewTimeZone; -} - -- (NSTimeZone *) backendTimeZone -{ - return GMT; -} - - (NSCalendarDate *) selectedDate { NSString *s, *dateString; @@ -410,7 +381,7 @@ static BOOL uixDebugEnabled = NO; s = [self queryParameterForKey: @"day"]; if ([s length] > 0) dateString = [s stringByAppendingFormat: @" %@", - [[self viewTimeZone] abbreviation]]; + [[[self clientObject] userTimeZone] abbreviation]]; else { cdate = [NSCalendarDate calendarDate]; @@ -418,7 +389,7 @@ static BOOL uixDebugEnabled = NO; [cdate yearOfCommonEra], [cdate monthOfYear], [cdate dayOfMonth], - [[self viewTimeZone] abbreviation]]; + [[[self clientObject] userTimeZone] abbreviation]]; } cdate = [NSCalendarDate dateWithString: dateString @@ -440,7 +411,7 @@ static BOOL uixDebugEnabled = NO; } - (NSString *)dateStringForDate:(NSCalendarDate *)_date { - [_date setTimeZone:[self viewTimeZone]]; + [_date setTimeZone: [[self clientObject] userTimeZone]]; return [_date descriptionWithCalendarFormat:@"%Y%m%d"]; }