+2004-06-23 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * UIxCalMonthOverview.[m,wox]: completed month view. Turned out to
+ be much more difficult to improve with style sheets than expected.
+ Requires version 4.2.45 of WEExtensions.
+
2004-06-22 Marcus Mueller <znek@mulle-kybernetik.com>
* Refactoring: Renamed everything from OGo to UIx in order to avoid
letter-spacing: 0pt;
text-decoration: none;
}
+
+.monthoverview {
+ color: #000000;
+ font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+ font-size: 10pt;
+ letter-spacing: 0pt;
+ padding: 2px;
+}
+
+.monthoverview a {
+ color: #0033cc;
+ font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+ font-size: 7pt;
+ font-style: normal;
+ font-weight: normal;
+ letter-spacing: 0pt;
+ text-decoration: none;
+}
+
+.monthoverview a:hover {
+ text-decoration: underline;
+}
+
+.monthoverview_title {
+ background-color: #d2d2cc;
+ text-align: center;
+}
+
+.monthoverview_week {
+ background-color: #d2d2cc;
+ width: 16pt;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.monthoverview_week a {
+ color: #000000;
+ font-size: 10pt;
+}
+
+.monthoverview_week_hilite {
+ background-color: #fffff0;
+ width: 16pt;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.monthoverview_week_hilite a {
+ color: #000000;
+ font-size: 10pt;
+}
+
+.monthoverview_content {
+ background-color: #e8e8e0;
+ font-size: 9pt;
+ height: 60;
+ vertical-align: top;
+}
+
+.monthoverview_content a {
+ font-style: italic;
+ font-weight: bold;
+}
+
+.monthoverview_content_hilite {
+ background-color: #fffff0;
+ font-size: 9pt;
+ height: 60;
+ vertical-align: top;
+}
+
+.monthoverview_content_hilite a {
+ font-style: italic;
+ font-weight: bold;
+}
+
+.monthoverview_content_dimmed {
+ background-color: #d2d2cc;
+ font-size: 9pt;
+ height: 60;
+ vertical-align: top;
+}
+
+.monthoverview_content_dimmed a {
+ font-style: normal;
+ font-weight: normal;
+}
+
+.monthoverview_day a {
+ color: #000000;
+ font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+ font-size: 12pt;
+}
+
+.monthoverview_day_new a {
+ font-style: normal;
+ font-weight: normal;
+}
+
+.monthoverview_day_new a:hover {
+ font-style: normal;
+ font-weight: normal;
+ color: #ff0000;
+}
+
+.monthoverview_content_link {
+ font-style: normal;
+ font-weight: normal;
+}
// $Id$
#include "UIxCalMonthView.h"
+#include <NGExtensions/NGExtensions.h>
+
@interface UIxCalMonthOverview : UIxCalMonthView
{
+ int dayIndex;
+ int dayOfWeek;
+ int weekOfYear;
+ NSCalendarDate *currentWeekStart;
}
@end
@implementation UIxCalMonthOverview
+- (void)dealloc {
+ [self->currentWeekStart release];
+ [super dealloc];
+}
+
+- (void)setDayIndex:(int)_idx {
+ self->dayIndex = _idx;
+}
+
+- (int)dayIndex {
+ return self->dayIndex;
+}
+
+- (void)setDayOfWeek:(int)_day {
+ self->dayOfWeek = _day;
+}
+
+- (int)dayOfWeek {
+ return self->dayOfWeek;
+}
+
+- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date {
+ ASSIGN(self->currentWeekStart, _date);
+}
+
+- (NSCalendarDate *)currentWeekStartDate {
+ return self->currentWeekStart;
+}
+
+- (void)setWeekOfYear:(int)_week {
+ NSCalendarDate *date;
+
+ self->weekOfYear = _week;
+ date = [[self startDate] mondayOfWeek:self->weekOfYear];
+ [self setCurrentWeekStartDate:date];
+}
+
+- (int)weekOfYear {
+ return self->weekOfYear;
+}
+
+- (int)year {
+ return [[self startDate] yearOfCommonEra];
+}
+
+- (int)month {
+ return [[self startDate] monthOfYear];
+}
+
+- (NSString *)localizedNameOfDayOfWeek {
+ // TODO: move this to some locale method
+ static char *dayNames[] = {
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"
+ };
+ return [[[NSString alloc] initWithCString:
+ dayNames[self->dayOfWeek]] autorelease];
+}
+
+- (NSDictionary *)currentWeekQueryParameters {
+ return [self queryParametersBySettingSelectedDate:self->currentWeekStart];
+}
+
+
+/* style sheet */
+
+
+- (NSString *)weekStyle {
+ if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]])
+ return @"monthoverview_week_hilite";
+ return @"monthoverview_week";
+}
+
+- (NSString *)contentStyle {
+ if([self->currentDay isToday])
+ return @"monthoverview_content_hilite";
+ else if([self->currentDay monthOfYear] != [[self startDate] monthOfYear])
+ return @"monthoverview_content_dimmed";
+ return @"monthoverview_content";
+}
+
+
+/* appointments */
+
+
- (NSArray *)appointments {
return [self fetchCoreInfos];
}
const:selection="month"
currentDate="selectedDate"
>
+ <table border="0" cellpadding="4" width="100%" cellspacing="2">
+ <tr>
+ <td align="right" bgcolor="#e8e8e0">
+ <table border='0' cellpadding='0' cellspacing='1'>
+ <tr>
+ <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+ <a class="button_auto" href="monthprintview" var:queryDictionary="queryParameters" target="SOGoPrintView">printview</a>
+ </td>
+ <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+ <a class="button_auto" href="proposal" var:queryDictionary="queryParameters">proposal</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
<var:month-overview
list="appointments"
item="appointment"
- index="index"
- currentDay="selectedDate"
-
+ currentDay="currentDay"
+ index="dayIndex"
+ year="year"
+ month="month"
const:startDateKey = "startDate"
const:endDateKey = "endDate"
- const:titleColor = "#7799FF"
- const:contentColor = "#5577FF"
+ const:class="monthoverview"
+ contentStyle="contentStyle"
+ const:width="100%"
>
- <var:month>
- <a var:href="appointmentViewURL"><var:string value="appointment.title" /></a>
- </var:month>
- </var:month-overview>
+ <var:month-info>
+ <var:if condition="hasHolidayInfo">
+ <var:string value="holidayInfo" const:class="monthoverview_holidayinfo" />
+ </var:if>
+ <var:foreach list="allDayApts" item="appointment">
+ <a var:href="appointmentViewURL"><var:string value="shortTextForApt" /></a>
+ </var:foreach>
+ </var:month-info>
+ <var:month-label const:orientation="top"
+ dayOfWeek="dayOfWeek"
+ const:class="monthoverview_title"
+ >
+ <var:string value="localizedNameOfDayOfWeek" />
+ </var:month-label>
+ <var:month-label const:orientation="left"
+ weekOfYear="weekOfYear"
+ class="weekStyle"
+ >
+ <a href="weekoverview"
+ var:queryDictionary="currentWeekQueryParameters"
+ ><var:string value="weekOfYear" /></a>
+ </var:month-label>
+
+ <var:month-title class="contentStyle">
+ <span class="monthoverview_day">
+ <a href="dayoverview"
+ var:queryDictionary="currentDayQueryParameters"
+ ><var:string value="currentDay.dayOfMonth" /></a>
+ </span>
+ <br />
+ <span class="monthoverview_day_new">
+ <a href="proposal"
+ var:queryDictionary="currentDayQueryParameters"
+ >[new]</a>
+ </span>
+ </var:month-title>
+ <var:month>
+ <a var:href="appointmentViewURL" class="monthoverview_content_link"><var:string value="appointment.title" /></a>
+ </var:month>
+ </var:month-overview>
</var:component>
</td>
</tr>