]> err.no Git - scalable-opengroupware.org/commitdiff
fixes
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 19 Jul 2004 09:54:15 +0000 (09:54 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 19 Jul 2004 09:54:15 +0000 (09:54 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@144 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxCalWeekOverview.wox

index c6230282346fc53fb58fb61ddb9fd722fc3a56ea..8345e43a3413f4ba16d38ef38ce0ab76b9770543 100644 (file)
@@ -1,3 +1,10 @@
+2004-07-07  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * 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  <helge.hess@opengroupware.org>
 
        * GNUmakefile.preamble: added proper include pathes to allow "inline"
index 2e6ed61de0129c84c0c4e4d2ad6d9add452e680b..156914d828d12b187fc550f96023f15cc7cfb733 100644 (file)
 - (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"];
 }
 
 
 /* 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;
   /* 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
 #endif
   
   uriFormat = [self uriAsFormat];
-  uri = [NSString stringWithFormat:uriFormat, nextMethod];
+  uri = [NSString stringWithFormat:uriFormat, @"view"];
 
   r = [WOResponse responseWithRequest:req];
   [r setStatus:302 /* moved */];
index e3cffd508faa2ffb4c6b922d8a5ed65d357fa7d0..eea16c9e1b757f37c2de9c60ed02368c0face0e5 100644 (file)
   <td align="left" width="10"><var:entity const:name="nbsp"/></td>
   <td align="right"><img 
      border="0" alt="" 
-     src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif"/></td>
+     src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /></td>
   </tr>
   <tr>
   <td colspan="2" bgcolor="#F5F5E9">
   <table border="0" width="100%" cellpadding="10" cellspacing="0">
-  <tr/>
+  <tr />
   </table>
   </td>
   </tr>