Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@
{assign var=curr_id value=$cart->id_currency|intval}
{foreach from=$cart_detail_data item=data}
<tr data-id-booking-data="{$data.id}" data-id-product="{$data.id_product}" data-id-room="{$data.id_room}" data-date-from="{$data.date_from}" data-date-to="{$data.date_to}" >
<td>{$data.room_num|escape:'html':'UTF-8'} {hook h='displayRoomNumAfter' data=$data type='adminOrder'}</td>
<td>{$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'}</td>
<td><img src="{$data.image_link|escape:'html':'UTF-8'}" title="Room image" /></td>
<td>
<p>{$data.room_type|escape:'html':'UTF-8'}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@

<tr class="product-line-row" data-id_htl_booking="{$data.id|escape:'html':'UTF-8'}" data-id_room="{$data.id_room}" data-id_product="{$data.id_product}" data-id_hotel="{$data.id_hotel}" data-date_from="{$data.date_from}" data-date_to="{$data.date_to}" data-product_price="{$data.unit_amt_tax_incl}" data-id_order_detail="{$data.id_order_detail}">
<td>
<p>{$data.room_num}</p>
<p>{$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}
</p>
{if $data.is_back_order}
<span class="overbooked_room">{l s='overbooked'}</span>
{/if}
Expand Down
293 changes: 270 additions & 23 deletions admin/themes/default/template/controllers/products/configuration.tpl

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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}
<span class="connected-room-tooltip-trigger"
data-connected-details='{json_encode($htl_connected_rooms)|escape:'html':'UTF-8'}'>
<i class="icon-random connected-room-icon"></i>
</span>
{/if}
<script>
$(document).ready(function() {
{literal}
if (typeof window.initConnectedRoomTooltips === 'undefined') {
window.initConnectedRoomTooltips = function() {
if (typeof $.fn.tooltip === 'undefined' || typeof $.ui === 'undefined' || typeof $.ui.tooltip === 'undefined') {
return;
}
$('.connected-room-tooltip-trigger').each(function() {
if ($(this).data('ui-tooltip')) {
return;
}
$(this).tooltip({
items: '.connected-room-tooltip-trigger',
content: function() {
var details = $(this).data('connected-details');
if (!details || details.length === 0) {
return "{/literal}{l s='No rooms connected' js=1}{literal}";
}
var html = '<div class="tooltip_cont">';
html += '<div class="tip_header"><div class="tip_date">{/literal}{l s="Connected Rooms" js=1}{literal}</div></div>';
html += '<div class="tip-body connected-tip-body">';
var grouped = {};
for (var i = 0; i < details.length; i++) {
var type = details[i].room_type_name;
if (!grouped[type]) { grouped[type] = []; }
grouped[type].push(details[i].connected_room_name);
}
for (var type in grouped) {
html += '<div>';
html += '<div class="tip_element_head">' + type + '</div>';
html += '<div class="tip_element_value">' + grouped[type].join(', ') + '</div>';
html += '</div>';
}
html += '</div></div>';
return html;
},
position: { my: "left top+10", at: "left bottom", collision: "flipfit", within: "#content" },
close: function(event, ui) {
ui.tooltip.hover(function() {
$(this).stop(true).fadeTo(300, 1);
},
function() {
$(this).fadeOut('300', function() {
$(this).remove();
});
});
}
});
});
};
}
window.initConnectedRoomTooltips();
{/literal}
});
</script>
Original file line number Diff line number Diff line change
@@ -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
*}
<style>
#connectedRoomModal .connected-rooms-table {
table-layout: fixed;
width: 100%;
border-radius: 3px;
}


#connectedRoomModal .modal-title .disable_dates_title {
display: inline-block;
font-weight: 600;
}

#connectedRoomModal .modal-title .connected_room_num {
color: grey;
}

#connectedRoomModal .modal-title {
line-height: 2;
}

#connectedRoomModal .modal-title .close {
line-height: 2;
}

#connectedRoomModal .modal-body {
max-height: 600px;
overflow-y: auto;
}
</style>
<div class="modal-body">
<input type="hidden" id="connected_room_main_id" name="main_room_id" value="{$main_room_id|intval}">
<!-- connectedrooms list -->
<div class="">
<div class="">
<div id="connected_rooms_list">
<div id="connected_rooms_table_wrapper"
class="{if !isset($htl_connected_rooms) || $htl_connected_rooms|count == 0}hide{/if}">
<table class="table table-bordered table-striped connected-rooms-table">
<colgroup>
<col style="width: 35%;">
<col style="width: 45%;">
<col style="width: 120px;">
</colgroup>
<thead>
<tr>
<th>{l s='Room Type'}</th>
<th>{l s='Connected Room'}</th>
<th width="120" class="text-center">
{l s='Action'}
</th>
</tr>
</thead>
<tbody id="connected_rooms_tbody">
{if isset($htl_connected_rooms) && $htl_connected_rooms|count > 0}
{foreach from=$htl_connected_rooms item=room}
<tr class="connected-room-row">
<td>{$room.room_type_name|escape:'html':'UTF-8'}</td>
<td>{$room.connected_room_name|escape:'html':'UTF-8'}</td>
<td class="text-center">
<a href="javascript:void(0);"
class="delete-connected-room btn btn-default"
data-connected-id="{$room.id_connected_room|intval}"
data-connected-room-id="{$room.id_room_connected|intval}"
title="{l s='Remove'}">
<i class="icon-trash"></i>
</a>
</td>
</tr>
{/foreach}
{/if}
</tbody>
</table>
</div>
<div class="list-empty {if isset($htl_connected_rooms) && $htl_connected_rooms|count > 0}hide{/if}"
id="connected_rooms_empty_state">
<div class="list-empty-msg">
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No connected rooms.'}
</div>
</div>
</div>
{if isset($htl_not_connected_rooms) && $htl_not_connected_rooms|count > 0}
<button type="button" id="add_connected_room_row" class="btn btn-default">
<i class="icon-plus"></i> {l s='Add Connected Room'}
</button>
{/if}
</div>
</div>
{if isset($htl_not_connected_rooms) && $htl_not_connected_rooms|count > 0}
<table class="hide">
<tbody>
<tr id="connected_room_add_template" class="connected-room-add-row hide">
<td>
<select class="form-control connect-room-type" name="connect_room_type">
{foreach from=$htl_not_connected_rooms key=typeId item=typeGroup}
<option value="{$typeGroup.id_room_type|intval}"
{if $typeGroup.id_room_type == $current_roomtype}selected{/if}>
{$typeGroup.name|escape:'html':'UTF-8'}
</option>
{/foreach}
</select>
</td>
<td>
<select class="form-control connect-room" name="connect_room">
</select>
</td>
<td class="text-center">
<button type="button" class="btn btn-default remove-connected-room-row"
title="{l s='Remove'}">
<i class="icon-trash"></i>
</button>
<button type="button" class="btn btn-primary save-connected-room">
{l s='Add'}
</button>
</td>
</tr>
</tbody>
</table>
{/if}
</div>
5 changes: 5 additions & 0 deletions controllers/admin/AdminOrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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']
Expand Down
Loading