Improved read-only tasks/events web view

Monotone-Parent: af17dd6e983493b4bd201d8d0a23bdac014fa84c
Monotone-Revision: 08f744da20c99e50446879fca5f5ee8194b2217b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-07-29T18:46:44
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-07-29 18:46:44 +00:00
parent d7a9423108
commit 1cc51af9ef
11 changed files with 266 additions and 175 deletions
+7 -46
View File
@@ -978,8 +978,14 @@ iRANGE(2);
- (NSNumber *) reply
{
iCalPersonPartStat participationStatus;
LDAPUserManager *um;
NSString *owner, *ownerEmail;
participationStatus = [[component findParticipant: [context activeUser]] participationStatus];
um = [LDAPUserManager sharedUserManager];
owner = [componentCalendar ownerInContext: context];
ownerEmail = [um getEmailForUID: owner];
// We assume the owner is part of the participants
participationStatus = [[component findParticipantWithEmail: (id)ownerEmail] participationStatus];
return [NSNumber numberWithInt: participationStatus];
}
@@ -2050,49 +2056,4 @@ RANGE(2);
return [self getEventRWType] == 1;
}
- (NSCalendarDate *) getDateFor: (NSString *) when
{
NSCalendarDate *startDate, *endDate, *firstDate, *rc;
NSTimeZone *timeZone;
iCalEvent *master;
signed int daylightOffset;
startDate = [component startDate];
daylightOffset = 0;
if ([component isKindOfClass: [SOGoAppointmentOccurence class]])
{
master = (iCalEvent*)[[component parent] firstChildWithTag: @"vevent"];
firstDate = [master startDate];
timeZone = [[context activeUser] timeZone];
if ([timeZone isDaylightSavingTimeForDate: startDate] != [timeZone isDaylightSavingTimeForDate: firstDate])
{
daylightOffset = (signed int)[timeZone secondsFromGMTForDate: firstDate]
- (signed int)[timeZone secondsFromGMTForDate: startDate];
startDate = [startDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset];
}
}
[startDate setTimeZone: [[context activeUser] timeZone]];
endDate = [[component endDate] dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset];
[endDate setTimeZone: [[context activeUser] timeZone]];
if ([when isEqualToString: @"start"])
rc = startDate;
else
rc = endDate;
return rc;
}
- (NSString *) startDateString
{
return [[self getDateFor: @"start"] description];
}
- (NSString *) endDateString
{
return [[self getDateFor: @"end"] description];
}
@end