Monotone-Parent: 3153e42cfafdd9f2a07623a78af07f4b4e837945
Monotone-Revision: 94cd3c2d69b764a47aa3032dde40735f50a696c9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-01-06T19:21:15 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
1169e642e7
commit
62433faf35
10
ChangeLog
10
ChangeLog
|
@ -1,5 +1,15 @@
|
||||||
2010-01-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-01-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* UI/Scheduler/UIxDatePicker.m
|
||||||
|
(-takeValuesFromRequest:inContext:): we set the new date to the
|
||||||
|
user's timezone and recompute the proper offset compare to the
|
||||||
|
system timezone, which may differ from it.
|
||||||
|
|
||||||
|
* SoObjects/Appointments/iCalEntityObject+SOGo.m
|
||||||
|
(-quickRecordDateAsNumber:withOffset:forAllDay:): we only need to
|
||||||
|
compute the delta between the user's timezone and UTC rather than
|
||||||
|
the system timezone.
|
||||||
|
|
||||||
* SoObjects/Mailer/SOGoMailNamespace.m
|
* SoObjects/Mailer/SOGoMailNamespace.m
|
||||||
(-lookupName:inContext:acquire:): overriden method because the
|
(-lookupName:inContext:acquire:): overriden method because the
|
||||||
namespace "folders" cannot be created and cannot contain messages.
|
namespace "folders" cannot be created and cannot contain messages.
|
||||||
|
|
|
@ -34,40 +34,16 @@
|
||||||
#import <NGObjWeb/WOApplication.h>
|
#import <NGObjWeb/WOApplication.h>
|
||||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
|
|
||||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
#import <SOGo/NSArray+Utilities.h>
|
||||||
#import <SoObjects/SOGo/SOGoUser.h>
|
#import <SOGo/SOGoUser.h>
|
||||||
#import <SoObjects/SOGo/SOGoUserDefaults.h>
|
#import <SOGo/SOGoUserDefaults.h>
|
||||||
|
|
||||||
#import "iCalPerson+SOGo.h"
|
#import "iCalPerson+SOGo.h"
|
||||||
|
|
||||||
#import "iCalEntityObject+SOGo.h"
|
#import "iCalEntityObject+SOGo.h"
|
||||||
|
|
||||||
static int utcOffset = -1;
|
|
||||||
|
|
||||||
@implementation iCalEntityObject (SOGoExtensions)
|
@implementation iCalEntityObject (SOGoExtensions)
|
||||||
|
|
||||||
static inline int
|
|
||||||
_computeAllDayOffset()
|
|
||||||
{
|
|
||||||
NSTimeZone *tz;
|
|
||||||
SOGoUser *user;
|
|
||||||
WOApplication *application;
|
|
||||||
int offset;
|
|
||||||
|
|
||||||
if (utcOffset == -1)
|
|
||||||
{
|
|
||||||
tz = [[NSCalendarDate date] timeZone];
|
|
||||||
utcOffset = [tz secondsFromGMT];
|
|
||||||
}
|
|
||||||
|
|
||||||
application = [WOApplication application];
|
|
||||||
user = [[application context] activeUser];
|
|
||||||
tz = [[user userDefaults] timeZone];
|
|
||||||
offset = utcOffset - [tz secondsFromGMT];
|
|
||||||
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void) initializeSOGoExtensions;
|
+ (void) initializeSOGoExtensions;
|
||||||
{
|
{
|
||||||
if (!iCalDistantFuture)
|
if (!iCalDistantFuture)
|
||||||
|
@ -228,7 +204,7 @@ _computeAllDayOffset()
|
||||||
{
|
{
|
||||||
seconds = [_date timeIntervalSince1970] + offset;
|
seconds = [_date timeIntervalSince1970] + offset;
|
||||||
if (allDay)
|
if (allDay)
|
||||||
seconds += _computeAllDayOffset ();
|
seconds += [[_date timeZone] secondsFromGMT];
|
||||||
|
|
||||||
dateNumber = [NSNumber numberWithInt: seconds];
|
dateNumber = [NSNumber numberWithInt: seconds];
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,15 @@
|
||||||
|
|
||||||
#import <Foundation/NSValue.h>
|
#import <Foundation/NSValue.h>
|
||||||
#import <Foundation/NSCalendarDate.h>
|
#import <Foundation/NSCalendarDate.h>
|
||||||
|
#import <Foundation/NSTimeZone.h>
|
||||||
|
|
||||||
#import <NGObjWeb/WOContext.h>
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
#import <NGObjWeb/WORequest.h>
|
#import <NGObjWeb/WORequest.h>
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
|
|
||||||
|
#import <SOGo/SOGoUser.h>
|
||||||
|
#import <SOGo/SOGoUserDefaults.h>
|
||||||
|
|
||||||
#import "UIxDatePicker.h"
|
#import "UIxDatePicker.h"
|
||||||
|
|
||||||
@implementation UIxDatePicker
|
@implementation UIxDatePicker
|
||||||
|
@ -144,6 +148,9 @@
|
||||||
{
|
{
|
||||||
NSString *dateString;
|
NSString *dateString;
|
||||||
NSCalendarDate *d;
|
NSCalendarDate *d;
|
||||||
|
NSInteger dateTZOffset, userTZOffset;
|
||||||
|
NSTimeZone *userTZ;
|
||||||
|
SOGoUserDefaults *ud;
|
||||||
|
|
||||||
dateString = [_rq formValueForKey:[self dateID]];
|
dateString = [_rq formValueForKey:[self dateID]];
|
||||||
if (dateString == nil) {
|
if (dateString == nil) {
|
||||||
|
@ -158,6 +165,18 @@
|
||||||
dateString];
|
dateString];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* we must adjust the date timezone because "dateWithString:..." uses the
|
||||||
|
system timezone, which can be different from the user's. */
|
||||||
|
ud = [[_ctx activeUser] userDefaults];
|
||||||
|
dateTZOffset = [[d timeZone] secondsFromGMT];
|
||||||
|
userTZ = [ud timeZone];
|
||||||
|
userTZOffset = [userTZ secondsFromGMT];
|
||||||
|
if (dateTZOffset != userTZOffset)
|
||||||
|
d = [d dateByAddingYears: 0 months: 0 days: 0
|
||||||
|
hours: 0 minutes: 0
|
||||||
|
seconds: (dateTZOffset - userTZOffset)];
|
||||||
|
[d setTimeZone: userTZ];
|
||||||
|
|
||||||
[self setDay: [NSNumber numberWithInt:[d dayOfMonth]]];
|
[self setDay: [NSNumber numberWithInt:[d dayOfMonth]]];
|
||||||
[self setMonth:[NSNumber numberWithInt:[d monthOfYear]]];
|
[self setMonth:[NSNumber numberWithInt:[d monthOfYear]]];
|
||||||
[self setYear: [NSNumber numberWithInt:[d yearOfCommonEra]]];
|
[self setYear: [NSNumber numberWithInt:[d yearOfCommonEra]]];
|
||||||
|
|
Loading…
Reference in New Issue