From 1ee7693432df178fe176d1d92a2c4fcf7e56fed6 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 1 Nov 2016 14:52:18 -0400 Subject: [PATCH] Fix support for recurrent tasks (cont'd) Fixes #3864 --- NEWS | 3 +- .../Appointments/SOGoAppointmentFolder.m | 6 +- SoObjects/Appointments/iCalToDo+SOGo.m | 9 ++- UI/Templates/SchedulerUI/UIxCalMainView.wox | 2 +- .../SchedulerUI/UIxTaskEditorTemplate.wox | 64 ++++++++++++++++++- .../js/Scheduler/Component.service.js | 4 +- 6 files changed, 78 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 4ebb81e11..b2f9e2b2a 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,8 @@ Bug fixes - [web] fixed vCard generation for tags with no type (#3826) - [web] only show the organizer field of an IMIP REPLY if one is defined - [web] fixed saving the note of a card (#3849) - - [web] fixed support for recurrent tasks + - [web] fixed support for recurrent tasks (#3864) + - [web] restored support for alarms in tasks - [web] improved validation of mail account delegators - [web] fixed auto-completion of list members (#3870) - [web] added missing options to subscribed addressbooks (#3850) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 8ea61da6e..24a23fb20 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1007,13 +1007,13 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir { master = [[[component parent] events] objectAtIndex: 0]; masterEndDate = [master endDate]; - endDate = [component endDate]; + endDate = [(iCalEvent*) component endDate]; } else { master = [[[component parent] todos] objectAtIndex: 0]; masterEndDate = [master due]; - endDate = [component due]; + endDate = [(iCalToDo*) component due]; } delta = [masterEndDate timeIntervalSinceDate: [master startDate]]; @@ -1027,7 +1027,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir if (recordIndex > -1) { if ([dateRange containsDate: [component startDate]] || - [dateRange containsDate: endDate]) + (endDate && [dateRange containsDate: endDate])) { // We must pass nil to :container here in order to avoid re-entrancy issues. newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]]; diff --git a/SoObjects/Appointments/iCalToDo+SOGo.m b/SoObjects/Appointments/iCalToDo+SOGo.m index 7cb00323e..6ff4b6b06 100644 --- a/SoObjects/Appointments/iCalToDo+SOGo.m +++ b/SoObjects/Appointments/iCalToDo+SOGo.m @@ -1,6 +1,6 @@ /* iCalToDot+SOGo.m - this file is part of SOGo * - * Copyright (C) 2008-2014 Inverse inc. + * Copyright (C) 2008-2016 Inverse inc. * * 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 @@ -32,6 +32,7 @@ #import +#import #import #import #import @@ -367,7 +368,11 @@ - (NSTimeInterval) occurenceInterval { - return [[self due] timeIntervalSinceDate: [self startDate]]; + if ([self due]) + return [[self due] timeIntervalSinceDate: [self startDate]]; + else + // When no due date is defined, base recurrence calculation on a 60-minute duration + return 3600; } @end diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index 5587df286..75782bae0 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -661,7 +661,7 @@
repeat - alarm + alarm
diff --git a/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox index 893c6fe8f..d6dbda222 100644 --- a/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxTaskEditorTemplate.wox @@ -181,7 +181,69 @@
{{editor.component.percentComplete}}
- + +
+
+ + + + + + + + + + add + +
+
+ +
+ +
+ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + + + +
+ +
+
diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index edbcaf8b1..c0821211a 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -1129,7 +1129,7 @@ else if (this.repeat.frequency && this.repeat.frequency != 'never') { component.repeat = { frequency: this.repeat.frequency }; } - if (this.repeat.frequency) { + if (component.startDate && this.repeat.frequency) { if (this.repeat.end == 'until' && this.repeat.until) component.repeat.until = this.repeat.until.stringWithSeparator('-'); else if (this.repeat.end == 'count' && this.repeat.count) @@ -1150,7 +1150,7 @@ delete component.completedDate; // Verify alarm - if (this.$hasAlarm) { + if (component.startDate && this.$hasAlarm) { if (this.alarm.action && this.alarm.action == 'email' && !(this.attendees && this.attendees.length > 0)) { // No attendees; email reminder must be sent to organizer only