From 4c0141769009f98e0f53fba39408ddf9633ecc4b Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 16 Feb 2016 12:40:59 -0500 Subject: [PATCH] Handle resource limits in the Web interface See @d7b010 --- .../Appointments/SOGoAppointmentObject.m | 6 +- .../UIxAppointmentEditorTemplate.wox | 67 ++++++++++++------- UI/Templates/SchedulerUI/UIxCalMainView.wox | 11 ++- .../js/Scheduler/ComponentController.js | 4 +- .../scss/components/dialog/dialog.scss | 16 +++++ 5 files changed, 73 insertions(+), 31 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 2e92b85aa..ad4153846 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -665,7 +665,7 @@ else { iCalCalendar *calendar; - NSDictionary *values; + NSDictionary *values, *info; NSString *reason; iCalEvent *event; @@ -682,8 +682,10 @@ reason = [values keysWithFormat: [self labelForKey: @"Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}."]]; + info = [NSDictionary dictionaryWithObject: reason forKey: @"reject"]; + return [NSException exceptionWithHTTPStatus: 403 - reason: reason]; + reason: [info jsonRepresentation]]; } } // diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox index 79666f52a..6a1427bc4 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox @@ -289,33 +289,32 @@ - -
- - close - -
- -
- person {{editor.attendeeConflictError.attendee_name}} ({{editor.attendeeConflictError.attendee_email}}) + +
+
+ + close + +
+
+ person {{editor.attendeeConflictError.attendee_name}} ({{editor.attendeeConflictError.attendee_email}}) +
+
+ schedule +
+ +
{{conflict.startDate}} trending_flat
+
+
+ +
{{conflict.endDate}}
- - - schedule -
- -
{{conflict.startDate}} trending_flat
-
- -
{{conflict.endDate}}
-
-
- + + @@ -329,6 +328,24 @@ + + + +
{{editor.attendeeConflictError.reject}}
+ + close + +
+ + + + + + + + diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index d248c9486..3d11e4aca 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -740,8 +740,9 @@