From f28a25cb70c736f32ebfd07f4a26a17ff2db8a14 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 4 Oct 2006 23:15:25 +0000 Subject: [PATCH] Monotone-Parent: b0ba815a88a1243ad497187fab3660f3ebef9f27 Monotone-Revision: 7e4012769b937d5a36d8043bf2b2b1392a61a376 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-04T23:15:25 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/UIxAppointmentEditor.m | 54 +++++++------------ UI/Scheduler/UIxCalDateSelector.m | 2 +- UI/Scheduler/UIxCalInlineMonthOverview.m | 2 +- UI/Scheduler/UIxCalView.h | 1 - UI/Scheduler/UIxCalView.m | 18 +++---- UI/Scheduler/UIxTimeDateControl.m | 30 ++++++----- .../SchedulerUI/UIxAppointmentEditor.wox | 2 +- 7 files changed, 50 insertions(+), 59 deletions(-) diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 54c1277a6..dd6e6ad73 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -20,7 +20,9 @@ */ #import +#import +#import #import /* TODO: CLEAN UP */ @@ -97,10 +99,6 @@ #import #import "UIxComponent+Agenor.h" -@interface NSDate(UsedPrivates) -- (NSString *)icalString; // TODO: this is in NGCards -@end - @implementation UIxAppointmentEditor + (int)version { @@ -521,9 +519,9 @@ s = [self iCalParticipantsAndResourcesStringFromQueryParameters]; template = [NSString stringWithFormat:iCalStringTemplate, [[self clientObject] nameInContainer], - [[NSCalendarDate date] icalString], - [lStartDate icalString], - [lEndDate icalString], + [[NSCalendarDate date] iCalFormattedString], + [lStartDate iCalFormattedString], + [lEndDate iCalFormattedString], [self transparency], [self iCalOrganizerString], s]; @@ -685,15 +683,6 @@ /* save */ /* returned dates are in GMT */ -- (NSCalendarDate *)_dateFromString:(NSString *)_str { - NSCalendarDate *date; - - date = [NSCalendarDate dateWithString:_str - calendarFormat:@"%Y-%m-%d %H:%M %Z"]; - [date setTimeZone:[[self clientObject] serverTimeZone]]; - return date; -} - - (NSArray *)getICalPersonsFromFormValues:(NSArray *)_values treatAsResource:(BOOL)_isResource { @@ -764,16 +753,23 @@ { NSString *s; iCalRecurrenceRule *rrule; + NSTimeZone *uTZ; - if ((startDate = [[_appointment startDate] copy]) == nil) - startDate = [[[NSCalendarDate date] hour:11 minute:0] copy]; - if ((endDate = [[_appointment endDate] copy]) == nil) { + if ((startDate = [_appointment startDate]) == nil) + startDate = [[NSCalendarDate date] hour:11 minute:0]; + if ((endDate = [_appointment endDate]) == nil) { endDate = - [[startDate hour:[startDate hourOfDay] + 1 minute:0] copy]; + [startDate hour:[startDate hourOfDay] + 1 minute:0]; } - [startDate setTimeZone:[[self clientObject] userTimeZone]]; - [endDate setTimeZone:[[self clientObject] userTimeZone]]; - + + uTZ = [[self clientObject] userTimeZone]; + [startDate setTimeZone: uTZ]; + [endDate setTimeZone: uTZ]; +// startDate = [startDate adjustedDate]; +// endDate = [endDate adjustedDate]; + [startDate retain]; + [endDate retain]; + title = [[_appointment summary] copy]; location = [[_appointment location] copy]; comment = [[_appointment comment] copy]; @@ -854,11 +850,6 @@ return appointment; } -- (void) loadValuesFromICalString: (NSString *) _iCalString -{ - [self loadValuesFromAppointment: [self appointmentFromString: _iCalString]]; -} - /* contact editor compatibility */ - (void)setContentString:(NSString *)_s { @@ -868,11 +859,6 @@ return [self iCalStringTemplate]; } -- (void)loadValuesFromContentString:(NSString *)_s { - [self loadValuesFromICalString:_s]; -} - - /* access */ - (BOOL) isMyApt @@ -982,7 +968,7 @@ ical = [self contentStringTemplate]; [self setContentString:ical]; - [self loadValuesFromContentString:ical]; + [self loadValuesFromAppointment: [self appointmentFromString: ical]]; if (![self canEditApt]) { /* TODO: we need proper ACLs */ diff --git a/UI/Scheduler/UIxCalDateSelector.m b/UI/Scheduler/UIxCalDateSelector.m index e61fe536c..6ab548c85 100644 --- a/UI/Scheduler/UIxCalDateSelector.m +++ b/UI/Scheduler/UIxCalDateSelector.m @@ -22,7 +22,7 @@ #import -#import "NSCalendarDate+Scheduler.h" +#import #import "UIxCalDateSelector.h" diff --git a/UI/Scheduler/UIxCalInlineMonthOverview.m b/UI/Scheduler/UIxCalInlineMonthOverview.m index 87d11a8ec..d8484ffd9 100644 --- a/UI/Scheduler/UIxCalInlineMonthOverview.m +++ b/UI/Scheduler/UIxCalInlineMonthOverview.m @@ -23,7 +23,7 @@ #import -#import "NSCalendarDate+Scheduler.h" +#import #import "UIxCalInlineMonthOverview.h" diff --git a/UI/Scheduler/UIxCalView.h b/UI/Scheduler/UIxCalView.h index 2eae70fcb..1dec65cc1 100644 --- a/UI/Scheduler/UIxCalView.h +++ b/UI/Scheduler/UIxCalView.h @@ -63,7 +63,6 @@ - (id)holidayInfo; - /* related to current day */ - (void)setCurrentDay:(NSCalendarDate *)_day; - (NSCalendarDate *)currentDay; diff --git a/UI/Scheduler/UIxCalView.m b/UI/Scheduler/UIxCalView.m index 3b812323d..7f30644ab 100644 --- a/UI/Scheduler/UIxCalView.m +++ b/UI/Scheduler/UIxCalView.m @@ -1,14 +1,14 @@ // $Id: UIxCalView.m 885 2005-07-21 16:41:34Z znek $ -#include "UIxCalView.h" -#include "common.h" -//#include -#include "SoObjects/Appointments/SOGoAppointmentFolder.h" -#include -#include -#include -#include -#include "UIxComponent+Agenor.h" +#import "UIxCalView.h" +#import "common.h" +//#import +#import "SoObjects/Appointments/SOGoAppointmentFolder.h" +#import +#import +#import +#import +#import "UIxComponent+Agenor.h" @interface UIxCalView (PrivateAPI) - (NSString *) _userFolderURI; diff --git a/UI/Scheduler/UIxTimeDateControl.m b/UI/Scheduler/UIxTimeDateControl.m index 6cac3c0d3..6191b9586 100644 --- a/UI/Scheduler/UIxTimeDateControl.m +++ b/UI/Scheduler/UIxTimeDateControl.m @@ -20,7 +20,13 @@ */ // $Id: UIxTimeDateControl.m 601 2005-02-22 15:45:03Z znek $ -#import "common.h" +#import +#import +#import + +#import + +#import #import "UIxTimeDateControl.h" @@ -64,7 +70,11 @@ - (void)setDate:(NSCalendarDate *)_date { if (!_date) _date = [NSCalendarDate date]; - [self _setDate:_date]; + [self _setDate: [_date driftedDate]]; + + NSLog (@"date Hour, before: %d; after: %d (tz: %@)", + [_date hourOfDay], [[_date driftedDate] hourOfDay], + [[_date timeZone] timeZoneName]); [self setHour:[NSNumber numberWithInt:[_date hourOfDay]]]; [self setMinute:[NSNumber numberWithInt:[_date minuteOfHour]]]; [self setYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]]; @@ -241,20 +251,16 @@ [self setHour: [_rq formValueForKey: [self hourSelectId]]]; [self setMinute: [_rq formValueForKey: [self minuteSelectId]]]; - _month = [[self month] intValue]; - _day = [[self day] intValue]; - _hour = [[self hour] intValue]; + _month = [[self month] intValue]; + _day = [[self day] intValue]; + _hour = [[self hour] intValue]; _minute = [[self minute] intValue]; _second = [[self second] intValue]; - d = [NSCalendarDate dateWithYear:_year - month:_month - day:_day - hour:_hour - minute:_minute - second:_second + d = [NSCalendarDate dateWithYear: _year month:_month day:_day + hour:_hour minute:_minute second:_second timeZone: [[self clientObject] userTimeZone]]; - [self _setDate:d]; + [self _setDate: [d adjustedDate]]; } } diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox index 10cc86c1e..2883b9032 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox @@ -42,7 +42,7 @@