From: znek Date: Mon, 19 Jul 2004 09:54:15 +0000 (+0000) Subject: fixes X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=208aafe95150a59345c5e61398a1af4870564db7;p=scalable-opengroupware.org fixes git-svn-id: http://svn.opengroupware.org/SOGo/trunk@144 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index c6230282..8345e43a 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,10 @@ +2004-07-07 Marcus Mueller + + * UIxCalWeekOverview.wox: minor correction + + * UIxAppointmentEditor.m: fixed handling in -saveAction:. Also, + added code to correctly convert dates into GMT upon storing. + 2004-07-15 Helge Hess * GNUmakefile.preamble: added proper include pathes to allow "inline" diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 2e6ed61d..156914d8 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -67,12 +67,18 @@ - (SOGoAppointment *)appointment; - (NSString *)iCalStringTemplate; - (NSString *)iCalString; -- (BOOL)isNewAppointment; @end @implementation UIxAppointmentEditor +static NSTimeZone *GMT = nil; + ++ (void)initialize { + if (GMT == nil) + GMT = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain]; +} + - (void)dealloc { [self->appointment release]; [self->participants release]; @@ -86,8 +92,8 @@ - (NSString *)formattedAptStartTime { NSCalendarDate *date; - date = [[self appointment] startDate]; - /* TODO: convert this into display timeZone! */ + date = [[[[self appointment] startDate] copy] autorelease]; + [date setTimeZone:[self viewTimeZone]]; return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"]; } @@ -244,16 +250,20 @@ /* save */ +/* returned dates are in GMT */ - (NSCalendarDate *)_dateFromString:(NSString *)_str { - _str = [_str stringByAppendingString:@" GMT"]; - return [NSCalendarDate dateWithString:_str - calendarFormat:@"%Y-%m-%d %H:%M %Z"]; + NSCalendarDate *date; + + date = [NSCalendarDate dateWithString:_str + calendarFormat:@"%Y-%m-%d %H:%M %Z"]; + [date setTimeZone:GMT]; + return date; } - (id)saveAction { SOGoAppointment *apt; NSString *iCalString; - NSString *summary, *location, *nextMethod, *uri, *uriFormat; + NSString *summary, *location, *uri, *uriFormat; NSCalendarDate *sd, *ed; NSArray *ps; unsigned i, count; @@ -311,13 +321,7 @@ /* receive current representation for save operation */ iCalString = [apt iCalString]; [apt release]; apt = nil; - - /* determine what's to do and where to go next */ - if([self isNewAppointment]) - nextMethod = @"duhduh"; - else - nextMethod = @"view"; - + #if 0 NSLog(@"%s new iCalString:\n%@", __PRETTY_FUNCTION__, iCalString); #else @@ -331,7 +335,7 @@ #endif uriFormat = [self uriAsFormat]; - uri = [NSString stringWithFormat:uriFormat, nextMethod]; + uri = [NSString stringWithFormat:uriFormat, @"view"]; r = [WOResponse responseWithRequest:req]; [r setStatus:302 /* moved */]; diff --git a/SOGo/UI/Scheduler/UIxCalWeekOverview.wox b/SOGo/UI/Scheduler/UIxCalWeekOverview.wox index e3cffd50..eea16c9e 100644 --- a/SOGo/UI/Scheduler/UIxCalWeekOverview.wox +++ b/SOGo/UI/Scheduler/UIxCalWeekOverview.wox @@ -146,12 +146,12 @@ + src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /> - +