From 6a79497fc157cf5be9a7d41ac83da65541824509 Mon Sep 17 00:00:00 2001 From: helge Date: Sun, 15 Aug 2004 18:03:22 +0000 Subject: [PATCH] attendee selector git-svn-id: http://svn.opengroupware.org/SOGo/trunk@230 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Anais/AnaisAttendeeSelector.m | 74 ++++++++++++-- SOGo/UI/Anais/AnaisAttendeeSelector.wox | 32 +++++- SOGo/UI/Anais/ChangeLog | 3 + SOGo/UI/Scheduler/ChangeLog | 9 ++ SOGo/UI/Scheduler/UIxAppointmentEditor.m | 34 +++---- SOGo/UI/Scheduler/UIxAppointmentEditor.wox | 110 +++++---------------- SOGo/UI/Scheduler/Version | 2 +- 7 files changed, 145 insertions(+), 119 deletions(-) diff --git a/SOGo/UI/Anais/AnaisAttendeeSelector.m b/SOGo/UI/Anais/AnaisAttendeeSelector.m index 7bcc8a74..cfcc02c9 100644 --- a/SOGo/UI/Anais/AnaisAttendeeSelector.m +++ b/SOGo/UI/Anais/AnaisAttendeeSelector.m @@ -28,8 +28,12 @@ Select a set of attendees using Anais. Bindings: - attendees - array of iCalPerson objects - selectorID - string to be used as the identifier for form/JS elements + attendees - array of iCalPerson objects + selectorID - string to be used as the identifier for form/JS elements + withCN - show CN of person (eg disabled for resources) + division - Anais division + emailForUser - default EMail + cnForUser - default CN Sample: +#include #include #include "common.h" @implementation AnaisAttendeeSelector - (void)dealloc { - [self->division release]; - [self->selectorID release]; - [self->attendee release]; - [self->attendees release]; + [self->emailForUser release]; + [self->cnForUser release]; + [self->division release]; + [self->selectorID release]; + [self->attendee release]; + [self->attendees release]; [super dealloc]; } @@ -80,6 +93,19 @@ - (NSArray *)attendees { return self->attendees; } +- (BOOL)hasAttendees { + return [[self attendees] count] > 0 ? YES : NO; +} +- (BOOL)hasNoAttendees { + return [[self attendees] count] == 0 ? YES : NO; +} + +- (void)setWithCN:(BOOL)_flag { + self->flags.withCN = _flag ? 1 : 0; +} +- (BOOL)withCN { + return self->flags.withCN ? YES : NO; +} - (void)setAttendee:(iCalPerson *)_attendee { ASSIGN(self->attendee, _attendee); @@ -95,6 +121,42 @@ return self->division; } +- (void)setEmailForUser:(NSString *)_value { + ASSIGNCOPY(self->emailForUser, _value); +} +- (NSString *)emailForUser { + return self->emailForUser; +} + +- (void)setCnForUser:(NSString *)_value { + ASSIGNCOPY(self->cnForUser, _value); +} +- (NSString *)cnForUser { + return self->cnForUser; +} + +- (BOOL)showDefaultAttendees { + return [self hasNoAttendees] && [[self emailForUser] length] > 0 ? YES : NO; +} + +/* email, cn */ + +- (NSString *)combinedCNAndEmailForUser { + NSString *e, *c; + + e = [self emailForUser]; + c = [self cnForUser]; + return [[e stringByAppendingString:@";"] stringByAppendingString:c]; +} + +- (NSString *)combinedCNAndEmail { + NSString *e, *c; + + e = [[self attendee] rfc822Email]; + c = [[self attendee] cnForDisplay]; + return [[e stringByAppendingString:@";"] stringByAppendingString:c]; +} + /* id accessors */ - (void)setSelectorID:(NSString *)_value { diff --git a/SOGo/UI/Anais/AnaisAttendeeSelector.wox b/SOGo/UI/Anais/AnaisAttendeeSelector.wox index 76e9b6c5..471a88e2 100644 --- a/SOGo/UI/Anais/AnaisAttendeeSelector.wox +++ b/SOGo/UI/Anais/AnaisAttendeeSelector.wox @@ -16,14 +16,38 @@ var:callback="callbackName" />
- + + /> + + + + + + + + + + + + + + diff --git a/SOGo/UI/Anais/ChangeLog b/SOGo/UI/Anais/ChangeLog index 29eeed14..37b72578 100644 --- a/SOGo/UI/Anais/ChangeLog +++ b/SOGo/UI/Anais/ChangeLog @@ -1,5 +1,8 @@ 2004-08-15 Helge Hess + * AnaisAttendeeSelector.m: added support for default attendees (as used + by the editor component) (v0.9.6) + * AnaisAttendeeSelector.wox: added 'division' binding (v0.9.5) * added AnaisAttendeeSelector component (v0.9.4) diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index a03d2f80..31a32af2 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,12 @@ +2004-08-15 Helge Hess + + * v0.9.44 + + * UIxAppointmentEditor.m: use new AnaisAttendeeSelector + + * UIxAppointmentEditor.m: replaced formattedAptStartDate with a + titleDateFormatter (directly bound to the string element) + 2004-08-15 Marcus Mueller * v0.9.43 diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 53a6fbcb..93081f2f 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -89,34 +89,28 @@ return self->item; } -- (NSString *)formattedAptStartTime { - NSCalendarDate *date; +- (NSFormatter *)titleDateFormatter { SOGoDateFormatter *fmt; - NSString *s; - - date = [[[[self appointment] startDate] copy] autorelease]; - [date setTimeZone:[self viewTimeZone]]; - fmt = [[SOGoDateFormatter alloc] initWithLocale:[self locale]]; + + fmt = [[[SOGoDateFormatter alloc] initWithLocale:[self locale]] autorelease]; [fmt setFullWeekdayNameAndDetails]; - s = [fmt stringForObjectValue:date]; - [fmt release]; - return s; + return fmt; } - (NSCalendarDate *)aptStartDate { - NSCalendarDate *date; - - date = [[[[self appointment] startDate] copy] autorelease]; - [date setTimeZone:[self viewTimeZone]]; - return date; + NSCalendarDate *date; + + date = [[[[self appointment] startDate] copy] autorelease]; + [date setTimeZone:[self viewTimeZone]]; + return date; } - (NSCalendarDate *)aptEndDate { - NSCalendarDate *date; + NSCalendarDate *date; - date = [[[[self appointment] endDate] copy] autorelease]; - [date setTimeZone:[self viewTimeZone]]; - return date; + date = [[[[self appointment] endDate] copy] autorelease]; + [date setTimeZone:[self viewTimeZone]]; + return date; } - (BOOL)isNewAppointment { @@ -239,7 +233,7 @@ return [self completeHrefForMethod:uri]; } -/* email, cn */ +/* email, cn TODO: unused now?*/ - (NSString *)combinedCNAndEmailForUser { return [NSString stringWithFormat:@"%@;%@", diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox index 46ab1be0..ed544bac 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox @@ -25,17 +25,15 @@
- @@ -87,11 +85,8 @@ @@ -103,11 +98,8 @@ @@ -132,48 +124,15 @@ : @@ -182,10 +141,7 @@
- +
- +
- +
- - - -
- - - - - - - - - - - - - - - -
- @@ -203,27 +159,11 @@ @@ -232,10 +172,7 @@
- -
- - - - - - - -
- @@ -253,11 +190,8 @@
- +