Monotone-Parent: 5a0923ee4a53f0897396508265abec375d015ac6

Monotone-Revision: ef958228c2d8c66a13e333a92731c39034ca0b02

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-05-25T19:40:46
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau committed 2010-05-25 19:40:46 +00:00
1 parent eb3280e181
commit 9bbc19231d
4 files changed
+26 -36

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
2010-05-25 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2010-05-25 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAptMailNotification.m (+initialize):
removed obsolete method.
(-viewTZ, setViewTZ): idem.
(-setupValues): the "viewTZ" is now initialized from here, using
the active user's defaults.
* UI/WebServerResources/SchedulerUIDnD.js: * UI/WebServerResources/SchedulerUIDnD.js:
(SOGoEventDragEventCoordinates.setLocation) (SOGoEventDragEventCoordinates.setLocation)
(SOGoEventDragGhostController.setLocation): new self-explanatory (SOGoEventDragGhostController.setLocation): new self-explanatory
@@ -25,6 +25,7 @@
#import <Foundation/NSTimeZone.h> #import <Foundation/NSTimeZone.h>
#import <NGObjWeb/WOActionResults.h> #import <NGObjWeb/WOActionResults.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WOResponse.h> #import <NGObjWeb/WOResponse.h>
#import <NGExtensions/NSObject+Logs.h> #import <NGExtensions/NSObject+Logs.h>
#import <NGCards/iCalEvent.h> #import <NGCards/iCalEvent.h>
@@ -33,20 +34,14 @@
#import <SOGo/NSDictionary+Utilities.h> #import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/NSObject+Utilities.h> #import <SOGo/NSObject+Utilities.h>
#import <SOGo/NSString+Utilities.h> #import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import "iCalPerson+SOGo.h" #import "iCalPerson+SOGo.h"
#import "SOGoAptMailNotification.h" #import "SOGoAptMailNotification.h"
@implementation SOGoAptMailNotification @implementation SOGoAptMailNotification
static NSTimeZone *UTC = nil;
+ (void) initialize
{
if (!UTC)
UTC = [[NSTimeZone timeZoneWithAbbreviation: @"UTC"] retain];
}
- (id) init - (id) init
{ {
if ((self = [super init])) if ((self = [super init]))
@@ -100,22 +95,12 @@ static NSTimeZone *UTC = nil;
return ([[previousApt location] length] > 0); return ([[previousApt location] length] > 0);
} }
- (NSTimeZone *) viewTZ
{
if (viewTZ) return viewTZ;
return UTC;
}
- (void) setViewTZ: (NSTimeZone *) _viewTZ
{
ASSIGN (viewTZ, _viewTZ);
}
- (NSCalendarDate *) oldStartDate - (NSCalendarDate *) oldStartDate
{ {
if (!oldStartDate) if (!oldStartDate)
{ {
ASSIGN (oldStartDate, [[self previousApt] startDate]); ASSIGN (oldStartDate, [[self previousApt] startDate]);
[oldStartDate setTimeZone: [self viewTZ]]; [oldStartDate setTimeZone: viewTZ];
} }
return oldStartDate; return oldStartDate;
} }
@@ -125,7 +110,7 @@ static NSTimeZone *UTC = nil;
if (!newStartDate) if (!newStartDate)
{ {
ASSIGN (newStartDate, [[self apt] startDate]); ASSIGN (newStartDate, [[self apt] startDate]);
[newStartDate setTimeZone:[self viewTZ]]; [newStartDate setTimeZone: viewTZ];
} }
return newStartDate; return newStartDate;
} }
@@ -167,6 +152,11 @@ static NSTimeZone *UTC = nil;
{ {
NSDictionary *sentByValues; NSDictionary *sentByValues;
NSString *sentBy, *sentByText; NSString *sentBy, *sentByText;
SOGoUser *user;
user = [context activeUser];
viewTZ = [[user userDefaults] timeZone];
[viewTZ retain];
values = [NSMutableDictionary new]; values = [NSMutableDictionary new];
[values setObject: [self summary] forKey: @"Summary"]; [values setObject: [self summary] forKey: @"Summary"];
+1 -3
View File
@@ -131,13 +131,11 @@ static NSCharacterSet *wsSet = nil;
SOGoDateFormatter *formatter; SOGoDateFormatter *formatter;
NSCalendarDate *tzDate; NSCalendarDate *tzDate;
SOGoUser *currentUser; SOGoUser *currentUser;
SOGoUserDefaults *ud;
currentUser = [context activeUser]; currentUser = [context activeUser];
ud = [currentUser userDefaults];
tzDate = [date copy]; tzDate = [date copy];
[tzDate setTimeZone: [ud timeZone]]; [tzDate setTimeZone: viewTZ];
[tzDate autorelease]; [tzDate autorelease];
formatter = [currentUser dateFormatterInContext: context]; formatter = [currentUser dateFormatterInContext: context];
+9 -13
View File
@@ -29,7 +29,6 @@
#import <SOGo/NSObject+Utilities.h> #import <SOGo/NSObject+Utilities.h>
#import <SOGo/SOGoDateFormatter.h> #import <SOGo/SOGoDateFormatter.h>
#import <SOGo/SOGoUser.h> #import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import "SOGoAptMailNotification.h" #import "SOGoAptMailNotification.h"
@@ -39,12 +38,11 @@
@implementation SOGoAptMailUpdate @implementation SOGoAptMailUpdate
- (NSString *) valueForProperty: (NSString *) property - (NSString *) valueForProperty: (NSString *) property
withDateFormatter: (SOGoDateFormatter *) dateFormatter
{ {
static NSDictionary *valueTypes = nil; static NSDictionary *valueTypes = nil;
NSString *valueType; NSString *valueType;
id value; id value;
SOGoUser *user;
NSTimeZone *userTZ;
if (!valueTypes) if (!valueTypes)
{ {
@@ -65,11 +63,8 @@
value = [(iCalEvent *) apt propertyValue: property]; value = [(iCalEvent *) apt propertyValue: property];
if ([valueType isEqualToString: @"date"]) if ([valueType isEqualToString: @"date"])
{ {
user = [context activeUser]; [value setTimeZone: viewTZ];
userTZ = [[user userDefaults] timeZone]; value = [dateFormatter formattedDateAndTime: value];
[value setTimeZone: userTZ];
value = [[user dateFormatterInContext: context]
formattedDateAndTime: value];
} }
} }
else else
@@ -78,7 +73,7 @@
return value; return value;
} }
- (void) _setupBodyContent - (void) _setupBodyContentWithFormatter: (SOGoDateFormatter *) dateFormatter
{ {
NSArray *updatedProperties; NSArray *updatedProperties;
NSMutableString *bodyContent; NSMutableString *bodyContent;
@@ -93,7 +88,8 @@
for (count = 0; count < max; count++) for (count = 0; count < max; count++)
{ {
property = [updatedProperties objectAtIndex: count]; property = [updatedProperties objectAtIndex: count];
value = [self valueForProperty: property]; value = [self valueForProperty: property
withDateFormatter: dateFormatter];
/* Unhandled properties will return nil */ /* Unhandled properties will return nil */
if (value) if (value)
{ {
@@ -107,7 +103,7 @@
[bodyContent release]; [bodyContent release];
} }
- (void) _setupBodyValues - (void) _setupBodyValuesWithFormatter: (SOGoDateFormatter *) dateFormatter
{ {
NSString *bodyText; NSString *bodyText;
@@ -116,7 +112,7 @@
inContext: context]; inContext: context];
[values setObject: [values keysWithFormat: bodyText] [values setObject: [values keysWithFormat: bodyText]
forKey: @"_bodyStart"]; forKey: @"_bodyStart"];
[self _setupBodyContent]; [self _setupBodyContentWithFormatter: dateFormatter];
[values setObject: [self labelForKey: @"Please accept" [values setObject: [self labelForKey: @"Please accept"
@" or decline those changes." @" or decline those changes."
inContext: context] inContext: context]
@@ -144,7 +140,7 @@
[values setObject: [dateFormatter formattedTime: date] [values setObject: [dateFormatter formattedTime: date]
forKey: @"StartTime"]; forKey: @"StartTime"];
[self _setupBodyValues]; [self _setupBodyValuesWithFormatter: dateFormatter];
} }
- (NSString *) getSubject - (NSString *) getSubject