Monotone-Parent: 820b27e801f0d5e9a95d74d782342e33456b3b4d

Monotone-Revision: c818bd7fb6cf31cc71d77656fd51138b3237c073

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-09-08T15:26:46
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-09-08 15:26:46 +00:00
parent 6b74ac5941
commit 7b1cd90d5b
3 changed files with 11 additions and 37 deletions

View File

@@ -1,5 +1,8 @@
2006-09-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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.

View File

@@ -22,7 +22,10 @@
#ifndef __UIxComponent_H_
#define __UIxComponent_H_
#include <NGObjWeb/SoComponent.h>
#import <NGObjWeb/SoComponent.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoObject.h>
/*
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;

View File

@@ -23,6 +23,7 @@
#import "SOGoJSStringFormatter.h"
#import "NSString+URL.h"
#import "common.h"
#import <NGObjWeb/SoHTTPAuthenticator.h>
#import <NGObjWeb/WOResourceManager.h>
@@ -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"];
}