Merge branch 'develop' into gli-2217
This commit is contained in:
@@ -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'];
|
||||
|
||||
@@ -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
|
||||
@@ -3359,15 +3380,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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -34,6 +34,7 @@ function initMap() {
|
||||
position: hotelLocation,
|
||||
map: map,
|
||||
title: hotel_name,
|
||||
icon: PS_STORES_ICON
|
||||
});
|
||||
|
||||
marker.addListener('click', function() {
|
||||
|
||||
Reference in New Issue
Block a user