mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user