diff --git a/NEWS b/NEWS index 52680f470..588ed76f9 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,8 @@ Enhancements - [web] create card from sender or recipient address (#3002, #4610) - - [core] baseDN now accept dynamic domain values (#3685) + - [core] baseDN now accept dynamic domain values (#3685 - sponsored by iRedMail) + - [core] we now handle optional and non-required attendee states Bug fixes - [web] fixed all-day event dates with different timezone diff --git a/SoObjects/Appointments/English.lproj/Localizable.strings b/SoObjects/Appointments/English.lproj/Localizable.strings index da4f31192..03707ef52 100644 --- a/SoObjects/Appointments/English.lproj/Localizable.strings +++ b/SoObjects/Appointments/English.lproj/Localizable.strings @@ -62,3 +62,8 @@ vtodo_class2 = "(Confidential task)"; /* Resources */ "Cannot access resource: \"%{Cn} %{SystemEmail}\"" = "Cannot access resource: \"%{Cn} %{SystemEmail}\""; "Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}." = "Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}."; + +/* Participation role */ +"Your participation is required to this event" = "Your participation is required to this event"; +"Your participation is optional to this event" = "Your participation is optional to this event"; +"Your participation is not required to this event" = "Your participation is not required to this event"; \ No newline at end of file diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index a38789820..c02556d24 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2007-2016 Inverse inc. + Copyright (C) 2007-2019 Inverse inc. This file is part of SOGo @@ -187,9 +187,17 @@ { SOGoAppointmentObject *attendeeObject; iCalCalendar *iCalendarToSave; - + iCalPerson *attendee; + SOGoUser *user; + iCalendarToSave = nil; + user = [SOGoUser userWithLogin: theUID]; attendeeObject = [self _lookupEvent: [newEvent uid] forUID: theUID]; + attendee = [newEvent userAsAttendee: user]; + + // If the atttende's role is NON-PARTICIPANT, we write nothing to its calendar + if ([[attendee role] caseInsensitiveCompare: @"NON-PARTICIPANT"] == NSOrderedSame) + return; if ([newEvent recurrenceId]) { @@ -197,12 +205,11 @@ if ([attendeeObject isNew]) { iCalEvent *ownerEvent; - SOGoUser *user; + // We check if the attendee that was added to a single occurence is // present in the master component. If not, we create a calendar with // a single event for the occurence. ownerEvent = [[[newEvent parent] events] objectAtIndex: 0]; - user = [SOGoUser userWithLogin: theUID]; if (![ownerEvent userAsAttendee: user]) { @@ -339,7 +346,7 @@ } } else - [self errorWithFormat: @"Unable to find event with UID %@ in %@'s calendar - skipping delete operation", nameInContainer, theUID]; + [self errorWithFormat: @"Unable to find event with UID %@ in %@'s calendar - skipping delete operation. This can be normal for NON-PARTICIPANT attendees.", nameInContainer, theUID]; } } @@ -1171,6 +1178,10 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent NSException *error; BOOL addDelegate, removeDelegate; + // If the atttende's role is NON-PARTICIPANT, we write nothing to its calendar + if ([[attendee role] caseInsensitiveCompare: @"NON-PARTICIPANT"] == NSOrderedSame) + return; + error = nil; eventObject = [self _lookupEvent: eventUID forUID: uid]; diff --git a/SoObjects/Appointments/SOGoAptMailInvitation.m b/SoObjects/Appointments/SOGoAptMailInvitation.m index f3a449b1c..1343826ce 100644 --- a/SoObjects/Appointments/SOGoAptMailInvitation.m +++ b/SoObjects/Appointments/SOGoAptMailInvitation.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2010-2012 Inverse + Copyright (C) 2010-2019 Inverse This file is part of SOGo diff --git a/SoObjects/Appointments/SOGoAptMailNotification.h b/SoObjects/Appointments/SOGoAptMailNotification.h index b650ee9e9..0b6add4d0 100644 --- a/SoObjects/Appointments/SOGoAptMailNotification.h +++ b/SoObjects/Appointments/SOGoAptMailNotification.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2006-2018 Inverse inc. + Copyright (C) 2006-2019 Inverse inc. This file is part of SOGo. @@ -28,6 +28,7 @@ @class NSMutableDictionary; @class NSString; @class NSTimeZone; +@class iCalPerson; @class iCalRepeatableEntityObject; @class SOGoDateFormatter; @@ -46,6 +47,7 @@ NSCalendarDate *oldEndDate; NSCalendarDate *newEndDate; NSString *organizerName; + iCalPerson *currentAttendee; NSMutableDictionary *values; SOGoDateFormatter *dateFormatter; } @@ -61,6 +63,9 @@ - (void) setOrganizerName: (NSString *) theString; - (NSString *) organizerName; +- (void) setCurrentAttendee: (iCalPerson *) theAttendee; +- (iCalPerson *) currentAttendee; + - (NSCalendarDate *) oldStartDate; - (NSCalendarDate *) newStartDate; diff --git a/SoObjects/Appointments/SOGoAptMailNotification.m b/SoObjects/Appointments/SOGoAptMailNotification.m index a967f61ab..90a171040 100644 --- a/SoObjects/Appointments/SOGoAptMailNotification.m +++ b/SoObjects/Appointments/SOGoAptMailNotification.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2006-2013 Inverse inc. + Copyright (C) 2006-2019 Inverse inc. Copyright (C) 2000-2005 SKYRIX Software AG This file is part of SOGo. @@ -48,6 +48,8 @@ apt = nil; values = nil; dateFormatter = RETAIN([[context activeUser] dateFormatterInContext: context]); + organizerName = nil; + currentAttendee = nil; } return self; @@ -59,6 +61,7 @@ [apt release]; [previousApt release]; [organizerName release]; + [currentAttendee release]; [viewTZ release]; [oldStartDate release]; [newStartDate release]; @@ -164,6 +167,16 @@ return organizerName; } +- (void) setCurrentAttendee: (iCalPerson *) theAttendee +{ + ASSIGN(currentAttendee, theAttendee); +} + +- (iCalPerson *) currentAttendee +{ + return currentAttendee; +} + - (NSString *) sentByText { NSDictionary *sentByValues; @@ -293,4 +306,21 @@ return nil; } +- (NSString *) getParticipationRole +{ + if ([[currentAttendee role] caseInsensitiveCompare: @"OPT-PARTICIPANT"] == NSOrderedSame) + { + return [self labelForKey: @"Your participation is optional to this event" + inContext: context]; + } + else if ([[currentAttendee role] caseInsensitiveCompare: @"NON-PARTICIPANT"] == NSOrderedSame) + { + return [self labelForKey: @"Your participation is not required to this event" + inContext: context]; + } + + return [self labelForKey: @"Your participation is required to this event" + inContext: context]; +} + @end diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 7650a4b00..d4e259943 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-2016 Inverse inc. + * Copyright (C) 2006-2019 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 @@ -846,6 +846,7 @@ p = [app pageWithName: pageName inContext: context]; [p setApt: (iCalEvent *) object]; [p setPreviousApt: (iCalEvent *) previousObject]; + [p setCurrentAttendee: attendee]; if ([[object organizer] cn] && [[[object organizer] cn] length]) { @@ -893,9 +894,10 @@ /* attach text part to multipart body */ [body addBodyPart: bodyPart]; - /* attach calendar part to multipart body */ - [body addBodyPart: eventBodyPart]; - + /* attach calendar part to multipart body only if the participation role is not NON-PARTICIPANT */ + if ([[attendee role] caseInsensitiveCompare: @"NON-PARTICIPANT"] != NSOrderedSame) + [body addBodyPart: eventBodyPart]; + /* attach multipart body to message */ [msg setBody: body]; [body release]; diff --git a/UI/Templates/Appointments/SOGoAptMailInvitation.wox b/UI/Templates/Appointments/SOGoAptMailInvitation.wox index a95b52194..4664a86fa 100644 --- a/UI/Templates/Appointments/SOGoAptMailInvitation.wox +++ b/UI/Templates/Appointments/SOGoAptMailInvitation.wox @@ -20,7 +20,12 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon value="getSubject" const:escapeHTML="NO"/> - + +

+ diff --git a/UI/Templates/Appointments/SOGoAptMailUpdate.wox b/UI/Templates/Appointments/SOGoAptMailUpdate.wox index bce368fb7..99fac806b 100644 --- a/UI/Templates/Appointments/SOGoAptMailUpdate.wox +++ b/UI/Templates/Appointments/SOGoAptMailUpdate.wox @@ -20,6 +20,12 @@ th, td { font-family: Lucida Grande, Bitstream VeraSans, Tahoma, sans-serif; fon value="getSubject" const:escapeHTML="NO"/> + + +

+