3 #include "UIxAppointmentView.h"
5 #include <Backend/SxAptManager.h>
6 #include <SOGoLogic/SOGoAppointment.h>
9 @interface NSObject(UsedPrivates)
10 - (SxAptManager *)aptManagerInContext:(id)_ctx;
13 @implementation UIxAppointmentView
16 [self->appointment release];
17 [self->attendee release];
25 - (NSString *)tabSelection {
28 selection = [self queryParameterForKey:@"tab"];
30 selection = @"attributes";
34 - (void)setAttendee:(id)_attendee {
35 ASSIGN(self->attendee, _attendee);
38 return self->attendee;
45 - (SxAptManager *)aptManager {
46 return [[self clientObject] aptManagerInContext:[self context]];
49 - (SOGoAppointment *)appointment {
50 if(self->appointment == nil) {
53 iCalString = [[self clientObject] valueForKey:@"iCalString"];
54 self->appointment = [[SOGoAppointment alloc] initWithICalString:iCalString];
56 return self->appointment;
59 - (NSString *)formattedAptStartTime {
62 date = [[self appointment] startDate];
63 /* TODO: convert this into display timeZone! */
64 return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
67 - (NSString *)formattedAptEndTime {
70 date = [[self appointment] endDate];
71 /* TODO: convert this into display timeZone! */
72 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 */