Merge pull request #1823 from amitsharma322/gli-3104

Fixed: prevent raw HTML in admin cart rule and order tooltips in the back-office
This commit is contained in:
Rohit Jain
2026-10-14 19:41:32 +05:30
committed by GitHub
49 changed files with 368 additions and 528 deletions

View File

@@ -478,11 +478,13 @@ $(document).ready(function() {
$('.no-htl-access-option').on('click', function() {
$(this).prop('selected', false);
});
initTooltip();
initUITooltip();
}); //end dom ready
function initTooltip($target, contentFn, items) {
var $elements = $target || $('.tooltip-trigger');
function initUITooltip($target, contentFn, items) {
var $elements = $target || $('.ui-tooltip-trigger');
if (!$elements.length) {
return;
}
@@ -491,11 +493,11 @@ function initTooltip($target, contentFn, items) {
if (!contentFn && $this.data('ui-tooltip')) {
return;
}
$this.tooltip({
$this.uiTooltip({
content: contentFn || $this.next('.tooltip-content').html(),
items: items || 'span',
trigger: 'hover',
tooltipClass: 'tooltip-popup',
tooltipClass: 'ui-tooltip-popup',
open: function (event, ui) {
if (event.buttons == 1 || event.buttons == 3) {
ui.tooltip.remove();

View File

@@ -1,57 +1,44 @@
.tooltip_cont
width: 100%
font-size: 14px
font-weight: 600
.tip_header
margin-bottom: 10px
.tip-body > div
margin-bottom: 6px
margin-right: 10px
.tip_element_head
font-size: 12px
.tip_element_value
font-size: 14px
font-weight: 400
opacity: 0.8
.tip-body
display: grid
grid-template-columns: auto auto
&.tip-body-grid
grid-template-columns: 1fr 1fr
gap: 8px 16px
.ui-tooltip,
.ui-tooltip.ui-widget-content
.ui-tooltip.ui-tooltip-popup
border: none
padding: 10px
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.15)
width: auto
.tooltip-trigger
.ui-tooltip-trigger
cursor: pointer
display: inline-block
vertical-align: middle
.ui-tooltip-content
width: 100%
.ui-tooltip-wrapper
width: 100%
font-size: 14px
font-weight: 600
.ui-tooltip.tooltip-popup
ul
margin: 0
padding: 0 0 0 16px
list-style: disc
li
padding: 2px 0
.ui-tooltip-header
margin-bottom: 5px
.tooltip-popup-row
display: flex
justify-content: space-between
align-items: center
gap: 12px
margin: 3px 0
white-space: nowrap
label
font-weight: 600
margin: 0
.ui-tooltip-body
> div
margin-bottom: 6px
margin-right: 10px
&.ui-tooltip-body-grid
display: grid
grid-template-columns: auto auto
grid-template-columns: 1fr 1fr
gap: 8px 2px
.ui-tooltip-elem-head
font-size: 12px
.ui-tooltip-elem-txt
font-size: 13px
font-weight: 400
opacity: 0.8
.ui-tooltip-label
font-weight: 600
margin: 0

View File

@@ -24,17 +24,17 @@
<span>{$hotel_names_first|escape:'html':'UTF-8'}</span>
{if $hotel_names_remaining}
{capture name='hotel_names_tooltip'}
<div class="tooltip_cont">
<div class="tip_header"><div class="tip_date">{l s='Selected Hotels'}</div></div>
<div class="ui-tooltip-wrapper">
<div class="ui-tooltip-header"><div class="ui-tooltip-label">{l s='Selected Hotels'}</div></div>
<ul>
{foreach from=$selected_hotels item='hotel'}
<li class="tip_element_value">{$hotel|escape:'html':'UTF-8'}</li>
<li class="ui-tooltip-elem-txt">{$hotel|escape:'html':'UTF-8'}</li>
{/foreach}
</ul>
</div>
{/capture}
{capture name='hotel_names_tooltip_title'}<span class="badge tooltip-trigger">+{$hotel_names_remaining|@count}</span>{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.hotel_names_tooltip tooltip_title=$smarty.capture.hotel_names_tooltip_title}
{capture name='hotel_names_tooltip_title'}<span class="badge ui-tooltip-trigger">+{$hotel_names_remaining|@count}</span>{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.hotel_names_tooltip tooltip_title=$smarty.capture.hotel_names_tooltip_title}
{/if}
{else}
--

View File

@@ -69,21 +69,21 @@
<td>
<span>{displayPrice price=($product.total_price_tax_incl - $product.total_price_tax_excl) currency=$currency->id}</span>
{if isset($use_tourism_tax) && $use_tourism_tax && isset($product.tourism_tax_status)}
<span class="price_info">
&nbsp;<img src="{$info_icon_path|escape:'htmlall':'UTF-8'}" />
</span>
<div class="price_info_container" style="display: none;">
<div>
<label>{l s='Service Tax:'}</label>
<span class="pull-right">{displayPrice price=$product.total_service_tax_only currency=$currency->id}</span>
{capture name='service_tax_tooltip_content'}
<div class="ui-tooltip-body">
<div class="ui-tooltip-service-tax-row">
<label class="ui-tooltip-label">{l s='Service Tax:'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$product.total_service_tax_only currency=$currency->id}</span>
</div>
{if $product.tourism_tax_total > 0}
<div class="ui-tooltip-tourism-tax-row">
<label class="ui-tooltip-label">{l s='Tourism Tax:'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$product.tourism_tax_total currency=$currency->id}</span>
</div>
{/if}
</div>
{if $product.tourism_tax_total > 0}
<div>
<label>{l s='Tourism Tax:'}</label>
<span class="pull-right">{displayPrice price=$product.tourism_tax_total currency=$currency->id}</span>
</div>
{/if}
</div>
{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.service_tax_tooltip_content}
{/if}
</td>
<td>

View File

@@ -105,21 +105,21 @@
</td>
<td class="center text-nowrap">
{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}
<span class="price_info">
&nbsp;<img src="{$info_icon_path|escape:'htmlall':'UTF-8'}" />
</span>
<div class="price_info_container" style="display: none;">
<div>
<label>{l s='Room & Service Tax:'}</label>
<span class="pull-right">{convertPriceWithCurrency price=$data.total_room_service_tax_only currency=$currency->id}</span>
{capture name='room_tax_tooltip_content'}
<div class="ui-tooltip-body">
<div class="ui-tooltip-service-tax-row">
<label class="ui-tooltip-label">{l s='Room & Service Tax:'}</label>
<span class="ui-tooltip-elem-txt">{convertPriceWithCurrency price=$data.total_room_service_tax_only currency=$currency->id}</span>
</div>
{if isset($data.tourism_tax_total) && $data.tourism_tax_total > 0}
<div>
<label>{l s='Tourism Tax:'}</label>
<span class="pull-right">{convertPriceWithCurrency price=$data.tourism_tax_total currency=$currency->id}</span>
<div class="ui-tooltip-tourism-tax-row">
<label class="ui-tooltip-label">{l s='Tourism Tax:'}</label>
<span class="ui-tooltip-elem-txt">{convertPriceWithCurrency price=$data.tourism_tax_total currency=$currency->id}</span>
</div>
{/if}
</div>
{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.room_tax_tooltip_content}
</td>
<td class="center">
{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}

View File

@@ -69,21 +69,21 @@
<td>
<span>{displayPrice price=($product.total_price_tax_incl - $product.total_price_tax_excl) currency=$currency->id}</span>
{if isset($use_tourism_tax) && $use_tourism_tax && isset($product.tourism_tax_status)}
<span class="price_info">
&nbsp;<img src="{$info_icon_path|escape:'htmlall':'UTF-8'}" />
</span>
<div class="price_info_container" style="display: none;">
<div>
<label>{l s='Service Tax:'}</label>
<span class="pull-right">{displayPrice price=$product.total_service_tax_only currency=$currency->id}</span>
{capture name='service_tax_tooltip_content'}
<div class="ui-tooltip-body">
<div class="ui-tooltip-service-tax-row">
<label class="ui-tooltip-label">{l s='Service Tax:'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$product.total_service_tax_only currency=$currency->id}</span>
</div>
{if $product.tourism_tax_total > 0}
<div class="ui-tooltip-tourism-tax-row">
<label class="ui-tooltip-label">{l s='Tourism Tax:'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$product.tourism_tax_total currency=$currency->id}</span>
</div>
{/if}
</div>
{if $product.tourism_tax_total > 0}
<div>
<label>{l s='Tourism Tax:'}</label>
<span class="pull-right">{displayPrice price=$product.tourism_tax_total currency=$currency->id}</span>
</div>
{/if}
</div>
{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.service_tax_tooltip_content}
{/if}
</td>
<td>

View File

@@ -21,27 +21,27 @@
*}
{capture name='stay_periods_tooltip'}
<div class="bootstrap tooltip_cont">
<div class="tip_header">
<div>{l s='Stay Periods'}</div>
<div class="bootstrap ui-tooltip-wrapper">
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Stay Periods'}</div>
</div>
<table class="table">
<thead>
<tr>
<th class="tip_element_head">{l s='Duration'}</th>
<th class="tip_element_head">{l s='Rooms'}</th>
<th class="ui-tooltip-elem-head">{l s='Duration'}</th>
<th class="ui-tooltip-elem-head">{l s='Rooms'}</th>
</tr>
</thead>
<tbody>
{foreach from=$stay_periods item=stay_period}
<tr>
<td class="tip_element_value">{$stay_period.from} &ndash; {$stay_period.to}</td>
<td class="tip_element_value center">{$stay_period.count}</td>
<td class="ui-tooltip-elem-txt">{$stay_period.from} &ndash; {$stay_period.to}</td>
<td class="ui-tooltip-elem-txt center">{$stay_period.count}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/capture}
{capture name='stay_periods_tooltip_title'}<span class="badge tooltip-trigger">+{$extra_stay_periods_count}</span>{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.stay_periods_tooltip tooltip_title=$smarty.capture.stay_periods_tooltip_title}
{capture name='stay_periods_tooltip_title'}<span class="badge ui-tooltip-trigger">+{$extra_stay_periods_count}</span>{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.stay_periods_tooltip tooltip_title=$smarty.capture.stay_periods_tooltip_title}

View File

@@ -24,12 +24,6 @@
room table (_rooms_informaion_table.tpl) and/or a products table (_hotel_service_products_table.tpl /
_standalone_service_products_table.tpl) with tourism tax columns is rendered. *}
<style>
.ui-tooltip.price_info-tooltip { border: unset; padding: 10px; box-shadow: 0px 0px 15px 0px #00000026; }
.ui-tooltip.price_info-tooltip span { margin-left: 15px; }
.ui-tooltip.price_info-tooltip label { font-weight: 600; }
</style>
<div class="modal fade" id="exempt-tourism-tax-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
@@ -58,35 +52,6 @@
<script>
$(document).ready(function () {
if ($('#customer_cart_details .price_info, #customer_products_details .price_info').length) {
$('#customer_cart_details .price_info, #customer_products_details .price_info').each(function (i, element) {
$(this).find('img').tooltip({
content: $(this).closest('td').find('.price_info_container').html(),
items: 'img',
trigger: 'hover',
tooltipClass: 'price_info-tooltip',
open: function (event, ui) {
if (typeof(event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function (event, ui) {
ui.tooltip.hover(function () {
$(this).stop(true).fadeTo(400, 1);
}, function () {
$(this).fadeOut('400', function () {
$(this).remove();
});
});
}
});
});
}
function ttAjax(action, data) {
$.ajax({
type: 'POST',

View File

@@ -22,11 +22,6 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<style>
.ui-tooltip.price_info-tooltip { border: unset; padding: 10px; box-shadow: 0px 0px 15px 0px #00000026; }
.ui-tooltip.price_info-tooltip span { margin-left: 15px; }
.ui-tooltip.price_info-tooltip label { font-weight: 600; }
</style>
<script type="text/javascript">
{if isset($cart->id) && $cart->id}
var id_cart = {$cart->id|intval};
@@ -62,31 +57,8 @@
}
});
$('.total_taxes_price_info img').tooltip({
content: function () {
return $(this).closest('.data-focus').find('.price_info_container').html();
},
items: 'img',
trigger: 'hover',
tooltipClass: 'price_info-tooltip',
open: function (event, ui) {
if (typeof(event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function (event, ui) {
ui.tooltip.hover(function () {
$(this).stop(true).fadeTo(400, 1);
}, function () {
$(this).fadeOut('400', function () {
$(this).remove();
});
});
}
$(document).on('admin-theme.js.ready', function () {
initUITooltip();
});
$('#customer').typeWatch({
@@ -1462,7 +1434,7 @@
{
$("#customer_cart_details").empty();
$("#customer_cart_details").append(res.cart_detail_html);
initTooltip();
initUITooltip();
displaySummary(res);
}
@@ -1667,7 +1639,7 @@
},
complete: function() {
$(".loading_overlay").hide();
initTooltip();
initUITooltip();
}
});
});
@@ -1803,7 +1775,7 @@
},
complete: function() {
$(".loading_overlay").hide();
initTooltip();
initUITooltip();
}
});
});
@@ -1854,7 +1826,7 @@
},
complete: function() {
$(".loading_overlay").hide();
initTooltip();
initUITooltip();
}
});
});
@@ -2308,20 +2280,22 @@
</div>
<div class="col-lg-2">
<div class="data-focus">
<span>{l s='Total taxes'}
<span class="price_info total_taxes_price_info">&nbsp;<img src="{$info_icon_path|escape:'htmlall':'UTF-8'}" /></span>
</span><br/>
<span>{l s='Total taxes'}</span>
{capture name='total_taxes_tooltip_content'}
<div class="ui-tooltip-body">
<div class="ui-tooltip-service-tax-row">
<label class="ui-tooltip-label">{l s='Room & Service Tax:'}</label>
<span class="ui-tooltip-elem-txt" id="total_taxes_vat"></span>
</div>
<div class="ui-tooltip-tourism-tax-row">
<label class="ui-tooltip-label">{l s='Tourism Tax:'}</label>
<span class="ui-tooltip-elem-txt" id="total_taxes_tourism"></span>
</div>
</div>
{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.total_taxes_tooltip_content}
<br/>
<span id="total_taxes" class="size_l"></span>
<div class="price_info_container" style="display: none;">
<div>
<label>{l s='Room & Service Tax:'}</label>
<span class="pull-right" id="total_taxes_vat"></span>
</div>
<div>
<label>{l s='Tourism Tax:'}</label>
<span class="pull-right" id="total_taxes_tourism"></span>
</div>
</div>
</div>
</div>
<div class="col-lg-2">

View File

@@ -65,17 +65,19 @@
{$product['name']|escape:'html':'UTF-8'}
{capture name='room_type_service_tooltip_content'}
{assign var="priceCalcMethod" value=$product['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-popup-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
{/foreach}
</ul>
</div>
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
{/foreach}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_tooltip_content allow_html=true}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_tooltip_content allow_html=true}
</div>
</td>
<td>

View File

@@ -57,9 +57,11 @@
{$service['name']|escape:'html':'UTF-8'}
{capture name='room_type_service_tooltip_content'}
{assign var="priceCalcMethod" value=$service['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-popup-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
{/foreach}
@@ -67,7 +69,7 @@
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_tooltip_content allow_html=true}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_tooltip_content allow_html=true}
</div>
</div>
<input value="{$service['id_service_product_order_detail']|escape:'html':'UTF-8'}" name="id_service_product_order_detail[]" type="hidden"/>
@@ -145,16 +147,18 @@
{$product['name']|escape:'html':'UTF-8'}
{capture name='adm_pcm_tooltip_content'}
{assign var="priceCalcMethod" value=$product['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-popup-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
{/foreach}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.adm_pcm_tooltip_content allow_html=true}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.adm_pcm_tooltip_content allow_html=true}
</td>
<td class="text-center">
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
@@ -321,16 +325,18 @@
{$service['name']|escape:'html':'UTF-8'}
{capture name='room_type_service_pcm_tooltip_content'}
{assign var="priceCalcMethod" value=$service['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-popup-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
{/foreach}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_pcm_tooltip_content allow_html=true} </td>
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_pcm_tooltip_content allow_html=true} </td>
<td>
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>

View File

@@ -21,13 +21,13 @@
*}
{if isset($htl_connected_rooms) && $htl_connected_rooms|@count > 0}
{capture name='connected_room_tooltip'}
<div class="tooltip_cont">
<div class="tip_header"><div class="tip_date">{l s='Connected Rooms'}</div></div>
<div class="tip-body tip-body-grid">
<div class="ui-tooltip-wrapper">
<div class="ui-tooltip-header"><div class="ui-tooltip-label">{l s='Connected Rooms'}</div></div>
<div class="ui-tooltip-body ui-tooltip-body-grid">
{foreach from=$htl_connected_rooms.connected_room_types item=group}
<div>
<div class="tip_element_head">{$group.room_type_name|escape:'html':'UTF-8'}</div>
<div class="tip_element_value">
<div class="ui-tooltip-elem-head">{$group.room_type_name|escape:'html':'UTF-8'}</div>
<div class="ui-tooltip-elem-txt">
{foreach from=$group.connected_rooms item=room name=connected_rooms}
{$room.name|escape:'html':'UTF-8'}{if !$smarty.foreach.connected_rooms.last}, {/if}
{/foreach}
@@ -37,5 +37,5 @@
</div>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.connected_room_tooltip tooltip_icon_class='icon-random' tooltip_icon_style='color: #008abd;' }
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.connected_room_tooltip tooltip_icon_class='icon-random' tooltip_icon_style='color: #008abd;' }
{/if}

View File

@@ -383,4 +383,4 @@
<div id="main">
<div id="content" class="{if !$bootstrap}nobootstrap{else}bootstrap{/if}">
{/if}
<div id="page-loader"><span><i class="icon-refresh icon-spin icon-fw"></i></span></div>
<div id="page-loader"><span><i class="icon-refresh icon-spin icon-fw"></i></span></div>

View File

@@ -20,7 +20,7 @@
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*}
<span class="tooltip-trigger{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
<span class="ui-tooltip-trigger{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
{if isset($tooltip_title) && $tooltip_title}
{$tooltip_title nofilter}
{elseif isset($tooltip_icon_class) && $tooltip_icon_class}

