diff --git a/admin/themes/default/img/icon-info.svg b/admin/themes/default/img/icon-info.svg new file mode 100644 index 000000000..5d4d44d02 --- /dev/null +++ b/admin/themes/default/img/icon-info.svg @@ -0,0 +1,4 @@ + + + + diff --git a/admin/themes/default/js/admin-theme.js b/admin/themes/default/js/admin-theme.js index 1aa61350d..04acc90b5 100644 --- a/admin/themes/default/js/admin-theme.js +++ b/admin/themes/default/js/admin-theme.js @@ -478,4 +478,42 @@ $(document).ready(function() { $('.no-htl-access-option').on('click', function() { $(this).prop('selected', false); }); + initTooltip(); }); //end dom ready + +function initTooltip($target, contentFn, items) { + var $elements = $target || $('.tooltip-trigger'); + if (!$elements.length) { + return; + } + $elements.each(function () { + var $this = $(this); + if (!contentFn && $this.data('ui-tooltip')) { + return; + } + $this.tooltip({ + content: contentFn || $this.next('.tooltip-content').html(), + items: items || 'span', + trigger: 'hover', + tooltipClass: 'tooltip-popup', + 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'); + if ($('div.ui-tooltip').not('#' + $id).length) { + return false; + } + }, + close: function (event, ui) { + ui.tooltip.hover( + function () { $(this).stop(true).fadeTo(300, 1); }, + function () { $(this).fadeOut(300, function () { $(this).remove(); }); } + ); + } + }); + }); +} \ No newline at end of file diff --git a/admin/themes/default/js/modernizr-loads.js b/admin/themes/default/js/modernizr-loads.js index aa738e542..f4142963e 100644 --- a/admin/themes/default/js/modernizr-loads.js +++ b/admin/themes/default/js/modernizr-loads.js @@ -3,6 +3,10 @@ Modernizr.load([ test: window.matchMedia, nope: ["themes/default/js/vendor/matchMedia.js", "themes/default/js/vendor/matchMedia.addListener.js"] }, - "themes/default/js/vendor/enquire.min.js", - "themes/default/js/admin-theme.js", + { + load: ["themes/default/js/vendor/enquire.min.js", "themes/default/js/admin-theme.js"], + complete: function() { + $(document).trigger('admin-theme.js.ready'); + } + } ]); \ No newline at end of file diff --git a/admin/themes/default/sass/partials/_tooltip.sass b/admin/themes/default/sass/partials/_tooltip.sass index 986d49667..d1f445386 100644 --- a/admin/themes/default/sass/partials/_tooltip.sass +++ b/admin/themes/default/sass/partials/_tooltip.sass @@ -1,5 +1,4 @@ .tooltip_cont - min-width: 280px width: 100% font-size: 14px font-weight: 600 @@ -7,6 +6,7 @@ margin-bottom: 10px .tip-body > div margin-bottom: 6px + margin-right: 10px .tip_element_head font-size: 12px @@ -28,3 +28,30 @@ border: none padding: 10px box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.15) + width: auto + +.tooltip-trigger + cursor: pointer + display: inline-block + vertical-align: middle + + + +.ui-tooltip.tooltip-popup + ul + margin: 0 + padding: 0 0 0 16px + list-style: disc + li + padding: 2px 0 + +.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 diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 5bfb1dbf1..5e3d15f6e 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -1404,6 +1404,7 @@ { $("#customer_cart_details").empty(); $("#customer_cart_details").append(res.cart_detail_html); + initTooltip(); displaySummary(res); } diff --git a/admin/themes/default/template/controllers/products/connected-rooms.tpl b/admin/themes/default/template/controllers/products/connected-rooms.tpl index 6017e4269..5fe24f98c 100644 --- a/admin/themes/default/template/controllers/products/connected-rooms.tpl +++ b/admin/themes/default/template/controllers/products/connected-rooms.tpl @@ -20,63 +20,22 @@ * @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} - - - + {capture name='connected_room_tooltip'} +
+
{l s='Connected Rooms'}
+
+ {foreach from=$htl_connected_rooms.connected_room_types item=group} +
+
{$group.room_type_name|escape:'html':'UTF-8'}
+
+ {foreach from=$group.connected_rooms item=room name=connected_rooms} + {$room.name|escape:'html':'UTF-8'}{if !$smarty.foreach.connected_rooms.last}, {/if} + {/foreach} +
+
+ {/foreach} +
+
+ {/capture} + {include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.connected_room_tooltip tooltip_icon_class='icon-random' tooltip_icon_style='color: #008abd;' } {/if} - diff --git a/admin/themes/default/template/helpers/tooltip.tpl b/admin/themes/default/template/helpers/tooltip.tpl new file mode 100644 index 000000000..dde9e5866 --- /dev/null +++ b/admin/themes/default/template/helpers/tooltip.tpl @@ -0,0 +1,38 @@ +{* +* 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($tooltip_title) && $tooltip_title} + {$tooltip_title nofilter} + {elseif isset($tooltip_icon_class) && $tooltip_icon_class} + + {else} + + {/if} + + diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php index 8edfba919..81fba0d1a 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php @@ -350,7 +350,6 @@ class AdminOrderRefundRequestsController extends ModuleAdminController 'isRefundCompleted' => $objOrderReturn->hasBeenCompleted(), 'paymentMethods' => $paymentMethods, 'name_controller' => Tools::getValue('controller'), - 'info_icon_path' => $this->context->link->getMediaLink(_MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icon-info.svg'), 'expiry_date' => time() + (3600 * 24 * 365.25) ) ); diff --git a/modules/hotelreservationsystem/views/css/admin/wk_refund_request.css b/modules/hotelreservationsystem/views/css/admin/wk_refund_request.css index e3cd83c23..69fc03b56 100644 --- a/modules/hotelreservationsystem/views/css/admin/wk_refund_request.css +++ b/modules/hotelreservationsystem/views/css/admin/wk_refund_request.css @@ -24,9 +24,9 @@ body.adminorderrefundrequests .ui-tooltip { padding: 10px; box-shadow: 0px 0px 15px 0px #00000026; } -.ui-tooltip.price_info-tooltip span { +.ui-tooltip.tooltip-popup span { margin-left: 15px; } -.ui-tooltip.price_info-tooltip label { +.ui-tooltip.tooltip-popup label { font-weight: 600; } \ No newline at end of file diff --git a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js index e52d8e4c5..8d37728d8 100644 --- a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js +++ b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js @@ -23,8 +23,9 @@ $(document).ready(function() { // calender - if ($('#fullcalendar').length) { - var calendar = new FullCalendar.Calendar($('#fullcalendar').get(0), { + var calendar; + function initBookingCalendar() { + calendar = new FullCalendar.Calendar($('#fullcalendar').get(0), { initialView: 'dayGridMonth', initialDate: initialDate, events: { @@ -53,32 +54,23 @@ $(document).ready(function() { if (info.event.extendedProps.is_notification) { var $cell = $(info.el).closest('td'); $cell.css('background-color', info.event.backgroundColor); - $cell.tooltip({ - content: function() - { - $('#date-stats-tooltop .tip_date').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(''); - } else { - $('#date-stats-tooltop').find('.'+elem).show().find('.tip_element_value').text(val); - } - }); - return $('#date-stats-tooltop').html(); - }, - items: "td", - trigger : 'hover', + initTooltip($cell, function() { + $('#date-stats-tooltop .tip_date').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(''); + } else { + $('#date-stats-tooltop').find('.'+elem).show().find('.tip_element_value').text(val); + } + }); + return $('#date-stats-tooltop').html(); + }, 'td'); + $cell.tooltip('option', { position: { my: "left top", at: "left+50% bottom-50%", collision: "flipfit" }, - show: { - delay: 100, - }, - hide: { - delay: 300, - }, open: function(event, ui) { if(event.buttons == 1 || event.buttons == 3){ @@ -102,27 +94,11 @@ $(document).ready(function() { 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(); - }); - }); - } - }); - } else { - $(info.el).addClass('search-result-event'); - $(info.el).tooltip({ - content: 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); $.each(info.event.extendedProps.data.stats, function(elem, val) { if (elem == 'num_part_avai') { @@ -136,48 +112,8 @@ $(document).ready(function() { } }); return $('#date-stats-tooltop').html(); - }, - items: "div", - trigger : 'hover', - track: true, - 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(); - }); - }); - } - }); + }, 'div'); + $(info.el).tooltip('option', 'track', true); info.el.style.borderLeftColor = info.event.extendedProps.data.eventColor; resizeSearchResultEventBar($(info.el)); } @@ -201,6 +137,14 @@ $(document).ready(function() { }); } + if ($('#fullcalendar').length) { + if (typeof initTooltip === 'function') { + initBookingCalendar(); + } else { + $(document).on('admin-theme.js.ready', initBookingCalendar); + } + } + function resizeSearchResultEventBar($bar) { requestAnimationFrame(function() { var $td = $bar.closest('td'); @@ -548,6 +492,7 @@ $(document).ready(function() { } else { showSuccessMessage(removed_room_success_txt); $("#htl_rooms_list").empty().append(result.data.room_tpl); + initTooltip(); refreshCartData(); refreshStatsData(); calendar.refetchEvents(); @@ -1077,4 +1022,4 @@ $(document).ready(function() { return [true, ""]; } } -}); +}); \ No newline at end of file diff --git a/modules/hotelreservationsystem/views/js/admin/wk_refund_request.js b/modules/hotelreservationsystem/views/js/admin/wk_refund_request.js index 7bf27b61f..a74ad4bf1 100644 --- a/modules/hotelreservationsystem/views/js/admin/wk_refund_request.js +++ b/modules/hotelreservationsystem/views/js/admin/wk_refund_request.js @@ -41,45 +41,6 @@ $(document).ready(function() { $('#voucher_expiry').parent().removeClass('has-error'); }); - // initialize tootip for room price - if ($('#rooms_refund_info .price_info').length) { - $('#rooms_refund_info .price_info').each(function (i, element) { - $(this).find('img').tooltip({ - content: $(this).closest('td').find('.price_info_container').html(), - items: "span", - 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('change', '#refundTransactionAmount', function() { if ($(this).is(':checked')) { $(".refund_transaction_fields").show(200); diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl index d8cadf9e9..79ea77d21 100644 --- a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl @@ -171,10 +171,7 @@ {dateFormat date=$booking['date_from'] full=$is_full_date} {l s='To' mod='hotelreservationsystem'} {dateFormat date=$booking['date_to'] full=$is_full_date} {displayPrice price=($booking['total_price_tax_incl'] + $booking['extra_service_total_price_tax_incl']) currency=$orderCurrency['id']} - -   - - + {/capture} + {include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.refund_total_tooltip} {displayPrice price=($booking['room_paid_amount'] + $booking['extra_service_total_paid_amount']) currency=$orderCurrency['id']} - -   - - + {/capture} + {include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.refund_paid_tooltip } {if !$isRefundCompleted}