diff --git a/admin/themes/default/sass/controllers/_order.sass b/admin/themes/default/sass/controllers/_order.sass index c5315218e..d061c8615 100644 --- a/admin/themes/default/sass/controllers/_order.sass +++ b/admin/themes/default/sass/controllers/_order.sass @@ -77,3 +77,9 @@ .room_status_info_form .room_status white-space: normal + +#noteContent + max-height: 200px + +.panel-refund-request .refunded_amount + margin-top: 2px \ No newline at end of file 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 diff --git a/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl b/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl index ec102910d..9fd0f69e6 100644 --- a/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl +++ b/admin/themes/default/template/controllers/addresses/helpers/form/form.tpl @@ -29,31 +29,29 @@ {if $input.name == 'vat_number'}
{/if} - - {if $input.type == 'text_customer' && !isset($customer)} - - {else} - {$smarty.block.parent} - {/if} + {$smarty.block.parent} {/block} -{block name="field"} +{block name="input"} {if $input.type == 'text_customer'} {if isset($customer)} -
- - {$customer->lastname} {$customer->firstname} ({$customer->email}) - -
+ + {$customer->lastname} {$customer->firstname} ({$customer->email}) + - {else} - - -
- - -
- {/if} + function resetCustomerRelatedAddressFields() { + $('input[name=firstname]').val(''); + $('input[name=lastname]').val(''); + $('input[name=company]').val(''); + $('input[name=id_customer]').val(''); + } + {else} {$smarty.block.parent} {/if} diff --git a/admin/themes/default/template/controllers/customers/helpers/view/view.tpl b/admin/themes/default/template/controllers/customers/helpers/view/view.tpl index 88da2734e..18145ce07 100644 --- a/admin/themes/default/template/controllers/customers/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/customers/helpers/view/view.tpl @@ -146,15 +146,27 @@

- {if $customer->active} - - - {l s='Active'} + {if !$customer->deleted} + {if $customer->active} + + + {l s='Active'} + + {else} + + + {l s='Inactive'} + + {/if} + {elseif $customer->deleted == Customer::STATUS_BANNED} + + + {l s='Banned'} - {else} + {elseif $customer->deleted == Customer::STATUS_DELETED} - {l s='Inactive'} + {l s='Deleted'} {/if}

diff --git a/admin/themes/default/template/controllers/login/header.tpl b/admin/themes/default/template/controllers/login/header.tpl index aff412764..d1d17ce21 100644 --- a/admin/themes/default/template/controllers/login/header.tpl +++ b/admin/themes/default/template/controllers/login/header.tpl @@ -39,7 +39,7 @@ - {$shop_name} {if $meta_title != ''}{if isset($navigationPipe)}{$navigationPipe|escape:'html':'UTF-8'}{else}>{/if} {$meta_title}{/if} (PrestaShop™) + {$shop_name} {if $meta_title != ''}{if isset($navigationPipe)}{$navigationPipe|escape:'html':'UTF-8'}{else}>{/if} {$meta_title}{/if} (QloApps™) {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} 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 fb6f389c2..07f87ca73 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 @@ -92,7 +92,7 @@ {foreach $data['child_ages'] as $childAge}

- -

