]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@240 d1b88da0-ebda-0310-925b-ed51d...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 21:49:40 +0000 (21:49 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 21:49:40 +0000 (21:49 +0000)
SOGo/UI/Anais/AnaisAttendeeSelector.m
SOGo/UI/Anais/ChangeLog
SOGo/UI/Anais/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxDatePicker.m
SOGo/UI/Scheduler/UIxTimeDateControl.m
SOGo/UI/Scheduler/UIxTimeDateControl.wox
SOGo/UI/Scheduler/UIxTimeSelector.m
SOGo/UI/Scheduler/UIxTimeSelector.wox
SOGo/UI/Scheduler/Version

index 4eba737dfce6b7dbbd30333f8c4af2a2add7d1a9..dc7e2bcd3a2dde1aedaaf92a2b3dd7579948a488 100644 (file)
 
 @implementation AnaisAttendeeSelector
 
+static BOOL debugOn = NO;
+
++ (void)initialize {
+  NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+  
+  debugOn = [ud boolForKey:@"AnaisDebugEnabled"];
+}
+
 - (void)dealloc {
   [self->role         release];
   [self->emailForUser release];
   return ms;
 }
 
+/* debugging */
+
+- (BOOL)isDebuggingEnabled {
+  return debugOn;
+}
+
 @end /* AnaisAttendeeSelector */
index c04f8f8680d4eb7dacf8d546436d3c25ace214c9..a3ebc9ad318b93846c513447292d6099d2cbf977 100644 (file)
@@ -1,5 +1,8 @@
 2004-08-15  Helge Hess  <helge.hess@skyrix.com>
 
+       * AnaisAttendeeSelector.m: added AnaisDebugEnabled default to 
+         enable/disable debug logs (v0.9.8)
+
        * AnaisAttendeeSelector.m: added form processing code (v0.9.7)
 
        * AnaisAttendeeSelector.m: added support for default attendees (as used
index 29a2806a15987fcf9d3c07ee32fc016e465bec4b..3a77a23497b429d2c92362a758ddd2e36a551fa4 100644 (file)
@@ -1,3 +1,3 @@
 # $Id: Version 165 2004-08-05 17:55:50Z znek $
 
-SUBMINOR_VERSION:=7
+SUBMINOR_VERSION:=8
index 85b7f060031a80e68e52eb9676b453db295632fe..60b83586fe879e07357e3e75d5e1246abe1755e7 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-15  Helge Hess  <helge.hess@skyrix.com>
+
+       * fixed time field controls (v0.9.50)
+
 2004-08-15  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.49
index 24528c6be29d51adf0141f78edc82e3db944655e..68514c1019b50bb33e9b0c4bd44a35e18fff6832 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  Copyright (C) 2000-2004 SKYRIX Software AG
+  Copyright (C) 2004 SKYRIX Software AG
 
-  This file is part of OGo
+  This file is part of OpenGroupware.org.
 
   OGo is free software; you can redistribute it and/or modify it under
   the terms of the GNU Lesser General Public License as published by the
 */
 // $Id$
 
+#include <NGObjWeb/WOComponent.h>
 
-#include <NGObjWeb/NGObjWeb.h>
-
+@class NSString, NSCalendarDate;
 
 @interface UIxDatePicker : WOComponent
 {
-    NSString *dateID;
-    NSCalendarDate *date;
-    NSString *label;
+  NSString       *dateID;
+  NSCalendarDate *date;
+  NSString       *label;
 }
 
 - (NSString *)dateID;
     
 @end
 
+#include "common.h"
+
 @implementation UIxDatePicker
 
 - (void)dealloc {
-    [self->dateID release];
-    [self->date release];
-    [self->label release];
-    [super dealloc];
+  [self->dateID release];
+  [self->date   release];
+  [self->label  release];
+  [super dealloc];
 }
 
 /* Accessors */
 
 - (void)setDateID:(NSString *)_dateID {
-    ASSIGN(self->dateID, _dateID);
+  ASSIGNCOPY(self->dateID, _dateID);
 }
 - (NSString *)dateID {
-    return self->dateID;
+  return self->dateID;
 }
 
 - (void)setDate:(NSCalendarDate *)_date {
-    ASSIGN(self->date, _date);
+  ASSIGN(self->date, _date);
 }
 - (NSCalendarDate *)date {
-    return self->date;
+  if (self->date == nil) /* HACK, return 'now' */
+    return [NSCalendarDate date];
+  return self->date;
 }
 
 - (void)setLabel:(NSString *)_label {
-    ASSIGN(self->label, _label);
+  ASSIGNCOPY(self->label, _label);
 }
 - (NSString *)label {
-    return self->label;
+  return self->label;
 }
 
 - (NSString *)formattedDateString {
-    return [date descriptionWithCalendarFormat:@"%Y-%m-%d"];
+  return [[self date] descriptionWithCalendarFormat:@"%Y-%m-%d"];
 }
 
 - (NSString *)dateFormat {
-    return @"yyyy-mm-dd";
+  return @"yyyy-mm-dd";
 }
 
 - (NSString *)calendarPageURL {
-    WOResourceManager *rm;
-    WOContext *ctx;
-    NSArray *languages;
+  WOResourceManager *rm;
+  WOContext *ctx;
+  NSArray   *languages;
 
-    if ((rm = [self resourceManager]) == nil)
-        rm = [[WOApplication application] resourceManager];
-    if (rm == nil)
-        [self debugWithFormat:@"WARNING: missing resource manager!"];
+  if ((rm = [self resourceManager]) == nil)
+    rm = [[WOApplication application] resourceManager];
+  if (rm == nil)
+    [self debugWithFormat:@"WARNING: missing resource manager!"];
 
-    /* lookup languages */
+  /* lookup languages */
     
-    ctx = [self context];
+  ctx = [self context];
 #if 0
-    languages = [ctx hasSession]
+  languages = [ctx hasSession]
         ? [[ctx session] languages]
         : [[ctx request] browserLanguages];
 #else
 #warning !! FIX SoProduct to enable localizable resource, then disable this!
-    languages = nil;
+  languages = nil;
 #endif
     
-    return [rm urlForResourceNamed:@"skycalendar.html"
-               inFramework:nil
-               languages:languages
-               request:[ctx request]];
+  return [rm urlForResourceNamed:@"skycalendar.html"
+            inFramework:nil
+            languages:languages
+            request:[ctx request]];
 }
 
 /* JavaScript */
 
 - (NSString *)jsPopup {
-    return [NSString stringWithFormat:@"javascript:calendar_%@.popup()",
+  return [NSString stringWithFormat:@"javascript:calendar_%@.popup()",
         [self dateID]];
 }
 
 - (NSString *)jsCode {
-    static NSString *code = \
+  static NSString *code = \
     @"var calendar_%@ = new skycalendar(document.getElementById('%@'));\n"
     @"calendar_%@.setCalendarPage('%@');\n"
     @"calendar_%@.setDateFormat('%@');\n";
 
-    return [NSString stringWithFormat:code,
+  return [NSString stringWithFormat:code,
         self->dateID,
         self->dateID,
         self->dateID,
 /* action */
 
 - (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
-#if 0
-    NSString *dateString;
-    NSCalendarDate *d;
-
-    dateString = [_rq formValueForKey:[self dateID]];
-    if(!dateString)
-        return;
-
-    d = [NSCalendarDate dateWithString:dateString calendarFormat:@"%Y-%m-%d"];
-    if(!d)
-        NSLog(@"WARNING: Couldn't parse dateString '%@'", dateString);
-    NSLog(@"%s setting date:%@",
-          __PRETTY_FUNCTION__,
-          d);
-    [self setDate:d];
-#endif
+  NSString       *dateString;
+  NSCalendarDate *d;
+
+  dateString = [_rq formValueForKey:[self dateID]];
+  if (dateString == nil) {
+    [self debugWithFormat:@"got no date string!"];
+    return;
+  }
+  
+  d = [NSCalendarDate dateWithString:dateString calendarFormat:@"%Y-%m-%d"];
+  if (d == nil)
+    [self logWithFormat:@"WARNING: Could not parse dateString: '%@'", 
+         dateString];
+  [self logWithFormat:@"%s setting date: %@", __PRETTY_FUNCTION__, d];
+  [self setDate:d];
 }
 
-@end
+@end /* UIxDatePicker */
index 9568283f175d5282a88c933bfd8d8b520d55cc14..0dbbafd88e5b14c4842eb8bc74f9f8b6df7dc7fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  Copyright (C) 2000-2004 SKYRIX Software AG
+  Copyright (C) 2004 SKYRIX Software AG
 
-  This file is part of OGo
+  This file is part of OpenGroupware.org.
 
   OGo is free software; you can redistribute it and/or modify it under
   the terms of the GNU Lesser General Public License as published by the
 */
 // $Id$
 
-
 #include <NGObjWeb/NGObjWeb.h>
 
-
 @interface UIxTimeDateControl : WOComponent
 {
-    NSString *controlID;
-    NSCalendarDate *date;
-    NSString *label;
+  NSString       *controlID;
+  NSCalendarDate *date;
+  NSString       *label;
 
-    NSCalendarDate *timeComponent;
-    NSCalendarDate *dateComponent;
+  NSCalendarDate *timeComponent;
+  NSCalendarDate *dateComponent;
 }
 
 - (NSString *)timeID;
 @implementation UIxTimeDateControl
 
 - (void)dealloc {
-    [self->controlID release];
-    [self->date release];
-    [self->label release];
-    [self->timeComponent release];
-    [self->dateComponent release];
-    [super dealloc];
+  [self->controlID     release];
+  [self->date          release];
+  [self->label         release];
+  [self->timeComponent release];
+  [self->dateComponent release];
+  [super dealloc];
 }
 
+/* accessors */
+
 - (void)setControlID:(NSString *)_controlID {
-    ASSIGNCOPY(self->controlID, _controlID);
+  ASSIGNCOPY(self->controlID, _controlID);
 }
 - (NSString *)controlID {
-    return self->controlID;
+  return self->controlID;
 }
 - (void)setDate:(NSCalendarDate *)_date {
-    ASSIGN(self->date, _date);
-    [self setTimeComponent:_date];
-    [self setDateComponent:_date];
+  ASSIGN(self->date, _date);
+  [self setTimeComponent:_date];
+  [self setDateComponent:_date];
 }
 - (NSCalendarDate *)date {
-    return self->date;
+  return self->date;
 }
 - (void)setLabel:(NSString *)_label {
-    ASSIGNCOPY(self->label, _label);
+  ASSIGNCOPY(self->label, _label);
 }
 - (NSString *)label {
-    return self->label;
+  return self->label;
 }
 
 - (void)setTimeComponent:(NSCalendarDate *)_timeComponent {
-    ASSIGN(self->timeComponent, _timeComponent);
+  ASSIGN(self->timeComponent, _timeComponent);
 }
 - (NSCalendarDate *)timeComponent {
-    return self->timeComponent;
+  return self->timeComponent;
 }
 
 - (void)setDateComponent:(NSCalendarDate *)_dateComponent {
-    ASSIGN(self->dateComponent, _dateComponent);
+  ASSIGN(self->dateComponent, _dateComponent);
 }
 - (NSCalendarDate *)dateComponent {
-    return self->dateComponent;
+  return self->dateComponent;
 }
 
 - (NSString *)timeID {
-    return [NSString stringWithFormat:@"%@_time",
-        [self controlID]];
+  return [[self controlID] stringByAppendingString:@"_time"];
 }
-
 - (NSString *)dateID {
-    return [NSString stringWithFormat:@"%@_date",
-        [self controlID]];
+  return [[self controlID] stringByAppendingString:@"_date"];
 }
 
-/* action */
+/* processing request */
 
 - (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
-    NSCalendarDate *d;
-
-    d = [[self dateComponent] hour:[[self timeComponent] hourOfDay]
-                            minute:[[self timeComponent] minuteOfHour]];
-    if(!d)
-        return;
-
-    NSLog(@"%s newDate:%@",
-          __PRETTY_FUNCTION__,
-          d);
-    [self setDate:d];
+  NSCalendarDate *d;
+  
+  /* call super, so that the form values are applied on the popups */
+  [super takeValuesFromRequest:_rq inContext:_ctx];
+  
+  d = [self dateComponent];
+  [self logWithFormat:@"base date: %@", d];
+  
+  d = [d  hour:[[self timeComponent] hourOfDay]
+         minute:[[self timeComponent] minuteOfHour]];
+  [self logWithFormat:@"%s newDate:%@",
+       __PRETTY_FUNCTION__,
+       d];
+  
+  if (d == nil)
+    return;
+  [self setDate:d];
 }
 
-@end
+@end /* UIxTimeDateControl */
index e3c70b98faeabc429effc01258c2dc740030d3c4..3d52f3b03c8ae54f5904359b9240a9a7f60dbb82 100644 (file)
@@ -1,17 +1,13 @@
 <?xml version='1.0' standalone='yes'?>
-
+<!-- $Id$ -->
 <span xmlns="http://www.w3.org/1999/xhtml"
       xmlns:var="http://www.skyrix.com/od/binding"
       xmlns:const="http://www.skyrix.com/od/constant"
       xmlns:rsrc="OGo:url"
 >
-  <var:component className="UIxTimeSelector"
-                 timeID="timeID"
-                 date="time"
-   />
-  <var:component className="UIxDatePicker"
-                 dateID="dateID"
-                 date="date"
-                 label="label"
-  />
-</span>
\ No newline at end of file
+  <var:component className="UIxTimeSelector" timeID="timeID" 
+                 date="timeComponent" />
+  <var:component className="UIxDatePicker"   dateID="dateID" 
+                 date="dateComponent"
+                 label="label" />
+</span>
index dcba8fe6c05aaf58537b911209c6a97544601d0a..a558990e3b31a6a57ad6183d86844905340fe6ba 100644 (file)
@@ -1,7 +1,7 @@
 /*
-  Copyright (C) 2000-2004 SKYRIX Software AG
+  Copyright (C) 2004 SKYRIX Software AG
 
-  This file is part of OGo
+  This file is part of OpenGroupware.org.
 
   OGo is free software; you can redistribute it and/or modify it under
   the terms of the GNU Lesser General Public License as published by the
 */
 // $Id$
 
+#include <NGObjWeb/WOComponent.h>
 
-#include <NGObjWeb/NGObjWeb.h>
-
+@class NSString, NSCalendarDate, NSArray;
 
 @interface UIxTimeSelector : WOComponent
 {
-    NSString *timeID;
-    NSCalendarDate *date;
-    BOOL combined;
-    NSString *minuteInterval;
-    id item;
-    NSArray *hours, *minutes;
+  NSString       *timeID;
+  NSCalendarDate *date;
+  BOOL           combined;
+  NSString       *minuteInterval;
+  id             item;
+  NSArray        *hours, *minutes;
 }
 
 - (NSArray *)hours;
 @implementation UIxTimeSelector
 
 - (void)dealloc {
-    [self->timeID release];
-    [self->date release];
-    [self->minuteInterval release];
-    [self->item release];
-    [self->hours release];
-    [self->minutes release];
-    [super dealloc];
+  [self->timeID         release];
+  [self->date           release];
+  [self->minuteInterval release];
+  [self->item           release];
+  [self->hours          release];
+  [self->minutes        release];
+  [super dealloc];
 }
 
 /* accessors */
 
 - (void)setTimeID:(NSString *)_timeID {
-    ASSIGNCOPY(self->timeID, _timeID);
+  ASSIGNCOPY(self->timeID, _timeID);
 }
 - (NSString *)timeID {
-    return self->timeID;
+  return self->timeID;
 }
 
 - (void)setDate:(NSCalendarDate *)_date {
-    ASSIGN(self->date, _date);
+  ASSIGN(self->date, _date);
 }
 - (NSCalendarDate *)date {
-    return self->date;
+  if (self->date == nil) /* HACK, return 'now' */
+    return [NSCalendarDate date];
+  return self->date;
 }
 
 - (void)setMinuteInterval:(NSString *)_minuteInterval {
-    ASSIGNCOPY(self->minuteInterval, _minuteInterval);
+  ASSIGNCOPY(self->minuteInterval, _minuteInterval);
 }
 - (NSString *)minuteInterval {
-    if(self->minuteInterval == nil)
-        return @"1";
-    return self->minuteInterval;
+  if(self->minuteInterval == nil)
+    return @"1";
+  return self->minuteInterval;
 }
 
 - (void)setItem:(id)_item {
-    ASSIGN(self->item, _item);
+  ASSIGN(self->item, _item);
 }
 - (id)item {
-    return self->item;
+  return self->item;
 }
 
 - (NSString *)hoursName {
-    return [NSString stringWithFormat:@"%@_hours",
-        [self timeID]];
+  return [[self timeID] stringByAppendingString:@"_hours"];
 }
 
 - (NSString *)minutesName {
-    return [NSString stringWithFormat:@"%@_minutes",
-        [self timeID]];
+  return [[self timeID] stringByAppendingString:@"_minutes"];
 }
 
 - (NSArray *)hours {
-    if(self->hours == nil) {
-        NSMutableArray *values;
-        unsigned i, count;
-        
-        count = 24;
-        values = [NSMutableArray arrayWithCapacity:count];
-        for(i = 0; i < count; i++) {
-            [values addObject:[NSNumber numberWithInt:i]];
-        }
-        self->hours = [values retain];
-    }
+  NSMutableArray *values;
+  unsigned i, count;
+  
+  if (self->hours)
     return self->hours;
+        
+  count = 24;
+  values = [NSMutableArray arrayWithCapacity:count];
+  for (i = 0; i < count; i++)
+    [values addObject:[NSNumber numberWithInt:i]];
+  
+  self->hours = [values copy];
+  return self->hours;
 }
 
 - (NSArray *)minutes {
-    if(self->minutes == nil) {
-        NSMutableArray *values;
-        unsigned i, count, iv;
-        
-        iv = [[self minuteInterval] intValue];
-
-        count = 60;
-        values = [NSMutableArray arrayWithCapacity:count];
-        for(i = 0; i < count; i += iv) {
-            [values addObject:[NSNumber numberWithInt:i]];
-        }
-        self->minutes = [values retain];
-    }
+  NSMutableArray *values;
+  unsigned i, count, iv;
+  
+  if (self->minutes)
     return self->minutes;
+        
+  iv = [[self minuteInterval] intValue];
+
+  count = 60;
+  values = [NSMutableArray arrayWithCapacity:count];
+  for (i = 0; i < count; i += iv)
+    [values addObject:[NSNumber numberWithInt:i]];
+  
+  self->minutes = [values copy];
+  return self->minutes;
 }
 
 - (NSNumber *)selectedHour {
-    return [[self hours] objectAtIndex:[[self date] hourOfDay]];
+  return [[self hours] objectAtIndex:[[self date] hourOfDay]];
 }
 
 - (NSNumber *)selectedMinute {
-    return [[self minutes] objectAtIndex:[[self date] minuteOfHour]];
+  return [[self minutes] objectAtIndex:[[self date] minuteOfHour]];
 }
 
 - (NSString *)displayString {
-    return [NSString stringWithFormat:@"%02d", [item intValue]];
+  char buf[8];
+  sprintf(buf, "%02d", [item intValue]);
+  return [NSString stringWithCString:buf];
 }
 
-
 /* action */
 
 - (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
-    NSString *h, *m;
-    NSCalendarDate *d;
-
-    h = [_rq formValueForKey:[self hoursName]];
-    if(!h)
-        return;
-
-    m = [_rq formValueForKey:[self minutesName]];
-    d = [[self date] hour:[h intValue] minute:[m intValue]];
-    NSLog(@"%s setting date:%@",
-          __PRETTY_FUNCTION__,
-          d);
-    [self setDate:d];
-}
-
-@end
+  NSString *h, *m;
+  NSCalendarDate *d;
+  
+  h = [_rq formValueForKey:[self hoursName]];
+  m = [_rq formValueForKey:[self minutesName]];
+  
+  [self logWithFormat:@"got hour (%@): %@", [self hoursName],   h];
+  [self logWithFormat:@"got minute (%@): %@", [self minutesName], m];
+  
+  if (h == nil)
+    return;
+  
+  d = [[self date] hour:[h intValue] minute:[m intValue]];
+  [self logWithFormat:@"%s setting date:%@", __PRETTY_FUNCTION__, d];
+  [self setDate:d];
+}
+
+@end /* UIxTimeSelector */
index bf4a0ce53b465c2ee52aa51730c82d7b074d40a4..938bff14c090892258d8e86cc3700c08ddc72ed0 100644 (file)
@@ -17,4 +17,4 @@
                 displayString="displayString"
                 selection="selectedMinute"
      />
-</span>
\ No newline at end of file
+</span>
index e31de3a70ab522d3639ba33f204de0aadcdf8d5d..b838d545813c4ef56cd9d093d509b20ddf2b550d 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 
-SUBMINOR_VERSION:=49
+SUBMINOR_VERSION:=50
 
 # v0.9.41 requires libNGObjWeb     v4.2.431
 # v0.9.31 requires libWEExtensions v4.2.52