';
html += '| ';
- html += '';
+ html += '';
html += ' | ';
html += '';
- html += '';
+ html += '';
html += ' | ';
html += '';
- html += '';
+ html += '';
html += ' | ';
html += '';
- html += '';
+ html += '';
html += ' | ';
html += '';
- html += '';
+ html += '';
html += ' | ';
html += '';
- html += '';
- html += "{l s='Add Dates'}";
- html += '';
- html += '';
+ html +=
+ '';
+ html += "{l s='Add Dates'}";
+ html += '';
+ html += '';
+ html += ' | ';
+ html += '';
+ html += '';
+ html += '';
+ html += '';
+ html += '0';
+ html += '';
+ html += '';
html += ' | ';
html += '{hook h='displayHotelRoomListTableRowColumn'}';
html += '';
- html += '';
+ html +=
+ '';
html += ' | ';
- html += '
';
+ html += '';
- $('table.hotel-room tbody').append(html);
- });
+ $('table.hotel-room tbody').append(html);
+ });
// delete room
$('.rm_htl_room').on('click',function(e) {
@@ -714,13 +725,26 @@
action:'deleteHotelRoom',
id: id_htl_info,
},
- success: function (response) {
+ success: function(response) {
if (response.success) {
showSuccessMessage("{l s='Removed successfully'}");
$current.closest(".room_data_values").remove();
+ if (response.affected_rooms && response.affected_rooms.length) {
+ $.each(response.affected_rooms, function(i, roomId) {
+ var $badge = $(
+ '.connectedRoomModal[data-id-room="' +
+ roomId + '"] .connected-room-count');
+ if ($badge.length) {
+ var count = parseInt($badge.text().trim());
+ if (count > 0) {
+ $badge.text(count - 1);
+ }
+ }
+ });
+ }
} else {
if (response.errors)
- showErrorMessage(response.errors);
+ showErrorMessage(response.errors);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
@@ -1935,7 +1959,6 @@
e.preventDefault();
let roomId = $(this).data('id-room');
- let hotelId = $(this).data('id-hotel');
let roomNum = $(this).data('room-num');
let currentRoomType = $('[name="id_product"]').val();
$.ajax({
@@ -1946,7 +1969,6 @@
ajax: true,
action: 'getModalConnectedRooms',
room_id: roomId,
- hotel_id: hotelId,
current_roomtype: currentRoomType,
},
success: function(response) {
@@ -2051,7 +2073,6 @@
var $row = $(this).closest('tr');
var mainRoomId = $('#connected_room_main_id').val();
var connectedRoomId = $row.find('.connect-room').val();
- var hotelId = $('#hotel_id').val();
let currentRoomType = $('[name="id_product"]').val();
if (!connectedRoomId) {
alert(selectRoomText);
@@ -2065,7 +2086,6 @@
ajax: true,
action: 'ManageConnectedRoom',
mode: 'add',
- hotel_id: hotelId,
room_id: mainRoomId,
connected_room_id: connectedRoomId,
current_roomtype: currentRoomType,
@@ -2109,7 +2129,6 @@
var mainRoomId = $('#connected_room_main_id').val();
var connectedRoomId = $(this).data('connected-room-id');
var connectedId = $(this).data('connected-id');
- var hotelId = $(this).data('hotel-id');
let currentRoomType = $('[name="id_product"]').val();
$.ajax({
url: prod_link,
@@ -2122,7 +2141,6 @@
room_id: mainRoomId,
connected_room_id: connectedRoomId,
connected_id: connectedId,
- hotel_id: hotelId,
current_roomtype: currentRoomType,
},
success: function(response) {
diff --git a/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl b/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl
index 5a92ed178..ea505ec4b 100644
--- a/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl
+++ b/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl
@@ -100,7 +100,7 @@
data-connected-id="{$row.id_connected_room|intval}"
data-room-id="{$row.id_room_information|intval}"
data-connected-room-id="{$row.id_room|intval}"
- data-hotel-id="{$row.id_hotel|intval}" title="{l s='Remove'}">
+ title="{l s='Remove'}">