Fix email reminders support for tasks

pull/229/merge
Francis Lachapelle 2018-09-13 14:56:44 -04:00
parent 563a2cd9df
commit a7c88597c6
5 changed files with 34 additions and 35 deletions

1
NEWS
View File

@ -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)
------------------

View File

@ -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;

View File

@ -28,7 +28,7 @@
#import <NGExtensions/NSCalendarDate+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGCards/iCalEvent.h>
#import <NGCards/iCalToDo.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/NSObject+Utilities.h>
#import <SOGo/NSString+Utilities.h>
@ -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;

View File

@ -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

View File

@ -33,10 +33,11 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon
<th align="right" style="font-weight: bold;"><var:string label:value="startDate_label" const:escapeHTML="NO"/></th>
<td><var:string value="aptStartDate" const:escapeHTML="NO"/></td>
</tr>
<tr>
<var:if condition="aptEndDate"
><tr>
<th align="right" style="font-weight: bold;"><var:string label:value="endDate_label" const:escapeHTML="NO"/></th>
<td><var:string value="aptEndDate" const:escapeHTML="NO"/></td>
</tr>
</tr></var:if>
<var:if condition="apt.comment.length"
><tr>
<th align="right" style="font-weight: bold;"><var:string label:value="comment_label" const:escapeHTML="NO"/></th>