Merge branch 'webkul:develop' into gli-1263
This commit is contained in:
@@ -50,6 +50,9 @@ class BankwirePaymentModuleFrontController extends ModuleFrontController
|
||||
$total = $cart->getOrderTotal(true, Cart::BOTH);
|
||||
}
|
||||
|
||||
// check all service products are available
|
||||
RoomTypeServiceProductCartDetail::validateServiceProductsInCart();
|
||||
|
||||
$restrict_order = false;
|
||||
/*Check Order restrict condition before Payment by the customer*/
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
|
||||
@@ -49,6 +49,9 @@ class BankwireValidationModuleFrontController extends ModuleFrontController
|
||||
if (!$authorized)
|
||||
die($this->module->l('This payment method is not available.', 'validation'));
|
||||
|
||||
// check all service products are available
|
||||
RoomTypeServiceProductCartDetail::validateServiceProductsInCart();
|
||||
|
||||
// Check Order restrict condition before Payment by the customer
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
|
||||
@@ -47,4 +47,17 @@ $(document).ready(function()
|
||||
if (menu_cont.hasClass("menu_cont_left"))
|
||||
menu_cont.removeClass("menu_cont_left").addClass("menu_cont_right");
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', function(e) {
|
||||
const navigationMenu = $('#menu_cont');
|
||||
if (navigationMenu.length) {
|
||||
if (!($(e.target).closest('#menu_cont').length
|
||||
|| $(e.target).closest('.header-top .header-top-menu .nav_toggle').length
|
||||
)) {
|
||||
if (navigationMenu.hasClass('menu_cont_left')) {
|
||||
navigationMenu.removeClass('menu_cont_left').addClass('menu_cont_right');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -50,6 +50,9 @@ class ChequePaymentModuleFrontController extends ModuleFrontController
|
||||
$total = $cart->getOrderTotal(true, Cart::BOTH);
|
||||
}
|
||||
|
||||
// check all service products are available
|
||||
RoomTypeServiceProductCartDetail::validateServiceProductsInCart();
|
||||
|
||||
$restrict_order = false;
|
||||
/*Check Order restrict condition before Payment by the customer*/
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
|
||||
@@ -48,6 +48,9 @@ class ChequeValidationModuleFrontController extends ModuleFrontController
|
||||
if (!$authorized)
|
||||
die($this->module->l('This payment method is not available.', 'validation'));
|
||||
|
||||
// check all service products are available
|
||||
RoomTypeServiceProductCartDetail::validateServiceProductsInCart();
|
||||
|
||||
/*Check Order restrict condition before Payment by the customer*/
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
|
||||
@@ -82,8 +82,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
const SEARCH_TYPE_NORMAL = 2;
|
||||
|
||||
//
|
||||
const PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY = 1;
|
||||
const PS_FRONT_ROOM_UNIT_SELECTION_TYPE_QUANTITY = 2;
|
||||
const PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY = 1;
|
||||
const PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY = 2;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_booking_detail',
|
||||
@@ -1254,7 +1254,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
// This function algo is same as available rooms algo and it not similar to booked rooms algo.
|
||||
public function chechRoomBooked($id_room, $date_from, $date_to)
|
||||
{
|
||||
$sql = 'SELECT `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`
|
||||
$sql = 'SELECT `id`, `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_room` = '.(int)$id_room.
|
||||
' AND `is_back_order` = 0 AND `is_refunded` = 0 AND ((date_from <= \''.pSQL($date_from).'\' AND date_to > \''.
|
||||
pSQL($date_from).'\' AND date_to <= \''.pSQL($date_to).'\') OR (date_from > \''.pSQL($date_from).
|
||||
|
||||
@@ -450,7 +450,12 @@ class HotelCartBookingData extends ObjectModel
|
||||
$chkQty = 0;
|
||||
$num_days = HotelHelper::getNumberOfDays($date_from, $date_to);
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (defined('_PS_ADMIN_DIR_')) {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE');
|
||||
} else {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE');
|
||||
}
|
||||
if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$roomsRequired = count($occupancy);
|
||||
} else {
|
||||
$objRoomType = new HotelRoomType();
|
||||
@@ -475,7 +480,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
$obj_htl_cart_booking_data->extra_demands = $roomDemand;
|
||||
$obj_htl_cart_booking_data->date_from = $date_from;
|
||||
$obj_htl_cart_booking_data->date_to = $date_to;
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$room_occupancy = array_shift($occupancy);
|
||||
$obj_htl_cart_booking_data->adults = $room_occupancy['adults'];
|
||||
$obj_htl_cart_booking_data->children = $room_occupancy['children'];
|
||||
@@ -573,8 +578,12 @@ class HotelCartBookingData extends ObjectModel
|
||||
'id_cart' => $id_cart,
|
||||
'id_guest' => $id_guest,
|
||||
);
|
||||
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (defined('_PS_ADMIN_DIR_')) {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE');
|
||||
} else {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE');
|
||||
}
|
||||
if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$roomsRequired = count($occupancy);
|
||||
} else {
|
||||
$roomsRequired = $occupancy;
|
||||
|
||||
@@ -256,10 +256,10 @@ class HotelHelper
|
||||
// Search Fields
|
||||
Configuration::updateValue('PS_FRONT_SEARCH_TYPE', HotelBookingDetail::SEARCH_TYPE_OWS);
|
||||
Configuration::updateValue('PS_FRONT_OWS_SEARCH_ALGO_TYPE', HotelBookingDetail::SEARCH_EXACT_ROOM_TYPE_ALGO);
|
||||
Configuration::updateValue('PS_FRONT_ROOM_UNIT_SELECTION_TYPE', HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY);
|
||||
Configuration::updateValue('PS_FRONT_ROOM_UNIT_SELECTION_TYPE', HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY);
|
||||
Configuration::updateValue('PS_BACKOFFICE_SEARCH_TYPE', HotelBookingDetail::SEARCH_TYPE_OWS);
|
||||
Configuration::updateValue('PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE', HotelBookingDetail::SEARCH_ALL_ROOM_TYPE_ALGO);
|
||||
Configuration::updateValue('PS_BACKOFFICE_ROOM_BOOKING_TYPE', HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY);
|
||||
Configuration::updateValue('PS_BACKOFFICE_ROOM_BOOKING_TYPE', HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class HotelImage extends ObjectModel
|
||||
|
||||
$this->source_index = _PS_HOTEL_IMG_DIR_.'index.php';
|
||||
|
||||
$this->image_dir = _PS_HOTEL_IMG_.$this->getImgFolder();
|
||||
$this->image_dir = _PS_HOTEL_IMG_DIR_.$this->getImgFolder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +61,33 @@ class HotelImage extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the hotel image from disk and remove the containing folder if empty
|
||||
* Handles both legacy and new image filesystems
|
||||
*/
|
||||
public function deleteImage($force_delete = false)
|
||||
{
|
||||
parent::deleteImage();
|
||||
// Can we delete the image folder?
|
||||
if (is_dir($this->image_dir)) {
|
||||
$delete_folder = true;
|
||||
foreach (scandir($this->image_dir) as $file) {
|
||||
if (($file != '.' && $file != '..' && $file != 'index.php')) {
|
||||
$delete_folder = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($delete_folder) && $delete_folder) {
|
||||
// delete index image before deleting folder
|
||||
unlink($this->image_dir.'index.php');
|
||||
@rmdir($this->image_dir);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* [getImagesByHotelId :: To get paginated hotel images data]
|
||||
* @param [int] $id_hotel [id_hotel to get images of]
|
||||
@@ -232,9 +259,9 @@ class HotelImage extends ObjectModel
|
||||
}
|
||||
}
|
||||
$addedImage = array(
|
||||
'id_image' => $objHtlImage->id,
|
||||
'id' => $objHtlImage->id,
|
||||
'cover' => $objHtlImage->cover,
|
||||
'image_url' => Context::getContext()->link->getMediaLink($objHtlImage->getImageLink($objHtlImage->id)),
|
||||
'image_link' => Context::getContext()->link->getMediaLink($objHtlImage->getImageLink($objHtlImage->id)),
|
||||
);
|
||||
return $addedImage;
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ class HotelOrderRefundRules extends ObjectModel
|
||||
|
||||
$objHtlRefundRules = new HotelBranchRefundRules();
|
||||
$objHotelBookingDemands = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
|
||||
if ($bookingsToRefund = OrderReturn::getOrdersReturnDetail($idOrder, $idOrderReturn, $idHtlBooking)) {
|
||||
foreach ($bookingsToRefund as $booking) {
|
||||
@@ -152,6 +153,19 @@ class HotelOrderRefundRules extends ObjectModel
|
||||
1
|
||||
);
|
||||
|
||||
$totalServicesPrice = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$objHtlBooking->id_order,
|
||||
0,
|
||||
0,
|
||||
$objHtlBooking->id_product,
|
||||
$objHtlBooking->date_from,
|
||||
$objHtlBooking->date_to,
|
||||
$objHtlBooking->id_room,
|
||||
1,
|
||||
1,
|
||||
null
|
||||
);
|
||||
|
||||
if ($refundRules = $objHtlRefundRules->getHotelRefundRules($objHtlBooking->id_hotel, 0, 1)) {
|
||||
$orderCurrency = $objOrder->id_currency;
|
||||
$defaultCurrency = Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
@@ -169,7 +183,7 @@ class HotelOrderRefundRules extends ObjectModel
|
||||
$ruleApplied = false;
|
||||
foreach ($refundRules as $refRule) {
|
||||
if ($daysBeforeCancel >= $refRule['days']) {
|
||||
$paidAmount = $objHtlBooking->total_paid_amount + $totalDemandsPrice;
|
||||
$paidAmount = $objHtlBooking->total_paid_amount + $totalDemandsPrice + $totalServicesPrice;
|
||||
if ($objOrder->is_advance_payment) {
|
||||
$refundValue = $refRule['deduction_value_adv_pay'];
|
||||
} else {
|
||||
@@ -222,4 +236,44 @@ class HotelOrderRefundRules extends ObjectModel
|
||||
|
||||
return $totalCancelationCharges;
|
||||
}
|
||||
|
||||
public static function getApplicableRefundRules($idOrder)
|
||||
{
|
||||
$idLang = Context::getContext()->language->id;
|
||||
|
||||
$maxDate = Db::getInstance()->getValue(
|
||||
'SELECT MAX(DATE(hbd.`date_from`))
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
WHERE hbd.`id_order` = '.(int) $idOrder
|
||||
);
|
||||
|
||||
if ($maxDate) {
|
||||
$dateToday = date('Y-m-d');
|
||||
|
||||
if (strtotime($maxDate) >= strtotime($dateToday)) {
|
||||
$days = HotelBookingDetail::getDays($dateToday, $maxDate); // always returns positive
|
||||
|
||||
$sql = 'SELECT hbrr.`id_hotel_refund_rule`, hbrr.`id_refund_rule`, hbrr.`id_hotel`, hbrr.`position`,
|
||||
horrl.`name`, horrl.`description`, horr.`payment_type`, horr.`deduction_value_full_pay`,
|
||||
horr.`deduction_value_adv_pay`, horr.`days`
|
||||
FROM `'._DB_PREFIX_.'htl_branch_refund_rules` hbrr
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_order_refund_rules` horr
|
||||
ON (horr.`id_refund_rule` = hbrr.`id_refund_rule`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_order_refund_rules_lang` horrl
|
||||
ON (horrl.`id_refund_rule` = horr.`id_refund_rule` AND horrl.`id_lang` = '.(int) $idLang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
ON (hbd.`id_hotel` = hbrr.`id_hotel` AND hbd.`id_order` = '.(int) $idOrder.')
|
||||
WHERE horr.`days` <= '.(int) $days.'
|
||||
GROUP BY hbrr.`id_refund_rule`
|
||||
ORDER BY hbrr.`position`';
|
||||
|
||||
if ($result = Db::getInstance()->executeS($sql)) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,41 +103,6 @@ class HotelOrderRestrictDate extends ObjectModel
|
||||
)) {
|
||||
$cart_data = array();
|
||||
foreach ($cart_bk_data as $data) {
|
||||
$objCartBookingData = new HotelCartBookingData($data['id']);
|
||||
if ($maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($objCartBookingData->id_hotel)) {
|
||||
if (strtotime('-1 day', strtotime($maxOrderDate)) < strtotime($objCartBookingData->date_from)
|
||||
|| strtotime($maxOrderDate) < strtotime($objCartBookingData->date_to)
|
||||
) {
|
||||
$objBranchInfo = new HotelBranchInformation(
|
||||
$objCartBookingData->id_hotel,
|
||||
$context->language->id
|
||||
);
|
||||
$controller->errors[] = sprintf(
|
||||
'You can not book rooms for hotel \'%s\' after date %s. Please remove these rooms to proceed.',
|
||||
$objBranchInfo->hotel_name,
|
||||
Tools::displayDate($maxOrderDate)
|
||||
);
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
$preparationTime = HotelOrderRestrictDate::getPreparationTime($objCartBookingData->id_hotel);
|
||||
if ($preparationTime !== false) {
|
||||
$minOrderDate = date('Y-m-d', strtotime('+'. ($preparationTime) .' days'));
|
||||
if (strtotime($minOrderDate) > strtotime($objCartBookingData->date_from)
|
||||
|| strtotime($minOrderDate . ' +1 day')> strtotime($objCartBookingData->date_to)
|
||||
) {
|
||||
$objBranchInfo = new HotelBranchInformation(
|
||||
$objCartBookingData->id_hotel,
|
||||
$context->language->id
|
||||
);
|
||||
$controller->errors[] = sprintf(
|
||||
'You can not book rooms for hotel \'%s\' before date %s. Please remove these rooms to proceed.',
|
||||
$objBranchInfo->hotel_name,
|
||||
Tools::displayDate($minOrderDate)
|
||||
);
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
$date_join = strtotime($data['date_from']).strtotime($data['date_to']);
|
||||
$cart_data[$date_join]['date_from'] = $data['date_from'];
|
||||
$cart_data[$date_join]['date_to'] = $data['date_to'];
|
||||
@@ -145,6 +110,45 @@ class HotelOrderRestrictDate extends ObjectModel
|
||||
$cart_data[$date_join]['id_rms'][] = $data['id_room'];
|
||||
}
|
||||
foreach ($cart_data as $cl_key => $cl_val) {
|
||||
if ($maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($cl_val['id_hotel'])) {
|
||||
if (strtotime('-1 day', strtotime($maxOrderDate)) < strtotime($cl_val['date_from'])
|
||||
|| strtotime($maxOrderDate) < strtotime($cl_val['date_to'])
|
||||
) {
|
||||
$objBranchInfo = new HotelBranchInformation(
|
||||
$cl_val['id_hotel'],
|
||||
$context->language->id
|
||||
);
|
||||
$controller->errors[] = sprintf(
|
||||
'You can not book rooms for hotel \'%s\' after date %s. Please remove rooms from %s - %s to proceed.',
|
||||
$objBranchInfo->hotel_name,
|
||||
Tools::displayDate($maxOrderDate),
|
||||
Tools::displayDate($cl_val['date_from']),
|
||||
Tools::displayDate($cl_val['date_to'])
|
||||
);
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
$preparationTime = HotelOrderRestrictDate::getPreparationTime($cl_val['id_hotel']);
|
||||
if ($preparationTime !== false) {
|
||||
$minOrderDate = date('Y-m-d', strtotime('+'. ($preparationTime) .' days'));
|
||||
if (strtotime($minOrderDate) > strtotime($cl_val['date_from'])
|
||||
|| strtotime($minOrderDate . ' +1 day')> strtotime($cl_val['date_to'])
|
||||
) {
|
||||
$objBranchInfo = new HotelBranchInformation(
|
||||
$cl_val['id_hotel'],
|
||||
$context->language->id
|
||||
);
|
||||
$controller->errors[] = sprintf(
|
||||
'You can not book rooms for hotel \'%s\' before date %s. Please remove rooms from %s - %s to proceed.',
|
||||
$objBranchInfo->hotel_name,
|
||||
Tools::displayDate($minOrderDate),
|
||||
Tools::displayDate($cl_val['date_from']),
|
||||
Tools::displayDate($cl_val['date_to'])
|
||||
);
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
|
||||
$bookingParams = array(
|
||||
'date_from' => $cl_val['date_from'],
|
||||
'date_to' => $cl_val['date_to'],
|
||||
|
||||
@@ -120,7 +120,7 @@ class RoomTypeServiceProduct extends ObjectModel
|
||||
if (Product::isBookingProduct($idProduct)) {
|
||||
$sql = 'SELECT p.`id_product` FROM `'._DB_PREFIX_.'htl_room_type_service_product` rsp
|
||||
INNER JOIN `'._DB_PREFIX_.'product` p ON (rsp.`id_product` = p.`id_product` AND p.`auto_add_to_cart` = 1)
|
||||
WHERE `id_element` = '.(int)$idProduct.' AND `element_type` = '.self::WK_ELEMENT_TYPE_ROOM_TYPE;
|
||||
WHERE p.`active` = 1 AND `id_element` = '.(int)$idProduct.' AND `element_type` = '.self::WK_ELEMENT_TYPE_ROOM_TYPE;
|
||||
if (!is_null($priceAdditionType)) {
|
||||
$sql .= ' AND p.`price_addition_type` = '.$priceAdditionType;
|
||||
}
|
||||
@@ -183,6 +183,7 @@ class RoomTypeServiceProduct extends ObjectModel
|
||||
$useTax
|
||||
);
|
||||
}
|
||||
$serviceProduct['images'] = Image::getImages((int)Context::getContext()->language->id, $serviceProduct['id_product']);
|
||||
}
|
||||
|
||||
return $serviceProducts;
|
||||
|
||||
@@ -107,16 +107,24 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
if ($useTax === null)
|
||||
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
|
||||
|
||||
$idLang = Context::getContext()->language->id;
|
||||
|
||||
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_cart`, cbd.`id` as `htl_cart_booking_id` ,
|
||||
cbd.`id_product` as `room_type_id_product`, cbd.`adults`, cbd.`children`';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ', cbd.`id_guest`, cbd.`id_customer`, p.`auto_add_to_cart`, p.`price_addition_type`,
|
||||
$sql .= ', pl.`name`, cbd.`id_guest`, cbd.`id_customer`, p.`auto_add_to_cart`, p.`price_addition_type`,
|
||||
cbd.`id_hotel`, cbd.`id_room`, cbd.`date_from`, cbd.`date_to`, cbd.`is_refunded`';
|
||||
}
|
||||
$sql .= ' FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`)
|
||||
WHERE 1';
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd
|
||||
ON(rscd.`htl_cart_booking_id` = cbd.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = rscd.`id_product`)';
|
||||
if (!$getTotalPrice) {
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int)$idLang.')';
|
||||
}
|
||||
$sql .= ' WHERE 1';
|
||||
|
||||
if (!is_null($autoAddToCart)) {
|
||||
$sql .= ' AND p.`auto_add_to_cart` = '. (int)$autoAddToCart;
|
||||
@@ -165,7 +173,6 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
);
|
||||
|
||||
} else {
|
||||
$roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($product['room_type_id_product']);
|
||||
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
|
||||
if (isset($selectedServiceProducts[$product['htl_cart_booking_id']])) {
|
||||
if ($product['id_product']) {
|
||||
@@ -175,6 +182,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
} else {
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['selected_products_info'][$product['id_product']] = array(
|
||||
'id_product' => $product['id_product'],
|
||||
'name' => $product['name'],
|
||||
'auto_add_to_cart' => $product['auto_add_to_cart'],
|
||||
'price_addition_type' => $product['price_addition_type'],
|
||||
'quantity' => $product['quantity'],
|
||||
@@ -220,6 +228,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['children'] = $product['children'];
|
||||
if ($idProduct) {
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['id_product'] = $product['id_product'];
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['name'] = $product['name'];
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['quantity'] = $product['quantity'];
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['auto_add_to_cart'] = $product['auto_add_to_cart'];
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['price_addition_type'] = $product['price_addition_type'];
|
||||
@@ -243,6 +252,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
$selectedServiceProducts[$product['htl_cart_booking_id']]['selected_products_info'] = ($product['id_product']) ? array(
|
||||
$product['id_product'] => array(
|
||||
'id_product' => $product['id_product'],
|
||||
'name' => $product['name'],
|
||||
'quantity' => $product['quantity'],
|
||||
'auto_add_to_cart' => $product['auto_add_to_cart'],
|
||||
'price_addition_type' => $product['price_addition_type'],
|
||||
@@ -341,4 +351,20 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function validateServiceProductsInCart()
|
||||
{
|
||||
$context = Context::getContext();
|
||||
if ($cartProducts = $context->cart->getProducts()) {
|
||||
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
|
||||
foreach ($cartProducts as $product) {
|
||||
if (!$product['active'] && !$product['booking_product']) {
|
||||
$serviceProducts = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart($context->cart->id, $product['id_product']);
|
||||
foreach ($serviceProducts as $serviceProduct) {
|
||||
$objRoomTypeServiceProductCartDetail->removeServiceProductByIdHtlCartBooking($serviceProduct['htl_cart_booking_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -576,6 +576,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
|
||||
public function ajaxProcessUploadHotelImages()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
$idHotel = Tools::getValue('id_hotel');
|
||||
if ($idHotel) {
|
||||
$invalidImg = ImageManager::validateUpload(
|
||||
@@ -584,27 +585,32 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
);
|
||||
if (!$invalidImg) {
|
||||
// Add Hotel images
|
||||
$kwargs = [
|
||||
'id_hotel' => $idHotel,
|
||||
'hotel_image' => $_FILES['hotel_image'],
|
||||
];
|
||||
$objHotelImage = new HotelImage();
|
||||
$imageDetail = $objHotelImage->uploadHotelImages($_FILES['hotel_image'], $idHotel);
|
||||
if ($imageDetail) {
|
||||
die(json_encode($imageDetail));
|
||||
$response['success'] = true;
|
||||
$imageDetail['image_link'] = $this->context->link->getMediaLink($objHotelImage->getImageLink($imageDetail['id'],ImageType::getFormatedName('large')));
|
||||
$imageDetail['image_link_small'] = $this->context->link->getMediaLink($objHotelImage->getImageLink($imageDetail['id'], ImageType::getFormatedName('small')));
|
||||
$response['data']['image_info'] = $imageDetail;
|
||||
// get image row
|
||||
$this->context->smarty->assign(array(
|
||||
'image' => $imageDetail,
|
||||
'hotel_info' => array('id' => $idHotel)
|
||||
));
|
||||
$response['data']['image_row'] = $this->context->smarty->fetch(
|
||||
_PS_MODULE_DIR_.$this->module->name.
|
||||
'/views/templates/admin/add_hotel/_partials/htl-images-list-row.tpl'
|
||||
);
|
||||
} else {
|
||||
die(json_encode(array('hasError' => true)));
|
||||
$response['errors'][] = $this->l('Unable to uploade image. Please try again');
|
||||
}
|
||||
} else {
|
||||
die(
|
||||
json_encode(
|
||||
array('hasError' => true, 'message' => $_FILES['hotel_image']['name'].': '.$invalidImg)
|
||||
)
|
||||
);
|
||||
$response['errors'][] = $_FILES['hotel_image']['name'].': '.$invalidImg;
|
||||
}
|
||||
} else {
|
||||
die(json_encode(array('hasError' => true)));
|
||||
$response['errors'][] = $this->l('Hotel info not found. Please try reloading the page');
|
||||
}
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessChangeCoverImage()
|
||||
|
||||
@@ -226,4 +226,4 @@ class AdminAssignHotelFeaturesController extends ModuleAdminController
|
||||
$this->addJs(_MODULE_DIR_.'hotelreservationsystem/views/js/HotelReservationAdmin.js');
|
||||
$this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,27 +40,15 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
}
|
||||
|
||||
if (!isset($this->context->cookie->id_cart)) {
|
||||
// create a new cart
|
||||
$objCart = new Cart();
|
||||
$objCart->recyclable = 0;
|
||||
$objCart->gift = 0;
|
||||
$objCart->id_shop = (int) $this->context->shop->id;
|
||||
$objCart->id_lang = (($id_lang = (int) Tools::getValue('id_lang')) ? $id_lang : (int) Configuration::get('PS_LANG_DEFAULT'));
|
||||
$objCart->id_currency = (($id_currency = (int) Tools::getValue('id_currency')) ? $id_currency : (int) Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$objCart->id_address_delivery = 0;
|
||||
$objCart->id_address_invoice = 0;
|
||||
$objCart->id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
$objCart->id_guest = (int) $this->context->cookie->id_guest;
|
||||
$objCart->setNoMultishipping();
|
||||
|
||||
$this->context->cart = $objCart;
|
||||
$this->context->cart->save();
|
||||
|
||||
$objCart = $this->createNewCart();
|
||||
$this->context->cookie->id_cart = (int) $objCart->id;
|
||||
} else {
|
||||
// use previous cart
|
||||
$this->context->cart = new Cart($this->context->cookie->id_cart);
|
||||
if (!validate::isLoadedObject($objCart = new Cart($this->context->cookie->id_cart))) {
|
||||
$objCart = $this->createNewCart();
|
||||
}
|
||||
}
|
||||
$this->context->cart = $objCart;
|
||||
|
||||
$objCustomer = new Customer();
|
||||
$objCustomer->id_gender = 0;
|
||||
@@ -77,6 +65,26 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$this->context->customer = $objCustomer;
|
||||
}
|
||||
|
||||
protected function createNewCart()
|
||||
{
|
||||
// create a new cart
|
||||
$objCart = new Cart();
|
||||
$objCart->recyclable = 0;
|
||||
$objCart->gift = 0;
|
||||
$objCart->id_shop = (int) $this->context->shop->id;
|
||||
$objCart->id_lang = (($id_lang = (int) Tools::getValue('id_lang')) ? $id_lang : (int) Configuration::get('PS_LANG_DEFAULT'));
|
||||
$objCart->id_currency = (($id_currency = (int) Tools::getValue('id_currency')) ? $id_currency : (int) Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$objCart->id_address_delivery = 0;
|
||||
$objCart->id_address_invoice = 0;
|
||||
$objCart->id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
$objCart->id_guest = (int) $this->context->cookie->id_guest;
|
||||
$objCart->setNoMultishipping();
|
||||
|
||||
$objCart->save();
|
||||
return $objCart;
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::getValue('date_from')) {
|
||||
@@ -260,6 +268,10 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'booking_product' => $this->booking_product,
|
||||
'is_occupancy_wise_search' => $isOccupancyWiseSearch,
|
||||
));
|
||||
MediaCore::addJsDef(array(
|
||||
'initialDate' => $this->date_from
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
public function renderView()
|
||||
@@ -300,7 +312,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
|
||||
$allotmentTypes = HotelBookingDetail::getAllAllotmentTypes();
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
|
||||
@@ -778,7 +790,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
parent::setMedia();
|
||||
$currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
$jsVars = array(
|
||||
|
||||
@@ -23,6 +23,7 @@ $(document).ready(function() {
|
||||
if ($('#fullcalendar').length) {
|
||||
var calendar = new FullCalendar.Calendar($('#fullcalendar').get(0), {
|
||||
initialView: 'dayGridMonth',
|
||||
initialDate: initialDate,
|
||||
events: {
|
||||
url: rooms_booking_url,
|
||||
method: 'POST',
|
||||
@@ -312,7 +313,7 @@ $(document).ready(function() {
|
||||
occupancy = false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return occupancy;
|
||||
|
||||
@@ -49,4 +49,34 @@ $(document).ready(function() {
|
||||
}
|
||||
$('#generateCreditSlip').change();
|
||||
});
|
||||
|
||||
$(document).on('keyup', '#order_return_form .table input[name^="refund_amounts"]', function() {
|
||||
let refundAmountInputs = $('#order_return_form .table input[name^="refund_amounts"]');
|
||||
|
||||
let disableRefundOptions = false;
|
||||
$(refundAmountInputs).each(function(index, element) {
|
||||
let val = parseFloat($(element).val().trim());
|
||||
if (isNaN(val)) { // if at least one amount input is empty
|
||||
disableRefundOptions = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (!disableRefundOptions) {
|
||||
let hasAllZero = true;
|
||||
$(refundAmountInputs).each(function(index, element) {
|
||||
let val = parseFloat($(element).val().trim());
|
||||
if (val != 0) {
|
||||
hasAllZero = false;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (hasAllZero) { // if all amount inputs are 0
|
||||
disableRefundOptions = true;
|
||||
}
|
||||
}
|
||||
|
||||
$('#generateCreditSlip, #refundTransactionAmount, #generateDiscount').attr('disabled', disableRefundOptions);
|
||||
});
|
||||
});
|
||||
@@ -27,104 +27,75 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$("#hotel_images").on("change", function(event) {
|
||||
files = event.target.files;
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
var formData = new FormData();
|
||||
var file = files[i];
|
||||
|
||||
if (typeof file != 'undefined') {
|
||||
if (file.size > maxSizeAllowed) {
|
||||
showErrorMessage(filesizeError + '[' + file.name + ']');
|
||||
} else {
|
||||
formData.append('hotel_image', file);
|
||||
uploadHotelImages(formData);
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#hotel_images').val(null);
|
||||
const files = Array.from(event.target.files);
|
||||
uploadSelectedImages(files);
|
||||
});
|
||||
|
||||
function uploadHotelImages(formData) {
|
||||
var idHotel = $("#id-hotel").val();
|
||||
formData.append('id_hotel', idHotel);
|
||||
formData.append('ajax', true);
|
||||
formData.append('action', 'uploadHotelImages');
|
||||
function uploadSelectedImages(files)
|
||||
{
|
||||
if (files.length == 0) return; // all done
|
||||
let file = files[0];
|
||||
files.splice(0, 1);
|
||||
createImageUploadRequest(file).then((formData) => {
|
||||
uploadHotelImages(formData).then(() => {
|
||||
uploadSelectedImages(files)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url: adminHotelCtrlUrl,
|
||||
data: formData,
|
||||
cache:false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success:function(image){
|
||||
image = JSON.parse(image);
|
||||
if (!image.hasError) {
|
||||
$('.list-empty-tr').remove();
|
||||
var html = '';
|
||||
html += '<tr class="';
|
||||
if(image.cover) {
|
||||
html += 'cover-image-tr';
|
||||
}
|
||||
html += '">';
|
||||
html += '<td class="text-center">'+image.id_image+'</td>';
|
||||
html += '<td class="text-center">';
|
||||
html += '<a class="htl-img-preview" href="'+image.image_url+'">';
|
||||
html += '<img class="img-thumbnail" width="100" src="'+image.image_url+'"/>';
|
||||
html += '</a>';
|
||||
html += '</td>';
|
||||
html += '<td class="text-center ';
|
||||
if(image.cover) {
|
||||
html += 'cover-image-td';
|
||||
}
|
||||
html += '">';
|
||||
html += '<a href="#" class="';
|
||||
if(image.cover) {
|
||||
html += 'text-success';
|
||||
} else {
|
||||
html += 'text-danger';
|
||||
}
|
||||
html += ' changer-cover-image" data-id-hotel="'+idHotel+'" data-is-cover="';
|
||||
if(image.cover) {
|
||||
html += '1';
|
||||
} else {
|
||||
html += '0';
|
||||
}
|
||||
html += '" data-id-image="'+image.id_image+'">';
|
||||
if(image.cover) {
|
||||
html += '<i class="icon-check"></i>';
|
||||
} else {
|
||||
html += '<i class="icon-times"></i>';
|
||||
}
|
||||
html += '</a>';
|
||||
html += '</td>';
|
||||
html += '<td class="text-center">';
|
||||
html += '<button type="button" class="btn btn-default delete-hotel-image" data-id-hotel="'+idHotel+'" data-is-cover="';
|
||||
if(image.cover) {
|
||||
html += '1';
|
||||
} else {
|
||||
html += '0';
|
||||
}
|
||||
html += '" data-id-image="'+image.id_image+'"><i class="icon-trash"></i></button>';
|
||||
html += '</td>';
|
||||
html += '</tr>';
|
||||
$("#hotel-image-table tbody").append(html);
|
||||
|
||||
showSuccessMessage(imgUploadSuccessMsg);
|
||||
function createImageUploadRequest(file)
|
||||
{
|
||||
return new Promise((resolve, reject) => {
|
||||
if (typeof file != 'undefined') {
|
||||
if (file.size > maxSizeAllowed) {
|
||||
reject(filesizeError + '[' + file.name + ']');
|
||||
} else {
|
||||
if (typeof image.message != 'undefined') {
|
||||
showErrorMessage(image.message);
|
||||
} else {
|
||||
showErrorMessage(imgUploadErrorMsg);
|
||||
}
|
||||
var formData = new FormData();
|
||||
var idHotel = $("#id-hotel").val();
|
||||
formData.append('hotel_image', file);
|
||||
formData.append('id_hotel', idHotel);
|
||||
formData.append('ajax', true);
|
||||
formData.append('action', 'uploadHotelImages');
|
||||
resolve(formData);
|
||||
}
|
||||
},
|
||||
error: function(data) {
|
||||
showErrorMessage(imgUploadErrorMsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function uploadHotelImages(formData) {
|
||||
return new Promise((resolve, reject) => {
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
url: adminHotelCtrlUrl,
|
||||
data: formData,
|
||||
cache:false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success:function(response){
|
||||
if (response.success) {
|
||||
$('.list-empty-tr').remove();
|
||||
$("#hotel-image-table tbody").append(response.data.image_row);
|
||||
showSuccessMessage(imgUploadSuccessMsg);
|
||||
resolve(imgUploadSuccessMsg);
|
||||
} else {
|
||||
if (typeof response.errors != 'undefined') {
|
||||
showErrorMessage(response.errors);
|
||||
reject(response.errors);
|
||||
} else {
|
||||
showErrorMessage(imgUploadErrorMsg);
|
||||
reject(imgUploadErrorMsg);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(data) {
|
||||
showErrorMessage(imgUploadErrorMsg);
|
||||
reject(imgUploadErrorMsg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('body').on('click', '.changer-cover-image', function(e){
|
||||
e.preventDefault();
|
||||
var idHotel = $(this).attr('data-id-hotel');
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* 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 CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<tr class="{if $image.cover == 1}cover-image-tr{/if}">
|
||||
<td class="text-center">{$image.id|escape:'html':'UTF-8'}</td>
|
||||
<td class="text-center">
|
||||
<a class="htl-img-preview" href="{$image.image_link|escape:'html':'UTF-8'}">
|
||||
<img class="img-thumbnail" width="100" src="{$image.image_link_small|escape:'html':'UTF-8'}"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center {if $image.cover == 1}cover-image-td{/if}">
|
||||
<a href="#" class="{if $image.cover == 1}text-success{else}text-danger{/if} changer-cover-image" data-id-hotel="{$hotel_info.id|escape:'html':'UTF-8'}" data-is-cover="{if $image.cover == 1}1{else}0{/if}" data-id-image="{$image.id|escape:'html':'UTF-8'}">
|
||||
{if $image.cover == 1}
|
||||
<i class="icon-check"></i>
|
||||
{else}
|
||||
<i class="icon-times"></i>
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-default delete-hotel-image" data-id-hotel="{$hotel_info.id|escape:'html':'UTF-8'}" data-is-cover="{if $image.cover == 1}1{else}0{/if}" data-id-image="{$image.id|escape:'html':'UTF-8'}"><i class="icon-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,47 @@
|
||||
{**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* 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 CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="hotel-image-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{l s='Image Id' mod='hotelreservationsystem'}</th>
|
||||
<th class="text-center">{l s='Image' mod='hotelreservationsystem'}</th>
|
||||
<th class="text-center">{l s='Cover' mod='hotelreservationsystem'}</th>
|
||||
<th class="text-center">{l s='Action' mod='hotelreservationsystem'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($hotelImages) && $hotelImages}
|
||||
{foreach from=$hotelImages item=image name=hotelImage}
|
||||
{include file="./htl-images-list-row.tpl"}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr class="list-empty-tr">
|
||||
<td class="list-empty" colspan="5">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No Image Found' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -304,53 +304,7 @@
|
||||
<h4><i class="icon-image"></i> <span>{l s='Hotel Images' mod='hotelreservationsystem'}</span></h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="hotel-image-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{l s='Image Id' mod='hotelreservationsystem'}</th>
|
||||
<th class="text-center">{l s='Image' mod='hotelreservationsystem'}</th>
|
||||
<th class="text-center">{l s='Cover' mod='hotelreservationsystem'}</th>
|
||||
<th class="text-center">{l s='Action' mod='hotelreservationsystem'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($hotelImages) && $hotelImages}
|
||||
{foreach from=$hotelImages item=image name=hotelImage}
|
||||
<tr class="{if $image.cover == 1}cover-image-tr{/if}">
|
||||
<td class="text-center">{$image.id|escape:'html':'UTF-8'}</td>
|
||||
<td class="text-center">
|
||||
<a class="htl-img-preview" href="{$image.image_link|escape:'html':'UTF-8'}">
|
||||
<img class="img-thumbnail" width="100" src="{$image.image_link_small|escape:'html':'UTF-8'}"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center {if $image.cover == 1}cover-image-td{/if}">
|
||||
<a href="#" class="{if $image.cover == 1}text-success{else}text-danger{/if} changer-cover-image" data-id-hotel="{$hotel_info.id|escape:'html':'UTF-8'}" data-is-cover="{if $image.cover == 1}1{else}0{/if}" data-id-image="{$image.id|escape:'html':'UTF-8'}">
|
||||
{if $image.cover == 1}
|
||||
<i class="icon-check"></i>
|
||||
{else}
|
||||
<i class="icon-times"></i>
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-default delete-hotel-image" data-id-hotel="{$hotel_info.id|escape:'html':'UTF-8'}" data-is-cover="{if $image.cover == 1}1{else}0{/if}" data-id-image="{$image.id|escape:'html':'UTF-8'}"><i class="icon-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr class="list-empty-tr">
|
||||
<td class="list-empty" colspan="5">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No Image Found' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{include file="../../_partials/htl-images-list.tpl"}
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<th>{l s='Hotel' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Duration' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Total rooms paid (tax incl.)'}</th>
|
||||
<th>{l s='Additional facilities price (tax incl.)'}</th>
|
||||
<th>{l s='Additional services price (tax incl.)'}</th>
|
||||
{if !$isRefundCompleted}
|
||||
<th>{l s='Rooms cancelation charges' mod='hotelreservationsystem'}</th>
|
||||
{/if}
|
||||
@@ -137,7 +137,7 @@
|
||||
<td>{$booking['hotel_name']|escape:'htmlall':'UTF-8'}</td>
|
||||
<td>{$booking['date_from']|date_format:"%d-%m-%Y"} {l s='To' mod='hotelreservationsystem'} {$booking['date_to']|date_format:"%d-%m-%Y"}</td>
|
||||
<td>{displayPrice price=$booking['total_paid_amount'] currency=$orderCurrency['id']}</td>
|
||||
<td>{displayPrice price=$booking['extra_demands_price_tax_incl'] currency=$orderCurrency['id']}</td>
|
||||
<td>{displayPrice price=($booking['extra_demands_price_tax_incl'] + $booking['additional_services_tax_incl']) currency=$orderCurrency['id']}</td>
|
||||
{if !$isRefundCompleted}
|
||||
<td>{displayPrice price=$booking['cancelation_charge'] currency=$orderCurrency['id']}</td>
|
||||
{/if}
|
||||
@@ -148,7 +148,7 @@
|
||||
{displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']}
|
||||
{else}
|
||||
<span class="input-group-addon">{$orderCurrency['sign']|escape:'html':'UTF-8'}</span>
|
||||
<input placeholder="" type="text" name="refund_amounts[{$booking['id_order_return_detail']|escape:'html':'UTF-8'}]">
|
||||
<input placeholder="" type="text" name="refund_amounts[{$booking['id_order_return_detail']|escape:'html':'UTF-8'}]" value="{$booking['total_paid_amount'] - $booking['cancelation_charge']}">
|
||||
<span class="input-group-addon">{l s='tax incl.' mod='hotelreservationsystem'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -21,9 +21,13 @@
|
||||
<label class="control-label col-lg-3">{l s='Customer' mod='qlohotelreview'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="form-control-static">
|
||||
<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$obj_customer->id}" target="_blank">
|
||||
{$obj_customer->firstname} {$obj_customer->lastname} (#{$obj_customer->id})
|
||||
</a>
|
||||
{if isset($obj_customer) && $obj_customer}
|
||||
<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$obj_customer->id}" target="_blank">
|
||||
{$obj_customer->firstname} {$obj_customer->lastname} (#{$obj_customer->id})
|
||||
</a>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -126,7 +126,7 @@ class StatsData extends Module
|
||||
FROM `'._DB_PREFIX_.'guest`
|
||||
WHERE `id_customer` = '.(int)$params['cookie']->id_customer);
|
||||
|
||||
if ((int)$result['id_guest']) {
|
||||
if (isset($result['id_guest']) && ( int)$result['id_guest']) {
|
||||
// The new guest is merged with the old one when it's connecting to an account
|
||||
$guest->mergeWithCustomer($result['id_guest'], $params['cookie']->id_customer);
|
||||
$params['cookie']->id_guest = $guest->id;
|
||||
|
||||
@@ -218,56 +218,48 @@ class WkRoomSearchHelper
|
||||
'location' => 4,
|
||||
'hotel' => 5,
|
||||
'date' => 5,
|
||||
'occupancy' => 5,
|
||||
'search' => 3
|
||||
'occupancy' => 4,
|
||||
'search' => 4
|
||||
);
|
||||
|
||||
if (!$locationEnabled) {
|
||||
unset($search_column_widths['location']);
|
||||
|
||||
$search_column_widths['date'] += 1;
|
||||
$search_column_widths['date'] += 2;
|
||||
$search_column_widths['search'] += 1;
|
||||
if ($occupancyEnabled) {
|
||||
$search_column_widths['search'] += 1;
|
||||
$search_column_widths['occupancy'] += 1;
|
||||
} elseif ($smartyVars['show_hotel_name'] || count($hotelsInfo) > 1) {
|
||||
$search_column_widths['hotel'] += 1;
|
||||
} else {
|
||||
$search_column_widths['search'] += 1;
|
||||
$search_column_widths['date'] += 1;
|
||||
}
|
||||
}
|
||||
if (!$smartyVars['show_hotel_name'] && count($hotelsInfo) <= 1) {
|
||||
unset($search_column_widths['hotel']);
|
||||
|
||||
$search_column_widths['date'] += 1;
|
||||
$search_column_widths['date'] += 2;
|
||||
$search_column_widths['search'] += 1;
|
||||
if ($occupancyEnabled) {
|
||||
$search_column_widths['date'] += 1;
|
||||
$search_column_widths['occupancy'] += 2;
|
||||
} else {
|
||||
$search_column_widths['date'] += 1;
|
||||
$search_column_widths['date'] += 2;
|
||||
}
|
||||
}
|
||||
if (!$occupancyEnabled) {
|
||||
unset($search_column_widths['occupancy']);
|
||||
|
||||
$search_column_widths['date'] += 1;
|
||||
if ($smartyVars['show_hotel_name'] || count($hotelsInfo) > 1) {
|
||||
$search_column_widths['hotel'] += 1;
|
||||
$search_column_widths['date'] += 1;
|
||||
if ($locationEnabled) {
|
||||
$search_column_widths['hotel'] += 1;
|
||||
$search_column_widths['location'] += 1;
|
||||
$search_column_widths['search'] += 2;
|
||||
$search_column_widths['date'] += 1;
|
||||
} else {
|
||||
$search_column_widths['hotel'] += 2;
|
||||
$search_column_widths['search'] += 2;
|
||||
$search_column_widths['date'] += 2;
|
||||
|
||||
$search_column_widths['date'] += 1;
|
||||
}
|
||||
} else {
|
||||
$search_column_widths['date'] += 1;
|
||||
$search_column_widths['date'] += 4;
|
||||
$search_column_widths['date'] += 3;
|
||||
}
|
||||
}
|
||||
$smartyVars['column_widths'] = $search_column_widths;
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
height: unset;
|
||||
min-height: 45px;
|
||||
}
|
||||
#search_hotel_block_form #search_room_submit {
|
||||
height: unset;
|
||||
min-height: 45px;
|
||||
}
|
||||
/* #search_hotel_block_form #search_room_submit {
|
||||
height: 45px;
|
||||
} */
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;}
|
||||
|
||||
.header-rmsearch-hide-xs {
|
||||
background-image: url("../img/black-opacity-5.png");}
|
||||
.header-rmsearch-show-xs {
|
||||
@@ -50,7 +51,16 @@
|
||||
#make_booking_btn_div {
|
||||
margin-top: 20px;
|
||||
text-align: center;}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.header-rmsearch-wrapper #search_hotel_block_form.grid {
|
||||
grid-template-columns: 1fr;
|
||||
column-gap: 0px;
|
||||
}
|
||||
.header-rmsearch-wrapper {
|
||||
height: calc(100vw - 60px);
|
||||
width: calc(100vw - 60px);
|
||||
}
|
||||
}
|
||||
.fancy_search_header_xs {
|
||||
margin-top: 25px;
|
||||
padding-left: 15px;
|
||||
@@ -62,6 +72,10 @@
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
width: 125px;}
|
||||
#search_hotel_block_form #search_room_submit {
|
||||
height: unset;
|
||||
min-height: 45px;
|
||||
}
|
||||
/* .fancybox-inner #search_hotel_block_form {
|
||||
grid-template-columns: 1fr;
|
||||
} */
|
||||
@@ -64,6 +64,19 @@
|
||||
background-color: #FAFAFA;}
|
||||
.faded-txt {
|
||||
color: #777777;}
|
||||
#search_hotel_block_form #search_room_submit {
|
||||
height: unset;
|
||||
min-height: 45px;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.header-rmsearch-wrapper #search_hotel_block_form.grid {
|
||||
grid-template-columns: 1fr;
|
||||
column-gap: 0px;
|
||||
}
|
||||
.header-rmsearch-details-wrapper .modify_roomtype_search_btn {
|
||||
padding: 6px 12px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.header-rmsearch-wrapper .close_room_serach_wrapper {
|
||||
top: -8px;
|
||||
|
||||
@@ -42,7 +42,9 @@ $(document).ready(function() {
|
||||
padding: 0,
|
||||
autoScale: false,
|
||||
maxWidth: '100%',
|
||||
'hideOnContentClick': false,
|
||||
helpers: {
|
||||
overlay: { closeClick: false } //Disable click outside event
|
||||
},
|
||||
'afterClose': function() {
|
||||
$('.header-rmsearch-container').show();
|
||||
$('#xs_room_search_form').show();
|
||||
|
||||
@@ -26,7 +26,9 @@
|
||||
<div class="col-sm-9 form-group">
|
||||
<div class="filter_header row">
|
||||
<div class="col-sm-12">
|
||||
<p>{l s='Searched results for' mod='wkroomsearchblock'}:</p>
|
||||
<p>{l s='Searched results for' mod='wkroomsearchblock'}:
|
||||
<button class="btn btn-default visible-xs modify_roomtype_search_btn pull-right"><i class="icon-pencil"></i></button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -35,7 +37,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 form-group">
|
||||
<div class="col-sm-3 form-group hidden-xs">
|
||||
<button class="btn btn-default modify_roomtype_search_btn pull-right">{l s='Modify Search' mod='wkroomsearchblock'}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group search_room_submit_block area-{$column_widths['search']}">
|
||||
<button type="submit" class="btn btn btn-lg btn-primary pull-right" name="search_room_submit" id="search_room_submit">
|
||||
<button type="submit" class="btn btn btn-primary pull-right" name="search_room_submit" id="search_room_submit">
|
||||
<span>{l s='Search Rooms' mod='wkroomsearchblock'}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -168,7 +168,7 @@ class WkRoomSearchBlock extends Module
|
||||
$maxOrderDate = Tools::getValue('max_order_date');
|
||||
$maxOrderDate = date('Y-m-d', strtotime($maxOrderDate));
|
||||
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if ($occupancy = Tools::getValue('occupancy')) {
|
||||
$urlData['occupancy'] = $occupancy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user