From 2ef62c630c6db766413469acd4690d880215af36 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 28 Mar 2024 16:04:48 +0530 Subject: [PATCH 001/103] Added: Done button into the occupacy block in the front office --- .../views/css/wk-global-search.css | 8 ++- .../views/js/wk-room-search-block.js | 51 +++++++++++++++++ .../views/templates/hook/searchForm.tpl | 26 ++++++++- .../_partials/occupancy_field.tpl | 7 ++- .../hotel-reservation-theme/js/occupancy.js | 56 +++++++++++++++++++ 5 files changed, 143 insertions(+), 5 deletions(-) diff --git a/modules/wkroomsearchblock/views/css/wk-global-search.css b/modules/wkroomsearchblock/views/css/wk-global-search.css index d70fd2e11..59f781dc3 100644 --- a/modules/wkroomsearchblock/views/css/wk-global-search.css +++ b/modules/wkroomsearchblock/views/css/wk-global-search.css @@ -206,6 +206,12 @@ text-transform: uppercase; border: none; border-radius: 4px;} + .select_occupancy_btn { + background-color: #1292FF; + font-size: 13px; + border: none; + padding: 5px 20px; + border-radius: 4px;} /* occupancy */ @@ -216,7 +222,7 @@ overflow: auto; box-shadow: 0 8px 25px -4px rgba(0,0,0,0.39); left: 0px; - padding: 20px;} + padding: 12px 20px;} #search_occupancy_wrapper .occupancy-info-separator { margin-bottom: 15px; margin-top: 15px; diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index f5d180d16..6080b36c5 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -569,6 +569,57 @@ $(document).ready(function() { } } }); + $(document).on('click', '#search_occupancy_wrapper .select_occupancy_btn', function(e) { + e.preventDefault(); + if ($('#search_occupancy_wrapper').length) { + if ($('#search_occupancy_wrapper').css('display') !== 'none') { + // Before closing the occupancy block validate the vaules inside + let hasErrors = 0; + + let adults = $("#search_occupancy_wrapper").find(".num_adults").map(function(){return $(this).val();}).get(); + let children = $("#search_occupancy_wrapper").find(".num_children").map(function(){return $(this).val();}).get(); + let child_ages = $("#search_occupancy_wrapper").find(".guest_child_age").map(function(){return $(this).val();}).get(); + + // start validating above values + if (!adults.length || (adults.length != children.length)) { + hasErrors = 1; + showErrorMessage(invalid_occupancy_txt); + } else { + $("#search_occupancy_wrapper").find('.occupancy_count').removeClass('error_border'); + + // validate values of adults and children + adults.forEach(function (item, index) { + if (isNaN(item) || parseInt(item) < 1) { + hasErrors = 1; + $("#search_occupancy_wrapper .num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + if (isNaN(children[index])) { + hasErrors = 1; + $("#search_occupancy_wrapper .num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + }); + + // validate values of selected child ages + $("#search_occupancy_wrapper").find('.guest_child_age').removeClass('error_border'); + child_ages.forEach(function (age, index) { + age = parseInt(age); + if (isNaN(age) || (age < 0) || (age >= parseInt(max_child_age))) { + hasErrors = 1; + $("#search_occupancy_wrapper .guest_child_age").eq(index).addClass('error_border'); + } + }); + } + + if (hasErrors == 0) { + $("#search_occupancy_wrapper").hide(); + $("#search_hotel_block_form #guest_occupancy").removeClass('error_border'); + } else { + $("#search_hotel_block_form #guest_occupancy").addClass('error_border'); + return false; + } + } + } + }); }); // function to set occupancy infor in guest occupancy field(search form) function setGuestOccupancy() diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index 9629b5e69..3f93b5dc2 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -1,3 +1,22 @@ +{* +* Copyright since 2010 Webkul. +* +* NOTICE OF LICENSE +* +* All right is reserved, +* Please go through this link for complete license : https://store.webkul.com/license.html +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to 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 IN +* @license https://store.webkul.com/license.html +*} +
{if isset($location_enabled) && $location_enabled}
@@ -201,9 +220,12 @@
{/if} - + + + + diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index c16039713..ccd9b288e 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -175,11 +175,14 @@ {/if} - + + + + \ No newline at end of file diff --git a/themes/hotel-reservation-theme/js/occupancy.js b/themes/hotel-reservation-theme/js/occupancy.js index 2cb25784d..0fd907f81 100644 --- a/themes/hotel-reservation-theme/js/occupancy.js +++ b/themes/hotel-reservation-theme/js/occupancy.js @@ -160,6 +160,62 @@ $(document).ready(function(){ } }); + $(document).on('click', '.booking_occupancy_wrapper .select_occupancy_btn', function(e) { + e.preventDefault(); + if ($('.booking_occupancy_wrapper:visible').length) { + var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); + $(occupancy_wrapper).find(".occupancy_info_block").addClass('selected'); + setRoomTypeGuestOccupancy(occupancy_wrapper); + + let hasErrors = 0; + + let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get(); + let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get(); + let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get(); + + // start validating above values + if (!adults.length || (adults.length != children.length)) { + hasErrors = 1; + showErrorMessage(invalid_occupancy_txt); + } else { + $(occupancy_wrapper).find('.occupancy_count').removeClass('error_border'); + + // validate values of adults and children + adults.forEach(function (item, index) { + if (isNaN(item) || parseInt(item) < 1) { + hasErrors = 1; + $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + if (isNaN(children[index])) { + hasErrors = 1; + $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + }); + + // validate values of selected child ages + $(occupancy_wrapper).find('.guest_child_age').removeClass('error_border'); + 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).addClass('error_border'); + } + }); + } + if (hasErrors == 0) { + if (!($(e.target).closest(".ajax_add_to_cart_button").length + || $(e.target).closest(".exclusive.book_now_submit").length + )) { + $(occupancy_wrapper).parent().removeClass('open'); + $(occupancy_wrapper).siblings(".booking_guest_occupancy").removeClass('error_border'); + $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); + } + } else { + $(occupancy_wrapper).siblings(".booking_guest_occupancy").addClass('error_border'); + } + } + }); + $(document).on('click', function(e) { if ($('.booking_occupancy_wrapper:visible').length) { var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); From 55cf83563a2fe25ad09920aaeecfae4f1d960e76 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 3 Apr 2024 18:53:21 +0530 Subject: [PATCH 002/103] Fixed: Room type duplication was not creating a perfect copy of existing the room type --- modules/hotelreservationsystem/classes/HotelRoomType.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/hotelreservationsystem/classes/HotelRoomType.php b/modules/hotelreservationsystem/classes/HotelRoomType.php index a5445ec18..6c0a80fd4 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomType.php +++ b/modules/hotelreservationsystem/classes/HotelRoomType.php @@ -107,6 +107,11 @@ class HotelRoomType extends ObjectModel $objHotelRoomType->id_hotel = $idHotelNew; $objHotelRoomType->adults = $roomType['adults']; $objHotelRoomType->children = $roomType['children']; + $objHotelRoomType->max_adults = $roomType['max_adults']; + $objHotelRoomType->max_children = $roomType['max_children']; + $objHotelRoomType->max_guests = $roomType['max_guests']; + $objHotelRoomType->min_los = $roomType['min_los']; + $objHotelRoomType->max_los = $roomType['max_los']; if ($objHotelRoomType->save()) { $objHotelRoomType->updateCategories(); return $returnId ? $objHotelRoomType->id : true; From 52b6e3f87edaa744e9c6ed099a1fcba40dc05425 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 5 Apr 2024 11:32:07 +0530 Subject: [PATCH 003/103] Fixed: Defaul dates in the booking form, search block, if prepration time is applied to the hotel --- controllers/front/ProductController.php | 8 +++++--- .../controllers/front/autocompletesearch.php | 3 ++- .../views/js/wk-room-search-block.js | 13 +++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index ec77ebd09..d44e46489 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -341,8 +341,13 @@ class ProductControllerCore extends FrontController $date_from = Tools::getValue('date_from'); $date_to = Tools::getValue('date_to'); + $preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($hotel_id); if (!($date_from = Tools::getValue('date_from'))) { $date_from = date('Y-m-d'); + if ($preparationTime) { + $date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day')); + } + // set date to according to los $objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange(); $los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from); @@ -368,9 +373,6 @@ class ProductControllerCore extends FrontController } } /*End*/ - // booking preparation time - $preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($hotel_id); - $objHotelImage = new HotelImage(); $hotelImageLink = null; if ($coverImage = HotelImage::getCover($hotel_id)) { diff --git a/modules/wkroomsearchblock/controllers/front/autocompletesearch.php b/modules/wkroomsearchblock/controllers/front/autocompletesearch.php index 4a051c103..4d5eec20a 100644 --- a/modules/wkroomsearchblock/controllers/front/autocompletesearch.php +++ b/modules/wkroomsearchblock/controllers/front/autocompletesearch.php @@ -46,9 +46,10 @@ class WkRoomSearchBlockAutoCompleteSearchModuleFrontController extends ModuleFro foreach ($cat_ids as $value) { if ($hotel_info = $obj_htl_info->hotelBranchInfoByCategoryId($value['id_category'])) { $maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotel_info['id']); + $preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($hotel_info['id']); $maxOrderDate = date('Y-m-d', strtotime($maxOrderDate)); $html .= '
  • '. + $hotel_info['id_category'].'" data-max_order_date="'.$maxOrderDate.'" data-preparation_time="'.$preparationTime.'">'. $hotel_info['hotel_name'].'
  • '; } } diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index f5d180d16..d85c25e5b 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -62,6 +62,14 @@ $(document).ready(function() { if (preparation_time) { start_date.setDate(start_date.getDate() + parseInt(preparation_time)); start_date.setHours(0, 0, 0, 0); + let selecteDateFrom = new Date(Date.parse(dateFrom)); + let selecteDateTo = new Date(Date.parse(dateTo)); + if (selecteDateFrom < start_date + || selecteDateTo < start_date + ) { + $('#check_in_time').val(''); + $('#check_out_time').val(''); + } } if (max_order_date) { @@ -203,6 +211,11 @@ $(document).ready(function() { $('#hotel_cat_name').html('Select Hotel'); $('.hotel_dropdown_ul').empty(); $('.hotel_dropdown_ul').html(result.data); + // Resetting the data from previously selected hotel + $('#preparation_time').val(0); + var max_order_date = $('#max_order_date').val(); + var preparation_time = 0; + createDateRangePicker(max_order_date, preparation_time, $('#check_in_time').val(), $('#check_out_time').val()); } else { alert(no_results_found_cond); } From cd58f81cbcab68f7f7d291b5342fe76464971192 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 17 Apr 2024 13:31:20 +0530 Subject: [PATCH 004/103] Added:Admin is show global max order date and global preparation time in AdminAddHotel while editing hotel --- .../controllers/admin/AdminAddHotelController.php | 2 ++ .../views/templates/admin/add_hotel/helpers/form/form.tpl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 1d0e738b3..9b6f35bbf 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -183,6 +183,8 @@ class AdminAddHotelController extends ModuleAdminController $smartyVars['state_var'] = $stateOptions; $smartyVars['enabledDisplayMap'] = Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP'); $smartyVars['ps_img_dir'] = _PS_IMG_.'l/'; + $smartyVars['MAX_GLOBAL_BOOKING_DATE'] = date('Y-m-d', strtotime(Configuration::get('MAX_GLOBAL_BOOKING_DATE'))); + $smartyVars['GLOBAL_PREPARATION_TIME'] = Configuration::get('GLOBAL_PREPARATION_TIME'); $this->context->smarty->assign($smartyVars); 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 4ef90c7d8..53a919257 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 @@ -357,6 +357,7 @@ +
    {l s='Global max order date:' mod='hotelreservationsystem'} {dateFormat date=$MAX_GLOBAL_BOOKING_DATE}
    + {/if} {/if} From 775c4ab4ddcac852b8f9be271a2ecf2db144e03a Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 31 May 2024 11:17:53 +0530 Subject: [PATCH 042/103] Fixed: Extra services pop not for second hotel is not visible when booked multiple hotel rooms from a single cart --- .../front/OrderConfirmationController.php | 10 +- .../css/order-confirmation.css | 193 ++++++++++++++++++ .../js/order-confirmation.js | 73 +++++++ .../order-confirmation.tpl | 2 +- 4 files changed, 274 insertions(+), 4 deletions(-) create mode 100644 themes/hotel-reservation-theme/css/order-confirmation.css create mode 100644 themes/hotel-reservation-theme/js/order-confirmation.js diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index 8c63c8907..a60326859 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -175,6 +175,7 @@ class OrderConfirmationControllerCore extends FrontController $order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($idOrder, $customer->id_guest, $type_value['product_id']); } if ($rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id'])) { + $cart_htl_data[$type_key]['id_order'] = $idOrder; $cart_htl_data[$type_key]['id_product'] = $type_value['product_id']; $cart_htl_data[$type_key]['cover_img'] = $cover_img; $cart_htl_data[$type_key]['adults'] = $rm_dtl['adults']; @@ -366,9 +367,6 @@ class OrderConfirmationControllerCore extends FrontController } } - if (!empty($cart_htl_data)) { - $this->context->smarty->assign('cart_htl_data', $cart_htl_data); - } if (!empty($cart_service_products)) { $this->context->smarty->assign('cart_service_products', $cart_service_products); } @@ -399,6 +397,10 @@ class OrderConfirmationControllerCore extends FrontController $this->context->smarty->assign('orders_has_invoice', $orders_has_invoice); } + if (!empty($cart_htl_data)) { + $this->context->smarty->assign('cart_htl_data', $cart_htl_data); + } + $shw_bo_msg = Configuration::get('WK_SHOW_MSG_ON_BO'); $bo_msg = Configuration::get('WK_BO_MESSAGE'); $this->context->smarty->assign( @@ -469,6 +471,8 @@ class OrderConfirmationControllerCore extends FrontController parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'history.css'); $this->addJS(_THEME_JS_DIR_.'history.js'); + $this->addJS(_THEME_JS_DIR_.'order-confirmation.js'); + $this->addCSS(_THEME_CSS_DIR_.'order-confirmation.css'); $this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme $this->addJqueryUI('ui.tooltip', 'base', true); } diff --git a/themes/hotel-reservation-theme/css/order-confirmation.css b/themes/hotel-reservation-theme/css/order-confirmation.css new file mode 100644 index 000000000..654658b95 --- /dev/null +++ b/themes/hotel-reservation-theme/css/order-confirmation.css @@ -0,0 +1,193 @@ +/** + * 2010-2023 Webkul. + * + * NOTICE OF LICENSE + * + * All right is reserved, + * Please go through LICENSE.txt file inside our module + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade this module to newer + * versions in the future. If you wish to customize this module for your + * needs please refer to CustomizationPolicy.txt file inside our module for more information. + * + * @author Webkul IN + * @copyright 2010-2023 Webkul IN + * @license LICENSE.txt + */ + +.fancybox-wrap.fancybox-extra-services .card { + width: 650px; + margin-bottom: 0; +} + +.fancybox-wrap.fancybox-extra-services .fancybox-close { + background: none; + top: 12px; + right: 12px; + font-size: 32px; +} + +.fancybox-wrap.fancybox-extra-services .fancybox-close:after { + content: '\00D7'; + color: #333; +} +.fancybox-wrap.fancybox-extra-services .card-body { + padding: 0; + max-height: 70vh; + overflow: auto; +} + +.card { + padding: 0; + border-radius: 4px; + border: 1px solid #E5E5E5; + background: #FFF; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.10); + color: #333; +} +.card .card-header { + padding: 14px 18px; + margin-bottom: 0; + border-bottom: 1px solid #E5E5E5; + font-size: 19px; + font-weight: bold; + line-height: 27px; +} + +.card.card-toolbar .card-header { + padding: 8px 18px; +} + +.card .card-subheader { + margin-bottom: 0; + font-size: 14px; + font-weight: normal; +} + +.card .card-body { + padding: 18px; +} + +.card .card-body .card-title { + margin: 0; + font-size: 18px; + font-weight: bold; +} + +.card .card-body .card-subtitle { + margin: 0; + margin-bottom: 8px; + font-size: 16px; + font-weight: bold; +} + +.card .card-body .card-text { + font-size: 14px; + line-height: 26px; +} + +/* card-tabs - start */ +.card.card-tabs .nav-tabs { + border: none; +} + +.card.card-tabs .nav-tabs li > a { + padding: 0 18px; + border: none; + color: #333; +} + +.card.card-tabs .nav-tabs li.active:after { + content: ''; + position: absolute; + top: 39px; + width: 100%; + height: 2px; + background: #379aef; +} + +.card.card-tabs .tab-content { + margin-top: 0; +} +/* card-tabs - end */ + +#rooms_extra_services .nav-tabs { + border-bottom: none; +} + +#rooms_extra_services .nav-tabs > li { + width: 50%; + text-align: center; + margin: 0; +} + +#rooms_extra_services .nav-tabs > li > a { + border: none; + margin: 0; + font-size: 14px; + font-weight: bold; + color: #333; +} + +#rooms_extra_services .nav-tabs > li.active { + border-bottom: 1px solid #1292FF; +} + +#rooms_extra_services .nav-tabs > li.active > a { + color: #1292FF; +} + +#rooms_extra_services .nav-tabs > li:not(.active) { + border-bottom: 1px solid #F0F0F0; +} + +#rooms_extra_services .tab-content { + margin-top: 0; + padding: 0; + padding-bottom: 15px; +} + +#rooms_extra_services .tab-content .rooms_extra_demands_head { + padding: 10px 18px; + border-bottom: 1px solid #F0F0F0; +} + +#rooms_extra_services .tab-content .rooms_extra_demands_text { + font-size: 12px; + margin-bottom: 0; +} + +#rooms_extra_services .tab-content .room_demands { + padding: 0 18px; + margin-top: 20px; +} + +#rooms_extra_services .tab-content .demand_header { + font-size: 16px; + font-weight: bold; + line-height: 24px; + margin-bottom: 10px; +} + +#rooms_extra_services .tab-content .room_demand_detail { + font-size: 14px; + font-weight: 500; + margin-top: 0; + padding-top: 0; + border-top: unset; +} + +#rooms_extra_services .tab-content .room_demand_block { + display: flex; + justify-content: space-between; +} + +#rooms_extra_services .tab-content .room_demand_block:not(:last-of-type) { + margin-bottom: 12px; +} + +#rooms_extra_services .nav-tabs > li.active:after { + content: unset; +} \ No newline at end of file diff --git a/themes/hotel-reservation-theme/js/order-confirmation.js b/themes/hotel-reservation-theme/js/order-confirmation.js new file mode 100644 index 000000000..7b4359cf6 --- /dev/null +++ b/themes/hotel-reservation-theme/js/order-confirmation.js @@ -0,0 +1,73 @@ +/** +* 2010-2022 Webkul. +* +* NOTICE OF LICENSE +* +* All right is reserved, +* Please go through LICENSE.txt file inside our module +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to newer +* versions in the future. If you wish to customize this module for your +* needs please refer to CustomizationPolicy.txt file inside our module for more information. +* +* @author Webkul IN +* @copyright 2010-2022 Webkul IN +* @license LICENSE.txt +*/ + +$(document).ready(function(){ + $(document).off('click').on('click', '.open_rooms_extra_services_panel', function(e) { + var idProduct = $(this).data('id_product'); + var idOrder = $(this).data('id_order'); + var dateFrom = $(this).data('date_from'); + var dateTo = $(this).data('date_to'); + var action = $(this).data('action'); + $.ajax({ + type: 'POST', + headers: { + "cache-control": "no-cache" + }, + url: action, + dataType: 'json', + cache: false, + data: { + date_from: dateFrom, + date_to: dateTo, + id_product: idProduct, + id_order: idOrder, + action: 'getRoomTypeBookingDemands', + method: 'getRoomTypeBookingDemands', + ajax: true, + token: static_token + }, + success: function(result) { + if (result.extra_demands) { + $('#rooms_extra_services').html(''); + $('#rooms_extra_services').append(result.extra_demands); + } + $.fancybox({ + href: "#rooms_extra_services", + autoSize : true, + autoScale : true, + maxWidth : '100%', + wrapCSS: 'fancybox-extra-services', + padding: 0, + helpers: { + overlay: { + css : {background: 'rgba(0, 0, 0, 0.8)'} + } + }, + 'hideOnContentClick': false, + afterClose: function() { + if (result.reload) { + // reload so that changes prices will reflect everywhere + location.reload(); + } + }, + }); + }, + }); + }); +}); \ No newline at end of file diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl index fcbe91d71..f1da8db68 100644 --- a/themes/hotel-reservation-theme/order-confirmation.tpl +++ b/themes/hotel-reservation-theme/order-confirmation.tpl @@ -111,7 +111,7 @@

    {if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']} - + {/if} {if $group_use_tax} {displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency} From 2996d89f35a7f41516d13e36459e1300062317c0 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 31 May 2024 15:19:11 +0530 Subject: [PATCH 043/103] Fixed: Calendar open for pervious month of max order date is for current month --- js/daterangepicker/jquery.daterangepicker.js | 2 +- js/daterangepicker/jquery.daterangepicker.min.js | 2 +- modules/wkroomsearchblock/views/js/wk-room-search-block.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/js/daterangepicker/jquery.daterangepicker.js b/js/daterangepicker/jquery.daterangepicker.js index e9338be38..6115348dc 100755 --- a/js/daterangepicker/jquery.daterangepicker.js +++ b/js/daterangepicker/jquery.daterangepicker.js @@ -2597,7 +2597,7 @@ if (opt.endDate && compare_month(nextMonth(defaultTime), opt.endDate) > 0) defaultTime = prevMonth(moment(opt.endDate).toDate()); } - if (opt.singleDate) { + if (opt.singleDate || opt.singleMonth) { if (opt.startDate && compare_month(defaultTime, opt.startDate) < 0) defaultTime = moment(opt.startDate).toDate(); if (opt.endDate && compare_month(defaultTime, opt.endDate) > 0) defaultTime = moment(opt.endDate).toDate(); } diff --git a/js/daterangepicker/jquery.daterangepicker.min.js b/js/daterangepicker/jquery.daterangepicker.min.js index 508ddcce6..4c7a27afd 100755 --- a/js/daterangepicker/jquery.daterangepicker.min.js +++ b/js/daterangepicker/jquery.daterangepicker.min.js @@ -4,4 +4,4 @@ * @link https://github.com/longbill/jquery-date-range-picker * @license MIT */ -!function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("moment")):e(jQuery,moment)}(function(U,Q){"use strict";U.dateRangePickerLanguages={default:{selected:"Selected:",day:"Day",days:"Days",apply:"Close","week-1":"mo","week-2":"tu","week-3":"we","week-4":"th","week-5":"fr","week-6":"sa","week-7":"su","week-number":"W","month-name":["january","february","march","april","may","june","july","august","september","october","november","december"],shortcuts:"Shortcuts","custom-values":"Custom Values",past:"Past",following:"Following",previous:"Previous","prev-week":"Week","prev-month":"Month","prev-year":"Year",next:"Next","next-week":"Week","next-month":"Month","next-year":"Year","less-than":"Date range should not be more than %d days","more-than":"Date range should not be less than %d days","default-more":"Please select a date range longer than %d days","default-single":"Please select a date","default-less":"Please select a date range less than %d days","default-range":"Please select a date range between %d and %d days","default-default":"Please select a date range",time:"Time",hour:"Hour",minute:"Minute"},id:{selected:"Terpilih:",day:"Hari",days:"Hari",apply:"Tutup","week-1":"sen","week-2":"sel","week-3":"rab","week-4":"kam","week-5":"jum","week-6":"sab","week-7":"min","week-number":"W","month-name":["januari","februari","maret","april","mei","juni","juli","agustus","september","oktober","november","desember"],shortcuts:"Pintas","custom-values":"Nilai yang ditentukan",past:"Yang Lalu",following:"Mengikuti",previous:"Sebelumnya","prev-week":"Minggu","prev-month":"Bulan","prev-year":"Tahun",next:"Selanjutnya","next-week":"Minggu","next-month":"Bulan","next-year":"Tahun","less-than":"Tanggal harus lebih dari %d hari","more-than":"Tanggal harus kurang dari %d hari","default-more":"Jarak tanggal harus lebih lama dari %d hari","default-single":"Silakan pilih tanggal","default-less":"Jarak rentang tanggal tidak boleh lebih lama dari %d hari","default-range":"Rentang tanggal harus antara %d dan %d hari","default-default":"Silakan pilih rentang tanggal",time:"Waktu",hour:"Jam",minute:"Menit"},az:{selected:"Seçildi:",day:" gün",days:" gün",apply:"tətbiq","week-1":"1","week-2":"2","week-3":"3","week-4":"4","week-5":"5","week-6":"6","week-7":"7","month-name":["yanvar","fevral","mart","aprel","may","iyun","iyul","avqust","sentyabr","oktyabr","noyabr","dekabr"],shortcuts:"Qısayollar",past:"Keçmiş",following:"Növbəti",previous:"   ","prev-week":"Öncəki həftə","prev-month":"Öncəki ay","prev-year":"Öncəki il",next:"   ","next-week":"Növbəti həftə","next-month":"Növbəti ay","next-year":"Növbəti il","less-than":"Tarix aralığı %d gündən çox olmamalıdır","more-than":"Tarix aralığı %d gündən az olmamalıdır","default-more":"%d gündən çox bir tarix seçin","default-single":"Tarix seçin","default-less":"%d gündən az bir tarix seçin","default-range":"%d və %d gün aralığında tarixlər seçin","default-default":"Tarix aralığı seçin"},bg:{selected:"Избрано:",day:"Ден",days:"Дни",apply:"Затвори","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"нд","week-number":"С","month-name":["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],shortcuts:"Преки пътища","custom-values":"Персонализирани стойности",past:"Минал",following:"Следващ",previous:"Предишен","prev-week":"Седмица","prev-month":"Месец","prev-year":"Година",next:"Следващ","next-week":"Седмица","next-month":"Месец","next-year":"Година","less-than":"Периодът от време не трябва да е повече от %d дни","more-than":"Периодът от време не трябва да е по-малко от %d дни","default-more":"Моля изберете период по-дълъг от %d дни","default-single":"Моля изберете дата","default-less":"Моля изберете период по-къс от %d дни","default-range":"Моля изберете период между %d и %d дни","default-default":"Моля изберете период",time:"Време",hour:"Час",minute:"Минута"},cn:{selected:"已选择:",day:"天",days:"天",apply:"确定","week-1":"一","week-2":"二","week-3":"三","week-4":"四","week-5":"五","week-6":"六","week-7":"日","week-number":"周","month-name":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortcuts:"快捷选择",past:"过去",following:"将来",previous:"   ","prev-week":"上周","prev-month":"上个月","prev-year":"去年",next:"   ","next-week":"下周","next-month":"下个月","next-year":"明年","less-than":"所选日期范围不能大于%d天","more-than":"所选日期范围不能小于%d天","default-more":"请选择大于%d天的日期范围","default-less":"请选择小于%d天的日期范围","default-range":"请选择%d天到%d天的日期范围","default-single":"请选择一个日期","default-default":"请选择一个日期范围",time:"时间",hour:"小时",minute:"分钟"},cz:{selected:"Vybráno:",day:"Den",days:"Dny",apply:"Zavřít","week-1":"po","week-2":"út","week-3":"st","week-4":"čt","week-5":"pá","week-6":"so","week-7":"ne","month-name":["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],shortcuts:"Zkratky",past:"po",following:"následující",previous:"předchozí","prev-week":"týden","prev-month":"měsíc","prev-year":"rok",next:"další","next-week":"týden","next-month":"měsíc","next-year":"rok","less-than":"Rozsah data by neměl být větší než %d dnů","more-than":"Rozsah data by neměl být menší než %d dnů","default-more":"Prosím zvolte rozsah data větší než %d dnů","default-single":"Prosím zvolte datum","default-less":"Prosím zvolte rozsah data menší než %d dnů","default-range":"Prosím zvolte rozsah data mezi %d a %d dny","default-default":"Prosím zvolte rozsah data"},de:{selected:"Auswahl:",day:"Tag",days:"Tage",apply:"Schließen","week-1":"mo","week-2":"di","week-3":"mi","week-4":"do","week-5":"fr","week-6":"sa","week-7":"so","month-name":["januar","februar","märz","april","mai","juni","juli","august","september","oktober","november","dezember"],shortcuts:"Schnellwahl",past:"Vorherige",following:"Folgende",previous:"Vorherige","prev-week":"Woche","prev-month":"Monat","prev-year":"Jahr",next:"Nächste","next-week":"Woche","next-month":"Monat","next-year":"Jahr","less-than":"Datumsbereich darf nicht größer sein als %d Tage","more-than":"Datumsbereich darf nicht kleiner sein als %d Tage","default-more":"Bitte mindestens %d Tage auswählen","default-single":"Bitte ein Datum auswählen","default-less":"Bitte weniger als %d Tage auswählen","default-range":"Bitte einen Datumsbereich zwischen %d und %d Tagen auswählen","default-default":"Bitte ein Start- und Enddatum auswählen",Time:"Zeit",hour:"Stunde",minute:"Minute"},es:{selected:"Seleccionado:",day:"Día",days:"Días",apply:"Cerrar","week-1":"lu","week-2":"ma","week-3":"mi","week-4":"ju","week-5":"vi","week-6":"sa","week-7":"do","month-name":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortcuts:"Accesos directos",past:"Pasado",following:"Siguiente",previous:"Anterior","prev-week":"Semana","prev-month":"Mes","prev-year":"Año",next:"Siguiente","next-week":"Semana","next-month":"Mes","next-year":"Año","less-than":"El rango no debería ser mayor de %d días","more-than":"El rango no debería ser menor de %d días","default-more":"Por favor selecciona un rango mayor a %d días","default-single":"Por favor selecciona un día","default-less":"Por favor selecciona un rango menor a %d días","default-range":"Por favor selecciona un rango entre %d y %d días","default-default":"Por favor selecciona un rango de fechas."},fr:{selected:"Sélection:",day:"Jour",days:"Jours",apply:"Fermer","week-1":"lu","week-2":"ma","week-3":"me","week-4":"je","week-5":"ve","week-6":"sa","week-7":"di","month-name":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortcuts:"Raccourcis",past:"Passé",following:"Suivant",previous:"Précédent","prev-week":"Semaine","prev-month":"Mois","prev-year":"Année",next:"Suivant","next-week":"Semaine","next-month":"Mois","next-year":"Année","less-than":"L'intervalle ne doit pas être supérieure à %d jours","more-than":"L'intervalle ne doit pas être inférieure à %d jours","default-more":"Merci de choisir une intervalle supérieure à %d jours","default-single":"Merci de choisir une date","default-less":"Merci de choisir une intervalle inférieure %d jours","default-range":"Merci de choisir une intervalle comprise entre %d et %d jours","default-default":"Merci de choisir une date"},hu:{selected:"Kiválasztva:",day:"Nap",days:"Nap",apply:"Ok","week-1":"h","week-2":"k","week-3":"sz","week-4":"cs","week-5":"p","week-6":"sz","week-7":"v","month-name":["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],shortcuts:"Gyorsválasztó",past:"Múlt",following:"Következő",previous:"Előző","prev-week":"Hét","prev-month":"Hónap","prev-year":"Év",next:"Következő","next-week":"Hét","next-month":"Hónap","next-year":"Év","less-than":"A kiválasztás nem lehet több %d napnál","more-than":"A kiválasztás nem lehet több %d napnál","default-more":"Válassz ki egy időszakot ami hosszabb mint %d nap","default-single":"Válassz egy napot","default-less":"Válassz ki egy időszakot ami rövidebb mint %d nap","default-range":"Válassz ki egy %d - %d nap hosszú időszakot","default-default":"Válassz ki egy időszakot"},it:{selected:"Selezionati:",day:"Giorno",days:"Giorni",apply:"Chiudi","week-1":"lu","week-2":"ma","week-3":"me","week-4":"gi","week-5":"ve","week-6":"sa","week-7":"do","month-name":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortcuts:"Scorciatoie",past:"Scorso",following:"Successivo",previous:"Precedente","prev-week":"Settimana","prev-month":"Mese","prev-year":"Anno",next:"Prossimo","next-week":"Settimana","next-month":"Mese","next-year":"Anno","less-than":"L'intervallo non dev'essere maggiore di %d giorni","more-than":"L'intervallo non dev'essere minore di %d giorni","default-more":"Seleziona un intervallo maggiore di %d giorni","default-single":"Seleziona una data","default-less":"Seleziona un intervallo minore di %d giorni","default-range":"Seleziona un intervallo compreso tra i %d e i %d giorni","default-default":"Seleziona un intervallo di date"},ko:{selected:"기간:",day:"일",days:"일간",apply:"닫기","week-1":"월","week-2":"화","week-3":"수","week-4":"목","week-5":"금","week-6":"토","week-7":"일","week-number":"주","month-name":["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],shortcuts:"단축키들",past:"지난(오늘기준)",following:"이후(오늘기준)",previous:"이전","prev-week":"1주","prev-month":"1달","prev-year":"1년",next:"다음","next-week":"1주","next-month":"1달","next-year":"1년","less-than":"날짜 범위는 %d 일보다 많을 수 없습니다","more-than":"날짜 범위는 %d 일보다 작을 수 없습니다","default-more":"날짜 범위를 %d 일보다 길게 선택해 주세요","default-single":"날짜를 선택해 주세요","default-less":"%d 일보다 작은 날짜를 선택해 주세요","default-range":"%d와 %d 일 사이의 날짜 범위를 선택해 주세요","default-default":"날짜 범위를 선택해 주세요",time:"시각",hour:"시",minute:"분"},no:{selected:"Valgt:",day:"Dag",days:"Dager",apply:"Lukk","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lø","week-7":"sø","month-name":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],shortcuts:"Snarveier","custom-values":"Egendefinerte Verdier",past:"Over",following:"Følger",previous:"Forrige","prev-week":"Uke","prev-month":"Måned","prev-year":"År",next:"Neste","next-week":"Uke","next-month":"Måned","next-year":"År","less-than":"Datoperioden skal ikkje være lengre enn %d dager","more-than":"Datoperioden skal ikkje være kortere enn %d dager","default-more":"Vennligst velg ein datoperiode lengre enn %d dager","default-single":"Vennligst velg ein dato","default-less":"Vennligst velg ein datoperiode mindre enn %d dager","default-range":"Vennligst velg ein datoperiode mellom %d og %d dager","default-default":"Vennligst velg ein datoperiode",time:"Tid",hour:"Time",minute:"Minutter"},nl:{selected:"Geselecteerd:",day:"Dag",days:"Dagen",apply:"Ok","week-1":"ma","week-2":"di","week-3":"wo","week-4":"do","week-5":"vr","week-6":"za","week-7":"zo","month-name":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortcuts:"Snelkoppelingen","custom-values":"Aangepaste waarden",past:"Verleden",following:"Komend",previous:"Vorige","prev-week":"Week","prev-month":"Maand","prev-year":"Jaar",next:"Volgende","next-week":"Week","next-month":"Maand","next-year":"Jaar","less-than":"Interval moet langer dan %d dagen zijn","more-than":"Interval mag niet minder dan %d dagen zijn","default-more":"Selecteer een interval langer dan %dagen","default-single":"Selecteer een datum","default-less":"Selecteer een interval minder dan %d dagen","default-range":"Selecteer een interval tussen %d en %d dagen","default-default":"Selecteer een interval",time:"Tijd",hour:"Uur",minute:"Minuut"},ru:{selected:"Выбрано:",day:"День",days:"Дней",apply:"Применить","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"вс","month-name":["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],shortcuts:"Быстрый выбор","custom-values":"Пользовательские значения",past:"Прошедшие",following:"Следующие",previous:"   ","prev-week":"Неделя","prev-month":"Месяц","prev-year":"Год",next:"   ","next-week":"Неделя","next-month":"Месяц","next-year":"Год","less-than":"Диапазон не может быть больше %d дней","more-than":"Диапазон не может быть меньше %d дней","default-more":"Пожалуйста выберите диапазон больше %d дней","default-single":"Пожалуйста выберите дату","default-less":"Пожалуйста выберите диапазон меньше %d дней","default-range":"Пожалуйста выберите диапазон между %d и %d днями","default-default":"Пожалуйста выберите диапазон",time:"Время",hour:"Часы",minute:"Минуты"},uk:{selected:"Вибрано:",day:"День",days:"Днів",apply:"Застосувати","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"нд","month-name":["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],shortcuts:"Швидкий вибір","custom-values":"Значення користувача",past:"Минулі",following:"Наступні",previous:"   ","prev-week":"Тиждень","prev-month":"Місяць","prev-year":"Рік",next:"   ","next-week":"Тиждень","next-month":"Місяць","next-year":"Рік","less-than":"Діапазон не може бути більш ніж %d днів","more-than":"Діапазон не може бути меньш ніж %d днів","default-more":"Будь ласка виберіть діапазон більше %d днів","default-single":"Будь ласка виберіть дату","default-less":"Будь ласка виберіть діапазон менше %d днів","default-range":"Будь ласка виберіть діапазон між %d та %d днями","default-default":"Будь ласка виберіть діапазон",time:"Час",hour:"Години",minute:"Хвилини"},pl:{selected:"Wybrany:",day:"Dzień",days:"Dni",apply:"Zamknij","week-1":"pon","week-2":"wt","week-3":"śr","week-4":"czw","week-5":"pt","week-6":"so","week-7":"nd","month-name":["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],shortcuts:"Skróty","custom-values":"Niestandardowe wartości",past:"Przeszłe",following:"Następne",previous:"Poprzednie","prev-week":"tydzień","prev-month":"miesiąc","prev-year":"rok",next:"Następny","next-week":"tydzień","next-month":"miesiąc","next-year":"rok","less-than":"Okres nie powinien być dłuższy niż %d dni","more-than":"Okres nie powinien być krótszy niż %d ni","default-more":"Wybierz okres dłuższy niż %d dni","default-single":"Wybierz datę","default-less":"Wybierz okres krótszy niż %d dni","default-range":"Wybierz okres trwający od %d do %d dni","default-default":"Wybierz okres",time:"Czas",hour:"Godzina",minute:"Minuta"},se:{selected:"Vald:",day:"dag",days:"dagar",apply:"godkänn","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lö","week-7":"sö","month-name":["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],shortcuts:"genvägar","custom-values":"Anpassade värden",past:"över",following:"följande",previous:"förra","prev-week":"vecka","prev-month":"månad","prev-year":"år",next:"nästa","next-week":"vecka","next-month":"måned","next-year":"år","less-than":"Datumintervall bör inte vara mindre än %d dagar","more-than":"Datumintervall bör inte vara mer än %d dagar","default-more":"Välj ett datumintervall längre än %d dagar","default-single":"Välj ett datum","default-less":"Välj ett datumintervall mindre än %d dagar","default-range":"Välj ett datumintervall mellan %d och %d dagar","default-default":"Välj ett datumintervall",time:"tid",hour:"timme",minute:"minut"},pt:{selected:"Selecionado:",day:"Dia",days:"Dias",apply:"Fechar","week-1":"seg","week-2":"ter","week-3":"qua","week-4":"qui","week-5":"sex","week-6":"sab","week-7":"dom","week-number":"N","month-name":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortcuts:"Atalhos","custom-values":"Valores Personalizados",past:"Passado",following:"Seguinte",previous:"Anterior","prev-week":"Semana","prev-month":"Mês","prev-year":"Ano",next:"Próximo","next-week":"Próxima Semana","next-month":"Próximo Mês","next-year":"Próximo Ano","less-than":"O período selecionado não deve ser maior que %d dias","more-than":"O período selecionado não deve ser menor que %d dias","default-more":"Selecione um período superior a %d dias","default-single":"Selecione uma data","default-less":"Selecione um período inferior a %d dias","default-range":"Selecione um período de %d a %d dias","default-default":"Selecione um período",time:"Tempo",hour:"Hora",minute:"Minuto"},tc:{selected:"已選擇:",day:"天",days:"天",apply:"確定","week-1":"一","week-2":"二","week-3":"三","week-4":"四","week-5":"五","week-6":"六","week-7":"日","week-number":"週","month-name":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortcuts:"快速選擇",past:"過去",following:"將來",previous:"   ","prev-week":"上週","prev-month":"上個月","prev-year":"去年",next:"   ","next-week":"下週","next-month":"下個月","next-year":"明年","less-than":"所選日期範圍不能大於%d天","more-than":"所選日期範圍不能小於%d天","default-more":"請選擇大於%d天的日期範圍","default-less":"請選擇少於%d天的日期範圍","default-range":"請選擇%d天到%d天的日期範圍","default-single":"請選擇一個日期","default-default":"請選擇一個日期範圍",time:"日期",hour:"小時",minute:"分鐘"},ja:{selected:"選択しました:",day:"日",days:"日",apply:"確定","week-1":"月","week-2":"火","week-3":"水","week-4":"木","week-5":"金","week-6":"土","week-7":"日","month-name":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],shortcuts:"クイック選択",past:"過去",following:"将来",previous:"   ","prev-week":"先週","prev-month":"先月","prev-year":"昨年",next:"   ","next-week":"来週","next-month":"来月","next-year":"来年","less-than":"日付の範囲は%d日以上にすべきではありません","more-than":"日付の範囲は%d日を下回ってはいけません","default-more":"%d日よりも長い期間を選択してください","default-less":"%d日未満の期間を選択してください","default-range":"%d日と%d日の間の日付範囲を選択してください","default-single":"日付を選択してください","default-default":"日付範囲を選択してください",time:"時間",hour:"時間",minute:"分"},da:{selected:"Valgt:",day:"Dag",days:"Dage",apply:"Luk","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lø","week-7":"sø","month-name":["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],shortcuts:"genveje","custom-values":"Brugerdefinerede værdier",past:"Forbi",following:"Følgende",previous:"Forrige","prev-week":"uge","prev-month":"måned","prev-year":"år",next:"Næste","next-week":"uge","next-month":"måned","next-year":"år","less-than":"Dato interval bør ikke være med end %d dage","more-than":"Dato interval bør ikke være mindre end %d dage","default-more":"Vælg datointerval længere end %d dage","default-single":"Vælg dato","default-less":"Vælg datointerval mindre end %d dage","default-range":"Vælg datointerval mellem %d og %d dage","default-default":"Vælg datointerval",time:"tid",hour:"time",minute:"minut"},fi:{selected:"Valittu:",day:"Päivä",days:"Päivää",apply:"Sulje","week-1":"ma","week-2":"ti","week-3":"ke","week-4":"to","week-5":"pe","week-6":"la","week-7":"su","week-number":"V","month-name":["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],shortcuts:"Pikavalinnat","custom-values":"Mukautetut Arvot",past:"Menneet",following:"Tulevat",previous:"Edellinen","prev-week":"Viikko","prev-month":"Kuukausi","prev-year":"Vuosi",next:"Seuraava","next-week":"Viikko","next-month":"Kuukausi","next-year":"Vuosi","less-than":"Aikajakson tulisi olla vähemmän kuin %d päivää","more-than":"Aikajakson ei tulisi olla vähempää kuin %d päivää","default-more":"Valitse pidempi aikajakso kuin %d päivää","default-single":"Valitse päivä","default-less":"Valitse lyhyempi aikajakso kuin %d päivää","default-range":"Valitse aikajakso %d ja %d päivän väliltä","default-default":"Valitse aikajakso",time:"Aika",hour:"Tunti",minute:"Minuutti"},cat:{selected:"Seleccionats:",day:"Dia",days:"Dies",apply:"Tanca","week-1":"Dl","week-2":"Dm","week-3":"Dc","week-4":"Dj","week-5":"Dv","week-6":"Ds","week-7":"Dg","week-number":"S","month-name":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],shortcuts:"Dreçeres","custom-values":"Valors personalitzats",past:"Passat",following:"Futur",previous:"Anterior","prev-week":"Setmana","prev-month":"Mes","prev-year":"Any",next:"Següent","next-week":"Setmana","next-month":"Mes","next-year":"Any","less-than":"El període no hauria de ser de més de %d dies","more-than":"El període no hauria de ser de menys de %d dies","default-more":"Perfavor selecciona un període més gran de %d dies","default-single":"Perfavor selecciona una data","default-less":"Perfavor selecciona un període de menys de %d dies","default-range":"Perfavor selecciona un període d'entre %d i %d dies","default-default":"Perfavor selecciona un període",time:"Temps",hour:"Hora",minute:"Minut"},sk:{selected:"Vybrané:",day:"Deň",days:"Dni",apply:"Zavrieť","week-1":"po","week-2":"út","week-3":"st","week-4":"št","week-5":"pi","week-6":"so","week-7":"ne","week-number":"T","month-name":["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"],shortcuts:"Skratky","custom-values":"Vlastné hodnoty",past:"po",following:"nasledujúci",previous:"predchádzajúci","prev-week":"týždeň","prev-month":"mesiac","prev-year":"rok",next:"ďalší","next-week":"týždeň","next-month":"mesiac","next-year":"rok","less-than":"Rozsah dátumu by nemal byť väčší ako %d dní","more-than":"Rozsah dátumu by nemal byť menší ako %d dní","default-more":"Prosím zvoľte rozsah dlhší ako %d dní","default-single":"Prosím zvoľte dátum","default-less":"Prosím zvoľte rozsah menší ako %d dní","default-range":"Prosím zvoľte rozsah medzi %d a %d dňami","default-default":"Prosím zvoľte rozsah",time:"Čas",hour:"Hodina",minute:"Minúta"}},U.fn.dateRangePicker=function(f){f||(f={}),(f=U.extend(!0,{autoClose:!1,format:"YYYY-MM-DD",separator:" to ",language:"auto",startOfWeek:"sunday",getValue:function(){return U(this).val()},setValue:function(e){U(this).attr("readonly")||U(this).is(":disabled")||e==U(this).val()||U(this).val(e)},startDate:!1,endDate:!1,time:{enabled:!1},minDays:0,maxDays:0,showShortcuts:!1,shortcuts:{},customShortcuts:[],inline:!1,container:"body",alwaysOpen:!1,singleDate:!1,lookBehind:!1,batchMode:!1,duration:200,stickyMonths:!1,dayDivAttrs:[],dayTdAttrs:[],selectForward:!1,selectBackward:!1,applyBtnClass:"",singleMonth:"auto",hoveringTooltip:function(e,t,a){return 1'+f.customTopBar+""):(t+='

    ",t+='
    error
    default
    '),t+='',t+="");var a=f.showWeekNumbers?6:5,n="<";f.customArrowPrevSymbol&&(n=f.customArrowPrevSymbol);var r=">";if(f.customArrowNextSymbol&&(r=f.customArrowNextSymbol),t+='
    '+E()+"
    '+n+' '+(f.singleDate||!f.stickyMonths?''+r+"":"")+'
    ",f.singleMonth||(t+='
    '+function(){for(var e=['
    '],t=0;t<20;t++)e.push('
    ');return e.push("
    "),e.join("")}()+'
    '+E()+"
    '+(f.stickyMonths?"":''+n+"")+' '+r+'
    "),t+='
    ',f.singleDate||(t+='
    '),t+='
    ',t+='
    ")}().hide()).append('
    '),U(f.container).append(m),f.inline?m.addClass("inline-wrapper"):i();f.alwaysOpen&&m.find(".apply-btn").hide();var e=_();if(G(e),f.time.enabled)if(f.startDate&&f.endDate||f.start&&f.end)Y(Q(f.start||f.startDate).toDate(),"time1"),Y(Q(f.end||f.endDate).toDate(),"time2");else{var a=f.defaultEndTime?f.defaultEndTime:e;Y(e,"time1"),Y(a,"time2")}var n="";n=f.singleDate?K("default-single"):f.minDays&&f.maxDays?K("default-range"):f.minDays?K("default-more"):f.maxDays?K("default-less"):K("default-default");m.find(".default-top").html(n.replace(/\%d/,f.minDays).replace(/\%d/,f.maxDays)),f.singleMonth?m.addClass("single-month"):m.addClass("two-months");setTimeout(function(){l(),s=!0},0),m.on("click",function(e){e.stopPropagation()}),U(document).on("click.datepicker",Z),m.find(".next").on("click",function(){f.stickyMonths?function(e){var t=F(f.month1),a=F(f.month2);if(q(a))return;if(!f.singleDate&&0<=L(t,a))return;O(t,"month1"),O(a,"month2"),C()}():function(e){var t=U(e).parents("table").hasClass("month2"),a=t?f.month2:f.month1;if(a=F(a),!f.singleMonth&&!f.singleDate&&!t&&0<=L(a,f.month2)||q(a))return;O(a,t?"month2":"month1"),I()}(this)}),m.find(".prev").on("click",function(){f.stickyMonths?function(e){var t=R(f.month1),a=R(f.month2);if(q(t))return;if(!f.singleDate&&L(a,t)<=0)return;O(a,"month2"),O(t,"month1"),C()}():function(e){var t=U(e).parents("table").hasClass("month2"),a=t?f.month2:f.month1;if(a=R(a),t&&L(a,f.month1)<=0||q(a))return;O(a,t?"month2":"month1"),I()}(this)}),m.attr("unselectable","on").css("user-select","none").on("selectstart",function(e){return e.preventDefault(),!1}),m.find(".apply-btn").on("click",function(){B();var e=W(new Date(f.start))+f.separator+W(new Date(f.end));U(t).trigger("datepicker-apply",{value:e,date1:new Date(f.start),date2:new Date(f.end)})}),m.find("[custom]").on("click",function(){var e=U(this).attr("custom");f.start=!1,f.end=!1,m.find(".day.checked").removeClass("checked"),f.setValue.call(o,e),M(),S(!0),C(),f.autoClose&&B()}),m.find("[shortcut]").on("click",function(){var e,t=U(this).attr("shortcut"),a=new Date,n=!1;if(-1!=t.indexOf("day")){var r=parseInt(t.split(",",2)[1],10);n=new Date((new Date).getTime()+864e5*r),a=new Date(a.getTime()+864e5*(0f.end){var a=f.end;f.end=v(f.start),f.start=p(a),f.time.enabled&&f.swapTime&&(u("time1",f.start),u("time2",f.end))}f.start=parseInt(f.start),f.end=parseInt(f.end),b(),f.start&&!f.end&&(U(n).trigger("datepicker-first-date-selected",{date1:new Date(f.start)}),y(e)),w(),M(),S(),C(),x()}}function g(e){if(e=parseInt(e,10),f.startDate&&H(e,f.startDate)<0)return!1;if(f.endDate&&0f.maxDays)return!1;if(0f.start)return!1;if(f.beforeShowDay&&"function"==typeof f.beforeShowDay){for(var t=!0,a=e;1f.start&&(a-=864e5),a'+e.attr("data-tooltip")+"";else if(!e.hasClass("invalid"))if(f.singleDate)m.find(".day.hovering").removeClass("hovering"),e.addClass("hovering");else if(m.find(".day").each(function(){var e=parseInt(U(this).attr("time"));f.start,f.end;e==t?U(this).addClass("hovering"):U(this).removeClass("hovering"),f.start&&!f.end&&(f.starte&&t<=e)?U(this).addClass("hovering"):U(this).removeClass("hovering")}),f.start&&!f.end){var n=z(t,f.start);f.hoveringTooltip&&("function"==typeof f.hoveringTooltip?a=f.hoveringTooltip(n,f.start,t):!0===f.hoveringTooltip&&1f.maxDays?(f.start=!1,f.end=!1,m.find(".day").removeClass("checked"),m.find(".drp_top-bar").removeClass("normal").addClass("error").find(".error-top").html(K("less-than").replace("%d",f.maxDays))):f.minDays&&et.getTime()){var n=t;t=e,e=n,n=null}var r=!0;if(f.startDate&&H(e,f.startDate)<0&&(r=!1),f.endDate&&0'+A(a)+"";if(!f.monthSelect)return n;var r=!!f.startDate&&Q(f.startDate).add(f.singleMonth||"month2"!==t?0:1,"month"),s=!!f.endDate&&Q(f.endDate).add(f.singleMonth||"month1"!==t?0:-1,"month"),o=r&&e.isSame(r,"year")?r.get("month"):0,i=s&&e.isSame(s,"year")?s.get("month"):11,d=Math.min(o,a),l=Math.max(i,a);if(d===l)return n;return P("month",V({minSelectable:o,maxSelectable:i,minVisible:d,maxVisible:l},a,function(e){return A(e)}))}(e=Q(e).toDate(),t),n=function(e,t){var a=(e=Q(e)).get("year"),n='
    '+a+"
    ";if(!f.yearSelect)return n;var r=f.yearSelect&&"function"==typeof f.yearSelect,s=!!f.startDate&&Q(f.startDate).add(f.singleMonth||"month2"!==t?0:1,"month"),o=!!f.endDate&&Q(f.endDate).add(f.singleMonth||"month1"!==t?0:-1,"month"),i=r?f.yearSelect(a):f.yearSelect.slice(),d=s?Math.max(i[0],s.get("year")):Math.min(i[0],a),l=o?Math.min(i[1],o.get("year")):Math.max(i[1],a),u=Math.min(d,a),m=Math.max(l,a);if(u===m)return n;return P("year",V({minSelectable:d,maxSelectable:l,minVisible:u,maxVisible:m},a))}(e,t);m.find("."+t+" .month-name").html(a+" "+n),m.find("."+t+" tbody").html(function(e){var t=[];e.setDate(1);new Date(e.getTime()-864e5);var a,n,r=new Date,s=e.getDay();0===s&&"monday"===f.startOfWeek&&(s=7);if(0");for(var i=0;i<7;i++){var m="monday"==f.startOfWeek?i+1:i;a=t[7*u+m];var h=Q(a.time).format("L")==Q(r).format("L");if(a.extraClass="",a.tooltip="",a.valid&&f.beforeShowDay&&"function"==typeof f.beforeShowDay){var c=f.beforeShowDay(Q(a.time).toDate());a.valid=c[0],a.extraClass=c[1]||"",a.tooltip=c[2]||"",""!==a.tooltip&&(a.extraClass+=" has-tooltip ")}var p={time:a.time,"data-tooltip":a.tooltip,class:"day "+a.type+" "+a.extraClass+" "+(a.valid?"valid":"invalid")+" "+(h?"real-today":"")};0===i&&f.showWeekNumbers&&l.push('
    '+f.getWeekNumber(a.date)+"
    "),l.push("
    "+J(a.time,a.day)+"
    ")}l.push("")}return l.join("")}(e)),f[t]=e,w(),m.find(".day").off("click").on("click",function(e){k(U(this))}),m.find(".day").off("mouseenter").on("mouseenter",function(e){y(U(this))}),m.find(".day").off("mouseleave").on("mouseleave",function(e){m.find(".date-range-length-tip").hide(),f.singleDate&&b()}),m.find(".week-number").off("click").on("click",function(e){var t,a,n,r;t=U(this),r=parseInt(t.attr("data-start-time"),10),f.startWeek?(m.find(".week-number-selected").removeClass("week-number-selected"),a=new Date(re.maxSelectable});return n}function P(e,t){for(var a,n='
    "+a+"
    "}function Y(e,t){m.find("."+t).append("
    "+K("Time")+': 00:00
    '),u(t,e)}function A(e){return K("month-name")[e]}function W(e){return Q(e).format(f.format)}function I(){C();var e=parseInt(Q(f.month1).format("YYYYMM")),t=parseInt(Q(f.month2).format("YYYYMM")),a=Math.abs(e-t);1"+K("week-number")+"":"";return"monday"==f.startOfWeek?e+""+K("week-1")+""+K("week-2")+""+K("week-3")+""+K("week-4")+""+K("week-5")+""+K("week-6")+""+K("week-7")+"":e+""+K("week-7")+""+K("week-1")+""+K("week-2")+""+K("week-3")+""+K("week-4")+""+K("week-5")+""+K("week-6")+""}function q(e){return e=Q(e),!(!f.startDate||!e.endOf("month").isBefore(f.startDate))||!(!f.endDate||!e.startOf("month").isAfter(f.endDate))}function $(e,t,r){var s=U.extend(!0,{},e);U.each(t,function(e,t){var a=t(r);for(var n in a)s.hasOwnProperty(n)?s[n]+=a[n]:s[n]=a[n]});var a="";for(var n in s)s.hasOwnProperty(n)&&(a+=n+'="'+s[n]+'" ');return a}function J(e,t){return f.showDateFilter&&"function"==typeof f.showDateFilter?f.showDateFilter(e,t):t}function K(e){var t=e.toLowerCase(),a=e in r?r[e]:t in r?r[t]:null,n=U.dateRangePickerLanguages.default;return null==a&&(a=e in n?n[e]:t in n?n[t]:""),a}function _(){var e=f.defaultTime?f.defaultTime:new Date;return f.lookBehind?(f.startDate&&L(e,f.startDate)<0&&(e=F(Q(f.startDate).toDate())),f.endDate&&0'+c.customTopBar+""):(e+='
    '+W("selected")+' ...',c.singleDate||(e+=' '+c.separator+' ... (3 '+W("days")+")"),e+='
    error
    default
    '),e=e+('');var t=c.showWeekNumbers?6:5,a="<";c.customArrowPrevSymbol&&(a=c.customArrowPrevSymbol);var n,s=">";c.customArrowNextSymbol&&(s=c.customArrowNextSymbol);e+='
    '+$()+"
    '+a+' '+(c.singleDate||!c.stickyMonths?''+s+"":"")+'
    ",c.singleMonth||(e+='
    '+function(){for(var e=['
    '],t=0;t<20;t++)e.push('
    ');return e.push("
    "),e.join("")}()+'
    '+$()+"
    '+(c.stickyMonths?"":''+a+"")+' '+s+'
    ");e+='
    ',c.singleDate||(e+='
    ');if(e+='
    ")}().hide()).append('
    '),Z(c.container).append(l),c.inline?l.addClass("inline-wrapper"):i(),c.alwaysOpen&&l.find(".apply-btn").hide(),t=K(),_(t),c.time.enabled&&(c.startDate&&c.endDate||c.start&&c.end?(z(U(c.start||c.startDate).toDate(),"time1"),z(U(c.end||c.endDate).toDate(),"time2")):(e=c.defaultEndTime||t,z(t,"time1"),z(e,"time2"))),t="",t=c.singleDate?W("default-single"):c.minDays&&c.maxDays?W("default-range"):c.minDays?W("default-more"):c.maxDays?W("default-less"):W("default-default"),l.find(".default-top").html(t.replace(/\%d/,c.minDays).replace(/\%d/,c.maxDays)),c.singleMonth?l.addClass("single-month"):l.addClass("two-months"),setTimeout(function(){u(),n=!0},0),l.on("click",function(e){e.stopPropagation()}),Z(document).on("click.datepicker",G),l.find(".next").on("click",function(){var e,t;c.stickyMonths?(e=P(c.month1),A(t=P(c.month2))||!c.singleDate&&0<=O(e,t)||(S(e,"month1"),S(t,"month2"),M())):(e=Z(e=this).parents("table").hasClass("month2"),t=P(t=e?c.month2:c.month1),!c.singleMonth&&!c.singleDate&&!e&&0<=O(t,c.month2)||A(t)||(S(t,e?"month2":"month1"),C()))}),l.find(".prev").on("click",function(){var e,t;c.stickyMonths?(t=Y(c.month1),e=Y(c.month2),A(t)||!c.singleDate&&O(e,t)<=0||(S(e,"month2"),S(t,"month1"),M())):(e=Z(e=this).parents("table").hasClass("month2"),t=Y(t=e?c.month2:c.month1),e&&O(t,c.month1)<=0||A(t)||(S(t,e?"month2":"month1"),C()))}),l.attr("unselectable","on").css("user-select","none").on("selectstart",function(e){return e.preventDefault(),!1}),l.find(".apply-btn").on("click",function(){T();var e=j(new Date(c.start))+c.separator+j(new Date(c.end));Z(a).trigger("datepicker-apply",{value:e,date1:new Date(c.start),date2:new Date(c.end)})}),l.find("[custom]").on("click",function(){var e=Z(this).attr("custom");c.start=!1,c.end=!1,l.find(".day.checked").removeClass("checked"),c.setValue.call(o,e),y(),b(!0),M(),c.autoClose&&T()}),l.find("[shortcut]").on("click",function(){var e=Z(this).attr("shortcut"),t=new Date,a=!1;if(-1!=e.indexOf("day"))var n=parseInt(e.split(",",2)[1],10),a=new Date((new Date).getTime()+864e5*n),t=new Date(t.getTime()+864e5*(0c.end&&(t=c.end,c.end=v(c.start),c.start=f(t),c.time.enabled)&&c.swapTime&&(m("time1",c.start),m("time2",c.end)),c.start=parseInt(c.start),c.end=parseInt(c.end),N(),c.start&&!c.end&&(Z(r).trigger("datepicker-first-date-selected",{date1:new Date(c.start)}),B(e)),g(),y(),b(),M(),w())}function k(e){if(e=parseInt(e,10),c.startDate&&V(e,c.startDate)<0)return!1;if(c.endDate&&0c.maxDays)return!1;if(0c.start)return!1;if(c.beforeShowDay&&"function"==typeof c.beforeShowDay){for(var t=!0,a=e;1c.start&&(a-=864e5),a'+e.attr("data-tooltip")+"":e.hasClass("invalid")||(c.singleDate?(l.find(".day.hovering").removeClass("hovering"),e.addClass("hovering")):(l.find(".day").each(function(){var e=parseInt(Z(this).attr("time"));c.start,c.end;e==o?Z(this).addClass("hovering"):Z(this).removeClass("hovering"),c.start&&!c.end&&(c.starte&&o<=e)?Z(this).addClass("hovering"):Z(this).removeClass("hovering")}),c.start&&!c.end&&(s=D(o,c.start),c.hoveringTooltip)&&("function"==typeof c.hoveringTooltip?i=c.hoveringTooltip(s,c.start,o):!0===c.hoveringTooltip&&1c.maxDays?(c.start=!1,c.end=!1,l.find(".day").removeClass("checked"),l.find(".drp_top-bar").removeClass("normal").addClass("error").find(".error-top").html(W("less-than").replace("%d",c.maxDays))):c.minDays&&et.getTime()&&(n=t,t=e,e=n,n=null);var n=!0;c.startDate&&V(e,c.startDate)<0&&(n=!1),((n=!(c.endDate&&0'+q(s)+"";var a,n,s,r,o,i=c.monthSelect&&(i=!!c.startDate&&U(c.startDate).add(c.singleMonth||"month2"!==a?0:1,"month"),a=!!c.endDate&&U(c.endDate).add(c.singleMonth||"month1"!==a?0:-1,"month"),i=i&&n.isSame(i,"year")?i.get("month"):0,n=a&&n.isSame(a,"year")?a.get("month"):11,a=Math.min(i,s),o=Math.max(n,s),a!==o)?R("month",F({minSelectable:i,maxSelectable:n,minVisible:a,maxVisible:o},s,q)):d,d=(n=t,a=(a=U(a=e)).get("year"),o='
    '+a+"
    ",c.yearSelect&&(s=c.yearSelect&&"function"==typeof c.yearSelect,d=!!c.startDate&&U(c.startDate).add(c.singleMonth||"month2"!==n?0:1,"month"),n=!!c.endDate&&U(c.endDate).add(c.singleMonth||"month1"!==n?0:-1,"month"),s=s?c.yearSelect(a):c.yearSelect.slice(),d=d?Math.max(s[0],d.get("year")):Math.min(s[0],a),n=n?Math.min(s[1],n.get("year")):Math.max(s[1],a),s=Math.min(d,a),r=Math.max(n,a),s!==r)?R("year",F({minSelectable:d,maxSelectable:n,minVisible:s,maxVisible:r},a)):o);l.find("."+t+" .month-name").html(i+" "+d),l.find("."+t+" tbody").html(function(e){var t,a,n=[],s=(e.setDate(1),new Date(e.getTime()-864e5),new Date),r=e.getDay();0===r&&"monday"===c.startOfWeek&&(r=7);if(0");for(i=0;i<7;i++){var m="monday"==c.startOfWeek?i+1:i,m=U((t=n[7*u+m]).time).format("L")==U(s).format("L"),h=(t.extraClass="",t.tooltip="",t.valid&&c.beforeShowDay&&"function"==typeof c.beforeShowDay&&(h=c.beforeShowDay(U(t.time).toDate()),t.valid=h[0],t.extraClass=h[1]||"",t.tooltip=h[2]||"",""!==t.tooltip)&&(t.extraClass+=" has-tooltip "),{time:t.time,"data-tooltip":t.tooltip,class:"day "+t.type+" "+t.extraClass+" "+(t.valid?"valid":"invalid")+" "+(m?"real-today":"")});0===i&&c.showWeekNumbers&&l.push('
    '+c.getWeekNumber(t.date)+"
    "),l.push("
    "+function(e,t){return c.showDateFilter&&"function"==typeof c.showDateFilter?c.showDateFilter(e,t):t}(t.time,t.day)+"
    ")}l.push("")}return l.join("")}(e)),c[t]=e,g(),l.find(".day").off("click").on("click",function(e){I(Z(this))}),l.find(".day").off("mouseenter").on("mouseenter",function(e){B(Z(this))}),l.find(".day").off("mouseleave").on("mouseleave",function(e){l.find(".date-range-length-tip").hide(),c.singleDate&&N()}),l.find(".week-number").off("click").on("click",function(e){var t,a,n,s;t=Z(this),s=parseInt(t.attr("data-start-time"),10),c.startWeek?(l.find(".week-number-selected").removeClass("week-number-selected"),a=new Date(se.maxSelectable});return n}function R(e,t){for(var a,n='
    "+a+"
    "}function z(e,t){l.find("."+t).append("
    "+W("Time")+': 00:00
    '),m(t,e)}function q(e){return W("month-name")[e]}function j(e){return U(e).format(c.format)}function C(){M();var e=parseInt(U(c.month1).format("YYYYMM")),t=parseInt(U(c.month2).format("YYYYMM")),e=Math.abs(e-t),t=(1"+W("week-number")+"":"";return"monday"==c.startOfWeek?e+""+W("week-1")+""+W("week-2")+""+W("week-3")+""+W("week-4")+""+W("week-5")+""+W("week-6")+""+W("week-7")+"":e+""+W("week-7")+""+W("week-1")+""+W("week-2")+""+W("week-3")+""+W("week-4")+""+W("week-5")+""+W("week-6")+""}function A(e){return e=U(e),c.startDate&&e.endOf("month").isBefore(c.startDate)||!(!c.endDate||!e.startOf("month").isAfter(c.endDate))}function J(e,t,s){var a,r=Z.extend(!0,{},e),n=(Z.each(t,function(e,t){var a,n=t(s);for(a in n)r.hasOwnProperty(a)?r[a]+=n[a]:r[a]=n[a]}),"");for(a in r)r.hasOwnProperty(a)&&(n+=a+'="'+r[a]+'" ');return n}function W(e){var t=e.toLowerCase(),a=e in s?s[e]:t in s?s[t]:null,n=Z.dateRangePickerLanguages.default;return a=null==a?e in n?n[e]:t in n?n[t]:"":a}function K(){var e=c.defaultTime||new Date;return c.lookBehind?(c.startDate&&O(e,c.startDate)<0&&(e=P(U(c.startDate).toDate())),c.endDate&&0 Date: Mon, 3 Jun 2024 12:25:02 +0530 Subject: [PATCH 044/103] =?UTF-8?q?Fixed:=20OPC=20page=20not=20opening=20w?= =?UTF-8?q?hen=20installed=20QloApps=20in=20=C4=8Ce=C5=A1tina=20(Czech)=20?= =?UTF-8?q?language?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/langs/cs/data/meta.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/langs/cs/data/meta.xml b/install/langs/cs/data/meta.xml index 8aea57f69..fee7a64b4 100644 --- a/install/langs/cs/data/meta.xml +++ b/install/langs/cs/data/meta.xml @@ -145,10 +145,10 @@ prodejny - Objednávka + Rychlá Objednávka - objednavka + rychla-objednavka Sledování objednávky návštěvníka From fce36b9d6e022ac86bde654500a4f690cca346ba Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 5 Jun 2024 14:51:13 +0530 Subject: [PATCH 045/103] Fixed: Cookie not updating in browser when url contains parenthesis --- classes/Cookie.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 0edb66672..312837ee1 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -89,8 +89,9 @@ class CookieCore $this->_path = '/'.$this->_path; } $this->_path = rawurlencode($this->_path); - $this->_path = str_replace('%2F', '/', $this->_path); - $this->_path = str_replace('%7E', '~', $this->_path); + $search = array('%2F', '%7E', '%28', '%29'); + $replace = array('/', '~', '(', ')'); + $this->_path = str_replace($search, $replace, $this->_path); $this->_domain = $this->getDomain($shared_urls); $this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE'); $this->_name = 'QloApps-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain); From c98def9446f226b9d7a746c7184bb2ced60e363f Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 6 Jun 2024 13:04:03 +0530 Subject: [PATCH 046/103] Fixed: Invalid Extra service price when a room with services is deleted from order --- classes/Cart.php | 1 - controllers/admin/AdminOrdersController.php | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 6bd68b361..8401a36b9 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -2380,7 +2380,6 @@ class CartCore extends ObjectModel $array = array(); foreach($selectedServiceProducts as $selectedProduct) { if (isset($array[$selectedProduct['id_hotel']])) { - $array[$selectedProduct['id_hotel']]['quantity'] += $selectedProduct['quantity']; $array[$selectedProduct['id_hotel']]['total_price_tax_excl'] += $selectedProduct['total_price_tax_excl']; $array[$selectedProduct['id_hotel']]['total_price_tax_incl'] += $selectedProduct['total_price_tax_incl']; } else { diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 3cfdfdf15..616c8ab97 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -5371,20 +5371,23 @@ class AdminOrdersControllerCore extends AdminController // update order detail for selected aditional services foreach ($selectedAdditonalServices['additional_services'] as $service) { $serviceOrderDetail = new OrderDetail($service['id_order_detail']); - if ($service['quantity'] >= $serviceOrderDetail->product_quantity) { + + $cart_quantity = $service['quantity']; + if ($service['product_price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY) { + $cart_quantity = $cart_quantity * $product_quantity; + } + if ($cart_quantity >= $serviceOrderDetail->product_quantity) { $serviceOrderDetail->delete(); } else { - $order_detail->total_price_tax_incl -= Tools::ps_round($service['total_price_tax_incl'], 6); - $order_detail->total_price_tax_excl -= Tools::ps_round($service['total_price_tax_excl'], 6); - - $serviceOldQuantity = $serviceOrderDetail->product_quantity; - $serviceOrderDetail->product_quantity = $serviceOldQuantity - $service['quantity']; + $serviceOrderDetail->total_price_tax_incl -= Tools::ps_round($service['total_price_tax_incl'], 6); + $serviceOrderDetail->total_price_tax_excl -= Tools::ps_round($service['total_price_tax_excl'], 6); + $serviceOrderDetail->product_quantity -= $cart_quantity; // update taxes - $res &= $order_detail->updateTaxAmount($order); + $res &= $serviceOrderDetail->updateTaxAmount($order); // Save order detail - $res &= $order_detail->update(); + $res &= $serviceOrderDetail->update(); } } /*End*/ From e8551769b87221eda98f65acb166216a9c8cd4a8 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 6 Jun 2024 19:47:06 +0530 Subject: [PATCH 047/103] Added: Different Advance price rule for different group for same date ranges --- .../classes/HotelRoomTypeFeaturePricing.php | 46 +++++++++++-------- .../admin/AdminHotelFeaturePricesSettings.php | 11 ++++- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index 5dbfbd1db..a49d60ec1 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -180,6 +180,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $id_product, $date_from, $date_to, + $groups, $type = 'date_range', $current_Special_days = false, $id_feature_price = 0 @@ -188,20 +189,26 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $date_to = date('Y-m-d', strtotime($date_to)); if ($type == 'specific_date') { return Db::getInstance()->getRow( - 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` - WHERE `id_product`='.(int) $id_product.' AND `active`=1 - AND `date_selection_type` = '.(int) self::DATE_SELECTION_TYPE_SPECIFIC.' - AND `date_from` = \''.pSQL($date_from).'\' - AND `id_feature_price`!='.(int) $id_feature_price + 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` rtfp + INNER JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_group` rtfpg + ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price`) + WHERE rtfp.`id_product`='.(int) $id_product.' AND rtfp.`active`=1 + AND rtfp.`date_selection_type` = '.(int) self::DATE_SELECTION_TYPE_SPECIFIC.' + AND rtfp.`date_from` = \''.pSQL($date_from).'\' + AND rtfp.`id_feature_price`!='.(int) $id_feature_price.' + AND rtfpg.`id_group` IN ('.pSQL(implode(', ',$groups)).')' ); } elseif ($type == 'special_day') { $featurePrices = Db::getInstance()->executeS( - 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` - WHERE `id_product`='.(int) $id_product.' - AND `is_special_days_exists`=1 AND `active`=1 - AND `date_from` < \''.pSQL($date_to).'\' - AND `date_to` > \''.pSQL($date_from).'\' - AND `id_feature_price`!='.(int) $id_feature_price + 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` rtfp + INNER JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_group` rtfpg + ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price`) + WHERE rtfp.`id_product`='.(int) $id_product.' + AND rtfp.`is_special_days_exists`=1 AND `active`=1 + AND rtfp.`date_from` < \''.pSQL($date_to).'\' + AND rtfp.`date_to` > \''.pSQL($date_from).'\' + AND rtfp.`id_feature_price`!='.(int) $id_feature_price.' + AND rtfpg.`id_group` IN ('.pSQL(implode(', ',$groups)).')' ); if ($featurePrices) { foreach ($featurePrices as $featurePrice) { @@ -216,13 +223,16 @@ class HotelRoomTypeFeaturePricing extends ObjectModel return false; } elseif ($type == 'date_range') { return Db::getInstance()->getRow( - 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` - WHERE `id_product`='.(int) $id_product.' AND `active`=1 - AND `date_selection_type` = '.(int) self::DATE_SELECTION_TYPE_RANGE.' - AND `is_special_days_exists`=0 - AND `date_from` <= \''.pSQL($date_to).'\' - AND `date_to` >= \''.pSQL($date_from).'\' - AND `id_feature_price`!='.(int) $id_feature_price + 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` rtfp + INNER JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_group` rtfpg + ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price`) + WHERE rtfp.`id_product`='.(int) $id_product.' AND rtfp.`active`=1 + AND rtfp.`date_selection_type` = '.(int) self::DATE_SELECTION_TYPE_RANGE.' + AND rtfp.`is_special_days_exists`=0 + AND rtfp.`date_from` <= \''.pSQL($date_to).'\' + AND rtfp.`date_to` >= \''.pSQL($date_from).'\' + AND rtfp.`id_feature_price`!='.(int) $id_feature_price.' + AND rtfpg.`id_group` IN ('.pSQL(implode(', ',$groups)).')' ); } return false; diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php index d77a293a2..0652f90c7 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php @@ -182,6 +182,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $objFeaturePricing->id_product, $objFeaturePricing->date_from, $objFeaturePricing->date_to, + $objFeaturePricing->getGroups($objFeaturePricing->id), $objFeaturePricing->id, $objFeaturePricing->is_special_days_exists, $objFeaturePricing->special_days @@ -283,6 +284,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $roomTypeId, $dateFrom, $dateTo, + $group, $idFeaturePrice, $isSpecialDaysExists = false, $jsonSpecialDays = "false" @@ -293,6 +295,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $roomTypeId, $dateFrom, $dateTo, + $group, 'specific_date', false, $idFeaturePrice @@ -302,6 +305,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $roomTypeId, $dateFrom, $dateTo, + $group, 'special_day', $jsonSpecialDays, $idFeaturePrice @@ -311,6 +315,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $roomTypeId, $dateFrom, $dateTo, + $group, 'date_range', false, $idFeaturePrice @@ -335,6 +340,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $impactValue = Tools::getValue('impact_value'); $dateSelectionType = Tools::getValue('date_selection_type'); $specificDate = date('Y-m-d', strtotime(Tools::getValue('specific_date'))); + $groups = Tools::getValue('groupBox'); $jsonSpecialDays = json_encode($specialDays); $defaultLangId = Configuration::get('PS_LANG_DEFAULT'); @@ -361,6 +367,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $roomTypeId, $dateFrom, $dateTo, + $groups, $idFeaturePrice, $isSpecialDaysExists, $jsonSpecialDays @@ -435,7 +442,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController } } - if (!(bool)Tools::getValue('groupBox')) { + if (!(bool)$groups) { $this->errors[] = $this->l('Please select at least one group for the group access'); } @@ -467,7 +474,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController $objFeaturePricing->active = $enableFeaturePrice; // set the values of the groups for this feature price - $objFeaturePricing->groupBox = Tools::getValue('groupBox'); + $objFeaturePricing->groupBox = $groups; if ($objFeaturePricing->save()) { if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) { From 9b13577cdab8e58c73872d04c6f9d0a98a269472 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 6 Jun 2024 20:12:31 +0530 Subject: [PATCH 048/103] Remove: Retail price field with tax from manage service product panel --- .../controllers/normal_products/prices.tpl | 4 +-- js/admin/price.js | 25 ++++++++----------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/admin/themes/default/template/controllers/normal_products/prices.tpl b/admin/themes/default/template/controllers/normal_products/prices.tpl index 9fc108e17..f49068ca7 100644 --- a/admin/themes/default/template/controllers/normal_products/prices.tpl +++ b/admin/themes/default/template/controllers/normal_products/prices.tpl @@ -200,7 +200,7 @@ $(document).ready(function () { -
    auto_add_to_cart && $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}style="display:none"{/if}> + {*
    auto_add_to_cart && $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}style="display:none"{/if}>
    {$currency->prefix}{$currency->suffix} @@ -208,7 +208,7 @@ $(document).ready(function () {
    {if isset($pack) && $pack->isPack($product->id)}

    {l s='The sum of prices of the products in the pack is %s%s%s' sprintf=[$currency->prefix,{toolsConvertPrice price=$pack->noPackPrice($product->id)|string_format:$priceDisplayPrecisionFormat},$currency->suffix]}

    {/if} -
    +
    *}
    {/foreach} - + {if $occupancy_required_for_booking} @@ -138,7 +138,7 @@ {$allotment_type.name|escape:'htmlall':'UTF-8'} {/foreach} - + {if $occupancy_required_for_booking} From 08d9017845a894307685f73e815030adcfe43dba Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 11 Jun 2024 12:02:44 +0530 Subject: [PATCH 050/103] applied changes to the new uploaded files after merge --- .../wkroomsearchblock/views/templates/front/hotel-options.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wkroomsearchblock/views/templates/front/hotel-options.tpl b/modules/wkroomsearchblock/views/templates/front/hotel-options.tpl index b6dd9cd0d..1c258d2c8 100644 --- a/modules/wkroomsearchblock/views/templates/front/hotel-options.tpl +++ b/modules/wkroomsearchblock/views/templates/front/hotel-options.tpl @@ -20,7 +20,7 @@ {if isset($hotels_info) && is_array($hotels_info)} {foreach from=$hotels_info item=hotel_info} - {/foreach} From e7c85cd15424cfa48b93175dfeab5f9ea4df8903 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 12 Jun 2024 11:28:54 +0530 Subject: [PATCH 051/103] Fixed: Hotel locations is displayed on the google map at order-detail and category page even if option 'Display Google Maps For Hotel Location' is disabled --- controllers/front/GuestTrackingController.php | 4 +++- controllers/front/OrderDetailController.php | 5 ++++- .../admin/AdminHotelGeneralSettingsController.php | 2 +- modules/hotelreservationsystem/hotelreservationsystem.php | 4 +++- themes/hotel-reservation-theme/order-detail.tpl | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index e7017e12f..b58af864e 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -629,7 +629,9 @@ class GuestTrackingControllerCore extends FrontController if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($objOrder->id)) { $objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id); if (Validate::isLoadedObject($objHotelBranchInformation)) { - if ($apiKey = Configuration::get('PS_API_KEY')) { + if (($apiKey = Configuration::get('PS_API_KEY')) + && Configuration::get('WK_GOOGLE_ACTIVE_MAP') + ) { if (floatval($objHotelBranchInformation->latitude) != 0 && floatval($objHotelBranchInformation->longitude) != 0 ) { diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index afa1ea9e8..ed11b9cc3 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -406,6 +406,7 @@ class OrderDetailControllerCore extends FrontController 'obj_hotel_branch_information' => $objHotelBranchInformation, 'hotel_address_info' => $hotelAddressInfo, 'hotel_refund_rules' => $hotelRefundRules, + 'view_on_google_map' => Configuration::get('WK_GOOGLE_ACTIVE_MAP'), ) ); // } @@ -782,7 +783,9 @@ class OrderDetailControllerCore extends FrontController if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder(Tools::getValue('id_order'))) { $objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id); if (Validate::isLoadedObject($objHotelBranchInformation)) { - if ($apiKey = Configuration::get('PS_API_KEY')) { + if (($apiKey = Configuration::get('PS_API_KEY')) + && Configuration::get('WK_GOOGLE_ACTIVE_MAP') + ) { if (floatval($objHotelBranchInformation->latitude) != 0 && floatval($objHotelBranchInformation->longitude) != 0 ) { diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index 2d8d7ff6d..a0fb09dad 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -307,7 +307,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'value' => 0, ), ), - 'hint' => $this->l('If set to No, Google Maps will not be displayed for hotel location. You need to set hotels location from edit hotel page to display location on the map at contact-us page.'), + 'hint' => $this->l('If set to No, Google Maps will not be displayed for hotel location. You need to set hotels location from edit hotel page to display location on the map on front office.'), ), 'WK_MAP_HOTEL_ACTIVE_ONLY' => array( 'title' => $this->l('Display Active Hotels Only'), diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index 76a6c3bae..d2bfe7cb0 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -293,7 +293,9 @@ class HotelReservationSystem extends Module public function hookDisplayLeftColumn() { if (Tools::getValue('controller') == 'category') { - if ($apiKey = Configuration::get('PS_API_KEY')) { + if (($apiKey = Configuration::get('PS_API_KEY')) + && Configuration::get('WK_GOOGLE_ACTIVE_MAP') + ) { $idCategory = Tools::getValue('id_category'); $idHotel = HotelBranchInformation::getHotelIdByIdCategory($idCategory); $objHotel = new HotelBranchInformation($idHotel, $this->context->language->id); diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index e0000be46..ebbc7575e 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -155,7 +155,7 @@
    {l s='Hotel location not available.'}
    {/if} - {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0)} + {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_google_map}
    @@ -542,7 +542,7 @@
    {l s='Hotel location not available.'}
    {/if} - {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0)} + {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_google_map}
    From 6f9d5bccc47f9e315b5e7365f6cae5c4814353d2 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 12 Jun 2024 18:55:28 +0530 Subject: [PATCH 052/103] Fixed: Admin was able to create account using 0 as email --- .../admin/AdminCustomersController.php | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 6c763f10c..c5c49544e 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -1044,22 +1044,27 @@ class AdminCustomersControllerCore extends AdminController $customer = new Customer(); if (Validate::isEmail($customer_email)) { $customer->getByEmail($customer_email); - } - if ($customer->id) { - $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email; + if ($customer->id) { + $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email; + $this->display = 'edit'; + return $customer; + } elseif (trim(Tools::getValue('passwd')) == '') { + $this->validateRules(); + $this->errors[] = Tools::displayError('Password can not be empty.'); + $this->display = 'edit'; + } elseif ($customer = parent::processAdd()) { + $this->context->smarty->assign('new_customer', $customer); + return $customer; + } + } else { + $this->errors[] = Tools::displayError('Invalid email address.'); $this->display = 'edit'; - return $customer; - } elseif (trim(Tools::getValue('passwd')) == '') { - $this->validateRules(); - $this->errors[] = Tools::displayError('Password can not be empty.'); - $this->display = 'edit'; - } elseif ($customer = parent::processAdd()) { - $this->context->smarty->assign('new_customer', $customer); - return $customer; } + return false; } + public function processUpdate() { if (Validate::isLoadedObject($this->object)) { @@ -1070,7 +1075,11 @@ class AdminCustomersControllerCore extends AdminController $customer = new Customer(); if (Validate::isEmail($customer_email)) { $customer->getByEmail($customer_email); + } else { + $this->errors[] = Tools::displayError('Invalid email address.'); + $this->display = 'edit'; } + if (($customer->id) && ($customer->id != (int)$this->object->id)) { $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email; } From 601e51b514c42848b0c7562cd7f9307982fe72fd Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 14 Jun 2024 12:39:42 +0530 Subject: [PATCH 053/103] Fixed the new customer KPI --- .../admin/AdminCustomersController.php | 20 +++++++++++++++++++ controllers/admin/AdminStatsController.php | 8 +++++++- modules/dashactivity/views/js/dashactivity.js | 6 ++++-- .../templates/hook/dashboard_zone_one.tpl | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 6c763f10c..526c59dbb 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -230,6 +230,23 @@ class AdminCustomersControllerCore extends AdminController )); } + $prefix = $this->getCookieFilterPrefix(); + if (Tools::getValue('filterOnlyNewCustomer')) { + if (($dateFrom = Tools::getValue('date_from')) + && ($dateTo = Tools::getValue('date_to')) + && strtotime($dateTo) >= strtotime($dateFrom) + ) { + $this->processResetFilters(); + $this->context->cookie->{'submitFilter'.$this->table} = true; + //Updating the date format of the filter dates to the desired format. + $dateFrom = date('Y-m-d', strtotime($dateFrom)); + $dateTo = date('Y-m-d', strtotime($dateTo)); + $this->context->cookie->{$prefix.$this->table.'Filter_date_add'} = json_encode(array($dateFrom, $dateTo)); + } + + $this->redirect_after = $this->context->link->getAdminLink('AdminCustomers'); + } + if (!$this->can_add_customer && !$this->display) { $this->informations[] = $this->l('You have to select a shop if you want to create a customer.'); } @@ -739,6 +756,9 @@ class AdminCustomersControllerCore extends AdminController $helper->color = 'color4'; $helper->title = $this->l('New Customers', null, null, false); $nbDaysNewCustomers = Validate::isUnsignedInt(Configuration::get('PS_KPI_NEW_CUSTOMERS_NB_DAYS')) ? Configuration::get('PS_KPI_NEW_CUSTOMERS_NB_DAYS') : 30; + $date_from = date('Y-m-d', strtotime('-'.$nbDaysNewCustomers.' day')); + $date_to = date('Y-m-d'); + $helper->href = $this->context->link->getAdminLink('AdminCustomers').'&filterOnlyNewCustomer=1&date_from='.$date_from.'&date_to='.$date_to; $helper->subtitle = sprintf($this->l('%d Days', null, null, false), (int) $nbDaysNewCustomers); $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=total_new_customers'; $helper->tooltip = $this->l('The total number of new customers who registered in given period of time.', null, null, false); diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index f647411b1..abd0d9be7 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -981,6 +981,12 @@ class AdminStatsControllerCore extends AdminStatsTabController case 'average_lead_time': $dateToday = date('Y-m-d'); $value = Tools::ps_round(AdminStatsController::getAverageLeadTime(), 2); + if ($value && $value <= 1) { + $value .= ' '.$this->l('day'); + } else { + $value .= ' '.$this->l('days'); + } + break; case 'average_guest_in_booking': $dateToday = date('Y-m-d'); @@ -1879,7 +1885,7 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getTotalNewCustomers($nbDaysNewCustomers) { - $maxDateAdd = date('Y-m-d H:i:s', strtotime('-'.$nbDaysNewCustomers.' day')); + $maxDateAdd = date('Y-m-d', strtotime('-'.$nbDaysNewCustomers.' day')); $sql = 'SELECT COUNT(c.`id_customer`) FROM `'._DB_PREFIX_.'customer` c WHERE c.`date_add` >= "'.pSQL($maxDateAdd).'" AND c.`deleted` = 0'; diff --git a/modules/dashactivity/views/js/dashactivity.js b/modules/dashactivity/views/js/dashactivity.js index a84820e02..1aa71314a 100644 --- a/modules/dashactivity/views/js/dashactivity.js +++ b/modules/dashactivity/views/js/dashactivity.js @@ -58,7 +58,8 @@ $(document).ready(function() { $('#date-start').change(function() { start = Date.parseDate($('#date-start').val(), 'Y-m-d'); end = Date.parseDate($('#date-end').val(), 'Y-m-d'); - + var url = $('#dash_filter_new_customers').data('href') + '&date_from='+start.format('Y-m-d')+ '&date_to='+ end.format('Y-m-d'); + $('#dash_filter_new_customers').attr('href', url); $('#customers-newsletters-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); $('#traffic-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); }); @@ -66,7 +67,8 @@ $(document).ready(function() { $('#date-end').change(function() { start = Date.parseDate($('#date-start').val(), 'Y-m-d'); end = Date.parseDate($('#date-end').val(), 'Y-m-d'); - + var url = $('#dash_filter_new_customers').data('href') + '&date_from='+start.format('Y-m-d')+ '&date_to='+ end.format('Y-m-d'); + $('#dash_filter_new_customers').attr('href', url); $('#customers-newsletters-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); $('#traffic-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); }); diff --git a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl index 95cee2cd3..a649805a3 100644 --- a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl +++ b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl @@ -121,7 +121,7 @@
    {/if} - - {l s='Add Room' mod='wkroomsearchblock'} - - - - +
    + + {l s='Add Room' mod='wkroomsearchblock'} + + + + +
    diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index ccd9b288e..98981c700 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -175,14 +175,16 @@ {/if} - - - - {l s='Add Room'} - - - - - +
    + + + + {l s='Add Room'} + + + + + +
    \ No newline at end of file diff --git a/themes/hotel-reservation-theme/js/occupancy.js b/themes/hotel-reservation-theme/js/occupancy.js index 5f7307f2f..ca7b8f7ed 100644 --- a/themes/hotel-reservation-theme/js/occupancy.js +++ b/themes/hotel-reservation-theme/js/occupancy.js @@ -163,118 +163,76 @@ $(document).ready(function(){ $(document).on('click', '.booking_occupancy_wrapper .select_occupancy_btn', function(e) { e.preventDefault(); if ($('.booking_occupancy_wrapper:visible').length) { - var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); - $(occupancy_wrapper).find(".occupancy_info_block").addClass('selected'); - setRoomTypeGuestOccupancy(occupancy_wrapper); - - let hasErrors = 0; - - let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get(); - let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get(); - let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get(); - - // start validating above values - if (!adults.length || (adults.length != children.length)) { - hasErrors = 1; - showErrorMessage(invalid_occupancy_txt); - } else { - $(occupancy_wrapper).find('.occupancy_count').removeClass('error_border'); - - // validate values of adults and children - adults.forEach(function (item, index) { - if (isNaN(item) || parseInt(item) < 1) { - hasErrors = 1; - $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); - } - if (isNaN(children[index])) { - hasErrors = 1; - $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); - } - }); - - // validate values of selected child ages - $(occupancy_wrapper).find('.guest_child_age').removeClass('error_border'); - 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).addClass('error_border'); - } - }); - } - if (hasErrors == 0) { - if (!($(e.target).closest(".ajax_add_to_cart_button").length - || $(e.target).closest(".exclusive.book_now_submit").length - )) { - $(occupancy_wrapper).parent().removeClass('open'); - $(occupancy_wrapper).siblings(".booking_guest_occupancy").removeClass('error_border'); - $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); - } - } else { - $(occupancy_wrapper).siblings(".booking_guest_occupancy").addClass('error_border'); - } + return validateBookingOccupancies(e); } }); $(document).on('click', function(e) { if ($('.booking_occupancy_wrapper:visible').length) { - var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); - $(occupancy_wrapper).find(".occupancy_info_block").addClass('selected'); - setRoomTypeGuestOccupancy(occupancy_wrapper); if (!($(e.target).closest(".booking_occupancy_wrapper").length || $(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".remove-room-link").length )) { - let hasErrors = 0; - - let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get(); - let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get(); - let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get(); - - // start validating above values - if (!adults.length || (adults.length != children.length)) { - hasErrors = 1; - showErrorMessage(invalid_occupancy_txt); - } else { - $(occupancy_wrapper).find('.occupancy_count').removeClass('error_border'); - - // validate values of adults and children - adults.forEach(function (item, index) { - if (isNaN(item) || parseInt(item) < 1) { - hasErrors = 1; - $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); - } - if (isNaN(children[index])) { - hasErrors = 1; - $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); - } - }); - - // validate values of selected child ages - $(occupancy_wrapper).find('.guest_child_age').removeClass('error_border'); - 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).addClass('error_border'); - } - }); - } - if (hasErrors == 0) { - if (!($(e.target).closest(".ajax_add_to_cart_button").length - || $(e.target).closest(".exclusive.book_now_submit").length - )) { - $(occupancy_wrapper).parent().removeClass('open'); - $(occupancy_wrapper).siblings(".booking_guest_occupancy").removeClass('error_border'); - $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); - } - } else { - $(occupancy_wrapper).siblings(".booking_guest_occupancy").addClass('error_border'); - } + return validateBookingOccupancies(e); } } }); + function validateBookingOccupancies(e) { + var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); + $(occupancy_wrapper).find(".occupancy_info_block").addClass('selected'); + setRoomTypeGuestOccupancy(occupancy_wrapper); + let hasErrors = 0; + let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get(); + let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get(); + let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get(); + + // start validating above values + if (!adults.length || (adults.length != children.length)) { + hasErrors = 1; + showErrorMessage(invalid_occupancy_txt); + } else { + $(occupancy_wrapper).find('.occupancy_count').removeClass('error_border'); + + // validate values of adults and children + adults.forEach(function (item, index) { + if (isNaN(item) || parseInt(item) < 1) { + hasErrors = 1; + $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + if (isNaN(children[index])) { + hasErrors = 1; + $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + }); + + // validate values of selected child ages + $(occupancy_wrapper).find('.guest_child_age').removeClass('error_border'); + 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).addClass('error_border'); + } + }); + } + if (hasErrors == 0) { + if (!($(e.target).closest(".ajax_add_to_cart_button").length + || $(e.target).closest(".exclusive.book_now_submit").length + )) { + $(occupancy_wrapper).parent().removeClass('open'); + $(occupancy_wrapper).siblings(".booking_guest_occupancy").removeClass('error_border'); + $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); + } + } else { + $(occupancy_wrapper).siblings(".booking_guest_occupancy").addClass('error_border'); + + return false; + } + + return true; + } + $(document).on('click', '.booking_occupancy_wrapper .add_new_occupancy_btn', function(e) { e.preventDefault(); From 578bce5a1ede7af9b20c7c011e9ee68305e91456 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 25 Jun 2024 18:35:45 +0530 Subject: [PATCH 062/103] Updated: The best selling KPI will now show rooms on the basis of the booked rooms instead of total revenue --- controllers/admin/AdminStatsController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index abd0d9be7..ce7df4d7d 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -573,20 +573,19 @@ class AdminStatsControllerCore extends AdminStatsTabController { $sql = 'SELECT p.`id_product`, ( - SELECT IFNULL(SUM(ROUND((DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($dateTo).'"), GREATEST(hbd.`date_from`, "'.pSQL($dateFrom).'")) / DATEDIFF(hbd.`date_to`, hbd.`date_from`)) * hbd.`total_price_tax_excl`, 2)), 0) + SELECT count(hbd.`id_product`) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) WHERE hbd.`id_product` = p.`id_product` AND o.`valid` = 1 AND hbd.`date_to` > "'.pSQL($dateFrom).'" AND hbd.`date_from` < "'.pSQL($dateTo).'" - ) AS totalRevenue - FROM `'._DB_PREFIX_.'product` p + ) as total_booked FROM `'._DB_PREFIX_.'product` p INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (hrt.`id_product` = p.`id_product`) - WHERE p.`active` = 1 AND p.`booking_product` = 1'. + WHERE p.`active` = 1 AND p.`booking_product` = 1 '. (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hrt') : '').' - HAVING totalRevenue > 0 - ORDER BY totalRevenue DESC'; + GROUP By p.`id_product` + ORDER BY total_booked DESC'; return Db::getInstance()->getValue($sql); } From 60fd1bc2d13fdb4dccf40183daf54907b8e85d2b Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 26 Jun 2024 12:48:55 +0530 Subject: [PATCH 063/103] Fixed the booking dates incase prepration time is applied to the hotel --- controllers/front/CategoryController.php | 10 ++++++++ controllers/front/ProductController.php | 15 ++++++++--- .../classes/WkRoomSearchHelper.php | 25 ++++++++++++++++--- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 0fc5f8efb..7b6b31489 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -165,6 +165,16 @@ class CategoryControllerCore extends FrontController $currency = new Currency($this->context->currency->id); if ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($id_category)) { + $preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($id_hotel); + if ($preparationTime + && strtotime('+ '.$preparationTime.' day') >= strtotime($date_from) + ) { + $date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day')); + if (strtotime($date_from) >= strtotime($date_to)) { + $date_to = date('Y-m-d', strtotime($date_from) + 86400); + } + } + $id_cart = $this->context->cart->id; $id_guest = $this->context->cookie->id_guest; diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index bd25afa81..fc503b2aa 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -344,10 +344,6 @@ class ProductControllerCore extends FrontController $preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($hotel_id); if (!($date_from = Tools::getValue('date_from'))) { $date_from = date('Y-m-d'); - if ($preparationTime) { - $date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day')); - } - // set date to according to los $objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange(); $los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from); @@ -360,6 +356,17 @@ class ProductControllerCore extends FrontController $date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from))); } + if ($preparationTime + && strtotime('+ '.$preparationTime.' day') >= strtotime($date_from) + ) { + $date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day')); + if (strtotime($date_from) >= strtotime($date_to)) { + $objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange(); + $los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from); + $date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from))); + } + } + $hotel_branch_obj = new HotelBranchInformation($hotel_id); /*Max date of ordering for order restrict*/ $order_date_restrict = false; diff --git a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php index effe0f15f..51fef3746 100644 --- a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php +++ b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php @@ -140,11 +140,31 @@ class WkRoomSearchHelper if (!$dateTo = Tools::getValue('date_to')) { $dateTo = date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))); } - $smartyVars['date_from'] = $dateFrom; - $smartyVars['date_to'] = $dateTo; $idHotel = HotelBranchInformation::getHotelIdByIdCategory($idHotelCategory); $htlCategoryInfo = $objHotelInfo->getCategoryDataByIdCategory((int) $objCategory->id_parent); + $searchedData['htl_dtl'] = $objHotelInfo->hotelBranchesInfo(0, 1, 1, $idHotel); + $preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($idHotel); + if ($preparationTime + && strtotime('+ '.$preparationTime.' day') >= strtotime($dateFrom) + ) { + $dateFrom = date('Y-m-d', strtotime('+ '.$preparationTime.' day')); + if (strtotime($dateFrom) >= strtotime($dateTo)) { + $controller = Tools::getValue('controller'); + if ($controller == 'product' + && ($idProduct = Tools::getValue('id_product')) + ) { + $objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange(); + $los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($idProduct, $dateFrom); + $dateTo = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($dateFrom))); + } else { + $dateTo = date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))); + } + } + } + + $smartyVars['date_from'] = $dateFrom; + $smartyVars['date_to'] = $dateTo; $objBookingDetail = new HotelBookingDetail(); $searchedData['num_days'] = $objBookingDetail->getNumberOfDays($dateFrom, $dateTo); @@ -152,7 +172,6 @@ class WkRoomSearchHelper $searchedData['parent_data'] = $htlCategoryInfo; $searchedData['date_from'] = $dateFrom; $searchedData['date_to'] = $dateTo; - $searchedData['htl_dtl'] = $objHotelInfo->hotelBranchesInfo(0, 1, 1, $idHotel); if ($locationCategoryId) { $objLocationCategory = new Category($locationCategoryId, $context->language->id); From 5ab9f4318e070b708d0835eb746226c74c51fcb4 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 27 Jun 2024 11:38:12 +0530 Subject: [PATCH 064/103] Added: Prepration time validation for dates selcted for hotel search and for the room type page --- controllers/front/CategoryController.php | 4 ++-- controllers/front/ProductController.php | 12 ++++++------ .../hotelreservationsystem/classes/HotelHelper.php | 12 ++++++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 509a9e6c0..c96a8632d 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -101,8 +101,8 @@ class CategoryControllerCore extends FrontController // validate dates if available $dateFrom = Tools::getValue('date_from'); $dateTo = Tools::getValue('date_to'); - - if (!HotelHelper::validateDateRange($dateFrom, $dateTo)) { + $idHotel = HotelBranchInformation::getHotelIdByIdCategory($id_category); + if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); } diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index f8aef8c77..177fd5004 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -109,18 +109,18 @@ class ProductControllerCore extends FrontController // validate dates if available $dateFrom = Tools::getValue('date_from'); $dateTo = Tools::getValue('date_to'); - - if (!HotelHelper::validateDateRange($dateFrom, $dateTo)) { - Tools::redirect($this->context->link->getPageLink('pagenotfound')); - } - parent::init(); if ($id_product = (int) Tools::getValue('id_product')) { $this->product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id); } - if (!$this->product->booking_product || ($this->product->booking_product && !$this->product->show_at_front)) { + $objHotelRoomType = new HotelRoomType(); + $hotelRoomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id); + $idHotel = (int) $hotelRoomInfo['id_hotel']; + if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } else if (!$this->product->booking_product || ($this->product->booking_product && !$this->product->show_at_front)) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); } diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 544a8fb7a..e4d78f7f8 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -932,15 +932,19 @@ class HotelHelper return $daysDifference; } - public static function validateDateRange($dateFrom, $dateTo) + public static function validateDateRangeForHotel($dateFrom, $dateTo, $idHotel) { - $currentTimestamp = strtotime(date('Y-m-d')); + $validStartDateTimeStamp = strtotime(date('Y-m-d')); + if ($preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($idHotel)) { + $validStartDateTimeStamp = strtotime(date('Y-m-d', strtotime('+ '.$preparationTime.' day'))); + } + $dateFromTimestamp = strtotime($dateFrom); $dateToTimestamp = strtotime($dateTo); $isValid = true; - if ($dateFrom != '' && ($dateFromTimestamp === false || ($dateFromTimestamp < $currentTimestamp))) { + if ($dateFrom != '' && ($dateFromTimestamp === false || ($dateFromTimestamp < $validStartDateTimeStamp))) { $isValid = false; - } else if ($dateTo != '' && ($dateToTimestamp === false || ($dateToTimestamp < $currentTimestamp))) { + } else if ($dateTo != '' && ($dateToTimestamp === false || ($dateToTimestamp < $validStartDateTimeStamp))) { $isValid = false; } else if ($dateTo != '' && $dateFrom != '' && $dateFromTimestamp >= $dateToTimestamp) { $isValid = false; From 3966727dc6fb0bb4e437653507cd681920cb7502 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 27 Jun 2024 16:13:29 +0530 Subject: [PATCH 065/103] Fixed the error message for updation failed for show at front --- controllers/admin/AdminProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 2786381b6..690c3f054 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1937,7 +1937,7 @@ class AdminProductsControllerCore extends AdminController if ($this->object->save()) { Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=4'); } else { - $this->errors[] = $this->l('Something error occurred.'); + $this->errors[] = $this->l('An error occurred while updating "show at front".'); } } From 020c1986a31daf80c4a123304f34806e27ec95d9 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 27 Jun 2024 16:31:11 +0530 Subject: [PATCH 066/103] Fixed fatal error caused by changing the in the AdminNormalProductsController --- controllers/admin/AdminNormalProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index 1c8027412..174681d68 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -526,7 +526,7 @@ class AdminNormalProductsControllerCore extends AdminController // convert price with the currency from context $this->_list[$i]['price'] = Tools::convertPrice($this->_list[$i]['price'], $this->context->currency, true, $this->context); $this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, - (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, null, true, true, + (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, $nothing, true, true, $context); } } From 04485016d56e8fdeec48c867678205f257229737 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 27 Jun 2024 18:12:40 +0530 Subject: [PATCH 067/103] Updated the name of the done button field in the occuancy popup --- modules/wkroomsearchblock/views/css/wk-global-search.css | 2 +- modules/wkroomsearchblock/views/js/wk-room-search-block.js | 2 +- modules/wkroomsearchblock/views/templates/hook/searchForm.tpl | 2 +- themes/hotel-reservation-theme/_partials/occupancy_field.tpl | 2 +- themes/hotel-reservation-theme/js/occupancy.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/wkroomsearchblock/views/css/wk-global-search.css b/modules/wkroomsearchblock/views/css/wk-global-search.css index 6872355b6..3949a7c10 100644 --- a/modules/wkroomsearchblock/views/css/wk-global-search.css +++ b/modules/wkroomsearchblock/views/css/wk-global-search.css @@ -213,7 +213,7 @@ text-transform: uppercase; border: none; border-radius: 4px;} - .select_occupancy_btn { + .submit_occupancy_btn { background-color: #1292FF; font-size: 13px; border: none; diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index e4e3f06a2..72588c0e3 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -831,7 +831,7 @@ $(document).ready(function() { } }); - $(document).on('click', '#search_occupancy_wrapper .select_occupancy_btn', function(e) { + $(document).on('click', '#search_occupancy_wrapper .submit_occupancy_btn', function(e) { e.preventDefault(); if ($('#search_occupancy_wrapper').length) { if ($('#search_occupancy_wrapper').css('display') !== 'none') { diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index ed590139d..8bd27f7fc 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -215,7 +215,7 @@ {l s='Add Room' mod='wkroomsearchblock'} - + diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index 98981c700..3717949b3 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -183,7 +183,7 @@ - + diff --git a/themes/hotel-reservation-theme/js/occupancy.js b/themes/hotel-reservation-theme/js/occupancy.js index ca7b8f7ed..031a37904 100644 --- a/themes/hotel-reservation-theme/js/occupancy.js +++ b/themes/hotel-reservation-theme/js/occupancy.js @@ -160,7 +160,7 @@ $(document).ready(function(){ } }); - $(document).on('click', '.booking_occupancy_wrapper .select_occupancy_btn', function(e) { + $(document).on('click', '.booking_occupancy_wrapper .submit_occupancy_btn', function(e) { e.preventDefault(); if ($('.booking_occupancy_wrapper:visible').length) { return validateBookingOccupancies(e); From 965f599c5387532e3c89b76f25e194032bd9e050 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 10:22:36 +0530 Subject: [PATCH 068/103] Fixed: the design for the 'Subscribe' button on the order-detail page --- .../hotel-reservation-theme/css/order-detail.css | 14 +++++++------- themes/hotel-reservation-theme/order-detail.tpl | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/themes/hotel-reservation-theme/css/order-detail.css b/themes/hotel-reservation-theme/css/order-detail.css index c84de4477..54796fd24 100644 --- a/themes/hotel-reservation-theme/css/order-detail.css +++ b/themes/hotel-reservation-theme/css/order-detail.css @@ -385,11 +385,11 @@ margin-bottom: 10px; } -.add-order-message form #submitMessage { +#order_detail_container #submitMessage { padding: 6px 20px; } -.add-order-message form #submitMessage span { +#order_detail_container #submitMessage span { font-size: 14px; font-weight: bold; } @@ -522,20 +522,20 @@ border-radius: 4px; } -.button.button-medium { +#order_detail_container .button.button-medium { padding: 8px 15px; background-color: #379bf0; background-image: none; border-radius: 2px; } -.button.button-medium span { +#order_detail_container .button.button-medium span { padding: 0; } -.button.button-medium:hover, -.button.button-medium:focus, -.button.button-medium:active { +#order_detail_container .button.button-medium:hover, +#order_detail_container .button.button-medium:focus, +#order_detail_container .button.button-medium:active { opacity: 0.8; } diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index ad1ca8629..df1703249 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -59,7 +59,7 @@ {$HOOK_ORDERDETAILDISPLAYED} -
    +
    {hook h='displayOrderDetailTopLeft' id_order=$order->id} From 731cf6fafcaab4d8c1115430f39e7a0b86eaab33 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 10:34:02 +0530 Subject: [PATCH 069/103] Added: Empty dropdown will appear if select input options and empty message are not set. --- admin/themes/default/template/helpers/options/options.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/themes/default/template/helpers/options/options.tpl b/admin/themes/default/template/helpers/options/options.tpl index 24a6094cd..527850f73 100644 --- a/admin/themes/default/template/helpers/options/options.tpl +++ b/admin/themes/default/template/helpers/options/options.tpl @@ -138,6 +138,9 @@ {elseif isset($input.empty_message)} {$input.empty_message} + {else} + {/if}
    {elseif $field['type'] == 'bool'} From 4c10e15ab926cb7d74eddd6135034a55ce6951a4 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 12:11:25 +0530 Subject: [PATCH 070/103] removed non required code for advanced payment status in Admin Products controller --- controllers/admin/AdminProductsController.php | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 690c3f054..a5cf027ab 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -332,7 +332,7 @@ class AdminProductsControllerCore extends AdminController if (Configuration::get('WK_ALLOW_ADVANCED_PAYMENT')) { $this->fields_list['advance_payment'] = array( 'title' => $this->l('Advance Payment'), - 'callback' => 'getAdvancePaymentBadge', + 'callback' => 'getAdvancePaymentStatus', 'align' => 'text-center', 'type' => 'bool', 'optional' => true, @@ -342,17 +342,6 @@ class AdminProductsControllerCore extends AdminController ); } - $this->statusBadge = array( - 0 => array( - 'badge' => 'badge-danger', - 'text' => $this->l('No') - ), - 1 => array( - 'badge' => 'badge-success', - 'text' => $this->l('Yes') - ) - ); - $taxRulesGroups = array(); foreach (TaxRulesGroup::getTaxRulesGroups(true) as $taxRulesGroup) { $taxRulesGroups[$taxRulesGroup['id_tax_rules_group']] = $taxRulesGroup['name']; @@ -452,9 +441,15 @@ class AdminProductsControllerCore extends AdminController } } - public function getAdvancePaymentBadge($val, $row) + public function getAdvancePaymentStatus($val, $row) { - return ''.$this->statusBadge[(int)$val]['text'].''; + if ($val) { + $str_return = ''.$this->l('Yes').''; + } else { + $str_return = ''.$this->l('No').''; + } + + return $str_return; } From fc4d66f6925ccbe3fecd69ca89da4ae3f99ccdbb Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 12:59:49 +0530 Subject: [PATCH 071/103] Udpated: Text of column 'tax' to 'Tax rule' in both 'Additional Facilities' & 'Service Products' tab of room type detail page --- .../template/controllers/products/additionalfacilities.tpl | 2 +- .../default/template/controllers/products/serviceproduct.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/products/additionalfacilities.tpl b/admin/themes/default/template/controllers/products/additionalfacilities.tpl index c3a58eb34..eb40e083e 100644 --- a/admin/themes/default/template/controllers/products/additionalfacilities.tpl +++ b/admin/themes/default/template/controllers/products/additionalfacilities.tpl @@ -43,7 +43,7 @@ {l s='Price'} - {l s='Tax rate'} + {l s='Tax rule'} {l s='Per day price calculation'} diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index e7b2001cb..ac93c1ed9 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -27,7 +27,7 @@ {l s='Price'} - {l s='Tax'} + {l s='Tax rule'} From 620c7a2f495ed0c1ed4099a0389310d0dd2a3d1d Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 13:20:46 +0530 Subject: [PATCH 072/103] Fixed the variable name for view on map on order detail page --- controllers/front/OrderDetailController.php | 2 +- themes/hotel-reservation-theme/order-detail.tpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index bc6ae5620..381a1410e 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -407,7 +407,7 @@ class OrderDetailControllerCore extends FrontController 'obj_hotel_branch_information' => $objHotelBranchInformation, 'hotel_address_info' => $hotelAddressInfo, 'hotel_refund_rules' => $hotelRefundRules, - 'view_on_google_map' => Configuration::get('WK_GOOGLE_ACTIVE_MAP'), + 'view_on_map' => Configuration::get('WK_GOOGLE_ACTIVE_MAP'), ) ); // } diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 4d4dc120c..730247dad 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -155,7 +155,7 @@
    {l s='Hotel location not available.'}
    {/if} - {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_google_map} + {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
    @@ -542,7 +542,7 @@
    {l s='Hotel location not available.'}
    {/if} - {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_google_map} + {if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
    From 09c883a7fe3027feb7b9d36fb4f06009467df3ac Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 17:00:30 +0530 Subject: [PATCH 073/103] Updated: Prepration time to minimum booking offset and its defination in the admin order preferences controller --- controllers/admin/AdminOrderPreferencesController.php | 8 ++++---- .../classes/HotelBranchInformation.php | 4 ++-- .../controllers/admin/AdminAddHotelController.php | 4 ++-- .../views/templates/admin/add_hotel/helpers/form/form.tpl | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/controllers/admin/AdminOrderPreferencesController.php b/controllers/admin/AdminOrderPreferencesController.php index 4068a6f09..4125603b6 100644 --- a/controllers/admin/AdminOrderPreferencesController.php +++ b/controllers/admin/AdminOrderPreferencesController.php @@ -95,8 +95,8 @@ class AdminOrderPreferencesControllerCore extends AdminController 'class' => 'fixed-width-xxl readonly', ), 'GLOBAL_PREPARATION_TIME' => array( - 'title' => $this->l('Preparation time'), - 'hint' => $this->l('Number of days required to prepare a room for a guest\'s stay. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'), + 'title' => $this->l('Minimum booking offset'), + 'hint' => $this->l('The minimum booking offset refers to the furthest future date from which a guest can book a room relative to their desired check-in date. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'), 'desc' => $this->l('Set to 0 to disable this feature.'), 'type' => 'text', 'class' => 'fixed-width-xl', @@ -342,9 +342,9 @@ class AdminOrderPreferencesControllerCore extends AdminController } if ($globalPreparationTime === '') { - $this->errors[] = Tools::displayError('Field \'Preparation time\' can not be empty.'); + $this->errors[] = Tools::displayError('Field \'Minimum booking offset\' can not be empty.'); } elseif ($globalPreparationTime !== '0' && !Validate::isUnsignedInt($globalPreparationTime)) { - $this->errors[] = Tools::displayError('Field \'Preparation time\' is invalid.'); + $this->errors[] = Tools::displayError('Field \'Minimum booking offset\' is invalid.'); } } diff --git a/modules/hotelreservationsystem/classes/HotelBranchInformation.php b/modules/hotelreservationsystem/classes/HotelBranchInformation.php index 05af3c72b..9463c8cd0 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchInformation.php +++ b/modules/hotelreservationsystem/classes/HotelBranchInformation.php @@ -1228,13 +1228,13 @@ class HotelBranchInformation extends ObjectModel if (!$this->use_global_preparation_time) { if ($this->preparation_time === '') { - $message = Tools::displayError('Preparation time is a required.'); + $message = Tools::displayError('Minimum booking offset is a required.'); if ($die) { throw new PrestaShopException($message); } return $error_return ? $message : false; } elseif ($this->preparation_time !== '0' && !Validate::isUnsignedInt($this->preparation_time)) { - $message = Tools::displayError('Preparation time is invalid.'); + $message = Tools::displayError('Minimum booking offset is invalid.'); if ($die) { throw new PrestaShopException($message); } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 1d0e738b3..4998ad868 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -343,9 +343,9 @@ class AdminAddHotelController extends ModuleAdminController if (!$enableUseGlobalPreparationTime) { if ($preparationTime === '') { - $this->errors[] = $this->l('Preparation time is a required field.'); + $this->errors[] = $this->l('Minimum booking offset is a required field.'); } elseif ($preparationTime !== '0' && !Validate::isUnsignedInt($preparationTime)) { - $this->errors[] = $this->l('Preparation time is invalid.'); + $this->errors[] = $this->l('Minimum booking offset is invalid.'); } } } 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 4ef90c7d8..2321054af 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 @@ -367,7 +367,7 @@
    @@ -380,7 +380,7 @@