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;
34 - (NSString *)attendeeEmail {
37 s = [[self attendee] email];
38 if (![s hasPrefix:@"mailto:"]) return s;
39 return [s substringFromIndex:7];
44 - (SOGoAppointment *)appointment {
47 if (self->appointment)
48 return self->appointment;
50 iCalString = [[self clientObject] valueForKey:@"iCalString"];
51 self->appointment = [[SOGoAppointment alloc] initWithICalString:iCalString];
52 return self->appointment;
55 - (NSString *)formattedAptStartTime {
58 date = [[self appointment] startDate];
59 /* TODO: convert this into display timeZone! */
60 return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
63 - (NSString *)formattedAptEndTime {
66 date = [[self appointment] endDate];
67 /* TODO: convert this into display timeZone! */
68 return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
74 - (NSString *)attributesTabLink {
75 return [self completeHrefForMethod:[self ownMethodName]
76 withParameter:@"attributes"
80 - (NSString *)participantsTabLink {
81 return [self completeHrefForMethod:[self ownMethodName]
82 withParameter:@"participants"
86 - (NSString *)debugTabLink {
87 return [self completeHrefForMethod:[self ownMethodName]
88 withParameter:@"debug"
92 - (NSString *)completeHrefForMethod:(NSString *)_method
93 withParameter:(NSString *)_param
94 forKey:(NSString *)_key
98 [self setQueryParameter:_param forKey:_key];
99 href = [self completeHrefForMethod:[self ownMethodName]];
100 [self setQueryParameter:nil forKey:_key];
104 @end /* UIxAppointmentView */