From 8cc0b946e70f4a7643acfc4956a49b50c059f380 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 17 Jun 2016 15:24:59 -0400 Subject: [PATCH] Fix handling of attendees when updating an event --- NEWS | 1 + SoObjects/Appointments/iCalEntityObject+SOGo.m | 6 ++++-- UI/MailPartViewers/UIxMailPartICalViewer.m | 2 +- UI/Scheduler/UIxAppointmentEditor.m | 4 ++-- UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox | 2 +- UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox | 2 +- UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox | 2 +- UI/WebServerResources/js/Scheduler/Component.service.js | 4 ++-- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 18c5c2c6f..cbad960cb 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Bug fixes - [web] honor the domain default SOGoAppointmentSendEMailNotifications (#3729) - [web] the login module parameter is now properly restored when set as "Last used" - [web] if cn isn't found for shared mailboxes, use email address (#3733) + - [web] fixed handling of attendees when updating an event 3.1.2 (2016-06-06) ------------------ diff --git a/SoObjects/Appointments/iCalEntityObject+SOGo.m b/SoObjects/Appointments/iCalEntityObject+SOGo.m index d12aae19a..a4312d009 100644 --- a/SoObjects/Appointments/iCalEntityObject+SOGo.m +++ b/SoObjects/Appointments/iCalEntityObject+SOGo.m @@ -158,7 +158,7 @@ NSNumber *iCalDistantFutureNumber = nil; } } } - [attendeeData setObject: [[currentAttendee partStat] lowercaseString] forKey: @"status"]; + [attendeeData setObject: [[currentAttendee partStat] lowercaseString] forKey: @"partstat"]; [attendeeData setObject: [[currentAttendee role] lowercaseString] forKey: @"role"]; if ([[currentAttendee delegatedTo] length]) [attendeeData setObject: [[currentAttendee delegatedTo] rfc822Email] forKey: @"delegatedTo"]; @@ -232,7 +232,9 @@ NSNumber *iCalDistantFutureNumber = nil; [currentAttendee setCn: [currentData objectForKey: @"name"]]; [currentAttendee setEmail: currentEmail]; } - [currentAttendee + if (!currentAttendee || ![[currentAttendee role] isEqualToString: role]) + // Set the RSVP only if this is a new attendee or the role has changed + [currentAttendee setRsvp: ([role isEqualToString: @"NON-PARTICIPANT"] ? @"FALSE" : @"TRUE")]; diff --git a/UI/MailPartViewers/UIxMailPartICalViewer.m b/UI/MailPartViewers/UIxMailPartICalViewer.m index caacda76d..042790529 100644 --- a/UI/MailPartViewers/UIxMailPartICalViewer.m +++ b/UI/MailPartViewers/UIxMailPartICalViewer.m @@ -548,7 +548,7 @@ if (![[person delegatedTo] length]) [a addObject: [NSDictionary dictionaryWithObjectsAndKeys: ([person cnWithoutQuotes] ? [person cnWithoutQuotes] : [person rfc822Email]), @"name", [person rfc822Email], @"email", - [[person partStatWithDefault] lowercaseString], @"status", nil]]; + [[person partStatWithDefault] lowercaseString], @"partstat", nil]]; } [d setObject: a forKey: @"participants"]; diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 7a25ceec1..c8fc7bcd2 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -409,7 +409,7 @@ * @apiParam {String} [attendees.name] Attendee's name * @apiParam {String} attendees.email Attendee's email address * @apiParam {String} [attendees.uid] System user ID - * @apiParam {String} attendees.status Attendee's participation status + * @apiParam {String} attendees.partstat Attendee's participation status * @apiParam {String} [attendees.role] Either CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, or NON-PARTICIPANT * @apiParam {String} [attendees.delegatedTo] User that the original request was delegated to * @apiParam {String} [attendees.delegatedFrom] User the request was delegated from @@ -617,7 +617,7 @@ * @apiSuccess (Success 200) {String} [attendees.name] Attendee's name * @apiSuccess (Success 200) {String} attendees.email Attendee's email address * @apiSuccess (Success 200) {String} [attendees.uid] System user ID - * @apiSuccess (Success 200) {String} attendees.status Attendee's participation status + * @apiSuccess (Success 200) {String} attendees.partstat Attendee's participation status * @apiSuccess (Success 200) {String} [attendees.role] Either CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, or NON-PARTICIPANT * @apiSuccess (Success 200) {String} [attendees.delegatedTo] User that the original request was delegated to * @apiSuccess (Success 200) {String} [attendees.delegatedFrom] User the request was delegated from diff --git a/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox b/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox index 006a084af..fa1d81482 100644 --- a/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox +++ b/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox @@ -261,7 +261,7 @@
{{$chip.name}}
- + diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox index 3499ca09d..e9412d67c 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox @@ -263,7 +263,7 @@
{{$chip.name || $chip.email}}
- + close diff --git a/UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox index 26cba1370..fcd4abde6 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox @@ -179,7 +179,7 @@ {{$chip.name}} - + diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index 0c4a28e9d..f61bbbc28 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -841,7 +841,7 @@ name: ref.c_cn, email: ref.$preferredEmail(), role: 'req-participant', - status: 'needs-action', + partstat: 'needs-action', uid: ref.c_uid }; if (!_.find(_this.attendees, function(o) { @@ -864,7 +864,7 @@ name: card.c_cn, email: card.$preferredEmail(), role: 'req-participant', - status: 'needs-action', + partstat: 'needs-action', uid: card.c_uid }; if (!_.find(this.attendees, function(o) {