(feat) warn when double-booking attendees and offer force save option

This commit is contained in:
Ludovic Marcotte
2016-02-11 10:54:07 -05:00
parent 9cc4bfd9be
commit d7b010526b
13 changed files with 218 additions and 192 deletions
+11 -5
View File
@@ -1,6 +1,6 @@
/* UIxAppointmentEditor.m - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2016 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
@@ -467,7 +467,9 @@
SOGoAppointmentObject *co;
SoSecurityManager *sm;
WORequest *request;
unsigned int httpStatus;
BOOL forceSave;
event = [self event];
co = [self clientObject];
@@ -488,6 +490,7 @@
else
{
[self setAttributes: params];
forceSave = NO;
if ([event hasRecurrenceRules])
[self _adjustRecurrentRules];
@@ -511,12 +514,12 @@
}
// Save the event.
ex = [co saveComponent: event];
ex = [co saveComponent: event force: forceSave];
}
else
{
// The event was modified -- save it.
ex = [co saveComponent: event];
ex = [co saveComponent: event force: forceSave];
if (componentCalendar
&& ![[componentCalendar ocsPath]
@@ -539,9 +542,12 @@
if (ex)
{
httpStatus = 500;
if ([ex respondsToSelect: @selector(httpStatus)])
httpStatus = [ex httpStatus];
jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys:
@"failure", @"status",
[ex reason], @"message",
[ex reason], @"message",
nil];
}
else