Merge branch 'webkul:develop' into text-changes-2

This commit is contained in:
abhishek-webkul
2024-02-09 12:59:49 +05:30
committed by GitHub
133 changed files with 1372 additions and 612 deletions

View File

@@ -404,7 +404,7 @@ var ajaxCart = {
if (jsonData.avail_rooms == 0) {
disableRoomTypeDemands(1);
}
BookingForm.refresh();
BookingForm.refresh(true);
}
if (pagename == 'category') {
@@ -422,6 +422,13 @@ var ajaxCart = {
$(callerElement).closest(".room_cont").hide();
}
//$('#quantity_wanted_'+idProduct).val(1);
let addRoomButton = $(callerElement).closest('.room_info_cont').find('.booking_guest_occupancy_conatiner .dropdown-menu .add_occupancy_block .add_new_occupancy_btn');
if (jsonData.avail_rooms > 1) {
$(addRoomButton).removeClass('disabled');
} else {
$(addRoomButton).addClass('disabled');
}
}
@@ -664,6 +671,13 @@ var ajaxCart = {
$('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').hide();
}
});
let addRoomButton = $('.room_cont[data-id-product="'+idProduct+'"]').find('.room_info_cont').find('.booking_guest_occupancy_conatiner .dropdown-menu .add_occupancy_block .add_new_occupancy_btn');
if (jsonData.avail_rooms > 1) {
$(addRoomButton).removeClass('disabled');
} else {
$(addRoomButton).addClass('disabled');
}
}
if (pagename == 'orderopc') {
location.reload();

View File

@@ -17,26 +17,6 @@
* @license LICENSE.txt
*/
/* scrollbar design - start */
#dashguestcycle.dashboard-top ::-webkit-scrollbar {
height: 12px;
margin-bottom: 5px;
}
#dashguestcycle.dashboard-top ::-webkit-scrollbar-track {
background-color: #DDD;
margin: 0 6px;
border-radius: 10px;
}
#dashguestcycle.dashboard-top ::-webkit-scrollbar-thumb {
background-color: #BBB;
border-radius: 10px;
margin-bottom: 5px;
}
/* scrollbar design - end */
#dashguestcycle {
padding-bottom: 5px;
}

View File

