Monotone-Parent: 55b46093b748e72cd037f89dc45b4785c5466dc6

Monotone-Revision: 3292f2d387157f6c1152305848b550e74545263e

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-03-12T23:06:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-03-12 23:06:48 +00:00
parent fd0d5ab723
commit f8e3c30e2c
13 changed files with 696 additions and 476 deletions
+1
View File
@@ -45,6 +45,7 @@ SchedulerUI_OBJC_FILES = \
UIxDatePicker.m \
UIxTimeDateControl.m \
UIxCalInlineAptView.m \
UIxCalInlineMonthAptView.m \
UIxCalScheduleOverview.m \
UIxCalParticipationStatusView.m \
UIxCalMonthOverview.m
+44
View File
@@ -0,0 +1,44 @@
/*
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: UIxCalInlineAptView.h 1031 2007-03-07 22:52:32Z wolfgang $
#ifndef UIXCALINLINEAPTVIEW_H
#define UIXCALINLINEAPTVIEW_H
#import <NGObjWeb/WOComponent.h>
@interface UIxCalInlineAptView : WOComponent
{
NSDictionary *appointment;
id formatter;
id tooltipFormatter;
id url;
id style;
id queryDictionary;
id referenceDate;
int dayStartHour;
int dayEndHour;
BOOL canAccess;
}
@end
#endif /* UIXCALINLINEAPTVIEW_H */
+9 -23
View File
@@ -18,36 +18,22 @@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: UIxCalInlineAptView.m 1029 2007-03-02 22:28:13Z wolfgang $
// $Id: UIxCalInlineAptView.m 1031 2007-03-07 22:52:32Z wolfgang $
#import <math.h>
#import <Foundation/NSDictionary.h>
#import <NGObjWeb/NGObjWeb.h>
#import <SOGo/SOGoAuthenticator.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSCalendarDate+misc.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGCards/iCalEntityObject.h>
#import <SOGo/SOGoAuthenticator.h>
#import <SOGo/SOGoUser.h>
#import <SOGoUI/SOGoAptFormatter.h>
@interface UIxCalInlineAptView : WOComponent
{
NSDictionary *appointment;
id formatter;
id tooltipFormatter;
id url;
id style;
id queryDictionary;
id referenceDate;
int dayStartHour;
int dayEndHour;
BOOL canAccess;
}
@end
#include "common.h"
#include <SOGoUI/SOGoAptFormatter.h>
#include <SOGo/SOGoUser.h>
#include <NGObjWeb/WOContext+SoObjects.h>
#import "UIxCalInlineAptView.h"
@implementation UIxCalInlineAptView
+32
View File
@@ -0,0 +1,32 @@
/* UIxCalInlineMonthAptView.h - this file is part of SOGo
*
* Copyright (C) 2007 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef UIXCALINLINEMONTHAPTVIEW_H
#define UIXCALINLINEMONTHAPTVIEW_H
#import "UIxCalInlineAptView.h"
@interface UIxCalInlineMonthAptView : UIxCalInlineAptView
@end
#endif /* UIXCALINLINEMONTHAPTVIEW_H */
+27
View File
@@ -0,0 +1,27 @@
/* UIxCalInlineMonthAptView.m - this file is part of SOGo
*
* Copyright (C) 2007 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import "UIxCalInlineMonthAptView.h"
@implementation UIxCalInlineMonthAptView
@end
+2 -7
View File
@@ -41,9 +41,9 @@
SOGoDateFormatter *dateFormatter;
NSMutableDictionary *sortedAppointments;
NSArray *daysToDisplay;
NSCalendarDate *currentTableDay;
// NSArray *rangesOf7Days;
NSArray *currentRangeOf7Days;
NSArray *currentTableColumn;
}
- (id <WOActionResults>) defaultAction;
@@ -68,11 +68,6 @@
- (NSCalendarDate *) currentTableDay;
- (NSString *) labelForCurrentDayCell;
- (NSArray *) rangesOf7Days;
- (void) setCurrentRangeOf7Days: (NSArray *) newCurrentRangeOf7Days;
- (NSArray *) currentRangeOf7Days;
@end
#endif /* UIXCALMONTHVIEW_H */
+77 -46
View File
@@ -1,6 +1,6 @@
/* UIxCalMonthView.m - this file is part of SOGo
*
* Copyright (C) 2006 Inverse groupe conseil
* Copyright (C) 2006, 2007 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
@@ -48,6 +48,7 @@
dateFormatter = [[SOGoDateFormatter alloc]
initWithLocale: [self locale]];
sortedAppointments = [NSMutableDictionary new];
daysToDisplay = nil;
}
return self;
@@ -60,6 +61,7 @@
- (void) dealloc
{
[daysToDisplay release];
[monthAptFormatter release];
[dateFormatter release];
[sortedAppointments release];
@@ -99,19 +101,46 @@
return self;
}
- (NSArray *) headerDaysToDisplay
{
NSMutableArray *headerDaysToDisplay;
unsigned int counter;
headerDaysToDisplay = [NSMutableArray arrayWithCapacity: 7];
currentTableDay = [[self selectedDate] mondayOfWeek];
for (counter = 0; counter < 7; counter++)
{
[headerDaysToDisplay addObject: currentTableDay];
currentTableDay = [currentTableDay tomorrow];
}
return headerDaysToDisplay;
}
- (NSArray *) daysToDisplay
{
NSMutableArray *daysToDisplay;
NSCalendarDate *currentDayToDisplay;
unsigned int day;
NSMutableArray *days[7];
unsigned int counter;
NSCalendarDate *firstOfAllDays, *lastDayOfMonth;
daysToDisplay = [NSMutableArray arrayWithCapacity: 7];
currentDayToDisplay = [[NSCalendarDate calendarDate] mondayOfWeek];
for (day = 0; day < 7; day++)
if (!daysToDisplay)
{
[daysToDisplay addObject: currentDayToDisplay];
currentDayToDisplay
= [currentDayToDisplay dateByAddingYears: 0 months: 0 days: 1];
firstOfAllDays = [[[self selectedDate] firstDayOfMonth] mondayOfWeek];
lastDayOfMonth = [[self selectedDate] lastDayOfMonth];
for (counter = 0; counter < 7; counter++)
{
days[counter] = [NSMutableArray new];
[days[counter] autorelease];
}
currentTableDay = firstOfAllDays;
while ([currentTableDay earlierDate: lastDayOfMonth] == currentTableDay)
for (counter = 0; counter < 7; counter++)
{
[days[counter] addObject: currentTableDay];
currentTableDay = [currentTableDay tomorrow];
}
daysToDisplay = [NSArray arrayWithObjects: days count: 7];
[daysToDisplay retain];
}
return daysToDisplay;
@@ -197,14 +226,14 @@
return currentTableDay;
}
- (void) setCurrentRangeOf7Days: (NSArray *) newCurrentRangeOf7Days
- (void) setCurrentTableColumn: (NSArray *) newCurrentTableColumn
{
currentRangeOf7Days = newCurrentRangeOf7Days;
currentTableColumn = newCurrentTableColumn;
}
- (NSArray *) currentRangeOf7Days
- (NSArray *) currentTableColumn
{
return currentRangeOf7Days;
return currentTableColumn;
}
- (NSString *) labelForCurrentDayCell
@@ -228,16 +257,48 @@
return label;
}
- (NSString *) headerDayCellClasses
{
return [NSString stringWithFormat: @"headerDay day%d",
[currentTableDay dayOfWeek]];
}
- (NSString *) dayHeaderNumber
{
NSString *nameOfMonth, *dayHeaderNumber;
unsigned int dayOfMonth;
dayOfMonth = [currentTableDay dayOfMonth];
if (dayOfMonth == 1
|| [currentTableDay isDateOnSameDay: [currentTableDay lastDayOfMonth]])
{
nameOfMonth
= [self localizedNameForMonthOfYear: [currentTableDay monthOfYear]];
dayHeaderNumber = [NSString stringWithFormat: @"%d %@", dayOfMonth,
nameOfMonth];
}
else
dayHeaderNumber = [NSString stringWithFormat: @"%d", dayOfMonth];
return dayHeaderNumber;
}
- (NSString *) dayCellClasses
{
NSMutableString *classes;
NSCalendarDate *selectedDate;
int dayOfWeek;
int dayOfWeek, numberOfWeeks;
classes = [NSMutableString new];
[classes autorelease];
[classes appendString: @"day"];
dayOfWeek = [currentTableDay dayOfWeek];
numberOfWeeks = [currentTableColumn count];
[classes appendFormat: @"day weekOf%d week%dof%d day%d",
numberOfWeeks,
[currentTableColumn indexOfObject: currentTableDay],
numberOfWeeks, dayOfWeek];
if (dayOfWeek == 0 || dayOfWeek == 6)
[classes appendString: @" weekEndDay"];
selectedDate = [self selectedDate];
@@ -287,36 +348,6 @@
return [[lastDayOfMonth mondayOfWeek] dateByAddingYears: 0 months: 0 days: 6];
}
- (NSArray *) rangesOf7Days
{
NSCalendarDate *currentDate, *firstDayOfMonth, *lastDayOfMonth;
NSMutableArray *rangesOf7Days;
NSArray *currentRange;
int monthOfYear;
rangesOf7Days = [NSMutableArray new];
[rangesOf7Days autorelease];
firstDayOfMonth = [[self selectedDate] firstDayOfMonth];
lastDayOfMonth = [firstDayOfMonth lastDayOfMonth];
currentDate = [firstDayOfMonth mondayOfWeek];
currentRange = [self _rangeOf7DaysForWeekStartingOn: currentDate];
[rangesOf7Days addObject: currentRange];
currentDate = [[currentRange objectAtIndex: 6] dateByAddingYears: 0
months: 0 days: 1];
monthOfYear = [currentDate monthOfYear];
while ([currentDate monthOfYear] == monthOfYear)
{
currentRange = [self _rangeOf7DaysForWeekStartingOn: currentDate];
[rangesOf7Days addObject: currentRange];
currentDate = [[currentRange objectAtIndex: 6] dateByAddingYears: 0
months: 0 days: 1];
}
return rangesOf7Days;
}
- (NSArray *) aptsForCurrentDate
{
return [sortedAppointments objectForKey: [currentTableDay shortDateString]];