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
24 #include "UIxCalMonthOverview.h"
26 @interface UIxCalMonthPrintview : UIxCalMonthOverview
34 @implementation UIxCalMonthPrintview
36 - (NSString *)shortTextForApt {
37 NSCalendarDate *startDate, *endDate;
38 NSMutableString *aptDescr;
45 apt = [self appointment];
46 isMyApt = [self isMyApt];
47 canAccessApt = [self canAccessApt];
49 startDate = [apt valueForKey:@"startDate"];
50 [startDate setTimeZone:[self viewTimeZone]];
51 endDate = [apt valueForKey:@"endDate"];
53 [endDate setTimeZone:[self viewTimeZone]];
54 spansRange = ![endDate isEqualToDate:startDate];
57 aptDescr = [[NSMutableString alloc] init];
58 [aptDescr appendFormat:@"<span class=\"%@\">%02i:%02i",
59 isMyApt ? @"monthprintview_apt_time" :
60 @"monthprintview_apt_time_other",
61 [startDate hourOfDay],
62 [startDate minuteOfHour]];
64 [aptDescr appendFormat:@" - %02i:%02i",
66 [endDate minuteOfHour]];
68 [aptDescr appendFormat:@"</span>,"];
70 [aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
72 s = [apt valueForKey:@"title"];
74 [aptDescr appendFormat:@"<br />%@", s];
76 s = [apt valueForKey:@"location"];
78 [aptDescr appendFormat:@"<br />%@", s];
82 [aptDescr appendFormat:@"<br />%@",
83 [self labelForKey:@"private appointment"]];
86 [aptDescr appendString:@"</span>"];
87 return [aptDescr autorelease];
93 date = [self startOfMonth];
94 return [NSString stringWithFormat:@"%@ %d",
95 [self localizedNameForMonthOfYear:[date monthOfYear]],
96 [date yearOfCommonEra]];
103 - (NSString *)contentStyle {
104 if([self->currentDay monthOfYear] != [[self startOfMonth] monthOfYear])
105 return @"monthprintview_content_dimmed";
106 return @"monthprintview_content";
109 - (NSString *)aptStyle {
111 return @"monthprintview_apt_other";