From a6d7968b8a7eb2e367708615b5238993e3a3fa62 Mon Sep 17 00:00:00 2001 From: QS5ELkMu Date: Tue, 18 Dec 2018 19:50:38 +0100 Subject: [PATCH] [FIX] Santize id calendar management --- hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js | 5 +++-- .../static/src/lib/hcalendar/js/hcalendar_management.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js index 399ea7254..38cc5afef 100644 --- a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js +++ b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar.js @@ -339,7 +339,7 @@ HotelCalendar.prototype = { } this._updateReservation(r); } - this._updateReservationsMap(); + this._assignReservationsEvents(toAssignEvents); }.bind(this), addedReservations); @@ -1508,7 +1508,8 @@ HotelCalendar.prototype = { } // Invalid? - if (nreserv.room.id !== uniRoom || (!nreserv.startDate.isSame(dateLimits[1], 'day') && !nreserv.endDate.isSame(dateLimits[0], 'day'))) + if (nreserv.room.id !== uniRoom || (!nreserv.startDate.isSame(dateLimits[1], 'day') && !nreserv.endDate.isSame(dateLimits[0], 'day')) || + (nreserv.id !== refUnifyReservation.id && nreserv.getUserData('parent_reservation') !== refUnifyReservation.id)) { nreserv._html.classList.add('hcal-reservation-invalid-unify'); } diff --git a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar_management.js b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar_management.js index c7406cc19..b65f3f9ad 100644 --- a/hotel_calendar/static/src/lib/hcalendar/js/hcalendar_management.js +++ b/hotel_calendar/static/src/lib/hcalendar/js/hcalendar_management.js @@ -769,7 +769,7 @@ HotelCalendarManagement.prototype = { }, _sanitizeId: function(/*String*/str) { - return str.replace(/[^a-zA-Z0-9\.\-_:]/g, '_'); + return str.replace(/[^a-zA-Z0-9\-_]/g, '_'); }, _isNumeric: function(/*?*/n) {