diff --git a/NEWS b/NEWS index 88404419e..06180a76b 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Bug fixes - [web] fixed synchronisation of calendar categories - [web] fixed popup window detection in message viewer (#4518) - [web] fixed behaviour of return receipt actions + - [core] fixed email reminders support for tasks 4.0.2 (2018-08-24) ------------------ diff --git a/SoObjects/Appointments/SOGoAptMailNotification.h b/SoObjects/Appointments/SOGoAptMailNotification.h index 407c25184..b650ee9e9 100644 --- a/SoObjects/Appointments/SOGoAptMailNotification.h +++ b/SoObjects/Appointments/SOGoAptMailNotification.h @@ -1,6 +1,5 @@ /* - Copyright (C) 2006-2012 Inverse inc. - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2006-2018 Inverse inc. This file is part of SOGo. @@ -15,7 +14,7 @@ License for more details. You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the + License along with SOGo; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -29,7 +28,7 @@ @class NSMutableDictionary; @class NSString; @class NSTimeZone; -@class iCalEvent; +@class iCalRepeatableEntityObject; @class SOGoDateFormatter; /* @@ -38,8 +37,8 @@ */ @interface SOGoAptMailNotification : SoComponent { - iCalEvent *apt; - iCalEvent *previousApt; + iCalRepeatableEntityObject *apt; + iCalRepeatableEntityObject *previousApt; NSString *homePageURL; NSTimeZone *viewTZ; NSCalendarDate *oldStartDate; @@ -53,11 +52,11 @@ - (void) setupValues; -- (iCalEvent *) apt; -- (void) setApt: (iCalEvent *) theApt; +- (iCalRepeatableEntityObject *) apt; +- (void) setApt: (iCalRepeatableEntityObject *) theApt; -- (iCalEvent *) previousApt; -- (void) setPreviousApt: (iCalEvent *) theApt; +- (iCalRepeatableEntityObject *) previousApt; +- (void) setPreviousApt: (iCalRepeatableEntityObject *) theApt; - (void) setOrganizerName: (NSString *) theString; - (NSString *) organizerName; diff --git a/SoObjects/Appointments/SOGoAptMailNotification.m b/SoObjects/Appointments/SOGoAptMailNotification.m index 456349dfc..a967f61ab 100644 --- a/SoObjects/Appointments/SOGoAptMailNotification.m +++ b/SoObjects/Appointments/SOGoAptMailNotification.m @@ -28,7 +28,7 @@ #import #import #import - +#import #import #import #import @@ -68,22 +68,22 @@ [super dealloc]; } -- (iCalEvent *) apt +- (iCalRepeatableEntityObject *) apt { return apt; } -- (void) setApt: (iCalEvent *) theApt +- (void) setApt: (iCalRepeatableEntityObject *) theApt { ASSIGN (apt, theApt); } -- (iCalEvent *) previousApt +- (iCalRepeatableEntityObject *) previousApt { return previousApt; } -- (void) setPreviousApt: (iCalEvent *) theApt +- (void) setPreviousApt: (iCalRepeatableEntityObject *) theApt { ASSIGN (previousApt, theApt); } @@ -122,7 +122,10 @@ { if (!oldEndDate) { - ASSIGN (oldEndDate, [[self previousApt] endDate]); + if ([[self previousApt] isKindOfClass: [iCalEvent class]]) + ASSIGN (oldEndDate, [(iCalEvent*)[self previousApt] endDate]); + else + ASSIGN (oldEndDate, [(iCalToDo*)[self previousApt] due]); [oldEndDate setTimeZone: viewTZ]; } return oldEndDate; @@ -132,7 +135,10 @@ { if (!newEndDate) { - ASSIGN (newEndDate, [[self apt] endDate]); + if ([[self apt] isKindOfClass: [iCalEvent class]]) + ASSIGN (newEndDate, [(iCalEvent*)[self apt] endDate]); + else + ASSIGN (newEndDate, [(iCalToDo*)[self apt] due]); [newEndDate setTimeZone: viewTZ]; } return newEndDate; @@ -191,7 +197,7 @@ - (BOOL) isEndDateOnSameDay { - if ([[self apt] isAllDay]) + if ([[self apt] isKindOfClass: [iCalEvent class]] && [(iCalEvent*)[self apt] isAllDay]) return ([self duration] <= 86400); return [[self newStartDate] isDateOnSameDay: [self newEndDate]]; @@ -220,7 +226,7 @@ value = [self newStartDate]; s = @""; - if (value && ![apt isAllDay]) + if (value && (![apt isKindOfClass: [iCalEvent class]] || ![(iCalEvent*)apt isAllDay])) s = [dateFormatter formattedTime: value]; return s; @@ -248,7 +254,7 @@ value = [self newEndDate]; s = @""; - if (value && ![apt isAllDay]) + if (value && (![apt isKindOfClass: [iCalEvent class]] || ![(iCalEvent*)apt isAllDay])) s = [dateFormatter formattedTime: value]; return s; diff --git a/SoObjects/Appointments/SOGoAptMailReminder.m b/SoObjects/Appointments/SOGoAptMailReminder.m index 69d6e0109..bb8140680 100644 --- a/SoObjects/Appointments/SOGoAptMailReminder.m +++ b/SoObjects/Appointments/SOGoAptMailReminder.m @@ -125,33 +125,25 @@ static NSCharacterSet *wsSet = nil; - (NSString *) _formattedUserDate: (NSCalendarDate *) date { SOGoDateFormatter *formatter; - NSCalendarDate *tzDate; SOGoUser *currentUser; currentUser = [context activeUser]; - - tzDate = [date copy]; - [tzDate setTimeZone: viewTZ]; - [tzDate autorelease]; - formatter = [currentUser dateFormatterInContext: context]; - if ([apt isAllDay]) - return [formatter formattedDate: tzDate]; + if ([apt isKindOfClass: [iCalEvent class]] && [(iCalEvent*)apt isAllDay]) + return [formatter formattedDate: date]; else - return [NSString stringWithFormat: @"%@, %@", - [formatter formattedDate: tzDate], - [formatter formattedTime: tzDate]]; + return [formatter formattedDateAndTime: date]; } - (NSString *) aptStartDate { - return [self _formattedUserDate: [apt startDate]]; + return [self _formattedUserDate: [self newStartDate]]; } - (NSString *) aptEndDate { - return [self _formattedUserDate: [(iCalEvent *) apt endDate]]; + return [self _formattedUserDate: [self newEndDate]]; } - (iCalPerson *) organizer diff --git a/UI/Templates/Appointments/SOGoAptMailReminder.wox b/UI/Templates/Appointments/SOGoAptMailReminder.wox index 1c3caad04..1d04e678d 100644 --- a/UI/Templates/Appointments/SOGoAptMailReminder.wox +++ b/UI/Templates/Appointments/SOGoAptMailReminder.wox @@ -33,10 +33,11 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon - + - +