diff --git a/SoObjects/Appointments/English.lproj/Localizable.strings b/SoObjects/Appointments/English.lproj/Localizable.strings index 171173eb9..97bed05c9 100644 --- a/SoObjects/Appointments/English.lproj/Localizable.strings +++ b/SoObjects/Appointments/English.lproj/Localizable.strings @@ -12,6 +12,9 @@ vtodo_class2 = "(Confidential task)"; "The event \"%{Summary}\" was created" = "The event \"%{Summary}\" was created"; "The event \"%{Summary}\" was deleted" = "The event \"%{Summary}\" was deleted"; "The event \"%{Summary}\" was updated" = "The event \"%{Summary}\" was updated"; +"The task \"%{Summary}\" was created" = "The task \"%{Summary}\" was created"; +"The task \"%{Summary}\" was deleted" = "The task \"%{Summary}\" was deleted"; +"The task \"%{Summary}\" was updated" = "The task \"%{Summary}\" was updated"; "The following attendees(s) were notified" = "The following attendee(s) were notified"; "The following attendees(s) were added" = "The following attendee(s) were added"; "The following attendees(s) were removed" = "The following attendee(s) were removed"; diff --git a/SoObjects/Appointments/SOGoAptMailReceipt.h b/SoObjects/Appointments/SOGoAptMailReceipt.h index 84aad774c..43b65ac54 100644 --- a/SoObjects/Appointments/SOGoAptMailReceipt.h +++ b/SoObjects/Appointments/SOGoAptMailReceipt.h @@ -38,7 +38,7 @@ NSArray *deletedAttendees; NSArray *updatedAttendees; iCalPerson *currentRecipient; - SOGoEventOperation operation; + SOGoComponentOperation operation; NSString *calendarName; } @@ -46,7 +46,7 @@ - (void) setAddedAttendees: (NSArray *) theAttendees; - (void) setDeletedAttendees: (NSArray *) theAttendees; - (void) setUpdatedAttendees: (NSArray *) theAttendees; -- (void) setOperation: (SOGoEventOperation) theOperation; +- (void) setOperation: (SOGoComponentOperation) theOperation; - (void) setCalendarName: (NSString *) theCalendarName; - (NSString *) aptSummary; diff --git a/SoObjects/Appointments/SOGoAptMailReceipt.m b/SoObjects/Appointments/SOGoAptMailReceipt.m index ddd8a3fd1..62ce5a42f 100644 --- a/SoObjects/Appointments/SOGoAptMailReceipt.m +++ b/SoObjects/Appointments/SOGoAptMailReceipt.m @@ -31,6 +31,7 @@ #import #import +#import #import #import @@ -136,7 +137,7 @@ static NSCharacterSet *wsSet = nil; return currentRecipient; } -- (void) setOperation: (SOGoEventOperation) theOperation +- (void) setOperation: (SOGoComponentOperation) theOperation { operation = theOperation; } @@ -160,6 +161,21 @@ static NSCharacterSet *wsSet = nil; switch (operation) { + case TaskCreated: + s = [self labelForKey: @"The task \"%{Summary}\" was created" + inContext: context]; + break; + + case TaskDeleted: + s = [self labelForKey: @"The task \"%{Summary}\" was deleted" + inContext: context]; + break; + + case TaskUpdated: + s = [self labelForKey: @"The task \"%{Summary}\" was updated" + inContext: context]; + break; + case EventCreated: s = [self labelForKey: @"The event \"%{Summary}\" was created" inContext: context]; @@ -198,7 +214,7 @@ static NSCharacterSet *wsSet = nil; formatter = [currentUser dateFormatterInContext: context]; - if ([apt isAllDay]) + if ([apt isKindOfClass: [iCalEvent class]] && [(iCalEvent *)apt isAllDay]) return [formatter formattedDate: tzDate]; else return [NSString stringWithFormat: @"%@ - %@", @@ -213,7 +229,10 @@ static NSCharacterSet *wsSet = nil; - (NSString *) aptEndDate { - return [self _formattedUserDate: [(iCalEvent *) apt endDate]]; + if ([apt isKindOfClass: [iCalEvent class]]) + return [self _formattedUserDate: [(iCalEvent *) apt endDate]]; + else + return [self _formattedUserDate: [(iCalToDo *) apt due]]; } @end diff --git a/SoObjects/Appointments/SOGoCalendarComponent.h b/SoObjects/Appointments/SOGoCalendarComponent.h index adcf3be89..3ecb0d007 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.h +++ b/SoObjects/Appointments/SOGoCalendarComponent.h @@ -1,6 +1,6 @@ /* SOGoCalendarComponent.h - this file is part of SOGo * - * Copyright (C) 2006-2014 Inverse inc. + * Copyright (C) 2006-2021 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 @@ -75,11 +75,11 @@ - (void) sendResponseToOrganizer: (iCalRepeatableEntityObject *) newComponent from: (SOGoUser *) owner; -- (void) sendReceiptEmailForObject: (iCalRepeatableEntityObject *) object +- (void) sendReceiptEmailForObject: (iCalEntityObject *) object addedAttendees: (NSArray *) theAddedAttendees deletedAttendees: (NSArray *) theDeletedAttendees updatedAttendees: (NSArray *) theUpdatedAttendees - operation: (SOGoEventOperation) theOperation; + operation: (SOGoComponentOperation) theOperation; - (iCalPerson *) findParticipantWithUID: (NSString *) uid; diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 4fa3a1bdb..705852d6c 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -1,6 +1,6 @@ /* SOGoCalendarComponent.m - this file is part of SOGo * - * Copyright (C) 2006-2019 Inverse inc. + * Copyright (C) 2006-2021 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 @@ -1093,11 +1093,11 @@ // // // -- (void) sendReceiptEmailForObject: (iCalRepeatableEntityObject *) object +- (void) sendReceiptEmailForObject: (iCalEntityObject *) object addedAttendees: (NSArray *) theAddedAttendees deletedAttendees: (NSArray *) theDeletedAttendees updatedAttendees: (NSArray *) theUpdatedAttendees - operation: (SOGoEventOperation) theOperation + operation: (SOGoComponentOperation) theOperation { NSString *calendarName, *mailDate, *mailText, *fullSenderEmail, *senderEmail, *fullRecipientEmail, *recipientEmail; NSDictionary *senderIdentity, *recipientIdentity; diff --git a/SoObjects/Appointments/SOGoTaskObject.m b/SoObjects/Appointments/SOGoTaskObject.m index 563f3fcbf..dd9ceddd9 100644 --- a/SoObjects/Appointments/SOGoTaskObject.m +++ b/SoObjects/Appointments/SOGoTaskObject.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2006-2014-2016 Inverse inc. + Copyright (C) 2006-2014-2021 Inverse inc. This file is part of SOGo. @@ -21,6 +21,7 @@ #import +#import #import #import #import @@ -65,6 +66,14 @@ baseVersion: (unsigned int) newVersion { NSException *ex; + iCalToDo *todo; + + todo = (iCalToDo*)[theComponent firstChildWithTag: [self componentTag]]; + [self sendReceiptEmailForObject: todo + addedAttendees: nil + deletedAttendees: nil + updatedAttendees: nil + operation: [self isNew] ? TaskCreated : TaskUpdated]; ex = [super saveComponent: theComponent baseVersion: newVersion]; [fullCalendar release]; @@ -111,6 +120,19 @@ } +- (NSException *) prepareDelete +{ + iCalToDo *todo = [self component: NO secure: NO]; + + [self sendReceiptEmailForObject: todo + addedAttendees: nil + deletedAttendees: nil + updatedAttendees: nil + operation: TaskDeleted]; + + return [super prepareDelete]; +} + - (id) PUTAction: (WOContext *) _ctx { iCalCalendar *rqCalendar; diff --git a/SoObjects/SOGo/SOGoConstants.h b/SoObjects/SOGo/SOGoConstants.h index 830d2bea4..c3b24a3b4 100644 --- a/SoObjects/SOGo/SOGoConstants.h +++ b/SoObjects/SOGo/SOGoConstants.h @@ -1,8 +1,6 @@ /* SOGoConstants.h - this file is part of SOGo * - * Copyright (C) 2010 Inverse inc. - * - * Author: Ludovic Marcotte + * Copyright (C) 2010-2021 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 @@ -49,7 +47,10 @@ typedef enum EventCreated = 0, EventDeleted = 1, EventUpdated = 2, -} SOGoEventOperation; + TaskCreated = 3, + TaskDeleted = 4, + TaskUpdated = 5, +} SOGoComponentOperation; typedef enum { diff --git a/UI/Templates/Appointments/SOGoAptMailReceipt.wox b/UI/Templates/Appointments/SOGoAptMailReceipt.wox index 0e2111a12..7e63954f3 100644 --- a/UI/Templates/Appointments/SOGoAptMailReceipt.wox +++ b/UI/Templates/Appointments/SOGoAptMailReceipt.wox @@ -17,31 +17,33 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon

+ value="aptSummary"/> - - + + - - + + + + + + + + + + - - - - - - - - + label:value="The following attendees(s) were notified"/> @@ -54,7 +56,7 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon > + label:value="The following attendees(s) were added"/> @@ -67,14 +69,19 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon > + label:value="The following attendees(s) were removed"/> - + + + + +