From 2ef62c630c6db766413469acd4690d880215af36 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 28 Mar 2024 16:04:48 +0530 Subject: [PATCH 01/40] 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 ec11eea527598abdf7688f1b34e33e11e4f23707 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 19 Apr 2024 11:02:43 +0530 Subject: [PATCH 02/40] Updated: room type operating cost validation message --- controllers/admin/AdminProductsController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 811207d39..2f44e93c3 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2199,10 +2199,14 @@ public function checkProduct() } if (!$res) { - $this->errors[] = sprintf( - Tools::displayError('The %s field is invalid.'), - call_user_func(array($className, 'displayFieldName'), $field, $className) - ); + if (Tools::strtolower($field) == 'wholesale_price') { + $this->errors[] = Tools::displayError('The Pre-tax operating cost field is invalid.'); + } else { + $this->errors[] = sprintf( + Tools::displayError('The %s field is invalid.'), + call_user_func(array($className, 'displayFieldName'), $field, $className) + ); + } } } } From bbc6985d415b54f631126f35fad85d6c447ea0c8 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 22 Apr 2024 18:53:26 +0530 Subject: [PATCH 03/40] Fixed: Invalid num rows mentioned extra services overview module. --- .../qlostatsserviceproducts/qlostatsserviceproducts.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/qlostatsserviceproducts/qlostatsserviceproducts.php b/modules/qlostatsserviceproducts/qlostatsserviceproducts.php index 4644d0828..07ff01608 100644 --- a/modules/qlostatsserviceproducts/qlostatsserviceproducts.php +++ b/modules/qlostatsserviceproducts/qlostatsserviceproducts.php @@ -229,10 +229,6 @@ public function setQueryForServices($dateBetween) ) AND p.`booking_product` = 0)'; - $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue( - 'SELECT COUNT(p.`id_product`) FROM '._DB_PREFIX_.'product p WHERE p.`booking_product` = 0 AND p.`active` = 1' - ); - $this->option = 'services'; } @@ -278,10 +274,6 @@ public function setQueryForFacilities($dateBetween) WHERE o.valid = 1 AND o.invoice_date BETWEEN '.$dateBetween.' '.HotelBranchInformation::addHotelRestriction(false, 'hbd').' ))'; - $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue( - 'SELECT COUNT(`id_global_demand`) FROM '._DB_PREFIX_.'htl_room_type_global_demand' - ); - $this->option = 'facilities'; } @@ -299,6 +291,7 @@ public function getData() $this->query .= ' LIMIT '.(int)$this->_start.', '.(int)$this->_limit; $values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query); + $this->_totalCount = Db::getInstance()->NumRows(); foreach ($values as &$value) { if (!Tools::getValue('export')) { From a2f6110a5192d5a8c525829cba65e10f5a6dab46 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 2 May 2024 16:06:58 +0530 Subject: [PATCH 04/40] Fixed: Backoffice design issue in RTL language --- .../themes/default/sass/admin-theme_rtl.sass | 11 ++ admin/themes/default/sass/partials/_rtl.sass | 5 + .../vendor/bootstrap-rtl-sass/_grid-rtl.sass | 121 ++++++++++++------ .../dashoccupancy/views/css/dashoccupancy.css | 2 +- 4 files changed, 99 insertions(+), 40 deletions(-) diff --git a/admin/themes/default/sass/admin-theme_rtl.sass b/admin/themes/default/sass/admin-theme_rtl.sass index 90d7eec1b..712d08aa9 100644 --- a/admin/themes/default/sass/admin-theme_rtl.sass +++ b/admin/themes/default/sass/admin-theme_rtl.sass @@ -84,14 +84,20 @@ @import "partials/date-range-picker" @import "partials/multistore" @import "partials/product" + @import "partials/skeleton-loading" + //Controllers @import "controllers/carrier-wizard" @import "controllers/dashboard" @import "controllers/login" + @import "controllers/modules_catalog" @import "controllers/modules" @import "controllers/search" @import "controllers/translations" @import "controllers/customer-thread" + @import "controllers/themes" + @import "controllers/order" + @import "controllers/products" @import "vendor/bootstrap-rtl-sass/bootstrap-rtl" //Plug-ins @@ -99,6 +105,9 @@ @import "partials/growl" @import "partials/chosen" @import "partials/ladda" +@import "partials/date-picker" +@import "partials/select2" +@import "partials/ndv3" //RTL @import "partials/rtl" @@ -106,3 +115,5 @@ //Backward compatibility @import "partials/backward" +//Print support +@import "partials/print" diff --git a/admin/themes/default/sass/partials/_rtl.sass b/admin/themes/default/sass/partials/_rtl.sass index c3b7b569f..7fd16f206 100644 --- a/admin/themes/default/sass/partials/_rtl.sass +++ b/admin/themes/default/sass/partials/_rtl.sass @@ -119,3 +119,8 @@ html margin-left: 0px @include border-right(1px solid $sidebar-menu-bg-hover-color) border-left: 0px +#nav-topbar + #ellipsistab + ul#ellipsis_submenu + left: 0 + right: unset diff --git a/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_grid-rtl.sass b/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_grid-rtl.sass index 4563bca33..c8e9fb9fd 100644 --- a/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_grid-rtl.sass +++ b/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_grid-rtl.sass @@ -187,28 +187,42 @@ .col-sm-push-11 right: percentage((11/ $grid-columns)) + .col-sm-pull-0 + left: auto + right: auto .col-sm-pull-1 left: percentage((1 / $grid-columns)) + right: auto .col-sm-pull-2 left: percentage((2 / $grid-columns)) + right: auto .col-sm-pull-3 left: percentage((3 / $grid-columns)) + right: auto .col-sm-pull-4 left: percentage((4 / $grid-columns)) + right: auto .col-sm-pull-5 left: percentage((5 / $grid-columns)) + right: auto .col-sm-pull-6 left: percentage((6 / $grid-columns)) + right: auto .col-sm-pull-7 left: percentage((7 / $grid-columns)) + right: auto .col-sm-pull-8 left: percentage((8 / $grid-columns)) + right: auto .col-sm-pull-9 left: percentage((9 / $grid-columns)) + right: auto .col-sm-pull-10 left: percentage((10/ $grid-columns)) + right: auto .col-sm-pull-11 left: percentage((11/ $grid-columns)) + right: auto // Offsets .col-sm-offset-1 @@ -269,23 +283,23 @@ .col-md-10, .col-md-11 float: right - .col-md-1 + .col-md-1 width: percentage((1 / $grid-columns)) - .col-md-2 + .col-md-2 width: percentage((2 / $grid-columns)) - .col-md-3 + .col-md-3 width: percentage((3 / $grid-columns)) - .col-md-4 + .col-md-4 width: percentage((4 / $grid-columns)) - .col-md-5 + .col-md-5 width: percentage((5 / $grid-columns)) - .col-md-6 + .col-md-6 width: percentage((6 / $grid-columns)) - .col-md-7 + .col-md-7 width: percentage((7 / $grid-columns)) - .col-md-8 + .col-md-8 width: percentage((8 / $grid-columns)) - .col-md-9 + .col-md-9 width: percentage((9 / $grid-columns)) .col-md-10 width: percentage((10/ $grid-columns)) @@ -318,28 +332,42 @@ .col-md-push-11 right: percentage((11/ $grid-columns)) + .col-md-pull-0 + left: auto + right: auto .col-md-pull-1 left: percentage((1 / $grid-columns)) + right: auto .col-md-pull-2 left: percentage((2 / $grid-columns)) + right: auto .col-md-pull-3 left: percentage((3 / $grid-columns)) + right: auto .col-md-pull-4 left: percentage((4 / $grid-columns)) + right: auto .col-md-pull-5 left: percentage((5 / $grid-columns)) + right: auto .col-md-pull-6 left: percentage((6 / $grid-columns)) + right: auto .col-md-pull-7 left: percentage((7 / $grid-columns)) + right: auto .col-md-pull-8 left: percentage((8 / $grid-columns)) + right: auto .col-md-pull-9 left: percentage((9 / $grid-columns)) + right: auto .col-md-pull-10 left: percentage((10/ $grid-columns)) + right: auto .col-md-pull-11 left: percentage((11/ $grid-columns)) + right: auto // Offsets .col-md-offset-1 @@ -402,77 +430,92 @@ .col-lg-11 float: right - .col-lg-1 + .col-lg-1 width: percentage((1 / $grid-columns)) - .col-lg-2 + .col-lg-2 width: percentage((2 / $grid-columns)) - .col-lg-3 + .col-lg-3 width: percentage((3 / $grid-columns)) - .col-lg-4 + .col-lg-4 width: percentage((4 / $grid-columns)) - .col-lg-5 + .col-lg-5 width: percentage((5 / $grid-columns)) - .col-lg-6 + .col-lg-6 width: percentage((6 / $grid-columns)) - .col-lg-7 + .col-lg-7 width: percentage((7 / $grid-columns)) - .col-lg-8 + .col-lg-8 width: percentage((8 / $grid-columns)) - .col-lg-9 + .col-lg-9 width: percentage((9 / $grid-columns)) - .col-lg-10 + .col-lg-10 width: percentage((10/ $grid-columns)) - .col-lg-11 + .col-lg-11 width: percentage((11/ $grid-columns)) - .col-lg-12 + .col-lg-12 width: 100% // Push and pull columns for source order changes - .col-lg-push-1 + .col-lg-push-1 right: percentage((1 / $grid-columns)) - .col-lg-push-2 + .col-lg-push-2 right: percentage((2 / $grid-columns)) - .col-lg-push-3 + .col-lg-push-3 right: percentage((3 / $grid-columns)) - .col-lg-push-4 + .col-lg-push-4 right: percentage((4 / $grid-columns)) - .col-lg-push-5 + .col-lg-push-5 right: percentage((5 / $grid-columns)) - .col-lg-push-6 + .col-lg-push-6 right: percentage((6 / $grid-columns)) - .col-lg-push-7 + .col-lg-push-7 right: percentage((7 / $grid-columns)) - .col-lg-push-8 + .col-lg-push-8 right: percentage((8 / $grid-columns)) - .col-lg-push-9 + .col-lg-push-9 right: percentage((9 / $grid-columns)) .col-lg-push-10 right: percentage((10/ $grid-columns)) .col-lg-push-11 right: percentage((11/ $grid-columns)) - .col-lg-pull-1 + .col-lg-pull-0 + left: auto + right: auto + .col-lg-pull-1 left: percentage((1 / $grid-columns)) - .col-lg-pull-2 + right: auto + .col-lg-pull-2 left: percentage((2 / $grid-columns)) - .col-lg-pull-3 + right: auto + .col-lg-pull-3 left: percentage((3 / $grid-columns)) - .col-lg-pull-4 + right: auto + .col-lg-pull-4 left: percentage((4 / $grid-columns)) - .col-lg-pull-5 + right: auto + .col-lg-pull-5 left: percentage((5 / $grid-columns)) - .col-lg-pull-6 + right: auto + .col-lg-pull-6 left: percentage((6 / $grid-columns)) - .col-lg-pull-7 + right: auto + .col-lg-pull-7 left: percentage((7 / $grid-columns)) - .col-lg-pull-8 + right: auto + right: unset + .col-lg-pull-8 left: percentage((8 / $grid-columns)) - .col-lg-pull-9 + right: auto + .col-lg-pull-9 left: percentage((9 / $grid-columns)) + right: auto .col-lg-pull-10 left: percentage((10/ $grid-columns)) + right: auto .col-lg-pull-11 left: percentage((11/ $grid-columns)) + right: auto // Offsets .col-lg-offset-1 diff --git a/modules/dashoccupancy/views/css/dashoccupancy.css b/modules/dashoccupancy/views/css/dashoccupancy.css index 43b2faf90..711279a60 100644 --- a/modules/dashoccupancy/views/css/dashoccupancy.css +++ b/modules/dashoccupancy/views/css/dashoccupancy.css @@ -41,7 +41,7 @@ top: -50px; bottom: 50px; left: -50px; - right: 50px; + right: -50px; width: calc(100% + 100px); height: calc(100% + 100px); } From 1740165348f89bc3fa9ac2bdc03117ff9f311818 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 2 May 2024 19:15:25 +0530 Subject: [PATCH 05/40] fix statsforcast divide by zero error --- modules/statsforecast/statsforecast.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/statsforecast/statsforecast.php b/modules/statsforecast/statsforecast.php index ae5517c32..23a223da7 100644 --- a/modules/statsforecast/statsforecast.php +++ b/modules/statsforecast/statsforecast.php @@ -461,7 +461,7 @@ public function hookAdminStatsModules() '.(int)$payment['nb'].' '.Tools::displayPrice($payment['total'], $currency).' '.sprintf('%0.2f', ($ca['ventil']['nb'] ? ($payment['nb'] / $ca['ventil']['nb']) * 100 : 0)).'% - '.sprintf('%0.2f', ($ca['ventil']['nb'] ? ($payment['total'] / $ca['ventil']['total_incl']) * 100 : 0)).'% + '.sprintf('%0.2f', ($ca['ventil']['total_incl'] > 0 ? ($payment['total'] / $ca['ventil']['total_incl']) * 100 : 0)).'% '.Tools::displayPrice($payment['total'] / (int)$payment['nb'], $currency).' '; } @@ -492,7 +492,7 @@ public function hookAdminStatsModules() '.$ophone.' '.Tools::displayPrice($amount, $currency).' - '.sprintf('%0.2f', ($ca['ventil']['total'] ? ($amount / $ca['ventil']['total']) * 100 : 0)).'% + '.sprintf('%0.2f', ($ca['ventil']['total'] > 0 ? ($amount / $ca['ventil']['total']) * 100 : 0)).'% '; } } else { @@ -526,7 +526,7 @@ public function hookAdminStatsModules() '.(int)($zone['nb']).' '.Tools::displayPrice($zone['total'], $currency).' '.sprintf('%0.2f', $ca['ventil']['nb'] ? ($zone['nb'] / $ca['ventil']['nb']) * 100 : 0).'% - '.sprintf('%0.2f', $ca['ventil']['total'] ? ($zone['total'] / $ca['ventil']['total']) * 100 : 0).'% + '.sprintf('%0.2f', $ca['ventil']['total'] > 0 ? ($zone['total'] / $ca['ventil']['total']) * 100 : 0).'% '; } } else { @@ -577,7 +577,7 @@ public function hookAdminStatsModules() '.(int)($currency_row['nb']).' '.Tools::displayPrice($currency_row['total'], $currency).' '.sprintf('%0.2f', $ca['ventil']['nb'] ? ($currency_row['nb'] / $ca['ventil']['nb']) * 100 : 0).'% - '.sprintf('%0.2f', $ca['ventil']['total'] ? ($currency_row['total'] / $ca['ventil']['total']) * 100 : 0).'% + '.sprintf('%0.2f', $ca['ventil']['total'] > 0 ? ($currency_row['total'] / $ca['ventil']['total']) * 100 : 0).'% '; } } else { From d343463ac158fffe9660c73b40b9f7c85f562aa5 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 3 May 2024 15:46:48 +0530 Subject: [PATCH 06/40] resolve csv export issues --- classes/module/ModuleGraph.php | 4 ++-- classes/module/ModuleGrid.php | 5 ++++- modules/statsbestproducts/statsbestproducts.php | 11 +++++------ modules/statsproduct/statsproduct.php | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/classes/module/ModuleGraph.php b/classes/module/ModuleGraph.php index f087a0a2c..f74e66146 100644 --- a/classes/module/ModuleGraph.php +++ b/classes/module/ModuleGraph.php @@ -210,7 +210,7 @@ protected function csvExport($datas) if (isset($this->_values[$key])) { // We don't want strings to be divided. Example: product name if (is_numeric($this->_values[$key])) { - $this->_csv .= $this->_values[$key] / (($datas['type'] == 'pie') ? $total : 1); + $this->_csv .= $this->_values[$key] * 100 / (($datas['type'] == 'pie') ? $total : 1) . '%'; } else { $this->_csv .= $this->_values[$key]; } @@ -220,7 +220,7 @@ protected function csvExport($datas) } else { // We don't want strings to be divided. Example: product name if (is_numeric($this->_values[$i][$key])) { - $this->_csv .= $this->_values[$i][$key] / (($datas['type'] == 'pie') ? $total : 1); + $this->_csv .= $this->_values[$i][$key] * 100 / (($datas['type'] == 'pie') ? $total : 1) . '%'; } else { $this->_csv .= $this->_values[$i][$key]; } diff --git a/classes/module/ModuleGrid.php b/classes/module/ModuleGrid.php index 024066626..13f6f18ee 100644 --- a/classes/module/ModuleGrid.php +++ b/classes/module/ModuleGrid.php @@ -153,7 +153,10 @@ public function engine($params) protected function csvExport($datas) { $this->_sort = $datas['defaultSortColumn']; - $this->setLang(Context::getContext()->language->id); + $context = Context::getContext(); + $this->setLang($context->language->id); + $this->setEmployee($context->employee->id); + if (isset($datas['option'])) { $this->setOption($datas['option'], $layers); } diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index 29459c0d7..deb4dd68f 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -229,18 +229,17 @@ public function getData() if (Tools::getValue('export') == false) { $value['roomTypeName'] = ''.$value['roomTypeName'].''; $value['hotelName'] = ''.$value['hotelName'].''; + if ($value['active']) { + $value['active'] = ''.$this->l('Yes').''; + } else { + $value['active'] = ''.$this->l('No').''; + } } $value['totalRoomsBooked'] = (int) $value['totalRoomsBooked']; $value['availableRooms'] = max($value['totalRooms'] - $value['totalRoomsBooked'], 0); // availableRooms can be negative if more rooms are disabled than available for booking $value['bookingsPerDay'] = sprintf('%0.2f', ($numberOfDays ? $value['totalRoomsBooked'] / $numberOfDays : 0)); $value['sellingPrice'] = Tools::displayPrice($value['sellingPrice'], $currency); $value['totalRevenue'] = Tools::displayPrice($value['totalRevenue'], $currency); - - if ($value['active']) { - $value['active'] = ''.$this->l('Yes').''; - } else { - $value['active'] = ''.$this->l('No').''; - } } $this->_values = $values; diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index c6dd7f867..ec99f900a 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -332,7 +332,7 @@ public function hookAdminStatsModules() $this->html .= ' - + '.$this->l('CSV Export').' '; } From a9ef1e30c162a84bf5f7afc4a7dfc697706973a0 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 3 May 2024 16:53:27 +0530 Subject: [PATCH 07/40] fixed currency distribution not visible according to zone distribution --- modules/statsforecast/statsforecast.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/statsforecast/statsforecast.php b/modules/statsforecast/statsforecast.php index 23a223da7..31cf12d7f 100644 --- a/modules/statsforecast/statsforecast.php +++ b/modules/statsforecast/statsforecast.php @@ -677,6 +677,7 @@ private function getRealCA() LEFT JOIN `'._DB_PREFIX_.'currency` cu ON o.id_currency = cu.id_currency '.$join.' WHERE o.`id_order` IN ('.pSQL($idOrders).') + '.$where.' GROUP BY o.id_currency ORDER BY total DESC'; $ca['currencies'] = Db::getInstance()->executeS($sql); From f0b648ae9653e0aeff66296def9de01ae68f61d6 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 8 May 2024 13:07:30 +0530 Subject: [PATCH 08/40] adjust graph axis title according to date range --- modules/statsregistrations/statsregistrations.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/statsregistrations/statsregistrations.php b/modules/statsregistrations/statsregistrations.php index ea6ff5750..430ddc07c 100644 --- a/modules/statsregistrations/statsregistrations.php +++ b/modules/statsregistrations/statsregistrations.php @@ -190,6 +190,7 @@ protected function setAllTimeValues($layers) protected function setYearValues($layers) { + $this->_titles['x'][] = $this->l('Month'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $mounth = (int)substr($row['date_add'], 5, 2); @@ -202,6 +203,7 @@ protected function setYearValues($layers) protected function setMonthValues($layers) { + $this->_titles['x'][] = $this->l('Date'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $this->_values[(int)Tools::substr($row['date_add'], 8, 2)]++; @@ -210,6 +212,7 @@ protected function setMonthValues($layers) protected function setDayValues($layers) { + $this->_titles['x'][] = $this->l('Time'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $this->_values[(int)Tools::substr($row['date_add'], 11, 2)]++; From 8c659848fa5ff96459b0fabf9c1ee0e2bfc3ae39 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 17 May 2024 14:44:22 +0530 Subject: [PATCH 09/40] Updated pie chart display format, added legend and show value in percentage --- modules/graphnvd3/graphnvd3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/graphnvd3/graphnvd3.php b/modules/graphnvd3/graphnvd3.php index 7dcc9c4be..62b104acf 100644 --- a/modules/graphnvd3/graphnvd3.php +++ b/modules/graphnvd3/graphnvd3.php @@ -91,7 +91,7 @@ public static function hookGraphEngine($params, $drawer) .x(function(d) { return d.label; }) .y(function(d) { return d.value; }) .showLabels(true) - .showLegend(false)' + .labelType("percent")' ); return ' From b9ce8387396dec5dd864ceb061ea986d444f5a07 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 17 May 2024 16:33:13 +0530 Subject: [PATCH 10/40] Fixed Incorrect currency show in order detail in stats room type detail --- modules/statsproduct/statsproduct.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index ec99f900a..2ec1bdce5 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -132,7 +132,9 @@ private function getProducts() private function getSales($id_product) { - $sql = 'SELECT o.`date_add`, o.`id_order`, o.`id_customer`, c.`firstname`, c.`lastname`, od.`product_quantity`, (od.`product_price` * od.`product_quantity`) AS total, od.`tax_name`, od.`product_name`, SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS total_booked + $sql = 'SELECT o.`date_add`, o.`id_order`, o.`id_customer`, c.`firstname`, c.`lastname`, od.`product_quantity`, + (od.`product_price` * od.`product_quantity`) AS total, od.`tax_name`, od.`product_name`, o.`id_currency`, + SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS total_booked FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order` LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (od.`id_order` = hbd.`id_order` AND od.`product_id` = hbd.`id_product`) @@ -266,7 +268,7 @@ public function hookAdminStatsModules() '.$sale['firstname'].' '.$sale['lastname'].' (#'.(int) $sale['id_customer'].')'.' '.($has_attribute ? ''.$sale['product_name'].'' : '').' '.(int)$sale['total_booked'].' - '.Tools::displayprice($sale['total'], $currency).' + '.Tools::displayprice($sale['total'], (int)$sale['id_currency']).' '; } $this->html .= ' From 3cb96190ad1d55e7a7dda93e83ac4384460c7828 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 17 May 2024 16:55:17 +0530 Subject: [PATCH 11/40] Fixed: refunded/canceled rooms still counted as booked rooms in best hotel stats --- modules/statsbestcategories/statsbestcategories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/statsbestcategories/statsbestcategories.php b/modules/statsbestcategories/statsbestcategories.php index ffcc16459..55198a104 100644 --- a/modules/statsbestcategories/statsbestcategories.php +++ b/modules/statsbestcategories/statsbestcategories.php @@ -165,7 +165,7 @@ public function getData() SELECT IFNULL(SUM(DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($date_to).'"), GREATEST(hbd.`date_from`, "'.pSQL($date_from).'"))), 0) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) - WHERE hbd.`id_hotel` = hbi.`id` AND o.`valid` = 1 + WHERE hbd.`id_hotel` = hbi.`id` AND o.`valid` = 1 AND is_refunded = 0 AND hbd.`date_to` > "'.pSQL($date_from).'" AND hbd.`date_from` < "'.pSQL($date_to).'" ) AS totalRoomsBooked, ( From d56a7cb638b5cd7f04e9010e546031d304706c5e Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 17 May 2024 17:21:58 +0530 Subject: [PATCH 12/40] Fixed: The customer does not gets deleted from the newsletter after the admin bans the customer --- modules/blocknewsletter/blocknewsletter.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index a7a0612d6..e8015cde0 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -84,11 +84,23 @@ public function registerHooks() 'actionCustomerAccountAdd', 'registerGDPRConsent', 'actionExportGDPRData', - 'actionDeleteGDPRCustomer' + 'actionDeleteGDPRCustomer', + 'actionObjectCustomerUpdateAfter' ) ); } + public function hookActionObjectCustomerUpdateAfter($params) + { + $objCustomer = $params['object']; + if ($objCustomer->deleted + && ($register_status = $this->isNewsletterRegistered($objCustomer->email)) + && $register_status > 0 + ) { + $this->unregister($objCustomer->email, $register_status); + } + } + public function hookActionExportGDPRData($customer) { if (!Tools::isEmpty($customer['email']) && Validate::isEmail($customer['email'])) { From a693a4594411695d562900e97a343e61a615153f Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 17 May 2024 17:23:13 +0530 Subject: [PATCH 13/40] Fixed: The customer does not gets deleted from the newsletter after the admin deletes the customer --- modules/blocknewsletter/blocknewsletter.php | 12 ++++++++++++ modules/dashactivity/dashactivity.php | 1 + 2 files changed, 13 insertions(+) diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index e8015cde0..4fc61795e 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -85,6 +85,7 @@ public function registerHooks() 'registerGDPRConsent', 'actionExportGDPRData', 'actionDeleteGDPRCustomer', + 'actionObjectCustomerDeleteAfter', 'actionObjectCustomerUpdateAfter' ) ); @@ -101,6 +102,17 @@ public function hookActionObjectCustomerUpdateAfter($params) } } + public function hookActionObjectCustomerDeleteAfter($params) + { + $objCustomer = $params['object']; + if ($objCustomer->deleted + && ($register_status = $this->isNewsletterRegistered($objCustomer->email)) + && $register_status > 0 + ) { + $this->unregister($objCustomer->email, $register_status); + } + } + public function hookActionExportGDPRData($customer) { if (!Tools::isEmpty($customer['email']) && Validate::isEmail($customer['email'])) { diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php index df63c4b60..46fc8c72f 100644 --- a/modules/dashactivity/dashactivity.php +++ b/modules/dashactivity/dashactivity.php @@ -266,6 +266,7 @@ public function hookDashboardData($params) SELECT COUNT(*) FROM `'._DB_PREFIX_.'customer` WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'" + AND `deleted` = 0 '.Shop::addSqlRestriction(Shop::SHARE_ORDER) ); From 0beaafdb87b8bab671a98d67bfabe5911b8acb30 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 17 May 2024 17:35:33 +0530 Subject: [PATCH 14/40] Added graph axis title according to date range --- classes/module/ModuleGraph.php | 4 ++++ modules/statsproduct/statsproduct.php | 1 - modules/statsregistrations/statsregistrations.php | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/module/ModuleGraph.php b/classes/module/ModuleGraph.php index f74e66146..190787bfe 100644 --- a/classes/module/ModuleGraph.php +++ b/classes/module/ModuleGraph.php @@ -77,6 +77,7 @@ protected function setDateGraph($layers, $legend = false) if (is_callable(array($this, 'setDayValues'))) { $this->setDayValues($layers); } + $this->_titles['x'][] = $this->l('Time'); } // If the granularity is inferior to 1 month // @TODO : change to manage 28 to 31 days @@ -110,6 +111,7 @@ protected function setDateGraph($layers, $legend = false) if (is_callable(array($this, 'setMonthValues'))) { $this->setMonthValues($layers); } + $this->_titles['x'][] = $this->l('Date'); } // If the granularity is less than 1 year elseif (strtotime('-1 year', strtotime($this->_employee->stats_date_to)) < strtotime($this->_employee->stats_date_from)) { @@ -141,6 +143,7 @@ protected function setDateGraph($layers, $legend = false) if (is_callable(array($this, 'setYearValues'))) { $this->setYearValues($layers); } + $this->_titles['x'][] = $this->l('Month'); } // If the granularity is greater than 1 year else { @@ -163,6 +166,7 @@ protected function setDateGraph($layers, $legend = false) if (is_callable(array($this, 'setAllTimeValues'))) { $this->setAllTimeValues($layers); } + $this->_titles['x'][] = $this->l('Year'); } } diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index 2ec1bdce5..8a7051421 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -358,7 +358,6 @@ public function setOption($option, $layers = 1) } $this->_titles['main'][] = $this->l('Room nights'); $this->_titles['main'][] = $this->l('Views (x100)'); - $this->_titles['x'] = $this->l('Date'); $this->_titles['y'] = $this->l('Room nights, Views (x100)'); $this->_formats['y'] = 'd'; diff --git a/modules/statsregistrations/statsregistrations.php b/modules/statsregistrations/statsregistrations.php index 430ddc07c..ea6ff5750 100644 --- a/modules/statsregistrations/statsregistrations.php +++ b/modules/statsregistrations/statsregistrations.php @@ -190,7 +190,6 @@ protected function setAllTimeValues($layers) protected function setYearValues($layers) { - $this->_titles['x'][] = $this->l('Month'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $mounth = (int)substr($row['date_add'], 5, 2); @@ -203,7 +202,6 @@ protected function setYearValues($layers) protected function setMonthValues($layers) { - $this->_titles['x'][] = $this->l('Date'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $this->_values[(int)Tools::substr($row['date_add'], 8, 2)]++; @@ -212,7 +210,6 @@ protected function setMonthValues($layers) protected function setDayValues($layers) { - $this->_titles['x'][] = $this->l('Time'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $this->_values[(int)Tools::substr($row['date_add'], 11, 2)]++; From c02870c0531504b2155ff5e4388938f5411d75b7 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 20 May 2024 17:13:33 +0530 Subject: [PATCH 15/40] Fixed: Order prices decimal value not shown according to configuraion during boking from back office --- admin/themes/default/template/controllers/orders/form.tpl | 1 - js/tools.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 933d0a6cc..c1a99a85c 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -1170,7 +1170,6 @@ currency_format = jsonSummary.currency.format; currency_sign = jsonSummary.currency.sign; currency_blank = jsonSummary.currency.blank; - priceDisplayPrecision = jsonSummary.currency.decimals ? 2 : 0; updateCartProducts(jsonSummary.summary.products, jsonSummary.summary.gift_products, jsonSummary.cart.id_address_delivery); updateCartVouchers(jsonSummary.summary.discounts); diff --git a/js/tools.js b/js/tools.js index f62ce81f2..93486eae3 100644 --- a/js/tools.js +++ b/js/tools.js @@ -53,7 +53,7 @@ function formatNumber(value, numberOfDecimal, thousenSeparator, virgule) if (parseInt(numberOfDecimal) === 0) return abs_val_string; - return abs_val_string + virgule + (deci_string > 0 ? deci_string : '00'); + return abs_val_string + virgule + deci_string; } function formatCurrency(price, currencyFormat, currencySign, currencyBlank) From 67a0b2dcf3ac2b11a85a4e82fe312d4e5e9de644 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 22 May 2024 15:15:15 +0530 Subject: [PATCH 16/40] Added: check all and uncheck all option in the tree for normal products and scroll bar for the rendered tree --- admin/themes/default/sass/partials/_tree.sass | 6 +++++- .../helpers/tree/tree_associated_hotels.tpl | 6 ++---- classes/helper/HelperTreeHotels.php | 17 +++++++++++++++++ .../admin/AdminNormalProductsController.php | 6 +++--- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/admin/themes/default/sass/partials/_tree.sass b/admin/themes/default/sass/partials/_tree.sass index b6cb0ecdf..897c29f85 100644 --- a/admin/themes/default/sass/partials/_tree.sass +++ b/admin/themes/default/sass/partials/_tree.sass @@ -62,4 +62,8 @@ .tree-panel-label-title font-weight: 400 margin: 0 - @include padding(0, 0, 0, 8px) \ No newline at end of file + @include padding(0, 0, 0, 8px) + +.tree.cattree + max-height: 350px + overflow-y: auto diff --git a/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl b/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl index 079538e41..4add416b6 100644 --- a/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl +++ b/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl @@ -48,17 +48,15 @@ } {if isset($use_checkbox) && $use_checkbox == true} - function checkAllAssociatedCategories($tree) + function checkAllAssociatedHotels($tree) { $tree.find(':input[type=checkbox]').each(function(){ $(this).prop('checked', true); - - addDefaultCategory($(this)); $(this).parent().addClass('tree-selected'); }); } - function uncheckAllAssociatedCategories($tree) + function uncheckAllAssociatedHotels($tree) { $tree.find(':input[type=checkbox]').each(function(){ $(this).prop('checked', false); diff --git a/classes/helper/HelperTreeHotels.php b/classes/helper/HelperTreeHotels.php index 5849ffb73..dd142943a 100644 --- a/classes/helper/HelperTreeHotels.php +++ b/classes/helper/HelperTreeHotels.php @@ -382,6 +382,23 @@ public function render($data = null) $this->addAction($expand_all); if ($this->useCheckBox()) { + if ($this->useBulkActions()) { + $check_all = new TreeToolbarLink( + 'Check All', + '#', + 'checkAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;', + 'icon-check-sign'); + $check_all->setAttribute('id', 'check-all-'.$this->getId()); + $uncheck_all = new TreeToolbarLink( + 'Uncheck All', + '#', + 'uncheckAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;', + 'icon-check-empty'); + $uncheck_all->setAttribute('id', 'uncheck-all-'.$this->getId()); + $this->addAction($check_all); + $this->addAction($uncheck_all); + } + $this->setNodeFolderTemplate('tree_node_hotel_folder_checkbox.tpl'); $this->setNodeItemTemplate('tree_node_hotel_item_checkbox.tpl'); $this->setAttribute('use_checkbox', $this->useCheckBox()); diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index cf78be63c..1c8027412 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -526,7 +526,7 @@ public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0, // 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, $nothing, true, true, + (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION'), null, false, true, 1, true, null, null, null, null, true, true, $context); } } @@ -2994,7 +2994,7 @@ public function initFormAssociations($obj) ->setUseSearch(false) ->setFullTree(0) ->setSelectedCategories($categories) - ->setUseBulkActions(false); + ->setUseBulkActions(true); $data->assign(array('default_category' => $default_category, 'selected_cat_ids' => implode(',', array_keys($selected_cat)), @@ -3510,7 +3510,7 @@ public function initFormInformations($product) ->setRoomsOnly(false) ->setSelectedHotels($selectedElements['hotels']) ->setSelectedRoomTypes($selectedElements['room_types']) - ->setUseBulkActions(false) + ->setUseBulkActions(true) ->setAccessedHotels(HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 0)); $data->assign('hotel_tree', $tree->render()); From b87f8b9c8409df752a4c4870e532f6d55b751e8c Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 24 May 2024 16:18:19 +0530 Subject: [PATCH 17/40] Fixed: filter input field are saved before validation --- .../template/helpers/list/list_header.tpl | 28 ++- classes/controller/AdminController.php | 212 ++++++++++-------- 2 files changed, 140 insertions(+), 100 deletions(-) diff --git a/admin/themes/default/template/helpers/list/list_header.tpl b/admin/themes/default/template/helpers/list/list_header.tpl index bf7678e4f..70b0c572b 100644 --- a/admin/themes/default/template/helpers/list/list_header.tpl +++ b/admin/themes/default/template/helpers/list/list_header.tpl @@ -291,28 +291,30 @@
{if $params.type == 'range'} + {$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
- - + +
{elseif $params.type == 'bool'} - - - + + {elseif $params.type == 'date' || $params.type == 'datetime'}
- +
- + @@ -366,28 +368,30 @@
{elseif $params.type == 'select'} + {$field_name="`$list_id`Filter_`$params.filter_key`"} {if isset($params.multiple) && $params.multiple} - {if isset($params.list) && is_array($params.list)} {foreach $params.list AS $option_value => $option_display} - + {/foreach} {/if} {else} {if isset($params.filter_key)} - {if isset($params.list) && is_array($params.list)} {foreach $params.list AS $option_value => $option_display} - + {/foreach} {/if} {/if} {/if} {else} - + {$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"} + {/if}
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 6d36f953e..787b527c3 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -841,13 +841,13 @@ public function processFilter() $this->ensureListIdDefinition(); $prefix = $this->getCookieFilterPrefix(); - + $filters = array(); if (isset($this->list_id)) { foreach ($_POST as $key => $value) { if ($value === '') { unset($this->context->cookie->{$prefix.$key}); } elseif (stripos($key, $this->list_id.'Filter_') === 0) { - $this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : json_encode($value); + $filters[$prefix.$key] = !is_array($value) ? $value : json_encode($value); } elseif (stripos($key, 'submitFilter') === 0) { $this->context->cookie->$key = !is_array($value) ? $value : json_encode($value); } @@ -855,7 +855,7 @@ public function processFilter() foreach ($_GET as $key => $value) { if (stripos($key, $this->list_id.'Filter_') === 0) { - $this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : json_encode($value); + $filters[$prefix.$key] = !is_array($value) ? $value : json_encode($value); } elseif (stripos($key, 'submitFilter') === 0) { $this->context->cookie->$key = !is_array($value) ? $value : json_encode($value); } @@ -863,65 +863,36 @@ public function processFilter() if ($value === '' || $value == $this->_defaultOrderBy) { unset($this->context->cookie->{$prefix.$key}); } else { - $this->context->cookie->{$prefix.$key} = $value; + $filters[$prefix.$key] = $value; } } elseif (stripos($key, $this->list_id.'Orderway') === 0 && Validate::isOrderWay($value)) { if ($value === '' || $value == $this->_defaultOrderWay) { unset($this->context->cookie->{$prefix.$key}); } else { - $this->context->cookie->{$prefix.$key} = $value; + $filters[$prefix.$key] = $value; } } } } - $filters = $this->context->cookie->getFamily($prefix.$this->list_id.'Filter_'); - $definition = false; - if (isset($this->className) && $this->className) { - $definition = ObjectModel::getDefinition($this->className); + if (empty($filters)) { + $filters = $this->context->cookie->getFamily($prefix.$this->list_id.'Filter_'); } foreach ($filters as $key => $value) { - /* Extracting filters from $_POST on key filter_ */ - if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) { - $key_org = $key; - $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id)); - /* Table alias could be specified using a ! eg. alias!field */ - $tmp_tab = explode('!', $key); - $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; - - if ($field = $this->filterToField($key, $filter)) { - $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); - if ((($type == 'date' || $type == 'datetime' || $type == 'range') || ($type == 'select' && (isset($field['multiple']) && $field['multiple']))) - && is_string($value) - ) { - $value = json_decode($value, true); - } - $key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`'; - - // as in database 0 means position 1 in the renderlist - if (isset($field['position']) && Validate::isInt($value)) { - $value -= 1; + $key_org = $key; + $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id)); + /* Table alias could be specified using a ! eg. alias!field */ + $tmp_tab = explode('!', $key); + $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; + if ($field = $this->filterToField($key, $filter)) { + $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); + if (($type == 'date' || $type == 'datetime' || $type == 'range')) { + if (is_string($value)) { + $filter_value = json_decode($value, true); } - - // Assignment by reference - if (array_key_exists('tmpTableFilter', $field)) { - $sql_filter = & $this->_tmpTableFilter; - } elseif (array_key_exists('havingFilter', $field)) { - $sql_filter = & $this->_filterHaving; - } else { - $sql_filter = & $this->_filter; - } - - if (is_array($value)) { - if ($type == 'select' && (isset($field['multiple']) && $field['multiple']) && isset($field['operator'])) { - if ($field['operator'] == 'and') { - $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; - $this->_filterHaving .= ' AND COUNT(DISTINCT '.pSQL($key).') = '.(int) count($value); - } elseif ($field['operator'] == 'or') { - $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; - } - } elseif ($type == 'range') { + if (is_array($filter_value)) { + if ($type == 'range') { // set validation type if (isset($field['validation']) && $field['validation'] && method_exists('Validate', $field['validation'])) { $validation = $field['validation']; @@ -929,57 +900,122 @@ public function processFilter() $validation = 'isUnsignedInt'; } - if (isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) { - if (!Validate::$validation($value[0])) { - $this->errors[] = Tools::displayError('The \'From\' value is invalid'); - } else { - $sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]); + if (isset($filter_value[0]) && ($filter_value[0] !== '' || $filter_value[0] === 0)) { + if (!Validate::$validation($filter_value[0])) { + $this->errors[] = sprintf(Tools::displayError('The %s field \'From\' value is invalid'), $field['title']); } } - if (isset($value[1]) && ($value[1] !== '' || $value[1] === 0)) { - if (!Validate::$validation($value[1])) { - $this->errors[] = Tools::displayError('The \'To\' value is invalid'); - } elseif ((isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) && $value[0] > $value[1]) { - $this->errors[] = Tools::displayError('The \'To\' value cannot be less than \'From\' value'); - } else { - $sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]); + if (isset($filter_value[1]) && ($filter_value[1] !== '' || $filter_value[1] === 0)) { + if (!Validate::$validation($filter_value[1])) { + $this->errors[] = sprintf(Tools::displayError('The %s field \'To\' value is invalid'), $field['title']); + } elseif ((isset($filter_value[0]) && ($filter_value[0] !== '' || $filter_value[0] === 0)) && $filter_value[0] > $filter_value[1]) { + $this->errors[] = sprintf(Tools::displayError('The %s field \'To\' value cannot be less than \'From\' value'), $field['title']); } } } else { - if (isset($value[0]) && !empty($value[0])) { - if (!Validate::isDate($value[0])) { - $this->errors[] = Tools::displayError('The \'From\' date format is invalid (YYYY-MM-DD)'); - } else { - $sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; + if (isset($filter_value[0]) && !empty($filter_value[0])) { + if (!Validate::isDate($filter_value[0])) { + $this->errors[] = sprintf(Tools::displayError('The %s field \'From\' date format is invalid (YYYY-MM-DD)'), $field['title']); } } - if (isset($value[1]) && !empty($value[1])) { - if (!Validate::isDate($value[1])) { - $this->errors[] = Tools::displayError('The \'To\' date format is invalid (YYYY-MM-DD)'); - } elseif (isset($value[0]) && !empty($value[0]) && strtotime($value[0]) > strtotime($value[1])) { - $this->errors[] = Tools::displayError('The \'To\' date cannot be earlier than \'From\' date'); - } else { - $sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; + if (isset($filter_value[1]) && !empty($filter_value[1])) { + if (!Validate::isDate($filter_value[1])) { + $this->errors[] = sprintf(Tools::displayError('The %s field \'To\' date format is invalid (YYYY-MM-DD)'), $field['title']); + } elseif (isset($filter_value[0]) && !empty($filter_value[0]) && strtotime($filter_value[0]) > strtotime($filter_value[1])) { + $this->errors[] = sprintf(Tools::displayError('The %s field \'To\' date cannot be earlier than \'From\' date'), $field['title']); } } } - } else { - $sql_filter .= ' AND '; - $check_key = ($key == $this->identifier || $key == '`'.$this->identifier.'`'); - $alias = ($definition && !empty($definition['fields'][$filter]['shop'])) ? 'sa' : 'a'; - - if ($type == 'int' || $type == 'bool') { - $sql_filter .= (($check_key || $key == '`active`') ? $alias.'.' : '').pSQL($key).' = '.(int)$value.' '; - } elseif ($type == 'decimal') { - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.(float)$value.' '; - } elseif ($type == 'select') { - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = \''.pSQL($value).'\' '; - } elseif ($type == 'price') { - $value = (float)str_replace(',', '.', $value); - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.pSQL(trim($value)).' '; + } + } + } + } + + if (empty($this->errors)) { + if ($filters) { + foreach ($filters as $key => $value) { + $this->context->cookie->$key = $value; + } + } + $definition = false; + if (isset($this->className) && $this->className) { + $definition = ObjectModel::getDefinition($this->className); + } + + foreach ($filters as $key => $value) { + /* Extracting filters from $_POST on key filter_ */ + if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) { + $key_org = $key; + $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id)); + /* Table alias could be specified using a ! eg. alias!field */ + $tmp_tab = explode('!', $key); + $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; + + if ($field = $this->filterToField($key, $filter)) { + $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); + if ((($type == 'date' || $type == 'datetime' || $type == 'range') || ($type == 'select' && (isset($field['multiple']) && $field['multiple']))) + && is_string($value) + ) { + $value = json_decode($value, true); + } + $key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`'; + + // as in database 0 means position 1 in the renderlist + if (isset($field['position']) && Validate::isInt($value)) { + $value -= 1; + } + + // Assignment by reference + if (array_key_exists('tmpTableFilter', $field)) { + $sql_filter = & $this->_tmpTableFilter; + } elseif (array_key_exists('havingFilter', $field)) { + $sql_filter = & $this->_filterHaving; + } else { + $sql_filter = & $this->_filter; + } + + if (is_array($value)) { + if ($type == 'select' && (isset($field['multiple']) && $field['multiple']) && isset($field['operator'])) { + if ($field['operator'] == 'and') { + $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; + $this->_filterHaving .= ' AND COUNT(DISTINCT '.pSQL($key).') = '.(int) count($value); + } elseif ($field['operator'] == 'or') { + $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; + } + } elseif ($type == 'range') { + + if (isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) { + $sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]); + } + if (isset($value[1]) && ($value[1] !== '' || $value[1] === 0)) { + $sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]); + } + } else { + if (isset($value[0]) && !empty($value[0])) { + $sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; + } + if (isset($value[1]) && !empty($value[1])) { + $sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; + } + } } else { - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' LIKE \'%'.pSQL(trim($value)).'%\' '; + $sql_filter .= ' AND '; + $check_key = ($key == $this->identifier || $key == '`'.$this->identifier.'`'); + $alias = ($definition && !empty($definition['fields'][$filter]['shop'])) ? 'sa' : 'a'; + + if ($type == 'int' || $type == 'bool') { + $sql_filter .= (($check_key || $key == '`active`') ? $alias.'.' : '').pSQL($key).' = '.(int)$value.' '; + } elseif ($type == 'decimal') { + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.(float)$value.' '; + } elseif ($type == 'select') { + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = \''.pSQL($value).'\' '; + } elseif ($type == 'price') { + $value = (float)str_replace(',', '.', $value); + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.pSQL(trim($value)).' '; + } else { + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' LIKE \'%'.pSQL(trim($value)).'%\' '; + } } } } @@ -1042,7 +1078,7 @@ public function postProcess() if ($this->filter && $this->action != 'reset_filters') { $this->processFilter(); } - if (isset($_POST) && count($_POST) && (int)Tools::getValue('submitFilter'.$this->list_id) || Tools::isSubmit('submitReset'.$this->list_id)) { + if (empty($this->errors) && isset($_POST) && count($_POST) && (int)Tools::getValue('submitFilter'.$this->list_id) || Tools::isSubmit('submitReset'.$this->list_id)) { $this->setRedirectAfter(self::$currentIndex.'&token='.$this->token.(Tools::isSubmit('submitFilter'.$this->list_id) ? '&submitFilter'.$this->list_id.'='.(int)Tools::getValue('submitFilter'.$this->list_id) : '').(isset($_GET['id_'.$this->list_id]) ? '&id_'.$this->list_id.'='.(int)$_GET['id_'.$this->list_id] : '')); } From ab99c61c40d879e24f42df5749ea901920398439 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 28 May 2024 09:38:08 +0530 Subject: [PATCH 18/40] Reverted: The customer deletion process after the admin bans the customer --- modules/blocknewsletter/blocknewsletter.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index 4fc61795e..b2a0025d7 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -86,27 +86,14 @@ public function registerHooks() 'actionExportGDPRData', 'actionDeleteGDPRCustomer', 'actionObjectCustomerDeleteAfter', - 'actionObjectCustomerUpdateAfter' ) ); } - public function hookActionObjectCustomerUpdateAfter($params) - { - $objCustomer = $params['object']; - if ($objCustomer->deleted - && ($register_status = $this->isNewsletterRegistered($objCustomer->email)) - && $register_status > 0 - ) { - $this->unregister($objCustomer->email, $register_status); - } - } - public function hookActionObjectCustomerDeleteAfter($params) { $objCustomer = $params['object']; - if ($objCustomer->deleted - && ($register_status = $this->isNewsletterRegistered($objCustomer->email)) + if (($register_status = $this->isNewsletterRegistered($objCustomer->email)) && $register_status > 0 ) { $this->unregister($objCustomer->email, $register_status); From 6602ef5cc4f63cb9536fc2f3a1b79e2361b71426 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 28 May 2024 11:56:01 +0530 Subject: [PATCH 19/40] Added: The customer messages sent from the contact page will now also be segregated according to the contact selected by the customer --- classes/CustomerThread.php | 5 +++-- controllers/front/ContactController.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index b6ec27283..70db8c507 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -140,14 +140,15 @@ public static function getCustomerMessages($id_customer, $read = null, $id_order return Db::getInstance()->executeS($sql); } - public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order) + public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order, $id_contact = false) { return Db::getInstance()->getValue(' SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm WHERE cm.email = \''.pSQL($email).'\' AND cm.id_shop = '.(int)Context::getContext()->shop->id.' - AND cm.id_order = '.(int)$id_order + AND cm.id_order = '.(int)$id_order.' '. + (($id_contact) ? ' AND cm.id_contact='.(int) $id_contact : ' ') ); } diff --git a/controllers/front/ContactController.php b/controllers/front/ContactController.php index ba68dd08c..8827ebdbf 100644 --- a/controllers/front/ContactController.php +++ b/controllers/front/ContactController.php @@ -77,7 +77,7 @@ public function postProcess() SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop = '.(int)$this->context->shop->id.' AND token = \''.pSQL(Tools::getValue('token')).'\'') ) || ( - $id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, $id_order) + $id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, $id_order, $id_contact) ))) { $fields = Db::getInstance()->executeS(' SELECT cm.id_customer_thread, cm.id_contact, cm.id_customer, cm.id_order, cm.id_product, cm.email From a280f58cf5b56bbcee09b6cd2a20f6cc656a74f7 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 28 May 2024 12:03:54 +0530 Subject: [PATCH 20/40] Fixed best selling room types data --- modules/statsbestproducts/statsbestproducts.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index deb4dd68f..61100c405 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -96,7 +96,7 @@ public function __construct() ), array( 'id' => 'availableRooms', - 'header' => $this->l('Available rooms'), + 'header' => $this->l('Room nights available'), 'dataIndex' => 'availableRooms', 'tooltip' => $this->l('The room nights available for booking for the room type.'), 'align' => 'center', @@ -168,7 +168,10 @@ public function getData() AND hbd.`date_to` > "'.pSQL($date_from).'" AND hbd.`date_from` < "'.pSQL($date_to).'" ) AS totalRoomsBooked, ( - SELECT IFNULL(AVG(hbd.`total_price_tax_excl` / o.`conversion_rate`), 0) + SELECT IFNULL(ROUND( + SUM(hbd.`total_price_tax_excl` * DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($date_to).'"), GREATEST(hbd.`date_from`, "'.pSQL($date_from).'")) / (o.`conversion_rate` * DATEDIFF(hbd.`date_to`, hbd.`date_from`))) / SUM(DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($date_to).'"), GREATEST(hbd.`date_from`, "'.pSQL($date_from).'"))), + 2 + ), 0) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) @@ -176,7 +179,10 @@ public function getData() AND hbd.`date_to` > "'.pSQL($date_from).'" AND hbd.`date_from` < "'.pSQL($date_to).'" ) AS sellingPrice, ( - SELECT IFNULL(SUM(ROUND((DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($date_to).'"), GREATEST(hbd.`date_from`, "'.pSQL($date_from).'")) / DATEDIFF(hbd.`date_to`, hbd.`date_from`)) * (hbd.`total_price_tax_excl` / o.`conversion_rate`) , 2)), 0) + SELECT IFNULL(ROUND( + SUM(hbd.`total_price_tax_excl` * DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($date_to).'"), GREATEST(hbd.`date_from`, "'.pSQL($date_from).'")) / (o.`conversion_rate` * DATEDIFF(hbd.`date_to`, hbd.`date_from`))), + 2 + ), 0) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) From 775c4ab4ddcac852b8f9be271a2ecf2db144e03a Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 31 May 2024 11:17:53 +0530 Subject: [PATCH 21/40] 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 @@ public function initContent() $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 @@ public function initContent() } } - 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 @@ public function initContent() $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 @@ public function setMedia() 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 22/40] 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 23/40] =?UTF-8?q?Fixed:=20OPC=20page=20not=20opening=20whe?= =?UTF-8?q?n=20installed=20QloApps=20in=20=C4=8Ce=C5=A1tina=20(Czech)=20la?= =?UTF-8?q?nguage?= 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 24/40] 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 @@ public function __construct($name, $path = '', $expire = null, $shared_urls = nu $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 25/40] 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 @@ public function getPackageList($flush = false) $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 @@ public function ajaxProcessDeleteRoomLine() // 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 9b13577cdab8e58c73872d04c6f9d0a98a269472 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 6 Jun 2024 20:12:31 +0530 Subject: [PATCH 26/40] 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 6f9d5bccc47f9e315b5e7365f6cae5c4814353d2 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 12 Jun 2024 18:55:28 +0530 Subject: [PATCH 28/40] 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 @@ public function processAdd() $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; - $this->display = 'edit'; - return $customer; - } elseif (trim(Tools::getValue('passwd')) == '') { - $this->validateRules(); - $this->errors[] = Tools::displayError('Password can not be empty.'); + 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'; - } 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 @@ public function processUpdate() $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 70663c991b602270e1386f4ef5d9a1f8bd97fed7 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 21 Jun 2024 14:46:09 +0530 Subject: [PATCH 29/40] fixed: decimal should only shown when currency decimal values are enabled --- admin/themes/default/template/controllers/orders/form.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 259afcfd4..3cd980765 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -1171,6 +1171,7 @@ currency_format = jsonSummary.currency.format; currency_sign = jsonSummary.currency.sign; currency_blank = jsonSummary.currency.blank; + priceDisplayPrecision = parseInt(jsonSummary.currency.decimals) ? {$smarty.const._PS_PRICE_DISPLAY_PRECISION_|intval} : 0; updateCartProducts(jsonSummary.summary.products, jsonSummary.summary.gift_products, jsonSummary.cart.id_address_delivery); updateCartVouchers(jsonSummary.summary.discounts); From 52b9795bf1c585138026970af2efb837c48f7741 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 25 Jun 2024 16:57:23 +0530 Subject: [PATCH 30/40] Added validateBookingOccupancies function to validate the occupancy popup --- .../views/templates/hook/searchForm.tpl | 14 +- .../_partials/occupancy_field.tpl | 20 +-- .../hotel-reservation-theme/js/occupancy.js | 150 +++++++----------- 3 files changed, 73 insertions(+), 111 deletions(-) diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index ea0a97990..ed590139d 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -210,12 +210,14 @@
{/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,117 +163,75 @@ $(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; + return validateBookingOccupancies(e); + } + } + }); - 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(); + 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'); - // start validating above values - if (!adults.length || (adults.length != children.length)) { + // validate values of adults and children + adults.forEach(function (item, index) { + if (isNaN(item) || parseInt(item) < 1) { 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'); - } - }); + $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').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'); + 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 020c1986a31daf80c4a123304f34806e27ec95d9 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 27 Jun 2024 16:31:11 +0530 Subject: [PATCH 31/40] 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 @@ public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0, // 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 32/40] 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 2983e833f4a626d66af341f8e10abc30b9a9d40d Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 3 Jul 2024 10:06:49 +0530 Subject: [PATCH 33/40] Removed non required code from hotel tree script --- .../helpers/tree/tree_associated_hotels.tpl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl b/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl index 4add416b6..8789a990a 100644 --- a/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl +++ b/admin/themes/default/template/controllers/normal_products/helpers/tree/tree_associated_hotels.tpl @@ -60,14 +60,6 @@ { $tree.find(':input[type=checkbox]').each(function(){ $(this).prop('checked', false); - - $('select#id_category_default option[value='+$(this).val()+']').remove(); - if ($('select#id_category_default option').length == 0) - { - $('select#id_category_default').closest('.form-group').hide(); - $('#no_default_category').show(); - } - $(this).parent().removeClass('tree-selected'); }); } From f3e3664118ebafde7037aeaa7efacb7c04e1bcc9 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 3 Jul 2024 17:24:50 +0530 Subject: [PATCH 34/40] moved order opc page js from global.js to order-opc.js --- themes/hotel-reservation-theme/js/global.js | 45 ------------------- .../js/order-confirmation.js | 2 +- .../hotel-reservation-theme/js/order-opc.js | 44 ++++++++++++++++++ 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/themes/hotel-reservation-theme/js/global.js b/themes/hotel-reservation-theme/js/global.js index 2dc525720..ff00f02c0 100644 --- a/themes/hotel-reservation-theme/js/global.js +++ b/themes/hotel-reservation-theme/js/global.js @@ -114,51 +114,6 @@ $(document).ready(function(){ if (e.offsetX >= 16 && e.offsetX <= 39 && e.offsetY >= 16 && e.offsetY <= 34) $(this).fadeOut(); }); - - $(document).on('click', '.open_rooms_extra_services_panel', function() { - 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, - 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%', - 'hideOnContentClick': false, - afterClose: function() { - if (result.reload) { - // reload so that changes prices will reflect everywhere - location.reload(); - } - }, - }); - }, - }); - }); }); diff --git a/themes/hotel-reservation-theme/js/order-confirmation.js b/themes/hotel-reservation-theme/js/order-confirmation.js index 7b4359cf6..87175d20f 100644 --- a/themes/hotel-reservation-theme/js/order-confirmation.js +++ b/themes/hotel-reservation-theme/js/order-confirmation.js @@ -18,7 +18,7 @@ */ $(document).ready(function(){ - $(document).off('click').on('click', '.open_rooms_extra_services_panel', function(e) { + $(document).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'); diff --git a/themes/hotel-reservation-theme/js/order-opc.js b/themes/hotel-reservation-theme/js/order-opc.js index 4bb396e95..7906974a8 100644 --- a/themes/hotel-reservation-theme/js/order-opc.js +++ b/themes/hotel-reservation-theme/js/order-opc.js @@ -546,6 +546,50 @@ $(document).ready(function() } }); + $(document).on('click', '.open_rooms_extra_services_panel', function() { + 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, + 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%', + 'hideOnContentClick': false, + afterClose: function() { + if (result.reload) { + // reload so that changes prices will reflect everywhere + location.reload(); + } + }, + }); + }, + }); + }); + function updateServiceProducts(element) { var operator = $(element).is(':checked') ? 'up' : 'down'; From 7eb08f5dfbc61470b9db598b9b2c00861b522db1 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 3 Jul 2024 17:34:24 +0530 Subject: [PATCH 35/40] merger multiple foreach loop in a single loop --- classes/controller/AdminController.php | 138 ++++++++++++------------- 1 file changed, 68 insertions(+), 70 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index cbc88c89a..876652420 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -933,89 +933,87 @@ public function processFilter() } if (empty($this->errors)) { - if ($filters) { - foreach ($filters as $key => $value) { - $this->context->cookie->$key = $value; - } - } $definition = false; if (isset($this->className) && $this->className) { $definition = ObjectModel::getDefinition($this->className); } + if ($filters) { + foreach ($filters as $key => $value) { + $this->context->cookie->$key = $value; - foreach ($filters as $key => $value) { - /* Extracting filters from $_POST on key filter_ */ - if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) { - $key_org = $key; - $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id)); - /* Table alias could be specified using a ! eg. alias!field */ - $tmp_tab = explode('!', $key); - $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; - - if ($field = $this->filterToField($key, $filter)) { - $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); - if ((($type == 'date' || $type == 'datetime' || $type == 'range') || ($type == 'select' && (isset($field['multiple']) && $field['multiple']))) - && is_string($value) - ) { - $value = json_decode($value, true); - } - $key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`'; + /* Extracting filters from $_POST on key filter_ */ + if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) { + $key_org = $key; + $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id)); + /* Table alias could be specified using a ! eg. alias!field */ + $tmp_tab = explode('!', $key); + $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; + + if ($field = $this->filterToField($key, $filter)) { + $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); + if ((($type == 'date' || $type == 'datetime' || $type == 'range') || ($type == 'select' && (isset($field['multiple']) && $field['multiple']))) + && is_string($value) + ) { + $value = json_decode($value, true); + } + $key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`'; - // as in database 0 means position 1 in the renderlist - if (isset($field['position']) && Validate::isInt($value)) { - $value -= 1; - } + // as in database 0 means position 1 in the renderlist + if (isset($field['position']) && Validate::isInt($value)) { + $value -= 1; + } - // Assignment by reference - if (array_key_exists('tmpTableFilter', $field)) { - $sql_filter = & $this->_tmpTableFilter; - } elseif (array_key_exists('havingFilter', $field)) { - $sql_filter = & $this->_filterHaving; - } else { - $sql_filter = & $this->_filter; - } + // Assignment by reference + if (array_key_exists('tmpTableFilter', $field)) { + $sql_filter = & $this->_tmpTableFilter; + } elseif (array_key_exists('havingFilter', $field)) { + $sql_filter = & $this->_filterHaving; + } else { + $sql_filter = & $this->_filter; + } - if (is_array($value)) { - if ($type == 'select' && (isset($field['multiple']) && $field['multiple']) && isset($field['operator'])) { - if ($field['operator'] == 'and') { - $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; - $this->_filterHaving .= ' AND COUNT(DISTINCT '.pSQL($key).') = '.(int) count($value); - } elseif ($field['operator'] == 'or') { - $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; - } - } elseif ($type == 'range') { + if (is_array($value)) { + if ($type == 'select' && (isset($field['multiple']) && $field['multiple']) && isset($field['operator'])) { + if ($field['operator'] == 'and') { + $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; + $this->_filterHaving .= ' AND COUNT(DISTINCT '.pSQL($key).') = '.(int) count($value); + } elseif ($field['operator'] == 'or') { + $sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')'; + } + } elseif ($type == 'range') { - if (isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) { - $sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]); - } - if (isset($value[1]) && ($value[1] !== '' || $value[1] === 0)) { - $sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]); + if (isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) { + $sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]); + } + if (isset($value[1]) && ($value[1] !== '' || $value[1] === 0)) { + $sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]); + } + } else { + if (isset($value[0]) && !empty($value[0])) { + $sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; + } + if (isset($value[1]) && !empty($value[1])) { + $sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; + } } } else { - if (isset($value[0]) && !empty($value[0])) { - $sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; - } - if (isset($value[1]) && !empty($value[1])) { - $sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; + $sql_filter .= ' AND '; + $check_key = ($key == $this->identifier || $key == '`'.$this->identifier.'`'); + $alias = ($definition && !empty($definition['fields'][$filter]['shop'])) ? 'sa' : 'a'; + + if ($type == 'int' || $type == 'bool') { + $sql_filter .= (($check_key || $key == '`active`') ? $alias.'.' : '').pSQL($key).' = '.(int)$value.' '; + } elseif ($type == 'decimal') { + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.(float)$value.' '; + } elseif ($type == 'select') { + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = \''.pSQL($value).'\' '; + } elseif ($type == 'price') { + $value = (float)str_replace(',', '.', $value); + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.pSQL(trim($value)).' '; + } else { + $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' LIKE \'%'.pSQL(trim($value)).'%\' '; } } - } else { - $sql_filter .= ' AND '; - $check_key = ($key == $this->identifier || $key == '`'.$this->identifier.'`'); - $alias = ($definition && !empty($definition['fields'][$filter]['shop'])) ? 'sa' : 'a'; - - if ($type == 'int' || $type == 'bool') { - $sql_filter .= (($check_key || $key == '`active`') ? $alias.'.' : '').pSQL($key).' = '.(int)$value.' '; - } elseif ($type == 'decimal') { - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.(float)$value.' '; - } elseif ($type == 'select') { - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = \''.pSQL($value).'\' '; - } elseif ($type == 'price') { - $value = (float)str_replace(',', '.', $value); - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.pSQL(trim($value)).' '; - } else { - $sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' LIKE \'%'.pSQL(trim($value)).'%\' '; - } } } } From cc0fc2e9e0cca56af7297169f28ea1f5e5613d92 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 3 Jul 2024 17:45:09 +0530 Subject: [PATCH 36/40] added additional characted that are allowd in URL --- classes/Cookie.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 312837ee1..90dbc9509 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -89,8 +89,8 @@ public function __construct($name, $path = '', $expire = null, $shared_urls = nu $this->_path = '/'.$this->_path; } $this->_path = rawurlencode($this->_path); - $search = array('%2F', '%7E', '%28', '%29'); - $replace = array('/', '~', '(', ')'); + $search = array('%2F', '%7E', '%28', '%29', '%2B', '%26'); + $replace = array('/', '~', '(', ')', '+', '&'); $this->_path = str_replace($search, $replace, $this->_path); $this->_domain = $this->getDomain($shared_urls); $this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE'); From 08a0f9fd3bc8ffb907ffb380055f9c5b5cf8ab8f Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 4 Jul 2024 11:29:26 +0530 Subject: [PATCH 37/40] Removed non required code --- controllers/admin/AdminCustomersController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 93fc9ed6b..008ef64c6 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -1077,7 +1077,6 @@ public function processUpdate() $customer->getByEmail($customer_email); } else { $this->errors[] = Tools::displayError('Invalid email address.'); - $this->display = 'edit'; } if (($customer->id) && ($customer->id != (int)$this->object->id)) { From c7bcb85d9a6aa4292df201c46cb73e3dfc823723 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 4 Jul 2024 12:17:13 +0530 Subject: [PATCH 38/40] fixed integer data is shown as decimal in pie chart --- modules/graphnvd3/graphnvd3.php | 1 + modules/statsbestcategories/statsbestcategories.php | 2 +- modules/statsbestproducts/statsbestproducts.php | 2 +- modules/statspersonalinfos/statspersonalinfos.php | 12 ++++++++---- modules/statssales/statssales.php | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/graphnvd3/graphnvd3.php b/modules/graphnvd3/graphnvd3.php index 62b104acf..f2439f53b 100644 --- a/modules/graphnvd3/graphnvd3.php +++ b/modules/graphnvd3/graphnvd3.php @@ -92,6 +92,7 @@ public static function hookGraphEngine($params, $drawer) .y(function(d) { return d.value; }) .showLabels(true) .labelType("percent")' + .((isset($params['format']) && $params['format']) ? '.valueFormat(d3.format("'.$params['format'].'"))' : '') ); return ' diff --git a/modules/statsbestcategories/statsbestcategories.php b/modules/statsbestcategories/statsbestcategories.php index 55198a104..1ec55aa3c 100644 --- a/modules/statsbestcategories/statsbestcategories.php +++ b/modules/statsbestcategories/statsbestcategories.php @@ -62,7 +62,7 @@ public function __construct() ), array( 'id' => 'totalRoomsBooked', - 'header' => $this->l('Rooms booked'), + 'header' => $this->l('Room nights booked'), 'dataIndex' => 'totalRoomsBooked', 'align' => 'center', 'tooltip' => $this->l('The room nights booked for the hotel.'), diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index 61100c405..537e63f1a 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -70,7 +70,7 @@ public function __construct() ), array( 'id' => 'totalRoomsBooked', - 'header' => $this->l('Rooms booked'), + 'header' => $this->l('Room nights booked'), 'dataIndex' => 'totalRoomsBooked', 'tooltip' => $this->l('The room nights booked for the room type.'), 'align' => 'center', diff --git a/modules/statspersonalinfos/statspersonalinfos.php b/modules/statspersonalinfos/statspersonalinfos.php index 045ac0f4e..a0e30f0d6 100644 --- a/modules/statspersonalinfos/statspersonalinfos.php +++ b/modules/statspersonalinfos/statspersonalinfos.php @@ -116,7 +116,8 @@ public function hookAdminStatsModules()
'.$this->engine(array( 'type' => 'pie', - 'option' => 'gender' + 'option' => 'gender', + 'format' => 'd' )).'
@@ -133,7 +134,8 @@ public function hookAdminStatsModules()
'.$this->engine(array( 'type' => 'pie', - 'option' => 'age' + 'option' => 'age', + 'format' => 'd' )).'
@@ -150,7 +152,8 @@ public function hookAdminStatsModules()
'.$this->engine(array( 'type' => 'pie', - 'option' => 'country' + 'option' => 'country', + 'format' => 'd' )).'
@@ -167,7 +170,8 @@ public function hookAdminStatsModules()
'.$this->engine(array( 'type' => 'pie', - 'option' => 'currency' + 'option' => 'currency', + 'format' => 'd' )).'
diff --git a/modules/statssales/statssales.php b/modules/statssales/statssales.php index cda0279cb..264ddc207 100644 --- a/modules/statssales/statssales.php +++ b/modules/statssales/statssales.php @@ -176,6 +176,7 @@ public function hookAdminStatsModules() '.($totals['orderCount'] ? $this->engine(array( 'type' => 'pie', 'option' => '3-'.(int)Tools::getValue('id_country').'-'.(int)Tools::getValue('id_hotel'), + 'format' => 'd' )) : $this->l('No orders found.')).'
From fd79b68b460b9fa0204456e5591452635e24db74 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 4 Jul 2024 16:43:15 +0530 Subject: [PATCH 39/40] fixed additional RTL issues --- .../sass/controllers/_modules_catalog.sass | 8 +++-- .../_button-groups-rtl.sass | 8 +---- .../bootstrap-rtl-sass/_merged-rtl.sass | 19 +++++++---- .../modules_catalog/modules_list.tpl | 10 +++--- .../dashactivity/views/css/dashactivity.css | 19 +++++------ .../templates/hook/dashboard_zone_one.tpl | 33 ++++++++++--------- 6 files changed, 49 insertions(+), 48 deletions(-) diff --git a/admin/themes/default/sass/controllers/_modules_catalog.sass b/admin/themes/default/sass/controllers/_modules_catalog.sass index 67c7b45f4..74a40fc8f 100644 --- a/admin/themes/default/sass/controllers/_modules_catalog.sass +++ b/admin/themes/default/sass/controllers/_modules_catalog.sass @@ -53,10 +53,12 @@ .module-info-wrapper position: relative height: 100% - .module-logo img - max-height: 60px + .module-logo + display: flex + gap: 10px margin-bottom: 20px - margin-right: 10px + img + max-height: 60px .panel-action .module-price font-size: 14px diff --git a/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_button-groups-rtl.sass b/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_button-groups-rtl.sass index 052bd3634..52404f5f6 100644 --- a/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_button-groups-rtl.sass +++ b/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_button-groups-rtl.sass @@ -2,14 +2,8 @@ // Button groups // -------------------------------------------------- -// Make the div behave like a button -.btn-group, -.btn-group-vertical - > .btn - float: right - // Prevent double borders when buttons are next to each other -.btn-group +.btn-group .btn + .btn, .btn + .btn-group, .btn-group + .btn, diff --git a/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_merged-rtl.sass b/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_merged-rtl.sass index 835e73b6f..a302d5d30 100644 --- a/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_merged-rtl.sass +++ b/admin/themes/default/sass/vendor/bootstrap-rtl-sass/_merged-rtl.sass @@ -118,7 +118,7 @@ h1, h2, h3, h4, h5, h6, border-radius: $border-radius-base $border-radius-base 0 0 // pulling this in mainly for less shorthand - &.nav-justified + &.nav-justified @extend .nav-justified @extend .nav-tabs-justified @@ -169,9 +169,9 @@ h1, h2, h3, h4, h5, h6, // The dropdown menu (ul) .dropdown-menu - right: 0 - float: left - left: auto + right: unset + float: right + left: 0 // Aligns the dropdown menu to left &.pull-left @@ -185,6 +185,11 @@ h1, h2, h3, h4, h5, h6, float: right right: auto +.pull-right > .dropdown-menu + right: unset + float: right + left: 0 + // Right aligned menus need alt position .navbar-nav.pull-left > li > .dropdown-menu, .navbar-nav > li > .dropdown-menu.pull-left @@ -338,13 +343,13 @@ h1, h2, h3, h4, h5, h6, // Popovers // ------------------------- -.popover.top, +.popover.top, .popover.bottom direction:ltr -.popover.top .popover-title, +.popover.top .popover-title, .popover.top .popover-content, -.popover.bottom .popover-title, +.popover.bottom .popover-title, .popover.bottom .popover-content direction: rtl text-align: right diff --git a/admin/themes/default/template/controllers/modules_catalog/modules_list.tpl b/admin/themes/default/template/controllers/modules_catalog/modules_list.tpl index 22113e45c..02226f20a 100644 --- a/admin/themes/default/template/controllers/modules_catalog/modules_list.tpl +++ b/admin/themes/default/template/controllers/modules_catalog/modules_list.tpl @@ -22,10 +22,12 @@
-