Monotone-Parent: 3a3e7e985adac6637eacd797235cdf6c4eae70cb

Monotone-Revision: c0313f0b5f2d308876016aebbaf81c198b684173

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-06-12T15:36:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-06-12 15:36:10 +00:00
parent c8cea8fa21
commit 5afdcba397
2 changed files with 64 additions and 67 deletions

View File

@@ -31,10 +31,10 @@
NSString *currentTableHour;
NSMutableArray *subscriptionUsers;
NSMutableArray *hoursToDisplay;
NSArray *allAppointments;
// NSArray *allAppointments;
NSString *currentTableUser;
NSDictionary *currentAppointment;
// NSDictionary *currentAppointment;
NSString *cssClass;
NSString *cssId;
@@ -50,8 +50,8 @@
- (void) setCurrentTableUser: (NSString *) aTableDay;
- (NSString *) currentTableUser;
- (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment;
- (NSDictionary *) currentAppointment;
// - (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment;
// - (NSDictionary *) currentAppointment;
@end

View File

@@ -38,13 +38,13 @@
{
if ((self = [super init]))
{
allAppointments = nil;
// allAppointments = nil;
subscriptionUsers = nil;
hoursToDisplay = nil;
currentTableUser = nil;
currentTableHour = nil;
dateFormatter = [[SOGoDateFormatter alloc]
initWithLocale: [self locale]];
// dateFormatter = [[SOGoDateFormatter alloc]
// initWithLocale: [self locale]];
}
return self;
@@ -52,13 +52,10 @@
- (void) dealloc
{
if (allAppointments)
[allAppointments release];
if (subscriptionUsers)
[subscriptionUsers release];
if (hoursToDisplay)
[hoursToDisplay release];
[dateFormatter release];
// [allAppointments release];
[subscriptionUsers release];
[hoursToDisplay release];
// [dateFormatter release];
[super dealloc];
}
@@ -189,69 +186,69 @@
/* fetching */
- (NSCalendarDate *) startDate
{
return [[self selectedDate] beginOfDay];
}
// - (NSCalendarDate *) startDate
// {
// return [[self selectedDate] beginOfDay];
// }
- (NSCalendarDate *) endDate
{
return [[self selectedDate] endOfDay];
}
// - (NSCalendarDate *) endDate
// {
// return [[self selectedDate] endOfDay];
// }
- (NSArray *) appointmentsForCurrentUser
{
NSMutableArray *filteredAppointments;
NSEnumerator *aptsEnumerator;
NSDictionary *userAppointment;
NSCalendarDate *start, *end;
int endHour;
// - (NSArray *) appointmentsForCurrentUser
// {
// NSMutableArray *filteredAppointments;
// NSEnumerator *aptsEnumerator;
// NSDictionary *userAppointment;
// NSCalendarDate *start, *end;
// int endHour;
if (!allAppointments)
{
allAppointments = [self fetchCoreAppointmentsInfos];
[allAppointments retain];
}
// if (!allAppointments)
// {
// allAppointments = [self fetchCoreAppointmentsInfos];
// [allAppointments retain];
// }
start = [[self selectedDate] hour: [self dayStartHour] minute: 0];
endHour = [self dayEndHour];
if (endHour < 24)
end = [[self selectedDate] hour: [self dayEndHour] minute: 59];
else
end = [[[self selectedDate] tomorrow] hour: 0 minute: 0];
// start = [[self selectedDate] hour: [self dayStartHour] minute: 0];
// endHour = [self dayEndHour];
// if (endHour < 24)
// end = [[self selectedDate] hour: [self dayEndHour] minute: 59];
// else
// end = [[[self selectedDate] tomorrow] hour: 0 minute: 0];
filteredAppointments = [NSMutableArray new];
[filteredAppointments autorelease];
// filteredAppointments = [NSMutableArray new];
// [filteredAppointments autorelease];
aptsEnumerator = [allAppointments objectEnumerator];
userAppointment = [aptsEnumerator nextObject];
while (userAppointment)
{
if ([[userAppointment objectForKey: @"owner"]
isEqualToString: currentTableUser])
[filteredAppointments
addObject: [self _adjustedAppointment: userAppointment
forStart: start andEnd: end]];
userAppointment = [aptsEnumerator nextObject];
}
// aptsEnumerator = [allAppointments objectEnumerator];
// userAppointment = [aptsEnumerator nextObject];
// while (userAppointment)
// {
// if ([[userAppointment objectForKey: @"owner"]
// isEqualToString: currentTableUser])
// [filteredAppointments
// addObject: [self _adjustedAppointment: userAppointment
// forStart: start andEnd: end]];
// userAppointment = [aptsEnumerator nextObject];
// }
return filteredAppointments;
}
// return filteredAppointments;
// }
- (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment
{
currentAppointment = newCurrentAppointment;
}
// - (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment
// {
// currentAppointment = newCurrentAppointment;
// }
- (NSDictionary *) currentAppointment
{
return currentAppointment;
}
// - (NSDictionary *) currentAppointment
// {
// return currentAppointment;
// }
- (NSString *) appointmentsClasses
{
return @"appointments appointmentsFor1Days";
}
// - (NSString *) appointmentsClasses
// {
// return @"appointments appointmentsFor1Days";
// }
- (NSString *) currentUserClasses
{