From 646f45c78393cc085d227efbca3d1b6c71c87bd1 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 7 May 2024 13:07:36 +0530 Subject: [PATCH 01/48] Fixed: The noticies on the Admin controllers when the identifier provided manually by editing the url does not exists in the database --- classes/order/Order.php | 2 +- controllers/admin/AdminCmsContentController.php | 6 ++++-- controllers/admin/AdminFeaturesController.php | 5 ++--- controllers/admin/AdminNormalProductsController.php | 6 ++++++ controllers/admin/AdminOrdersController.php | 10 +++++----- controllers/admin/AdminProductsController.php | 6 ++++++ controllers/admin/AdminRequestSqlController.php | 6 ++---- .../admin/AdminOrderRefundRequestsController.php | 2 +- 8 files changed, 27 insertions(+), 16 deletions(-) diff --git a/classes/order/Order.php b/classes/order/Order.php index a4e7a5e6b..dc29f2652 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -1804,7 +1804,7 @@ class OrderCore extends ObjectModel SELECT opd.`amount` as `real_paid_amount`, opd.*, op.* FROM `'._DB_PREFIX_.'order_payment_detail` opd INNER JOIN `'._DB_PREFIX_.'order_payment` op ON (opd.`id_order_payment` = op.`id_order_payment`) - WHERE `id_order` = '.$this->id + WHERE `id_order` = '.(int) $this->id ); } diff --git a/controllers/admin/AdminCmsContentController.php b/controllers/admin/AdminCmsContentController.php index 9bf088b58..6708fa987 100644 --- a/controllers/admin/AdminCmsContentController.php +++ b/controllers/admin/AdminCmsContentController.php @@ -85,6 +85,7 @@ class AdminCmsContentControllerCore extends AdminController public function initContent() { + $this->loadObject(true); $this->initTabModuleList(); $this->renderPageHeaderToolbar(); @@ -151,8 +152,9 @@ class AdminCmsContentControllerCore extends AdminController if (Tools::getValue('addcms') !== false) { $this->toolbar_title[] = $this->l('Add new'); - } elseif ($id_cms_page) { - $cms_page = new CMS($id_cms_page); + } elseif ($id_cms_page + && Validate::isLoadedObject($cms_page = new CMS($id_cms_page)) + ) { $this->toolbar_title[] = sprintf($this->l('Edit: %s'), $cms_page->meta_title[$this->context->employee->id_lang]); } } else { diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index c581d2604..c57d5d807 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -452,10 +452,9 @@ class AdminFeaturesControllerCore extends AdminController $this->initToolbar(); $this->initPageHeaderToolbar(); if ($this->display == 'edit' || $this->display == 'add') { - if (!$this->loadObject(true)) { - return; + if ($this->loadObject(true)) { + $this->content .= $this->renderForm(); } - $this->content .= $this->renderForm(); } elseif ($this->display == 'view') { // Some controllers use the view action without an object if ($this->className) { diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index 87a959951..6cd378dbf 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -398,6 +398,12 @@ class AdminNormalProductsControllerCore extends AdminController $bo_theme = 'default'; } + Media::addJsDef( + array( + 'tb_pathToImage' => '../img/loadingAnimation.gif' + ) + ); + $this->addJs(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$bo_theme.'/js/jquery.iframe-transport.js'); $this->addJs(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$bo_theme.'/js/jquery.fileupload.js'); $this->addJs(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$bo_theme.'/js/jquery.fileupload-process.js'); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 9c6d1fe61..870ac9432 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -482,8 +482,7 @@ class AdminOrdersControllerCore extends AdminController { if ($this->display == 'view') { /** @var Order $order */ - $order = $this->loadObject(); - + $order = new Order(Tools::getValue($this->identifier)); // hotel link in header if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) { $this->toolbar_btn['hotel'] = array( @@ -997,7 +996,9 @@ class AdminOrdersControllerCore extends AdminController $this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js'); if ($this->tabAccess['edit'] == 1 && $this->display == 'view') { - $this->addJS(_PS_JS_DIR_.'admin/orders.js'); + if ($this->loadObject(true)) { + $this->addJS(_PS_JS_DIR_.'admin/orders.js'); + } // $this->addJS(_PS_JS_DIR_.'admin/orders-product-event.js'); // $this->addJS(_PS_JS_DIR_.'admin/orders-room-event.js'); $this->addJS(_PS_JS_DIR_.'tools.js'); @@ -2477,11 +2478,10 @@ class AdminOrdersControllerCore extends AdminController { $order = new Order(Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) { - $this->errors[] = Tools::displayError('The order cannot be found within your database.'); + return false; } $this->content .= $this->renderKpis(); - $customer = new Customer($order->id_customer); $carrier = new Carrier($order->id_carrier); $products = $this->getProducts($order); diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 811207d39..4f4277bdb 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -468,6 +468,12 @@ class AdminProductsControllerCore extends AdminController $bo_theme = 'default'; } + Media::addJsDef( + array( + 'tb_pathToImage' => '../img/loadingAnimation.gif' + ) + ); + $this->addJs(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$bo_theme.'/js/jquery.iframe-transport.js'); $this->addJs(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$bo_theme.'/js/jquery.fileupload.js'); $this->addJs(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$bo_theme.'/js/jquery.fileupload-process.js'); diff --git a/controllers/admin/AdminRequestSqlController.php b/controllers/admin/AdminRequestSqlController.php index a8e5507b1..068face35 100644 --- a/controllers/admin/AdminRequestSqlController.php +++ b/controllers/admin/AdminRequestSqlController.php @@ -283,11 +283,9 @@ class AdminRequestSqlControllerCore extends AdminController $this->initToolbar(); $this->initPageHeaderToolbar(); if ($this->display == 'edit' || $this->display == 'add') { - if (!$this->loadObject(true)) { - return; + if ($this->loadObject(true)) { + $this->content .= $this->renderForm(); } - - $this->content .= $this->renderForm(); } elseif ($this->display == 'view') { // Some controllers use the view action without an object if ($this->className) { diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php index f6eb2fb5f..916e6c1c2 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php @@ -135,7 +135,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController public function renderView() { - if (!($objOrderReturn = $this->loadObject(true))) { + if (!($objOrderReturn = $this->loadObject())) { return; } $refundStatuses = OrderReturnStateCore::getOrderReturnStates($this->context->language->id); From c91935a28d7eac3d08f5db3c00b0fe8e09858b32 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Tue, 21 May 2024 17:50:06 +0530 Subject: [PATCH 02/48] Fixed:The option to select children's age is not showing in the popup while editing occupancy on the order detail page. --- .../controllers/orders/modals/_edit_room_tab_content.tpl | 2 ++ js/admin/orders.js | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl index 444182bab..02d5ae38c 100644 --- a/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl @@ -89,6 +89,8 @@ + +

diff --git a/js/admin/orders.js b/js/admin/orders.js index 8a551b4fa..25d8111a3 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -523,15 +523,12 @@ function initProductEvents() $(this).val(max_child_in_room); if (elementVal == 1) { showOccupancyError(no_children_allowed_txt, $(this).closest(".occupancy_info_block")); - haserror = true; } else { showOccupancyError(max_children_txt, $(this).closest(".occupancy_info_block")); - haserror = true; } } else if (elementVal > max_allowed_for_current) { $(this).val(max_allowed_for_current); showOccupancyError(max_occupancy_reached_txt, $(this).closest(".occupancy_info_block")); - haserror = true; } } else { max_adults_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_adults').val(); From f9ccc67a4e7ffb6da88e69210aafc75d9be14973 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 22 May 2024 12:23:38 +0530 Subject: [PATCH 03/48] Fixed:During addition of rooms in booking from backoffice, scrolling the page displaces the suggested room types from input in the modal --- admin/themes/default/sass/vendor/bootstrap-sass/_modals.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/sass/vendor/bootstrap-sass/_modals.scss b/admin/themes/default/sass/vendor/bootstrap-sass/_modals.scss index 8240fa4ad..a126c3986 100644 --- a/admin/themes/default/sass/vendor/bootstrap-sass/_modals.scss +++ b/admin/themes/default/sass/vendor/bootstrap-sass/_modals.scss @@ -9,7 +9,7 @@ // Kill the scroll on the body .modal-open { - overflow-x: hidden; + overflow: hidden; } // Container that the modal scrolls within From c19a195d8b26ef134eb58d8206324f75e998f33e Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 22 May 2024 15:22:54 +0530 Subject: [PATCH 04/48] Fixed: Time is not shown with date for check-In and check-out status in Room Status section in back-office order detail page --- .../default/template/controllers/orders/helpers/view/view.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index f28080e92..f20d03ea1 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -127,9 +127,9 @@ {if $data['id_status'] == $hotel_order_status['STATUS_ALLOTED']['id_status']} {l s='Alloted'} {elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']} - {l s='Checked in on'} {dateFormat date=$data['check_in']} + {l s='Checked in on'} {dateFormat date=$data['check_in'] full=1} {elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']} - {l s='Checked out on'} {dateFormat date=$data['check_out']} + {l s='Checked out on'} {dateFormat date=$data['check_out'] full=1} {/if} From e7f3fd1beb23b3fb8cb5d5b9f5009f075c85f9fd Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 22 May 2024 15:48:16 +0530 Subject: [PATCH 05/48] add scrollbar in Private note on order detail page --- admin/themes/default/sass/controllers/_order.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/themes/default/sass/controllers/_order.sass b/admin/themes/default/sass/controllers/_order.sass index c5315218e..c32768ed0 100644 --- a/admin/themes/default/sass/controllers/_order.sass +++ b/admin/themes/default/sass/controllers/_order.sass @@ -77,3 +77,6 @@ .room_status_info_form .room_status white-space: normal + +#noteContent + max-height: 200px \ No newline at end of file From e879c6638d58917c81d47198a71510865fb33da0 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 22 May 2024 18:40:30 +0530 Subject: [PATCH 06/48] Fixed:At the time of room edit mention price is tax included or excluded --- .../controllers/orders/modals/_add_room_booking.tpl | 4 ++-- .../controllers/orders/modals/_edit_room_tab_content.tpl | 2 +- .../modals/_extra_services_facilities_tab_content.tpl | 6 +++--- .../modals/_extra_services_service_products_tab_content.tpl | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl b/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl index 63d96c205..92beca110 100644 --- a/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl @@ -49,7 +49,7 @@
- +
{if $currency->format % 2}
{$currency->sign}
{/if} @@ -57,7 +57,7 @@
- +
{if $currency->format % 2}
{$currency->sign}
{/if} diff --git a/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl index 02d5ae38c..932b0bc19 100644 --- a/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_edit_room_tab_content.tpl @@ -50,7 +50,7 @@
- +
{if $currency->format % 2}
{$currency->sign}
{/if} diff --git a/admin/themes/default/template/controllers/orders/modals/_extra_services_facilities_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_extra_services_facilities_tab_content.tpl index 1231752ca..4dee95332 100644 --- a/admin/themes/default/template/controllers/orders/modals/_extra_services_facilities_tab_content.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_extra_services_facilities_tab_content.tpl @@ -31,8 +31,8 @@ {l s='Name'} - {l s='Unit Price'} - {l s='Total Price'} + {l s='Unit Price (tax excl.)'} + {l s='Total Price (tax excl.)'} {l s='Action'} @@ -77,7 +77,7 @@ {l s='Name'} {l s='Option'} - {l s='Unit Price'} + {l s='Unit Price (tax excl.)'} diff --git a/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl b/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl index 67412d3fc..ac4ce1231 100644 --- a/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_extra_services_service_products_tab_content.tpl @@ -33,8 +33,8 @@ {l s='Name'} {l s='Quantity'} - {l s='Unit Price'} - {l s='Total Price'} + {l s='Unit Price (tax excl.)'} + {l s='Total Price (tax excl.)'} {l s='Action'} @@ -101,7 +101,7 @@ {l s='Name'} {l s='Quantity'} - {l s='Unit Price'} + {l s='Unit Price (tax excl.)'} From 2081d72d74a4377553bfd8cc064ca28414239159 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 22 May 2024 18:48:19 +0530 Subject: [PATCH 07/48] Fixed: Showing status booked on header even after all bookings are refunded on order detail page in back-office --- .../default/template/controllers/orders/helpers/view/view.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index 74eb8d437..9f884e2b1 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -28,9 +28,9 @@ {block name=pageTitle}

{if is_array($title)}{$title|end|strip_tags}{else}{$title|strip_tags}{/if} - {if $currentState == Configuration::get('PS_OS_REFUND')} + {if $currentState->id == Configuration::get('PS_OS_REFUND')} {l s='Refunded'} - {elseif $currentState == Configuration::get('PS_OS_CANCELED')} + {elseif $currentState->id == Configuration::get('PS_OS_CANCELED')} {l s='Cancelled'} {else} {l s='Booked'} From 3433aec4b222d5fb79e33c9575b30608ff119b83 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 27 May 2024 12:00:37 +0530 Subject: [PATCH 08/48] Updated: The google maps will now display the store icon insted of the default marker --- controllers/front/StoresController.php | 6 +++++- modules/hotelreservationsystem/hotelreservationsystem.php | 7 +++++++ .../views/js/HotelReservationAdmin.js | 1 + .../hotelreservationsystem/views/js/searchResultsMap.js | 1 + themes/hotel-reservation-theme/js/contact-form.js | 1 + themes/hotel-reservation-theme/js/order-detail.js | 1 + themes/hotel-reservation-theme/js/product.js | 1 + 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/controllers/front/StoresController.php b/controllers/front/StoresController.php index 89f21c5ac..901f5ec7d 100644 --- a/controllers/front/StoresController.php +++ b/controllers/front/StoresController.php @@ -208,8 +208,12 @@ class StoresControllerCore extends FrontController */ protected function assignStores() { - $this->context->smarty->assign('hasStoreIcon', Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_DIR_.Configuration::get('PS_STORES_ICON')))); // by webkul to get media link. + $hasStoreIcon = false; + if (Tools::file_get_contents($this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')))) { // by webkul to get media link. + $hasStoreIcon = true; + } + $this->context->smarty->assign('hasStoreIcon', $hasStoreIcon); $distance_unit = Configuration::get('PS_DISTANCE_UNIT'); if (!in_array($distance_unit, array('km', 'mi'))) { $distance_unit = 'km'; diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index bf6473245..0466fcf00 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -87,6 +87,9 @@ class HotelReservationSystem extends Module public function hookActionFrontControllerSetMedia() { + Media::addJsDef(array( + 'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')) + )); if (Configuration::get('WK_CUSTOMER_SUPPORT_PHONE_NUMBER') != '' || Configuration::get('WK_CUSTOMER_SUPPORT_EMAIL') != '' ) { @@ -492,6 +495,10 @@ class HotelReservationSystem extends Module public function hookDisplayBackOfficeHeader() { + Media::addJsDef(array( + 'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')) + )); + $this->context->controller->addCSS($this->_path.'views/css/admin/css/hotel_admin_tab_logo.css'); } diff --git a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js index c923b0eea..160df0a5f 100644 --- a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js +++ b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js @@ -217,6 +217,7 @@ var GoogleMapsManager = { position: latLng, map: that.map, draggable: true, + icon: PS_STORES_ICON }); that.markers.push(marker); marker.addListener('dragend', function(e) { diff --git a/modules/hotelreservationsystem/views/js/searchResultsMap.js b/modules/hotelreservationsystem/views/js/searchResultsMap.js index cc58afebd..f24c762c4 100644 --- a/modules/hotelreservationsystem/views/js/searchResultsMap.js +++ b/modules/hotelreservationsystem/views/js/searchResultsMap.js @@ -34,6 +34,7 @@ function initMap() { position: hotelLocation, map: map, title: hotel_name, + icon: PS_STORES_ICON }); marker.addListener('click', function() { diff --git a/themes/hotel-reservation-theme/js/contact-form.js b/themes/hotel-reservation-theme/js/contact-form.js index 8a77661d6..4f8f51dc2 100644 --- a/themes/hotel-reservation-theme/js/contact-form.js +++ b/themes/hotel-reservation-theme/js/contact-form.js @@ -93,6 +93,7 @@ function initMap() { map: map, title: location.hotel_name, animation: google.maps.Animation.DROP, + icon: PS_STORES_ICON }); // Allow each marker to have an info window diff --git a/themes/hotel-reservation-theme/js/order-detail.js b/themes/hotel-reservation-theme/js/order-detail.js index 6a54f74b0..26d1fcb99 100644 --- a/themes/hotel-reservation-theme/js/order-detail.js +++ b/themes/hotel-reservation-theme/js/order-detail.js @@ -115,6 +115,7 @@ function initMap() { position: hotelLocation, map: map, title: hotel_name, + icon: PS_STORES_ICON }); marker.addListener('click', function() { diff --git a/themes/hotel-reservation-theme/js/product.js b/themes/hotel-reservation-theme/js/product.js index 4974d31e2..4d340fcf9 100644 --- a/themes/hotel-reservation-theme/js/product.js +++ b/themes/hotel-reservation-theme/js/product.js @@ -1275,6 +1275,7 @@ function initMap() { const marker = new google.maps.Marker({ position: hotelLatLng, map: map, + icon: PS_STORES_ICON }); const uiContent = $('#room-info-map-ui-content .hotel-info-wrap').get(0); From cbf7a64e114c07fd008c7a4e75f75f894063fd30 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 28 May 2024 17:09:18 +0530 Subject: [PATCH 09/48] Added: option to view new customers in Admin Customer list using the KPI and the new customers option in dashboard --- .../admin/AdminCustomersController.php | 20 +++++++++++++++++++ controllers/admin/AdminStatsController.php | 2 +- modules/dashactivity/views/js/dashactivity.js | 4 ++++ .../templates/hook/dashboard_zone_one.tpl | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 6c763f10c..cdc291da4 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -217,6 +217,23 @@ class AdminCustomersControllerCore extends AdminController $this->redirect_after = $this->context->link->getAdminLink('AdminCustomers'); } + if (Tools::getValue('action') == 'filterOnlyNewCustomer') { + if (($dateFrom = Tools::getValue('date_from')) + && ($dateTo = Tools::getValue('date_to')) + && strtotime($dateTo) >= strtotime($dateFrom) + ) { + $this->processResetFilters(); + $this->context->cookie->{'submitFilter'.$this->table} = true; + $prefix = $this->getCookieFilterPrefix(); + //Updating the date format of the filter dates to the desired format. + $dateFrom = date('Y-m-d', strtotime($dateFrom)); + $dateTo = date('Y-m-d', strtotime($dateTo)); + $this->context->cookie->{$prefix.$this->table.'Filter_date_add'} = json_encode(array($dateFrom, $dateTo)); + } + + $this->redirect_after = $this->context->link->getAdminLink('AdminCustomers'); + } + parent::postProcess(); } @@ -739,6 +756,9 @@ class AdminCustomersControllerCore extends AdminController $helper->color = 'color4'; $helper->title = $this->l('New Customers', null, null, false); $nbDaysNewCustomers = Validate::isUnsignedInt(Configuration::get('PS_KPI_NEW_CUSTOMERS_NB_DAYS')) ? Configuration::get('PS_KPI_NEW_CUSTOMERS_NB_DAYS') : 30; + $date_from = date('Y-m-d', strtotime('-'.$nbDaysNewCustomers.' day')); + $date_to = date('Y-m-d'); + $helper->href = $this->context->link->getAdminLink('AdminCustomers').'&filterOnlyNewCustomer=1&date_from='.$date_from.'&date_to='.$date_to; $helper->subtitle = sprintf($this->l('%d Days', null, null, false), (int) $nbDaysNewCustomers); $helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=total_new_customers'; $helper->tooltip = $this->l('The total number of new customers who registered in given period of time.', null, null, false); diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 2de11a362..86e20a67f 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -1885,7 +1885,7 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getTotalNewCustomers($nbDaysNewCustomers) { - $maxDateAdd = date('Y-m-d H:i:s', strtotime('-'.$nbDaysNewCustomers.' day')); + $maxDateAdd = date('Y-m-d', strtotime('-'.$nbDaysNewCustomers.' day')); $sql = 'SELECT COUNT(c.`id_customer`) FROM `'._DB_PREFIX_.'customer` c WHERE c.`date_add` >= "'.pSQL($maxDateAdd).'" AND c.`deleted` = 0'; diff --git a/modules/dashactivity/views/js/dashactivity.js b/modules/dashactivity/views/js/dashactivity.js index a84820e02..8343efa89 100644 --- a/modules/dashactivity/views/js/dashactivity.js +++ b/modules/dashactivity/views/js/dashactivity.js @@ -58,6 +58,8 @@ $(document).ready(function() { $('#date-start').change(function() { start = Date.parseDate($('#date-start').val(), 'Y-m-d'); end = Date.parseDate($('#date-end').val(), 'Y-m-d'); + var url = $('#dash_filter_new_customers').data('href') + '&date_from='+start.format('Y-m-d')+ '&date_to='+ end.format('Y-m-d'); + $('#dash_filter_new_customers').attr('href', url); $('#customers-newsletters-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); $('#traffic-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); @@ -66,6 +68,8 @@ $(document).ready(function() { $('#date-end').change(function() { start = Date.parseDate($('#date-start').val(), 'Y-m-d'); end = Date.parseDate($('#date-end').val(), 'Y-m-d'); + var url = $('#dash_filter_new_customers').data('href') + '&date_from='+start.format('Y-m-d')+ '&date_to='+ end.format('Y-m-d'); + $('#dash_filter_new_customers').attr('href', url); $('#customers-newsletters-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); $('#traffic-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format))); diff --git a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl index 95cee2cd3..a0d0a48c8 100644 --- a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl +++ b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl @@ -121,7 +121,7 @@
  • - + {l s="New Customers" mod='dashactivity'} From 19e74a7ff27d66dd1c05a19046668e7faf95dca8 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 29 May 2024 09:56:56 +0530 Subject: [PATCH 10/48] Added: Admin can now filter the using banned status of the customer in the listing in the admin customer controller --- controllers/admin/AdminCustomersController.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index cdc291da4..3344f23a2 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -170,6 +170,11 @@ class AdminCustomersControllerCore extends AdminController 'type' => 'datetime', 'search' => false, 'havingFilter' => true + ), + 'deleted' => array( + 'title' => $this->l('Banned'), + 'type' => 'bool', + 'displayed' => false, ) )); @@ -217,14 +222,14 @@ class AdminCustomersControllerCore extends AdminController $this->redirect_after = $this->context->link->getAdminLink('AdminCustomers'); } - if (Tools::getValue('action') == 'filterOnlyNewCustomer') { + $prefix = $this->getCookieFilterPrefix(); + if (Tools::getValue('filterOnlyNewCustomer')) { if (($dateFrom = Tools::getValue('date_from')) && ($dateTo = Tools::getValue('date_to')) && strtotime($dateTo) >= strtotime($dateFrom) ) { $this->processResetFilters(); $this->context->cookie->{'submitFilter'.$this->table} = true; - $prefix = $this->getCookieFilterPrefix(); //Updating the date format of the filter dates to the desired format. $dateFrom = date('Y-m-d', strtotime($dateFrom)); $dateTo = date('Y-m-d', strtotime($dateTo)); @@ -235,6 +240,10 @@ class AdminCustomersControllerCore extends AdminController } parent::postProcess(); + $filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_'); + if (isset($filters[$prefix.$this->table.'Filter_deleted']) && $filters[$prefix.$this->table.'Filter_deleted'] == 1) { + $this->deleted = false; + } } public function initContent() From 04132d354cc2c6cd2ccf14b07c3615318c58dae3 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 1 Jun 2024 13:57:13 +0530 Subject: [PATCH 11/48] Fixed: Text mentioned in the manual allotment is not visible on the order detail page in back-office --- .../controllers/orders/helpers/view/view.tpl | 6 ++- .../orders/modals/_room_allotment_comment.tpl | 28 +++++++++++ controllers/admin/AdminOrdersController.php | 24 ++++++++++ js/admin/orders.js | 46 +++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 admin/themes/default/template/controllers/orders/modals/_room_allotment_comment.tpl diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index 9f884e2b1..ab8516fb5 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -125,7 +125,7 @@ {if $data['id_status'] == $hotel_order_status['STATUS_ALLOTED']['id_status']} - {l s='Alloted'} + {l s='Alloted'} {if $data['booking_type'] == HotelBookingDetail::ALLOTMENT_MANUAL}({l s='Manually'}){/if} {elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']} {l s='Checked in on'} {dateFormat date=$data['check_in'] full=1} {elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']} @@ -140,6 +140,10 @@ {/if} + + {if $data['booking_type'] == HotelBookingDetail::ALLOTMENT_MANUAL && $data['comment'] != ''} + + {/if} {/foreach} diff --git a/admin/themes/default/template/controllers/orders/modals/_room_allotment_comment.tpl b/admin/themes/default/template/controllers/orders/modals/_room_allotment_comment.tpl new file mode 100644 index 000000000..859ee5cb0 --- /dev/null +++ b/admin/themes/default/template/controllers/orders/modals/_room_allotment_comment.tpl @@ -0,0 +1,28 @@ +{* +* 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 +*} + + diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index c08b5f111..ef9e6ad44 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -779,6 +779,30 @@ class AdminOrdersControllerCore extends AdminController die(Tools::jsonEncode($response)); } + public function ajaxProcessInitRoomAllotmentCommentModal() + { + $response['hasError'] = 1; + if (Validate::isLoadedObject($objBookingDetail = new HotelBookingDetail(Tools::getValue('id_hotel_booking')))) { + if ($objBookingDetail->booking_type == HotelBookingDetail::ALLOTMENT_MANUAL) { + // get booking information by order + $this->context->smarty->assign('comment', $objBookingDetail->comment); + $modal = array( + 'modal_id' => 'room-allotment-comment-modal', + 'modal_class' => 'modal-md order_detail_modal', + 'modal_title' => '  '.$this->l('Room Manual Allotment Comment'), + 'modal_content' => $this->context->smarty->fetch('controllers/orders/modals/_room_allotment_comment.tpl'), + 'modal_actions' => array(), + ); + + $this->context->smarty->assign($modal); + $response['hasError'] = 0; + $response['modalHtml'] = $this->context->smarty->fetch('modal.tpl'); + } + } + + die(Tools::jsonEncode($response)); + } + public function ajaxProcessInitRoomReallocationModal() { // set modal details diff --git a/js/admin/orders.js b/js/admin/orders.js index 25d8111a3..4eaab342f 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -1705,6 +1705,18 @@ $(document).ready(function() { // End: RoomStatusModal: Processes // ====================================== + + // Start: RoomAllotmentCommentModal: Processes + $(document).on('click', '.manual_allotment_comment', function(e){ + e.preventDefault(); + + RoomAllotmentCommentModal.show(this); + }); + // End: RoomAllotmentCommentModal: Processes + // ====================================== + + + // Start: RoomReallocationModal: Processes // For processing room reallocation and swapping $(document).on('click', '.room_reallocate_swap', function(e) { @@ -2718,6 +2730,40 @@ const CancelRoomBookingModal = { } }; +// Modal object to handle comment on rooms for manual cancellation +const RoomAllotmentCommentModal = { + show: function(element) { + $(".loading_overlay").show(); + let idHtlBooking = parseInt($(element).attr('data-id_hotel_booking_detail')); + $.ajax({ + type: 'POST', + headers: { + "cache-control": "no-cache" + }, + url: admin_order_tab_link, + dataType: 'JSON', + cache: false, + data: 'ajax=true&id_hotel_booking='+idHtlBooking+'&action=initRoomAllotmentCommentModal', + success: function(result) { + if (result.hasError == 0 && result.modalHtml) { + $('#footer').next('.bootstrap').append(result.modalHtml); + + $('#room-allotment-comment-modal').modal('show'); + + } else { + showErrorMessage(txtSomeErr); + } + }, + complete: function() { + $(".loading_overlay").hide(); + } + }); + }, + close: function() { + $('#room-allotment-comment-modal').modal('hide'); + } +}; + function updateAdditionalServices(element) { var id_room_type_service_product_order_detail = $(element).data('id_room_type_service_product_order_detail'); From 0dbd6290480ccaaf7beae25b0282ee57fa51ba1f Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 1 Jun 2024 15:31:21 +0530 Subject: [PATCH 12/48] Fixed:Should have some gap between Refund status and refund amount on order detail page. --- admin/themes/default/sass/controllers/_order.sass | 5 ++++- .../template/controllers/orders/helpers/view/view.tpl | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/admin/themes/default/sass/controllers/_order.sass b/admin/themes/default/sass/controllers/_order.sass index c32768ed0..d061c8615 100644 --- a/admin/themes/default/sass/controllers/_order.sass +++ b/admin/themes/default/sass/controllers/_order.sass @@ -79,4 +79,7 @@ white-space: normal #noteContent - max-height: 200px \ No newline at end of file + max-height: 200px + +.panel-refund-request .refunded_amount + margin-top: 2px \ No newline at end of file diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index ab8516fb5..1ddf349a9 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -785,7 +785,7 @@

{/if} -
+
 {l s='Refund Requests'}
@@ -816,7 +816,7 @@ {$return_info.state_name} {if $return_info.refunded_amount > 0} -  {displayPrice price=$return_info.refunded_amount currency=$currency->id} +  {displayPrice price=$return_info.refunded_amount currency=$currency->id} {/if} From 4740b83032f86d0e95cc7bf6a6ef73103aacd77a Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 1 Jun 2024 15:58:26 +0530 Subject: [PATCH 13/48] Fixed: Children's age with Under 1 showing 0 in order detail page in back-office --- .../controllers/orders/_overbookings.tpl | 10 +++++++--- .../controllers/orders/_product_line.tpl | 6 +++++- .../classes/HotelBookingDetail.php | 16 ++++++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/_overbookings.tpl b/admin/themes/default/template/controllers/orders/_overbookings.tpl index b2b89fa6c..154adbccf 100644 --- a/admin/themes/default/template/controllers/orders/_overbookings.tpl +++ b/admin/themes/default/template/controllers/orders/_overbookings.tpl @@ -43,15 +43,19 @@ {if $order->with_occupancy && $data['children']}