From 915551c68878d81fca1b94c70e72d1aa7e4c5287 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 1 Oct 2024 13:54:41 +0530 Subject: [PATCH 1/4] updates for changes in booking flow --- modules/hotelreservationsystem/classes/HotelHelper.php | 7 +++++++ .../helpers/view/_partials/booking-rooms.tpl | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 373da959c..b9fe7aea9 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -2511,6 +2511,13 @@ public static function validateDateRangeForHotel($dateFrom, $dateTo, $idHotel) $isValid = false; } + Hook::exec('actionValidateDateRangeForHotel', array( + 'is_valid' => &$isValid, + 'date_from' => $dateFrom, + 'date_to' => $dateTo, + 'id_hotel' => $idHotel + )); + return $isValid; } diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl index fdd59ea80..e4bf1cb95 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl @@ -99,7 +99,7 @@ {/if} - + {/foreach} @@ -187,7 +187,7 @@ {/if} - + {/foreach} From 4a007d272498bc081e9e01c5fe9bd5662a895fb6 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 1 Oct 2024 15:41:30 +0530 Subject: [PATCH 2/4] upadate in override process --- classes/module/Module.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/classes/module/Module.php b/classes/module/Module.php index 5dd18e9d6..3ca653693 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -2874,15 +2874,17 @@ public function getOverrides() $overrides = array(); foreach (Tools::scandir($this->getLocalPath().'override', 'php', '', true) as $file) { $class = basename($file, '.php'); - $classInfo = array('class' => $class, 'file' => $file, 'type' => null); - if (PrestaShopAutoload::getInstance()->getClassPath($class.'Core')) { - $classInfo['type'] = self::OVERRIDE_TYPE_CORE; - } elseif (Module::getModuleIdByName($class)) { - $classInfo['type'] = self::OVERRIDE_TYPE_MODULE; - } elseif (preg_match('#^modules/([a-zA-Z0-9_-]+)/controllers/(admin|front)/([0-9a-zA-Z-_]+).php#', $file, $matches)) { - $classInfo['type'] = self::OVERRIDE_TYPE_MODULE_CONTROLLER; - $classInfo['module'] = $matches[1]; - $classInfo['controller_type'] = $matches[2]; + if ($class != 'index') { + $classInfo = array('class' => $class, 'file' => $file, 'type' => null); + if (PrestaShopAutoload::getInstance()->getClassPath($class.'Core')) { + $classInfo['type'] = self::OVERRIDE_TYPE_CORE; + } elseif (Module::getModuleIdByName($class)) { + $classInfo['type'] = self::OVERRIDE_TYPE_MODULE; + } elseif (preg_match('#^modules/([a-zA-Z0-9_-]+)/controllers/(admin|front)/([0-9a-zA-Z-_]+).php#', $file, $matches)) { + $classInfo['type'] = self::OVERRIDE_TYPE_MODULE_CONTROLLER; + $classInfo['module'] = $matches[1]; + $classInfo['controller_type'] = $matches[2]; + } } if ($classInfo['type']) { From 527fa2f048f4a9de540eaa7b117d8b04085a7bb1 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 1 Oct 2024 20:00:08 +0530 Subject: [PATCH 3/4] update date display process --- .../controllers/carts/helpers/view/view.tpl | 3 ++- .../orders/_current_cart_details_data.tpl | 3 ++- .../template/controllers/orders/_overbookings.tpl | 3 ++- .../template/controllers/orders/_product_line.tpl | 3 ++- .../orders/_resolvable_overbookings.tpl | 3 ++- .../controllers/orders/helpers/view/view.tpl | 3 ++- .../orders/modals/_cancel_room_bookings.tpl | 3 ++- classes/controller/AdminController.php | 3 ++- classes/controller/Controller.php | 2 ++ classes/controller/FrontController.php | 4 +++- classes/module/Module.php | 14 +++++++------- classes/pdf/HTMLTemplateInvoice.php | 5 +++-- modules/blockcart/blockcart.php | 5 +++-- modules/blockcart/blockcart.tpl | 3 ++- .../helpers/view/_partials/booking-cart.tpl | 3 ++- .../helpers/view/_partials/booking-rooms.tpl | 9 ++++++--- .../order_refund_requests/helpers/view/view.tpl | 3 ++- .../_partials/order-room-detail.tpl | 5 +++-- themes/hotel-reservation-theme/global.tpl | 1 + .../modules/blockcart/blockcart.tpl | 3 ++- .../hotel-reservation-theme/order-confirmation.tpl | 5 +++-- themes/hotel-reservation-theme/order-detail.tpl | 3 ++- themes/hotel-reservation-theme/order-return.tpl | 3 ++- themes/hotel-reservation-theme/shopping-cart.tpl | 5 +++-- 24 files changed, 62 insertions(+), 35 deletions(-) diff --git a/admin/themes/default/template/controllers/carts/helpers/view/view.tpl b/admin/themes/default/template/controllers/carts/helpers/view/view.tpl index 630836734..41f4ee2fe 100644 --- a/admin/themes/default/template/controllers/carts/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/carts/helpers/view/view.tpl @@ -100,7 +100,8 @@ {$room['room_type_info'].hotel_name} - {dateFormat date=$room['date_from']} - {dateFormat date=$room['date_to']} + {assign var="is_full_date" value=($show_full_date && ($room['date_from']|date_format:'%D' == $room['date_to']|date_format:'%D'))} + {dateFormat date=$room['date_from'] full=$is_full_date} - {dateFormat date=$room['date_to'] full=$is_full_date} {if $room['adults']}{$room['adults']}{/if} {if $room['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$room['children']}}, {$room['children']} {if $room['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if} diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index f8490a33c..3bb29c765 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -51,7 +51,8 @@

{$data.room_type|escape:'html':'UTF-8'}

- {dateFormat date=$data.date_from} - {dateFormat date=$data.date_to} + {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))} + {dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date} {if $occupancy_required_for_booking}