From 07225fe5888340f8191e678facd9f1537fe02984 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 3 Nov 2008 14:17:57 +0000 Subject: [PATCH] Monotone-Parent: 093eb3ebcf238b8c813759fda17e22addd7cc0b0 Monotone-Revision: 34dbce3026b164b07c558711781fcfb5cde0fcff Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-11-03T14:17:57 Monotone-Branch: ca.inverse.sogo --- .../Appointments/iCalRepeatableEntityObject+SOGo.m | 10 ++++++++++ UI/Scheduler/UIxAppointmentEditor.m | 3 +++ UI/WebServerResources/SchedulerUI.js | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m b/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m index 7548471d7..4cd59a0b0 100644 --- a/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m +++ b/SoObjects/Appointments/iCalRepeatableEntityObject+SOGo.m @@ -21,8 +21,10 @@ */ #import +#import #import #import +#import #import #import @@ -107,11 +109,19 @@ NSArray *ranges; NGCalendarDateRange *checkRange; NSCalendarDate *endDate; + NSTimeZone *tz; BOOL doesOccur; + signed daylightOffset; doesOccur = [self isRecurrent]; if (doesOccur) { + tz = [occurenceDate timeZone]; + if ([tz isDaylightSavingTimeForDate: occurenceDate] != [tz isDaylightSavingTimeForDate: [self startDate]]) { + daylightOffset = [tz secondsFromGMTForDate: occurenceDate] - [tz secondsFromGMTForDate: [self startDate]]; + occurenceDate = [occurenceDate dateByAddingYears: 0 months: 0 days: 0 hours: 0 minutes: 0 seconds: daylightOffset]; + } + endDate = [occurenceDate addTimeInterval: [self occurenceInterval]]; checkRange = [NGCalendarDateRange calendarDateRangeWithStartDate: occurenceDate endDate: endDate]; diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 4e3311336..f782d193e 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -43,6 +43,7 @@ #import #import #import +#import #import @@ -270,6 +271,8 @@ { sm = [SoSecurityManager sharedSecurityManager]; + if ([co isKindOfClass: [SOGoAppointmentOccurence class]]) + co = [co container]; thisFolder = [co container]; if (componentCalendar != thisFolder) if (![sm validatePermission: SoPerm_DeleteObjects diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 2863183af..17e35b46a 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -313,7 +313,10 @@ function _editRecurrenceDialog(eventDiv, method) { function onViewEvent(event) { if (event.detail == 2) return; - var url = ApplicationBaseURL + this.calendar + "/" + this.cname + "/view"; + var url = ApplicationBaseURL + this.calendar + "/" + this.cname; + if (typeof this.recurrenceTime != "undefined") + url += "/occurence" + this.recurrenceTime; + url += "/view"; if (document.viewEventAjaxRequest) { document.viewEventAjaxRequest.aborted = true; document.viewEventAjaxRequest.abort();