From d953935ab149ed26a7c557e50b18cfc31169414e Mon Sep 17 00:00:00 2001 From: znek Date: Wed, 23 Jun 2004 17:39:28 +0000 Subject: [PATCH] month view completed. git-svn-id: http://svn.opengroupware.org/SOGo/trunk@61 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ZideStore/UI-X/ChangeLog | 6 + ZideStore/UI-X/Common/calendar.css | 109 ++++++++++++++++++ .../UI-X/Scheduler/UIxCalMonthOverview.m | 96 +++++++++++++++ .../UI-X/Scheduler/UIxCalMonthOverview.wox | 72 ++++++++++-- 4 files changed, 274 insertions(+), 9 deletions(-) diff --git a/ZideStore/UI-X/ChangeLog b/ZideStore/UI-X/ChangeLog index 6d4b7a55..df753d1f 100644 --- a/ZideStore/UI-X/ChangeLog +++ b/ZideStore/UI-X/ChangeLog @@ -1,3 +1,9 @@ +2004-06-23 Marcus Mueller + + * 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 * Refactoring: Renamed everything from OGo to UIx in order to avoid diff --git a/ZideStore/UI-X/Common/calendar.css b/ZideStore/UI-X/Common/calendar.css index 00724bf4..364b9a0b 100644 --- a/ZideStore/UI-X/Common/calendar.css +++ b/ZideStore/UI-X/Common/calendar.css @@ -69,3 +69,112 @@ 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; +} diff --git a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m index ea2d061f..4d11a3cb 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m +++ b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m @@ -1,9 +1,15 @@ // $Id$ #include "UIxCalMonthView.h" +#include + @interface UIxCalMonthOverview : UIxCalMonthView { + int dayIndex; + int dayOfWeek; + int weekOfYear; + NSCalendarDate *currentWeekStart; } @end @@ -12,6 +18,96 @@ @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]; } diff --git a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox index ebdd9630..f21dd3a5 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox +++ b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox @@ -49,24 +49,78 @@ const:selection="month" currentDate="selectedDate" > + + + + +
+ + + + + +
+ printview + + proposal +
+
- - - - + + + + + + + + + + + + + + + + + + + +
+ + [new] + +
+ + + + -- 2.39.5