From 586373da706ee72d832b7e54b460a07555b9bd54 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 3 Aug 2023 21:08:48 +0530 Subject: [PATCH 01/32] Fix missing index.php file --- .../smarty_internal_method_clearcompiledtemplate.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/tools/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php index bf4929807..d1b21ee68 100644 --- a/tools/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php +++ b/tools/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php @@ -114,6 +114,11 @@ class Smarty_Internal_Method_ClearCompiledTemplate $unlink = true; } } + + if (substr($_filepath, -9) == 'index.php') { + $unlink = false; + } + if ($unlink && is_file($_filepath) && @unlink($_filepath)) { $_count++; if (function_exists('opcache_invalidate') From 309887312a12c1d306de2538a564ae905edc837d Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 4 Aug 2023 12:25:38 +0530 Subject: [PATCH 02/32] Remove Add a new module button if not applicable --- .../modules/page_header_toolbar.tpl | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl b/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl index 8396a808b..f6cfd6740 100644 --- a/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl +++ b/admin/themes/default/template/controllers/modules/page_header_toolbar.tpl @@ -67,20 +67,22 @@
{l s='Recommended Modules and Services'}
- {if $add_permission eq '1' && ($context_mode != Context::MODE_HOST)} -
  • - - -
    {l s='Add a new module'}
    -
    -
  • - {else} -
  • - - -
    {l s='Add a new module'}
    -
    -
  • + {if $add_permission eq '1'} + {if $context_mode != Context::MODE_HOST} +
  • + + +
    {l s='Add a new module'}
    +
    +
  • + {else} +
  • + + +
    {l s='Add a new module'}
    +
    +
  • + {/if} {/if} {if isset($help_link)} {*
  • From 3524640cec0708587bcdf0d624906d3b3970039f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 4 Aug 2023 12:50:16 +0530 Subject: [PATCH 03/32] Fix gender icon in Groups list --- admin/themes/default/template/helpers/list/list_content.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/themes/default/template/helpers/list/list_content.tpl b/admin/themes/default/template/helpers/list/list_content.tpl index 169041dc6..af5674265 100644 --- a/admin/themes/default/template/helpers/list/list_content.tpl +++ b/admin/themes/default/template/helpers/list/list_content.tpl @@ -99,6 +99,8 @@ {else} {$tr[$key]['alt']} {/if} + {else} + {/if} {elseif isset($params.type) && $params.type == 'price'} {if isset($tr.id_currency)} From 4783a0ccda62e37dfb1d654a4581f8729a3ff6c4 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 4 Aug 2023 14:29:57 +0530 Subject: [PATCH 04/32] Fix cancellation charge amount issue --- .../classes/HotelOrderRefundRules.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php index 0cdc01615..91b472101 100644 --- a/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php +++ b/modules/hotelreservationsystem/classes/HotelOrderRefundRules.php @@ -186,14 +186,6 @@ class HotelOrderRefundRules extends ObjectModel if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) { $bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE; $bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100); - - if ($defaultCurrency != $orderCurrency) { - $bookingCancellationDetail['cancelation_charge'] = Tools::convertPriceFull( - $bookingCancellationDetail['cancelation_charge'], - $objDefaultCurrency, - $objOrderCurrency - ); - } } else { $bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED; if ($defaultCurrency != $orderCurrency) { From 9a577436da86224fad3597603a048a1eb6cbe315 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 7 Aug 2023 15:04:22 +0530 Subject: [PATCH 05/32] Fix add new button issue on Webservice page --- controllers/admin/AdminWebserviceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminWebserviceController.php b/controllers/admin/AdminWebserviceController.php index e2e4a2865..151c0f79c 100644 --- a/controllers/admin/AdminWebserviceController.php +++ b/controllers/admin/AdminWebserviceController.php @@ -102,7 +102,7 @@ class AdminWebserviceControllerCore extends AdminController public function initPageHeaderToolbar() { - if (empty($this->display)) { + if (!in_array($this->display, array('add', 'edit')) ) { $this->page_header_toolbar_btn['new_webservice'] = array( 'href' => self::$currentIndex.'&addwebservice_account&token='.$this->token, 'desc' => $this->l('Add new webservice key', null, null, false), From cb4c50d5ebdc517ce76a8c9d598ac5a115cc3c82 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 7 Aug 2023 18:35:17 +0530 Subject: [PATCH 06/32] Change cookie key prefix to QloApps --- classes/Cookie.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 29b89b697..0edb66672 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -93,7 +93,7 @@ class CookieCore $this->_path = str_replace('%7E', '~', $this->_path); $this->_domain = $this->getDomain($shared_urls); $this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE'); - $this->_name = 'PrestaShop-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain); + $this->_name = 'QloApps-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain); $this->_allow_writing = true; $this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_; if ($this->_standalone) { From 3e7bc6b9969c0edb5e7e84904c4259bc0149ad16 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 8 Aug 2023 12:10:32 +0530 Subject: [PATCH 07/32] Disable cart popup options at back office if not useful --- .../views/js/admin/hotel_rooms_booking.js | 6 ++++++ .../admin/hotel_rooms_booking/helpers/view/view.tpl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js index d02a0b756..722661361 100644 --- a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js +++ b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js @@ -869,6 +869,12 @@ $(document).ready(function() { $("#cartModal").html(result.cart_content); } $("#cart_record").html(result.total_products_in_cart); + + if (parseInt(result.total_products_in_cart) > 0) { + $('#cart_record').closest('button').removeClass('disabled'); + } else { + $('#cart_record').closest('button').addClass('disabled'); + } } } }); diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl index 936793a14..4c54fdddd 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl @@ -188,7 +188,7 @@
    {if !isset($booking_product) || (isset($booking_product) && $booking_product == 1)}{l s='Booking Calender' mod='hotelreservationsystem'}{else}{l s='Service Products' mod='hotelreservationsystem'}{/if } - +
    {if !isset($booking_product) || (isset($booking_product) && $booking_product == 1)}
    From c7d04d7c6ad7ee3c47ea70753fbb56c716d20a34 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 10 Aug 2023 19:13:47 +0530 Subject: [PATCH 08/32] Add India to top countries during installation --- install/controllers/http/configure.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install/controllers/http/configure.php b/install/controllers/http/configure.php index a03dacfcf..a8ef6af3c 100644 --- a/install/controllers/http/configure.php +++ b/install/controllers/http/configure.php @@ -277,11 +277,12 @@ class InstallControllerHttpConfigure extends InstallControllerHttp $this->list_countries = array(); $countries = $this->language->getCountries(); $top_countries = array( - 'fr', 'es', 'us', - 'gb', 'it', 'de', - 'nl', 'pl', 'id', - 'be', 'br', 'se', - 'ca', 'ru', 'cn', + 'in', 'fr', 'es', + 'us', 'gb', 'it', + 'de', 'nl', 'pl', + 'id', 'be', 'br', + 'se', 'ca', 'ru', + 'cn', ); foreach ($top_countries as $iso) { From d3a9bcf66b8c34442a600c1ff8146c0b5f62d2a6 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 18 Aug 2023 13:10:22 +0530 Subject: [PATCH 09/32] Fix PHP warning on removing room from cart popup --- controllers/front/CartController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/CartController.php b/controllers/front/CartController.php index e3a37df06..d08db7b51 100644 --- a/controllers/front/CartController.php +++ b/controllers/front/CartController.php @@ -361,7 +361,7 @@ class CartControllerCore extends FrontController $this->errors[] = Tools::displayError('You can\'t book room after date '.$maxOrdDate); } } - if ($occupancyRequiredForBooking) { + if ($occupancyRequiredForBooking && $operator == 'up' ) { foreach($occupancy as $key => $roomOccupancy) { if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) { $this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']); From 61551699a9d6c9012cb8a49e5a34b3c4275c20d3 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 22 Aug 2023 19:45:58 +0530 Subject: [PATCH 10/32] Fix stats update issue on admin Book Now page --- .../controllers/admin/AdminHotelRoomsBookingController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 6146e43f4..af45527dc 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -418,7 +418,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $bookingParams['date_from'] = $searchDateFrom; $bookingParams['date_to'] = $searchDateTo; $bookingParams['hotel_id'] = $searchIdHotel; - $bookingParams['room_type'] = $searchIdRoomType; + $bookingParams['id_room_type'] = $searchIdRoomType; $bookingParams['adults'] = $adults; $bookingParams['children'] = $children; $bookingParams['num_rooms'] = $num_rooms; From bb9ebbe11bb2af0560e8a72d71c6f2ce47d58208 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 24 Aug 2023 18:50:17 +0530 Subject: [PATCH 11/32] Remove password field from new account email sent to customer --- controllers/front/AuthController.php | 1 - mails/en/account.html | 1 - mails/en/account.txt | 2 -- 3 files changed, 4 deletions(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 320da13dd..e3eeb87b3 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -788,7 +788,6 @@ class AuthControllerCore extends FrontController '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, - '{passwd}' => str_repeat('*', strlen(Tools::getValue('passwd'))), ), $customer->email, $customer->firstname.' '.$customer->lastname diff --git a/mails/en/account.html b/mails/en/account.html index 442df52ef..cd8acc616 100644 --- a/mails/en/account.html +++ b/mails/en/account.html @@ -90,7 +90,6 @@ Here are your login details:
    E-mail address: {email}
    - Password: {passwd}
    diff --git a/mails/en/account.txt b/mails/en/account.txt index a655394b8..45c45c880 100644 --- a/mails/en/account.txt +++ b/mails/en/account.txt @@ -9,8 +9,6 @@ Here are your login details: E-MAIL ADDRESS: {email} -PASSWORD: {passwd} - Important Security Tips: * Always keep your account details safe. From ee6fce84bb702ef7ec9fc99c5af3b9841da00f0f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 24 Aug 2023 19:00:58 +0530 Subject: [PATCH 12/32] Allow errors set from hook actionBeforeAuthentication prevent customer login --- controllers/front/AuthController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 320da13dd..db3e1da21 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -294,7 +294,9 @@ class AuthControllerCore extends FrontController $this->errors[] = Tools::displayError('Password is required.'); } elseif (!Validate::isPasswd($passwd)) { $this->errors[] = Tools::displayError('Invalid password.'); - } else { + } + + if (!count($this->errors)) { $customer = new Customer(); $authentication = $customer->getByEmail(trim($email), trim($passwd)); if (isset($authentication->active) && !$authentication->active) { @@ -321,6 +323,7 @@ class AuthControllerCore extends FrontController } } } + if ($this->ajax) { $return = array( 'hasError' => !empty($this->errors), From 1de8b5fd2cefda994cccdf1c53a9ae3cf2efa1fc Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 25 Aug 2023 13:31:38 +0530 Subject: [PATCH 13/32] Validate value of Position filter in renderList --- classes/controller/AdminController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index ea3a469f7..9b1b6b298 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -881,7 +881,7 @@ class AdminControllerCore extends Controller $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'])) { + if (isset($field['position']) && Validate::isInt($value)) { $value -= 1; } From eedbb9c69e31730dbb09022f1c2bfceed332a2cb Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 25 Aug 2023 22:10:26 +0530 Subject: [PATCH 14/32] Do not auto login customer after passsword reset --- controllers/front/PasswordController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/controllers/front/PasswordController.php b/controllers/front/PasswordController.php index f5c8c38fd..317818c87 100644 --- a/controllers/front/PasswordController.php +++ b/controllers/front/PasswordController.php @@ -84,9 +84,6 @@ class PasswordControllerCore extends FrontController '{passwd}' => $password ); if (Mail::Send($this->context->language->id, 'password', Mail::l('Your new password'), $mail_params, $customer->email, $customer->firstname.' '.$customer->lastname)) { - - $this->context->updateCustomer($customer); - $this->context->smarty->assign(array('confirmation' => 1, 'customer_email' => $customer->email)); } else { $this->errors[] = Tools::displayError('An error occurred while sending the email.'); From 78a9db9e87ccbe4ca94d26f7ecf870dbf74a3d7e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 28 Aug 2023 19:49:26 +0530 Subject: [PATCH 15/32] Comment Pagination panel on Preferences > Room Types page --- controllers/admin/AdminPPreferencesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminPPreferencesController.php b/controllers/admin/AdminPPreferencesController.php index 1ea8b3f50..f021fa9d7 100644 --- a/controllers/admin/AdminPPreferencesController.php +++ b/controllers/admin/AdminPPreferencesController.php @@ -197,7 +197,7 @@ class AdminPPreferencesControllerCore extends AdminController ), 'submit' => array('title' => $this->l('Save')) ), - 'order_by_pagination' => array( + /*'order_by_pagination' => array( 'title' => $this->l('Pagination'), 'fields' => array( 'PS_PRODUCTS_PER_PAGE' => array( @@ -241,7 +241,7 @@ class AdminPPreferencesControllerCore extends AdminController ) ), 'submit' => array('title' => $this->l('Save')) - ), + ),*/ 'fo_product_page' => array( 'title' => $this->l('Room type page'), 'fields' => array( From b2902a4c90ee09994c2d858af7e66d4821309a7e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 5 Sep 2023 11:53:23 +0530 Subject: [PATCH 16/32] Fix 'Controller not found issue' for hotelreservation module --- ...lReservationSystemManagementController.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php new file mode 100644 index 000000000..26ed1be94 --- /dev/null +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php @@ -0,0 +1,28 @@ +context->link->getAdminLink('AdminHotelRoomsBooking')); + } +} From 4fe7cefca424f656e48819cd66c4597e0f980a34 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 7 Sep 2023 10:24:17 +0530 Subject: [PATCH 17/32] Replace icon with Social title --- .../template/helpers/list/list_content.tpl | 2 -- controllers/admin/AdminGroupsController.php | 16 ++++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/admin/themes/default/template/helpers/list/list_content.tpl b/admin/themes/default/template/helpers/list/list_content.tpl index af5674265..169041dc6 100644 --- a/admin/themes/default/template/helpers/list/list_content.tpl +++ b/admin/themes/default/template/helpers/list/list_content.tpl @@ -99,8 +99,6 @@ {else} {$tr[$key]['alt']} {/if} - {else} - {/if} {elseif isset($params.type) && $params.type == 'price'} {if isset($tr.id_currency)} diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index 54ea51ffd..c22e02be7 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -175,13 +175,12 @@ class AdminGroupsControllerCore extends AdminController protected function renderCustomersList($group) { - $genders = array(0 => '?'); - $genders_icon = array('default' => 'unknown.gif'); - foreach (Gender::getGenders() as $gender) { - /** @var Gender $gender */ - $genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg'; - $genders[$gender->id] = $gender->name; + $titles_array = array(); + $genders = Gender::getGenders($this->context->language->id); + foreach ($genders as $gender) { + $titles_array[$gender->id_gender] = $gender->name; } + $this->table = 'customer_group'; $this->lang = false; $this->list_id = 'customer_group'; @@ -194,7 +193,7 @@ class AdminGroupsControllerCore extends AdminController $this->fields_list = (array( 'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'filter_key' => 'c!id_customer', 'class' => 'fixed-width-xs'), - 'id_gender' => array('title' => $this->l('Social title'), 'icon' => $genders_icon, 'list' => $genders), + 'title' => array('title' => $this->l('Social title'), 'filter_key' => 'c!id_gender', 'type' => 'select', 'list' => $titles_array), 'firstname' => array('title' => $this->l('First name')), 'lastname' => array('title' => $this->l('Last name')), 'email' => array('title' => $this->l('Email address'), 'filter_key' => 'c!email', 'orderby' => true), @@ -202,8 +201,9 @@ class AdminGroupsControllerCore extends AdminController 'date_add' => array('title' => $this->l('Registration date'), 'type' => 'date', 'class' => 'fixed-width-md', 'align' => 'center'), 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'class' => 'fixed-width-sm', 'type' => 'bool', 'search' => false, 'orderby' => false, 'filter_key' => 'c!active', 'callback' => 'printOptinIcon') )); - $this->_select = 'c.*, a.id_group'; + $this->_select = 'c.*, a.id_group, gl.`name` AS title'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)'; + $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'gender_lang gl ON (gl.`id_gender` = c.`id_gender` AND gl.`id_lang` = '.(int) $this->context->language->id.')'; $this->_where = 'AND a.`id_group` = '.(int)$group->id.' AND c.`deleted` != 1'; $this->_where .= Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c'); self::$currentIndex = self::$currentIndex.'&id_group='.(int)$group->id.'&viewgroup'; From e70021751e5e4e03715960d9ee2756142e7c5a04 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 7 Sep 2023 11:39:03 +0530 Subject: [PATCH 18/32] Redirect after options update --- controllers/admin/AdminWebserviceController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminWebserviceController.php b/controllers/admin/AdminWebserviceController.php index 151c0f79c..f44c412cb 100644 --- a/controllers/admin/AdminWebserviceController.php +++ b/controllers/admin/AdminWebserviceController.php @@ -102,7 +102,7 @@ class AdminWebserviceControllerCore extends AdminController public function initPageHeaderToolbar() { - if (!in_array($this->display, array('add', 'edit')) ) { + if (empty($this->display)) { $this->page_header_toolbar_btn['new_webservice'] = array( 'href' => self::$currentIndex.'&addwebservice_account&token='.$this->token, 'desc' => $this->l('Add new webservice key', null, null, false), @@ -118,6 +118,10 @@ class AdminWebserviceControllerCore extends AdminController { parent::processUpdateOptions(); Tools::generateHtaccess(); + + if (!count($this->errors)) { + Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=6'); + } } public function renderForm() From de8f096987e5bf423d08cc96c1101df37aebb097 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 7 Sep 2023 16:47:37 +0530 Subject: [PATCH 19/32] Improve code in CartController.php --- controllers/front/CartController.php | 62 ++++++++++++++-------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/controllers/front/CartController.php b/controllers/front/CartController.php index d08db7b51..25ed52255 100644 --- a/controllers/front/CartController.php +++ b/controllers/front/CartController.php @@ -319,25 +319,23 @@ class CartControllerCore extends FrontController $serviceProducts = json_decode(Tools::getValue('serviceProducts'),true); // valdiate occupancy if providede - if ($operator == 'up') { - if ($occupancyRequiredForBooking) { - foreach($occupancy as $key => $roomOccupancy) { - if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) { - $this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1)); + if ($operator == 'up' && $occupancyRequiredForBooking) { + foreach($occupancy as $key => $roomOccupancy) { + if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) { + $this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1)); + } + if (isset($roomOccupancy['children'])) { + if (!Validate::isUnsignedInt($roomOccupancy['children'])) { + $this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1)); } - if (isset($roomOccupancy['children'])) { - if (!Validate::isUnsignedInt($roomOccupancy['children'])) { - $this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1)); - } - if ($roomOccupancy['children'] > 0) { - if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) { - $this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1)); - } else { - if (is_array($roomOccupancy['child_ages'])) { - foreach($roomOccupancy['child_ages'] as $childAge) { - if (!Validate::isUnsignedInt($childAge)) { - $this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1)); - } + if ($roomOccupancy['children'] > 0) { + if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) { + $this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1)); + } else { + if (is_array($roomOccupancy['child_ages'])) { + foreach($roomOccupancy['child_ages'] as $childAge) { + if (!Validate::isUnsignedInt($childAge)) { + $this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1)); } } } @@ -345,6 +343,20 @@ class CartControllerCore extends FrontController } } } + + if (!count($this->errors)) { + foreach($occupancy as $key => $roomOccupancy) { + if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) { + $this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']); + } + if ($roomOccupancy['children'] > $roomTypeInfo['max_children']) { + $this->errors[] = sprintf(Tools::displayError('Room %s cannot have children more than %s'), $key + 1, $roomTypeInfo['max_children']); + } + if ($roomOccupancy['adults'] + $roomOccupancy['children'] > $roomTypeInfo['max_guests']) { + $this->errors[] = sprintf(Tools::displayError('Room %s cannot have total guests more than %s'), $key + 1, $roomTypeInfo['max_guests']); + } + } + } } if ($id_hotel = $roomTypeInfo['id_hotel']) { @@ -361,19 +373,7 @@ class CartControllerCore extends FrontController $this->errors[] = Tools::displayError('You can\'t book room after date '.$maxOrdDate); } } - if ($occupancyRequiredForBooking && $operator == 'up' ) { - foreach($occupancy as $key => $roomOccupancy) { - if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) { - $this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']); - } - if ($roomOccupancy['children'] > $roomTypeInfo['max_children']) { - $this->errors[] = sprintf(Tools::displayError('Room %s cannot have children more than %s'), $key + 1, $roomTypeInfo['max_children']); - } - if ($roomOccupancy['adults'] + $roomOccupancy['children'] > $roomTypeInfo['max_guests']) { - $this->errors[] = sprintf(Tools::displayError('Room %s cannot have total guests more than %s'), $key + 1, $roomTypeInfo['max_guests']); - } - } - } + if (!$this->errors) { $objBookingDetail = new HotelBookingDetail(); $num_days = $objBookingDetail->getNumberOfDays($date_from, $date_to); From 7df5c2d4cc10109fa57fc5bdc16b11c121b9851f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 7 Sep 2023 20:01:08 +0530 Subject: [PATCH 20/32] Remove tabs Search Engines and Referers from Stats tab --- controllers/admin/AdminReferrersController.php | 3 +++ controllers/admin/AdminSearchEnginesController.php | 3 +++ install/data/xml/tab.xml | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminReferrersController.php b/controllers/admin/AdminReferrersController.php index ee8da2c2b..bed1574e2 100644 --- a/controllers/admin/AdminReferrersController.php +++ b/controllers/admin/AdminReferrersController.php @@ -60,6 +60,9 @@ class AdminReferrersControllerCore extends AdminController { public function __construct() { + // redirect to Dashboard for stats related to Referers + Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminDashboard')); + $this->bootstrap = true; $this->table = 'referrer'; $this->className = 'Referrer'; diff --git a/controllers/admin/AdminSearchEnginesController.php b/controllers/admin/AdminSearchEnginesController.php index 9716e9501..92d4c1929 100644 --- a/controllers/admin/AdminSearchEnginesController.php +++ b/controllers/admin/AdminSearchEnginesController.php @@ -31,6 +31,9 @@ class AdminSearchEnginesControllerCore extends AdminController { public function __construct() { + // redirect to Dashboard for stats related to Search Engines + Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminDashboard')); + $this->bootstrap = true; $this->table = 'search_engine'; $this->className = 'SearchEngine'; diff --git a/install/data/xml/tab.xml b/install/data/xml/tab.xml index a20e6c70e..c7a7efae0 100644 --- a/install/data/xml/tab.xml +++ b/install/data/xml/tab.xml @@ -285,12 +285,12 @@ AdminStats - + + AdminWarehouses From da391c9e9e45df3823e307d71a347e1131572ed6 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 12 Sep 2023 18:36:34 +0530 Subject: [PATCH 21/32] Do not add tab AdminParentStats on installation --- admin/themes/default/sass/partials/_icons.sass | 2 +- install/data/xml/tab.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/themes/default/sass/partials/_icons.sass b/admin/themes/default/sass/partials/_icons.sass index 6788aad63..d6fdf4f09 100644 --- a/admin/themes/default/sass/partials/_icons.sass +++ b/admin/themes/default/sass/partials/_icons.sass @@ -311,7 +311,7 @@ @extend .icon-cogs .icon-AdminAdmin @extend .icon-cog -.icon-AdminParentStats +.icon-AdminStats @extend .icon-bar-chart .icon-AdminStock @extend .icon-archive diff --git a/install/data/xml/tab.xml b/install/data/xml/tab.xml index c7a7efae0..2cf64422d 100644 --- a/install/data/xml/tab.xml +++ b/install/data/xml/tab.xml @@ -60,9 +60,9 @@ AdminAdmin - + AdminStock @@ -282,7 +282,7 @@ AdminTabs - + AdminStats @@ -82,7 +82,7 @@

    {l s='Can I add my own modules?'}

    -

    {l s='Please note that for security reasons, you can only add modules that are being distributed on PrestaShop Addons, the official marketplace.'}

    +

    {l s='Please note that for security reasons, you can only add modules that are being distributed on QloApps Addons, the official marketplace.'}

    From de195f56d22fb8a628c0251f713854beddf03e3b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 26 Sep 2023 16:57:09 +0530 Subject: [PATCH 25/32] Fix reappearance of calendar tooltips on admin book now page --- .../views/js/admin/hotel_rooms_booking.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js index d02a0b756..03449e14d 100644 --- a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js +++ b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js @@ -28,6 +28,8 @@ $(document).ready(function() { url: rooms_booking_url, method: 'POST', extraParams: function() { + removeInitializedTooltips(); + return $.extend( { ajax: true, @@ -183,6 +185,14 @@ $(document).ready(function() { calendar.render(); } + function removeInitializedTooltips() { + $('#fullcalendar a.day-info, #fullcalendar .fc-daygrid-event').each(function () { + if ($(this).data('ui-tooltip')) { + $(this).tooltip('destroy'); + } + }); + } + function getSearchData() { return { From a5c4a60ff1952b46285dcf80fb9e091f79cd5850 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 26 Sep 2023 18:41:38 +0530 Subject: [PATCH 26/32] upadte invoce tax detail panel --- pdf/invoice.tax-tab.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf/invoice.tax-tab.tpl b/pdf/invoice.tax-tab.tpl index b38577f33..cadbb0d4e 100644 --- a/pdf/invoice.tax-tab.tpl +++ b/pdf/invoice.tax-tab.tpl @@ -39,7 +39,7 @@ {l s='Tax Details' pdf='true'} - {l s='Tax Detail' pdf='true'} + {l s='Taxable category' pdf='true'} {if isset($showTaxName) && $showTaxName} {l s='Tax Name' pdf='true'} {/if} From ed50cbba534003106d038eaadad3638d40574e29 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 27 Sep 2023 17:08:40 +0530 Subject: [PATCH 27/32] Fix Address issue on voucher deletion from cart dropdown --- themes/hotel-reservation-theme/order-opc.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/hotel-reservation-theme/order-opc.tpl b/themes/hotel-reservation-theme/order-opc.tpl index 8cdc91e23..2d55d1485 100644 --- a/themes/hotel-reservation-theme/order-opc.tpl +++ b/themes/hotel-reservation-theme/order-opc.tpl @@ -46,6 +46,8 @@ {* Accordian for all blocks *}
    + + {if isset($checkout_process_steps) && $checkout_process_steps} {foreach $checkout_process_steps as $step} {if $step->step_key == 'checkout_rooms_summary'} From b587f27066b99e7445890ac5364ffa8e87d1498b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 2 Nov 2023 12:53:56 +0530 Subject: [PATCH 28/32] Remove custom scrollbar design for badges on admin dashboard --- .../views/css/dashguestcycle.css | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/modules/dashguestcycle/views/css/dashguestcycle.css b/modules/dashguestcycle/views/css/dashguestcycle.css index b31121c47..de2301a8c 100644 --- a/modules/dashguestcycle/views/css/dashguestcycle.css +++ b/modules/dashguestcycle/views/css/dashguestcycle.css @@ -17,26 +17,6 @@ * @license LICENSE.txt */ -/* scrollbar design - start */ -#dashguestcycle.dashboard-top ::-webkit-scrollbar { - height: 12px; - margin-bottom: 5px; -} - -#dashguestcycle.dashboard-top ::-webkit-scrollbar-track { - background-color: #DDD; - margin: 0 6px; - border-radius: 10px; -} - -#dashguestcycle.dashboard-top ::-webkit-scrollbar-thumb { - background-color: #BBB; - border-radius: 10px; - margin-bottom: 5px; - -} -/* scrollbar design - end */ - #dashguestcycle { padding-bottom: 5px; } From 73f36a3eb17393d44d7e4a2e72accee59580d066 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 9 Nov 2023 13:02:02 +0530 Subject: [PATCH 29/32] Use hook to redirect --- ...lReservationSystemManagementController.php | 28 ------------------- .../hotelreservationsystem.php | 4 +++ 2 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php deleted file mode 100644 index 26ed1be94..000000000 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelReservationSystemManagementController.php +++ /dev/null @@ -1,28 +0,0 @@ -context->link->getAdminLink('AdminHotelRoomsBooking')); - } -} diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index e1240de49..d109c4a79 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -478,6 +478,10 @@ class HotelReservationSystem extends Module public function hookDisplayBackOfficeHeader() { + if (Tools::getValue('controllerUri') == 'AdminHotelReservationSystemManagement') { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminHotelRoomsBooking')); + } + $this->context->controller->addCSS($this->_path.'views/css/admin/css/hotel_admin_tab_logo.css'); } From 00315c8ca1b3db358b9da5fab75f6847652a7c31 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 15 Nov 2023 17:25:34 +0530 Subject: [PATCH 30/32] Clean js --- themes/hotel-reservation-theme/js/order-opc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/hotel-reservation-theme/js/order-opc.js b/themes/hotel-reservation-theme/js/order-opc.js index 0649a68dd..5ed4d1069 100644 --- a/themes/hotel-reservation-theme/js/order-opc.js +++ b/themes/hotel-reservation-theme/js/order-opc.js @@ -630,8 +630,8 @@ function updatePaymentMethodsDisplay() function updateAddressSelection(is_adv_api) { - var idAddress_delivery = ($('#opc_id_address_delivery').length == 1 ? $('#opc_id_address_delivery').val() : $('#id_address_delivery').val()); - var idAddress_invoice = ($('#opc_id_address_invoice').length == 1 ? $('#opc_id_address_invoice').val() : ($('#addressesAreEquals:checked').length == 1 ? idAddress_delivery : ($('#id_address_invoice').length == 1 ? $('#id_address_invoice').val() : idAddress_delivery))); + var idAddress_delivery = $('#opc_id_address_delivery').val(); + var idAddress_invoice = $('#opc_id_address_invoice').val(); $('#opc_account-overlay').fadeIn('slow'); $('#opc_delivery_methods-overlay').fadeIn('slow'); From 3fe0cca1ff790243f53cfc313c624f7f84138264 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 17 Nov 2023 12:19:56 +0530 Subject: [PATCH 31/32] Redirect to first child tab --- classes/Dispatcher.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index 14ce46b7c..0107ec323 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -300,6 +300,11 @@ class DispatcherCore } else { $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/'); if (!isset($controllers[strtolower($this->controller)])) { + // If this is a parent tab, load the first child + if (Validate::isLoadedObject($tab) && $tab->id_parent == 0 && ($tabs = Tab::getTabs(Context::getContext()->language->id, $tab->id)) && isset($tabs[0])) { + Tools::redirectAdmin(Context::getContext()->link->getAdminLink($tabs[0]['class_name'])); + } + $this->controller = $this->controller_not_found; $controller_class = 'AdminNotFoundController'; } else { From cb091351221b56db351f0d7e1ef6768e8abd8779 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 17 Nov 2023 12:20:46 +0530 Subject: [PATCH 32/32] Undo --- modules/hotelreservationsystem/hotelreservationsystem.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index d109c4a79..e1240de49 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -478,10 +478,6 @@ class HotelReservationSystem extends Module public function hookDisplayBackOfficeHeader() { - if (Tools::getValue('controllerUri') == 'AdminHotelReservationSystemManagement') { - Tools::redirectAdmin($this->context->link->getAdminLink('AdminHotelRoomsBooking')); - } - $this->context->controller->addCSS($this->_path.'views/css/admin/css/hotel_admin_tab_logo.css'); }