3 #include "UIxAppointmentView.h"
5 #include <SOGoLogic/SOGoAppointment.h>
7 @implementation UIxAppointmentView
10 [self->appointment release];
11 [self->attendee release];
17 - (NSString *)tabSelection {
20 selection = [self queryParameterForKey:@"tab"];
22 selection = @"attributes";
26 - (void)setAttendee:(id)_attendee {
27 ASSIGN(self->attendee, _attendee);
30 return self->attendee;
33 - (NSString *)attendeeEmail {
36 s = [[self attendee] email];
37 if (![s hasPrefix:@"mailto:"]) return s;
38 return [s substringFromIndex:7];
43 - (SOGoAppointment *)appointment {
46 if (self->appointment)
47 return self->appointment;
49 iCalString = [[self clientObject] valueForKey:@"iCalString"];
50 if ([iCalString length] == 0) {
51 [self logWithFormat:@"ERROR(%s): missing iCal string!",
56 self->appointment = [[SOGoAppointment alloc] initWithICalString:iCalString];
57 return self->appointment;
60 - (NSString *)formattedAptStartTime {
63 date = [[self appointment] startDate];
64 [date setTimeZone:[self viewTimeZone]];
65 return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
68 - (NSString *)formattedAptEndTime {
71 date = [[self appointment] endDate];
72 [date setTimeZone:[self viewTimeZone]];
73 return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
79 - (NSString *)attributesTabLink {
80 return [self completeHrefForMethod:[self ownMethodName]
81 withParameter:@"attributes"
85 - (NSString *)participantsTabLink {
86 return [self completeHrefForMethod:[self ownMethodName]
87 withParameter:@"participants"
91 - (NSString *)debugTabLink {
92 return [self completeHrefForMethod:[self ownMethodName]
93 withParameter:@"debug"
97 - (NSString *)completeHrefForMethod:(NSString *)_method
98 withParameter:(NSString *)_param
99 forKey:(NSString *)_key
103 [self setQueryParameter:_param forKey:_key];
104 href = [self completeHrefForMethod:[self ownMethodName]];
105 [self setQueryParameter:nil forKey:_key];
109 @end /* UIxAppointmentView */