@@ -35,6 +35,7 @@ class GraphNvD3 extends ModuleGraphEngine
private $_values;
private $_legend;
private $_titles;
private $_formats;
public function __construct($type = null)
{
@@ -113,6 +114,10 @@ class GraphNvD3 extends ModuleGraphEngine
if (jsonData.axisLabels.yAxis != null)
chart.yAxis.axisLabel(jsonData.axisLabels.yAxis);
if (jsonData.axisFormat.xAxis)
chart.xAxis.tickFormat(d3.format(jsonData.axisFormat.xAxis));
if (jsonData.axisFormat.yAxis)
chart.yAxis.tickFormat(d3.format(jsonData.axisFormat.yAxis));
d3.select("#nvd3_chart_'.($divid++).' svg")
.datum(jsonData.data)
.transition().duration(500)
@@ -148,10 +153,16 @@ class GraphNvD3 extends ModuleGraphEngine
$this->_titles = $titles;
}
public function setFormat($_formats)
{
$this->_formats = $_formats;
}
public function draw()
{
$array = array(
'axisLabels' => array('xAxis' => $this->_titles['x'], 'yAxis' => $this->_titles['y']),
'axisFormat' => array('xAxis' => $this->_formats['x'], 'yAxis' => $this->_formats['y']),
'data' => array()
);

View File

@@ -508,6 +508,8 @@ class HotelBookingDetail extends ObjectModel
$sql = $sql.' UNION '.$sql3;
}
$sql .= ' ORDER BY id_room ASC';
$unavailRoomTypes = array();
if ($unavailRooms = Db::getInstance()->executeS($sql)) {
foreach ($unavailRooms as $unavailRoomDetail) {
@@ -629,8 +631,8 @@ class HotelBookingDetail extends ObjectModel
$whereAvailRoomSearch = 'WHERE ri.`id_hotel`='.(int)$idHotel.' AND ri.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE.' AND ri.`id` NOT IN ('.$exclude_ids.') AND IF('.(int)$idRoomType.' > 0, ri.`id_product` = '.(int)$idRoomType.', 1) AND ri.`id_product` IN ('.$allowedIdRoomTypes.')';
$groupByAvailRoomSearch = '';
$orderByAvailRoomSearch = '';
$orderWayAvailRoomSearch = '';
$orderByAvailRoomSearch = 'ORDER BY ri.`id`';
$orderWayAvailRoomSearch = 'ASC';
Hook::exec('actionAvailRoomSearchSqlModifier',
array(
@@ -930,7 +932,7 @@ class HotelBookingDetail extends ObjectModel
(hrdd.`date_from` > \''.pSQL($dateFrom).'\' AND hrdd.`date_from` < \''.pSQL($dateTo).'\' AND hrdd.`date_to` < \''.pSQL($dateTo).'\')
) AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
$sql = $sql1.' UNION '.$sql2;
$sql = $sql1.' UNION '.$sql2.' ORDER BY id_room ASC';
$part_arr = Db::getInstance()->executeS($sql);
// Get date wise available rooms
@@ -1224,7 +1226,8 @@ class HotelBookingDetail extends ObjectModel
$sql = 'SELECT bd.`id_product`, bd.`id_room`, bd.`id_hotel`, bd.`id_customer`, bd.`booking_type`, bd.`id_status` AS booking_status, bd.`comment`, rf.`room_num`, bd.`date_from`, bd.`date_to`
FROM `'._DB_PREFIX_.'htl_booking_detail` AS bd
INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = bd.`id_room`)
WHERE bd.`id_hotel`='.(int)$idHotel.' AND bd.`is_refunded` = 0 AND bd.`is_back_order` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.date_to >= \''.pSQL($dateTo).'\') AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')';
WHERE bd.`id_hotel`='.(int)$idHotel.' AND bd.`is_refunded` = 0 AND bd.`is_back_order` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.date_to >= \''.pSQL($dateTo).'\') AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')
ORDER BY bd.`id_room` ASC';
$bookedRoomTypes = array();
if ($booked_rooms = Db::getInstance()->executeS($sql)) {

View File

@@ -976,7 +976,14 @@ class HotelCartBookingData extends ObjectModel
false
);
$cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData($value['id_product']);
$cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData(
$value['id_product'],
1,
0,
false,
2,
null
);
$cart_detail_data[$key]['selected_services'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
$value['id'],
0,

View File

@@ -305,15 +305,16 @@ class HotelHelper
return true;
}
public static function getPsProducts($id_lang, $start = 0, $limit = 0)
public static function getPsProducts($id_lang, $start = 0, $limit = 0, $booking_product = null)
{
$sql = 'SELECT p.`id_product`, pl.`name`
$sql = 'SELECT p.`id_product`, pl.`name`, p.`booking_product`
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` '.
Shop::addSqlRestrictionOnLang('pl').')
WHERE pl.`id_lang` = '.(int)$id_lang.
' ORDER BY pl.`name`'.
(isset($booking_product) ? ' AND p.`booking_product` = '.(int) $booking_product : '').'
ORDER BY pl.`name`'.
($limit > 0 ? ' LIMIT '.(int)$start.','.(int)$limit : '');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}
@@ -434,7 +435,7 @@ class HotelHelper
$product->description_short[$lang['id_lang']] = 'Fashion axe kogi yuccie, ramps shabby chic direct
trade before they sold out distillery bicycle rights. Slow-carb +1 quinoa VHS. +1 brunch trust fund,
meggings chartreuse sustainable everyday carry tumblr hoodie tacos tilde ramps post-ironic fixie.';
$product->link_rewrite[$lang['id_lang']] = Tools::link_rewrite('Super Delux Rooms');
$product->link_rewrite[$lang['id_lang']] = Tools::link_rewrite($value_prod);
}
$product->id_shop_default = Context::getContext()->shop->id;
$product->id_category_default = 2;
@@ -515,7 +516,7 @@ class HotelHelper
$htl_room_info_obj = new HotelRoomInformation();
$htl_room_info_obj->id_product = $product_id;
$htl_room_info_obj->id_hotel = $id_hotel;
$htl_room_info_obj->room_num = 'A-10'.$k;
$htl_room_info_obj->room_num = $value_prod[0].'R-10'.$k;
$htl_room_info_obj->id_status = 1;
$htl_room_info_obj->floor = 'First';
$htl_room_info_obj->save();
@@ -544,6 +545,170 @@ class HotelHelper
}
}
public function saveDummyServiceProductsAndRelatedInfo()
{
$idCategoryServices = (int) Configuration::get('PS_SERVICE_CATEGORY');
$idsGroup = array_column(Group::getGroups(Context::getContext()->language->id), 'id_group');
// create service categories
$categories = array(
'meals' => array(
'name' => 'Meals',
'id_category' => 'to_be_set_below',
),
'transfers' => array(
'name' => 'Transfers',
'id_category' => 'to_be_set_below',
)
);
foreach ($categories as &$category) {
$idCategory = $this->addCategory($category['name'], $idCategoryServices, $idsGroup);
$category['id_category'] = $idCategory;
}
// create service products
$serviceProducts = array(
array(
'name' => 'Room Maintenance Fees',
'id_category_default' => $idCategoryServices,
'description' => 'Ensure a comfortable stay with our room maintenance service, keeping your accommodation pristine and hassle-free throughout your visit.',
'price' => '250',
'auto_add_to_cart' => 1,
'show_at_front' => 0,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
),
array(
'name' => 'Internet Handling Charges',
'id_category_default' => $idCategoryServices,
'description' => 'Navigate our website effortlessly with seamless handling, ensuring reliable, high-speed access for an enjoyable browsing experience throughout your online journey.',
'price' => '250',
'auto_add_to_cart' => 1,
'show_at_front' => 0,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_INDEPENDENT,
),
array(
'name' => 'Airport Shuttle',
'id_category_default' => $categories['transfers']['id_category'],
'description' => 'Experience convenience from touchdown to check-in with our efficient airport shuttle service, whisking you to your accommodation with ease and comfort.',
'price' => '50',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
),
array(
'name' => 'Cab on Demand',
'id_category_default' => $categories['transfers']['id_category'],
'description' => 'Explore the city conveniently with our cab-on-demand service, giving you the freedom to travel and discover local attractions at your own pace.',
'price' => '200',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
),
array(
'name' => 'Breakfast',
'id_category_default' => $categories['meals']['id_category'],
'description' => 'Start your day right with a delicious and hearty breakfast, thoughtfully prepared to fuel your adventures and make your mornings exceptional.',
'price' => '350',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
),
array(
'name' => 'Dinner',
'id_category_default' => $categories['meals']['id_category'],
'description' => 'Wind down in the evening with a delectable dinner spread, offering a culinary journey that delights your taste buds and completes your day with satisfaction.',
'price' => '450',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
),
);
foreach ($serviceProducts as $serviceProduct) {
$objProduct = new Product();
$objProduct->name = array();
$objProduct->description = array();
$objProduct->description_short = array();
$objProduct->link_rewrite = array();
// copy lang values
foreach (Language::getLanguages(true) as $language) {
$objProduct->name[$language['id_lang']] = $serviceProduct['name'];
$objProduct->description[$language['id_lang']] = $serviceProduct['description'];
$objProduct->description_short[$language['id_lang']] = $serviceProduct['description'];
$objProduct->link_rewrite[$language['id_lang']] = Tools::link_rewrite($serviceProduct['name']);
}
$objProduct->id_shop_default = Context::getContext()->shop->id;
$objProduct->id_category_default = $serviceProduct['id_category_default'];
$objProduct->price = $serviceProduct['price'];
$objProduct->active = 1;
$objProduct->quantity = 999999999;
$objProduct->booking_product = 0;
$objProduct->service_product_type = Product::SERVICE_PRODUCT_WITH_ROOMTYPE;
$objProduct->auto_add_to_cart = $serviceProduct['auto_add_to_cart'];
$objProduct->show_at_front = $serviceProduct['show_at_front'];
$objProduct->available_for_order = 1;
if ($serviceProduct['auto_add_to_cart']) {
$objProduct->price_addition_type = $serviceProduct['price_addition_type'];
}
$objProduct->is_virtual = 1;
$objProduct->indexed = 1;
$objProduct->save();
$idProduct = $objProduct->id;
// add to applicable categories
$objCategory = new Category($serviceProduct['id_category_default']);
if ($categories = $objCategory->getParentsCategories()) {
$idsCategory = array();
foreach ($categories as $category) {
$idsCategory[] = $category['id_category'];
}
$objProduct->addToCategories($idsCategory);
}
Search::indexation(Tools::link_rewrite($serviceProduct['name']), $idProduct);
StockAvailable::updateQuantity($idProduct, null, 999999999);
// save service product images
$imagesBasePath = _PS_MODULE_DIR_.'hotelreservationsystem/views/img/prod_imgs/'.$idProduct.'/';
$imagesTypes = ImageType::getImagesTypes('products');
if (is_dir($imagesBasePath) && $opendir = opendir($imagesBasePath)) {
while (($image = readdir($opendir)) !== false) {
$sourceImagePath = $imagesBasePath.$image;
if (ImageManager::isRealImage($sourceImagePath)
&& ImageManager::isCorrectImageFileExt($sourceImagePath)
) {
$objImage = new Image();
$objImage->id_product = $idProduct;
$objImage->position = Image::getHighestPosition($idProduct) + 1;
$objImage->cover = 1;
$objImage->add();
$destinationPath = $objImage->getPathForCreation();
foreach ($imagesTypes as $imageType) {
ImageManager::resize(
$sourceImagePath,
$destinationPath.'-'.$imageType['name'].'.jpg',
$imageType['width'],
$imageType['height']
);
}
ImageManager::resize($sourceImagePath, $destinationPath.'.jpg');
}
}
closedir($opendir);
}
// link to all demo room types
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$objRoomTypeServiceProduct->addRoomProductLink(
$idProduct,
array(1, 2, 3, 4),
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
);
}
}
public function saveAdvancedPaymentInfo($id_product)
{
$obj_adv_pmt = new HotelAdvancedPayment();
@@ -584,6 +749,7 @@ class HotelHelper
$this->saveDummyHotelImages($htl_id);
$this->saveDummyHotelFeatures($htl_id);
$this->saveDummyProductsAndRelatedInfo($htl_id);
$this->saveDummyServiceProductsAndRelatedInfo();
return true;
}

View File

@@ -186,14 +186,6 @@ class HotelOrderRefundRules extends ObjectModel
if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100);
if ($defaultCurrency != $orderCurrency) {
$bookingCancellationDetail['cancelation_charge'] = Tools::convertPriceFull(
$bookingCancellationDetail['cancelation_charge'],
$objDefaultCurrency,
$objOrderCurrency
);
}
} else {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED;
if ($defaultCurrency != $orderCurrency) {

View File

@@ -190,7 +190,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_cart`, p.`auto_add_to_cart`, p.`allow_multiple_quantity`, cbd.`id` as `htl_cart_booking_id`,
p.`price_addition_type`, cbd.`id_product` as `room_type_id_product`, pl.`name`, cbd.`date_from`, cbd.`date_to`
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`)
INNER 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`)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')
WHERE 1';

View File

@@ -112,7 +112,8 @@ class AdminAddHotelController extends ModuleAdminController
$smartyVars['lang'] = true;
$smartyVars['iso'] = $this->context->language->iso_code;
//lang vars
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$smartyVars['languages'] = Language::getLanguages(false);
$smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId);
@@ -501,12 +502,20 @@ class AdminAddHotelController extends ModuleAdminController
if ($catState) {
if ($catCity = $objHotelBranch->addCategory($city, $catState, $groupIds)) {
$hotelCatName = $objHotelBranch->hotel_name;
if ($catHotel = $objHotelBranch->addCategory(
$hotelCatName, $catCity, $groupIds, 1, $newIdHotel
)) {
$objHotelBranch = new HotelBranchInformation($newIdHotel);
$objHotelBranch->id_category = $catHotel;
$objHotelBranch->save();
// add/update hotel category
if ($objHotelBranch->id_category) {
$objCategory = new Category($objHotelBranch->id_category);
$objCategory->name = $objHotelBranch->hotel_name;
$objCategory->save();
} else {
if ($catHotel = $objHotelBranch->addCategory(
$hotelCatName, $catCity, $groupIds, 1, $newIdHotel
)) {
$objHotelBranch = new HotelBranchInformation($newIdHotel);
$objHotelBranch->id_category = $catHotel;
$objHotelBranch->save();
}
}
}
}

View File

@@ -197,7 +197,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
$currencySign = $objCurrency->sign;
$dateFrom = date('d-m-Y');
$dateTo = date('d-m-Y', strtotime($dateFrom) + 86400);
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$smartyVars['languages'] = Language::getLanguages(false);
$smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId);

