Merge branch 'webkul:develop' into fix-disable-dates
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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -26,6 +26,7 @@ function line_chart_availability(widget_name, chart_details) {
|
||||
.useInteractiveGuideline(true)
|
||||
.x(function(d) { return (d !== undefined ? d[0] : 0); })
|
||||
.y(function(d) { return (d !== undefined ? parseInt(d[1]) : 0); })
|
||||
.forceY(0)
|
||||
.margin({
|
||||
left: 30,
|
||||
right: 30,
|
||||
|
||||
@@ -170,7 +170,7 @@ class DashGuestCycle extends Module
|
||||
}
|
||||
|
||||
$tr[] = array(
|
||||
'value' => $arrivalInfo['adult'] + $arrivalInfo['children'],
|
||||
'value' => $arrivalInfo['with_occupancy'] ? ($arrivalInfo['adults'] + $arrivalInfo['children']) : '--',
|
||||
'class' => 'text-center',
|
||||
);
|
||||
$tr[] = array(
|
||||
@@ -230,7 +230,7 @@ class DashGuestCycle extends Module
|
||||
}
|
||||
|
||||
$tr[] = array(
|
||||
'value' => $departureInfo['adult'] + $departureInfo['children'],
|
||||
'value' => $departureInfo['with_occupancy'] ? ($departureInfo['adults'] + $departureInfo['children']) : '--',
|
||||
'class' => 'text-center',
|
||||
);
|
||||
$tr[] = array(
|
||||
@@ -291,7 +291,7 @@ class DashGuestCycle extends Module
|
||||
}
|
||||
|
||||
$tr[] = array(
|
||||
'value' => $inHouseInfo['adult'] + $inHouseInfo['children'],
|
||||
'value' => $inHouseInfo['with_occupancy'] ? ($inHouseInfo['adults'] + $inHouseInfo['children']) : '--',
|
||||
'class' => 'text-center',
|
||||
);
|
||||
$tr[] = array(
|
||||
@@ -357,7 +357,7 @@ class DashGuestCycle extends Module
|
||||
'class' => 'text-center',
|
||||
);
|
||||
$tr[] = array(
|
||||
'value' => $newBookingInfo['total_guests'],
|
||||
'value' => $newBookingInfo['with_occupancy'] ? $newBookingInfo['total_guests'] : '--',
|
||||
'class' => 'text-center',
|
||||
);
|
||||
$tr[] = array(
|
||||
@@ -425,7 +425,7 @@ class DashGuestCycle extends Module
|
||||
}
|
||||
|
||||
$tr[] = array(
|
||||
'value' => $cancellationInfo['total_guests'],
|
||||
'value' => $cancellationInfo['with_occupancy'] ? $cancellationInfo['total_guests'] : '--',
|
||||
'class' => 'text-center',
|
||||
);
|
||||
$tr[] = array(
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-lg-3">
|
||||
<div class="stat-box label-tooltip" data-toggle="tooltip" data-original-title="{l s='Total Revenue Per Available Room (TrevPAR) measures the total revenue being generated per available room including additional facilities.' mod='dashperformance'}" data-placement="top" style="background-color: #B6FFB6;">
|
||||
<div class="stat-box label-tooltip" data-toggle="tooltip" data-original-title="{l s='Total Revenue Per Available Room (TrevPAR) measures the total revenue being generated per available room including additional facilities and service products.' mod='dashperformance'}" data-placement="top" style="background-color: #B6FFB6;">
|
||||
<div class="title-wrapper">
|
||||
<p>{l s='Total Revenue Per Available Room' mod='dashperformance'}</p>
|
||||
</div>
|
||||
|
||||
@@ -561,7 +561,7 @@ class DashProducts extends Module
|
||||
LEFT JOIN `'._DB_PREFIX_.'date_range` dr ON pv.`id_date_range` = dr.`id_date_range`
|
||||
LEFT JOIN `'._DB_PREFIX_.'page` p ON pv.`id_page` = p.`id_page`
|
||||
LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type`
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON hrt.`id_product` = p.`id_object`
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON hrt.`id_product` = p.`id_object`
|
||||
WHERE pt.`name` = \'product\'
|
||||
'.Shop::addSqlRestriction(false, 'pv').'
|
||||
AND dr.`time_start` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59"
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -471,11 +471,10 @@ class HotelReservationSystemDb
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link` (`id_settings_link`, `icon`, `link`, `new_window`, `position`, `unremovable`, `active`, `date_add`, `date_upd`) VALUES
|
||||
(1, 'icon-cogs', 'index.php?controller=AdminHotelGeneralSettings', 0, 0, 1, 1, NOW(), NOW()),
|
||||
(2, 'icon-list-alt', 'index.php?controller=AdminOrderRestrictSettings', 0, 1, 1, 1, NOW(), NOW()),
|
||||
(3, 'icon-dollar', 'index.php?controller=AdminHotelFeaturePricesSettings', 0, 2, 1, 1, NOW(), NOW()),
|
||||
(4, 'icon-plus-square', 'index.php?controller=AdminRoomTypeGlobalDemand', 0, 3, 1, 1, NOW(), NOW()),
|
||||
(5, 'icon-file-text', 'index.php?controller=AdminAboutHotelBlockSetting', 0, 4, 0, 1, NOW(), NOW()),
|
||||
(6, 'icon-th-list', 'index.php?controller=AdminFeaturesModuleSetting', 0, 5, 0, 1, NOW(), NOW());",
|
||||
(2, 'icon-dollar', 'index.php?controller=AdminHotelFeaturePricesSettings', 0, 2, 1, 1, NOW(), NOW()),
|
||||
(3, 'icon-plus-square', 'index.php?controller=AdminRoomTypeGlobalDemand', 0, 3, 1, 1, NOW(), NOW()),
|
||||
(4, 'icon-file-text', 'index.php?controller=AdminAboutHotelBlockSetting', 0, 4, 0, 1, NOW(), NOW()),
|
||||
(5, 'icon-th-list', 'index.php?controller=AdminFeaturesModuleSetting', 0, 5, 0, 1, NOW(), NOW());",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_settings_link_lang` (
|
||||
`id_settings_link` int(10) unsigned NOT NULL,
|
||||
@@ -491,27 +490,22 @@ class HotelReservationSystemDb
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 2, `id_lang`, 'Order Restrict', 'Configure if you want to restrict orders till a specific date for your hotels.'
|
||||
SELECT 2, `id_lang`, 'Advanced Price Rules', 'Here set Advanced price rules for specific dates.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 3, `id_lang`, 'Advanced Price Rules', 'Here set Advanced price rules for specific dates.'
|
||||
SELECT 3, `id_lang`, 'Additional Facilities', 'Here create Additional facilities and their prices for room types.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 4, `id_lang`, 'Additional Facilities', 'Here create Additional facilities and their prices for room types.'
|
||||
SELECT 4, `id_lang`, 'Hotel Interior Block', 'Configure Hotel Interior block. You can display hotel interior images using this block. This block will be displayed on home page.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 5, `id_lang`, 'Hotel Interior Block', 'Configure Hotel Interior block. You can display hotel interior images using this block. This block will be displayed on home page.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 6, `id_lang`, 'Hotel Amenities Block', 'Configure Hotels Amenities settings. You can display hotel amenities images using this block. This block will be displayed on home page.'
|
||||
SELECT 5, `id_lang`, 'Hotel Amenities Block', 'Configure Hotels Amenities settings. You can display hotel amenities images using this block. This block will be displayed on home page.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -40,11 +40,12 @@ class AdminAssignHotelFeaturesController extends ModuleAdminController
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'htl_branch_info` hi ON (hi.`id` = a.`id_hotel`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hil
|
||||
ON (hi.`id` = hil.`id` AND hil.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = hi.`state_id`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = hi.`country_id`
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'address` addr ON (addr.`id_hotel` = hi.`id`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = addr.`id_state`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = addr.`id_country`
|
||||
AND cl.`id_lang` = '.(int)$this->context->language->id.')';
|
||||
|
||||
$this->_select .= 'hi.`city` as htl_city, hi.`id` as htl_id, hil.`hotel_name` as htl_name,
|
||||
$this->_select .= 'addr.`city` as htl_city, hi.`id` as htl_id, hil.`hotel_name` as htl_name,
|
||||
s.`name` as `state_name`, cl.`name`';
|
||||
$this->_group = 'GROUP BY a.`id_hotel`';
|
||||
|
||||
@@ -57,12 +58,12 @@ class AdminAssignHotelFeaturesController extends ModuleAdminController
|
||||
'htl_name' => array(
|
||||
'title' => $this->l('Hotel Name'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 'hi!hotel_name',
|
||||
'filter_key' => 'hil!hotel_name',
|
||||
),
|
||||
'htl_city' => array(
|
||||
'title' => $this->l('City'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 'hi!city',
|
||||
'filter_key' => 'addr!city',
|
||||
),
|
||||
|
||||
'state_name' => array(
|
||||
@@ -225,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;
|
||||
}
|
||||
|
||||
@@ -466,6 +478,19 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$bookingParams['date_from'] = $cal_date_from;
|
||||
$bookingParams['date_to'] = $cal_date_to;
|
||||
$eventData = $objBookingDetail->getBookingData($bookingParams);
|
||||
if (!$eventData) {
|
||||
$eventData['stats'] = array(
|
||||
'total_room_type' => 0,
|
||||
'total_rooms' => 0,
|
||||
'max_avail_occupancy' => 0,
|
||||
'num_unavail' => 0,
|
||||
'num_cart' => 0,
|
||||
'num_booked' => 0,
|
||||
'num_avail' => 0,
|
||||
'num_part_avai' => 0,
|
||||
);
|
||||
}
|
||||
|
||||
$eventData['date_format'] = Tools::displayDate($cal_date_from);
|
||||
$events[strtotime($bookingParams['date_from'])] = array(
|
||||
'is_notification' => 1,
|
||||
@@ -765,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(
|
||||
|
||||
@@ -164,7 +164,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
}
|
||||
$this->fields_list = array(
|
||||
'id_order_return' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'title' => $this->l('Refund ID'),
|
||||
'align' => 'center',
|
||||
'class' => 'fixed-width-xs',
|
||||
),
|
||||
@@ -448,6 +448,8 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
|
||||
Hook::exec('actionOrderSlipAdd', array('order' => $objOrder, 'bookingList' => $bookingList));
|
||||
|
||||
$params['{credit_slip_url}'] = $this->context->link->getPageLink('order-slip', true);
|
||||
|
||||
@Mail::Send(
|
||||
(int)$objOrder->id_lang,
|
||||
'credit_slip',
|
||||
|
||||
@@ -411,65 +411,6 @@ $(document).ready(function() {
|
||||
$(this).parents('.child_feature_row').remove();
|
||||
});
|
||||
|
||||
/*For swaping rooms in the modal*/
|
||||
$("#realloc_allocated_rooms").on('click', function(e) {
|
||||
$(".error_text").text('');
|
||||
if ($('#realloc_avail_rooms').val() == 0) {
|
||||
$("#realloc_sel_rm_err_p").text(slct_rm_err);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#swap_allocated_rooms").on('click', function(e) {
|
||||
$(".error_text").text('');
|
||||
if ($('#swap_avail_rooms').val() == 0) {
|
||||
$("#swap_sel_rm_err_p").text(slct_rm_err);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#mySwappigModal').on('hidden.bs.modal', function(e) {
|
||||
$(".modal_date_from").val('');
|
||||
$(".modal_date_to").val('');
|
||||
$(".modal_id_room").val('');
|
||||
$(".modal_curr_room_num").val('');
|
||||
$(".cust_name").text('');
|
||||
$(".cust_email").text('');
|
||||
$(".swp_rm_opts").remove();
|
||||
$(".realloc_rm_opts").remove();
|
||||
});
|
||||
|
||||
$('#mySwappigModal').on('shown.bs.modal', function(e) {
|
||||
$(".modal_date_from").val(e.relatedTarget.dataset.date_from);
|
||||
$(".modal_date_to").val(e.relatedTarget.dataset.date_to);
|
||||
$(".modal_id_room").val(e.relatedTarget.dataset.id_room);
|
||||
$(".modal_curr_room_num").val(e.relatedTarget.dataset.room_num);
|
||||
$(".cust_name").text(e.relatedTarget.dataset.cust_name);
|
||||
$(".cust_email").text(e.relatedTarget.dataset.cust_email);
|
||||
html = '';
|
||||
if (e.relatedTarget.dataset.avail_rm_realloc) {
|
||||
var json_arr_rm_swp = JSON.parse(e.relatedTarget.dataset.avail_rm_swap);
|
||||
$.each(json_arr_rm_swp, function(key, val) {
|
||||
html += '<option class="swp_rm_opts" value="' + val.id_room + '" >' + val.room_num + '</option>';
|
||||
});
|
||||
}
|
||||
if (html != '') {
|
||||
$("#swap_avail_rooms").append(html);
|
||||
}
|
||||
|
||||
html = '';
|
||||
if (e.relatedTarget.dataset.avail_rm_realloc) {
|
||||
var json_arr_rm_realloc = JSON.parse(e.relatedTarget.dataset.avail_rm_realloc);
|
||||
$.each(json_arr_rm_realloc, function(key, val) {
|
||||
html += '<option class="realloc_rm_opts" value="' + val.id_room + '" >' + val.room_num + '</option>';
|
||||
});
|
||||
}
|
||||
if (html != '') {
|
||||
$("#realloc_avail_rooms").append(html);
|
||||
}
|
||||
});
|
||||
|
||||
/* ---- Book Now page Admin ---- */
|
||||
|
||||
/* ---- HotelConfigurationSettingController Admin ---- */
|
||||
|
||||
if ($('#WK_SHOW_MSG_ON_BO_on').prop('checked') === true) {
|
||||
|
||||
@@ -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',
|
||||
@@ -49,7 +50,7 @@ $(document).ready(function() {
|
||||
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#7EC77B');
|
||||
} else if (info.event.extendedProps.data.stats.num_part_avai > 0) {
|
||||
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#FFC224');
|
||||
} else if (info.event.extendedProps.data.stats.num_booked == info.event.extendedProps.data.stats.total_rooms) {
|
||||
} else if ((info.event.extendedProps.data.stats.num_booked == info.event.extendedProps.data.stats.total_rooms) && info.event.extendedProps.data.stats.total_rooms != 0) {
|
||||
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#00AFF0');
|
||||
} else {
|
||||
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#FF3838');
|
||||
@@ -312,7 +313,7 @@ $(document).ready(function() {
|
||||
occupancy = false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return occupancy;
|
||||
@@ -954,4 +955,61 @@ $(document).ready(function() {
|
||||
return [true, ""];
|
||||
}
|
||||
}
|
||||
|
||||
/*For swaping rooms in the modal*/
|
||||
$("#realloc_allocated_rooms").on('click', function(e) {
|
||||
$(".error_text").text('');
|
||||
if ($('#realloc_avail_rooms').val() == 0) {
|
||||
$("#realloc_sel_rm_err_p").text(slct_rm_err);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#swap_allocated_rooms").on('click', function(e) {
|
||||
$(".error_text").text('');
|
||||
if ($('#swap_avail_rooms').val() == 0) {
|
||||
$("#swap_sel_rm_err_p").text(slct_rm_err);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#mySwappigModal').on('hidden.bs.modal', function(e) {
|
||||
$(".modal_date_from").val('');
|
||||
$(".modal_date_to").val('');
|
||||
$(".modal_id_room").val('');
|
||||
$(".modal_curr_room_num").val('');
|
||||
$(".cust_name").text('');
|
||||
$(".cust_email").text('');
|
||||
$(".swp_rm_opts").remove();
|
||||
$(".realloc_rm_opts").remove();
|
||||
});
|
||||
|
||||
$('#mySwappigModal').on('shown.bs.modal', function(e) {
|
||||
$(".modal_date_from").val(e.relatedTarget.dataset.date_from);
|
||||
$(".modal_date_to").val(e.relatedTarget.dataset.date_to);
|
||||
$(".modal_id_room").val(e.relatedTarget.dataset.id_room);
|
||||
$(".modal_curr_room_num").val(e.relatedTarget.dataset.room_num);
|
||||
$(".cust_name").text(e.relatedTarget.dataset.cust_name);
|
||||
$(".cust_email").text(e.relatedTarget.dataset.cust_email);
|
||||
html = '';
|
||||
if (e.relatedTarget.dataset.avail_rm_realloc) {
|
||||
var json_arr_rm_swp = JSON.parse(e.relatedTarget.dataset.avail_rm_swap);
|
||||
$.each(json_arr_rm_swp, function(key, val) {
|
||||
html += '<option class="swp_rm_opts" value="' + val.id_room + '" >' + val.room_num + '</option>';
|
||||
});
|
||||
}
|
||||
if (html != '') {
|
||||
$("#swap_avail_rooms").append(html);
|
||||
}
|
||||
|
||||
html = '';
|
||||
if (e.relatedTarget.dataset.avail_rm_realloc) {
|
||||
var json_arr_rm_realloc = JSON.parse(e.relatedTarget.dataset.avail_rm_realloc);
|
||||
$.each(json_arr_rm_realloc, function(key, val) {
|
||||
html += '<option class="realloc_rm_opts" value="' + val.id_room + '" >' + val.room_num + '</option>';
|
||||
});
|
||||
}
|
||||
if (html != '') {
|
||||
$("#realloc_avail_rooms").append(html);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -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}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="1" min="1" max="{if isset($book_v)}{$book_v['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
</div>
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<label>{l s='Children'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="0" min="0" max="{if isset($book_v)}{$book_v['max_children']|escape:'html':'UTF-8'}{else}{$max_child_in_room}{/if}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
@@ -159,7 +159,7 @@
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="1" min="1" max="{if isset($book_v)}{$book_v['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
</div>
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<label>{l s='Children'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="0" min="0" max="{if isset($book_v)}{$book_v['max_children']|escape:'html':'UTF-8'}{else}{$max_child_in_room}{/if}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[{$key|escape:'htmlall':'UTF-8'}][adults]" value="{$room_occupancy['adults']|escape:'htmlall':'UTF-8'}" min="1">
|
||||
</div>
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<label>{l s='Children'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[{$key|escape:'htmlall':'UTF-8'}][children]" value="{$room_occupancy['children']|escape:'htmlall':'UTF-8'}" min="0" {if $max_child_in_room}max="{$max_child_in_room}"{/if}>
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
@@ -123,7 +123,7 @@
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="1" min="1">
|
||||
</div>
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<label>{l s='Children'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="0" min="0" {if $max_child_in_room}max="{$max_child_in_room}"{/if}>
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
@@ -218,7 +218,7 @@
|
||||
</ul>
|
||||
<div class="tab-content panel active">
|
||||
<div role="tabpanel" class="tab-pane active" id="reallocate_room_tab">
|
||||
<form method="post" action="{$formAction|escape:'htmlall':'UTF-8'}">
|
||||
<form method="post" action="">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="realloc_myModalLabel">{l s='Reallocate Rooms'}</h4>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -641,7 +641,6 @@ class QloCleaner extends Module
|
||||
array('warehouse_carrier', 'id_carrier', 'carrier', 'id_carrier'),
|
||||
array('warehouse_product_location', 'id_product', 'product', 'id_product'),
|
||||
array('warehouse_product_location', 'id_warehouse', 'warehouse', 'id_warehouse'),
|
||||
array('product_comment', 'id_product', 'product', 'id_product'),
|
||||
array('specific_price', 'id_product', 'customer', 'id_customer'),
|
||||
array('specific_price', 'id_group', 'group', 'id_group'),
|
||||
array('htl_features_block_data_lang', 'id_features_block', 'htl_features_block_data', 'id_features_block'),
|
||||
|
||||
@@ -202,10 +202,11 @@ class StatsBestProducts extends ModuleGrid
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int) $id_lang .')
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt
|
||||
ON (hrt.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil
|
||||
ON (hbil.`id` = hrt.`id_hotel` AND hbil.`id_lang` = '.(int) $id_lang .')';
|
||||
ON (hbil.`id` = hrt.`id_hotel` AND hbil.`id_lang` = '.(int) $id_lang .')
|
||||
WHERE p.`booking_product` = 1';
|
||||
|
||||
if (Validate::IsName($this->_sort)) {
|
||||
$this->query .= ' ORDER BY `'.bqSQL($this->_sort).'`';
|
||||
|
||||
@@ -46,7 +46,7 @@ class StatsCatalog extends Module
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Catalog statistics');
|
||||
$this->displayName = $this->l('Hotel statistics');
|
||||
$this->description = $this->l('Adds a tab containing general statistics about your catalog to the Stats dashboard.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.7.0.99');
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class StatsCatalog extends Module
|
||||
LEFT JOIN `'._DB_PREFIX_.'page` pa ON pv.`id_page` = pa.`id_page`
|
||||
LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = pa.`id_page_type`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = pa.`id_object`
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (p.`id_product` = hrt.`id_product`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (p.`id_product` = hrt.`id_product`)
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
'.$this->join.'
|
||||
WHERE pt.`name` IN ("product.php", "product")
|
||||
@@ -149,7 +149,7 @@ class StatsCatalog extends Module
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = i.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt
|
||||
ON (hrt.`id_product` = i.`id_product`)
|
||||
WHERE hrt.`id_hotel` = hbi.`id`
|
||||
) AS room_type_images
|
||||
@@ -174,7 +174,7 @@ class StatsCatalog extends Module
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = od.`product_id`
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (p.`id_product` = hrt.`id_product`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (p.`id_product` = hrt.`id_product`)
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
'.$this->join.'
|
||||
WHERE o.valid = 1
|
||||
@@ -194,7 +194,7 @@ class StatsCatalog extends Module
|
||||
$sql = 'SELECT p.id_product, pl.name, pl.link_rewrite
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (p.`id_product` = hrt.`id_product`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (p.`id_product` = hrt.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
ON (pl.`id_product` = p.`id_product` AND pl.id_lang = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').')
|
||||
'.$this->join.'
|
||||
@@ -282,12 +282,18 @@ class StatsCatalog extends Module
|
||||
<div class="row row-margin-bottom">
|
||||
<p>
|
||||
<i class="icon-asterisk"></i>'.$this->l('Defines the average conversion rate for the room type page. It is possible to book a room type without viewing the room type page, so this rate can be greater than 1.').'
|
||||
</p>';
|
||||
|
||||
$link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata';
|
||||
$html .='
|
||||
<p>
|
||||
<strong>'.$this->l('Note: ').'</strong>'.$this->l('You must enable the "Save global page views" option from ').'<a href="'.$link.'" target="_blank">Data mining for statistics</a>'.$this->l(' module for accurate data, or use the QloApps Google Analytics module.').'
|
||||
</p>
|
||||
</div>';
|
||||
|
||||
if (count($products_nb) && count($products_nb) < 50) {
|
||||
$html .= '
|
||||
<div class="panel-heading">'.$this->l('Room types never booked').'</div>
|
||||
<div class="col-sm-12"><div class="panel-heading">'.$this->l('Room types never booked').'</div></div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -91,6 +91,8 @@ class StatsCheckUp extends Module
|
||||
.$this->displayName.'
|
||||
</div>';
|
||||
|
||||
$activeTab = 'hotels';
|
||||
|
||||
if (Tools::isSubmit('submitCheckupRoomType')) {
|
||||
$confs = array(
|
||||
'ROOM_TYPE_CHECKUP_DESCRIPTIONS_LT',
|
||||
@@ -129,6 +131,25 @@ class StatsCheckUp extends Module
|
||||
$this->html .= $this->displayConfirmation($this->l('Configuration updated.'));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitCheckupService')) {
|
||||
$confs = array(
|
||||
'SERVICE_CHECKUP_DESCRIPTIONS_SHORT_LT',
|
||||
'SERVICE_CHECKUP_DESCRIPTIONS_SHORT_GT',
|
||||
'SERVICE_CHECKUP_IMAGES_LT',
|
||||
'SERVICE_CHECKUP_IMAGES_GT',
|
||||
'SERVICE_CHECKUP_ORDERS_LT',
|
||||
'SERVICE_CHECKUP_ORDERS_GT',
|
||||
);
|
||||
|
||||
foreach ($confs as $confname) {
|
||||
Configuration::updateValue($confname, (int)Tools::getValue($confname));
|
||||
}
|
||||
|
||||
$this->html .= $this->displayConfirmation($this->l('Configuration updated.'));
|
||||
|
||||
$activeTab = 'services';
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitCheckupOrder')) {
|
||||
$this->context->cookie->checkup_order = (int)Tools::getValue('submitCheckupOrder');
|
||||
$this->html .= $this->displayConfirmation($this->l('Configuration updated.'));
|
||||
@@ -142,6 +163,35 @@ class StatsCheckUp extends Module
|
||||
$this->id_hotel = (int) Tools::getValue('id_hotel');
|
||||
}
|
||||
|
||||
$this->html .= '
|
||||
<ul class="nav nav-tabs">
|
||||
<li '.($activeTab == 'hotels' ? 'class="active"' : '').'>
|
||||
<a href="#statscheckup_hotels" data-toggle="tab">
|
||||
<span>'.$this->l('Hotels').'</span>
|
||||
</a>
|
||||
</li>
|
||||
<li '.($activeTab == 'services' ? 'class="active"' : '').'>
|
||||
<a href="#statscheckup_services" data-toggle="tab">
|
||||
<span>'.$this->l('Services').'</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content panel panel-sm">
|
||||
<div class="tab-pane '.($activeTab == 'hotels' ? 'active' : '').'" id="statscheckup_hotels">
|
||||
'.$this->getHotelsTab().'
|
||||
</div>
|
||||
<div class="tab-pane '.($activeTab == 'services' ? 'active' : '').'" id="statscheckup_services">
|
||||
'.$this->getServicesTab().'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $this->html;
|
||||
}
|
||||
|
||||
private function getHotelsTab()
|
||||
{
|
||||
$employee = Context::getContext()->employee;
|
||||
$prop30 = ((strtotime($employee->stats_date_to.' 23:59:59') - strtotime($employee->stats_date_from.' 00:00:00')) / 60 / 60 / 24) / 30;
|
||||
|
||||
@@ -187,7 +237,7 @@ class StatsCheckUp extends Module
|
||||
'TOTAL_ROOMS' => array('name' => $this->l('Total rooms'), 'text' => $this->l('rooms')),
|
||||
);
|
||||
|
||||
$this->html .= '
|
||||
$hotelsHtml = '
|
||||
<form action="'.Tools::safeOutput(AdminController::$currentIndex.'&token='.Tools::getValue('token').'&module='.$this->name.($this->id_hotel ? '&id_hotel='.$this->id_hotel : '')).'" method="post" class="checkup form-horizontal">
|
||||
<table class="table checkup">
|
||||
<thead>
|
||||
@@ -200,7 +250,7 @@ class StatsCheckUp extends Module
|
||||
foreach ($array_conf as $conf => $translations) {
|
||||
$confKeyLt = ($this->id_hotel ? 'ROOM_TYPE' : 'HOTEL').'_CHECKUP_'.$conf.'_LT';
|
||||
$confKeyGt = ($this->id_hotel ? 'ROOM_TYPE' : 'HOTEL').'_CHECKUP_'.$conf.'_GT';
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -227,7 +277,7 @@ class StatsCheckUp extends Module
|
||||
</tr>
|
||||
</tbody>';
|
||||
}
|
||||
$this->html .= '</table>
|
||||
$hotelsHtml .= '</table>
|
||||
<button type="submit" name="'.($this->id_hotel ? 'submitCheckupRoomType' : 'submitCheckupHotel').'" class="btn btn-default pull-right">
|
||||
<i class="icon-save"></i> '.$this->l('Save').'
|
||||
</button>
|
||||
@@ -251,12 +301,12 @@ class StatsCheckUp extends Module
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box active">'.$this->l('ID').'</span></th>
|
||||
<th><span class="title_box active">'.$this->l('Room type').'</span></th>
|
||||
<th><span class="title_box active">'.(!$this->id_hotel ? $this->l('Hotel') : $this->l('Room type')).'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>';
|
||||
foreach ($languages as $language) {
|
||||
$this->html .= '<th><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';
|
||||
$hotelsHtml .= '<th><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';
|
||||
}
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<th class="center"><span class="title_box active">'.$this->l('Images').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Orders').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Total rooms').'</span></th>
|
||||
@@ -280,17 +330,6 @@ class StatsCheckUp extends Module
|
||||
);
|
||||
|
||||
foreach ($result as $row) {
|
||||
$row['stock'] = 0;
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($row['id_product'])) {
|
||||
$bookingParams['hotel_id'] = $roomTypeInfo['id_hotel'];
|
||||
$bookingParams['id_room_type'] = $row['id_product'];
|
||||
if ($booking_data = $objBookingDtl->getBookingData($bookingParams)) {
|
||||
if (isset($booking_data['stats']['num_avail'])) {
|
||||
$row['stock'] = $booking_data['stats']['num_avail'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$totals['products']++;
|
||||
$scores = array(
|
||||
'active' => ($row['active'] ? 2 : 0),
|
||||
@@ -302,7 +341,7 @@ class StatsCheckUp extends Module
|
||||
$totals['images'] += (int)$scores['images'];
|
||||
$totals['orders'] += (int)$scores['orders'];
|
||||
$totals['total_rooms'] += (int)$scores['total_rooms'];
|
||||
$descriptions = $this->getDescriptions($row['id_object']);
|
||||
$descriptions = $this->getDescriptions($this->id_hotel ? 'room_type' : 'hotel', $row['id_object']);
|
||||
foreach ($descriptions as $description) {
|
||||
if (isset($description['iso_code']) && isset($description['description'])) {
|
||||
$row['desclength_'.$description['iso_code']] = Tools::strlen(strip_tags($description['description']));
|
||||
@@ -321,16 +360,16 @@ class StatsCheckUp extends Module
|
||||
} else {
|
||||
$objectLink = $this->context->link->getAdminLink('AdminAddHotel').'&updatehtl_branch_info&id='.$row['id_object'];
|
||||
}
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<tr>
|
||||
<td>'.$row['id_object'].'</td>
|
||||
<td><a href="'.$objectLink.'" target="_blank">'.Tools::substr($row['object_name'], 0, 42).'</a></td>
|
||||
<td class="center">'.$array_colors[$scores['active']].'</td>';
|
||||
foreach ($languages as $language) {
|
||||
if (isset($row['desclength_'.$language['iso_code']])) {
|
||||
$this->html .= '<td class="center">'.(int)$row['desclength_'.$language['iso_code']].' '.$array_colors[$scores['description_'.$language['iso_code']]].'</td>';
|
||||
$hotelsHtml .= '<td class="center">'.(int)$row['desclength_'.$language['iso_code']].' '.$array_colors[$scores['description_'.$language['iso_code']]].'</td>';
|
||||
} else {
|
||||
$this->html .= '<td>0 '.$array_colors[0].'</td>';
|
||||
$hotelsHtml .= '<td>0 '.$array_colors[0].'</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,7 +378,7 @@ class StatsCheckUp extends Module
|
||||
$objectViewLink = $this->context->link->getAdminLink('AdminStats').'&module='.$this->name.'&id_hotel='.$row['id_object'];
|
||||
}
|
||||
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<td class="center">'.(int)$row['nbImages'].' '.$array_colors[$scores['images']].'</td>
|
||||
<td class="center">'.(int)$row['nbOrders'].' '.$array_colors[$scores['orders']].'</td>
|
||||
<td class="center">'.(int)$row['totalRooms'].' '.$array_colors[$scores['total_rooms']].'</td>
|
||||
@@ -348,7 +387,7 @@ class StatsCheckUp extends Module
|
||||
</tr>';
|
||||
}
|
||||
|
||||
$this->html .= '</tbody>';
|
||||
$hotelsHtml .= '</tbody>';
|
||||
|
||||
$totals['active'] = $totals['active'] / $totals['products'];
|
||||
$totals['active'] = ($totals['active'] < 1 ? 0 : ($totals['active'] > 1.5 ? 2 : 1));
|
||||
@@ -365,15 +404,15 @@ class StatsCheckUp extends Module
|
||||
$totals['average'] = array_sum($totals) / $divisor;
|
||||
$totals['average'] = ($totals['average'] < 1 ? 0 : ($totals['average'] > 1.5 ? 2 : 1));
|
||||
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>';
|
||||
foreach ($languages as $language) {
|
||||
$this->html .= '<th class="center"><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';
|
||||
$hotelsHtml .= '<th class="center"><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';
|
||||
}
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<th class="center"><span class="title_box active">'.$this->l('Images').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Orders').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Total rooms').'</span></th>
|
||||
@@ -384,19 +423,248 @@ class StatsCheckUp extends Module
|
||||
<td colspan="2"></td>
|
||||
<td class="center">'.$array_colors[$totals['active']].'</td>';
|
||||
foreach ($languages as $language) {
|
||||
$this->html .= '<td class="center">'.$array_colors[$totals['description_'.$language['iso_code']]].'</td>';
|
||||
$hotelsHtml .= '<td class="center">'.$array_colors[$totals['description_'.$language['iso_code']]].'</td>';
|
||||
}
|
||||
$this->html .= '
|
||||
$hotelsHtml .= '
|
||||
<td class="center">'.$array_colors[$totals['images']].'</td>
|
||||
<td class="center">'.$array_colors[$totals['orders']].'</td>
|
||||
<td class="center">'.$array_colors[$totals['total_rooms']].'</td>
|
||||
<td class="center">'.$array_colors[$totals['average']].'</td>
|
||||
'.(!$this->id_hotel ? '<td></td>' : '').'
|
||||
</tr>
|
||||
'.($this->id_hotel ? '
|
||||
<tr>
|
||||
<td colspan="100%">
|
||||
<a class="btn btn-default" href="'.$this->context->link->getAdminLink('AdminStats').'&module='.$this->name.''.'">
|
||||
<i class="icon-arrow-circle-left"></i> '.$this->l('Back').'
|
||||
</a>
|
||||
</td>
|
||||
</tr>' : '').'
|
||||
</tfoot>
|
||||
</table></div>';
|
||||
|
||||
return $this->html;
|
||||
return $hotelsHtml;
|
||||
}
|
||||
|
||||
private function getServicesTab()
|
||||
{
|
||||
$employee = Context::getContext()->employee;
|
||||
$prop30 = ((strtotime($employee->stats_date_to.' 23:59:59') - strtotime($employee->stats_date_from.' 00:00:00')) / 60 / 60 / 24) / 30;
|
||||
|
||||
// Get languages
|
||||
$sql = 'SELECT l.*
|
||||
FROM '._DB_PREFIX_.'lang l'
|
||||
.Shop::addSqlAssociation('lang', 'l');
|
||||
$languages = Db::getInstance()->executeS($sql);
|
||||
|
||||
$array_colors = array(
|
||||
0 => '<img src="../modules/'.$this->name.'/img/red.png" alt="'.$this->l('Bad').'" title="'.$this->l('Bad').'" />',
|
||||
1 => '<img src="../modules/'.$this->name.'/img/orange.png" alt="'.$this->l('Average').'" title="'.$this->l('Average').'" />',
|
||||
2 => '<img src="../modules/'.$this->name.'/img/green.png" alt="'.$this->l('Good').'" title="'.$this->l('Good').'" />'
|
||||
);
|
||||
|
||||
$divisor = 4;
|
||||
$totals = array('services' => 0, 'active' => 0, 'images' => 0, 'orders' => 0, 'associated_room_types' => 0);
|
||||
foreach ($languages as $language) {
|
||||
$divisor++;
|
||||
$totals['description_'.$language['iso_code']] = 0;
|
||||
}
|
||||
|
||||
// set data from here
|
||||
$result = $this->getServiceStats();
|
||||
|
||||
if (!$result) {
|
||||
return $this->l('No service was found.');
|
||||
}
|
||||
|
||||
$array_conf = array(
|
||||
'DESCRIPTIONS_SHORT' => array('name' => $this->l('Descriptions'), 'text' => $this->l('chars (without HTML)')),
|
||||
'IMAGES' => array('name' => $this->l('Images'), 'text' => $this->l('images')),
|
||||
'ORDERS' => array('name' => $this->l('Orders'), 'text' => $this->l('orders / month')),
|
||||
);
|
||||
|
||||
$servicesHtml = '
|
||||
<form action="'.Tools::safeOutput(AdminController::$currentIndex.'&token='.Tools::getValue('token').'&module='.$this->name).'" method="post" class="checkup form-horizontal">
|
||||
<table class="table checkup">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><span class="title_box active">'.$array_colors[0].' '.$this->l('Not enough').'</span></th>
|
||||
<th><span class="title_box active">'.$array_colors[2].' '.$this->l('Alright').'</span></th>
|
||||
</tr>
|
||||
</thead>';
|
||||
foreach ($array_conf as $conf => $translations) {
|
||||
$confKeyLt = 'SERVICE_CHECKUP_'.$conf.'_LT';
|
||||
$confKeyGt = 'SERVICE_CHECKUP_'.$conf.'_GT';
|
||||
$servicesHtml .= '
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label col-lg-12">'.$translations['name'].'</label>
|
||||
</td>
|
||||
<td>
|
||||
<div class="row">
|
||||
<div class="col-lg-11 input-group">
|
||||
<span class="input-group-addon">'.$this->l('Less than').'</span>
|
||||
<input type="text" name="'.$confKeyLt.'" value="'.Tools::safeOutput(Tools::getValue($confKeyLt, Configuration::get($confKeyLt))).'" />
|
||||
<span class="input-group-addon">'.$translations['text'].'</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 input-group">
|
||||
<span class="input-group-addon">'.$this->l('Greater than').'</span>
|
||||
<input type="text" name="'.$confKeyGt.'" value="'.Tools::safeOutput(Tools::getValue($confKeyGt, Configuration::get($confKeyGt))).'" />
|
||||
<span class="input-group-addon">'.$translations['text'].'</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>';
|
||||
}
|
||||
$servicesHtml .= '</table>
|
||||
<button type="submit" name="submitCheckupService" class="btn btn-default pull-right">
|
||||
<i class="icon-save"></i> '.$this->l('Save').'
|
||||
</button>
|
||||
</form>
|
||||
<form action="'.Tools::safeOutput(AdminController::$currentIndex.'&token='.Tools::getValue('token').'&module='.$this->name).'" method="post" class="form-horizontal alert">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="control-label pull-left">'.$this->l('Order by').'</label>
|
||||
<div class="col-lg-3">
|
||||
<select name="submitCheckupOrder" onchange="this.form.submit();">
|
||||
<option value="'.self::ORDER_BY_ID.'">'.$this->l('ID').'</option>
|
||||
<option value="'.self::ORDER_BY_NAME.'" '.($this->context->cookie->checkup_order == self::ORDER_BY_NAME ? 'selected="selected"' : '').'>'.$this->l('Name').'</option>
|
||||
<option value="'.self::ORDER_BY_ORDERS.'" '.($this->context->cookie->checkup_order == self::ORDER_BY_ORDERS ? 'selected="selected"' : '').'>'.$this->l('Orders').'</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div style="overflow-x:auto">
|
||||
<table class="table checkup2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box active">'.$this->l('ID').'</span></th>
|
||||
<th><span class="title_box active">'.$this->l('Service').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Associated room types').'</span></th>';
|
||||
foreach ($languages as $language) {
|
||||
$servicesHtml .= '<th class="center"><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';
|
||||
}
|
||||
$servicesHtml .= '
|
||||
<th class="center"><span class="title_box active">'.$this->l('Images').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Orders').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Overall status').'</span></th>
|
||||
'.(!$this->id_hotel ? '<th class="center"><span class="title_box active">'.$this->l('Action').'</span></th>' : '').'
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
|
||||
$confCheckup = array(
|
||||
'IMAGES_LT' => Configuration::get('SERVICE_CHECKUP_IMAGES_LT'),
|
||||
'IMAGES_GT' => Configuration::get('SERVICE_CHECKUP_IMAGES_GT'),
|
||||
'ORDERS_LT' => Configuration::get('SERVICE_CHECKUP_ORDERS_LT'),
|
||||
'ORDERS_GT' => Configuration::get('SERVICE_CHECKUP_ORDERS_GT'),
|
||||
'DESCRIPTIONS_SHORT_LT' => Configuration::get('SERVICE_CHECKUP_DESCRIPTIONS_SHORT_LT'),
|
||||
'DESCRIPTIONS_SHORT_GT' => Configuration::get('SERVICE_CHECKUP_DESCRIPTIONS_SHORT_GT'),
|
||||
);
|
||||
|
||||
foreach ($result as $row) {
|
||||
$totals['services']++;
|
||||
$scores = array(
|
||||
'active' => ($row['active'] ? 2 : 0),
|
||||
'images' => ($row['nbImages'] < $confCheckup['IMAGES_LT'] ? 0 : ($row['nbImages'] > $confCheckup['IMAGES_GT'] ? 2 : 1)),
|
||||
'orders' => (($row['nbOrders'] * $prop30 < $confCheckup['ORDERS_LT']) ? 0 : (($row['nbOrders'] * $prop30 > $confCheckup['ORDERS_GT']) ? 2 : 1)),
|
||||
);
|
||||
$totals['active'] += (int)$scores['active'];
|
||||
$totals['images'] += (int)$scores['images'];
|
||||
$totals['orders'] += (int)$scores['orders'];
|
||||
$descriptions = $this->getDescriptions('service', $row['id_object']);
|
||||
foreach ($descriptions as $description) {
|
||||
if (isset($description['iso_code']) && isset($description['description_short'])) {
|
||||
$row['desclength_'.$description['iso_code']] = Tools::strlen(strip_tags($description['description_short']));
|
||||
}
|
||||
if (isset($description['iso_code'])) {
|
||||
$scores['description_'.$description['iso_code']] = ($row['desclength_'.$description['iso_code']] < $confCheckup['DESCRIPTIONS_SHORT_LT'] ? 0 : ($row['desclength_'.$description['iso_code']] > $confCheckup['DESCRIPTIONS_SHORT_GT'] ? 2 : 1));
|
||||
$totals['description_'.$description['iso_code']] += $scores['description_'.$description['iso_code']];
|
||||
}
|
||||
}
|
||||
$scores['average'] = array_sum($scores) / $divisor;
|
||||
$scores['average'] = ($scores['average'] < 1 ? 0 : ($scores['average'] > 1.5 ? 2 : 1));
|
||||
|
||||
$objectLink = $this->context->link->getAdminLink('AdminNormalProducts').'&updateproduct&id_product='.$row['id_object'];
|
||||
$servicesHtml .= '
|
||||
<tr>
|
||||
<td>'.$row['id_object'].'</td>
|
||||
<td><a href="'.$objectLink.'" target="_blank">'.Tools::substr($row['object_name'], 0, 42).'</a></td>
|
||||
<td class="center">'.$array_colors[$scores['active']].'</td>
|
||||
<td class="center">'.$row['nbAssociatedRoomTypes'].'</td>';
|
||||
foreach ($languages as $language) {
|
||||
if (isset($row['desclength_'.$language['iso_code']])) {
|
||||
$servicesHtml .= '<td class="center">'.(int)$row['desclength_'.$language['iso_code']].' '.$array_colors[$scores['description_'.$language['iso_code']]].'</td>';
|
||||
} else {
|
||||
$servicesHtml .= '<td class="center">0 '.$array_colors[0].'</td>';
|
||||
}
|
||||
}
|
||||
|
||||
$servicesHtml .= '
|
||||
<td class="center">'.(int)$row['nbImages'].' '.$array_colors[$scores['images']].'</td>
|
||||
<td class="center">'.(int)$row['nbOrders'].' '.$array_colors[$scores['orders']].'</td>
|
||||
<td class="center">'.$array_colors[$scores['average']].'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
$servicesHtml .= '</tbody>';
|
||||
|
||||
$totals['active'] = $totals['active'] / $totals['services'];
|
||||
$totals['active'] = ($totals['active'] < 1 ? 0 : ($totals['active'] > 1.5 ? 2 : 1));
|
||||
$totals['images'] = $totals['images'] / $totals['services'];
|
||||
$totals['images'] = ($totals['images'] < 1 ? 0 : ($totals['images'] > 1.5 ? 2 : 1));
|
||||
$totals['orders'] = $totals['orders'] / $totals['services'];
|
||||
$totals['orders'] = ($totals['orders'] < 1 ? 0 : ($totals['orders'] > 1.5 ? 2 : 1));
|
||||
$totals['associated_room_types'] = $totals['associated_room_types'] / $totals['services'];
|
||||
$totals['associated_room_types'] = ($totals['associated_room_types'] < 1 ? 0 : ($totals['associated_room_types'] > 1.5 ? 2 : 1));
|
||||
foreach ($languages as $language) {
|
||||
$totals['description_'.$language['iso_code']] = $totals['description_'.$language['iso_code']] / $totals['services'];
|
||||
$totals['description_'.$language['iso_code']] = ($totals['description_'.$language['iso_code']] < 1 ? 0 : ($totals['description_'.$language['iso_code']] > 1.5 ? 2 : 1));
|
||||
}
|
||||
$totals['average'] = array_sum($totals) / $divisor;
|
||||
$totals['average'] = ($totals['average'] < 1 ? 0 : ($totals['average'] > 1.5 ? 2 : 1));
|
||||
|
||||
$servicesHtml .= '
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Associated room types').'</span></th>';
|
||||
foreach ($languages as $language) {
|
||||
$servicesHtml .= '<th class="center"><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';
|
||||
}
|
||||
$servicesHtml .= '
|
||||
<th class="center"><span class="title_box active">'.$this->l('Images').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Orders').'</span></th>
|
||||
<th class="center"><span class="title_box active">'.$this->l('Overall status').'</span></th>
|
||||
'.(!$this->id_hotel ? '<th></th>' : '').'
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td class="center">'.$array_colors[$totals['active']].'</td>
|
||||
<td class="center">NA</td>';
|
||||
foreach ($languages as $language) {
|
||||
$servicesHtml .= '<td class="center">'.$array_colors[$totals['description_'.$language['iso_code']]].'</td>';
|
||||
}
|
||||
$servicesHtml .= '
|
||||
<td class="center">'.$array_colors[$totals['images']].'</td>
|
||||
<td class="center">'.$array_colors[$totals['orders']].'</td>
|
||||
<td class="center">'.$array_colors[$totals['average']].'</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table></div>';
|
||||
|
||||
return $servicesHtml;
|
||||
}
|
||||
|
||||
public function getHotelStats()
|
||||
@@ -479,20 +747,49 @@ class StatsCheckUp extends Module
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public function getDescriptions($id_object)
|
||||
public function getServiceStats()
|
||||
{
|
||||
if ($this->id_hotel) {
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT l.`iso_code`, pl.`description`
|
||||
FROM '._DB_PREFIX_.'product_lang pl
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l
|
||||
ON pl.`id_lang` = l.`id_lang`
|
||||
LEFT JOIN '._DB_PREFIX_.'htl_room_type hrt
|
||||
ON (hrt.`id_product` = pl.`id_product`)
|
||||
WHERE hrt.`id_hotel` = '.(int) $this->id_hotel.'
|
||||
AND pl.`id_product` = '.(int) $id_object
|
||||
);
|
||||
} else {
|
||||
$date_from = date('Y-m-d', strtotime($this->context->employee->stats_date_from));
|
||||
$date_to = date('Y-m-d', strtotime($this->context->employee->stats_date_to));
|
||||
$id_lang = $this->context->language->id;
|
||||
|
||||
$order_by = 'p.`id_product`';
|
||||
if ($this->context->cookie->checkup_order == self::ORDER_BY_NAME) {
|
||||
$order_by = 'object_name';
|
||||
} elseif ($this->context->cookie->checkup_order == self::ORDER_BY_ORDERS) {
|
||||
$order_by = 'nbOrders DESC';
|
||||
}
|
||||
|
||||
$sql = 'SELECT p.`id_product` AS id_object, p.`active`, pl.`name` AS object_name,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM '._DB_PREFIX_.'image i
|
||||
WHERE i.`id_product` = p.`id_product`
|
||||
) AS nbImages,
|
||||
(
|
||||
SELECT COUNT(DISTINCT rsod.`id_order`) FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = rsod.`id_order`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id` = rsod.`id_htl_booking_detail`)
|
||||
WHERE rsod.`id_product` = p.`id_product` AND o.`valid` = 1
|
||||
AND hbd.`date_to` > "'.pSQL($date_from).'" AND hbd.`date_from` < "'.pSQL($date_to).'"
|
||||
) AS nbOrders,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_service_product` rsp
|
||||
WHERE rsp.`id_product` = p.`id_product`
|
||||
) AS nbAssociatedRoomTypes
|
||||
FROM '._DB_PREFIX_.'product p
|
||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl
|
||||
ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int) $id_lang.')
|
||||
WHERE p.`booking_product` = 0
|
||||
ORDER BY '.$order_by;
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public function getDescriptions($object_type, $id_object = null)
|
||||
{
|
||||
if ($object_type == 'hotel') {
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT l.`iso_code`, hbil.`description`
|
||||
FROM '._DB_PREFIX_.'htl_branch_info_lang hbil
|
||||
@@ -500,6 +797,27 @@ class StatsCheckUp extends Module
|
||||
ON hbil.`id_lang` = l.`id_lang`
|
||||
WHERE hbil.`id` = '.(int) $id_object
|
||||
);
|
||||
} elseif ($object_type == 'room_type') {
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT l.`iso_code`, pl.`description`
|
||||
FROM '._DB_PREFIX_.'product_lang pl
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l
|
||||
ON pl.`id_lang` = l.`id_lang`
|
||||
INNER JOIN '._DB_PREFIX_.'htl_room_type hrt
|
||||
ON (hrt.`id_product` = pl.`id_product`)
|
||||
WHERE hrt.`id_hotel` = '.(int) $this->id_hotel.'
|
||||
AND pl.`id_product` = '.(int) $id_object
|
||||
);
|
||||
} elseif ($object_type == 'service') {
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT l.`iso_code`, pl.`description_short`
|
||||
FROM '._DB_PREFIX_.'product p
|
||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl
|
||||
ON (pl.`id_product` = p.`id_product`)
|
||||
LEFT JOIN '._DB_PREFIX_.'lang l
|
||||
ON pl.`id_lang` = l.`id_lang`
|
||||
WHERE p.`booking_product` = 0'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -240,7 +240,7 @@ class StatsForecast extends Module
|
||||
|
||||
$this->html .= '
|
||||
<tr>
|
||||
<td class="fixed-width-sm">'.($this->context->cookie->stats_granularity == 42 ? (Tools::displayDate($row['fix_date']).' - '.Tools::displayDate($row['end_date'])) : Tools::displayDate($row['fix_date'])).'</td>
|
||||
<td class="fixed-width-sm">'.($this->context->cookie->stats_granularity == 42 ? (Tools::displayDate($row['fix_date']).' - '.Tools::displayDate($row['end_date'])) : $row['fix_date']).'</td>
|
||||
<td class="text-left">'.$visits_today.'</td>
|
||||
<td class="text-left">'.(int)$row['registrations'].'</td>
|
||||
<td class="text-left">'.(int)$row['countOrders'].'</td>
|
||||
|
||||
@@ -324,7 +324,7 @@ class StatsPersonalInfos extends ModuleGraph
|
||||
// Total unknown
|
||||
$sql = 'SELECT COUNT(`id_customer`) as total
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `birthday` IS NULL
|
||||
WHERE `birthday` = "0000-00-00"
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER);
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
|
||||
if (isset($result['total']) && $result['total']) {
|
||||
|
||||
@@ -119,6 +119,7 @@ class StatsProduct extends ModuleGraph
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (hrt.`id_product` = p.`id_product` AND hrt.`id_hotel` = '.(int)Tools::getValue('id_hotel').')';
|
||||
}
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang`='.(int)$this->context->language->id.')
|
||||
WHERE p.`booking_product` = 1
|
||||
ORDER BY pl.`name`';
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
@@ -302,20 +303,8 @@ class StatsProduct extends ModuleGraph
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
$bookingParams = array();
|
||||
$bookingParams['date_from'] = $dateFrom;
|
||||
$bookingParams['date_to'] = $dateTo;
|
||||
foreach ($this->getProducts($this->context->language->id) as $product) {
|
||||
$availRooms = 0;
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($product['id_product'])) {
|
||||
$bookingParams['hotel_id'] = $roomTypeInfo['id_hotel'];
|
||||
$bookingParams['id_room_type'] = $product['id_product'];
|
||||
if ($booking_data = $objBookingDtl->getBookingData($bookingParams)) {
|
||||
if (isset($booking_data['stats']['num_avail'])) {
|
||||
$availRooms = $booking_data['stats']['num_avail'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// get room types info
|
||||
foreach ($this->getProducts() as $product) {
|
||||
$this->html .= '
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
@@ -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