From dcdc66adce62a8379f2b3b559eafa32f449895b9 Mon Sep 17 00:00:00 2001 From: znek Date: Sun, 15 Aug 2004 21:29:03 +0000 Subject: [PATCH] new stuff git-svn-id: http://svn.opengroupware.org/SOGo/trunk@239 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SOGo.xcode/project.pbxproj | 49 +++++++- SOGo/UI/Scheduler/ChangeLog | 12 ++ .../Scheduler/English.lproj/default.strings | 25 ++-- SOGo/UI/Scheduler/GNUmakefile | 2 + SOGo/UI/Scheduler/UIxAppointmentEditor.wox | 20 +-- SOGo/UI/Scheduler/UIxAppointmentProposal.wox | 119 ++++++++++++------ SOGo/UI/Scheduler/UIxDatePicker.m | 21 ++++ SOGo/UI/Scheduler/UIxTimeDateControl.m | 119 ++++++++++++++++++ SOGo/UI/Scheduler/UIxTimeDateControl.wox | 17 +++ SOGo/UI/Scheduler/UIxTimeSelector.m | 45 ++++++- SOGo/UI/Scheduler/Version | 2 +- 11 files changed, 363 insertions(+), 68 deletions(-) create mode 100644 SOGo/UI/Scheduler/UIxTimeDateControl.m create mode 100644 SOGo/UI/Scheduler/UIxTimeDateControl.wox diff --git a/SOGo/SOGo.xcode/project.pbxproj b/SOGo/SOGo.xcode/project.pbxproj index e5ce1bda..f3e72ded 100644 --- a/SOGo/SOGo.xcode/project.pbxproj +++ b/SOGo/SOGo.xcode/project.pbxproj @@ -109,6 +109,7 @@ }; AD07124006C904DE00A9EEF4 = { children = ( + AD73C03606CFDE4500226A2D, AD07123806C904C900A9EEF4, ); isa = PBXGroup; @@ -133,6 +134,8 @@ AD07124B06C9052700A9EEF4, AD0715CB06CA711600A9EEF4, AD0715CA06CA711600A9EEF4, + AD73C03406CFDE3600226A2D, + AD73C03506CFDE3600226A2D, ); isa = PBXGroup; name = Components; @@ -633,10 +636,12 @@ children = ( AD73BE9406CF969100226A2D, AD73BE9306CF969100226A2D, - AD73BED806CFA0FD00226A2D, - AD73BED706CFA0FD00226A2D, AD73BF6C06CFB4CE00226A2D, AD73BF6B06CFB4CE00226A2D, + AD73C08306CFFEA600226A2D, + AD73C08206CFFEA600226A2D, + AD73BED806CFA0FD00226A2D, + AD73BED706CFA0FD00226A2D, ); isa = PBXGroup; name = "Date / Time"; @@ -659,6 +664,46 @@ refType = 4; sourceTree = ""; }; + AD73C03406CFDE3600226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = AnaisAttendeeSelector.m; + refType = 4; + sourceTree = ""; + }; + AD73C03506CFDE3600226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = AnaisAttendeeSelector.wox; + refType = 4; + sourceTree = ""; + }; + AD73C03606CFDE4500226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = common.h; + refType = 4; + sourceTree = ""; + }; + AD73C08206CFFEA600226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxTimeDateControl.wox; + refType = 4; + sourceTree = ""; + }; + AD73C08306CFFEA600226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxTimeDateControl.m; + refType = 4; + sourceTree = ""; + }; ADCDE53106ADA8AC00BFCE2B = { fileEncoding = 5; isa = PBXFileReference; diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index cf042357..85b7f060 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,15 @@ +2004-08-15 Marcus Mueller + + * v0.9.49 + + * UIxTimeDateControl.[wox,m]: new component. + + * UIxAppointmentProposal.wox: added labels and stuff, work in progress. + + * English.lproj/default.strings: new labels + + * UIxTimeSelector.m, UIxDatePicker.m: correct date bindings. + 2004-08-15 Helge Hess * v0.9.48 diff --git a/SOGo/UI/Scheduler/English.lproj/default.strings b/SOGo/UI/Scheduler/English.lproj/default.strings index a308c1c0..3f0bfe0b 100644 --- a/SOGo/UI/Scheduler/English.lproj/default.strings +++ b/SOGo/UI/Scheduler/English.lproj/default.strings @@ -70,26 +70,35 @@ /* Misc */ -"new" = "new"; -"printview" = "printview"; -"proposal" = "proposal"; -"Save" = "Save"; -"Cancel" = "Cancel"; -"OpenGroupware.org" = "OpenGroupware.org" - +"new" = "new"; +"printview" = "printview"; +"proposal" = "proposal"; +"Save" = "Save"; +"Cancel" = "Cancel"; +"OpenGroupware.org" = "OpenGroupware.org" /* Appointments */ -"Appointment Editor" = "Appointment Editor"; +"Appointment editor" = "Appointment Editor"; +"Appointment proposal" = "Appointment Proposal"; "Appointment on" = "Appointment on"; "Start time" = "Start time"; "End time" = "End time"; +"Start date" = "Start date"; +"End date" = "End date"; +"Earliest start time" = "Earliest start time"; +"Latest end time" = "Latest end time"; +"browse start date" = "browse start date"; +"browse end date" = "browse end date"; "Title" = "Title"; "Location" = "Location"; +"Duration" = "Duration"; "Search participants" = "Search participants"; "Participants" = "Participants"; "Search resources" = "Search resources"; "Resources" = "Resources"; +"Search appointments" = "Search appointments"; +"Search" = "Search"; "Search in Anais" = "Search in Anaïs"; diff --git a/SOGo/UI/Scheduler/GNUmakefile b/SOGo/UI/Scheduler/GNUmakefile index b5e64b4c..801c76be 100644 --- a/SOGo/UI/Scheduler/GNUmakefile +++ b/SOGo/UI/Scheduler/GNUmakefile @@ -45,6 +45,7 @@ SchedulerUI_OBJC_FILES = \ UIxDatePicker.m \ UIxDatePickerScript.m \ UIxTimeSelector.m \ + UIxTimeDateControl.m \ SchedulerUI_RESOURCE_FILES += \ Version \ @@ -74,6 +75,7 @@ SchedulerUI_RESOURCE_FILES += \ UIxDatePicker.wox \ UIxDatePickerScript.wox \ UIxTimeSelector.wox \ + UIxTimeDateControl.wox \ SchedulerUI_RESOURCE_FILES += \ images/next_week.gif \ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox index 7167b1e0..19d5f132 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox @@ -15,7 +15,7 @@ - + @@ -52,15 +52,10 @@ - - @@ -72,14 +67,9 @@ - - diff --git a/SOGo/UI/Scheduler/UIxAppointmentProposal.wox b/SOGo/UI/Scheduler/UIxAppointmentProposal.wox index 3e94adf2..f6e65561 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentProposal.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentProposal.wox @@ -1,21 +1,26 @@ - - +
+ @@ -30,53 +35,83 @@ const:selectedTabStyle="tab_selected" const:bodyStyle="tabview_body" > - +
- Search Appointments + +
- - - - + - - - - @@ -85,13 +120,17 @@
- Search Appointments + + +
- Startdate: + + : + - date selector here + + + +
- Enddate: + + : - date selector here + +
- Earliest Starttime: - - time selector here + + : + +
- Latest Endtime: + + : - time selector here + +
- Duration: + + : + duration popup here
- Search Resources + + +
- Select in Anais: + + : + Anais resource selector @@ -102,13 +141,17 @@
- Search Participants + + +
- Select in Anais: + + : + Anais person selector @@ -119,8 +162,10 @@
- + diff --git a/SOGo/UI/Scheduler/UIxDatePicker.m b/SOGo/UI/Scheduler/UIxDatePicker.m index 66849b99..24528c6b 100644 --- a/SOGo/UI/Scheduler/UIxDatePicker.m +++ b/SOGo/UI/Scheduler/UIxDatePicker.m @@ -126,4 +126,25 @@ [self dateFormat]]; } +/* 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 +} + @end diff --git a/SOGo/UI/Scheduler/UIxTimeDateControl.m b/SOGo/UI/Scheduler/UIxTimeDateControl.m new file mode 100644 index 00000000..9568283f --- /dev/null +++ b/SOGo/UI/Scheduler/UIxTimeDateControl.m @@ -0,0 +1,119 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#include + + +@interface UIxTimeDateControl : WOComponent +{ + NSString *controlID; + NSCalendarDate *date; + NSString *label; + + NSCalendarDate *timeComponent; + NSCalendarDate *dateComponent; +} + +- (NSString *)timeID; +- (NSString *)dateID; + +- (void)setTimeComponent:(NSCalendarDate *)_timeComponent; +- (void)setDateComponent:(NSCalendarDate *)_dateComponent; + +@end + +#include "common.h" + +@implementation UIxTimeDateControl + +- (void)dealloc { + [self->controlID release]; + [self->date release]; + [self->label release]; + [self->timeComponent release]; + [self->dateComponent release]; + [super dealloc]; +} + +- (void)setControlID:(NSString *)_controlID { + ASSIGNCOPY(self->controlID, _controlID); +} +- (NSString *)controlID { + return self->controlID; +} +- (void)setDate:(NSCalendarDate *)_date { + ASSIGN(self->date, _date); + [self setTimeComponent:_date]; + [self setDateComponent:_date]; +} +- (NSCalendarDate *)date { + return self->date; +} +- (void)setLabel:(NSString *)_label { + ASSIGNCOPY(self->label, _label); +} +- (NSString *)label { + return self->label; +} + +- (void)setTimeComponent:(NSCalendarDate *)_timeComponent { + ASSIGN(self->timeComponent, _timeComponent); +} +- (NSCalendarDate *)timeComponent { + return self->timeComponent; +} + +- (void)setDateComponent:(NSCalendarDate *)_dateComponent { + ASSIGN(self->dateComponent, _dateComponent); +} +- (NSCalendarDate *)dateComponent { + return self->dateComponent; +} + +- (NSString *)timeID { + return [NSString stringWithFormat:@"%@_time", + [self controlID]]; +} + +- (NSString *)dateID { + return [NSString stringWithFormat:@"%@_date", + [self controlID]]; +} + +/* action */ + +- (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]; +} + +@end diff --git a/SOGo/UI/Scheduler/UIxTimeDateControl.wox b/SOGo/UI/Scheduler/UIxTimeDateControl.wox new file mode 100644 index 00000000..e3c70b98 --- /dev/null +++ b/SOGo/UI/Scheduler/UIxTimeDateControl.wox @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/SOGo/UI/Scheduler/UIxTimeSelector.m b/SOGo/UI/Scheduler/UIxTimeSelector.m index 84fd81f7..dcba8fe6 100644 --- a/SOGo/UI/Scheduler/UIxTimeSelector.m +++ b/SOGo/UI/Scheduler/UIxTimeSelector.m @@ -28,14 +28,16 @@ { NSString *timeID; NSCalendarDate *date; - + BOOL combined; + NSString *minuteInterval; id item; NSArray *hours, *minutes; } - (NSArray *)hours; - (NSArray *)minutes; - +- (NSString *)minuteInterval; + @end #include "common.h" @@ -45,14 +47,17 @@ - (void)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 { - ASSIGN(self->timeID, _timeID); + ASSIGNCOPY(self->timeID, _timeID); } - (NSString *)timeID { return self->timeID; @@ -65,6 +70,15 @@ return self->date; } +- (void)setMinuteInterval:(NSString *)_minuteInterval { + ASSIGNCOPY(self->minuteInterval, _minuteInterval); +} +- (NSString *)minuteInterval { + if(self->minuteInterval == nil) + return @"1"; + return self->minuteInterval; +} + - (void)setItem:(id)_item { ASSIGN(self->item, _item); } @@ -100,11 +114,13 @@ - (NSArray *)minutes { if(self->minutes == nil) { NSMutableArray *values; - unsigned i, count; + unsigned i, count, iv; + iv = [[self minuteInterval] intValue]; + count = 60; values = [NSMutableArray arrayWithCapacity:count]; - for(i = 0; i < count; i++) { + for(i = 0; i < count; i += iv) { [values addObject:[NSNumber numberWithInt:i]]; } self->minutes = [values retain]; @@ -124,4 +140,23 @@ return [NSString stringWithFormat:@"%02d", [item intValue]]; } + +/* 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 diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 65f75406..e31de3a7 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # $Id$ -SUBMINOR_VERSION:=48 +SUBMINOR_VERSION:=49 # v0.9.41 requires libNGObjWeb v4.2.431 # v0.9.31 requires libWEExtensions v4.2.52 -- 2.39.5