View File

@@ -2936,7 +2936,7 @@ class AdminControllerCore extends Controller
public function setDeprecatedMedia()
{
}
public function setMedia()
{
//Bootstrap
@@ -2957,7 +2957,10 @@ class AdminControllerCore extends Controller
));
//loads specific javascripts for the admin theme
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJS(_PS_JS_DIR_.'jquery-ui-tooltip-alias.js');
$this->addJS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/bootstrap.min.js');
$this->addJS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/modernizr.min.js');
$this->addJS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/modernizr-loads.js');
$this->addJS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/moment-with-langs.min.js');

View File

@@ -1183,6 +1183,7 @@ class FrontControllerCore extends Controller
$this->addJS(_PS_JS_DIR_.'hookLiveEdit.js');
}
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJS(_PS_JS_DIR_.'jquery-ui-tooltip-alias.js');
if (Configuration::get('PS_QUICK_VIEW')) {
$this->addjqueryPlugin('fancybox');

View File

@@ -278,7 +278,6 @@ class AdminCartRulesControllerCore extends AdminController
'room_rmv_txt' => $this->l('Unselect below room types'),
)
);
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJS(_PS_JS_DIR_.'admin/cart-rules.js');
$this->addJqueryPlugin(array('typewatch', 'fancybox', 'autocomplete'));
}

