diff --git a/NEWS b/NEWS index 54aea6cc0..4bc22406a 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,7 @@ Bug fixes - fixed contextual menu of the current calendar view (#2557) - fixed handling of the '=' character in cards/events/tasks (#2505) - simplify searches in the address book (#2187) + - warn user when dnd failed because of a resource conflict (#1613) 2.1.1b (2013-12-04) ------------------- diff --git a/UI/Scheduler/UIxAppointmentActions.m b/UI/Scheduler/UIxAppointmentActions.m index 08d6c9f9c..db6d55c91 100644 --- a/UI/Scheduler/UIxAppointmentActions.m +++ b/UI/Scheduler/UIxAppointmentActions.m @@ -1,6 +1,6 @@ /* UIxAppointmentActions.m - this file is part of SOGo * - * Copyright (C) 2011 Inverse inc. + * Copyright (C) 2011-2014 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -21,6 +21,7 @@ */ #import +#import #import #import @@ -33,6 +34,7 @@ #import #import +#import #import #import #import @@ -56,6 +58,7 @@ SOGoUserDefaults *ud; NSString *daysDelta, *startDelta, *durationDelta; NSTimeZone *tz; + NSException *ex; rq = [context request]; @@ -105,16 +108,24 @@ [event updateRecurrenceRulesUntilDate: end]; [event setLastModified: [NSCalendarDate calendarDate]]; - [co saveComponent: event]; - - response = [self responseWith204]; + ex = [co saveComponent: event]; + if (ex) + { + NSDictionary *jsonResponse; + jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys: + [ex reason], @"message", + nil]; + response = [self responseWithStatus: 403 + andString: [jsonResponse jsonRepresentation]]; + } + else + response = [self responseWith204]; } else response = (WOResponse *) [NSException exceptionWithHTTPStatus: 400 reason: @"missing 'days', 'start' and/or 'duration' parameters"]; - return response; } diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 81b8e5928..725345d61 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -135,6 +135,10 @@ function updateEventFromDraggingCallback(http) { if (isHttpStatus204(http.status)) { refreshEventsAndDisplay(); } + else { + var response = http.responseText.evalJSON(true); + showAlertDialog(response['message']); + } } }