2 Copyright (C) 2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "UIxCalWeekOverview.h"
25 @interface UIxCalWeekPrintview : UIxCalWeekOverview
33 @implementation UIxCalWeekPrintview
35 - (NSString *)shortTextForApt {
36 NSCalendarDate *startDate, *endDate;
37 NSMutableString *aptDescr;
43 apt = [self appointment];
44 isMyApt = [self isMyApt];
46 startDate = [apt valueForKey:@"startDate"];
47 [startDate setTimeZone:[self viewTimeZone]];
48 endDate = [apt valueForKey:@"endDate"];
50 [endDate setTimeZone:[self viewTimeZone]];
51 spansRange = ![endDate isEqualToDate:startDate];
53 aptDescr = [[NSMutableString alloc] init];
54 [aptDescr appendFormat:@"<span class=\"%@\">%02i:%02i",
55 isMyApt ? @"weekprintview_apt_time" :
56 @"weekprintview_apt_time_other",
57 [startDate hourOfDay],
58 [startDate minuteOfHour]];
60 [aptDescr appendFormat:@" - %02i:%02i",
62 [endDate minuteOfHour]];
64 [aptDescr appendFormat:@"</span>,"];
66 [aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
67 s = [apt valueForKey:@"title"];
69 [aptDescr appendFormat:@"<br />%@", s];
71 s = [apt valueForKey:@"location"];
73 [aptDescr appendFormat:@"<br />%@", s];
76 [aptDescr appendString:@"</span>"];
77 return [aptDescr autorelease];
81 NSMutableString *title;
84 date = [self startDate];
85 title = [[NSMutableString alloc] init];
86 [title appendFormat:@"%@ %d",
87 [self localizedNameForMonthOfYear:[date monthOfYear]],
88 [date yearOfCommonEra]];
89 if([date monthOfYear] != [[self endDate] monthOfYear]) {
90 [title appendFormat:@" / %@ %d",
91 [self localizedNameForMonthOfYear:[[self endDate] monthOfYear]],
92 [[self endDate] yearOfCommonEra]];
94 [title appendFormat:@", %@ %d",
95 [self labelForKey:@"Week"],
97 return [title autorelease];
102 - (NSString *)titleStyle {
103 if([self->currentDay isToday])
104 return @"weekoverview_title_hilite";
105 return @"weekoverview_title";
108 - (NSString *)contentStyle {
109 if([self->currentDay isToday])
110 return @"weekoverview_content_hilite";
111 return @"weekoverview_content";
114 - (NSString *)aptStyle {
116 return @"weekprintview_apt_other";