mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-29 23:25:27 +00:00
feat(calendar): optionally remove attendees that can't be invited
If some attendees have prevented others to invite them, offer the organizer to remove them when saving the invitation.
This commit is contained in:
@@ -499,6 +499,8 @@ validate_untilbeforeend = "The recurrence must end after the first occurrence
|
||||
"and" = "and";
|
||||
"A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?"
|
||||
= "A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?";
|
||||
"Would you like to remove them and send the invitation to the remaining attendees?"
|
||||
= "Would you like to remove them and send the invitation to the remaining attendees?";
|
||||
|
||||
/* events list */
|
||||
"Due" = "Due";
|
||||
|
||||
@@ -263,6 +263,24 @@
|
||||
return ex;
|
||||
}
|
||||
|
||||
- (void) _removeAttendees: (NSArray *) emails
|
||||
{
|
||||
NSString *email;
|
||||
iCalEvent *event;
|
||||
iCalPerson *attendee;
|
||||
unsigned int i;
|
||||
|
||||
event = [self event];
|
||||
attendee = [[[iCalPerson alloc] init] autorelease];
|
||||
|
||||
for (i = 0; i < [emails count]; i++)
|
||||
{
|
||||
email = [emails objectAtIndex: i];
|
||||
[attendee setEmail: email];
|
||||
[event removeFromAttendees: attendee];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} /so/:username/Calendar/:calendarId/:appointmentId/rsvpAppointment Set participation state
|
||||
* @apiVersion 1.0.0
|
||||
@@ -512,6 +530,7 @@
|
||||
*/
|
||||
- (id <WOActionResults>) saveAction
|
||||
{
|
||||
NSArray *removeAttendees;
|
||||
NSDictionary *params;
|
||||
NSString *jsonResponse;
|
||||
NSException *ex;
|
||||
@@ -545,12 +564,19 @@
|
||||
{
|
||||
[self setAttributes: params];
|
||||
forceSave = [[params objectForKey: @"ignoreConflicts"] boolValue];
|
||||
removeAttendees = [params objectForKey: @"removeAttendees"];
|
||||
|
||||
if ([event hasRecurrenceRules])
|
||||
ex = [self _adjustRecurrentRules];
|
||||
|
||||
if (!ex)
|
||||
{
|
||||
if (removeAttendees)
|
||||
{
|
||||
[co expandGroupsInEvent: event];
|
||||
[self _removeAttendees: removeAttendees];
|
||||
}
|
||||
|
||||
if ([co isNew])
|
||||
{
|
||||
if (componentCalendar
|
||||
|
||||
Reference in New Issue
Block a user