- -
- -
- -
-
-
- - - -
-
-
-
{l s='Check In'}
- -
-
-
-
-
-
-
{l s='Check Out'}
- -
-
-
-
- - - {if $order->with_occupancy} -
- -
- {else} -
- -
- {/if} - - - -
-
-
- {if $currency->format % 2}
{$currency->sign} {l s='tax excl.'}
{/if} - - {if !($currency->format % 2)}
{$currency->sign} {l s='tax excl.'}
{/if} -
-
-
-
-
- {if $currency->format % 2}
{$currency->sign} {l s='tax incl.'}
{/if} - - {if !($currency->format % 2)}
{$currency->sign} {l s='tax incl.'}
{/if} -
-
-
- - - - {*{if ($order->hasBeenPaid())}{/if} - {if $display_warehouse}{/if} - {if ($order->hasBeenDelivered())}{/if} - 0*} - {displayPrice price=0 currency=$currency->id} - - {if sizeof($invoices_collection)} - - {/if} - - - - - - - - diff --git a/admin/themes/default/template/controllers/orders/_overbookings.tpl b/admin/themes/default/template/controllers/orders/_overbookings.tpl index b2b89fa6c..8f0064708 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']} + {/foreach}
{/if}
diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index b2a0025d7..5c916464a 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -84,12 +84,23 @@ class Blocknewsletter extends Module 'actionCustomerAccountAdd', 'registerGDPRConsent', 'actionExportGDPRData', + 'actionObjectCustomerUpdateBefore', 'actionDeleteGDPRCustomer', 'actionObjectCustomerDeleteAfter', ) ); } + public function hookActionObjectCustomerUpdateBefore($params) + { + $objCustomer = new Customer ($params['object']->id); + if ($params['object']->deleted == Customer::STATUS_DELETED + && ($register_status = $this->isNewsletterRegistered($objCustomer->email)) + ) { + $this->unregister($objCustomer->email, $register_status); + } + } + public function hookActionObjectCustomerDeleteAfter($params) { $objCustomer = $params['object']; diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 8474537c9..66260263a 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -2098,6 +2098,14 @@ class HotelBookingDetail extends ObjectModel // Reinject quantity in stock $objOldOrderDetail->reinjectQuantity($objOldOrderDetail, $objOldOrderDetail->product_quantity, $deleteQty); + // retrieve and delete HotelCartBookingData row + $idHotelCartBookingData = Db::getInstance()->getValue('SELECT `id` FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE date_from = "'.pSQL($objOldHotelBooking->date_from).'" AND date_to = "'.pSQL($objOldHotelBooking->date_to).'" + AND id_room = '.(int) $objOldHotelBooking->id_room.' AND `id_order` = '.(int) $objOldHotelBooking->id_order + ); + $objCartBookingData = new HotelCartBookingData($idHotelCartBookingData); + $objCartBookingData->delete(); + // delete the booking detail $objOldHotelBooking = new HotelBookingDetail($idHotelBooking); $objOldHotelBooking->delete(); @@ -2107,6 +2115,19 @@ class HotelBookingDetail extends ObjectModel // =============================================================== } else { // If we are reallocating to the same room type then we need to update only the room details + // update in the cart booking data + // retrieve HotelCartBookingData row + $idHotelCartBookingData = Db::getInstance()->getValue('SELECT `id` FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE date_from = "'.pSQL($objOldHotelBooking->date_from).'" AND date_to = "'.pSQL($objOldHotelBooking->date_to).'" + AND id_room = '.(int) $objOldHotelBooking->id_room.' AND `id_order` = '.(int) $objOldHotelBooking->id_order + ); + $objCartBookingData = new HotelCartBookingData($idHotelCartBookingData); + $objCartBookingData->id_room = $idRoom; + // set backorder to 0 as available reallocate rooms will always be free + $objOldHotelBooking->is_back_order = 0; + $objCartBookingData->save(); + + // update in the hotel booking detail table $objOldHotelBooking->id_room = $idRoom; $objOldHotelBooking->room_num = $objHotelRoomInfo->room_num; // set backorder to 0 as available reallocate rooms will always be free @@ -2253,10 +2274,14 @@ class HotelBookingDetail extends ObjectModel * * @return [boolean] [true if updated otherwise false] */ - public function updateOrderRefundStatus($id_order, $date_from = false, $date_to = false, $id_rooms = array(), $is_refunded = 1, $is_cancelled = 0) + public function updateOrderRefundStatus($id_order, $date_from = false, $date_to = false, $id_rooms = array(), $is_refunded = 1, $is_cancelled = null) { $table = 'htl_booking_detail'; - $data = array('is_refunded' => (int) $is_refunded, 'is_cancelled' => (int) $is_cancelled); + $data = array('is_refunded' => (int) $is_refunded); + + if (!is_null($is_cancelled)) { + $data['is_cancelled'] = (int) $is_cancelled; + } if ($id_rooms) { foreach ($id_rooms as $key_rm => $val_rm) { @@ -3358,15 +3383,19 @@ class HotelBookingDetail extends ObjectModel } } - if ($bookedRoomInfoFlag && !$roomCount && $result) { + if (!$roomCount && $result) { $link = new Link(); foreach ($result as $key => $bookingInfo) { - $result[$key]['booked_room_info'] = $this->chechRoomBooked($bookingInfo['id_room'], $bookingInfo['date_from'], $bookingInfo['date_to']); - $result[$key]['orders_filter_link'] = $link->getAdminLink('AdminOrders'); + $result[$key]['child_ages'] = json_decode($bookingInfo['child_ages'], true); - // if need only rooms which are available to resolve overbooking the unset booked rooms - if ($bookedRoomInfoFlag == 2 && $result[$key]['booked_room_info']) { - unset($result[$key]); + if ($bookedRoomInfoFlag) { + $result[$key]['booked_room_info'] = $this->chechRoomBooked($bookingInfo['id_room'], $bookingInfo['date_from'], $bookingInfo['date_to']); + $result[$key]['orders_filter_link'] = $link->getAdminLink('AdminOrders'); + + // if need only rooms which are available to resolve overbooking the unset booked rooms + if ($bookedRoomInfoFlag == 2 && $result[$key]['booked_room_info']) { + unset($result[$key]); + } } } } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 0fa3ea369..c36ca04dc 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -104,6 +104,9 @@ class AdminAddHotelController extends ModuleAdminController public function renderForm() { + if (!$this->loadObject(true)) { + return; + } $smartyVars = array(); //tinymce setup $smartyVars['path_css'] = _THEME_CSS_DIR_; @@ -125,7 +128,7 @@ class AdminAddHotelController extends ModuleAdminController $smartyVars['defaultCountry'] = $country->name[Configuration::get('PS_LANG_DEFAULT')]; $idCountry = null; - if ($this->display == 'edit') { + if ($this->object->id) { $idHotel = Tools::getValue('id'); $hotelBranchInfo = new HotelBranchInformation($idHotel); $objCategory = new Category($hotelBranchInfo->id_category); @@ -168,13 +171,11 @@ class AdminAddHotelController extends ModuleAdminController } } $smartyVars['order_restrict_date_info'] = $restrictDateInfo; - } - - // manage state option - if ($this->display == 'add') { + } else { $idCountry = Tools::getValue('hotel_country'); } + // manage state option $stateOptions = null; if ($idCountry) { $stateOptions = State::getStatesByIdCountry($idCountry); @@ -778,6 +779,7 @@ class AdminAddHotelController extends ModuleAdminController 'sortRowsUrl' => $this->context->link->getAdminLink('AdminAddHotel'), 'primaryHotelId' => Configuration::get('WK_PRIMARY_HOTEL'), 'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.', null, true), + 'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')), ) ); // GOOGLE MAP diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php index b9bd62f20..77d352ac0 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelfeaturesController.php @@ -58,6 +58,10 @@ class AdminHotelFeaturesController extends ModuleAdminController public function renderForm() { + if (!$this->loadObject(true)) { + return; + } + $smartyVars = array(); //lang vars $languages = Language::getLanguages(false); @@ -66,7 +70,7 @@ class AdminHotelFeaturesController extends ModuleAdminController $smartyVars['languages'] = $languages; $smartyVars['currentLang'] = $currentLang; $smartyVars['ps_img_dir'] = _PS_IMG_.'l/'; - if ($id = Tools::getValue('id')) { + if ($id = $this->object->id) { $smartyVars['edit'] = 1; if (Validate::isLoadedObject($objFeatures = new HotelFeatures($id))) { $featureInfo = (array) $objFeatures; diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php index c777cfa43..7b5c695a2 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php @@ -195,7 +195,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); @@ -326,10 +326,13 @@ class AdminOrderRefundRequestsController extends ModuleAdminController } else { $this->errors[] = $this->l('Invalid refund state.'); } - if (!$voucher_expiry_date = Tools::getValue('voucher_expiry_date')) { - $this->errors[] = $this->l('Voucher expiry date is required.'); - } elseif (!Validate::isDate($voucher_expiry_date)) { - $this->errors[] = $this->l('Invalid voucher expiry date.'); + + if (Tools::isSubmit('generateDiscount')) { + if (!$voucher_expiry_date = Tools::getValue('voucher_expiry_date')) { + $this->errors[] = $this->l('Voucher expiry date is required.'); + } elseif (!Validate::isDate($voucher_expiry_date)) { + $this->errors[] = $this->l('Invalid voucher expiry date.'); + } } } else { $this->errors[] = $this->l('Invalid refund information found.'); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php index 588444904..cb297db48 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php @@ -141,14 +141,13 @@ class AdminOrderRefundRulesController extends ModuleAdminController $smartyVars = array(); $objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); $smartyVars['objCurrency'] = $objCurrency; - - if ($this->display == 'edit' - && $refundRuleInfo = $this->loadObject(true) + if (($refundRuleInfo = $this->loadObject(true)) + && $this->object->id ) { $smartyVars['edit'] = 1; $idRefundRule = Tools::getValue('id_refund_rule'); $objRefundRule = new HotelOrderRefundRules(); - $smartyVars['refund_rules_info'] = (array)$refundRuleInfo; + $smartyVars['refund_rules_info'] = (array) $refundRuleInfo; } //lang vars diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index 065640113..f5294a76d 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -310,6 +310,7 @@ class HotelReservationSystem extends Module 'map_input_text' => $objHotel->map_input_text, ), 'hotel_name' => $objHotel->hotel_name, + 'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')), )); $this->context->controller->addJS( @@ -486,7 +487,8 @@ class HotelReservationSystem extends Module // Make rooms available for booking if order status is cancelled, refunded or error if (in_array($params['newOrderStatus']->id, $objHtlBkDtl->getOrderStatusToFreeBookedRoom())) { - $isCancelled = 0; + // do not change is_cancelled if room is not getting cancelled + $isCancelled = null; if ($params['newOrderStatus']->id == Configuration::get('PS_OS_CANCELED')) { $isCancelled = 1; } diff --git a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js index 2067b36bd..1e3bc80b5 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/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl index ad04059d2..ea4f1328a 100644 --- a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl @@ -5,7 +5,7 @@  {l s='Order Cancellation Request Information' mod='hotelreservationsystem'}
-
+
{if isset($customer_name)}
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 a56a5e68f..ff9f5c340 100644 --- a/themes/hotel-reservation-theme/js/order-detail.js +++ b/themes/hotel-reservation-theme/js/order-detail.js @@ -151,6 +151,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);