diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index e3405fa99f..46a2aa9608 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -51,7 +51,12 @@ {assign var=curr_id value=$cart->id_currency|intval} {foreach from=$cart_detail_data item=data} - {$data.room_num|escape:'html':'UTF-8'} {hook h='displayRoomNumAfter' data=$data type='adminOrder'} + {$data.room_num|escape:'html':'UTF-8'} + {if isset($data['connected_rooms']) && $data['connected_rooms']|@count > 0} + {include file="controllers/products/connected-rooms.tpl" htl_connected_rooms=$data['connected_rooms']} + {/if} + + {hook h='displayRoomNumAfter' data=$data type='adminOrder'}

{$data.room_type|escape:'html':'UTF-8'}

diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index 1e44a648f2..9061e52db6 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -25,7 +25,11 @@ -

{$data.room_num}

+

{$data.room_num} + {if isset($data['connected_rooms']) && $data['connected_rooms']|@count > 0} + {include file="controllers/products/connected-rooms.tpl" htl_connected_rooms=$data['connected_rooms']} + {/if} +

{if $data.is_back_order} {l s='overbooked'} {/if} diff --git a/admin/themes/default/template/controllers/products/configuration.tpl b/admin/themes/default/template/controllers/products/configuration.tpl index 7f0bc0f601..f092ba8bf5 100644 --- a/admin/themes/default/template/controllers/products/configuration.tpl +++ b/admin/themes/default/template/controllers/products/configuration.tpl @@ -67,6 +67,14 @@ + + + {hook h='displayHotelRoomListTableHeaderColumn'} {l s='--'} @@ -108,6 +116,21 @@ {* Since the data can also be used from post incase of errors, which will cause issues with the id index *} + + {if isset($room_info['id'])} + + + + + {if isset($room_info['connected_rooms_count'])}{$room_info['connected_rooms_count']|intval}{else}0{/if} + + + + {/if} + {if isset($room_info['id'])} {hook h='displayHotelRoomListTableRowColumn' index=$key id_room=$room_info['id']} {else} @@ -578,6 +601,26 @@ border: 1px solid #f2f2f2; margin-top: 10px; } + .connected-room-icon-wrapper { + display: inline-flex; + align-items: center; + gap: 4px; + justify-content: center; + } + .connected-room-count { + min-width: 14px; + height: 14px; + padding: 0 3px; + border-radius: 9px; + background: #f5f5f5; + color: #666; + border: 1px solid #d5d5d5; + font-size: 9px; + line-height: 12px; + font-weight: 600; + text-align: center; + box-shadow: none; + } diff --git a/admin/themes/default/template/controllers/products/connected-rooms.tpl b/admin/themes/default/template/controllers/products/connected-rooms.tpl new file mode 100644 index 0000000000..819a86d5a5 --- /dev/null +++ b/admin/themes/default/template/controllers/products/connected-rooms.tpl @@ -0,0 +1,83 @@ +{** +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} +{if isset($htl_connected_rooms) && $htl_connected_rooms|@count > 0} + + + +{/if} + diff --git a/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl b/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl new file mode 100644 index 0000000000..f1e8f286fc --- /dev/null +++ b/admin/themes/default/template/controllers/products/modal-connected-rooms.tpl @@ -0,0 +1,142 @@ +{* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + + diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index f6c236c596..50823f17ae 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1282,7 +1282,11 @@ public function setMedia() parent::setMedia(); $this->addJqueryUI('ui.datepicker'); + $this->addJqueryUI('ui.tooltip', 'base', true); + $this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css'); + $this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js'); + $this->addJqueryUI('ui.tooltip', 'base', true); if ($this->display == 'view') { if ($this->loadObject()) { @@ -3483,6 +3487,7 @@ public function renderView() $order_detail_data[$key]['amt_with_qty_tax_incl'] = $value['total_price_tax_incl']; $order_detail_data[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']); $order_detail_data[$key]['total_room_tax'] = $order_detail_data[$key]['total_room_price_ti'] - $order_detail_data[$key]['total_room_price_te']; + $order_detail_data[$key]['connected_rooms'] = HotelConnectedRoom::getConnectedRooms((int) $value['id_room'], (int) Context::getContext()->language->id); if (isset($value['refund_info']) && $value['refund_info']['refunded'] diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9b8e1ab484..cc9ce4e051 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -542,6 +542,7 @@ public function setMedia() $this->addJs(__PS_BASE_URI__.'js/vendor/ladda.js'); $this->addCSS(_PS_JS_DIR_.'fullcalendar/main.css'); $this->addJs(_PS_JS_DIR_.'fullcalendar/main.js'); + $this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css'); $this->addJS(_PS_JS_DIR_.'/datatable/jquery.dataTables.min.js'); $this->addJS(_PS_JS_DIR_.'/datatable/dataTables.bootstrap.js'); @@ -1602,7 +1603,8 @@ public function postProcess() ) { $this->addJqueryUI(array( 'ui.core', - 'ui.widget' + 'ui.widget', + 'ui.tooltip' )); $this->addjQueryPlugin(array( @@ -3159,6 +3161,7 @@ public function initFormConfiguration($obj) $disableDates = $objRoomDisableDates->getRoomDisableDates($room['id']); $room['disable_dates_json'] = json_encode($disableDates); } + $room['connected_rooms_count'] = HotelConnectedRoom::getTotalConnectedRooms($room['id']); } $data->assign('htl_room_info', $hotelRoomInfo); @@ -3786,6 +3789,7 @@ public function ajaxProcessDeleteHotelRoom() $this->errors[] = $this->l('This room cannot be deleted as this room contains future booking.'); } if (empty($this->errors)) { + $response['affected_rooms'] = HotelConnectedRoom::getTotalConnectedRooms(null, $idRoom); if ($objRoomInfo->delete()) { $response['success'] = true; } else { @@ -5707,4 +5711,102 @@ public function displayPreviewLink($token, $id, $name = null) return $tpl->fetch(); } + + public function ajaxProcessGetNotConnectedRooms() + { + $roomId = (int) Tools::getValue('room_id'); + $roomTypeId = (int) Tools::getValue('room_type_id'); + $allGroups = HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id); + $rooms = isset($allGroups[$roomTypeId]) ? $allGroups[$roomTypeId]['rooms'] : array(); + die(Tools::jsonEncode(['success' => true, 'rooms' => $rooms])); + } + + public function ajaxProcessInitConnectedRoomModal() + { + $response['hasError'] = 1; + $roomId = (int) Tools::getValue('room_id'); + $objRoom = new HotelRoomInformation($roomId); + $idProduct = (int) $objRoom->id_product; + $idHotel = (int) $objRoom->id_hotel; + + $this->context->smarty->assign(array( + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms($roomId, $this->context->language->id), + 'htl_not_connected_rooms' => HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id), + 'main_room_id' => $roomId, + 'current_roomtype' => $idProduct, + )); + + $modal = array( + 'modal_id' => 'connectedRoomModal', + 'modal_class' => 'modal-md', + 'modal_title' => '  '.$this->l('Connected Room').' ', + 'modal_content' => $this->context->smarty->fetch('controllers/products/modal-connected-rooms.tpl'), + 'modal_actions' => array(), + ); + + $this->context->smarty->assign($modal); + $response['hasError'] = 0; + $response['modalHtml'] = $this->context->smarty->fetch('modal.tpl'); + + die(Tools::jsonEncode($response)); + } + + public function ajaxProcessManageConnectedRoom() + { + if ($this->tabAccess['edit'] !== 1) { + die(json_encode(['success' => false, 'message' => $this->l('You do not have permission to edit this.')])); + } + + $mode = Tools::getValue('mode'); + $roomId = (int) Tools::getValue('room_id'); + $connectedRoomId = (int) Tools::getValue('connected_room_id'); + $connectedId = (int) Tools::getValue('connected_id'); + $objRoom = new HotelRoomInformation($roomId); + $idProduct = (int) $objRoom->id_product; + $idHotel = (int) $objRoom->id_hotel; + + if ($mode === 'add') { + $connection = new HotelConnectedRoom(); + $connection->id_room = $roomId; + $connection->id_room_connected = $connectedRoomId; + if ($connection->add()) { + $this->context->smarty->assign(array( + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms($roomId, $this->context->language->id), + 'htl_not_connected_rooms' => HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id), + 'main_room_id' => $roomId, + 'current_roomtype' => $idProduct, + )); + die(json_encode([ + 'html' => $this->context->smarty->fetch('controllers/products/modal-connected-rooms.tpl'), + 'success' => true, + 'message' => $this->l('Room connected successfully.'), + 'connected_count' => HotelConnectedRoom::getTotalConnectedRooms($roomId), + ])); + } + die(json_encode(['success' => false, 'message' => $this->l('Failed to connect room.')])); + } + + if ($mode === 'delete') { + if (!$connectedId) { + die(json_encode(['success' => false, 'message' => $this->l('Invalid data.')])); + } + $objHotelConnectedRoom = new HotelConnectedRoom($connectedId); + if ($objHotelConnectedRoom->delete()) { + $this->context->smarty->assign(array( + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms($roomId, $this->context->language->id), + 'htl_not_connected_rooms' => HotelConnectedRoom::getNotConnectedRooms($roomId, $this->context->language->id), + 'main_room_id' => $roomId, + 'current_roomtype' => $idProduct, + )); + die(json_encode([ + 'success' => true, + 'html' => $this->context->smarty->fetch('controllers/products/modal-connected-rooms.tpl'), + 'message' => $this->l('Connected room removed successfully.'), + 'connected_count' => HotelConnectedRoom::getTotalConnectedRooms($roomId), + ])); + } + die(json_encode(['success' => false, 'message' => $this->l('Failed to remove connected room.')])); + } + } + } diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index be3cabc94f..1cbc4eeb56 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -1331,6 +1331,7 @@ public function getCartFormatedBookinInfoByIdCart($id_cart) ); $cart_detail_data[$key]['amt_with_qty'] = $roomTypeDateRangePrice['total_price_tax_excl']; + $cart_detail_data[$key]['connected_rooms'] = HotelConnectedRoom::getConnectedRooms($obj_htl_room_info->id, Context::getContext()->language->id); } } if ($cart_detail_data) { diff --git a/modules/hotelreservationsystem/classes/HotelConnectedRoom.php b/modules/hotelreservationsystem/classes/HotelConnectedRoom.php new file mode 100644 index 0000000000..e18baddf63 --- /dev/null +++ b/modules/hotelreservationsystem/classes/HotelConnectedRoom.php @@ -0,0 +1,168 @@ + 'htl_connected_room', + 'primary' => 'id_connected_room', + 'fields' => array( + 'id_room' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), + 'id_room_connected' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), + 'date_add' => array('type' => self::TYPE_DATE), + 'date_upd' => array('type' => self::TYPE_DATE), + ), + ); + + public static function getConnectedRooms($idRoom = null, $idLang = null) + { + $idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id; + + if ($idRoom === null) { + $sql = 'SELECT + hcr.id_connected_room, + hcr.id_room, + hcr.id_room_connected, + conn_pl.name AS room_type_name, + connected_room.room_num AS connected_room_name + FROM `' . _DB_PREFIX_ . 'htl_connected_room` hcr + INNER JOIN `' . _DB_PREFIX_ . 'htl_room_information` connected_room + ON connected_room.id = hcr.id_room_connected + LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` conn_pl + ON (conn_pl.id_product = connected_room.id_product AND conn_pl.id_lang = ' . $idLang . ') + ORDER BY hcr.id_room, connected_room.room_num'; + + $results = Db::getInstance()->executeS($sql); + if ($results === false) { + return []; + } + $map = []; + foreach ($results as $row) { + $map[(int) $row['id_room']][] = $row; + } + return $map; + } + + $idRoom = (int) $idRoom; + if ($idRoom <= 0) { + return array(); + } + + $sql = 'SELECT + hcr.id_connected_room, + hcr.id_room, + hcr.id_room_connected, + conn_pl.name AS room_type_name, + connected_room.room_num AS connected_room_name + FROM `' . _DB_PREFIX_ . 'htl_connected_room` hcr + INNER JOIN `' . _DB_PREFIX_ . 'htl_room_information` connected_room + ON connected_room.id = hcr.id_room_connected + LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` conn_pl + ON (conn_pl.id_product = connected_room.id_product AND conn_pl.id_lang = ' . $idLang . ') + WHERE hcr.id_room = ' . $idRoom . ' + ORDER BY connected_room.room_num'; + + $results = Db::getInstance()->executeS($sql); + return ($results === false) ? array() : $results; + } + + public static function getNotConnectedRooms($idRoom, $idLang = null) + { + $idRoom = (int) $idRoom; + if ($idRoom <= 0) { + return array(); + } + $idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id; + + $hotelId = (int) (new HotelRoomInformation($idRoom))->id_hotel; + + $sql = 'SELECT hri.id AS id_room, hri.id_product AS id_room_type, pl.name AS room_type_name, hri.room_num AS room_name + FROM `' . _DB_PREFIX_ . 'htl_room_information` hri + LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl + ON (pl.id_product = hri.id_product AND pl.id_lang = ' . $idLang . ') + WHERE hri.id != ' . $idRoom . ' + AND hri.id_hotel = ' . $hotelId; + $sql .= ' AND NOT EXISTS ( + SELECT 1 FROM `' . _DB_PREFIX_ . 'htl_connected_room` cr + WHERE cr.id_room = ' . $idRoom . ' AND cr.id_room_connected = hri.id + ) + ORDER BY pl.name ASC, hri.room_num ASC'; + + $results = Db::getInstance()->executeS($sql); + if ($results === false) { + return array(); + } + + $grouped = array(); + foreach ($results as $row) { + $typeId = (int) $row['id_room_type']; + if (!isset($grouped[$typeId])) { + $grouped[$typeId] = array( + 'id_room_type' => $typeId, + 'name' => $row['room_type_name'], + 'rooms' => array(), + ); + } + $grouped[$typeId]['rooms'][] = array( + 'id_room' => (int) $row['id_room'], + 'name' => $row['room_name'], + ); + } + return $grouped; + } + + public static function getTotalConnectedRooms($idRoom = 0, $idRoomConnected = 0) + { + $idRoom = (int) $idRoom; + $idRoomConnected = (int) $idRoomConnected; + + if ($idRoom <= 0 && $idRoomConnected > 0) { + $sql = 'SELECT DISTINCT id_room + FROM `' . _DB_PREFIX_ . 'htl_connected_room` + WHERE id_room_connected = ' . $idRoomConnected; + + $results = Db::getInstance()->executeS($sql); + if ($results === false) { + return array(); + } + return array_column($results, 'id_room'); + } + + $sql = 'SELECT COUNT(*) FROM `' . _DB_PREFIX_ . 'htl_connected_room` hcr + INNER JOIN `' . _DB_PREFIX_ . 'htl_room_information` hri + ON hri.id = hcr.id_room_connected + WHERE hcr.id_room = ' . $idRoom; + + return (int) Db::getInstance()->getValue($sql); + } + +} diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index ca44a28267..4dfdabc016 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -552,6 +552,17 @@ public function getModuleSql() SELECT 5, `id_lang`, 'Hotel Amenities Block', 'Configure Hotels Amenities settings. You can display hotel amenities images using this block. This block will be displayed on home page.' FROM `"._DB_PREFIX_."lang` ORDER BY `id_lang`;", + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_connected_room` ( + `id_connected_room` int(11) NOT NULL AUTO_INCREMENT, + `id_room` int(11) NOT NULL, + `id_room_connected` int(11) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_connected_room`), + UNIQUE KEY `uniq_room_connection` (`id_room`, `id_room_connected`), + KEY `idx_id_room` (`id_room`), + KEY `idx_id_room_connected` (`id_room_connected`) + ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;", ); } @@ -615,7 +626,8 @@ public function dropTables() `'._DB_PREFIX_.'htl_room_type_bed_type`, `'._DB_PREFIX_.'htl_access`, `'._DB_PREFIX_.'htl_settings_link`, - `'._DB_PREFIX_.'htl_settings_link_lang`' + `'._DB_PREFIX_.'htl_settings_link_lang`, + `'._DB_PREFIX_.'htl_connected_room`' ); } } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 87c31f89bc..305cbf74db 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -386,6 +386,7 @@ public function assignRoomBookingForm() 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), 'link' => $this->context->link, 'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL, + 'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms(null, $this->context->language->id), )); if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) { @@ -1035,6 +1036,7 @@ public function setMedia() // add fullcalender plugin $this->addJqueryUI('ui.tooltip', 'base', true); $this->removeJS(Media::getJqueryUIPath('effects.core', 'base', false), false); + $this->addCSS(array(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css')); $this->addCSS(_PS_JS_DIR_.'fullcalendar/main.css'); $this->addJs(_PS_JS_DIR_.'fullcalendar/main.js'); diff --git a/modules/hotelreservationsystem/define.php b/modules/hotelreservationsystem/define.php index e8a7cc909c..46ac79645a 100644 --- a/modules/hotelreservationsystem/define.php +++ b/modules/hotelreservationsystem/define.php @@ -49,6 +49,7 @@ require_once 'classes/HotelBranchRefundRules.php'; require_once 'classes/HotelBedType.php'; require_once 'classes/HotelRoomTypeBedType.php'; +require_once 'classes/HotelConnectedRoom.php'; // linked products require_once 'classes/RoomTypeServiceProduct.php'; diff --git a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css index a207087a61..5d7bcbd54c 100644 --- a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css +++ b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css @@ -577,7 +577,7 @@ p.room_cat_data .fc-today-button:disabled { display: none; } -/* book now page tooltip */ +/*tooltip */ .tooltip_cont { min-width: 280px; width: 100%; @@ -607,6 +607,19 @@ body.adminhotelroomsbooking .ui-tooltip { padding: 10px; box-shadow: 0px 0px 15px 0px #00000026; } +.ui-tooltip { + border: unset; + padding: 10px; + box-shadow: 0px 0px 15px 0px #00000026; +} +.tooltip_cont { min-width: 280px; width: 100%; font-size: 14px; font-weight: 600; } +.tooltip_cont .tip_header { margin-bottom: 10px; } +.tooltip_cont .tip-body > div { margin-bottom: 6px; } +.tip_element_head { font-size: 12px; } +.tip_element_value { font-size: 16px; opacity: 0.6; } +.tip-body { display: grid; grid-template-columns: auto auto; } +.tip-body.connected-tip-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; } +.connected-room-icon { color: #008abd; cursor: pointer; } #room-reallocation-modal .modal-footer { padding: 15px 0px 0px 0px diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl index ccc73a37cb..8c9d0fe57f 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl @@ -40,7 +40,12 @@ {foreach from=$book_v['data']['available'] key=avai_k item=avai_v} - {$avai_v['room_num']|escape:'htmlall':'UTF-8'} {hook h='displayRoomNumAfter' data=$avai_v type='available'} + {$avai_v['room_num']|escape:'htmlall':'UTF-8'} + {if isset($htl_connected_rooms[$avai_v['id_room']]) && $htl_connected_rooms[$avai_v['id_room']]|@count > 0} + {include file="controllers/products/connected-rooms.tpl" htl_connected_rooms=$htl_connected_rooms[$avai_v['id_room']]} + {/if} + + {hook h='displayRoomNumAfter' data=$avai_v type='available'} {assign var="is_full_date" value=($show_full_date && ($date_from|date_format:'%D' == $date_to|date_format:'%D'))} {dateFormat date=$date_from full=$is_full_date} - {dateFormat date=$date_to full=$is_full_date} {$avai_v['room_comment']|escape:'htmlall':'UTF-8'} @@ -132,7 +137,11 @@

{dateFormat date=$part_v['date_from'] full=$is_full_date} - {dateFormat date=$part_v['date_to'] full=$is_full_date}

{/if} - {$sub_part_v['room_num']|escape:'htmlall':'UTF-8'} {hook h='displayRoomNumAfter' data=$sub_part_v type='partially_available'} + {$sub_part_v['room_num']|escape:'htmlall':'UTF-8'} + {if isset($htl_connected_rooms[$sub_part_v['id_room']]) && $htl_connected_rooms[$sub_part_v['id_room']]|@count > 0} + {include file="controllers/products/connected-rooms.tpl" htl_connected_rooms=$htl_connected_rooms[$sub_part_v['id_room']]} + {/if} + {hook h='displayRoomNumAfter' data=$sub_part_v type='partially_available'} {foreach $allotment_types as $allotment_type}