diff --git a/admin/ajax_products_list.php b/admin/ajax_products_list.php index 03a5f4999..98f9647cb 100644 --- a/admin/ajax_products_list.php +++ b/admin/ajax_products_list.php @@ -58,6 +58,8 @@ if ($excludeIds && $excludeIds != 'NaN') { $excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', true); $exclude_packs = (bool)Tools::getValue('exclude_packs', true); +$bookingProduct = (int) Tools::getValue('booking_product'); + $context = Context::getContext(); $sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute` @@ -72,6 +74,7 @@ $sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, imag (!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' '). ($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : ''). ($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : ''). + ($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : ''). ' GROUP BY p.id_product'; $items = Db::getInstance()->executeS($sql); diff --git a/admin/themes/default/sass/controllers/_order.sass b/admin/themes/default/sass/controllers/_order.sass index c5ccaa579..fab2d5f1c 100644 --- a/admin/themes/default/sass/controllers/_order.sass +++ b/admin/themes/default/sass/controllers/_order.sass @@ -4,10 +4,20 @@ #customization_list border: 0px +.booking_occupancy_edit, .booking_occupancy + .occupancy-info-separator + margin-top: 0px + margin-bottom: 10px + .close_occupancy + text-decoration: underline + .booking_occupancy .booking_occupancy_wrapper max-height: 250px overflow-x: auto + label.room_num_wrapper + text-decoration: underline + margin-bottom: 10px #booking-documents-modal .documents-list @@ -16,3 +26,5 @@ img max-height: 55px max-width: 55px + + diff --git a/admin/themes/default/sass/partials/_chosen.sass b/admin/themes/default/sass/partials/_chosen.sass index 9f5f1f7e7..25ff66ef3 100644 --- a/admin/themes/default/sass/partials/_chosen.sass +++ b/admin/themes/default/sass/partials/_chosen.sass @@ -200,6 +200,8 @@ $chosen-sprite-path: '../img/chosen-sprite.png' input position: absolute @include left(-9000px) + &:before + visibility: hidden .chosen-container-multi .chosen-choices diff --git a/admin/themes/default/sass/partials/_icons.sass b/admin/themes/default/sass/partials/_icons.sass index 6788aad63..d6fdf4f09 100644 --- a/admin/themes/default/sass/partials/_icons.sass +++ b/admin/themes/default/sass/partials/_icons.sass @@ -311,7 +311,7 @@ @extend .icon-cogs .icon-AdminAdmin @extend .icon-cog -.icon-AdminParentStats +.icon-AdminStats @extend .icon-bar-chart .icon-AdminStock @extend .icon-archive diff --git a/admin/themes/default/template/controllers/information/helpers/view/view.tpl b/admin/themes/default/template/controllers/information/helpers/view/view.tpl index d142e68a6..463806b60 100644 --- a/admin/themes/default/template/controllers/information/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/information/helpers/view/view.tpl @@ -84,7 +84,7 @@ {l s='Server information'} - {if count($uname)} + {if Tools::strlen($uname) > 0}

{l s='Server information:'} {$uname|escape:'html':'UTF-8'}

diff --git a/admin/themes/default/template/controllers/modules/content.tpl b/admin/themes/default/template/controllers/modules/content.tpl index ec7610a96..bfc706ef7 100644 --- a/admin/themes/default/template/controllers/modules/content.tpl +++ b/admin/themes/default/template/controllers/modules/content.tpl @@ -36,7 +36,7 @@
- PrestaShop Addons + QloApps Addons
diff --git a/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl b/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl index 8396a808b..f6cfd6740 100644 --- a/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl +++ b/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl @@ -67,20 +67,22 @@
{l s='Recommended Modules and Services'}
- {if $add_permission eq '1' && ($context_mode != Context::MODE_HOST)} -
  • - - -
    {l s='Add a new module'}
    -
    -
  • - {else} -
  • - - -
    {l s='Add a new module'}
    -
    -
  • + {if $add_permission eq '1'} + {if $context_mode != Context::MODE_HOST} +
  • + + +
    {l s='Add a new module'}
    +
    +
  • + {else} +
  • + + +
    {l s='Add a new module'}
    +
    +
  • + {/if} {/if} {if isset($help_link)} {*
  • diff --git a/admin/themes/default/template/controllers/normal_products/prices.tpl b/admin/themes/default/template/controllers/normal_products/prices.tpl index 9b91f7206..231a821a5 100644 --- a/admin/themes/default/template/controllers/normal_products/prices.tpl +++ b/admin/themes/default/template/controllers/normal_products/prices.tpl @@ -395,7 +395,7 @@ $(document).ready(function () {
    {if !$multi_shop} - + {else}
    -
    - +
    +
  • diff --git a/admin/themes/default/template/controllers/orders/_print_pdf_icon.tpl b/admin/themes/default/template/controllers/orders/_print_pdf_icon.tpl index 12c515d78..55ad2a64b 100644 --- a/admin/themes/default/template/controllers/orders/_print_pdf_icon.tpl +++ b/admin/themes/default/template/controllers/orders/_print_pdf_icon.tpl @@ -32,10 +32,10 @@ {/if} {* Generate HTML code for printing Delivery Icon with link *} - {if $order->delivery_number} + {* {if $order->delivery_number} - {/if} + {/if} *} diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index e68b185df..a67ac7f42 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -79,7 +79,7 @@ {/if} - {if $order->with_occupancy && $data['children']} + {if $data['children']} - - {else} - - {/if} + + @@ -182,7 +178,7 @@ {convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id} - {if ($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) > 0} + {if $data['extra_demands']|count || $data['additional_services']|count} diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 3cb512ab4..0fd70c10f 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -98,6 +98,7 @@ selectFirst: false, scroll: false, dataType: "json", + cacheLength: 0, formatItem: function(data, i, max, value, term) { return value; }, @@ -115,7 +116,8 @@ ajax: "1", token: "{getAdminToken tab='AdminCartRules'}", tab: "AdminCartRules", - action: "searchCartRuleVouchers" + action: "searchCartRuleVouchers", + id_customer: function () { return window.id_customer }, } } ) @@ -808,7 +810,9 @@ ajax: "1", tab: "AdminCustomers", action: "searchCustomers", - customer_search: $('#customer').val()}, + customer_search: $('#customer').val(), + skip_deleted: "1", + }, success : function(res) { if(res.found) diff --git a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl index 240e46188..6776306f3 100644 --- a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl +++ b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl @@ -24,7 +24,7 @@ *}
    - + diff --git a/admin/themes/default/template/controllers/products/informations.tpl b/admin/themes/default/template/controllers/products/informations.tpl index 89ff4ac8c..d66b7e120 100644 --- a/admin/themes/default/template/controllers/products/informations.tpl +++ b/admin/themes/default/template/controllers/products/informations.tpl @@ -137,7 +137,7 @@ {l s='Select Hotel'}
    - {foreach from=$htl_info item=htl_dtl} {/foreach} diff --git a/admin/themes/default/template/controllers/products/prices.tpl b/admin/themes/default/template/controllers/products/prices.tpl index 5713c330d..b9d0b26d2 100644 --- a/admin/themes/default/template/controllers/products/prices.tpl +++ b/admin/themes/default/template/controllers/products/prices.tpl @@ -494,7 +494,7 @@ $(document).ready(function () {
    {if !$multi_shop} - + {else}
    '; - childAgeSelect += ''; - childAgeSelect += ''; - for (let age = 1; age < max_child_age; age++) { - childAgeSelect += ''; - } - childAgeSelect += ''; - childAgeSelect += '

    '; - $(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect); - } - } + var childAgeSelect = '

    '; + childAgeSelect += ''; + childAgeSelect += '

    '; + $(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect); + } } else { let child = $(this).val(); $(this).closest('.occupancy_info_block').find('.guest_child_age').each(function(ind, element) { @@ -622,8 +593,8 @@ function initProductEvents() } } - setRoomTypeGuestOccupancy($(this).closest('.booking_occupancy_wrapper')); + setRoomTypeGuestOccupancy($(this).closest('.booking_occupancy_wrapper')); }); @@ -635,7 +606,7 @@ function initProductEvents() if ($('.booking_occupancy_wrapper:visible').length) { var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); $(occupancy_wrapper).find(".occupancy_info_block").addClass('selected'); - if (!($(e.target).closest(".booking_occupancy_wrapper").length || $(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".ajax_add_to_cart_button").length || $(e.target).closest(".exclusive.book_now_submit").length || $(e.target).closest(".remove-room-link").length)) { + if (!($(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".ajax_add_to_cart_button").length || $(e.target).closest(".exclusive.book_now_submit").length || $(e.target).closest(".remove-room-link").length)) { let hasErrors = 0; let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get(); @@ -647,54 +618,59 @@ function initProductEvents() hasErrors = 1; showErrorMessage(invalid_occupancy_txt); } else { - $(occupancy_wrapper).find('.occupancy_count').removeClass('error_border'); + $(occupancy_wrapper).find('.num_occupancy').removeClass('alert-danger'); // validate values of adults and children adults.forEach(function (item, index) { - if (isNaN(item) || parseInt(item) < 1) { + if (item == '' || isNaN(item) || parseInt(item) < 1) { hasErrors = 1; - $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.num_adults').addClass('alert-danger'); } - if (isNaN(children[index])) { + + if (children[index] == '' || isNaN(children[index])) { hasErrors = 1; - $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.num_children').addClass('alert-danger'); } }); // validate values of selected child ages - $(occupancy_wrapper).find('.guest_child_age').parent().removeClass('has-error'); + $(occupancy_wrapper).find('.guest_child_age').removeClass('alert-danger'); child_ages.forEach(function (age, index) { age = parseInt(age); if (isNaN(age) || (age < 0) || (age >= parseInt(max_child_age))) { hasErrors = 1; - $(occupancy_wrapper).find(".guest_child_age").eq(index).parent().addClass('has-error'); + $(occupancy_wrapper).find(".guest_child_age").eq(index).addClass('alert-danger'); } }); } if (hasErrors == 0) { - $(occupancy_wrapper).parent().removeClass('open'); - $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); + // Close the occupancy block only if click element is not occupancy block OR close link of the occupancy block + if (!($(e.target).closest(".booking_occupancy_wrapper").length) || $(e.target).hasClass("close_occupancy_link")) { + $(occupancy_wrapper).parent().removeClass('open'); + $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); + } } } } }); + // Close occupancy link default redirect action prevent + $(document).on('click', '.close_occupancy_link', function(e) { + e.preventDefault(); + }); + $('.booking_occupancy_wrapper .add_new_occupancy_btn').on('click', function(e) { e.preventDefault(); var booking_occupancy_wrapper = $(this).closest('.booking_occupancy_wrapper'); - var occupancy_block = ''; var roomBlockIndex = parseInt($(booking_occupancy_wrapper).find(".occupancy_info_block").last().attr('occ_block_index')); roomBlockIndex += 1; - let max_child_in_room; - if ($(this).closest(".booking_occupancy_wrapper").find('.max_children').val()) { - max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val(); - } else { - max_child_in_room = window.max_child_in_room; - } var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length); countRooms += 1 + + var occupancy_block = ''; occupancy_block += '
    '; + occupancy_block += '
    '; occupancy_block += '
    ' + remove_txt + '
    '; occupancy_block += '
    '; occupancy_block += '
    '; @@ -704,7 +680,7 @@ function initProductEvents() occupancy_block += '
    '; occupancy_block += '
    '; occupancy_block += ''; - occupancy_block += '(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')'; + occupancy_block += '(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')'; occupancy_block += '
    '; occupancy_block += '
    '; occupancy_block += ''; occupancy_block += '
    '; occupancy_block += '
    '; - occupancy_block += '
    '; occupancy_block += '
    '; $(booking_occupancy_wrapper).find('.booking_occupancy_inner').append(occupancy_block); @@ -1139,13 +1114,6 @@ function initRoomEvents() $('tr#new_product .booking_guest_occupancy').removeClass('disabled'); setRoomTypeGuestOccupancy($('tr#new_product .booking_occupancy_wrapper')); } - if (data.room_type_info) { - $('tr#new_product .max_adults').val(data.room_type_info.max_adults); - $('tr#new_product .max_children').val(data.room_type_info.max_children); - $('tr#new_product .max_guests').val(data.room_type_info.max_guests); - $('tr#new_product .num_adults').attr('max', data.room_type_info.max_adults); - $('tr#new_product .num_children').attr('max', data.room_type_info.max_children); - } // Keep product variable current_product = data; @@ -1358,7 +1326,6 @@ function initRoomEvents() $('th.edit_product_fields').attr('colspan', 2); element_list.find('td.product_action').attr('colspan', 1); element.parent().children('.edit_room_change_link').parent().hide(); - console.log(element.parent().parent()); element.parent().parent().find('button.submitRoomChange').show(); element.parent().parent().find('.cancel_room_change_link').show(); @@ -1594,37 +1561,41 @@ function initRoomEvents() } function setRoomTypeGuestOccupancy(booking_occupancy_wrapper) - { - var adults = 0; - var children = 0; - var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length; +{ + var adults = 0; + var children = 0; + var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length; - $(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) { - adults += parseInt($(this).val()); - }); - $(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) { - children += parseInt($(this).val()); - }); + $(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) { + if ($(this).val() != '' && !isNaN($(this).val()) && parseInt($(this).val()) >= 1) { + adults += parseInt($(this).val()); + } + }); + $(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) { + if ($(this).val() != '' && !isNaN($(this).val()) && parseInt($(this).val()) >= 0) { + children += parseInt($(this).val()); + } + }); - var guestButtonVal = parseInt(adults) + ' '; - if (parseInt(adults) > 1) { - guestButtonVal += adults_txt; - } else { - guestButtonVal += adult_txt; - } - if (parseInt(children) > 0) { - if (parseInt(children) > 1) { - guestButtonVal += ', ' + parseInt(children) + ' ' + children_txt; - } else { - guestButtonVal += ', ' + parseInt(children) + ' ' + child_txt; - } - } - if (parseInt(rooms) > 1) { - guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt; - } + var guestButtonVal = parseInt(adults) + ' '; + if (parseInt(adults) > 1) { + guestButtonVal += adults_txt; + } else { + guestButtonVal += adult_txt; + } + if (parseInt(children) > 0) { + if (parseInt(children) > 1) { + guestButtonVal += ', ' + parseInt(children) + ' ' + children_txt; + } else { + guestButtonVal += ', ' + parseInt(children) + ' ' + child_txt; + } + } + if (parseInt(rooms) > 1) { + guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt; + } - $(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal); - } + $(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal); +} /* Refund system script */ var flagRefund = ''; diff --git a/js/maintenance.js b/js/maintenance.js index 26015d1a9..a2685698b 100644 --- a/js/maintenance.js +++ b/js/maintenance.js @@ -18,4 +18,18 @@ $(document).ready(function(){ $("input[type='radio'][name='PS_SHOP_ENABLE']").change(function() { $("#conf_id_PS_ALLOW_EMP").toggle('slow'); }); -}); \ No newline at end of file + + // manage dropdowns + $(document).on('click', function (e) { + const closestDropdown = $(e.target).closest('.dropdown'); + + if (closestDropdown.length) { + if ($(e.target).closest('.dropdown-toggle').length) { + $('.dropdown').not(closestDropdown).removeClass('open'); + closestDropdown.toggleClass('open'); + } + } else { + $('.dropdown').removeClass('open'); + } + }); +}); diff --git a/mails/en/account.html b/mails/en/account.html index 95200ecf8..574320227 100644 --- a/mails/en/account.html +++ b/mails/en/account.html @@ -90,7 +90,6 @@ Here are your login details:
    E-mail address: {email}
    - Password: {passwd}
    diff --git a/mails/en/account.txt b/mails/en/account.txt index 012b219cd..4d081f381 100644 --- a/mails/en/account.txt +++ b/mails/en/account.txt @@ -9,8 +9,6 @@ Here are your login details: E-MAIL ADDRESS: {email} -PASSWORD: {passwd} - Important Security Tips: * Always keep your account details safe. diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index 01bb0f3a4..c2b6f45d5 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -404,7 +404,7 @@ var ajaxCart = { if (jsonData.avail_rooms == 0) { disableRoomTypeDemands(1); } - BookingForm.refresh(); + BookingForm.refresh(true); } if (pagename == 'category') { @@ -422,6 +422,13 @@ var ajaxCart = { $(callerElement).closest(".room_cont").hide(); } //$('#quantity_wanted_'+idProduct).val(1); + + let addRoomButton = $(callerElement).closest('.room_info_cont').find('.booking_guest_occupancy_conatiner .dropdown-menu .add_occupancy_block .add_new_occupancy_btn'); + if (jsonData.avail_rooms > 1) { + $(addRoomButton).removeClass('disabled'); + } else { + $(addRoomButton).addClass('disabled'); + } } @@ -664,6 +671,13 @@ var ajaxCart = { $('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').hide(); } }); + + let addRoomButton = $('.room_cont[data-id-product="'+idProduct+'"]').find('.room_info_cont').find('.booking_guest_occupancy_conatiner .dropdown-menu .add_occupancy_block .add_new_occupancy_btn'); + if (jsonData.avail_rooms > 1) { + $(addRoomButton).removeClass('disabled'); + } else { + $(addRoomButton).addClass('disabled'); + } } if (pagename == 'orderopc') { location.reload(); diff --git a/modules/dashguestcycle/views/css/dashguestcycle.css b/modules/dashguestcycle/views/css/dashguestcycle.css index b31121c47..de2301a8c 100644 --- a/modules/dashguestcycle/views/css/dashguestcycle.css +++ b/modules/dashguestcycle/views/css/dashguestcycle.css @@ -17,26 +17,6 @@ * @license LICENSE.txt */ -/* scrollbar design - start */ -#dashguestcycle.dashboard-top ::-webkit-scrollbar { - height: 12px; - margin-bottom: 5px; -} - -#dashguestcycle.dashboard-top ::-webkit-scrollbar-track { - background-color: #DDD; - margin: 0 6px; - border-radius: 10px; -} - -#dashguestcycle.dashboard-top ::-webkit-scrollbar-thumb { - background-color: #BBB; - border-radius: 10px; - margin-bottom: 5px; - -} -/* scrollbar design - end */ - #dashguestcycle { padding-bottom: 5px; } diff --git a/modules/graphnvd3/graphnvd3.php b/modules/graphnvd3/graphnvd3.php index 55dd2c031..7dcc9c4be 100644 --- a/modules/graphnvd3/graphnvd3.php +++ b/modules/graphnvd3/graphnvd3.php @@ -35,6 +35,7 @@ class GraphNvD3 extends ModuleGraphEngine private $_values; private $_legend; private $_titles; + private $_formats; public function __construct($type = null) { @@ -113,6 +114,10 @@ class GraphNvD3 extends ModuleGraphEngine if (jsonData.axisLabels.yAxis != null) chart.yAxis.axisLabel(jsonData.axisLabels.yAxis); + if (jsonData.axisFormat.xAxis) + chart.xAxis.tickFormat(d3.format(jsonData.axisFormat.xAxis)); + if (jsonData.axisFormat.yAxis) + chart.yAxis.tickFormat(d3.format(jsonData.axisFormat.yAxis)); d3.select("#nvd3_chart_'.($divid++).' svg") .datum(jsonData.data) .transition().duration(500) @@ -148,10 +153,16 @@ class GraphNvD3 extends ModuleGraphEngine $this->_titles = $titles; } + public function setFormat($_formats) + { + $this->_formats = $_formats; + } + public function draw() { $array = array( 'axisLabels' => array('xAxis' => $this->_titles['x'], 'yAxis' => $this->_titles['y']), + 'axisFormat' => array('xAxis' => $this->_formats['x'], 'yAxis' => $this->_formats['y']), 'data' => array() ); diff --git a/modules/hotelreservationsystem/classes/HotelBookingDemands.php b/modules/hotelreservationsystem/classes/HotelBookingDemands.php index b243dfc73..8b98d69f4 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDemands.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDemands.php @@ -175,10 +175,9 @@ class HotelBookingDemands extends ObjectModel return new TaxCalculator($taxes, $computationMethod); } - public function setBookingDemandTaxDetails() + public function setBookingDemandTaxDetails($replace = 0) { - $idBookingDemand = $this->id; - if ($idBookingDemand && Validate::isLoadedObject($objBkDemand = new HotelBookingDemands($idBookingDemand))) { + if ($this->id) { if ($taxCalculator = $this->tax_calculator) { if (!($taxCalculator instanceof TaxCalculator)) { return false; @@ -187,12 +186,11 @@ class HotelBookingDemands extends ObjectModel return true; } $values = ''; - $objGlobalDemand = new HotelRoomTypeGlobalDemand($this->id_global_demand); - $priceTaxExcl = $objBkDemand->unit_price_tax_excl; + $priceTaxExcl = $this->unit_price_tax_excl; foreach ($taxCalculator->getTaxesAmount($priceTaxExcl) as $idTax => $amount) { $quantity = 1; - if ($objGlobalDemand->price_calc_method == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY) { - $objBkDetail = new HotelBookingDetail($objBkDemand->id_htl_booking); + if ($this->price_calc_method == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY) { + $objBkDetail = new HotelBookingDetail($this->id_htl_booking); $quantity = $objBkDetail->getNumberOfDays($objBkDetail->date_from, $objBkDetail->date_to); } switch (Configuration::get('PS_ROUND_TYPE')) { @@ -212,9 +210,15 @@ class HotelBookingDemands extends ObjectModel $totalAmount = $unitAmount * $quantity; break; } - $values .= '('.(int)$idBookingDemand.','.(int)$idTax.','.(float)$unitAmount.','. + $values .= '('.(int)$this->id.','.(int)$idTax.','.(float)$unitAmount.','. (float)$totalAmount.'),'; } + + // if delete previous details and save new details + if ($replace) { + Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'htl_booking_demands_tax` WHERE id_booking_demand='.(int)$this->id); + } + $values = rtrim($values, ','); $sql = 'INSERT INTO `'._DB_PREFIX_.'htl_booking_demands_tax` (id_booking_demand, id_tax, unit_amount, total_amount) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 8f2b3ad49..b52743635 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -508,6 +508,8 @@ class HotelBookingDetail extends ObjectModel $sql = $sql.' UNION '.$sql3; } + $sql .= ' ORDER BY id_room ASC'; + $unavailRoomTypes = array(); if ($unavailRooms = Db::getInstance()->executeS($sql)) { foreach ($unavailRooms as $unavailRoomDetail) { @@ -629,8 +631,8 @@ class HotelBookingDetail extends ObjectModel $whereAvailRoomSearch = 'WHERE ri.`id_hotel`='.(int)$idHotel.' AND ri.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE.' AND ri.`id` NOT IN ('.$exclude_ids.') AND IF('.(int)$idRoomType.' > 0, ri.`id_product` = '.(int)$idRoomType.', 1) AND ri.`id_product` IN ('.$allowedIdRoomTypes.')'; $groupByAvailRoomSearch = ''; - $orderByAvailRoomSearch = ''; - $orderWayAvailRoomSearch = ''; + $orderByAvailRoomSearch = 'ORDER BY ri.`id`'; + $orderWayAvailRoomSearch = 'ASC'; Hook::exec('actionAvailRoomSearchSqlModifier', array( @@ -930,7 +932,7 @@ class HotelBookingDetail extends ObjectModel (hrdd.`date_from` > \''.pSQL($dateFrom).'\' AND hrdd.`date_from` < \''.pSQL($dateTo).'\' AND hrdd.`date_to` < \''.pSQL($dateTo).'\') ) AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')'; - $sql = $sql1.' UNION '.$sql2; + $sql = $sql1.' UNION '.$sql2.' ORDER BY id_room ASC'; $part_arr = Db::getInstance()->executeS($sql); // Get date wise available rooms @@ -1224,7 +1226,8 @@ class HotelBookingDetail extends ObjectModel $sql = 'SELECT bd.`id_product`, bd.`id_room`, bd.`id_hotel`, bd.`id_customer`, bd.`booking_type`, bd.`id_status` AS booking_status, bd.`comment`, rf.`room_num`, bd.`date_from`, bd.`date_to` FROM `'._DB_PREFIX_.'htl_booking_detail` AS bd INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = bd.`id_room`) - WHERE bd.`id_hotel`='.(int)$idHotel.' AND bd.`is_refunded` = 0 AND bd.`is_back_order` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.date_to >= \''.pSQL($dateTo).'\') AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')'; + WHERE bd.`id_hotel`='.(int)$idHotel.' AND bd.`is_refunded` = 0 AND bd.`is_back_order` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.date_to >= \''.pSQL($dateTo).'\') AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.') + ORDER BY bd.`id_room` ASC'; $bookedRoomTypes = array(); if ($booked_rooms = Db::getInstance()->executeS($sql)) { @@ -2030,13 +2033,16 @@ class HotelBookingDetail extends ObjectModel $objHtlBranchInfo = new HotelBranchInformation(); foreach ($order_detail_data as $key => $value) { - $product_image_id = Product::getCover($value['id_product']); - $link_rewrite = ((new Product((int) $value['id_product'], Configuration::get('PS_LANG_DEFAULT')))->link_rewrite[Configuration::get('PS_LANG_DEFAULT')]); - - if ($product_image_id) { - $order_detail_data[$key]['image_link'] = $context->link->getImageLink($link_rewrite, $product_image_id['id_image'], 'small_default'); + // Check if product is still available + if (Validate::isLoadedObject($objProduct = new Product((int) $value['id_product'], Configuration::get('PS_LANG_DEFAULT'))) + && $productCoverImg = Product::getCover($value['id_product']) + ) { + $order_detail_data[$key]['image_link'] = $context->link->getImageLink( + $objProduct->link_rewrite[Configuration::get('PS_LANG_DEFAULT')], + $productCoverImg['id_image'], 'small_default' + ); } else { - $order_detail_data[$key]['image_link'] = $context->link->getImageLink($link_rewrite, $context->language->iso_code.'-default', 'small_default'); + $order_detail_data[$key]['image_link'] = $context->link->getImageLink('', $context->language->iso_code.'-default', 'small_default'); } $objOrderDetail = new OrderDetail($value['id_order_detail']); diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index afae39dcb..e5cb5ef09 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -486,8 +486,9 @@ class HotelCartBookingData extends ObjectModel $obj_htl_cart_booking_data->children = $room_occupancy['children']; $obj_htl_cart_booking_data->child_ages = $room_occupancy['children'] ? json_encode($room_occupancy['child_ages']) : json_encode(array()); } else { + // if room is being booked without occupancy selection the for adults set base occupancy and children will be 0 $obj_htl_cart_booking_data->adults = $roomTypeInfo['adults']; - $obj_htl_cart_booking_data->children = $roomTypeInfo['children']; + $obj_htl_cart_booking_data->children = 0; $obj_htl_cart_booking_data->child_ages = json_encode(array()); } if ($res &= $obj_htl_cart_booking_data->save()) { @@ -976,7 +977,14 @@ class HotelCartBookingData extends ObjectModel false ); - $cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData($value['id_product']); + $cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData( + $value['id_product'], + 1, + 0, + false, + 2, + null + ); $cart_detail_data[$key]['selected_services'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts( $value['id'], 0, diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 447e95354..a204a2857 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -305,15 +305,16 @@ class HotelHelper return true; } - public static function getPsProducts($id_lang, $start = 0, $limit = 0) + public static function getPsProducts($id_lang, $start = 0, $limit = 0, $booking_product = null) { - $sql = 'SELECT p.`id_product`, pl.`name` + $sql = 'SELECT p.`id_product`, pl.`name`, p.`booking_product` FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` '. Shop::addSqlRestrictionOnLang('pl').') WHERE pl.`id_lang` = '.(int)$id_lang. - ' ORDER BY pl.`name`'. + (isset($booking_product) ? ' AND p.`booking_product` = '.(int) $booking_product : '').' + ORDER BY pl.`name`'. ($limit > 0 ? ' LIMIT '.(int)$start.','.(int)$limit : ''); return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); } @@ -434,7 +435,7 @@ class HotelHelper $product->description_short[$lang['id_lang']] = 'Fashion axe kogi yuccie, ramps shabby chic direct trade before they sold out distillery bicycle rights. Slow-carb +1 quinoa VHS. +1 brunch trust fund, meggings chartreuse sustainable everyday carry tumblr hoodie tacos tilde ramps post-ironic fixie.'; - $product->link_rewrite[$lang['id_lang']] = Tools::link_rewrite('Super Delux Rooms'); + $product->link_rewrite[$lang['id_lang']] = Tools::link_rewrite($value_prod); } $product->id_shop_default = Context::getContext()->shop->id; $product->id_category_default = 2; @@ -515,7 +516,7 @@ class HotelHelper $htl_room_info_obj = new HotelRoomInformation(); $htl_room_info_obj->id_product = $product_id; $htl_room_info_obj->id_hotel = $id_hotel; - $htl_room_info_obj->room_num = 'A-10'.$k; + $htl_room_info_obj->room_num = $value_prod[0].'R-10'.$k; $htl_room_info_obj->id_status = 1; $htl_room_info_obj->floor = 'First'; $htl_room_info_obj->save(); @@ -544,6 +545,170 @@ class HotelHelper } } + public function saveDummyServiceProductsAndRelatedInfo() + { + $idCategoryServices = (int) Configuration::get('PS_SERVICE_CATEGORY'); + $idsGroup = array_column(Group::getGroups(Context::getContext()->language->id), 'id_group'); + + // create service categories + $categories = array( + 'meals' => array( + 'name' => 'Meals', + 'id_category' => 'to_be_set_below', + ), + 'transfers' => array( + 'name' => 'Transfers', + 'id_category' => 'to_be_set_below', + ) + ); + + foreach ($categories as &$category) { + $idCategory = $this->addCategory($category['name'], $idCategoryServices, $idsGroup); + $category['id_category'] = $idCategory; + } + + // create service products + $serviceProducts = array( + array( + 'name' => 'Room Maintenance Fees', + 'id_category_default' => $idCategoryServices, + 'description' => 'Ensure a comfortable stay with our room maintenance service, keeping your accommodation pristine and hassle-free throughout your visit.', + 'price' => '250', + 'auto_add_to_cart' => 1, + 'show_at_front' => 0, + 'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM, + ), + array( + 'name' => 'Internet Handling Charges', + 'id_category_default' => $idCategoryServices, + 'description' => 'Navigate our website effortlessly with seamless handling, ensuring reliable, high-speed access for an enjoyable browsing experience throughout your online journey.', + 'price' => '250', + 'auto_add_to_cart' => 1, + 'show_at_front' => 0, + 'price_addition_type' => Product::PRICE_ADDITION_TYPE_INDEPENDENT, + ), + array( + 'name' => 'Airport Shuttle', + 'id_category_default' => $categories['transfers']['id_category'], + 'description' => 'Experience convenience from touchdown to check-in with our efficient airport shuttle service, whisking you to your accommodation with ease and comfort.', + 'price' => '50', + 'auto_add_to_cart' => 0, + 'show_at_front' => 1, + 'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM, + ), + array( + 'name' => 'Cab on Demand', + 'id_category_default' => $categories['transfers']['id_category'], + 'description' => 'Explore the city conveniently with our cab-on-demand service, giving you the freedom to travel and discover local attractions at your own pace.', + 'price' => '200', + 'auto_add_to_cart' => 0, + 'show_at_front' => 1, + ), + array( + 'name' => 'Breakfast', + 'id_category_default' => $categories['meals']['id_category'], + 'description' => 'Start your day right with a delicious and hearty breakfast, thoughtfully prepared to fuel your adventures and make your mornings exceptional.', + 'price' => '350', + 'auto_add_to_cart' => 0, + 'show_at_front' => 1, + ), + array( + 'name' => 'Dinner', + 'id_category_default' => $categories['meals']['id_category'], + 'description' => 'Wind down in the evening with a delectable dinner spread, offering a culinary journey that delights your taste buds and completes your day with satisfaction.', + 'price' => '450', + 'auto_add_to_cart' => 0, + 'show_at_front' => 1, + ), + ); + + foreach ($serviceProducts as $serviceProduct) { + $objProduct = new Product(); + $objProduct->name = array(); + $objProduct->description = array(); + $objProduct->description_short = array(); + $objProduct->link_rewrite = array(); + + // copy lang values + foreach (Language::getLanguages(true) as $language) { + $objProduct->name[$language['id_lang']] = $serviceProduct['name']; + $objProduct->description[$language['id_lang']] = $serviceProduct['description']; + $objProduct->description_short[$language['id_lang']] = $serviceProduct['description']; + $objProduct->link_rewrite[$language['id_lang']] = Tools::link_rewrite($serviceProduct['name']); + } + + $objProduct->id_shop_default = Context::getContext()->shop->id; + $objProduct->id_category_default = $serviceProduct['id_category_default']; + $objProduct->price = $serviceProduct['price']; + $objProduct->active = 1; + $objProduct->quantity = 999999999; + $objProduct->booking_product = 0; + $objProduct->service_product_type = Product::SERVICE_PRODUCT_WITH_ROOMTYPE; + $objProduct->auto_add_to_cart = $serviceProduct['auto_add_to_cart']; + $objProduct->show_at_front = $serviceProduct['show_at_front']; + $objProduct->available_for_order = 1; + if ($serviceProduct['auto_add_to_cart']) { + $objProduct->price_addition_type = $serviceProduct['price_addition_type']; + } + $objProduct->is_virtual = 1; + $objProduct->indexed = 1; + $objProduct->save(); + $idProduct = $objProduct->id; + + // add to applicable categories + $objCategory = new Category($serviceProduct['id_category_default']); + if ($categories = $objCategory->getParentsCategories()) { + $idsCategory = array(); + foreach ($categories as $category) { + $idsCategory[] = $category['id_category']; + } + $objProduct->addToCategories($idsCategory); + } + + Search::indexation(Tools::link_rewrite($serviceProduct['name']), $idProduct); + + StockAvailable::updateQuantity($idProduct, null, 999999999); + + // save service product images + $imagesBasePath = _PS_MODULE_DIR_.'hotelreservationsystem/views/img/prod_imgs/'.$idProduct.'/'; + $imagesTypes = ImageType::getImagesTypes('products'); + if (is_dir($imagesBasePath) && $opendir = opendir($imagesBasePath)) { + while (($image = readdir($opendir)) !== false) { + $sourceImagePath = $imagesBasePath.$image; + + if (ImageManager::isRealImage($sourceImagePath) + && ImageManager::isCorrectImageFileExt($sourceImagePath) + ) { + $objImage = new Image(); + $objImage->id_product = $idProduct; + $objImage->position = Image::getHighestPosition($idProduct) + 1; + $objImage->cover = 1; + $objImage->add(); + $destinationPath = $objImage->getPathForCreation(); + foreach ($imagesTypes as $imageType) { + ImageManager::resize( + $sourceImagePath, + $destinationPath.'-'.$imageType['name'].'.jpg', + $imageType['width'], + $imageType['height'] + ); + } + ImageManager::resize($sourceImagePath, $destinationPath.'.jpg'); + } + } + closedir($opendir); + } + + // link to all demo room types + $objRoomTypeServiceProduct = new RoomTypeServiceProduct(); + $objRoomTypeServiceProduct->addRoomProductLink( + $idProduct, + array(1, 2, 3, 4), + RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE + ); + } + } + public function saveAdvancedPaymentInfo($id_product) { $obj_adv_pmt = new HotelAdvancedPayment(); @@ -584,6 +749,7 @@ class HotelHelper $this->saveDummyHotelImages($htl_id); $this->saveDummyHotelFeatures($htl_id); $this->saveDummyProductsAndRelatedInfo($htl_id); + $this->saveDummyServiceProductsAndRelatedInfo(); return true; } diff --git a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php index 0cdc01615..91b472101 100644 --- a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php +++ b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php @@ -186,14 +186,6 @@ class HotelOrderRefundRules extends ObjectModel if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) { $bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE; $bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100); - - if ($defaultCurrency != $orderCurrency) { - $bookingCancellationDetail['cancelation_charge'] = Tools::convertPriceFull( - $bookingCancellationDetail['cancelation_charge'], - $objDefaultCurrency, - $objOrderCurrency - ); - } } else { $bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED; if ($defaultCurrency != $orderCurrency) { diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php index b1917b305..94c40c1ec 100644 --- a/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php +++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProductCartDetail.php @@ -190,7 +190,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel $sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_cart`, p.`auto_add_to_cart`, p.`allow_multiple_quantity`, cbd.`id` as `htl_cart_booking_id`, p.`price_addition_type`, cbd.`id_product` as `room_type_id_product`, pl.`name`, cbd.`date_from`, cbd.`date_to` FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd - LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`) + INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`) LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`) LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.') WHERE 1'; diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 278538193..e48432276 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -112,7 +112,8 @@ class AdminAddHotelController extends ModuleAdminController $smartyVars['lang'] = true; $smartyVars['iso'] = $this->context->language->iso_code; //lang vars - $currentLangId = Configuration::get('PS_LANG_DEFAULT'); + + $currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT'); $smartyVars['languages'] = Language::getLanguages(false); $smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId); @@ -501,12 +502,20 @@ class AdminAddHotelController extends ModuleAdminController if ($catState) { if ($catCity = $objHotelBranch->addCategory($city, $catState, $groupIds)) { $hotelCatName = $objHotelBranch->hotel_name; - if ($catHotel = $objHotelBranch->addCategory( - $hotelCatName, $catCity, $groupIds, 1, $newIdHotel - )) { - $objHotelBranch = new HotelBranchInformation($newIdHotel); - $objHotelBranch->id_category = $catHotel; - $objHotelBranch->save(); + + // add/update hotel category + if ($objHotelBranch->id_category) { + $objCategory = new Category($objHotelBranch->id_category); + $objCategory->name = $objHotelBranch->hotel_name; + $objCategory->save(); + } else { + if ($catHotel = $objHotelBranch->addCategory( + $hotelCatName, $catCity, $groupIds, 1, $newIdHotel + )) { + $objHotelBranch = new HotelBranchInformation($newIdHotel); + $objHotelBranch->id_category = $catHotel; + $objHotelBranch->save(); + } } } } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php index 3e6435433..763fce92d 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php @@ -197,7 +197,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $currencySign = $objCurrency->sign; $dateFrom = date('d-m-Y'); $dateTo = date('d-m-Y', strtotime($dateFrom) + 86400); - $currentLangId = Configuration::get('PS_LANG_DEFAULT'); + $currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT'); $smartyVars['languages'] = Language::getLanguages(false); $smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 6146e43f4..0166e41c0 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -44,8 +44,11 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $this->context->cookie->id_cart = (int) $objCart->id; } else { // use previous cart - if (!validate::isLoadedObject($objCart = new Cart($this->context->cookie->id_cart))) { + $objCart = new Cart($this->context->cookie->id_cart); + $isCartValid = Validate::isLoadedObject($objCart); + if (!$isCartValid || ($isCartValid && $objCart->orderExists())) { $objCart = $this->createNewCart(); + $this->context->cookie->id_cart = (int) $objCart->id; } } $this->context->cart = $objCart; @@ -418,7 +421,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $bookingParams['date_from'] = $searchDateFrom; $bookingParams['date_to'] = $searchDateTo; $bookingParams['hotel_id'] = $searchIdHotel; - $bookingParams['room_type'] = $searchIdRoomType; + $bookingParams['id_room_type'] = $searchIdRoomType; $bookingParams['adults'] = $adults; $bookingParams['children'] = $children; $bookingParams['num_rooms'] = $num_rooms; diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php index 06dff1066..128df3ba4 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php @@ -61,7 +61,7 @@ class AdminHotelFeaturesController extends ModuleAdminController $smartyVars = array(); //lang vars $languages = Language::getLanguages(false); - $currentLangId = Configuration::get('PS_LANG_DEFAULT'); + $currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT'); $currentLang = Language::getLanguage((int) $currentLangId); $smartyVars['languages'] = $languages; $smartyVars['currentLang'] = $currentLang; diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php index c03062ce6..588444904 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php @@ -152,7 +152,7 @@ class AdminOrderRefundRulesController extends ModuleAdminController } //lang vars - $currentLangId = Configuration::get('PS_LANG_DEFAULT'); + $currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT'); $smartyVars['languages'] = Language::getLanguages(false); $smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId); @@ -244,14 +244,6 @@ class AdminOrderRefundRulesController extends ModuleAdminController $this->errors[] = $this->l('Enter number of days before check-in date for this rule to be applicable.'); } else if (!Validate::isUnsignedInt($cancelationDays)) { $this->errors[] = $this->l('Enter valid number of days.'); - } else if ($objRefundRule->checkIfRuleExistsByCancelationdays($cancelationDays)) { - if ($idRefundRule) { - if ($objRefundRule->days != $cancelationDays) { - $this->errors[] = $this->l('Refund rule for ').$cancelationDays.$this->l(' days already exists.'); - } - } else { - $this->errors[] = $this->l('Refund rule for ').$cancelationDays.$this->l(' days already exists.'); - } } if (!count($this->errors)) { diff --git a/modules/hotelreservationsystem/controllers/admin/AdminRoomTypeGlobalDemand.php b/modules/hotelreservationsystem/controllers/admin/AdminRoomTypeGlobalDemand.php index b6dcb8650..72e2f61e9 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminRoomTypeGlobalDemand.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminRoomTypeGlobalDemand.php @@ -151,7 +151,7 @@ class AdminRoomTypeGlobalDemandController extends ModuleAdminController $smartyVars = array(); $objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); $smartyVars['defaultcurrencySign'] = $objCurrency->sign; - $currentLangId = Configuration::get('PS_LANG_DEFAULT'); + $currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT'); $languages = Language::getLanguages(false); $smartyVars['languages'] = $languages; $currentLang = Language::getLanguage((int) $currentLangId); diff --git a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css index 028ce74c1..99a26799c 100644 --- a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css +++ b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css @@ -472,6 +472,22 @@ p.room_cat_data border-color: #4d90fe; } +.gm-style-iw-d h6 { + font-family: unset; + font-size: 14px; + color: #333; + font-weight: 500; + margin: 0; +} + +.gm-style-iw-d p { + font-family: unset; + font-size: 13px; + color: #333; + font-weight: 400; + margin: 0; +} + /* ==== AdminHotelFeaturePricesSettingsController ==== */ .week_days { display: none; diff --git a/modules/hotelreservationsystem/views/img/prod_imgs/10/1.jpg b/modules/hotelreservationsystem/views/img/prod_imgs/10/1.jpg new file mode 100644 index 000000000..6af2e2eac Binary files /dev/null and b/modules/hotelreservationsystem/views/img/prod_imgs/10/1.jpg differ diff --git a/modules/hotelreservationsystem/views/img/prod_imgs/5/1.jpg b/modules/hotelreservationsystem/views/img/prod_imgs/5/1.jpg new file mode 100644 index 000000000..fa9236e73 Binary files /dev/null and b/modules/hotelreservationsystem/views/img/prod_imgs/5/1.jpg differ diff --git a/modules/hotelreservationsystem/views/img/prod_imgs/6/1.jpg b/modules/hotelreservationsystem/views/img/prod_imgs/6/1.jpg new file mode 100644 index 000000000..516d18425 Binary files /dev/null and b/modules/hotelreservationsystem/views/img/prod_imgs/6/1.jpg differ diff --git a/modules/hotelreservationsystem/views/img/prod_imgs/7/1.jpg b/modules/hotelreservationsystem/views/img/prod_imgs/7/1.jpg new file mode 100644 index 000000000..6d70e7a7a Binary files /dev/null and b/modules/hotelreservationsystem/views/img/prod_imgs/7/1.jpg differ diff --git a/modules/hotelreservationsystem/views/img/prod_imgs/8/1.jpg b/modules/hotelreservationsystem/views/img/prod_imgs/8/1.jpg new file mode 100644 index 000000000..9ee9be888 Binary files /dev/null and b/modules/hotelreservationsystem/views/img/prod_imgs/8/1.jpg differ diff --git a/modules/hotelreservationsystem/views/img/prod_imgs/9/1.jpg b/modules/hotelreservationsystem/views/img/prod_imgs/9/1.jpg new file mode 100644 index 000000000..3c08ba9bd Binary files /dev/null and b/modules/hotelreservationsystem/views/img/prod_imgs/9/1.jpg differ diff --git a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js index 66a274406..653a318e5 100644 --- a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js +++ b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js @@ -69,7 +69,8 @@ var GoogleMapsManager = { var that = this; that.setDefaultLatLng(function() { that.map = new google.maps.Map($(that.mapDiv).get(0), { - zoom: that.defaultZoom + zoom: that.defaultZoom, + clickableIcons: true, }); that.map.setCenter(that.defaultLatLng); if (that.defaultLatLng && that.formattedAddress) { @@ -80,11 +81,78 @@ var GoogleMapsManager = { // register marker events that.map.addListener('click', function (e) { var latLng = e.latLng; - that.geocoder.geocode({ location: latLng }, function (results, status) { - if (status == google.maps.GeocoderStatus.OK && results[0]) { - that.addMarker(latLng, results[0]); - } - }); + + var isInfoWindowNeeded = true; + // if it is a Place Of Interest (POI), event contains the property 'placeId' + if (Object.hasOwn(e, 'placeId')) { + isInfoWindowNeeded = false; + + that.geocoder.geocode({ location: latLng }, function (results, status) { + if (status == google.maps.GeocoderStatus.OK && results[0]) { + var request = { + placeId: e.placeId, + fields: ['name'], + }; + + that.placesService.getDetails(request, function(place, status) { + if (status === google.maps.places.PlacesServiceStatus.OK) { + var content = '
    ' + place.name + '

    ' + + results[0].formatted_address + '

    '; + + var callback = function (latLng) { + that.setFormVars({ + lat: latLng.lat(), + lng: latLng.lng(), + formattedAddress: content, + inputText: $('#pac-input').val(), + }); + } + + that.addMarker( + latLng, + results[0], + null, + isInfoWindowNeeded, + callback(latLng) + ); + } + }); + } + }); + } else { + that.geocoder.geocode({ location: latLng }, function (results, status) { + if (status == google.maps.GeocoderStatus.OK && results[0]) { + var request = { + placeId: results[0].place_id, + fields: ['name'], + }; + + that.placesService.getDetails(request, function(place, status) { + if (status === google.maps.places.PlacesServiceStatus.OK) { + var content = '
    ' + place.name + '

    ' + + results[0].formatted_address + '

    '; + + var callback = function (latLng) { + that.setFormVars({ + lat: latLng.lat(), + lng: latLng.lng(), + formattedAddress: content, + inputText: $('#pac-input').val(), + }); + } + + that.addMarker( + latLng, + results[0], + null, + isInfoWindowNeeded, + callback(latLng) + ); + } + }); + } + }); + } }); if(cb && typeof cb === 'function') { cb(); @@ -122,7 +190,7 @@ var GoogleMapsManager = { }; that.addMarker(latLng, place); - var content = '
    ' + place.name + '
    ' + place.formatted_address; + var content = '
    ' + place.name + '

    ' + place.formatted_address + '

    '; that.setFormVars({ lat: latLng.lat, lng: latLng.lng, @@ -142,7 +210,7 @@ var GoogleMapsManager = { } }); }, - addMarker: function(latLng, address = null, fa = null, cb = null) { + addMarker: function(latLng, address = null, fa = null, addInfoWindow = true, cb = null) { var that = this; that.clearAllMarkers(); var marker = new google.maps.Marker({ @@ -163,23 +231,36 @@ var GoogleMapsManager = { }); }); - if (address === null && fa) { - // open info window - that.addInfoWindow(marker, fa); + if (addInfoWindow) { + if (address === null && fa) { + // open info window + that.addInfoWindow(marker, fa); + } else { + var request = { + placeId: address.place_id, + fields: ['name'], + }; + + that.placesService.getDetails(request, function(place, status) { + if (status === google.maps.places.PlacesServiceStatus.OK) { + // open info window + var content = '
    ' + place.name + '

    ' + address.formatted_address + '

    '; + that.addInfoWindow(marker, content); + + if(cb && typeof cb === 'function') { + cb(); + } + } + }); + } } else { - var request = { - placeId: address.place_id, - fields: ['name'], - }; - that.placesService.getDetails(request, function(place, status) { - if (status === google.maps.places.PlacesServiceStatus.OK) { - // open info window - var content = '
    ' + place.name + '
    ' + - address.formatted_address + '
    '; - that.addInfoWindow(marker, content); - } - }); + if(cb && typeof cb === 'function') { + cb(); + } + + return marker; } + }, clearAllMarkers: function() { for (var i = 0; i < this.markers.length; i++) { @@ -190,13 +271,21 @@ var GoogleMapsManager = { addInfoWindow: function(marker, content) { if (typeof google === 'object') { var that = this; + var infoWindow = new google.maps.InfoWindow({ content: content, + maxWidth: 200, }); + infoWindow.open({ anchor: marker, map: that.map }); + + google.maps.event.addListener(infoWindow, 'closeclick', function () { + that.clearAllMarkers(); + }); + var latLng = marker.getPosition(); that.setFormVars({ lat: latLng.lat(), @@ -214,6 +303,10 @@ var GoogleMapsManager = { }, } +$(document).on('click', 'button.gm-ui-hover-effect', function () { + GoogleMapsManager.clearAllMarkers(); +}); + function initGoogleMaps() { if (typeof enabledDisplayMap != 'undefined' && typeof google === 'object' @@ -767,6 +860,13 @@ function showLangField(select_lang_name, id_lang) $('.all_lang_icon').attr('src', img_dir_l+id_lang+'.jpg'); $('#choosedLangId').val(id_lang); + + var id_old_language = id_language; + id_language = id_lang; + + if (id_old_language != id_lang) { + changeEmployeeLanguage(); + } } /* ---- HotelConfigurationSettingController Admin ---- */ diff --git a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js index d02a0b756..ac723fcac 100644 --- a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js +++ b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js @@ -28,6 +28,8 @@ $(document).ready(function() { url: rooms_booking_url, method: 'POST', extraParams: function() { + removeInitializedTooltips(); + return $.extend( { ajax: true, @@ -183,6 +185,14 @@ $(document).ready(function() { calendar.render(); } + function removeInitializedTooltips() { + $('#fullcalendar a.day-info, #fullcalendar .fc-daygrid-event').each(function () { + if ($(this).data('ui-tooltip')) { + $(this).tooltip('destroy'); + } + }); + } + function getSearchData() { return { @@ -869,6 +879,12 @@ $(document).ready(function() { $("#cartModal").html(result.cart_content); } $("#cart_record").html(result.total_products_in_cart); + + if (parseInt(result.total_products_in_cart) > 0) { + $('#cart_record').closest('button').removeClass('disabled'); + } else { + $('#cart_record').closest('button').addClass('disabled'); + } } } }); diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index 212a25a0e..a4bbe4ceb 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -32,28 +32,31 @@ {else} {assign var=hook_arg_id_hotel value=null} {/if} + {hook h='displayAdminAddHotelFormTop' id_hotel=$hook_arg_id_hotel} {if count($languages) > 1} -
    - - - - -

    {l s='Change language here to update information in multiple languages.' mod='hotelreservationsystem'}

    -
    +
    +
    + + + + +

    {l s='Change language here to update information in multiple languages.' mod='hotelreservationsystem'}

    +
    +
    {/if} - + {hook h='displayAdminAddHotelFormTabsBefore' id_hotel=$hook_arg_id_hotel}
    + {hook h='displayAdminAddHotelFormInformationTabBefore' id_hotel=$hook_arg_id_hotel} + {if isset($edit)} {/if} @@ -284,15 +289,19 @@
    {/if} + + {hook h='displayAdminAddHotelFormInformationTabAfter' id_hotel=$hook_arg_id_hotel}
    + {hook h='displayAdminAddHotelFormImagesTabBefore' id_hotel=$hook_arg_id_hotel} + {if isset($hotel_info.id) && $hotel_info.id}
    - +

    @@ -308,8 +317,12 @@ {l s='Please save hotel information before saving hotel images.' mod='hotelreservationsystem'}
    {/if} + + {hook h='displayAdminAddHotelFormImagesTabAfter' id_hotel=$hook_arg_id_hotel}
    + {hook h='displayAdminAddHotelFormRestrictionsTabBefore' id_hotel=$hook_arg_id_hotel} + {if isset($hotel_info.id) && $hotel_info.id}
    {/if} + + {hook h='displayAdminAddHotelFormRestrictionsTabAfter' id_hotel=$hook_arg_id_hotel}
    + {hook h='displayAdminAddHotelFormRefundPoliciesTabBefore' id_hotel=$hook_arg_id_hotel} + {if isset($hotel_info.id) && $hotel_info.id}
    {/if} + + {hook h='displayAdminAddHotelFormRefundPoliciesTabAfter' id_hotel=$hook_arg_id_hotel}
    {hook h='displayAdminAddHotelFormTabContent' id_hotel=$hook_arg_id_hotel}
    + + {hook h='displayAdminAddHotelFormBottom' id_hotel=$hook_arg_id_hotel} + + +{block name=script} + +{/block} diff --git a/modules/hotelreservationsystem/views/templates/admin/room_type_global_demand/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/room_type_global_demand/helpers/form/form.tpl index 3c0448dbc..696bf3c9e 100644 --- a/modules/hotelreservationsystem/views/templates/admin/room_type_global_demand/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/room_type_global_demand/helpers/form/form.tpl @@ -274,4 +274,11 @@
    -
    \ No newline at end of file +
    + +{block name=script} + +{/block} diff --git a/modules/statsbestcategories/statsbestcategories.php b/modules/statsbestcategories/statsbestcategories.php index 1b6feb710..f776d314d 100644 --- a/modules/statsbestcategories/statsbestcategories.php +++ b/modules/statsbestcategories/statsbestcategories.php @@ -130,10 +130,6 @@ class StatsBestCategories extends ModuleGrid
    '.$this->displayName.'
    '; - if (!(Module::isEnabled('statsdata') && Configuration::get('PS_STATSDATA_PAGESVIEWS'))) { - $link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata'; - $this->html .= '
    '.$this->l('You must enable the "Save global page views" option from ').'Data mining for statistics'.$this->l(' module in order to display the most viewed hotels, or use the QloApps Google Analytics module.').'
    '; - } $this->html .= $this->engine($engine_params).'
    diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index fbfff36f1..788dd72b9 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -136,10 +136,7 @@ class StatsBestProducts extends ModuleGrid } $html = '
    '.$this->displayName.'
    '; - if (!(Module::isEnabled('statsdata') && Configuration::get('PS_STATSDATA_PAGESVIEWS'))) { - $link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata'; - $html .= '
    '.$this->l('You must enable the "Save global page views" option from ').'Data mining for statistics'.$this->l(' module in order to display the most viewed room types, or use the QloApps Google Analytics module.').'
    '; - } + $html .= $this->engine($engine_params).' '.$this->l('CSV Export').' diff --git a/modules/statsforecast/views/css/conversion-graph.css b/modules/statsforecast/views/css/conversion-graph.css index bce88b010..84e9bccf3 100644 --- a/modules/statsforecast/views/css/conversion-graph.css +++ b/modules/statsforecast/views/css/conversion-graph.css @@ -26,7 +26,8 @@ min-width: 150px; margin-bottom: 25px; padding: 10px 15px; - border: 1.5px solid #555; + border: 1.5px solid transparent; + border-radius: 2px; background-color: #CFE2F3; color: #111; } @@ -37,7 +38,7 @@ } connection { - border: 1px solid #000; + border: 1px solid #777; } connection span { diff --git a/modules/statsnewsletter/statsnewsletter.php b/modules/statsnewsletter/statsnewsletter.php index ea837ec28..197966f60 100644 --- a/modules/statsnewsletter/statsnewsletter.php +++ b/modules/statsnewsletter/statsnewsletter.php @@ -129,6 +129,7 @@ class StatsNewsletter extends ModuleGraph $this->_titles['main'][1] = $this->l('Visitors'); $this->_titles['main'][2] = $this->l('Newsletter statistics'); $this->_titles['main'][3] = $this->l('Both'); + $this->_formats['y'] = 'd'; $this->_query = 'SELECT newsletter_date_add FROM `'._DB_PREFIX_.'customer` diff --git a/modules/statspersonalinfos/statspersonalinfos.php b/modules/statspersonalinfos/statspersonalinfos.php index a08bee698..38c4ba2fe 100644 --- a/modules/statspersonalinfos/statspersonalinfos.php +++ b/modules/statspersonalinfos/statspersonalinfos.php @@ -314,7 +314,7 @@ class StatsPersonalInfos extends ModuleGraph FROM `'._DB_PREFIX_.'customer` WHERE (YEAR(CURDATE()) - YEAR(`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(`birthday`, 5)) >= 60 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' - AND `birthday` IS NOT NULL'; + AND `birthday` IS NOT NULL AND `birthday` != "0000-00-00"'; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); if (isset($result['total']) && $result['total']) { $this->_values[] = $result['total']; diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index fcd91f0e6..ebb3f2538 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -343,6 +343,7 @@ class StatsProduct extends ModuleGraph $this->_titles['main'][1] = $this->l('Views (x100)'); $this->_titles['x'] = $this->l('Date'); $this->_titles['y'] = $this->l('Room nights, Views (x100)'); + $this->_formats['y'] = 'd'; $this->query[0] = 'SELECT o.`date_add`, SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS total FROM `'._DB_PREFIX_.'order_detail` od diff --git a/modules/statsregistrations/statsregistrations.php b/modules/statsregistrations/statsregistrations.php index 6931a4cc6..9fe40a18b 100644 --- a/modules/statsregistrations/statsregistrations.php +++ b/modules/statsregistrations/statsregistrations.php @@ -171,6 +171,7 @@ class StatsRegistrations extends ModuleGraph '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' AND `date_add` BETWEEN'; $this->_titles['main'] = $this->l('Number of customer registrations'); + $this->_formats['y'] = 'd'; $this->setDateGraph($layers, true); } diff --git a/modules/statssales/statssales.php b/modules/statssales/statssales.php index c56931ab6..0ddaece5a 100644 --- a/modules/statssales/statssales.php +++ b/modules/statssales/statssales.php @@ -234,6 +234,10 @@ class StatsSales extends ModuleGraph return $this->getOrderStatusesData(); } + if ($this->option == 1) { + $this->_formats['y'] = 'd'; + } + $this->query = 'SELECT o.`invoice_date`, ROUND(o.`total_paid_real` / o.`conversion_rate`, 2) as total_paid_real, ( SELECT hbd.`id_hotel` diff --git a/modules/statsvisits/statsvisits.php b/modules/statsvisits/statsvisits.php index f96716af5..ddde51efa 100644 --- a/modules/statsvisits/statsvisits.php +++ b/modules/statsvisits/statsvisits.php @@ -157,6 +157,7 @@ class StatsVisits extends ModuleGraph protected function getData($layers) { $this->setDateGraph($layers, true); + $this->_formats['y'] = 'd'; } protected function setAllTimeValues($layers) diff --git a/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl b/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl index 7db81900d..edd16b240 100644 --- a/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl +++ b/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl @@ -19,7 +19,7 @@
    - {if isset($config) && $config['SHOW_AMENITIES_FILTER']} + {if isset($config) && $config['SHOW_AMENITIES_FILTER'] && $all_feat}
    diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index e2fa40f38..41ad65e6b 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -64,7 +64,9 @@ class wkhotelfilterblock extends Module if ($this->context->controller->php_self == 'category') { $htl_id_category = Tools::getValue('id_category'); - if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) { + if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category)) + && ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category)) + ) { if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true))); @@ -73,8 +75,6 @@ class wkhotelfilterblock extends Module $id_lang = $this->context->language->id; $all_feat = FeatureCore::getFeatures($id_lang); - $id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category); - $max_adult = HotelRoomType::getMaxAdults($id_hotel); $max_child = HotelRoomType::getMaxChild($id_hotel); diff --git a/modules/wkhotelroom/classes/WkHotelRoomDisplay.php b/modules/wkhotelroom/classes/WkHotelRoomDisplay.php index f324aba82..51406ada8 100644 --- a/modules/wkhotelroom/classes/WkHotelRoomDisplay.php +++ b/modules/wkhotelroom/classes/WkHotelRoomDisplay.php @@ -152,7 +152,7 @@ class WkHotelRoomDisplay extends ObjectModel // update global configuration values in multilang Configuration::updateValue('HOTEL_ROOM_DISPLAY_HEADING', $HOTEL_ROOM_DISPLAY_HEADING); Configuration::updateValue('HOTEL_ROOM_DISPLAY_DESCRIPTION', $HOTEL_ROOM_DISPLAY_DESCRIPTION); - if ($roomTypes = HotelHelper::getPsProducts(Configuration::get('PS_LANG_DEFAULT'), 0, 5)) { + if ($roomTypes = HotelHelper::getPsProducts(Configuration::get('PS_LANG_DEFAULT'), 0, 5, 1)) { foreach ($roomTypes as $product) { if (Validate::isLoadedObject($objProduct = new Product($product['id_product']))) { $objRoomBlock = new WkHotelRoomDisplay(); diff --git a/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js b/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js index 3bec54859..7aee0d3a2 100644 --- a/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js +++ b/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js @@ -38,6 +38,7 @@ $(document).ready(function() { data: { q: word, _: n, + booking_product: '1', }, success: function(result) { if (result) { diff --git a/modules/wkroomsearchblock/wkroomsearchblock.php b/modules/wkroomsearchblock/wkroomsearchblock.php index f40e7f0f1..dc696e4af 100644 --- a/modules/wkroomsearchblock/wkroomsearchblock.php +++ b/modules/wkroomsearchblock/wkroomsearchblock.php @@ -124,7 +124,9 @@ class WkRoomSearchBlock extends Module { if ('category' == Tools::getValue('controller')) { $idCategory = Tools::getValue('id_category'); - if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory))) { + if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory)) + && HotelBranchInformation::getHotelIdByIdCategory($idCategory) + ) { if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { $objSearchHelper = new WkRoomSearchHelper(); $objSearchHelper->assignSearchPanelVariables(); diff --git a/pdf/invoice.tax-tab.tpl b/pdf/invoice.tax-tab.tpl index b38577f33..cadbb0d4e 100644 --- a/pdf/invoice.tax-tab.tpl +++ b/pdf/invoice.tax-tab.tpl @@ -39,7 +39,7 @@ {l s='Tax Details' pdf='true'} - {l s='Tax Detail' pdf='true'} + {l s='Taxable category' pdf='true'} {if isset($showTaxName) && $showTaxName} {l s='Tax Name' pdf='true'} {/if} diff --git a/themes/hotel-reservation-theme/404.tpl b/themes/hotel-reservation-theme/404.tpl index c770d8a48..8472e2721 100644 --- a/themes/hotel-reservation-theme/404.tpl +++ b/themes/hotel-reservation-theme/404.tpl @@ -23,22 +23,17 @@ * International Registered Trademark & Property of PrestaShop SA *} diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index 4adb17599..64f9f8984 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -63,8 +63,8 @@
    - -
    + +
    {$occupancy['children']|escape:'htmlall':'UTF-8'} @@ -174,7 +174,10 @@ {/if}
    \ No newline at end of file diff --git a/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl b/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl index 9f4167318..bf16754d8 100644 --- a/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl +++ b/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl @@ -25,7 +25,7 @@ {foreach $product.images as $image} {if $image['cover'] == 0} - {/if} {/foreach} diff --git a/themes/hotel-reservation-theme/address.tpl b/themes/hotel-reservation-theme/address.tpl index 3e3e9da78..e581f5382 100644 --- a/themes/hotel-reservation-theme/address.tpl +++ b/themes/hotel-reservation-theme/address.tpl @@ -22,14 +22,24 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -{capture name=path}{l s='Your address'}{/capture} +{capture name=path} + + {l s='My account'} + + + {$navigationPipe} + + + {l s='Address'} + +{/capture} {if isset($smarty.get.updated) && $smarty.get.updated}

    {l s='Your address has been successfully updated.'}

    {/if}
    -

    {l s='Your address'}

    +

    {l s='Address'}

    {if isset($id_address) && (isset($smarty.post.alias) || isset($address->alias))} {l s='Modify address'} @@ -215,7 +225,7 @@

    diff --git a/themes/hotel-reservation-theme/authentication.tpl b/themes/hotel-reservation-theme/authentication.tpl index 393e1f4c8..555f52585 100644 --- a/themes/hotel-reservation-theme/authentication.tpl +++ b/themes/hotel-reservation-theme/authentication.tpl @@ -464,49 +464,51 @@ {l s='(Five characters minimum)'}
    -
    - -
    -
    - - {* - {l s='January'} - {l s='February'} - {l s='March'} - {l s='April'} - {l s='May'} - {l s='June'} - {l s='July'} - {l s='August'} - {l s='September'} - {l s='October'} - {l s='November'} - {l s='December'} - *} -
    -
    - -
    -
    - + {if isset($birthday) && $birthday} +
    + +
    +
    + + {* + {l s='January'} + {l s='February'} + {l s='March'} + {l s='April'} + {l s='May'} + {l s='June'} + {l s='July'} + {l s='August'} + {l s='September'} + {l s='October'} + {l s='November'} + {l s='December'} + *} +
    +
    + +
    +
    + +
    -
    + {/if} {if isset($newsletter) && $newsletter}
    diff --git a/themes/hotel-reservation-theme/css/global.css b/themes/hotel-reservation-theme/css/global.css index 3cd05730d..e9125a210 100644 --- a/themes/hotel-reservation-theme/css/global.css +++ b/themes/hotel-reservation-theme/css/global.css @@ -8312,47 +8312,36 @@ table.discount i { #pagenotfound .pagenotfound { max-width: 824px; - margin: 100px auto 100px auto; + margin: 0px auto; text-align: center; } - #pagenotfound .pagenotfound .img-404 { - padding: 8px 0 27px 0; } - #pagenotfound .pagenotfound .img-404 img { - max-width: 100%; } + #pagenotfound .pagenotfound img { + margin: 0 auto; } #pagenotfound .pagenotfound h1 { - font: 600 28px/34px 'Oxygen', serif; + font-size: 40px; + font-weight: 700; color: #333; - text-transform: uppercase; margin-bottom: 7px; } #pagenotfound .pagenotfound p { - font: 600 16px/20px 'Oxygen', serif; color: #555454; - text-transform: uppercase; - border-bottom: 1px solid #d6d4d4; padding-bottom: 19px; - margin-bottom: 20px; } - #pagenotfound .pagenotfound h3 { - font-weight: bold; - color: #333; - font-size: 13px; - line-height: normal; - margin-bottom: 18px; } - #pagenotfound .pagenotfound label { - font-weight: normal; } - @media (max-width: 767px) { - #pagenotfound .pagenotfound label { - display: block; } } - #pagenotfound .pagenotfound .form-control { - max-width: 293px; - display: inline-block; - margin-right: 5px; } - @media (max-width: 767px) { - #pagenotfound .pagenotfound .form-control { - margin: 0 auto 15px auto; - display: block; } } + margin-top: 30px; + font-size: 18px; + line-height: 24px; + margin-bottom: 0; } #pagenotfound .pagenotfound .buttons { - padding: 48px 0 20px 0; } - #pagenotfound .pagenotfound .buttons .button-medium i.left { - font-size: 17px; } + margin-top: 5px; } + #pagenotfound .pagenotfound .buttons a.btn-primary { + border: none; + border-radius: 2px; + font-size: 14px; + padding: 15px 20px; + font-weight: 600; + background-color: #1292FF; + color: #FFFFFF; } + #pagenotfound .pagenotfound .buttons a.btn-primary:hover { + opacity: 0.8; } + #pagenotfound .pagenotfound .buttons a.btn-primary:hover span { + background: none; } #account-creation_form fieldset.reversoform { padding: 10px !important; } diff --git a/themes/hotel-reservation-theme/css/maintenance.css b/themes/hotel-reservation-theme/css/maintenance.css index 9ff35daca..da78fb1d8 100644 --- a/themes/hotel-reservation-theme/css/maintenance.css +++ b/themes/hotel-reservation-theme/css/maintenance.css @@ -129,6 +129,154 @@ button[type='button'].cancel-login { color: #FFF; } +.header-container { + display: flex; + justify-content: center; + align-items: center; + margin-right: auto; + margin-left: auto; + position: relative; +} + +.header-container.multilang .language-selector-wrap { + position: absolute; + right: 0; +} + +@media (min-width: 768px) { + .header-container { + width: 750px; + } +} +@media (min-width: 992px) { + .header-container { + width: 970px; + } +} +@media (min-width: 1200px) { + .header-container { + width: 1170px; + } +} + +.header-container img { + display: block; + max-height: 60px; + max-width: 100%; + margin: 0 auto; +} + +.header-container .language-selector-wrap { + display: flex; + justify-content: end; +} + +/* language-selector - start */ +.dropdown { + position: relative; +} +.dropdown-toggle { + display: inline-block; + background-color: transparent; + padding: 0; + margin-bottom: 0; + font-size: 14px; + font-weight: bold; + color: #333; + line-height: 1.42857; + text-align: center; + vertical-align: middle; + cursor: pointer; + border: 1px solid transparent; + border-radius: 0px; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-toggle .caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 0; + vertical-align: middle; + border-top-color: white; + border-top: 4px solid #000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + border-bottom: 0 dotted; + content: ""; +} +.dropdown-menu { + position: absolute; + top: 100%; + right: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: 400; + line-height: 1.42857143; + color: #333333; + text-decoration: none; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #262626; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + background-color: #337ab7; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #777777; + pointer-events: none; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +/* language-selector - end */ + #maintenance .logo { padding: 12px; text-align: center; } diff --git a/themes/hotel-reservation-theme/css/occupancy.css b/themes/hotel-reservation-theme/css/occupancy.css index 6523d35ee..37e510c0a 100644 --- a/themes/hotel-reservation-theme/css/occupancy.css +++ b/themes/hotel-reservation-theme/css/occupancy.css @@ -56,6 +56,13 @@ .booking_occupancy_wrapper .add_new_occupancy_btn:active, .booking_occupancy_wrapper .add_new_occupancy_btn:focus, .booking_occupancy_wrapper .add_new_occupancy_btn:hover { text-decoration: none; color: #0000FF;} + .booking_occupancy_wrapper .add_new_occupancy_btn.disabled, + .booking_occupancy_wrapper .add_new_occupancy_btn.disabled:active, + .booking_occupancy_wrapper .add_new_occupancy_btn.disabled:focus, + .booking_occupancy_wrapper .add_new_occupancy_btn.disabled:hover { + color: #333; + opacity: 0.5; + cursor: not-allowed;} .booking_occupancy_wrapper .occupancy_info_head { font-size: 14px; color: #333333; diff --git a/themes/hotel-reservation-theme/css/order-opc.css b/themes/hotel-reservation-theme/css/order-opc.css index 560d3ae92..dd4c0756d 100644 --- a/themes/hotel-reservation-theme/css/order-opc.css +++ b/themes/hotel-reservation-theme/css/order-opc.css @@ -409,11 +409,6 @@ font-size: 14px; color: #0000FF; } -#order-opc .avail_vouchers_block .avail_voucher_des { - font-size: 12px; - color: #777777; - margin-bottom: 2px; -} #order-opc .avail_vouchers_block .seperator { margin-top: 10px; margin-bottom: 10px; diff --git a/themes/hotel-reservation-theme/discount.tpl b/themes/hotel-reservation-theme/discount.tpl index 25440cad7..ea4ba715f 100644 --- a/themes/hotel-reservation-theme/discount.tpl +++ b/themes/hotel-reservation-theme/discount.tpl @@ -22,10 +22,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -{capture name=path}{l s='My account'}{$navigationPipe}{l s='My vouchers'}{/capture} +{capture name=path}{l s='My account'}{$navigationPipe}{l s='Vouchers'}{/capture}

    - {l s='My vouchers'} + {l s='Vouchers'}

    {if isset($cart_rules) && $nb_cart_rules} @@ -33,7 +33,7 @@ {l s='Code'} - {l s='Description'} + {l s='Name'} {l s='Quantity'} {l s='Value'} {l s='Minimum'} @@ -98,7 +98,7 @@
  • - {l s='Back to your account'} + {l s='Back to My account'}
  • diff --git a/themes/hotel-reservation-theme/history.tpl b/themes/hotel-reservation-theme/history.tpl index 8135b8fbc..b6eeee269 100644 --- a/themes/hotel-reservation-theme/history.tpl +++ b/themes/hotel-reservation-theme/history.tpl @@ -27,10 +27,10 @@ {l s='My account'} {$navigationPipe} - {l s='Order history'} + {l s='Bookings'} {/capture} {include file="$tpl_dir./errors.tpl"} -

    {l s='Order history'}

    +

    {l s='Bookings'}

    {l s='Here are the orders you\'ve placed since your account was created.'}

    {if $slowValidation}

    {l s='If you have just placed an order, it may take a few minutes for it to be validated. Please refresh this page if your order is missing.'}

    @@ -127,7 +127,7 @@
  • - {l s='Back to Your Account'} + {l s='Back to My account'}
  • diff --git a/themes/hotel-reservation-theme/identity.tpl b/themes/hotel-reservation-theme/identity.tpl index b84a30800..63d5645b5 100644 --- a/themes/hotel-reservation-theme/identity.tpl +++ b/themes/hotel-reservation-theme/identity.tpl @@ -31,12 +31,12 @@ {$navigationPipe} - {l s='Your personal information'} + {l s='Personal information'} {/capture}

    - {l s='Your personal information'} + {l s='Personal information'}

    {include file="$tpl_dir./errors.tpl"} @@ -84,51 +84,53 @@
    -
    - -
    -
    - -
    -
    - {* - {l s='January'} - {l s='February'} - {l s='March'} - {l s='April'} - {l s='May'} - {l s='June'} - {l s='July'} - {l s='August'} - {l s='September'} - {l s='October'} - {l s='November'} - {l s='December'} - *} - -
    -
    - + {if isset($birthday) && $birthday} +
    + +
    +
    + +
    +
    + {* + {l s='January'} + {l s='February'} + {l s='March'} + {l s='April'} + {l s='May'} + {l s='June'} + {l s='July'} + {l s='August'} + {l s='September'} + {l s='October'} + {l s='November'} + {l s='December'} + *} + +
    +
    + +
    -
    + {/if}