View File

@@ -1594,8 +1594,6 @@ class AdminNormalProductsControllerCore extends AdminController
_PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css',
_PS_CSS_DIR_.'ps-hotel-reservation.css',
));
}else {
$this->addJqueryUI('ui.tooltip', 'base', true);
}
}

View File

@@ -1431,9 +1431,7 @@ class AdminOrdersControllerCore extends AdminController
parent::setMedia();
$this->addJqueryUI('ui.datepicker');
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js');
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
if ($this->display == 'view') {
if ($this->loadObject()) {

View File

@@ -590,7 +590,6 @@ class GuestTrackingControllerCore extends FrontController
));
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
// load Google Maps library if configured
if (!count($this->errors)) {

View File

@@ -494,7 +494,6 @@ class OrderConfirmationControllerCore extends FrontController
$this->addJS(_THEME_JS_DIR_.'order-confirmation.js');
$this->addCSS(_THEME_CSS_DIR_.'order-confirmation.css');
$this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme
$this->addJqueryUI('ui.tooltip', 'base', true);
}
}
}

View File

@@ -847,7 +847,6 @@ class OrderDetailControllerCore extends FrontController
));
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
// load Google Maps library if configured
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder(Tools::getValue('id_order'))) {

View File

@@ -413,7 +413,6 @@ class OrderOpcControllerCore extends ParentOrderController
} else {
$this->addJS(_THEME_MOBILE_JS_DIR_.'opc.js');
}
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
$this->addJS(array(
_THEME_JS_DIR_.'tools/statesManagement.js',

View File

@@ -40,7 +40,6 @@ class ProductControllerCore extends FrontController
if (count($this->errors)) {
return;
}
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
if (!$this->useMobileTheme()) {
$this->addCSS(_THEME_CSS_DIR_.'product.css');

View File

@@ -1130,6 +1130,7 @@ $(document).ready(function() {
if (!jsonData.hasError) {
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
initUITooltip();
}
showSuccessMessage(txtExtraServiceSucc);
} else {
@@ -1191,6 +1192,7 @@ $(document).ready(function() {
if (!jsonData.hasError) {
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
initUITooltip();
}
showSuccessMessage(txtExtraServiceSucc);
} else {
@@ -1359,7 +1361,7 @@ $(document).ready(function() {
},
complete: function() {
$(".loading_overlay").hide();
initTooltip();
initUITooltip();
}
});
});
@@ -2478,7 +2480,7 @@ const EditRoomBookingModal = {
// initialize datepickers
EditRoomBookingModal.initDatePickers();
initTooltip();
initUITooltip();
$('#edit_product .extra-services-container #id_htl_booking').val(jsonProductLineData.id);
$('#edit-room-booking-modal').modal('show');
} else {

11
js/jquery-ui-tooltip-alias.js vendored Normal file
View File

@@ -0,0 +1,11 @@
/* Preserve jQuery UI's tooltip widget under $.fn.uiTooltip before it may be
* overwritten (e.g. by Bootstrap re-registering $.fn.tooltip). Shared by both
* the back office and front office, since the load order differs between the
* two but the aliasing logic itself doesn't depend on either context. */
(function ($) {
'use strict';
if ($ && $.fn && $.isFunction($.fn.tooltip) && !$.fn.tooltip.Constructor) {
$.fn.uiTooltip = $.fn.tooltip;
}
}(window.jQuery));

View File

@@ -1165,7 +1165,6 @@ public function ajaxProcessGetCalenderData()
MediaCore::addJsDef($jsVars);
// add fullcalender plugin
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->removeJS(Media::getJqueryUIPath('ui.effect', 'base', false), false);
$this->addCSS(array(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css'));

View File

@@ -697,7 +697,6 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
parent::setMedia();
if ($this->display == 'view') {
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->removeJS(Media::getJqueryUIPath('ui.effect', 'base', false), false);
$this->addJs(_MODULE_DIR_.$this->module->name.'/views/js/admin/wk_refund_request.js');

View File

@@ -23,10 +23,4 @@ body.adminorderrefundrequests .ui-tooltip {
border: unset;
padding: 10px;
box-shadow: 0px 0px 15px 0px #00000026;
}
.ui-tooltip.tooltip-popup span {
margin-left: 15px;
}
.ui-tooltip.tooltip-popup label {
font-weight: 600;
}

View File

@@ -54,18 +54,18 @@ $(document).ready(function() {
if (info.event.extendedProps.is_notification) {
var $cell = $(info.el).closest('td');
$cell.css('background-color', info.event.backgroundColor);
initTooltip($cell, function() {
$('#date-stats-tooltop .tip_date').text(info.event.extendedProps.data.date_format);
initUITooltip($cell, function() {
$('#date-stats-tooltop .ui-tooltip-label').text(info.event.extendedProps.data.date_format);
$.each(info.event.extendedProps.data.stats, function(elem, val) {
if (elem == 'num_part_avai') {
$('#date-stats-tooltop').find('.'+elem).hide().find('.tip_element_value').text('');
$('#date-stats-tooltop').find('.'+elem).hide().find('.ui-tooltip-elem-txt').text('');
} else {
$('#date-stats-tooltop').find('.'+elem).show().find('.tip_element_value').text(val);
$('#date-stats-tooltop').find('.'+elem).show().find('.ui-tooltip-elem-txt').text(val);
}
});
return $('#date-stats-tooltop').html();
}, 'td');
$cell.tooltip('option', {
$cell.uiTooltip('option', {
position: {
my: "left top",
at: "left+50% bottom-50%",
@@ -98,29 +98,29 @@ $(document).ready(function() {
});
} else {
$(info.el).addClass('search-result-event');
initTooltip($(info.el), function() {
$('#date-stats-tooltop .tip_date').text(info.event.extendedProps.data.date_from_format + ' - ' +info.event.extendedProps.data.date_to_format);
initUITooltip($(info.el), function() {
$('#date-stats-tooltop .ui-tooltip-label').text(info.event.extendedProps.data.date_from_format + ' - ' +info.event.extendedProps.data.date_to_format);
$.each(info.event.extendedProps.data.stats, function(elem, val) {
if (elem == 'num_part_avai') {
if (val > 0) {
$('#date-stats-tooltop').find('.'+elem).show().find('.tip_element_value').text(val);
$('#date-stats-tooltop').find('.'+elem).show().find('.ui-tooltip-elem-txt').text(val);
} else {
$('#date-stats-tooltop').find('.'+elem).hide().find('.tip_element_value').text('');
$('#date-stats-tooltop').find('.'+elem).hide().find('.ui-tooltip-elem-txt').text('');
}
} else {
$('#date-stats-tooltop').find('.'+elem).find('.tip_element_value').text(val);
$('#date-stats-tooltop').find('.'+elem).find('.ui-tooltip-elem-txt').text(val);
}
});
return $('#date-stats-tooltop').html();
}, 'div');
$(info.el).tooltip('option', 'track', true);
$(info.el).uiTooltip('option', 'track', true);
info.el.style.borderLeftColor = info.event.extendedProps.data.eventColor;
resizeSearchResultEventBar($(info.el));
}
},
datesSet: function(arg) {
if($('.fc-event').tooltip()) {
$('.fc-event').tooltip('destroy');
if($('.fc-event').uiTooltip()) {
$('.fc-event').uiTooltip('destroy');
}
}
});
@@ -138,7 +138,7 @@ $(document).ready(function() {
}
if ($('#fullcalendar').length) {
if (typeof initTooltip === 'function') {
if (typeof initUITooltip === 'function') {
initBookingCalendar();
} else {
$(document).on('admin-theme.js.ready', initBookingCalendar);
@@ -168,7 +168,7 @@ $(document).ready(function() {
function removeInitializedTooltips() {
$('#fullcalendar td.fc-daygrid-day, #fullcalendar .fc-daygrid-event').each(function () {
if ($(this).data('ui-tooltip')) {
$(this).tooltip('destroy');
$(this).uiTooltip('destroy');
}
});
}
@@ -492,7 +492,7 @@ $(document).ready(function() {
} else {
showSuccessMessage(removed_room_success_txt);
$("#htl_rooms_list").empty().append(result.data.room_tpl);
initTooltip();
initUITooltip();
refreshCartData();
refreshStatsData();
calendar.refetchEvents();
@@ -931,55 +931,21 @@ $(document).ready(function() {
success: function(result) {
if (result.success) {
$(".htl_room_data_cont").html(result.data.stats_panel);
initstatstooltip();
initStatsInfoTooltips();
}
}
});
}
initstatstooltip();
function initstatstooltip()
{
$(".htl_room_data_cont").find('.status-info-tooltip').tooltip({
trigger : 'hover',
show: {
delay: 100,
},
hide: {
delay: 300,
},
open: function(event, ui)
{
if(event.buttons == 1 || event.buttons == 3){
ui.tooltip.remove();
}
if (typeof(event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
// ajax function to pull in data and add it to the tooltip goes here
},
close: function(event, ui)
{
ui.tooltip.hover(function() {
$(this).stop(true).fadeTo(300, 1);
},
function() {
$(this).fadeOut('300', function()
{
$(this).remove();
});
});
}
});
function initStatsInfoTooltips() {
var $target = $(".htl_room_data_cont").find('.ui-tooltip-trigger');
if (typeof initUITooltip === 'function') {
initUITooltip($target);
} else {
$(document).on('admin-theme.js.ready', function () {
initUITooltip($target);
});
}
}
var allotmentTypes = {

View File

@@ -1,7 +1,8 @@
<div class="htl_room_data_cont">
<div class="status-info-tooltip" title="{l s='Due to the dynamic nature of room availability, a single room can fall under multiple categories in the stats panel. For example, if a room is booked from 1st to 3th and then marked as unavailable for maintenance on 4th to 5th, it would be counted in both the "Booked Rooms" and "Unavailable Rooms" categories for those respective dates if search is done from 1st to 6th. This allows admin to understand the room\'s status across different periods accurately.' mod='hotelreservationsystem'}">
<i class="icon-info-circle"></i>
</div>
{capture name='status_info_tooltip_content'}
{l s='Due to the dynamic nature of room availability, a single room can fall under multiple categories in the stats panel. For example, if a room is booked from 1st to 3th and then marked as unavailable for maintenance on 4th to 5th, it would be counted in both the "Booked Rooms" and "Unavailable Rooms" categories for those respective dates if search is done from 1st to 6th. This allows admin to understand the room\'s status across different periods accurately.' mod='hotelreservationsystem'}
{/capture}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.status_info_tooltip_content tooltip_icon_class='icon-info-circle' tooltip_class='status-info-tooltip'}
<div class="row">
<div class="col-sm-6">
<div class="row">

View File

@@ -243,30 +243,30 @@
</div>
<div id="date-stats-tooltop" style="display:none">
<div class="tooltip_cont">
<div class="tip_header">
<div class="tip_date"></div>
<div class="ui-tooltip-wrapper">
<div class="ui-tooltip-header">
<div class="ui-tooltip-label"></div>
</div>
<div class="tip-body">
<div class="ui-tooltip-body ui-tooltip-body-grid">
<div class="total_rooms">
<div class="tip_element_head">{l s='Total Rooms' mod='hotelreservationsystem'}</div>
<div class="tip_element_value"></div>
<div class="ui-tooltip-elem-head">{l s='Total Rooms' mod='hotelreservationsystem'}</div>
<div class="ui-tooltip-elem-txt"></div>
</div>
<div class="num_avail">
<div class="tip_element_head">{l s='Total Available' mod='hotelreservationsystem'}</div>
<div class="tip_element_value"></div>
<div class="ui-tooltip-elem-head">{l s='Total Available' mod='hotelreservationsystem'}</div>
<div class="ui-tooltip-elem-txt"></div>
</div>
<div class="num_booked">
<div class="tip_element_head">{l s='Booked Rooms' mod='hotelreservationsystem'}</div>
<div class="tip_element_value"></div>
<div class="ui-tooltip-elem-head">{l s='Booked Rooms' mod='hotelreservationsystem'}</div>
<div class="ui-tooltip-elem-txt"></div>
</div>
<div class="num_unavail">
<div class="tip_element_head">{l s='Unavailable Rooms' mod='hotelreservationsystem'}</div>
<div class="tip_element_value"></div>
<div class="ui-tooltip-elem-head">{l s='Unavailable Rooms' mod='hotelreservationsystem'}</div>
<div class="ui-tooltip-elem-txt"></div>
</div>
<div class="num_part_avai">
<div class="tip_element_head">{l s='Partially Available Rooms' mod='hotelreservationsystem'}</div>
<div class="tip_element_value"></div>
<div class="ui-tooltip-elem-head">{l s='Partially Available Rooms' mod='hotelreservationsystem'}</div>
<div class="ui-tooltip-elem-txt"></div>
</div>
</div>
</div>

View File

@@ -183,42 +183,46 @@
<td>
{displayPrice price=($booking['total_price_tax_incl'] + $booking['extra_service_total_price_tax_incl']) currency=$orderCurrency['id']}
{capture name='refund_total_tooltip'}
<div>
<label>{l s='%s cost:' sprintf=$booking.selling_object_name mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
<div>
<label>{l s='Services cost:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
{if $tourismTaxAppliedAmount > 0}
<div>
<label>{l s='Tourism Tax:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$tourismTaxAppliedAmount currency=$orderCurrency['id']}</span>
<div class="ui-tooltip-body">
<div class="ui-tooltip-room-row">
<label class="ui-tooltip-label">{l s='%s cost:' sprintf=$booking.selling_object_name mod='hotelreservationsystem'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
{/if}
<div class="ui-tooltip-service-tax-row">
<label class="ui-tooltip-label">{l s='Services cost:' mod='hotelreservationsystem'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
{if $tourismTaxAppliedAmount > 0}
<div class="ui-tooltip-tourism-tax-row">
<label class="ui-tooltip-label">{l s='Tourism Tax:' mod='hotelreservationsystem'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$tourismTaxAppliedAmount currency=$orderCurrency['id']}</span>
</div>
{/if}
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.refund_total_tooltip}
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.refund_total_tooltip}
</td>
<td>
{displayPrice price=($booking['room_paid_amount'] + $booking['extra_service_total_paid_amount']) currency=$orderCurrency['id']}
{capture name='refund_paid_tooltip'}
<div>
<label>{l s='%s paid amount:' sprintf=$booking.selling_object_name mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['room_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
<div>
<label>{l s='Services paid amount:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['extra_service_total_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
{if $tourismTaxPaidAmount > 0}
<div>
<label>{l s='Tourism Tax paid:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$tourismTaxPaidAmount currency=$orderCurrency['id']}</span>
<div class="ui-tooltip-body">
<div class="ui-tooltip-room-row">
<label class="ui-tooltip-label">{l s='%s paid amount:' sprintf=$booking.selling_object_name mod='hotelreservationsystem'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$booking['room_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
{/if}
<div class="ui-tooltip-service-tax-row">
<label class="ui-tooltip-label">{l s='Services paid amount:' mod='hotelreservationsystem'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$booking['extra_service_total_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
{if $tourismTaxPaidAmount > 0}
<div class="ui-tooltip-tourism-tax-row">
<label class="ui-tooltip-label">{l s='Tourism Tax paid:' mod='hotelreservationsystem'}</label>
<span class="ui-tooltip-elem-txt">{displayPrice price=$tourismTaxPaidAmount currency=$orderCurrency['id']}</span>
</div>
{/if}
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.refund_paid_tooltip }
{include file='helpers/ui-tooltip.tpl' tooltip_content=$smarty.capture.refund_paid_tooltip }
</td>
{if !$isRefundCompleted}
<td>

View File

@@ -87,18 +87,11 @@
</div>
<div class="col-sm-6">
<label class="control-label">{l s='Extra Services'}</label>
<p class="extra_services_price_block">
<div class="extra_services_price_block">
{if isset($service_product_price)}{convertPrice price=$service_product_price}{else}{convertPrice price=0}{/if}
{if isset($selected_service_product) && $selected_service_product}
<span class="services-info">
<img src="{$img_dir}icon/icon-info.svg" />
</span>
{/if}
</p>
{if isset($selected_service_product) && $selected_service_product}
<div class="services-info-container" style="display: none;">
<div class="services-info-tooltip-cont">
{if isset($selected_service_product) && $selected_service_product}
{capture name='extra_services_tooltip'}
<div class="services-info-tooltip-cont">
<div class="extra-service-panel">
<p class="panel_title">{l s='Selected services'} <span>{l s='(Per %s)' sprintf=$room_type_info['selling_object_name']}</span></p>
<div class="services-list">
@@ -118,21 +111,22 @@
{/foreach}
</div>
</div>
{/if}
<hr>
<div class="extra-service-panel">
<div class="summary-row">
<div>{l s='Total price per room'}</div>
<div><p class="service_price">{displayPrice price=$service_product_price_per_room}</p></div>
</div>
<div class="summary-row">
<div>{l s='Total price:'}</div>
<div><p class="service_price">{displayPrice price=$service_product_price}</p></div>
<hr>
<div class="extra-service-panel">
<div class="summary-row">
<div>{l s='Total price per room'}</div>
<div><p class="service_price">{displayPrice price=$service_product_price_per_room}</p></div>
</div>
<div class="summary-row">
<div>{l s='Total price:'}</div>
<div><p class="service_price">{displayPrice price=$service_product_price}</p></div>
</div>
</div>
</div>
</div>
</div>
{/if}
{/capture}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.extra_services_tooltip allow_html=true}
{/if}
</div>
</div>
</div>
<hr class="separator-hr-mg-10 form-group">

View File

@@ -70,8 +70,10 @@
<span>{$product['name']|escape:'html':'UTF-8'}</span>
{assign var='priceCalcMethod' value=$product.price_calculation_method|default:0}
{capture name='htl_pcm_tooltip'}
<div class="htl-tooltip-cont">
<p class="htl-tooltip-title">{l s='Applied on:'}</p>
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
@@ -79,7 +81,7 @@
</ul>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true} {if $product.allow_multiple_quantity}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true} {if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="text" class="form-control qty" id="qty_{$product.id_product}" name="room_service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if $serviceSelected}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">
<input type="hidden" class="qty_hidden" id="qty_{$product.id_product}_hidden" value="{if $serviceSelected}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}0{/if}">

View File

@@ -55,8 +55,10 @@
{/if}
{assign var='priceCalcMethod' value=$additionalService.price_calculation_method|default:0}
{capture name='htl_pcm_tooltip'}
<div class="htl-tooltip-cont">
<p class="htl-tooltip-title">{l s='Applied on:'}</p>
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
@@ -64,7 +66,7 @@
</ul>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
</div>
</div>
<div class="">

View File

@@ -125,36 +125,26 @@
{/if}
{if isset($rm_v.additional_services) && $rm_v.additional_services}
{capture name='htl_room_price_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row">
<div>
<p>{l s='%s cost:' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
</p>
</div>
</div>
<div class="htl-tooltip-row">
<div><p>{l s='Service(s) cost:'}</p></div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=$rm_v.additional_services_price_ti currency=$currency}
{else}
{displayWtPriceWithCurrency price=$rm_v.additional_services_price_te currency=$currency}
{/if}
</p>
</div>
</div>
<div class="ui-tooltip-body">
<div class="ui-tooltip-label">{l s='%s cost:' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}</div>
<span class="ui-tooltip-elem-txt">
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
</span>
<div class="ui-tooltip-label">{l s='Service(s) cost:'}</div>
<span class="ui-tooltip-elem-txt">
{if $group_use_tax}
{displayWtPriceWithCurrency price=$rm_v.additional_services_price_ti currency=$currency}
{else}
{displayWtPriceWithCurrency price=$rm_v.additional_services_price_te currency=$currency}
{/if}
</span>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_room_price_tooltip allow_html=true tooltip_class='htl-tooltip-room-price-detail'}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.htl_room_price_tooltip allow_html=true tooltip_class='ui-htl-tooltip-room-price-detail'}
{/if}
</dd>
</div>

View File

@@ -40,8 +40,10 @@
<span class="service-product-name">{$service_product['name']}</span>
{assign var='priceCalcMethod' value=$service_product.price_calculation_method|default:0}
{capture name='htl_pcm_tooltip'}
<div class="htl-tooltip-cont">
<p class="htl-tooltip-title">{l s='Applied on:'}</p>
<div class="ui-tooltip-header">
<div class="ui-tooltip-label">{l s='Applied on:'}</div>
</div>
<div class="ui-tooltip-body">
<ul>
{foreach from=Product::getPriceCalculationMethodDaysLabel($priceCalcMethod) item='pcmDayLabel'}
<li>{$pcmDayLabel}</li>
@@ -49,7 +51,7 @@
</ul>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
</div>
{/block}
{block name='service_product_description'}

View File

@@ -21,10 +21,16 @@
*}
<span class="htl-tooltip{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
<img src="{$img_dir}icon/icon-info.svg" />
<span class="ui-tooltip-trigger{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
{if isset($tooltip_title) && $tooltip_title}
{$tooltip_title nofilter}
{elseif isset($tooltip_icon_class) && $tooltip_icon_class}
<i class="{$tooltip_icon_class|escape:'html':'UTF-8'}"{if isset($tooltip_icon_style) && $tooltip_icon_style} style="{$tooltip_icon_style|escape:'html':'UTF-8'}"{/if}></i>
{else}
<img src="{$img_dir}icon/icon-info.svg" alt="" />
{/if}
</span>
<div class="htl-tooltip-content" style="display: none;">
<div class="ui-tooltip-content" style="display: none;">
{if isset($allow_html) && $allow_html}
{$tooltip_content nofilter}
{else}

View File

@@ -9391,13 +9391,13 @@ div a.our_properties_link{
font-size: 17px;
font-weight: 400;}
.htl-tooltip {
.ui-tooltip-trigger {
cursor: pointer;
display: inline-block;
vertical-align: text-bottom;
}
.ui-tooltip.htl-tooltip-popup {
.ui-tooltip.ui-tooltip-popup {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
@@ -9405,36 +9405,40 @@ div a.our_properties_link{
padding: 9px 15px;
}
.htl-tooltip-cont {
min-width: 160px;
.ui-tooltip-content {
min-width: 140px;
}
.htl-tooltip-cont .htl-tooltip-title {
.ui-tooltip-header {
margin: 0 0 6px;
}
.ui-tooltip-label {
font-weight: 600;
font-size: 13px;
margin: 0;
}
.htl-tooltip-cont ul {
.ui-tooltip-body ul {
margin: 0;
padding-left: 16px;
font-size: 13px;
list-style: disc;
}
.htl-tooltip-cont ul li {
.ui-tooltip-body ul li {
padding: 2px 0;
}
.htl-tooltip-cont .htl-tooltip-row {
display: flex;
justify-content: space-between;
margin: 5px 0;
white-space: nowrap;
.ui-tooltip-body {
display: grid;
grid-template-columns: auto 1fr;
gap: 5px 15px;
}
.htl-tooltip-cont .htl-tooltip-row p,
.htl-tooltip-cont .htl-tooltip-row label {
margin: 0;
.ui-tooltip-elem-txt {
font-size: 13px;
margin: 0;
text-align: right;
white-space: nowrap;
}

View File

@@ -1443,21 +1443,10 @@ Quick View Styles
}
/* service popup design */
.price_desc_block .services-info {
cursor: pointer;
}
.ui-tooltip.services-tootip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
/* min-width: 300px; */
padding: 9px 15px;
max-height: 310px;
overflow-y: auto;
}
.services-info-tooltip-cont {
min-width: 240px;
max-height: 310px;
overflow-y: auto;
}
.extra-service-panel + .extra-service-panel {
margin-top: 15px;

View File

@@ -30,6 +30,7 @@ var onlineFlag = true;
$(document).ready(function(){
highdpiInit();
initUITooltip();
responsiveResize();
$(window).resize(responsiveResize);
if (navigator.userAgent.match(/Android/i))
@@ -458,27 +459,28 @@ window.addEventListener('offline', function () {
onlineFlag = false;
});
function initHtlTooltip() {
if (!$('.htl-tooltip').length) {
function initUITooltip() {
if (!$('.ui-tooltip-trigger').length) {
return;
}
$('.htl-tooltip').each(function () {
$('.ui-tooltip-trigger').each(function () {
if ($(this).hasClass('ui-tooltip-content')) {
return;
}
$(this).tooltip({
content: $(this).siblings('.htl-tooltip-content').html(),
}
if ($(this).data('ui-tooltip')) {
return;
}
$(this).uiTooltip({
content: $(this).siblings('.ui-tooltip-content').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'htl-tooltip-popup',
tooltipClass: 'ui-tooltip-popup',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
$('div.ui-tooltip').not('#' + $id).remove();
},
close: function (event, ui) {
ui.tooltip.hover(function () {
@@ -491,8 +493,4 @@ function initHtlTooltip() {
}
});
});
}
$(document).ready(function () {
initHtlTooltip();
});
}

View File

@@ -51,7 +51,7 @@ $(document).ready(function(){
if (result.extra_services) {
$('#rooms_extra_services').html('');
$('#rooms_extra_services').append(result.extra_services);
initHtlTooltip();
initUITooltip();
}
$.fancybox({
href: "#rooms_extra_services",
@@ -76,6 +76,4 @@ $(document).ready(function(){
},
});
});
initHtlTooltip();
});

View File

@@ -308,7 +308,7 @@ $(document).on('click', '.btn-view-extra-services', function(e) {
if (result.extra_services) {
$('#popup-view-extra-services').html('');
$('#popup-view-extra-services').append(result.extra_services);
initHtlTooltip();
initUITooltip();
$.fancybox.open({
href: '#popup-view-extra-services',
@@ -333,6 +333,4 @@ $(document).ready(function () {
sendOrderMessage();
});
initHtlTooltip();
});

View File

@@ -612,7 +612,7 @@ $(document).ready(function()
if (result.extra_services) {
$('#rooms_extra_services').html('');
$('#rooms_extra_services').append(result.extra_services);
initHtlTooltip();
initUITooltip();
}
$.fancybox({
href: "#rooms_extra_services",

View File

@@ -1156,7 +1156,7 @@ $(document).ready(function() {
triggerElement.hide();
}
}
initHtlTooltip();
initUITooltip();
} else {
triggerElement.hide();
}
@@ -1346,47 +1346,8 @@ var BookingForm = {
if (parseInt($('#product_page_booking_product').val())) {
BookingForm.initDatepicker(max_order_date, min_booking_offset, $('#room_check_in').val(), $('#room_check_out').val());
}
// initialize tootltip for extra service
if ($('.price_desc_block .services-info').length) {
$('.price_desc_block .services-info img').tooltip({
content: $('.price_desc_block .services-info-container').html(),
items: "div",
trigger : 'hover',
position: { my: "left-15 top", at: "left bottom" },
tooltipClass: "services-tootip",
open: function(event, ui)
{
if (typeof(event.originalEvent) === 'undefined')
{
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
// ajax function to pull in data and add it to the tooltip goes here
},
close: function(event, ui)
{
ui.tooltip.hover(function()
{
$(this).stop(true).fadeTo(400, 1);
},
function()
{
$(this).fadeOut('400', function()
{
$(this).remove();
});
});
}
});
}
// initialize tooltip for extra service
initUITooltip();
if (!$('.max_avail_type_qty').length || $('.max_avail_type_qty').val() < 1) {
disableRoomTypeServices(1);
} else {

View File

@@ -160,36 +160,26 @@
{/if}
{if isset($rm_v['additional_services']) && $rm_v['additional_services']}
{capture name='htl_order_price_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row">
<div>
<p>{l s='%s cost' sprintf=$data_v['selling_object_plural_name']} : </p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
{/if}
</p>
</div>
</div>
<div class="htl-tooltip-row">
<div><p>{l s='Service cost'} : </p></div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['additional_services_price_te']) currency=$objOrderCurrency}
{/if}
</p>
</div>
</div>
<div class="ui-tooltip-body">
<div class="ui-tooltip-label">{l s='%s cost' sprintf=$data_v['selling_object_plural_name']} : </div>
<span class="ui-tooltip-elem-txt">
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
{/if}
</span>
<div class="ui-tooltip-label">{l s='Service cost'} : </div>
<span class="ui-tooltip-elem-txt">
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['additional_services_price_te']) currency=$objOrderCurrency}
{/if}
</span>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_order_price_tooltip allow_html=true}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.htl_order_price_tooltip allow_html=true}
{/if}
</dd>
</div>

View File

@@ -1030,7 +1030,7 @@
</label>
<span>({$hotel_booking_detail.adults|string_format:'%02d'} {if $hotel_booking_detail.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $hotel_booking_detail.children > 0}{l s=', '}{$hotel_booking_detail.children|string_format:'%02d'} {if $hotel_booking_detail.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
{if $hotel_booking_detail.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $hotel_booking_detail.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if $hotel_booking_detail.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> {include file='_partials/htl-tooltip.tpl' tooltip_content={l s='Refund for this booking is denied. Please contact admin for more detail.'}}{else if $hotel_booking_detail.id_status != $ROOM_STATUS_ASSIGNED}<span class="badge badge-danger badge-cancelled">{if $hotel_booking_detail.id_status == $ROOM_STATUS_CHECKED_OUT}{l s='Checked-Out'}{else}{l s='Checked-In'}{/if}</span>{/if}
{if $hotel_booking_detail.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $hotel_booking_detail.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if $hotel_booking_detail.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> {include file='_partials/ui-tooltip.tpl' tooltip_content={l s='Refund for this booking is denied. Please contact admin for more detail.'}}{else if $hotel_booking_detail.id_status != $ROOM_STATUS_ASSIGNED}<span class="badge badge-danger badge-cancelled">{if $hotel_booking_detail.id_status == $ROOM_STATUS_CHECKED_OUT}{l s='Checked-Out'}{else}{l s='Checked-In'}{/if}</span>{/if}
</div>
</div>
@@ -1074,7 +1074,7 @@
<input type="checkbox" class="bookings_to_refund" id="products_to_refund_{$product_option.id_service_product_order_detail}" name="id_service_product_order_detail[]" value="{$product_option.id_service_product_order_detail|escape:'html':'UTF-8'}" {if $is_product_cancelled }disabled{/if}/>
{$product_option.name}{if isset($product_option.option_name) && $product_option.option_name} : {$product_option.option_name}{/if}
</label>
{if $product_option.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $product_option.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if isset($product_option.refund_denied) && $product_option.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> {include file='_partials/htl-tooltip.tpl' tooltip_content={l s='Refund for this product is denied. Please contact admin for more detail.'}}</span>{/if}
{if $product_option.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $product_option.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if isset($product_option.refund_denied) && $product_option.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> {include file='_partials/ui-tooltip.tpl' tooltip_content={l s='Refund for this product is denied. Please contact admin for more detail.'}}</span>{/if}
</div>
{if $product_option.allow_multiple_quantity}
<div class="quantity-wrap clearfix">

View File

@@ -137,12 +137,12 @@
{displayPrice price=($rm_v['amount'])}
{if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && (in_array($data_v['id_product'], $discounted_products) || $PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN)}
{capture name='htl_room_price_detail_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row"><label>{l s='Room price'}</label><span>{displayPrice price=($rm_v['amount_without_auto_add'])}</span></div>
<div class="htl-tooltip-row"><label>{l s='Additional charges'}</label><span>{displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])}</span></div>
<div class="ui-tooltip-body">
<div class="ui-tooltip-label">{l s='Room price'}</div><span class="ui-tooltip-elem-txt">{displayPrice price=($rm_v['amount_without_auto_add'])}</span>
<div class="ui-tooltip-label">{l s='Additional charges'}</div><span class="ui-tooltip-elem-txt">{displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])}</span>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_room_price_detail_tooltip allow_html=true tooltip_class='htl-tooltip-room-price-detail'}
{include file='_partials/ui-tooltip.tpl' tooltip_content=$smarty.capture.htl_room_price_detail_tooltip allow_html=true tooltip_class='ui-htl-tooltip-room-price-detail'}
{/if}
</div>
<p class="total_price_detial">