From 1b57253a3d83dcac9098c4c5f1835f192050f8c1 Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 16 Aug 2004 09:52:48 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@248 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Scheduler/ChangeLog | 8 ++++ SOGo/UI/Scheduler/UIxAppointmentEditor.m | 8 +++- SOGo/UI/Scheduler/UIxAppointmentProposal.m | 39 ++++++++++++++++++++ SOGo/UI/Scheduler/UIxAppointmentProposal.wox | 26 ++++++++++--- SOGo/UI/Scheduler/Version | 2 +- 5 files changed, 75 insertions(+), 8 deletions(-) diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 7b69aa18..8b0273c2 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,11 @@ +2004-08-16 Helge Hess + + * v0.9.55 + + * UIxAppointmentProposal.m: load default start/enddates + + * UIxAppointmentEditor.m: add default start/enddates + 2004-08-15 Marcus Mueller * v0.9.54 diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 57937355..dd8363fa 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -321,8 +321,12 @@ } - (void)loadValuesFromAppointment:(SOGoAppointment *)_appointment { - self->startDate = [[_appointment startDate] copy]; - self->endDate = [[_appointment endDate] copy]; + if ((self->startDate = [[_appointment startDate] copy]) == nil) + self->startDate = [[[[NSCalendarDate date] date] hour:11 minute:0] copy]; + if ((self->endDate = [[_appointment endDate] copy]) == nil) { + self->endDate = + [[self->startDate hour:[self->startDate hourOfDay]+1 minute:0] copy]; + } [self->startDate setTimeZone:[self viewTimeZone]]; [self->endDate setTimeZone:[self viewTimeZone]]; diff --git a/SOGo/UI/Scheduler/UIxAppointmentProposal.m b/SOGo/UI/Scheduler/UIxAppointmentProposal.m index 92ed59c8..ca55acb1 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentProposal.m +++ b/SOGo/UI/Scheduler/UIxAppointmentProposal.m @@ -91,6 +91,16 @@ return self->resources; } +- (NSArray *)attendees { + NSArray *a, *b; + + a = [self participants]; + b = [self resources]; + if ([b count] == 0) return a; + if ([a count] == 0) return b; + return [a arrayByAddingObjectsFromArray:b]; +} + - (void)setCurrentDay:(id)_day { ASSIGN(self->currentDay, _day); } @@ -114,12 +124,41 @@ return [NSArray arrayWithObjects:@"2004-08-15", nil]; } +/* slots */ + +- (BOOL)isFirstHalfGreen { + [self logWithFormat:@"is first green: %@ %@", self->currentDay, self->item]; + return NO; +} +- (BOOL)isSecondHalfGreen { + [self logWithFormat:@"is second green: %@ %@", self->currentDay, self->item]; + return YES; +} + +- (BOOL)isFirstHalfBlocked { + return [self isFirstHalfGreen] ? NO : YES; +} +- (BOOL)isSecondHalfBlocked { + return [self isSecondHalfGreen] ? NO : YES; +} + /* actions */ - (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{ return YES; } +- (id)defaultAction { + NSCalendarDate *now; + + now = [NSCalendarDate date]; + + [self setStartDate:[now hour:9 minute:0]]; + [self setEndDate:[now hour:18 minute:0]]; + + return self; +} + - (id)proposalSearchAction { [self logWithFormat:@"search from %@ to %@", [self startDate], [self endDate]]; diff --git a/SOGo/UI/Scheduler/UIxAppointmentProposal.wox b/SOGo/UI/Scheduler/UIxAppointmentProposal.wox index 42ee2516..a16607a6 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentProposal.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentProposal.wox @@ -226,11 +226,27 @@ > - - new - - + + + new + + + + + + + + + + new + + + + + + diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index a96e7c74..8518823c 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # $Id$ -SUBMINOR_VERSION:=54 +SUBMINOR_VERSION:=55 # v0.9.41 requires libNGObjWeb v4.2.431 # v0.9.31 requires libWEExtensions v4.2.52 -- 2.39.5