@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 */
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
# $Id: Version 165 2004-08-05 17:55:50Z znek $
-SUBMINOR_VERSION:=7
+SUBMINOR_VERSION:=8
+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
/*
- 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 */
/*
- 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 */
<?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>
/*
- 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 */
displayString="displayString"
selection="selectedMinute"
/>
-</span>
\ No newline at end of file
+</span>
# $Id$
-SUBMINOR_VERSION:=49
+SUBMINOR_VERSION:=50
# v0.9.41 requires libNGObjWeb v4.2.431
# v0.9.31 requires libWEExtensions v4.2.52