mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-07 14:28:52 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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"];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user