View File

@@ -44,8 +44,11 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$this->context->cookie->id_cart = (int) $objCart->id;
} else {
// use previous cart
if (!validate::isLoadedObject($objCart = new Cart($this->context->cookie->id_cart))) {
$objCart = new Cart($this->context->cookie->id_cart);
$isCartValid = Validate::isLoadedObject($objCart);
if (!$isCartValid || ($isCartValid && $objCart->orderExists())) {
$objCart = $this->createNewCart();
$this->context->cookie->id_cart = (int) $objCart->id;
}
}
$this->context->cart = $objCart;
@@ -418,7 +421,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$bookingParams['date_from'] = $searchDateFrom;
$bookingParams['date_to'] = $searchDateTo;
$bookingParams['hotel_id'] = $searchIdHotel;
$bookingParams['room_type'] = $searchIdRoomType;
$bookingParams['id_room_type'] = $searchIdRoomType;
$bookingParams['adults'] = $adults;
$bookingParams['children'] = $children;
$bookingParams['num_rooms'] = $num_rooms;

View File

@@ -61,7 +61,7 @@ class AdminHotelFeaturesController extends ModuleAdminController
$smartyVars = array();
//lang vars
$languages = Language::getLanguages(false);
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$currentLang = Language::getLanguage((int) $currentLangId);
$smartyVars['languages'] = $languages;
$smartyVars['currentLang'] = $currentLang;

View File

@@ -152,7 +152,7 @@ class AdminOrderRefundRulesController extends ModuleAdminController
}
//lang vars
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$smartyVars['languages'] = Language::getLanguages(false);
$smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId);
@@ -244,14 +244,6 @@ class AdminOrderRefundRulesController extends ModuleAdminController
$this->errors[] = $this->l('Enter number of days before check-in date for this rule to be applicable.');
} else if (!Validate::isUnsignedInt($cancelationDays)) {
$this->errors[] = $this->l('Enter valid number of days.');
} else if ($objRefundRule->checkIfRuleExistsByCancelationdays($cancelationDays)) {
if ($idRefundRule) {
if ($objRefundRule->days != $cancelationDays) {
$this->errors[] = $this->l('Refund rule for ').$cancelationDays.$this->l(' days already exists.');
}
} else {
$this->errors[] = $this->l('Refund rule for ').$cancelationDays.$this->l(' days already exists.');
}
}
if (!count($this->errors)) {

View File

@@ -151,7 +151,7 @@ class AdminRoomTypeGlobalDemandController extends ModuleAdminController
$smartyVars = array();
$objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$smartyVars['defaultcurrencySign'] = $objCurrency->sign;
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$languages = Language::getLanguages(false);
$smartyVars['languages'] = $languages;
$currentLang = Language::getLanguage((int) $currentLangId);

View File

@@ -472,6 +472,22 @@ p.room_cat_data
border-color: #4d90fe;
}
.gm-style-iw-d h6 {
font-family: unset;
font-size: 14px;
color: #333;
font-weight: 500;
margin: 0;
}
.gm-style-iw-d p {
font-family: unset;
font-size: 13px;
color: #333;
font-weight: 400;
margin: 0;
}
/* ==== AdminHotelFeaturePricesSettingsController ==== */
.week_days {
display: none;

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 KiB

View File

@@ -69,7 +69,8 @@ var GoogleMapsManager = {
var that = this;
that.setDefaultLatLng(function() {
that.map = new google.maps.Map($(that.mapDiv).get(0), {
zoom: that.defaultZoom
zoom: that.defaultZoom,
clickableIcons: true,
});
that.map.setCenter(that.defaultLatLng);
if (that.defaultLatLng && that.formattedAddress) {
@@ -80,11 +81,78 @@ var GoogleMapsManager = {
// register marker events
that.map.addListener('click', function (e) {
var latLng = e.latLng;
that.geocoder.geocode({ location: latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results[0]) {
that.addMarker(latLng, results[0]);
}
});
var isInfoWindowNeeded = true;
// if it is a Place Of Interest (POI), event contains the property 'placeId'
if (Object.hasOwn(e, 'placeId')) {
isInfoWindowNeeded = false;
that.geocoder.geocode({ location: latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results[0]) {
var request = {
placeId: e.placeId,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
var content = '<div><h6>' + place.name + '</h6><p>' +
results[0].formatted_address + '</p></div>';
var callback = function (latLng) {
that.setFormVars({
lat: latLng.lat(),
lng: latLng.lng(),
formattedAddress: content,
inputText: $('#pac-input').val(),
});
}
that.addMarker(
latLng,
results[0],
null,
isInfoWindowNeeded,
callback(latLng)
);
}
});
}
});
} else {
that.geocoder.geocode({ location: latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results[0]) {
var request = {
placeId: results[0].place_id,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
var content = '<div><h6>' + place.name + '</h6><p>' +
results[0].formatted_address + '</p></div>';
var callback = function (latLng) {
that.setFormVars({
lat: latLng.lat(),
lng: latLng.lng(),
formattedAddress: content,
inputText: $('#pac-input').val(),
});
}
that.addMarker(
latLng,
results[0],
null,
isInfoWindowNeeded,
callback(latLng)
);
}
});
}
});
}
});
if(cb && typeof cb === 'function') {
cb();
@@ -122,7 +190,7 @@ var GoogleMapsManager = {
};
that.addMarker(latLng, place);
var content = '<div><strong>' + place.name + '</strong><br>' + place.formatted_address;
var content = '<div><h6>' + place.name + '</h6><p>' + place.formatted_address + '</p></div>';
that.setFormVars({
lat: latLng.lat,
lng: latLng.lng,
@@ -142,7 +210,7 @@ var GoogleMapsManager = {
}
});
},
addMarker: function(latLng, address = null, fa = null, cb = null) {
addMarker: function(latLng, address = null, fa = null, addInfoWindow = true, cb = null) {
var that = this;
that.clearAllMarkers();
var marker = new google.maps.Marker({
@@ -163,23 +231,36 @@ var GoogleMapsManager = {
});
});
if (address === null && fa) {
// open info window
that.addInfoWindow(marker, fa);
if (addInfoWindow) {
if (address === null && fa) {
// open info window
that.addInfoWindow(marker, fa);
} else {
var request = {
placeId: address.place_id,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
// open info window
var content = '<div><h6>' + place.name + '</h6><p>' + address.formatted_address + '</p></div>';
that.addInfoWindow(marker, content);
if(cb && typeof cb === 'function') {
cb();
}
}
});
}
} else {
var request = {
placeId: address.place_id,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
// open info window
var content = '<div><strong>' + place.name + '</strong><br>' +
address.formatted_address + '</div>';
that.addInfoWindow(marker, content);
}
});
if(cb && typeof cb === 'function') {
cb();
}
return marker;
}
},
clearAllMarkers: function() {
for (var i = 0; i < this.markers.length; i++) {
@@ -190,13 +271,21 @@ var GoogleMapsManager = {
addInfoWindow: function(marker, content) {
if (typeof google === 'object') {
var that = this;
var infoWindow = new google.maps.InfoWindow({
content: content,
maxWidth: 200,
});
infoWindow.open({
anchor: marker,
map: that.map
});
google.maps.event.addListener(infoWindow, 'closeclick', function () {
that.clearAllMarkers();
});
var latLng = marker.getPosition();
that.setFormVars({
lat: latLng.lat(),
@@ -214,6 +303,10 @@ var GoogleMapsManager = {
},
}
$(document).on('click', 'button.gm-ui-hover-effect', function () {
GoogleMapsManager.clearAllMarkers();
});
function initGoogleMaps() {
if (typeof enabledDisplayMap != 'undefined'
&& typeof google === 'object'
@@ -767,6 +860,13 @@ function showLangField(select_lang_name, id_lang)
$('.all_lang_icon').attr('src', img_dir_l+id_lang+'.jpg');
$('#choosedLangId').val(id_lang);
var id_old_language = id_language;
id_language = id_lang;
if (id_old_language != id_lang) {
changeEmployeeLanguage();
}
}
/* ---- HotelConfigurationSettingController Admin ---- */

View File

@@ -28,6 +28,8 @@ $(document).ready(function() {
url: rooms_booking_url,
method: 'POST',
extraParams: function() {
removeInitializedTooltips();
return $.extend(
{
ajax: true,
@@ -183,6 +185,14 @@ $(document).ready(function() {
calendar.render();
}
function removeInitializedTooltips() {
$('#fullcalendar a.day-info, #fullcalendar .fc-daygrid-event').each(function () {
if ($(this).data('ui-tooltip')) {
$(this).tooltip('destroy');
}
});
}
function getSearchData()
{
return {
@@ -869,6 +879,12 @@ $(document).ready(function() {
$("#cartModal").html(result.cart_content);
}
$("#cart_record").html(result.total_products_in_cart);
if (parseInt(result.total_products_in_cart) > 0) {
$('#cart_record').closest('button').removeClass('disabled');
} else {
$('#cart_record').closest('button').addClass('disabled');
}
}
}
});

View File

@@ -292,7 +292,7 @@
{l s='Upload images' mod='hotelreservationsystem'}&nbsp;:&nbsp;&nbsp;
</label>
<div class="col-sm-5">
<input class="form-control-static" type="file" id="hotel_images" name="hotel_images[]" multiple>
<input class="form-control-static" type="file" accept="image/gif, image/jpg, image/jpeg, image/png" id="hotel_images" name="hotel_images[]" multiple>
</div>
</div>
<hr>
@@ -483,6 +483,9 @@
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
// for tiny mce setup
var iso = "{$iso|escape:'htmlall':'UTF-8'}";
var pathCSS = "{$smarty.const._THEME_CSS_DIR_|escape:'htmlall':'UTF-8'}";
@@ -497,4 +500,4 @@
});
</script>
{/block}
{/block}

View File

@@ -323,4 +323,11 @@
{addJsDef autocomplete_room_search_url = $link->getAdminLink('AdminHotelFeaturePricesSettings')}
{addJsDef defaultcurrency_sign = $defaultcurrency_sign mod='hotelreservationsystem'}
{addJsDef booking_date_from = $date_from mod='hotelreservationsystem'}
{/strip}
{/strip}
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -133,3 +133,10 @@
{addJsDefL name=chld_ftr_text_err}{l s='Enter child feature name.' js=1 mod='hotelreservationsystem'}{/addJsDefL}
{addJsDefL name=pos_numeric_err}{l s='Position should be numeric.' js=1 mod='hotelreservationsystem'}{/addJsDefL}
{/strip}
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -188,7 +188,7 @@
<div class="panel">
<div class="panel-heading">
<i class="icon-info"></i> {if !isset($booking_product) || (isset($booking_product) && $booking_product == 1)}{l s='Booking Calender' mod='hotelreservationsystem'}{else}{l s='Service Products' mod='hotelreservationsystem'}{/if }
<button type="button" class="btn btn-primary" id="cart_btn" data-toggle="modal" data-target="#cartModal"><i class="icon-shopping-cart"></i> {l s='Cart' mod='hotelreservationsystem'} <span class="badge" id="cart_record">{$total_products_in_cart}</span></button>
<button type="button" class="btn btn-primary {if $total_products_in_cart|intval == 0}disabled{/if}" id="cart_btn" data-toggle="modal" data-target="#cartModal"><i class="icon-shopping-cart"></i> {l s='Cart' mod='hotelreservationsystem'} <span class="badge" id="cart_record">{$total_products_in_cart}</span></button>
</div>
{if !isset($booking_product) || (isset($booking_product) && $booking_product == 1)}
<div id='fullcalendar'></div>

View File

@@ -133,3 +133,10 @@
</div>
</form>
</div>
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -274,4 +274,11 @@
</button>
</div>
</form>
</div>
</div>
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -130,10 +130,6 @@ class StatsBestCategories extends ModuleGrid
<div class="panel-heading">
<i class="icon-sitemap"></i> '.$this->displayName.'
</div>';
if (!(Module::isEnabled('statsdata') && Configuration::get('PS_STATSDATA_PAGESVIEWS'))) {
$link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata';
$this->html .= '<div class="alert alert-info">'.$this->l('You must enable the "Save global page views" option from ').'<u><a href="'.$link.'" target="_blank">Data mining for statistics</a></u>'.$this->l(' module in order to display the most viewed hotels, or use the QloApps Google Analytics module.').'</div>';
}
$this->html .= $this->engine($engine_params).'
<div class="row form-horizontal">

View File

@@ -136,10 +136,7 @@ class StatsBestProducts extends ModuleGrid
}
$html = '<div class="panel-heading">'.$this->displayName.'</div>';
if (!(Module::isEnabled('statsdata') && Configuration::get('PS_STATSDATA_PAGESVIEWS'))) {
$link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata';
$html .= '<div class="alert alert-info">'.$this->l('You must enable the "Save global page views" option from ').'<u><a href="'.$link.'" target="_blank">Data mining for statistics</a></u>'.$this->l(' module in order to display the most viewed room types, or use the QloApps Google Analytics module.').'</div>';
}
$html .= $this->engine($engine_params).'
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI'].'&export=1').'">
<i class="icon-cloud-download"></i> '.$this->l('CSV Export').'

View File

@@ -26,7 +26,8 @@
min-width: 150px;
margin-bottom: 25px;
padding: 10px 15px;
border: 1.5px solid #555;
border: 1.5px solid transparent;
border-radius: 2px;
background-color: #CFE2F3;
color: #111;
}
@@ -37,7 +38,7 @@
}
connection {
border: 1px solid #000;
border: 1px solid #777;
}
connection span {

View File

@@ -129,6 +129,7 @@ class StatsNewsletter extends ModuleGraph
$this->_titles['main'][1] = $this->l('Visitors');
$this->_titles['main'][2] = $this->l('Newsletter statistics');
$this->_titles['main'][3] = $this->l('Both');
$this->_formats['y'] = 'd';
$this->_query = 'SELECT newsletter_date_add
FROM `'._DB_PREFIX_.'customer`

View File

@@ -314,7 +314,7 @@ class StatsPersonalInfos extends ModuleGraph
FROM `'._DB_PREFIX_.'customer`
WHERE (YEAR(CURDATE()) - YEAR(`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(`birthday`, 5)) >= 60
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
AND `birthday` IS NOT NULL';
AND `birthday` IS NOT NULL AND `birthday` != "0000-00-00"';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
if (isset($result['total']) && $result['total']) {
$this->_values[] = $result['total'];

View File

@@ -343,6 +343,7 @@ class StatsProduct extends ModuleGraph
$this->_titles['main'][1] = $this->l('Views (x100)');
$this->_titles['x'] = $this->l('Date');
$this->_titles['y'] = $this->l('Room nights, Views (x100)');
$this->_formats['y'] = 'd';
$this->query[0] = 'SELECT o.`date_add`, SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS total
FROM `'._DB_PREFIX_.'order_detail` od

View File

@@ -171,6 +171,7 @@ class StatsRegistrations extends ModuleGraph
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
AND `date_add` BETWEEN';
$this->_titles['main'] = $this->l('Number of customer registrations');
$this->_formats['y'] = 'd';
$this->setDateGraph($layers, true);
}

View File

@@ -234,6 +234,10 @@ class StatsSales extends ModuleGraph
return $this->getOrderStatusesData();
}
if ($this->option == 1) {
$this->_formats['y'] = 'd';
}
$this->query = 'SELECT o.`invoice_date`, ROUND(o.`total_paid_real` / o.`conversion_rate`, 2) as total_paid_real,
(
SELECT hbd.`id_hotel`

View File

@@ -157,6 +157,7 @@ class StatsVisits extends ModuleGraph
protected function getData($layers)
{
$this->setDateGraph($layers, true);
$this->_formats['y'] = 'd';
}
protected function setAllTimeValues($layers)

View File

@@ -19,7 +19,7 @@
<div id="filter_results" class="row block">
<div class="col-sm-12">
{if isset($config) && $config['SHOW_AMENITIES_FILTER']}
{if isset($config) && $config['SHOW_AMENITIES_FILTER'] && $all_feat}
<div class="row margin-lr-0 layered_filter_cont">
<div class="col-sm-12 layered_filter_heading">
<div class="row margin-lr-0">

View File

@@ -64,7 +64,9 @@ class wkhotelfilterblock extends Module
if ($this->context->controller->php_self == 'category') {
$htl_id_category = Tools::getValue('id_category');
if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) {
if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))
&& ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category))
) {
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true)));
@@ -73,8 +75,6 @@ class wkhotelfilterblock extends Module
$id_lang = $this->context->language->id;
$all_feat = FeatureCore::getFeatures($id_lang);
$id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category);
$max_adult = HotelRoomType::getMaxAdults($id_hotel);
$max_child = HotelRoomType::getMaxChild($id_hotel);

View File

@@ -152,7 +152,7 @@ class WkHotelRoomDisplay extends ObjectModel
// update global configuration values in multilang
Configuration::updateValue('HOTEL_ROOM_DISPLAY_HEADING', $HOTEL_ROOM_DISPLAY_HEADING);
Configuration::updateValue('HOTEL_ROOM_DISPLAY_DESCRIPTION', $HOTEL_ROOM_DISPLAY_DESCRIPTION);
if ($roomTypes = HotelHelper::getPsProducts(Configuration::get('PS_LANG_DEFAULT'), 0, 5)) {
if ($roomTypes = HotelHelper::getPsProducts(Configuration::get('PS_LANG_DEFAULT'), 0, 5, 1)) {
foreach ($roomTypes as $product) {
if (Validate::isLoadedObject($objProduct = new Product($product['id_product']))) {
$objRoomBlock = new WkHotelRoomDisplay();

View File

@@ -38,6 +38,7 @@ $(document).ready(function() {
data: {
q: word,
_: n,
booking_product: '1',
},
success: function(result) {
if (result) {

View File

@@ -124,7 +124,9 @@ class WkRoomSearchBlock extends Module
{
if ('category' == Tools::getValue('controller')) {
$idCategory = Tools::getValue('id_category');
if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory))) {
if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory))
&& HotelBranchInformation::getHotelIdByIdCategory($idCategory)
) {
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
$objSearchHelper = new WkRoomSearchHelper();
$objSearchHelper->assignSearchPanelVariables();