From: znek Date: Wed, 21 Jul 2004 21:46:55 +0000 (+0000) Subject: yearoverview and "inline" month overview X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3003154308c85ccff50043833b1d80f6e3c9463;p=scalable-opengroupware.org yearoverview and "inline" month overview git-svn-id: http://svn.opengroupware.org/SOGo/trunk@153 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SOGo.xcode/project.pbxproj b/SOGo/SOGo.xcode/project.pbxproj index 79685e58..3eaa5a1c 100644 --- a/SOGo/SOGo.xcode/project.pbxproj +++ b/SOGo/SOGo.xcode/project.pbxproj @@ -107,9 +107,49 @@ refType = 4; sourceTree = ""; }; - ADCDE53106ADA8AC00BFCE2B = { + AD7379B206AEBB2500735920 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxCalInlineMonthOverview.wox; + refType = 4; + sourceTree = ""; + }; + AD7379B306AEBB2500735920 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxCalInlineMonthOverview.m; + refType = 4; + sourceTree = ""; + }; + AD737A1706AEC77E00735920 = { fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = UIxCalMonthOverview.h; + refType = 4; + sourceTree = ""; + }; + AD737A6906AEE8BD00735920 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxCalYearOverview.wox; + refType = 4; + sourceTree = ""; + }; + AD737A6A06AEE8BD00735920 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxCalYearOverview.m; + refType = 4; + sourceTree = ""; + }; + ADCDE53106ADA8AC00BFCE2B = { + fileEncoding = 5; + isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/default.strings; @@ -127,6 +167,7 @@ sourceTree = ""; }; ADCDE53306ADA8CF00BFCE2B = { + fileEncoding = 5; isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; @@ -1881,12 +1922,17 @@ E87208FD0692E3D30099CBBD, E87208FE0692E3D30099CBBD, E87208FF0692E3D30099CBBD, - E87209000692E3D30099CBBD, - E87209010692E3D30099CBBD, E87209040692E3D30099CBBD, E87209050692E3D30099CBBD, + AD7379B306AEBB2500735920, + AD7379B206AEBB2500735920, E87209080692E3D30099CBBD, E87209090692E3D30099CBBD, + AD737A1706AEC77E00735920, + E87209000692E3D30099CBBD, + E87209010692E3D30099CBBD, + AD737A6A06AEE8BD00735920, + AD737A6906AEE8BD00735920, ); isa = PBXGroup; name = Components; diff --git a/SOGo/UI/SOGoUI/ChangeLog b/SOGo/UI/SOGoUI/ChangeLog index da9d49fe..f66a857d 100644 --- a/SOGo/UI/SOGoUI/ChangeLog +++ b/SOGo/UI/SOGoUI/ChangeLog @@ -1,3 +1,8 @@ +2004-07-21 Marcus Mueller + + * UIxComponent.[hm]: renamed some of the labels to better reflect the + intention (and to avoid name clashes) (v0.9.4) + 2004-07-21 Marcus Mueller * UIxComponent.[hm]: date specific labels (weekday names, month names) diff --git a/SOGo/UI/SOGoUI/UIxComponent.m b/SOGo/UI/SOGoUI/UIxComponent.m index 2d035892..9ccbe480 100644 --- a/SOGo/UI/SOGoUI/UIxComponent.m +++ b/SOGo/UI/SOGoUI/UIxComponent.m @@ -58,13 +58,13 @@ static NSMutableArray *abbrMonthLabelKeys = nil; [dayLabelKeys addObject:@"Saturday"]; abbrDayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7]; - [abbrDayLabelKeys addObject:@"Sun"]; - [abbrDayLabelKeys addObject:@"Mon"]; - [abbrDayLabelKeys addObject:@"Tue"]; - [abbrDayLabelKeys addObject:@"Wed"]; - [abbrDayLabelKeys addObject:@"Thu"]; - [abbrDayLabelKeys addObject:@"Fri"]; - [abbrDayLabelKeys addObject:@"Sat"]; + [abbrDayLabelKeys addObject:@"a2_Sunday"]; + [abbrDayLabelKeys addObject:@"a2_Monday"]; + [abbrDayLabelKeys addObject:@"a2_Tuesday"]; + [abbrDayLabelKeys addObject:@"a2_Wednesday"]; + [abbrDayLabelKeys addObject:@"a2_Thursday"]; + [abbrDayLabelKeys addObject:@"a2_Friday"]; + [abbrDayLabelKeys addObject:@"a2_Saturday"]; monthLabelKeys = [[NSMutableArray alloc] initWithCapacity:12]; [monthLabelKeys addObject:@"January"]; @@ -81,18 +81,18 @@ static NSMutableArray *abbrMonthLabelKeys = nil; [monthLabelKeys addObject:@"December"]; abbrMonthLabelKeys = [[NSMutableArray alloc] initWithCapacity:12]; - [abbrMonthLabelKeys addObject:@"Jan"]; - [abbrMonthLabelKeys addObject:@"Feb"]; - [abbrMonthLabelKeys addObject:@"Mar"]; - [abbrMonthLabelKeys addObject:@"Apr"]; - [abbrMonthLabelKeys addObject:@"May"]; - [abbrMonthLabelKeys addObject:@"Jun"]; - [abbrMonthLabelKeys addObject:@"Jul"]; - [abbrMonthLabelKeys addObject:@"Aug"]; - [abbrMonthLabelKeys addObject:@"Sep"]; - [abbrMonthLabelKeys addObject:@"Oct"]; - [abbrMonthLabelKeys addObject:@"Nov"]; - [abbrMonthLabelKeys addObject:@"Dec"]; + [abbrMonthLabelKeys addObject:@"a3_January"]; + [abbrMonthLabelKeys addObject:@"a3_February"]; + [abbrMonthLabelKeys addObject:@"a3_March"]; + [abbrMonthLabelKeys addObject:@"a3_April"]; + [abbrMonthLabelKeys addObject:@"a3_May"]; + [abbrMonthLabelKeys addObject:@"a3_June"]; + [abbrMonthLabelKeys addObject:@"a3_July"]; + [abbrMonthLabelKeys addObject:@"a3_August"]; + [abbrMonthLabelKeys addObject:@"a3_September"]; + [abbrMonthLabelKeys addObject:@"a3_October"]; + [abbrMonthLabelKeys addObject:@"a3_November"]; + [abbrMonthLabelKeys addObject:@"a3_December"]; } } diff --git a/SOGo/UI/SOGoUI/Version b/SOGo/UI/SOGoUI/Version index 6300d3ac..38b76bc3 100644 --- a/SOGo/UI/SOGoUI/Version +++ b/SOGo/UI/SOGoUI/Version @@ -1,5 +1,5 @@ # $Id$ -SUBMINOR_VERSION:=3 +SUBMINOR_VERSION:=4 # 1.1.0 requires NGObjWeb 4.2.202 diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 3fb9b3b0..1681d01e 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,22 @@ +2004-07-21 Marcus Mueller + + * v0.9.4 + + * UIxCalMonthOverview.h: new header, required by new + UIxCalInlineMonthOverview component. + + * UIxCalInlineMonthOverview.[m|wox]: new component rendering a month + overview suitable for inlining in other views. Several calendar + "modes" require this. + + * UIxCalYearOverview.[m|wox]: new component rendering the year + overview. + + * product.plist: yearoverview -> new method + + * GNUmakefile: added UIxCalInlineMonthOverview.[m|wox] and + UIxCalYearOverview.[m|wox]. + 2004-07-21 Marcus Mueller * v0.9.3 diff --git a/SOGo/UI/Scheduler/English.lproj/default.strings b/SOGo/UI/Scheduler/English.lproj/default.strings index e73e41cd..f0d64241 100644 --- a/SOGo/UI/Scheduler/English.lproj/default.strings +++ b/SOGo/UI/Scheduler/English.lproj/default.strings @@ -2,21 +2,21 @@ /* Day */ -"Sunday" = "Sunday"; -"Monday" = "Monday"; -"Tuesday" = "Tuesday"; -"Wednesday" = "Wednesday"; -"Thursday" = "Thursday"; -"Friday" = "Friday"; -"Saturday" = "Saturday"; - -"Sun" = "Sun"; -"Mon" = "Mon"; -"Tue" = "Tue"; -"Wed" = "Wed"; -"Thu" = "Thu"; -"Fri" = "Fri"; -"Sat" = "Sat"; +"Sunday" = "Sunday"; +"Monday" = "Monday"; +"Tuesday" = "Tuesday"; +"Wednesday" = "Wednesday"; +"Thursday" = "Thursday"; +"Friday" = "Friday"; +"Saturday" = "Saturday"; + +"a2_Sunday" = "Su"; +"a2_Monday" = "Mo"; +"a2_Tuesday" = "Tu"; +"a2_Wednesday" = "We"; +"a2_Thursday" = "Th"; +"a2_Friday" = "Fr"; +"a2_Saturday" = "Sa"; "dayLabelFormat" = "%Y-%m-%d"; @@ -44,18 +44,23 @@ "November" = "November"; "December" = "December"; -"Jan" = "Jan"; -"Feb" = "Feb"; -"Mar" = "Mar"; -"Apr" = "Apr"; -"May" = "May"; -"Jun" = "Jun"; -"Jul" = "Jul"; -"Aug" = "Aug"; -"Sep" = "Sep"; -"Oct" = "Oct"; -"Nov" = "Nov"; -"Dec" = "Dec"; +"a3_January" = "Jan"; +"a3_February" = "Feb"; +"a3_March" = "Mar"; +"a3_April" = "Apr"; +"a3_May" = "May"; +"a3_June" = "Jun"; +"a3_July" = "Jul"; +"a3_August" = "Aug"; +"a3_September" = "Sep"; +"a3_October" = "Oct"; +"a3_November" = "Nov"; +"a3_December" = "Dec"; + +/* Year */ + +"this year" = "this year"; + /* Misc */ diff --git a/SOGo/UI/Scheduler/French.lproj/default.strings b/SOGo/UI/Scheduler/French.lproj/default.strings index 8fa8deac..18b4e1ec 100644 --- a/SOGo/UI/Scheduler/French.lproj/default.strings +++ b/SOGo/UI/Scheduler/French.lproj/default.strings @@ -2,21 +2,21 @@ /* Day */ -"Sunday" = "Dimanche"; -"Monday" = "Lundi"; -"Tuesday" = "Mardi"; -"Wednesday" = "Mercredi"; -"Thursday" = "Jeudi"; -"Friday" = "Vendredi"; -"Saturday" = "Samedi"; - -"Sun" = "Dim"; -"Mon" = "Lun"; -"Tue" = "Mar"; -"Wed" = "Mer"; -"Thu" = "Jeu"; -"Fri" = "Ven"; -"Sat" = "Sam"; +"Sunday" = "Dimanche"; +"Monday" = "Lundi"; +"Tuesday" = "Mardi"; +"Wednesday" = "Mercredi"; +"Thursday" = "Jeudi"; +"Friday" = "Vendredi"; +"Saturday" = "Samedi"; + +"a2_Sunday" = "Di"; +"a2_Monday" = "Lu"; +"a2_Tuesday" = "Ma"; +"a2_Wednesday" = "Me"; +"a2_Thursday" = "Je"; +"a2_Friday" = "Ve"; +"a2_Saturday" = "Sa"; "dayLabelFormat" = "%Y-%m-%d"; @@ -43,18 +43,23 @@ "November" = "Novembre"; "December" = "Décembre"; -"Jan" = "Jan"; -"Feb" = "Fév"; -"Mar" = "Mar"; -"Apr" = "Avr"; -"May" = "Mai"; -"Jun" = "Jun"; -"Jul" = "Jul"; -"Aug" = "Aoû"; -"Sep" = "Sep"; -"Oct" = "Oct"; -"Nov" = "Nov"; -"Dec" = "Déc"; +"a3_January" = "Jan"; +"a3_February" = "Feb"; +"a3_March" = "Mar"; +"a3_April" = "Apr"; +"a3_May" = "May"; +"a3_June" = "Jun"; +"a3_July" = "Jul"; +"a3_August" = "Aug"; +"a3_September" = "Sep"; +"a3_October" = "Oct"; +"a3_November" = "Nov"; +"a3_December" = "Dec"; + + +/* Year */ + +"this year" = "this year"; /* Misc */ diff --git a/SOGo/UI/Scheduler/GNUmakefile b/SOGo/UI/Scheduler/GNUmakefile index 3df9e56b..fcef9b24 100644 --- a/SOGo/UI/Scheduler/GNUmakefile +++ b/SOGo/UI/Scheduler/GNUmakefile @@ -20,6 +20,8 @@ SchedulerUI_OBJC_FILES = \ \ UIxCalWeekOverview.m \ UIxCalMonthOverview.m \ + UIxCalYearOverview.m \ + UIxCalInlineMonthOverview.m \ UIxAppointmentView.m \ UIxAppointmentEditor.m \ UIxCalSelectTab.m \ @@ -33,6 +35,8 @@ SchedulerUI_RESOURCE_FILES += \ UIxAptTableView.wox \ UIxCalWeekOverview.wox \ UIxCalMonthOverview.wox \ + UIxCalYearOverview.wox \ + UIxCalInlineMonthOverview.wox \ UIxAppointmentView.wox \ UIxAppointmentEditor.wox \ UIxCalSelectTab.wox \ diff --git a/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m b/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m new file mode 100644 index 00000000..cc6fa7b7 --- /dev/null +++ b/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.m @@ -0,0 +1,221 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#include "UIxCalMonthOverview.h" +#include + + +@interface UIxCalInlineMonthOverview : UIxCalMonthOverview +{ + NSCalendarDate *selectedDate; + NSString *headerStyle; + NSString *weekStyle; + NSString *todayWeekStyle; + NSString *dayHeaderStyle; + NSString *dayBodyStyle; + NSString *todayBodyStyle; + NSString *inactiveDayBodyStyle; + NSString *daySelectionHref; + NSString *weekSelectionHref; + NSString *monthSelectionHref; + BOOL showWeekColumn; + BOOL showYear; +} + +@end + +@implementation UIxCalInlineMonthOverview + +/* init & dealloc */ + +- (void)dealloc { + [self->selectedDate release]; + [self->headerStyle release]; + [self->weekStyle release]; + [self->todayWeekStyle release]; + [self->dayHeaderStyle release]; + [self->dayBodyStyle release]; + [self->todayBodyStyle release]; + [self->inactiveDayBodyStyle release]; + [self->daySelectionHref release]; + [self->weekSelectionHref release]; + [self->monthSelectionHref release]; + [super dealloc]; +} + + +/* binding accessors */ + +- (void)setSelectedDate:(NSCalendarDate *)_date { + [_date setTimeZone:[self viewTimeZone]]; + ASSIGN(self->selectedDate, _date); +} +- (NSCalendarDate *)selectedDate { + return self->selectedDate; +} +- (void)setHeaderStyle:(NSString *)_style { + ASSIGN(self->headerStyle, _style); +} +- (NSString *)headerStyle { + return self->headerStyle; +} +- (void)setWeekStyle:(NSString *)_style { + ASSIGN(self->weekStyle, _style); +} +- (NSString *)weekStyle { + return self->weekStyle; +} +- (void)setTodayWeekStyle:(NSString *)_style { + ASSIGN(self->todayWeekStyle, _style); +} +- (NSString *)todayWeekStyle { + if(self->todayWeekStyle) + return self->todayWeekStyle; + return [self weekStyle]; +} +- (void)setDayHeaderStyle:(NSString *)_style { + ASSIGN(self->dayHeaderStyle, _style); +} +- (NSString *)dayHeaderStyle { + return self->dayHeaderStyle; +} +- (void)setDayBodyStyle:(NSString *)_style { + ASSIGN(self->dayBodyStyle, _style); +} +- (NSString *)dayBodyStyle { + return self->dayBodyStyle; +} +- (void)setTodayBodyStyle:(NSString *)_style { + ASSIGN(self->todayBodyStyle, _style); +} +- (NSString *)todayBodyStyle { + return self->todayBodyStyle; +} +- (void)setInactiveDayBodyStyle:(NSString *)_style { + ASSIGN(self->inactiveDayBodyStyle, _style); +} +- (NSString *)inactiveDayBodyStyle { + return self->inactiveDayBodyStyle; +} +- (void)setDaySelectionHref:(NSString *)_href { + ASSIGN(self->daySelectionHref, _href); +} +- (NSString *)daySelectionHref { + return self->daySelectionHref; +} +- (BOOL)hasDaySelectionHref { + return self->daySelectionHref != nil; +} +- (void)setWeekSelectionHref:(NSString *)_href { + ASSIGN(self->weekSelectionHref, _href); +} +- (NSString *)weekSelectionHref { + return self->weekSelectionHref; +} +- (BOOL)hasWeekSelectionHref { + return self->weekSelectionHref != nil; +} +- (void)setMonthSelectionHref:(NSString *)_href { + ASSIGN(self->monthSelectionHref, _href); +} +- (NSString *)monthSelectionHref { + return self->monthSelectionHref; +} +- (BOOL)hasMonthSelectionHref { + return self->monthSelectionHref != nil; +} +- (void)setShowWeekColumn:(BOOL)_yn { + self->showWeekColumn = _yn; +} +- (BOOL)showWeekColumn { + return self->showWeekColumn; +} +- (void)setShowYear:(BOOL)_yn { + self->showYear = _yn; +} +- (BOOL)showYear { + return self->showYear; +} + + +/* date ranges */ + + +- (NSCalendarDate *)startDate { + return [[self selectedDate] firstDayOfMonth]; +} + + +/* labels */ + +- (NSString *)headerString { + NSString *label; + + label = [self localizedNameForMonthOfYear:[[self startDate] monthOfYear]]; + if([self showYear]) { + label = [NSString stringWithFormat:@"%@ %d", + label, + [[self startDate] yearOfCommonEra]]; + } + return label; +} + +- (NSString *)localizedDayOfWeekName { + return [self localizedAbbreviatedNameForDayOfWeek:[self dayOfWeek]]; +} + + +/* stylesheets */ + +- (NSString *)currentWeekStyle { + if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]]) + return [self todayWeekStyle]; + return [self weekStyle]; +} + +- (NSString *)currentDayStyle { + return [self dayBodyStyle]; +} + +- (NSString *)contentStyle { + if([self->currentDay isToday]) + return [self todayBodyStyle]; + else if([self->currentDay monthOfYear] != [[self startDate] monthOfYear]) + return [self inactiveDayBodyStyle]; + return [self dayBodyStyle]; +} + + +/* URLs */ + +- (NSDictionary *)currentMonthQueryParameters { + return [self queryParametersBySettingSelectedDate:[self startDate]]; +} + +/* overriding */ + +- (NSArray *)fetchCoreInfos { + return nil; +} + +@end diff --git a/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.wox b/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.wox new file mode 100644 index 00000000..5414385f --- /dev/null +++ b/SOGo/UI/Scheduler/UIxCalInlineMonthOverview.wox @@ -0,0 +1,61 @@ + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/SOGo/UI/Scheduler/UIxCalMonthOverview.h b/SOGo/UI/Scheduler/UIxCalMonthOverview.h new file mode 100644 index 00000000..9e8a0aea --- /dev/null +++ b/SOGo/UI/Scheduler/UIxCalMonthOverview.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#include "UIxCalMonthView.h" + + +@class NSCalendarDate, NSString, NSDictionary, NSArray; + + +@interface UIxCalMonthOverview : UIxCalMonthView +{ + int dayIndex; + int dayOfWeek; + int weekOfYear; + NSCalendarDate *currentWeekStart; +} + +- (void)setDayIndex:(int)_idx; +- (int)dayIndex; +- (void)setDayOfWeek:(int)_day; +- (int)dayOfWeek; + +- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date; +- (NSCalendarDate *)currentWeekStartDate; +- (void)setWeekOfYear:(int)_week; +- (int)weekOfYear; +- (int)year; +- (int)month; +- (NSString *)localizedDayOfWeekName; +- (NSDictionary *)currentWeekQueryParameters; + + +/* style sheet */ + + +- (NSString *)weekStyle; + +- (NSString *)contentStyle; + + +/* appointments */ + + +- (NSArray *)appointments; + +@end + diff --git a/SOGo/UI/Scheduler/UIxCalMonthOverview.m b/SOGo/UI/Scheduler/UIxCalMonthOverview.m index 756f85a1..68550fe7 100644 --- a/SOGo/UI/Scheduler/UIxCalMonthOverview.m +++ b/SOGo/UI/Scheduler/UIxCalMonthOverview.m @@ -1,21 +1,8 @@ // $Id$ -#include "UIxCalMonthView.h" +#include "UIxCalMonthOverview.h" #include - -@interface UIxCalMonthOverview : UIxCalMonthView -{ - int dayIndex; - int dayOfWeek; - int weekOfYear; - NSCalendarDate *currentWeekStart; -} - -@end - -#include "common.h" - @implementation UIxCalMonthOverview diff --git a/SOGo/UI/Scheduler/UIxCalYearOverview.m b/SOGo/UI/Scheduler/UIxCalYearOverview.m new file mode 100644 index 00000000..202eeee5 --- /dev/null +++ b/SOGo/UI/Scheduler/UIxCalYearOverview.m @@ -0,0 +1,164 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#include +#include + + +@interface UIxCalYearOverview : UIxComponent +{ + NSArray *row; + NSCalendarDate *month; +} + +- (NSCalendarDate *)startDate; +- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date; +- (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate + inDictionary:(NSMutableDictionary *)_qp; + +@end + + +@implementation UIxCalYearOverview + +/* init & dealloc */ + +- (void)dealloc { + [self->row release]; + [self->month release]; + [super dealloc]; +} + + +/* accessors */ + +- (void)setRow:(NSArray *)_row { + ASSIGN(self->row, _row); +} + +- (NSArray *)row { + return self->row; +} + +- (void)setMonth:(NSCalendarDate *)_date { + ASSIGN(self->month, _date); +} + +- (NSCalendarDate *)month { + return self->month; +} + +- (int)year { + return [[self selectedDate] yearOfCommonEra]; +} + +- (NSArray *)arrayOfDateArrays { + NSCalendarDate *startDate; + NSMutableArray *result, *tmp; + unsigned rowIdx, columnIdx; + int month = 0; + + startDate = [self startDate]; + result = [[NSMutableArray alloc] initWithCapacity:3]; + for(rowIdx = 0; rowIdx < 3; rowIdx++) { + tmp = [[NSMutableArray alloc] initWithCapacity:4]; + for(columnIdx = 0; columnIdx < 4; columnIdx++) { + NSCalendarDate *date; + + date = [startDate dateByAddingYears:0 + months:month + days:0]; + [tmp addObject:date]; + month++; + } + [result addObject:tmp]; + [tmp release]; + } + return [result autorelease]; +} + + +/* date ranges */ + +- (NSCalendarDate *)startDate { + return [[[NSCalendarDate alloc] initWithYear:[self year] month:1 day:1 + hour:0 minute:0 second:0 + timeZone:[self viewTimeZone]] autorelease]; +} + +- (NSCalendarDate *)endDate { + return nil; +} + + +/* URLs */ + +- (NSDictionary *)todayQueryParameters { + NSCalendarDate *date; + + date = [NSCalendarDate date]; /* today */ + return [self queryParametersBySettingSelectedDate:date]; +} + +- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date { + NSMutableDictionary *qp; + + qp = [[self queryParameters] mutableCopy]; + [self setSelectedDateQueryParameter:_date inDictionary:qp]; + return [qp autorelease]; +} + +- (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate + inDictionary:(NSMutableDictionary *)_qp; +{ + if(_newDate != nil) + [_qp setObject:[self dateStringForDate:_newDate] forKey:@"day"]; + else + [_qp removeObjectForKey:@"day"]; +} + +- (NSDictionary *)prevYearQueryParameters { + NSCalendarDate *date; + + date = [[self startDate] dateByAddingYears:-1 + months:0 + days:0 + hours:0 + minutes:0 + seconds:0]; + return [self queryParametersBySettingSelectedDate:date]; +} + +- (NSDictionary *)nextYearQueryParameters { + NSCalendarDate *date; + + date = [[self startDate] dateByAddingYears:1 + months:0 + days:0 + hours:0 + minutes:0 + seconds:0]; + return [self queryParametersBySettingSelectedDate:date]; +} + +@end diff --git a/SOGo/UI/Scheduler/UIxCalYearOverview.wox b/SOGo/UI/Scheduler/UIxCalYearOverview.wox new file mode 100644 index 00000000..5a36f29f --- /dev/null +++ b/SOGo/UI/Scheduler/UIxCalYearOverview.wox @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + +
+ + + + + +
+ + +
+
+ + + + + +
TODO: controls + +
+
+ + + + + + + + + + + +
+ + + + + + + + + +
+ +
+
+
+ + +
+
+
+
diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 434e1ad2..38b76bc3 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,5 +1,5 @@ # $Id$ -SUBMINOR_VERSION:=2 +SUBMINOR_VERSION:=4 # 1.1.0 requires NGObjWeb 4.2.202 diff --git a/SOGo/UI/Scheduler/product.plist b/SOGo/UI/Scheduler/product.plist index d1839ec5..1e85c93b 100644 --- a/SOGo/UI/Scheduler/product.plist +++ b/SOGo/UI/Scheduler/product.plist @@ -43,6 +43,10 @@ protectedBy = "View"; pageName = "UIxCalMonthOverview"; }; + "yearoverview" = { + protectedBy = "View"; + pageName = "UIxCalYearOverview"; + }; "new" = { protectedBy = "View"; pageName = "UIxAppointmentEditor";