Merge branch 'develop' into gli-1991

This commit is contained in:
vishalsingh.qlo325
2024-08-27 16:49:30 +05:30
59 changed files with 2097 additions and 674 deletions

View File

@@ -1,39 +0,0 @@
{*
* Since 2010 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* 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 https://store.webkul.com/customisation-guidelines/ for more information.
*
* @author Webkul IN <support@webkul.com>
* @copyright Since 2010 Webkul IN
* @license https://store.webkul.com/license.html
*}
{extends file="helpers/tree/tree.tpl"}
<script>
{block name="script" append}
$(document).ready(function () {
$('#{$id|escape:'html':'UTF-8'}').find('[name="hotel_box[]"]').on('click', function(){
if ($(this).is(":checked")) {
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
$(this).prop('checked', true);
$(this).parent().addClass('tree-selected');
});
} else {
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
$(this).prop('checked', false);
$(this).parent().removeClass('tree-selected');
});
}
});
});
{/block}
</script>

View File

@@ -84,6 +84,22 @@
});
{/if}
{if isset($auto_select_children) && $auto_select_children == true}
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=checkbox]').on('click', function(){
if ($(this).is(":checked")) {
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
$(this).prop('checked', true);
$(this).parent().addClass('tree-selected');
});
} else {
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
$(this).prop('checked', false);
$(this).parent().removeClass('tree-selected');
});
}
});
{/if}
$(document).ready(function () {
var tree = $("#{$id|escape:'html':'UTF-8'}").tree('collapseAll');

View File

@@ -149,13 +149,16 @@ class AddressCore extends ObjectModel
protected $webserviceParameters = array(
'objectsNodeName' => 'addresses',
'fields' => array(
'id_customer' => array('xlink_resource'=> 'customers'),
'id_customer' => array('xlink_resource'=> 'customers', 'required' => true),
'id_manufacturer' => array('xlink_resource'=> 'manufacturers'),
'id_supplier' => array('xlink_resource'=> 'suppliers'),
'id_warehouse' => array('xlink_resource'=> 'warehouse'),
'id_country' => array('xlink_resource'=> 'countries'),
'id_state' => array('xlink_resource'=> 'states'),
),
'hidden_fields' => array(
'id_hotel'
),
);
/**
@@ -551,4 +554,37 @@ class AddressCore extends ObjectModel
)
');
}
public function validateFields($die = true, $error_return = false)
{
if (isset($this->webservice_validation) && $this->webservice_validation) {
if (!$this->id_customer || !Validate::isLoadedObject(new Customer((int) $this->id_customer))) {
$message = Tools::displayError('Invalid Id customer.');
} elseif (Customer::getCustomerIdAddress($this->id_customer, false) && !$this->id) {
$message = Tools::displayError('A single customer cannot have multiple addresses.');
} elseif (!$this->id_country || !Validate::isLoadedObject($objCountry = new Country($this->id_country))) {
$message = Tools::displayError('Invalid Id country');
} elseif ($objCountry->contains_states
&& (!$this->id_state || !Validate::isLoadedObject($objState = new State((int) $this->id_state)))
) {
$message = Tools::displayError('Invalid Id state');
} elseif (isset($objState) && ($objCountry->id != $objState->id_country)) {
$message = Tools::displayError('The given provided Id state does not belongs to the provided Id country');
} elseif ($objCountry->zip_code_format && !$objCountry->checkZipCode($this->postcode)) {
$message = Tools::displayError('Your Zip/postal code is incorrect');
} elseif (empty($this->postcode) && $objCountry->need_zip_code) {
$message = Tools::displayError('A Zip/postal code is required.');
} elseif ($this->postcode && !Validate::isPostCode($this->postcode)) {
$message = Tools::displayError('The Zip/postal code is invalid.');
}
if (isset($message)) {
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
return parent::validateFields($die, $error_return);
}
}

View File

@@ -4698,7 +4698,7 @@ class CartCore extends ObjectModel
public function getWsCartBookings()
{
return Db::getInstance()->executeS('
SELECT `id`
SELECT `id`, `date_from`, `date_to`, `id_hotel`, `id_product`
FROM `'._DB_PREFIX_.'htl_cart_booking_data`
WHERE id_cart = '.(int)$this->id.' ORDER BY `id` ASC'
);

View File

@@ -141,4 +141,12 @@ class CustomerMessageCore extends ObjectModel
');
}
public function validateFields($die = true, $error_return = false)
{
if (isset($this->webservice_validation) && $this->webservice_validation) {
$this->message = trim($this->message);
}
return parent::validateFields($die, $error_return);
}
}

View File

@@ -173,9 +173,18 @@ class GuestCore extends ObjectModel
public function mergeWithCustomer($idGuest, $idCustomer)
{
// Since the guests are merged, the guest id in the connections table must be changed too
Db::getInstance()->update('connections', [
'id_guest' => (int) $idGuest,
], 'id_guest = ' . (int) $this->id);
// If guest entry is already there in the connection within 30 mins then delete the visitor entry else update it with guest id of the customer
$sql = 'SELECT SQL_NO_CACHE `id_guest` FROM `'._DB_PREFIX_.'connections`
WHERE `id_guest` = '.(int)$idGuest.' AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\''.
Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `date_add` DESC';
if (Db::getInstance()->getRow($sql, false)) {
Db::getInstance()->delete('connections', 'id_guest = ' . (int) $this->id);
} else {
Db::getInstance()->update('connections', [
'id_guest' => (int) $idGuest,
], 'id_guest = ' . (int) $this->id);
}
// Since the guests are merged, the guest id in the cart table must be changed too
Db::getInstance()->update('cart', [
@@ -198,4 +207,21 @@ class GuestCore extends ObjectModel
$guest->save();
$cookie->id_guest = (int)($guest->id);
}
public function validateFields($die = true, $error_return = false)
{
if (isset($this->webservice_validation) && $this->webservice_validation) {
if ((int) $this->id_customer && !Validate::isLoadedObject(new Customer((int) $this->id_customer))) {
$message = Tools::displayError('Invalid Id customer.');
}
if (isset($message)) {
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
return parent::validateFields($die, $error_return);
}
}

View File

@@ -373,36 +373,22 @@ class ProductCore extends ObjectModel
protected $webserviceParameters = array(
'objectMethods' => array(
'add' => 'addWs',
'update' => 'updateWs',
'add' => 'addWsRoomType',
'update' => 'updateWsRoomType',
'delete' => 'deleteWs'
),
'objectsNodeName' => 'room_types',
'objectNodeName' => 'room_type',
'retrieveData' => array(
'retrieveMethod' => 'getRoomTypesObjectList'
),
'fields' => array(
'id_hotel' => array(
'getter' => 'getWsHotel',
'setter' => 'setWsHotel',
'xlink_resource' => 'hotels'
),
'adults' => array(
'getter' => 'getWsAdults',
'setter' => 'setWsAdults',
),
'children' => array(
'getter' => 'getWsChildren',
'setter' => 'setWsChildren',
),
'id_manufacturer' => array(
'xlink_resource' => 'manufacturers'
),
'id_supplier' => array(
'xlink_resource' => 'suppliers'
),
'id_category_default' => array(
'xlink_resource' => 'categories'
),
'id_hotel' => array('getter' => 'getWsHotel','setter' => 'setWsHotel', 'xlink_resource' => 'hotels'),
'adults' => array('getter' => 'getWsAdults','setter' => 'setWsAdults'),
'children' => array('getter' => 'getWsChildren','setter' => 'setWsChildren'),
'id_manufacturer' => array('xlink_resource' => 'manufacturers'),
'id_supplier' => array('xlink_resource' => 'suppliers'),
'id_category_default' => array('xlink_resource' => 'categories'),
'new' => array(),
'cache_default_attribute' => array(),
'id_default_image' => array(
@@ -420,36 +406,28 @@ class ProductCore extends ObjectModel
// 'resourceName' => 'combinations'
// )
// ),
'id_tax_rules_group' => array(
'xlink_resource' => array(
'resourceName' => 'tax_rule_groups'
)
),
'position_in_category' => array(
'getter' => 'getWsPositionInCategory',
'setter' => 'setWsPositionInCategory'
),
'id_tax_rules_group' => array('xlink_resource' => array('resourceName' => 'tax_rule_groups')),
'position_in_category' => array('getter' => 'getWsPositionInCategory', 'setter' => 'setWsPositionInCategory'),
// 'manufacturer_name' => array(
// 'getter' => 'getWsManufacturerName',
// 'setter' => false
// ),
'quantity' => array(
'getter' => false,
'setter' => false
),
'type' => array(
'getter' => 'getWsType',
'setter' => 'setWsType',
),
'id_advance_paypent' => array(
'xlink_resource' => array(
'resourceName' => 'advance_payments'
),
'getter' => 'getWsRoomTypeAdvancePayment',
'setter' => false
),
'type' => array('getter' => 'getWsType', 'setter' => 'setWsType'),
),
'associations' => array(
'advance_payments' => array(
'resource' => 'advance_payment',
'getter' => 'getWsAdvancePayments',
'setter' => 'setWsAdvancePayments',
'fields' => array(
'id' => array(),
'payment_type' => array(),
'tax_include' => array(),
'value' => array(),
'active' => array(),
'calculate_from' => array(),
),
),
'categories' => array(
'resource' => 'category',
'fields' => array(
@@ -466,7 +444,8 @@ class ProductCore extends ObjectModel
'id' => array('required' => true),
)
),
'tags' => array('resource' => 'tag',
'tags' => array(
'resource' => 'tag',
'fields' => array(
'id' => array('required' => true),
)
@@ -484,13 +463,78 @@ class ProductCore extends ObjectModel
)
),
'extra_demands' => array(
'setter' => false,
'resource' => 'extra_demand',
'fields' => array(
'id' => array('required' => true),
'id_option' => array(),
'price' => array(),
)
),
'services' => array(
'resource' => 'service',
'fields' => array(
'id' => array('validate' => 'isUnsignedId', 'required' => true),
'price' => array('validate' => 'isPrice', 'required' => true),
'id_tax_rules_group' => array('validate' => 'isUnsignedId')
)
),
),
'hidden_fields' => array(
'booking_product',
'service_product_type'
),
);
protected $webserviceServicesParameters = array(
'objectMethods' => array(
'add' => 'addWsServices',
'update' => 'updateWsServices',
'delete' => 'deleteWs'
),
'objectsNodeName' => 'services',
'objectNodeName' => 'service',
'retrieveData' => array(
'retrieveMethod' => 'getServicesObjectList'
),
'fields' => array(
'id_manufacturer' => array('xlink_resource' => 'manufacturers'),
'id_supplier' => array('xlink_resource' => 'suppliers'),
'id_category_default' => array('xlink_resource' => 'categories'),
'new' => array(),
'cache_default_attribute' => array(),
'id_default_image' => array(
'getter' => 'getCoverWs',
'setter' => 'setCoverWs',
'xlink_resource' => array(
'resourceName' => 'images',
'subResourceName' => 'room_types'
)
),
'id_tax_rules_group' => array('xlink_resource' => array('resourceName' => 'tax_rule_groups')),
'position_in_category' => array('getter' => 'getWsPositionInCategory', 'setter' => 'setWsPositionInCategory'),
// 'manufacturer_name' => array(
// 'getter' => 'getWsManufacturerName',
// 'setter' => false
// ),
'quantity' => array('getter' => false, 'setter' => false),
'type' => array('getter' => 'getWsType', 'setter' => 'setWsType'),
),
'associations' => array(
'categories' => array(
'resource' => 'category',
'fields' => array('id' => array('required' => true))
),
'images' => array('resource' => 'image', 'fields' => array('id' => array())),
'feature_prices' => array(
'setter' => false, 'resource' => 'feature_price',
'fields' => array(
'id' => array('required' => true),
)
),
),
'hidden_fields' => array(
'booking_product',
),
);
const CUSTOMIZE_FILE = 0;
@@ -5695,8 +5739,11 @@ class ProductCore extends ObjectModel
*/
public function getCoverWs()
{
$result = $this->getCover($this->id);
return $result['id_image'];
if ($result = $this->getCover($this->id)) {
return $result['id_image'];
}
return false;
}
/**
@@ -5985,8 +6032,9 @@ class ProductCore extends ObjectModel
return true;
}
public function addWs($autodate = true, $null_values = false)
public function addWsRoomType($autodate = true, $null_values = false)
{
$this->booking_product = 1;
if ($success = $this->add($autodate, $null_values)) {
if (Configuration::get('PS_SEARCH_INDEXATION')) {
Search::indexation(false, $this->id);
@@ -5998,19 +6046,56 @@ class ProductCore extends ObjectModel
return $success;
}
public function updateWs($null_values = false)
public function updateWsRoomType($null_values = false)
{
$success = parent::update($null_values);
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
Search::indexation(false, $this->id);
if (self::isBookingProduct($this->id)) {
$this->booking_product = 1; // Since there is nothing set from the API, it might get set as false
$success = parent::update($null_values);
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
Search::indexation(false, $this->id);
}
$this->setWsRoomTypeInfo();
Hook::exec('updateProduct', array('id_product' => (int)$this->id));
return $success;
}
$this->setWsRoomTypeInfo();
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Room type not found.'), 134);
return false;
}
public function addWsServices()
{
$this->booking_product = 0;
if ($success = $this->add()) {
if (Configuration::get('PS_SEARCH_INDEXATION')) {
Search::indexation(false, $this->id);
}
}
Hook::exec('updateProduct', array('id_product' => (int)$this->id));
return $success;
}
public function updateWsServices($null_values = false)
{
if (!self::isBookingProduct($this->id)) {
$this->booking_product = 0; // Since there is nothing set from the API.
$success = parent::update($null_values);
if ($success && Configuration::get('PS_SEARCH_INDEXATION')) {
Search::indexation(false, $this->id);
}
Hook::exec('updateProduct', array('id_product' => (int)$this->id));
return $success;
}
WebserviceRequest::getInstance()->setError(500, Tools::displayError('Service not found.'), 134);
return false;
}
/**
* For a given product, returns its real quantity
*
@@ -6370,6 +6455,20 @@ class ProductCore extends ObjectModel
return $cache_id;
}
public function getRoomTypesObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
{
$sql_filter .= ' AND main.`booking_product` = 1';
return parent::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit);
}
public function getServicesObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
{
$sql_filter .= ' AND main.`booking_product` = 0';
return parent::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit);
}
public static function setPackStockType($id_product, $pack_stock_type)
{
return Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'product p
@@ -6394,10 +6493,55 @@ class ProductCore extends ObjectModel
public function getWsAdvancePayments()
{
return Db::getInstance()->executeS(
'SELECT `id` FROM `'._DB_PREFIX_.'htl_advance_payment` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
'SELECT * FROM `'._DB_PREFIX_.'htl_advance_payment` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
);
}
public function setWsAdvancePayments($adv_payment)
{
$obj_adv_pmt = new HotelAdvancedPayment();
if (!$adv_payment) {
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($this->id)) {
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
}
$obj_adv_pmt->payment_type = '';
$obj_adv_pmt->id_product = $this->id;
$obj_adv_pmt->value = '';
$obj_adv_pmt->id_currency = '';
$obj_adv_pmt->tax_include = '';
$obj_adv_pmt->calculate_from = 0;
$obj_adv_pmt->active = 0;
return $obj_adv_pmt->save();
} else if (is_array($adv_payment) && count($adv_payment) == 1) {
$fields = array_shift($adv_payment);
if (!Validate::isLoadedObject($obj_adv_pmt = new HotelAdvancedPayment($fields['id']))) {
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($this->id)) {
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
}
}
$obj_adv_pmt->id_product = $this->id;
$obj_adv_pmt->active = 1;
$obj_adv_pmt->payment_type = $fields['payment_type'];
$obj_adv_pmt->value = $fields['value'];
if ($fields['payment_type'] == 2) {
$obj_adv_pmt->id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
} else {
$obj_adv_pmt->id_currency = '';
}
$obj_adv_pmt->tax_include = $fields['tax_include'];
$obj_adv_pmt->calculate_from = $fields['calculate_from'];
return $obj_adv_pmt->save();
}
return false;
}
public function getWsHotel()
{
return Db::getInstance()->getValue(
@@ -6421,8 +6565,41 @@ class ProductCore extends ObjectModel
public function getWsExtraDemands()
{
return Db::getInstance()->getValue(
'SELECT `id_global_demand` as `id` FROM `'._DB_PREFIX_.'htl_room_type_demand` WHERE `id_product` = '.(int)$this->id
$objHotelRoomTypeDemand = new HotelRoomTypeDemand();
$selectedDemands = Db::getInstance()->executeS(
'SELECT `id_global_demand` as `id` FROM `'._DB_PREFIX_.'htl_room_type_demand`
WHERE `id_product` = '.(int)$this->id
);
$res = array();
$demands = $objHotelRoomTypeDemand->getRoomTypeDemands($this->id);
if ($selectedDemands) {
foreach ($selectedDemands as $id_demand => $demand) {
$option['id'] = $demand['id'];
if (isset($demands[$demand['id']]['adv_option']) && count($demands[$demand['id']]['adv_option'])) {
foreach ($demands[$demand['id']]['adv_option'] as $id_option => $adv_option) {
$option['id_option'] = $id_option;
$option['price'] = $adv_option['price_tax_excl'];
$res[] = $option;
}
} else {
$option['id_option'] = false;
$option['price'] = $demand['price_tax_excl'];
$res[] = $option;
}
}
}
return $res;
}
public function getWsServices()
{
return Db::getInstance()->executeS(
'SELECT spp.`price`, spp.`id_tax_rules_group`, sp.`id_product` AS id
FROM `'._DB_PREFIX_.'htl_room_type_service_product` sp
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_price` spp
ON (spp.`id_product` = sp.`id_product` AND spp.`id_element` = sp.`id_element` AND spp.`element_type` = sp.`element_type`)
WHERE sp.`id_element` = '.(int)$this->id
);
}
@@ -6476,4 +6653,106 @@ class ProductCore extends ObjectModel
{
return $this->delete();
}
public function setWsExtraDemands($demands)
{
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'htl_room_type_demand`
WHERE `id_product` = '.(int)$this->id
);
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'htl_room_type_demand_price`
WHERE `id_product` = '.(int)$this->id
);
$objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption();
$savedDemands = array();
foreach ($demands as $globalDemand) {
if (Validate::isLoadedObject($objGlobalDemand = new HotelRoomTypeGlobalDemand($globalDemand['id']))) {
if (!isset($savedDemands[$globalDemand['id']])) {
$objRoomTypeDemand = new HotelRoomTypeDemand();
$objRoomTypeDemand->id_product = $this->id;
$objRoomTypeDemand->id_global_demand = $objGlobalDemand->id;
$objRoomTypeDemand->save();
$savedDemands[$globalDemand['id']] = $objRoomTypeDemand->id;
}
if (isset($globalDemand['price'])) {
if ($objAdvOption->getGlobalDemandAdvanceOptions($objGlobalDemand->id)
&& isset($globalDemand['id_option'])
&& Validate::isLoadedObject($objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption($globalDemand['id_option']))
) {
if ($globalDemand['price'] != $objAdvOption->price) {
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
$objRoomTypeDemandPrice->id_product = $this->id;
$objRoomTypeDemandPrice->id_global_demand = $objGlobalDemand->id;
$objRoomTypeDemandPrice->id_option = $objAdvOption->id;
$objRoomTypeDemandPrice->price = $globalDemand['price'];
$objRoomTypeDemandPrice->save();
}
} else {
// save selected demands prices for this room type
if ($objGlobalDemand->price != $globalDemand['price']) {
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
$objRoomTypeDemandPrice->id_product = $this->id;
$objRoomTypeDemandPrice->id_global_demand = $objGlobalDemand->id;
$objRoomTypeDemandPrice->id_option = 0;
$objRoomTypeDemandPrice->price = $globalDemand['price'];
$objRoomTypeDemandPrice->save();
}
}
}
}
}
return true;
}
public function setWsServices($services)
{
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'htl_room_type_service_product`
WHERE `id_element` = '.(int)$this->id
);
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'htl_room_type_service_product_price`
WHERE `id_element` = '.(int)$this->id
);
if ($this->booking_product) {
if ($allServiceProducts = $this->getServiceProducts()) {
$formttedServiceProducts = array();
foreach ($allServiceProducts as $product) {
$formttedServiceProducts[$product['id_product']] = $product;
}
$allServiceProducts = $formttedServiceProducts;
foreach ($services as $service) {
if (isset($service['id'])
&& Validate::isLoadedObject($objServiceProduct = new Product($service['id']))
&& !$objServiceProduct->booking_product
&& isset($allServiceProducts[$objServiceProduct->id])
) {
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$objRoomTypeServiceProduct->addRoomProductLink(
$objServiceProduct->id,
$this->id,
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
);
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
$objRoomTypeServiceProductPrice->id_product = $objServiceProduct->id;
$objRoomTypeServiceProductPrice->id_element = $this->id;
$objRoomTypeServiceProductPrice->element_type = RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE;
$objRoomTypeServiceProductPrice->price = isset($service['price']) ? $service['price'] : $allServiceProducts[$objServiceProduct->id]['price'];
$objRoomTypeServiceProductPrice->id_tax_rules_group = isset($service['id_tax_rules_group']) ? $service['id_tax_rules_group'] : $allServiceProducts[$objServiceProduct->id]['id_tax_rules_group'];
$objRoomTypeServiceProductPrice->save();
}
}
}
} else {
return false;
}
return true;
}
}

View File

@@ -46,7 +46,7 @@ class TranslatedConfigurationCore extends Configuration
'id_shop' => array('type' => self::TYPE_NOTHING, 'validate' => 'isUnsignedId'),
'value' => array('type' => self::TYPE_STRING, 'lang' => true),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'lang' => true),
),
);

View File

@@ -1216,6 +1216,7 @@ class FrontControllerCore extends Controller
*/
if ($this->context->language->is_rtl) {
$this->addCSS(_THEME_CSS_DIR_.'rtl.css');
$this->addCSS(_THEME_CSS_DIR_.'rtl_grid.css');
$this->addCSS(_THEME_CSS_DIR_.$this->context->language->iso_code.'.css');
}
}

View File

@@ -29,6 +29,7 @@ class HelperTreeCore extends TreeCore
private $_use_bulk_actions;
private $_use_checkbox;
private $_show_collapse_expand_button = true;
private $_auto_select_children = false;
private $_max_height = 350;
@@ -43,6 +44,18 @@ class HelperTreeCore extends TreeCore
return (isset($this->_use_search) && $this->_use_search);
}
public function setAutoSelectChildren($value)
{
$this->_auto_select_children = (bool)$value;
return $this;
}
public function autoSelectChildren()
{
return (isset($this->_auto_select_children) && $this->_auto_select_children);
}
public function setUseBulkActions($value)
{
$this->_use_bulk_actions = (bool)$value;
@@ -119,6 +132,7 @@ class HelperTreeCore extends TreeCore
);
$this->setAttribute('use_search', $this->useSearch());
}
$this->setAttribute('auto_select_children', $this->autoSelectChildren());
if ($this->showCollapseExpandButton()) {
$collapse_all = new TreeToolbarLink(

View File

@@ -632,6 +632,7 @@ class WebserviceOutputBuilderCore
$value = $object_assoc;
}
if (empty($fields_assoc)) {
$value['id'] = isset($value['id']) ? $value['id'] : '';
$fields_assoc = array(array('id' => $value['id']));
}
$output_details .= $this->renderFlatAssociation($object, $depth, $assoc_name, $association['resource'], $fields_assoc, $value, $parent_details);
@@ -680,7 +681,7 @@ class WebserviceOutputBuilderCore
$field['sqlId'] = 'id';
$field['value'] = isset($object_assoc['id']) ? $object_assoc['id'] : null;
} elseif (!isset($field['sqlId'])) {
$field['sqlId'] = $field_name;
$field['sqlId'] = $field_name ? $field_name : 'id';
$field['value'] = isset($object_assoc[$field_name]) ? $object_assoc[$field_name] : null;
}
@@ -829,4 +830,10 @@ class WebserviceOutputBuilderCore
{
$this->fieldsToDisplay = $fields;
}
public function setWsParameters($class, $parameters)
{
WebserviceOutputBuilder::$_cache_ws_parameters[$class] = $parameters;
}
}

View File

@@ -199,7 +199,7 @@ class WebserviceOutputXMLCore implements WebserviceOutputInterface
if (array_key_exists('setter', $params['associations'][$assoc_name]) && !$params['associations'][$assoc_name]['setter']) {
$more .= ' readOnly="true"';
}
$more .= ' nodeType="'.$params['associations'][$assoc_name]['resource'].'"';
$more .= (isset($params['associations'][$assoc_name]['resource'])? ' nodeType="'.$params['associations'][$assoc_name]['resource'].'"' : ' ');
if (isset($params['associations'][$assoc_name]['virtual_entity']) && $params['associations'][$assoc_name]['virtual_entity']) {
$more .= ' virtualEntity="true"';
} else {

View File

@@ -290,6 +290,7 @@ class WebserviceRequestCore
'room_type_options' => array('description' => 'The product options','class' => 'AttributeGroup'),
'room_type_option_values' => array('description' => 'The product options value','class' => 'Attribute'),
'room_types' => array('description' => 'The room types','class' => 'Product'),
'services' => array('description' => 'Services', 'class' => 'Product', 'parameters_attribute' => 'webserviceServicesParameters'),
'states' => array('description' => 'The available states of countries','class' => 'State'),
'stores' => array('description' => 'The stores', 'class' => 'Store'),
'suppliers' => array('description' => 'The product suppliers','class' => 'Supplier'),
@@ -512,6 +513,8 @@ class WebserviceRequestCore
$object = new $url_resource['class']();
if (isset($this->resourceList[$this->urlSegment[0]]['parameters_attribute'])) {
$this->resourceConfiguration = $object->getWebserviceParameters($this->resourceList[$this->urlSegment[0]]['parameters_attribute']);
// Setting the parameters for the output builder in cache for the resources having parameters_attribute.
$this->objOutput->setWsParameters($url_resource['class'], $this->resourceConfiguration);
} else {
$this->resourceConfiguration = $object->getWebserviceParameters();
}

View File

@@ -51,6 +51,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
'room_types' => array(),
'hotels' => array(),
'categories' => array(),
'extra_service' => array(),
// 'manufacturers' => array(),
// 'suppliers' => array(),
// 'stores' => array(),
@@ -286,7 +287,9 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$this->imageType = $this->wsObject->urlSegment[1];
// if image type requested is room_types then process products images
if ($this->imageType == 'room_types') {
if ($this->imageType == 'room_types'
|| $this->imageType == 'extra_services'
) {
$this->imageType = 'products';
}

View File

@@ -295,9 +295,12 @@ class AdminDashboardControllerCore extends AdminController
public function postProcess()
{
if (Tools::isSubmit('submitDateRange')) {
if (!Validate::isDate(Tools::getValue('date_from'))
|| !Validate::isDate(Tools::getValue('date_to'))) {
if (!Validate::isDate(Tools::getValue('date_from')) && !Validate::isDate(Tools::getValue('date_to'))) {
$this->errors[] = Tools::displayError('The selected date range is not valid.');
} elseif (!Validate::isDate(Tools::getValue('date_from'))) {
$this->errors[] = Tools::displayError('Date from in not selected. Please select a date range from the calendar.');
} elseif (!Validate::isDate(Tools::getValue('date_to'))) {
$this->errors[] = Tools::displayError('Date to in not selected. Please select a date range from the calendar.');
}
if (Tools::getValue('datepicker_compare')) {

View File

@@ -3507,6 +3507,7 @@ class AdminNormalProductsControllerCore extends AdminController
'selectedElements' => $selectedElements
]))
->setUseCheckBox(true)
->setAutoSelectChildren(true)
->setUseBulkActions(true)
->setUseSearch(true);
$data->assign('hotel_tree', $tree->render());

View File

@@ -91,6 +91,12 @@ class AdminOrdersControllerCore extends AdminController
} elseif (Tools::getValue('orders_stay_over')) {
$this->_where .= ' AND hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.'
AND hbd.`date_to` > \''.pSQL(date('Y-m-d')).' 00:00:00\'';
} elseif (Tools::getValue('orders_not_paid')) {
$this->_where .= ' AND os.`paid` = 0 AND a.`current_state` NOT IN ('.implode(',', array(
Configuration::get('PS_OS_CANCELED'),
Configuration::get('PS_OS_REFUND'),
Configuration::get('PS_OS_ERROR')
)).')';
}
$this->_orderBy = 'id_order';

View File

@@ -516,6 +516,46 @@ class AdminStatsControllerCore extends AdminStatsTabController
}
}
public static function getRefunds($date_from, $date_to, $granularity = false, $id_hotel = 0)
{
if ($granularity == 'day') {
$refunds = array();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT
LEFT(`invoice_date`, 10) as date,
SUM(orr.`refunded_amount`) as total_refund_amount,
(
SELECT hbd.`id_hotel`
FROM`'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`id_order` = o.`id_order` LIMIT 1
) AS id_hotel
FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'order_return` orr ON (o.id_order = orr.id_order)
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (o.current_state = os.id_order_state)
WHERE orr.`payment_mode` != "" AND `invoice_date` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1'.'
GROUP BY LEFT(`invoice_date`, 10) HAVING 1 '.HotelBranchInformation::addHotelRestriction($id_hotel));
foreach ($result as $row) {
$refunds[strtotime($row['date'])] = $row['total_refund_amount'];
}
return $refunds;
} else {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(
'SELECT SUM(orr.`refunded_amount`),
(
SELECT hbd.`id_hotel`
FROM`'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`id_order` = o.`id_order` LIMIT 1
) AS id_hotel
FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'order_return` orr ON (o.id_order = orr.id_order)
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (o.current_state = os.id_order_state)
WHERE orr.`payment_mode` != "" AND orr.`id_transaction` != "" AND `invoice_date` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1 HAVING 1 '.HotelBranchInformation::addHotelRestriction($id_hotel)
);
}
}
public static function getExpenses($date_from, $date_to, $granularity = false, $id_hotel = 0)
{
$expenses = ($granularity == 'day' ? array() : 0);
@@ -1165,7 +1205,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
ON (p.`id_product` = hri.`id_product`)
WHERE p.`active` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($dateTo).' 00:00:00" AND hbd.`date_to` > "'.pSQL($dateFrom).' 00:00:00"'.
AND IF(hbd.`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT .', hbd.`date_from` < DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") AND hbd.`date_from` < \''.pSQL($dateTo).'\' AND DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") > \''.pSQL($dateFrom).'\', hbd.`date_from` < \''.pSQL($dateTo).'\' AND hbd.`date_to` > \''.pSQL($dateFrom).'\')'.
HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd')
);
@@ -1257,7 +1297,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
return $averageDailyRates;
}
// Average Daily Rate is the average income per paid occupied room in a given time period
// Average Daily Rate is the average income per occupied room in a given time period
public static function getAverageDailyRate($dateFrom, $dateTo, $idHotel = null)
{
$roomsRevenueByDates = self::getRoomsRevenueForDiscreteDates($dateFrom, $dateTo, $idHotel);
@@ -1552,7 +1592,8 @@ class AdminStatsControllerCore extends AdminStatsTabController
return $result;
}
public static function getTotalRevenueForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
// Calculate total services revenue (services and demands)
public static function getServicesRevenueForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
{
$dateTo = !$dateTo ? date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))) : $dateTo;
@@ -1570,41 +1611,55 @@ class AdminStatsControllerCore extends AdminStatsTabController
$result = array();
foreach ($discreteDates as $discreteDate) {
$cacheKey = 'AdminStats::getTotalRevenueForDiscreteDates'.'_'.(int) $discreteDate['timestamp_from'].'_'.
(!is_array($idHotel) ? (int) $idHotel : implode('_', $idHotel));
if (!Cache::isStored($cacheKey) || !$useCache) {
$sql = 'SELECT SUM((current_parts / total_parts) * total_paid_tax_excl) AS total_revenue
FROM (
SELECT o.`id_order`,
o.`total_paid_tax_excl` / o.`conversion_rate` AS total_paid_tax_excl,
(
SELECT SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`))
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
WHERE hbd.`id_order` = o.`id_order`
AND p.`active` = 1 AND hbd.`is_refunded` = 0 AND o.`valid` = 1'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
) AS total_parts,
(
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
WHERE hbd.`id_order` = o.`id_order`
AND hbd.`date_from` <= "'.pSQL($discreteDate['date_from']).' 00:00:00" AND hbd.`date_to` >= "'.pSQL($discreteDate['date_to']).' 00:00:00"
AND p.`active` = 1 AND hbd.`is_refunded` = 0 AND o.`valid` = 1'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
) AS current_parts
FROM `'._DB_PREFIX_.'orders` o
HAVING total_parts IS NOT NULL AND current_parts > 0
ORDER BY o.`id_order`
) AS t';
$totalServicesRevenue = 0;
// Calculate services revenue
$servicesRevenueSql = 'SELECT SUM((rtspod.`total_price_tax_excl` / o.`conversion_rate`) / DATEDIFF(hbd.`date_to`, hbd.`date_from`))
FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rtspod
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
ON (rtspod.`id_htl_booking_detail` = hbd.`id`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`)
WHERE p.`active` = 1
AND o.`valid` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
$value = Db::getInstance()->getValue($sql);
$value = !$value ? 0: (float) $value;
Cache::store($cacheKey, $value);
if ($servicesRevenue = Db::getInstance()->getValue($servicesRevenueSql)) {
$totalServicesRevenue += $servicesRevenue;
}
$result[$discreteDate['timestamp_from']] = Cache::retrieve($cacheKey);
// Calculate demands revenue
$demandsRevenueSql = 'SELECT SUM((hdmd.`total_price_tax_excl` / o.`conversion_rate`) / DATEDIFF(hbd.`date_to`, hbd.`date_from`))
FROM `'._DB_PREFIX_.'htl_booking_demands` hdmd
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
ON (hdmd.`id_htl_booking` = hbd.`id`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`)
WHERE p.`active` = 1
AND o.`valid` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
if ($demandsRevenue = Db::getInstance()->getValue($demandsRevenueSql)) {
$totalServicesRevenue += $demandsRevenue;
}
$result[$discreteDate['timestamp_from']] = $totalServicesRevenue;
}
return $result;
}
public static function getTotalRevenueForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
{
$result = array();
$servicesRevenueByDates = self::getServicesRevenueForDiscreteDates($dateFrom, $dateTo, $idHotel);
if ($roomsRevenueByDates = self::getRoomsRevenueForDiscreteDates($dateFrom, $dateTo, $idHotel)) {
foreach ($roomsRevenueByDates as $key => $value) {
$result[$key] = (isset($servicesRevenueByDates[$key]) ? $servicesRevenueByDates[$key] : 0) + $value;
}
}
return $result;
@@ -2020,18 +2075,18 @@ class AdminStatsControllerCore extends AdminStatsTabController
$roomsSql = 'SELECT
IFNULL(SUM(
CASE
WHEN od.`original_wholesale_price` <> "0.000000"
THEN od.`original_wholesale_price`
WHEN p.`wholesale_price` <> "0.000000"
THEN p.`wholesale_price`
WHEN od.`purchase_supplier_price` <> "0.000000"
THEN od.`purchase_supplier_price`
WHEN od.`purchase_supplier_price` = "0.000000"
THEN (od.`original_product_price` / o.`conversion_rate`) * '.(int)Configuration::get('CONF_AVERAGE_PRODUCT_MARGIN').' / 100
END
), 0)
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'product` p
ON (p.`id_product` = hbd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'order_detail` od
ON (od.`id_order_detail` = hbd.`id_order_detail`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = hbd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = hbd.`id_order_detail`)
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (od.`id_order` = o.`id_order`)
WHERE p.`active` = 1
AND o.`valid` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
@@ -2044,20 +2099,20 @@ class AdminStatsControllerCore extends AdminStatsTabController
$servicesSql = 'SELECT
IFNULL(SUM(
CASE
WHEN od.`original_wholesale_price` <> "0.000000"
THEN od.`original_wholesale_price`
WHEN p.`wholesale_price` <> "0.000000"
THEN p.`wholesale_price`
WHEN od.`purchase_supplier_price` <> "0.000000"
THEN (od.`purchase_supplier_price` / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_PER_BOOKING.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1)))
WHEN od.`purchase_supplier_price` = "0.000000"
THEN ((od.`original_product_price` / o.`conversion_rate`) * '.(int)Configuration::get('CONF_AVERAGE_PRODUCT_MARGIN').' / 100) / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_PER_BOOKING.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1))
END
), 0)
FROM `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rtspod
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
ON (rtspod.`id_htl_booking_detail` = hbd.`id`)
LEFT JOIN `'._DB_PREFIX_.'product` p
ON (p.`id_product` = hbd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'order_detail` od
ON (od.`id_order_detail` = rtspod.`id_order_detail`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rtspod.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = rtspod.`id_order_detail`)
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (od.`id_order` = o.`id_order`)
WHERE p.`active` = 1
AND o.`valid` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($discreteDate['date_to']).' 00:00:00" AND hbd.`date_to` > "'.pSQL($discreteDate['date_from']).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');

View File

@@ -469,8 +469,6 @@ class OrderConfirmationControllerCore extends FrontController
{
if (Tools::getValue('ajax') != 'true') {
parent::setMedia();
$this->addCSS(_THEME_CSS_DIR_.'history.css');
$this->addJS(_THEME_JS_DIR_.'history.js');
$this->addJS(_THEME_JS_DIR_.'order-confirmation.js');
$this->addCSS(_THEME_CSS_DIR_.'order-confirmation.css');
$this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme

View File

@@ -80,7 +80,7 @@
<ul class="stats-list">
<li>
<span class="item-label">
<a href="{$link->getAdminLink("AdminOrders")|escape:"html":"UTF-8"}" target="_blank">
<a href="{$link->getAdminLink("AdminOrders")|escape:"html":"UTF-8"}&amp;orders_not_paid=1" target="_blank">
<span>{l s="Bookings (not paid)" mod='dashactivity'}</span>
</a>
</span>
@@ -90,7 +90,7 @@
</li>
<li>
<span class="item-label">
<a href="{$link->getAdminLink("AdminOrderRefundRequests")|escape:"html":"UTF-8"}&amp;&submitFilterorder_return=1&amp;order_returnFilter_total_pending_requests=1" target="_blank">
<a href="{$link->getAdminLink("AdminOrderRefundRequests")|escape:"html":"UTF-8"}&amp;&submitFilterorder_return=1&amp;order_returnFilter_total_pending_requests[0]=1" target="_blank">
<span>{l s="Refunds" mod='dashactivity'}</span>
</a>
</span>
@@ -100,7 +100,7 @@
</li>
<li>
<span class="item-label">
<a href="{$link->getAdminLink("AdminCarts")|escape:"html":"UTF-8"}&amp;submitFiltercart=1&amp;cartFilter_filter_ids_order=Abandoned cart" target="_blank">
<a href="{$link->getAdminLink("AdminCarts")|escape:"html":"UTF-8"}&amp;action=filterOnlyAbandonedCarts" target="_blank">
<span>{l s="Abandoned Carts" mod='dashactivity'}</span>
</a>
</span>

View File

@@ -21,9 +21,8 @@ function line_chart_dashinsights(widget_name, chart_details) {
$('#dashinsights_room_nights svg').html('');
nv.addGraph(function () {
var chart = nv.models.lineChart()
.useInteractiveGuideline(true)
.x(function (d) { return (d !== undefined ? d[0] : 0); })
.y(function (d) { return (d !== undefined ? d[1] : 0); })
.y(function (d) { return (d !== undefined ? parseInt(d[1]) : 0); })
.forceY([0, 1])
.margin({
left: 40,
@@ -32,7 +31,7 @@ function line_chart_dashinsights(widget_name, chart_details) {
chart.yAxis.scale().domain([0, 1]);
// create content for the tooltip of chart
chart.interactiveLayer.tooltip.contentGenerator((obj, element) => {
chart.tooltip.contentGenerator((obj, element) => {
var totalNightsBooked = 0;
var tooltipContent = '';

View File

@@ -30,7 +30,7 @@
<section>
<div class="row stats-wrap">
<div class="col-xs-6 col-lg-3">
<div class="stat-box label-tooltip" data-toggle="tooltip" data-original-title="{l s='Average Daily Rate (ADR) represents the average rental income per paid occupied room over a given time period.' mod='dashperformance'}" data-placement="top" style="background-color: #B7F0FF;">
<div class="stat-box label-tooltip" data-toggle="tooltip" data-original-title="{l s='Average Daily Rate (ADR) represents the average rental income per occupied room over a given time period.' mod='dashperformance'}" data-placement="top" style="background-color: #B7F0FF;">
<div class="title-wrapper">
<p>{l s='Average Daily Rate' mod='dashperformance'}</p>
</div>

View File

@@ -107,6 +107,7 @@ class Dashtrends extends Module
$tmp_data['total_paid_tax_excl'][$date] = $tmp_data['orders'][$date] * $tmp_data['average_cart_value'][$date];
$tmp_data['total_purchases'][$date] = $tmp_data['total_paid_tax_excl'][$date] * rand(50, 70) / 100;
$tmp_data['total_expenses'][$date] = $tmp_data['total_paid_tax_excl'][$date] * rand(0, 10) / 100;
$tmp_data['total_refunds'][$date] = $tmp_data['total_paid_tax_excl'][$date] * rand(0, 5) / 100;
}
} else {
$tmp_data['visits'] = AdminStatsController::getVisits(false, $date_from, $date_to, 'day');
@@ -114,6 +115,7 @@ class Dashtrends extends Module
$tmp_data['total_paid_tax_excl'] = AdminStatsController::getTotalSales($date_from, $date_to, 'day', $id_hotel);
$tmp_data['total_purchases'] = AdminStatsController::getPurchases($date_from, $date_to, 'day', $id_hotel);
$tmp_data['total_expenses'] = AdminStatsController::getExpenses($date_from, $date_to, 'day', $id_hotel);
$tmp_data['total_refunds'] = AdminStatsController::getRefunds($date_from, $date_to, 'day', $id_hotel);
}
return $tmp_data;
@@ -151,6 +153,7 @@ class Dashtrends extends Module
$refined_data['net_profits'][$date] += (isset($gross_data['total_paid_tax_excl'][$date]) ? $gross_data['total_paid_tax_excl'][$date] : 0);
$refined_data['net_profits'][$date] -= (isset($gross_data['total_purchases'][$date]) ? $gross_data['total_purchases'][$date] : 0);
$refined_data['net_profits'][$date] -= (isset($gross_data['total_expenses'][$date]) ? $gross_data['total_expenses'][$date] : 0);
$refined_data['net_profits'][$date] -= (isset($gross_data['total_refunds'][$date]) ? $gross_data['total_refunds'][$date] : 0);
}
return $refined_data;

View File

@@ -185,7 +185,7 @@ class HotelBookingDetail extends ObjectModel
return $result;
}
public function getBookingDataParams($params)
public function getBookingDataParams(&$params)
{
if (!isset($params['id_room_type'])) {
$params['id_room_type'] = 0;
@@ -211,6 +211,9 @@ class HotelBookingDetail extends ObjectModel
if (!isset($params['search_cart_rms'])) {
$params['search_cart_rms'] = 0;
}
if (!isset($params['hourly_booking'])) {
$params['hourly_booking'] = false;
}
if (!isset($params['only_active_roomtype'])) {
$params['only_active_roomtype'] = 1;
@@ -236,6 +239,8 @@ class HotelBookingDetail extends ObjectModel
$params['only_search_data'] = 0;
}
Hook::exec('actionBookingDataParamsModifier', array('params' => &$params));
return $params;
}
@@ -292,32 +297,34 @@ class HotelBookingDetail extends ObjectModel
// Unavailable Rooms
if ($search_unavai) {
$params = array(
$searchParams = array(
'idHotel' => $hotel_id,
'dateFrom' => $date_from,
'dateTo' => $date_to,
'idRoomType' => $id_room_type,
'allowedIdRoomTypes' => $allowedIdRoomTypes,
'applyLosRestriction' => $applyLosRestriction,
'allParams' => $params,
);
$unavailRoomTypes = $this->getSearchUnavailableRooms($params);
$unavailRoomTypes = $this->getSearchUnavailableRooms($searchParams);
}
// Cart Rooms
if ($search_cart_rms) {
$params = array(
$searchParams = array(
'idHotel' => $hotel_id,
'idCart' => $id_cart,
'idGuest' => $id_guest,
'idRoomType' => $id_room_type,
'allowedIdRoomTypes' => $allowedIdRoomTypes,
'allParams' => $params,
);
$cartRoomTypes = $this->getSearchCartRooms($params);
$cartRoomTypes = $this->getSearchCartRooms($searchParams);
}
// Available Rooms
if ($search_available) {
$params = array(
$searchParams = array(
'idHotel' => $hotel_id,
'dateFrom' => $date_from,
'dateTo' => $date_to,
@@ -327,16 +334,28 @@ class HotelBookingDetail extends ObjectModel
'searchOccupancy' => $occupancy,
'allowedIdRoomTypes' => $allowedIdRoomTypes,
'applyLosRestriction' => $applyLosRestriction,
'hourlyBooking' => $hourly_booking,
'allParams' => $params,
);
$availableRoomTypes = $this->getSearchAvailableRooms($params);
$availableRoomTypes = $this->getSearchAvailableRooms($searchParams);
if ($availableRoomTypes['unavailableRoomTypes'] && $search_unavai) {
// format unavailable room types
foreach ($availableRoomTypes['unavailableRoomTypes'] as $idProduct => $roomTypeDetail) {
if (!isset($unavailRoomTypes[$idProduct])) {
$unavailRoomTypes[$idProduct] = array();
foreach ($roomTypeDetail as $idRoom => $roomDetail) {
if (!isset($unavailRoomTypes[$idProduct][$idRoom])) {
$unavailRoomTypes[$idProduct][$idRoom] = array(
'id_product' => $roomDetail['id_product'],
'id_room' => $roomDetail['id_room'],
'id_hotel' => $roomDetail['id_hotel'],
'room_num' => $roomDetail['room_num'],
'detail' => array()
);
}
$unavailRoomTypes[$idProduct][$idRoom]['detail'][] = array(
'id_status' => $roomDetail['id_status'],
'room_comment' => $roomDetail['room_comment']
);
}
// FYI: used array_merge because we have int index
$unavailRoomTypes[$idProduct] = array_merge($unavailRoomTypes[$idProduct], $roomTypeDetail);
}
}
@@ -345,19 +364,20 @@ class HotelBookingDetail extends ObjectModel
// Booked Rooms
if ($search_booked) {
$params = array(
$searchParams = array(
'idHotel' => $hotel_id,
'dateFrom' => $date_from,
'dateTo' => $date_to,
'idRoomType' => $id_room_type,
'allowedIdRoomTypes' => $allowedIdRoomTypes,
'allParams' => $params,
);
$bookedRoomTypes = $this->getSearchBookedRooms($params);
$bookedRoomTypes = $this->getSearchBookedRooms($searchParams);
}
// Partially available Rooms
if ($search_partial) {
$params = array(
$searchParams = array(
'idHotel' => $hotel_id,
'dateFrom' => $date_from,
'dateTo' => $date_to,
@@ -366,21 +386,14 @@ class HotelBookingDetail extends ObjectModel
'idRoomType' => $id_room_type,
'searchOccupancy' => $occupancy,
'allowedIdRoomTypes' => $allowedIdRoomTypes,
'hourlyBooking' => $hourly_booking,
'allParams' => $params,
);
$partiallyAvailRoomTypes = $this->getSearchPartiallyAvailRooms($params);
if ($partiallyAvailRoomTypes['unavailableRoomTypes'] && $search_unavai) {
foreach ($partiallyAvailRoomTypes['unavailableRoomTypes'] as $idProduct => $roomTypeDetail) {
if (!isset($unavailRoomTypes[$idProduct])) {
$unavailRoomTypes[$idProduct] = array();
}
// FYI: used array_merge because we have int index
$unavailRoomTypes[$idProduct] = array_merge($unavailRoomTypes[$idProduct], $roomTypeDetail);
}
}
$partiallyAvailRoomTypes = $this->getSearchPartiallyAvailRooms($searchParams);
// Unavailable rooms and booked rooms are already included in there respective search
// So, no need to seperate them here
$partiallyAvailRoomsCount = $partiallyAvailRoomTypes['partiallyAvailRoomsCount'];
$partiallyAvailRoomTypes = $partiallyAvailRoomTypes['partiallyAvailRooms'];
}
@@ -480,6 +493,7 @@ class HotelBookingDetail extends ObjectModel
* 'idRoomType' => ...,
* 'allowedIdRoomTypes' => ...,
* 'applyLosRestriction' => ...,
* 'allParams' => ...,
* );
*/
protected function getSearchUnavailableRooms($params)
@@ -501,34 +515,64 @@ class HotelBookingDetail extends ObjectModel
$stayStartDate = date('Y-m-d', strtotime($dateFrom));
// Room status inactive
$sql1 = 'SELECT `id` AS `id_room`, `id_product`, `id_hotel`, `room_num`, `comment` AS `room_comment`
$sql = array();
$sql[] = 'SELECT `id` AS `id_room`, `id_product`, `id_hotel`, `room_num`, `comment` AS `room_comment`, `id_status`, NULL AS `date_from`, NULL AS `date_to`
FROM `'._DB_PREFIX_.'htl_room_information`
WHERE `id_hotel`='.(int)$idHotel.' AND `id_status` = '. HotelRoomInformation::STATUS_INACTIVE.' AND IF('.(int)$idRoomType.' > 0, `id_product` = '.(int)$idRoomType.', 1) AND `id_product` IN ('.$allowedIdRoomTypes.')';
// check room is temperory inactive
$sql2 = 'SELECT hri.`id` AS `id_room`, hri.`id_product`, hri.`id_hotel`, hri.`room_num`, hri.`comment` AS `room_comment`
$sql[] = 'SELECT hri.`id` AS `id_room`, hri.`id_product`, hri.`id_hotel`, hri.`room_num`, hri.`comment` AS `room_comment`, hri.`id_status`, hrdd.`date_from` AS `date_from`, hrdd.`date_to` AS `date_to`
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd. id_room = hri.`id`)
WHERE hri.`id_hotel`='.$idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND hrdd.`date_from` <= \''.pSql($dateFrom).'\' AND hrdd.`date_to` >= \''.pSql($dateTo).'\' AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
WHERE hri.`id_hotel`='.$idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND (
(hrdd.`date_from` <= \''.pSQL($dateFrom).'\' AND hrdd.`date_to` > \''.pSQL($dateFrom).'\' AND hrdd.`date_to` <= \''.pSQL($dateTo).'\') OR
(hrdd.`date_from` >= \''.pSQL($dateFrom).'\' AND hrdd.`date_to` > \''.pSQL($dateFrom).'\' AND hrdd.`date_to` <= \''.pSQL($dateTo).'\') OR
(hrdd.`date_from` >= \''.pSQL($dateFrom).'\' AND hrdd.`date_from` < \''.pSQL($dateTo).'\' AND hrdd.`date_to` >= \''.pSQL($dateTo).'\') OR
(hrdd.`date_from` <= \''.pSql($dateFrom).'\' 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;
if ($applyLosRestriction) {
$sql3 = 'SELECT hri.`id` AS `id_room`, hri.`id_product`, hri.`id_hotel`, hri.`room_num`, hri.`comment` AS `room_comment`
$sql[] = 'SELECT hri.`id` AS `id_room`, hri.`id_product`, hri.`id_hotel`, hri.`room_num`, hri.`comment` AS `room_comment`, '.HotelRoomInformation::STATUS_SEARCH_LOS_UNSATISFIED.' AS `id_status`, NULL AS `date_from`, NULL AS `date_to`
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
INNER JOIN `'._DB_PREFIX_.'htl_room_type` AS hrt ON (hrt.`id_product` = hri.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_restriction_date_range` AS hrtr ON (hrt.`id_product` = hrtr.`id_product` AND (hrtr.`date_from` <= \''.pSQL($stayStartDate).'\' AND hrtr.`date_to` > \''.pSQL($stayStartDate).'\'))
WHERE hri.`id_hotel`='.(int)$idHotel.' AND (IFNULL(hrtr.`min_los`, hrt.`min_los`) >'. (int)$lengthOfStay.' OR IF(IFNULL(hrtr.`max_los`, hrt.`max_los`) > 0, IFNULL(hrtr.`max_los`, hrt.`max_los`) < '.(int)$lengthOfStay.', 0)) AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
$sql = $sql.' UNION '.$sql3;
}
$sql .= ' ORDER BY id_room ASC';
Hook::exec('actionUnavailRoomSearchSqlModifier', array(
'sql' => &$sql,
'params' => array(
'id_hotel' => $idHotel,
'id_product' => $idRoomType,
'date_from' => $dateFrom,
'date_to' => $dateTo,
'all_params' => $allParams
)
));
$sql = implode(' UNION ', $sql);
$sql .= ' ORDER BY `id_room`, `date_from` ASC';
$unavailRoomTypes = array();
if ($unavailRooms = Db::getInstance()->executeS($sql)) {
foreach ($unavailRooms as $unavailRoomDetail) {
$unavailRoomTypes[$unavailRoomDetail['id_product']][] = $unavailRoomDetail;
if (!isset($unavailRoomTypes[$unavailRoomDetail['id_product']][$unavailRoomDetail['id_room']])) {
$unavailRoomTypes[$unavailRoomDetail['id_product']][$unavailRoomDetail['id_room']] = array(
'id_product' => $unavailRoomDetail['id_product'],
'id_room' => $unavailRoomDetail['id_room'],
'id_hotel' => $unavailRoomDetail['id_hotel'],
'room_num' => $unavailRoomDetail['room_num'],
'detail' => array()
);
}
$unavailRoomTypes[$unavailRoomDetail['id_product']][$unavailRoomDetail['id_room']]['detail'][] = array(
'id_status' => $unavailRoomDetail['id_status'],
'room_comment' => $unavailRoomDetail['room_comment'],
'date_from' => $unavailRoomDetail['date_from'],
'date_to' => $unavailRoomDetail['date_to'],
);
}
}
@@ -542,6 +586,7 @@ class HotelBookingDetail extends ObjectModel
* 'idGuest' => ...,
* 'idRoomType' => ...,
* 'allowedIdRoomTypes' => ...,
* 'allParams' => ...,
* );
*/
protected function getSearchCartRooms($params)
@@ -550,10 +595,40 @@ class HotelBookingDetail extends ObjectModel
$cartRoomTypes = array();
if ($idCart && $idGuest) {
$sql = 'SELECT cbd.`id_product`, cbd.`id_room`, cbd.`id_hotel`, cbd.`booking_type`, cbd.`comment`, rf.`room_num`, cbd.`date_from`, cbd.`date_to`
FROM `'._DB_PREFIX_.'htl_cart_booking_data` AS cbd
INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = cbd.`id_room`)
WHERE cbd.`id_hotel`= '.(int)$idHotel.' AND cbd.`id_cart` = '.(int)$idCart.' AND cbd.`id_guest` ='.(int)$idGuest.' AND cbd.`is_refunded` = 0 AND cbd.`is_back_order` = 0 AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')';
$selectCartRoomSearch = 'SELECT cbd.`id_product`, cbd.`id_room`, cbd.`id_hotel`, cbd.`booking_type`,
cbd.`comment`, rf.`room_num`, cbd.`date_from`, cbd.`date_to`';
$joinCartRoomSearch = 'INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = cbd.`id_room`)';
$whereCartRoomSearch = 'WHERE cbd.`id_hotel`= '.(int)$idHotel.' AND cbd.`id_cart` = '.(int)$idCart.'
AND cbd.`id_guest` ='.(int)$idGuest.' AND cbd.`is_refunded` = 0 AND cbd.`is_back_order` = 0
AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product`
IN ('.$allowedIdRoomTypes.')';
$groupByCartRoomSearch = '';
$orderByCartRoomSearch = '';
$orderWayCartRoomSearch = '';
Hook::exec('actionCartRoomSearchSqlModifier', array(
'select' => $selectCartRoomSearch,
'join' => &$joinCartRoomSearch,
'where' => &$whereCartRoomSearch,
'group_by' => &$groupByCartRoomSearch,
'order_by' => &$orderByCartRoomSearch,
'order_way' => &$orderWayCartRoomSearch,
'params' => array(
'id_hotel' => $idHotel,
'id_product' => $idRoomType,
'idCart' => $idCart,
'idGuest' => $idGuest,
'all_params' => $allParams
)
));
$sql = $selectCartRoomSearch;
$sql .= ' FROM `'._DB_PREFIX_.'htl_cart_booking_data` AS cbd';
$sql .= ' '.$joinCartRoomSearch;
$sql .= ' '.$whereCartRoomSearch;
$sql .= ' '.$groupByCartRoomSearch;
$sql .= ' '.$orderByCartRoomSearch;
$sql .= ' '.$orderWayCartRoomSearch;
if ($cartRooms = Db::getInstance()->executeS($sql)) {
foreach ($cartRooms as $cartRoomDetail) {
@@ -568,15 +643,17 @@ class HotelBookingDetail extends ObjectModel
/**
* $params = array(
* 'idHotel' => ...,
* 'dateFrom' => ...,
* 'dateTo' => ...,
* 'idCart' => ...,
* 'idGuest' => ...,
* 'idRoomType' => ...,
* 'searchOccupancy' => ...,
* 'allowedIdRoomTypes' => ...,
* 'applyLosRestriction' => ...,
* 'idHotel' => ...,
* 'dateFrom' => ...,
* 'dateTo' => ...,
* 'idCart' => ...,
* 'idGuest' => ...,
* 'idRoomType' => ...,
* 'searchOccupancy' => ...,
* 'allowedIdRoomTypes' => ...,
* 'applyLosRestriction' => ...,
* 'hourlyBooking' => ...,
* 'allParams' => ...,
* );
*/
protected function getSearchAvailableRooms($params)
@@ -606,15 +683,15 @@ class HotelBookingDetail extends ObjectModel
}
// Exculde Booked rooms
$exclude_ids = 'SELECT `id_room`
$excludeRoomId = array();
$excludeRoomId['checked_out'] = 'SELECT `id_room`
FROM `'._DB_PREFIX_.'htl_booking_detail`
WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `is_refunded` = 0 AND IF(`id_status` = '. self::STATUS_CHECKED_OUT.', (
(DATE_FORMAT(`check_out`, "%Y-%m-%d") > \''.pSQL($dateFrom).'\' AND DATE_FORMAT(`check_out`, "%Y-%m-%d") <= \''.PSQL($dateTo).'\') AND (
WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `is_refunded` = 0 AND IF(`id_status` = '. self::STATUS_CHECKED_OUT.',
IF('.(int) $hourlyBooking.', 1, (DATE_FORMAT(`check_out`, "%Y-%m-%d") != DATE_FORMAT(\''.pSQL($dateFrom).'\', "%Y-%m-%d")) AND (`check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\')) AND (
(`date_from` <= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.pSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `date_from` < \''.pSQL($dateTo).'\' AND `check_out` >= \''.pSQL($dateTo).'\') OR
(`date_from` <= \''.pSQL($dateFrom).'\' AND `check_out` >= \''.pSQL($dateTo).'\')
)
), (
(`date_from` <= \''.pSQL($dateFrom).'\' AND `date_to` > \''.pSQL($dateFrom).'\' AND `date_to` <= \''.PSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `date_to` <= \''.pSQL($dateTo).'\') OR
@@ -622,55 +699,54 @@ class HotelBookingDetail extends ObjectModel
(`date_from` <= \''.pSQL($dateFrom).'\' AND `date_to` >= \''.pSQL($dateTo).'\')
)) AND IF('.(int)$idRoomType.' > 0, `id_product` = '.(int)$idRoomType.', 1) AND `id_product` IN ('.$allowedIdRoomTypes.')';
// We have removed cart rooms after finally getting available rooms from booking
// Exclude temporary disable rooms
$exclude_ids .= ' UNION
SELECT hri.`id` AS id_room
$excludeRoomId['disabled'] = 'SELECT hri.`id` AS id_room
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd.`id_room` = hri.`id`)
WHERE hri.`id_hotel`='.(int)$idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND (hrdd.`date_from` < \''.pSql($dateTo).'\' AND hrdd.`date_to` > \''.pSql($dateFrom).'\') AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
// LOS Restriction. Also, Remember to check max LOS restriction is greater than zero
if ($applyLosRestriction) {
$exclude_ids .= ' UNION
SELECT hri.`id` AS `id_room`
$excludeRoomId['length_of_stay'] = 'SELECT hri.`id` AS `id_room`
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
INNER JOIN `'._DB_PREFIX_.'htl_room_type` AS hrt ON (hrt.`id_product` = hri.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_restriction_date_range` AS hrtr ON (hrt.`id_product` = hrtr.`id_product` AND (hrtr.`date_from` <= \''.pSQL($stayStartDate).'\' AND hrtr.`date_to` > \''.pSQL($stayStartDate).'\'))
WHERE hri.`id_hotel`='.(int)$idHotel.' AND (IFNULL(hrtr.`min_los`, hrt.`min_los`) >'. (int)$lengthOfStay.' OR IF(IFNULL(hrtr.`max_los`, hrt.`max_los`) > 0, IFNULL(hrtr.`max_los`, hrt.`max_los`) < '.(int)$lengthOfStay.', 0)) AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
}
// We will remove cart rooms after finally getting available rooms from booking
$selectAvailRoomSearch = 'SELECT ri.`id` AS `id_room`, ri.`id_product`, ri.`id_hotel`, ri.`room_num`, ri.`comment` AS `room_comment`, hrt.`max_adults` AS max_adult, hrt.`max_children`, hrt.`max_guests` AS max_occupancy';
$joinAvailRoomSearch = 'INNER JOIN `'._DB_PREFIX_.'htl_room_type` AS hrt ON (hrt.`id_product` = ri.`id_product`)';
$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.')';
$whereAvailRoomSearch = 'WHERE ri.`id_hotel`='.(int)$idHotel.' AND ri.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE.' AND IF('.(int)$idRoomType.' > 0, ri.`id_product` = '.(int)$idRoomType.', 1) AND ri.`id_product` IN ('.$allowedIdRoomTypes.')';
$groupByAvailRoomSearch = '';
$orderByAvailRoomSearch = 'ORDER BY ri.`id`';
$orderWayAvailRoomSearch = 'ASC';
Hook::exec('actionAvailRoomSearchSqlModifier',
array(
'select' => $selectAvailRoomSearch,
'join' => &$joinAvailRoomSearch,
'where' => &$whereAvailRoomSearch,
'group_by' => &$groupByAvailRoomSearch,
'order_by' => &$orderByAvailRoomSearch,
'order_way' => &$orderWayAvailRoomSearch,
'params' => array(
'id_hotel' => $idHotel,
'id_product' => $idRoomType,
'date_from' => $dateFrom,
'date_to' => $dateTo
)
Hook::exec('actionAvailRoomSearchSqlModifier', array(
'select' => $selectAvailRoomSearch,
'join' => &$joinAvailRoomSearch,
'where' => &$whereAvailRoomSearch,
'exclude_room_id' => &$excludeRoomId,
'group_by' => &$groupByAvailRoomSearch,
'order_by' => &$orderByAvailRoomSearch,
'order_way' => &$orderWayAvailRoomSearch,
'params' => array(
'id_hotel' => $idHotel,
'id_product' => $idRoomType,
'date_from' => $dateFrom,
'date_to' => $dateTo,
'all_params' => $allParams
)
);
));
$sql = $selectAvailRoomSearch;
$sql .= ' FROM `'._DB_PREFIX_.'htl_room_information` AS ri';
$sql .= ' '.$joinAvailRoomSearch;
$sql .= ' '.$whereAvailRoomSearch;
$sql .= ' AND ri.`id` NOT IN ('.implode(' UNION ', $excludeRoomId).')';
$sql .= ' '.$groupByAvailRoomSearch;
$sql .= ' '.$orderByAvailRoomSearch;
$sql .= ' '.$orderWayAvailRoomSearch;
@@ -708,7 +784,19 @@ class HotelBookingDetail extends ObjectModel
if ($QLO_SEARCH_TYPE == HotelBookingDetail::SEARCH_TYPE_OWS && $searchOccupancy) {
$availableRoomTypes = $this->getAvailableRoomSatisfingOccupancy($searchOccupancy, $availableRoomTypes, $QLO_OWS_SEARCH_ALGO_TYPE);
// segregating available and unavailable roomTypes
$unavailableRoomTypes = $availableRoomTypes['unavailableRoomTypes'];
if ($unavailableRoomTypes) {
// Adding an id_status key to the unavailable rooms array to identify rooms unavailable due to unsatisfied occupancy search criteria.
// if in case we need to add multiple keys then we can use array union operator
// Instead of looping here, we can do this in the getavailableRoomSatisfingOccupancy function
foreach ($unavailableRoomTypes as $idProduct => $roomTypeDetail) {
foreach ($roomTypeDetail as $idRoom => $roomDetail) {
$unavailableRoomTypes[$idProduct][$roomDetail['id_room']]['id_status'] = HotelRoomInformation::STATUS_SEARCH_OCCUPANCY_UNSATISFIED;
}
}
}
$availableRoomTypes = $availableRoomTypes['availableRoomTypes'];
}
@@ -915,29 +1003,30 @@ class HotelBookingDetail extends ObjectModel
* 'idRoomType' => ...,
* 'searchOccupancy' => ...,
* 'allowedIdRoomTypes' => ...,
* 'hourlyBooking' => ...,
* 'allParams' => ...,
* );
*/
protected function getSearchPartiallyAvailRooms($params)
{
extract($params);
$sql1 = 'SELECT bd.`id_product`, bd.`id_room`, bd.`id_hotel`, bd.`id_customer`, bd.`booking_type`, bd.`id_status` AS booking_status, bd.`comment` AS `room_comment`, rf.`room_num`, bd.`date_from`, IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`check_out`, bd.`date_to`) AS `date_to`, hrt.`max_adults` AS `max_adult`, hrt.`max_children`, hrt.`max_guests` AS `max_occupancy`
$sql = array();
$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` AS `room_comment`, rf.`room_num`, bd.`date_from`, IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`check_out`, bd.`date_to`) AS `date_to`, hrt.`max_adults` AS `max_adult`, hrt.`max_children`, hrt.`max_guests` AS `max_occupancy`
FROM `'._DB_PREFIX_.'htl_booking_detail` AS bd
INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = bd.`id_room`)
INNER JOIN `'._DB_PREFIX_.'htl_room_type` AS hrt ON (hrt.`id_product` = rf.`id_product`)
WHERE bd.`id_hotel`='.(int)$idHotel.' AND rf.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE .' AND bd.`is_back_order` = 0 AND bd.`is_refunded` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', (
(DATE_FORMAT(`check_out`, "%Y-%m-%d") > \''.pSQL($dateFrom).'\' AND DATE_FORMAT(`check_out`, "%Y-%m-%d") < \''.PSQL($dateTo).'\') AND (
(bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` > \''.pSQL($dateFrom).'\' AND bd.`check_out` < \''.pSQL($dateTo).'\') OR
(bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\') OR
(bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`check_out` > \''.pSQL($dateFrom).'\' AND bd.`check_out` < \''.pSQL($dateTo).'\')
)
WHERE bd.`id_hotel`='.(int)$idHotel.' AND rf.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE .' AND bd.`is_back_order` = 0 AND bd.`is_refunded` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', IF('.(int) $hourlyBooking.', 1, (DATE_FORMAT(`check_out`, "%Y-%m-%d") != DATE_FORMAT(\''.pSQL($dateFrom).'\', "%Y-%m-%d")) AND (`check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\')) AND (
(bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` > \''.pSQL($dateFrom).'\' AND bd.`check_out` < \''.pSQL($dateTo).'\') OR
(bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\') OR
(bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`check_out` > \''.pSQL($dateFrom).'\' AND bd.`check_out` < \''.pSQL($dateTo).'\')
), (
(bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`date_to` > \''.pSQL($dateFrom).'\' AND bd.`date_to` < \''.pSQL($dateTo).'\') OR
(bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`date_to` >= \''.pSQL($dateTo).'\') OR
(bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`date_to` < \''.pSQL($dateTo).'\')
)) AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')';
$sql2 = 'SELECT hri.`id_product`, hrdd.`id_room`, hri.`id_hotel`, 0 AS `id_customer`, 0 AS `booking_type`, 0 AS `booking_status`, 0 AS `room_comment`, hri.`room_num`, hrdd.`date_from`, hrdd.`date_to`, hrt.`max_adults` AS `max_adult`, hrt.`max_children`, hrt.`max_guests` AS `max_occupancy`
$sql[] = 'SELECT hri.`id_product`, hrdd.`id_room`, hri.`id_hotel`, 0 AS `id_customer`, 0 AS `booking_type`, 0 AS `booking_status`, 0 AS `room_comment`, hri.`room_num`, hrdd.`date_from`, hrdd.`date_to`, hrt.`max_adults` AS `max_adult`, hrt.`max_children`, hrt.`max_guests` AS `max_occupancy`
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
INNER JOIN `'._DB_PREFIX_.'htl_room_type` AS hrt ON (hrt.`id_product` = hri.`id_product`)
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd.`id_room` = hri.`id`)
@@ -947,7 +1036,20 @@ 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.' ORDER BY id_room ASC';
Hook::exec('actionPartiallyAvailRoomSearchSqlModifier', array(
'sql' => &$sql,
'params' => array(
'id_hotel' => $idHotel,
'id_product' => $idRoomType,
'date_from' => $dateFrom,
'date_to' => $dateTo,
'all_params' => $allParams
)
));
$sql = implode(' UNION ', $sql);
$sql .= ' ORDER BY id_room ASC';
$part_arr = Db::getInstance()->executeS($sql);
// Get date wise available rooms
@@ -1207,16 +1309,14 @@ class HotelBookingDetail extends ObjectModel
}
} else {
// If all dates are not covered then move all partially available room types to unavailable
foreach ($partiallyAvailRooms as $roomDetail) {
if (!isset($unavailableRoomTypes[$roomDetail['id_product']][$roomDetail['id_room']])) {
$unavailableRoomTypes[$roomDetail['id_product']][$roomDetail['id_room']] = array(
'id_room' => $roomDetail['id_room'],
'id_product' => $roomDetail['id_product'],
'id_hotel' => $roomDetail['id_hotel'],
'room_num' => $roomDetail['room_num'],
'room_comment' => ''
);
}
foreach ($partiallyAvailRooms as $partAvailRoomDetail) {
$unavailableRoomTypes[$partAvailRoomDetail['id_product']][$partAvailRoomDetail['id_room']] = array(
'id_room' => $partAvailRoomDetail['id_room'],
'id_product' => $partAvailRoomDetail['id_product'],
'id_hotel' => $partAvailRoomDetail['id_hotel'],
'room_num' => $partAvailRoomDetail['room_num'],
'room_comment' => ''
);
}
$partiallyAvailRooms = array();
@@ -1246,11 +1346,46 @@ class HotelBookingDetail extends ObjectModel
{
extract($params);
$sql = 'SELECT bd.`id`, 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.')
ORDER BY bd.`id_room` ASC';
$selectBookedRoomSearch = 'SELECT `id`, `id_order`, `id_product`, `id_room`, `id_hotel`, `id_customer`, `booking_type`, `id_status` AS booking_status, `comment`, `room_num`, `date_from`, IF(`id_status` = '. self::STATUS_CHECKED_OUT.', `check_out`,`date_to`) AS `date_to`, `check_in`, `check_out`, `date_to` AS `booking_date_to`';
$joinBookedRoomSearch = '';
$whereBookedRoomSearch = 'WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `is_refunded` = 0 AND IF(`id_status` = '. self::STATUS_CHECKED_OUT.', (
(`date_from` <= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.pSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `date_from` < \''.pSQL($dateTo).'\' AND `check_out` >= \''.pSQL($dateTo).'\') OR
(`date_from` <= \''.pSQL($dateFrom).'\' AND `check_out` >= \''.pSQL($dateTo).'\')
), (
(`date_from` <= \''.pSQL($dateFrom).'\' AND `date_to` > \''.pSQL($dateFrom).'\' AND `date_to` <= \''.PSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `date_to` <= \''.pSQL($dateTo).'\') OR
(`date_from` >= \''.pSQL($dateFrom).'\' AND `date_from` < \''.pSQL($dateTo).'\' AND `date_to` >= \''.pSQL($dateTo).'\') OR
(`date_from` <= \''.pSQL($dateFrom).'\' AND `date_to` >= \''.pSQL($dateTo).'\')
)) AND IF('.(int)$idRoomType.' > 0, `id_product` = '.(int)$idRoomType.', 1) AND `id_product` IN ('.$allowedIdRoomTypes.')';
$groupByBookedRoomSearch = '';
$orderByBookedRoomSearch = 'ORDER BY `id_room`, `date_from`';
$orderWayBookedRoomSearch = 'ASC';
Hook::exec('actionBookedRoomSearchSqlModifier', array(
'select' => $selectBookedRoomSearch,
'join' => &$joinBookedRoomSearch,
'where' => &$whereBookedRoomSearch,
'group_by' => &$groupByBookedRoomSearch,
'order_by' => &$orderByBookedRoomSearch,
'order_way' => &$orderWayBookedRoomSearch,
'params' => array(
'id_hotel' => $idHotel,
'id_product' => $idRoomType,
'date_from' => $dateFrom,
'date_to' => $dateTo,
'all_params' => $allParams
)
));
$sql = $selectBookedRoomSearch;
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail`';
$sql .= ' '.$joinBookedRoomSearch;
$sql .= ' '.$whereBookedRoomSearch;
$sql .= ' '.$groupByBookedRoomSearch;
$sql .= ' '.$orderByBookedRoomSearch;
$sql .= ' '.$orderWayBookedRoomSearch;
$bookedRoomTypes = array();
if ($booked_rooms = Db::getInstance()->executeS($sql)) {
@@ -1400,25 +1535,24 @@ class HotelBookingDetail extends ObjectModel
* @param [date] $dateTo [End date of the booking]
*
* @return [int] [Returns number of days between two dates]
* @deprecated use hotelBookingDetail::getDays() instead
* @deprecated use HotelHelper::getNumberOfDays() instead
*/
public function getNumberOfDays($dateFrom, $dateTo)
{
return self::getDays($dateFrom, $dateTo);
// $startDate = new DateTime($dateFrom);
// $endDate = new DateTime($dateTo);
// $daysDifference = $startDate->diff($endDate)->days;
// return $daysDifference;
return HotelHelper::getNumberOfDays($dateFrom, $dateTo);
}
/**
*
* @param [date] $dateFrom [Start date of the booking]
* @param [date] $dateTo [End date of the booking]
*
* @return [int] [Returns number of days between two dates]
* @deprecated use HotelHelper::getNumberOfDays() instead
*/
public static function getDays($dateFrom, $dateTo)
{
$startDate = new DateTime($dateFrom);
$endDate = new DateTime($dateTo);
$daysDifference = $startDate->diff($endDate)->days;
return $daysDifference;
return HotelHelper::getNumberOfDays($dateFrom, $dateTo);
}
public function generateRoomOccupancyWeight($availRoomTypeCount, $totalOccupancy, $totalAdult, $totalChildren)
@@ -1517,10 +1651,18 @@ class HotelBookingDetail extends ObjectModel
$this->context = Context::getContext();
$bookingParams['search_available'] = 1;
$bookingParams['search_partial'] = 0;
$bookingParams['search_booked'] = 0;
$bookingParams['search_unavai'] = 0;
if (!isset($bookingParams['search_available'])) {
$bookingParams['search_available'] = 1;
}
if (!isset($bookingParams['search_partial'])) {
$bookingParams['search_partial'] = 0;
}
if (!isset($bookingParams['search_booked'])) {
$bookingParams['search_booked'] = 0;
}
if (!isset($bookingParams['search_unavai'])) {
$bookingParams['search_unavai'] = 0;
}
$bookingData = $this->getBookingData($bookingParams);

View File

@@ -71,10 +71,10 @@ class HotelBranchInformation extends ObjectModel
public $zipcode;
public $address;
public $phone;
public $use_global_max_order_date;
public $max_order_date;
public $use_global_preparation_time;
public $preparation_time;
public $use_global_max_order_date = 1;
public $max_order_date = '0000-00-00';
public $use_global_preparation_time = 1;
public $preparation_time = '0000-00-00';
protected $webserviceParameters = array(
'objectsNodeName' => 'hotels',
@@ -140,7 +140,7 @@ class HotelBranchInformation extends ObjectModel
$this->moduleInstance = Module::getInstanceByName('hotelreservationsystem');
parent::__construct($id, $id_lang, $id_shop);
$this->use_global_max_order_date = $this->max_order_date = $this->use_global_preparation_time = $this->preparation_time = $this->id_country = $this->id_state = $this->city = $this->zipcode = $this->address = $this->phone = null;
$this->id_country = $this->id_state = $this->city = $this->zipcode = $this->address = $this->phone = null;
if ($id) {
if ($hotelAddress = $this->getAddress($id)) {
$this->id_country = $hotelAddress['id_country'];
@@ -1015,18 +1015,26 @@ class HotelBranchInformation extends ObjectModel
}
$hotelName = $this->hotel_name[Configuration::get('PS_LANG_DEFAULT')];
$hotelName = preg_replace('/[0-9!<>,;"?=+()@#°{}_$%:]*/u', '', $hotelName);
$hotelName = trim(preg_replace('/[0-9!<>,;?=+()@#"°{}_$%:]*$/u', '', $hotelName));
$objAddress->id_hotel = $this->id;
$objAddress->id_country = $this->id_country;
$objAddress->id_state = $this->id_state;
$objAddress->city = $this->city;
$objAddress->postcode = $this->zipcode;
$objAddress->lastname = $hotelName;
$objAddress->firstname = $hotelName;
$objAddress->alias = $hotelName;
$objAddress->address1 = $this->address;
$objAddress->phone = $this->phone;
$objAddress->alias = substr($hotelName, 0, 32);
$addressFirstName = $hotelName;
$addressLastName = $hotelName;
if (Tools::strlen($hotelName) > 32) {
$addressFirstName = trim(substr($hotelName, 0, 32));
if (!$addressLastName = trim(substr($hotelName, 32, 32))) {
$addressLastName = $addressFirstName;
}
}
$objAddress->firstname = $addressFirstName;
$objAddress->lastname = $addressLastName;
return $objAddress->save();
}
@@ -1061,186 +1069,96 @@ class HotelBranchInformation extends ObjectModel
if (isset($this->webservice_validation) && $this->webservice_validation) {
if ($this->rating < 1 || $this->rating > 5) {
$message = Tools::displayError('Rating must be between 1 and 5.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!strtotime($this->check_in)) {
} elseif (!strtotime($this->check_in)) {
$message = Tools::displayError('Check In time is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!strtotime($this->check_out)) {
} elseif (!strtotime($this->check_out)) {
$message = Tools::displayError('Check out time is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if ($this->check_in && $this->check_out && strtotime($this->check_out) >= strtotime($this->check_in)) {
} elseif ($this->check_in && $this->check_out && strtotime($this->check_out) >= strtotime($this->check_in)) {
$message = Tools::displayError('Check Out time must be before Check In time.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!$this->phone) {
} elseif (!trim($this->phone)) {
$message = Tools::displayError('Phone number is required field.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif (!Validate::isPhoneNumber($this->phone)) {
$message = Tools::displayError('Please enter a valid phone number.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if ($this->address == '') {
} elseif (trim($this->address) == '') {
$message = Tools::displayError('Address is required field.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif (!Validate::isAddress($this->address)) {
$message = Tools::displayError('Address is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!$this->id_country) {
} elseif (!$this->id_country) {
$message = Tools::displayError('Country is required field.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} else {
if (Validate::isLoadedObject($objCountry = new Country($this->id_country))) {
$statesbycountry = State::getStatesByIdCountry($this->id_country);
/*If selected country has states only the validate state field*/
if ($this->id_state) {
$objState = new State($this->id_state);
if ($objState->id_country != $this->id_country) {
$message = Tools::displayError('State is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
} else {
if ($statesbycountry) {
$message = Tools::displayError('State is required field.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
/* Check zip code format */
if (empty($this->zipcode) && $objCountry->need_zip_code) {
$message = Tools::displayError('A Zip / Postal code is required.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif ($objCountry->zip_code_format && !$objCountry->checkZipCode($this->zipcode)) {
$message = sprintf(Tools::displayError('The Zip/Postal code you have entered is invalid. It must follow this format: %s'), str_replace('C', $objCountry->iso_code, str_replace('N', '0', str_replace('L', 'A', $objCountry->zip_code_format))));
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif ($this->zipcode && !Validate::isPostCode($this->zipcode)) {
$message = Tools::displayError('The Zip / Postal code is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
} else {
$message = Tools::displayError('country is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
if ($this->city == '') {
} elseif ($this->city == '') {
$message = Tools::displayError('City is required field.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif (!Validate::isCityName($this->city)) {
$message = Tools::displayError('Enter a Valid City Name.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!Validate::isBool($this->use_global_max_order_date)) {
} elseif (!Validate::isBool($this->use_global_max_order_date)) {
$message = Tools::displayError('invalid value for use_global_max_order_date.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!Validate::isBool($this->use_global_preparation_time)) {
} elseif (!Validate::isBool($this->use_global_preparation_time)) {
$message = Tools::displayError('invalid value for use_global_preparation_time.');
} elseif (!$this->use_global_max_order_date && $this->max_order_date == '') {
$message = Tools::displayError('Maximum date to book a room is required.');
} elseif (!$this->use_global_max_order_date && !Validate::isDate($this->max_order_date)) {
$message = Tools::displayError('Maximum date to book a room is invalid.');
} elseif (!$this->use_global_max_order_date
&& ($maxOrderDateFormatted = date('Y-m-d', strtotime($this->max_order_date)))
&& strtotime($maxOrderDateFormatted) < strtotime(date('Y-m-d'))
) {
$message = Tools::displayError('Maximum Global Date to book a room can not be a past date. Please use a future date.');
} elseif (!$this->use_global_preparation_time && $this->preparation_time === '') {
$message = Tools::displayError('Minimum booking offset is a required.');
} elseif (!$this->use_global_preparation_time && $this->preparation_time !== '0' && !Validate::isUnsignedInt($this->preparation_time)) {
$message = Tools::displayError('Minimum booking offset is invalid.');
} elseif (!Validate::isLoadedObject($objCountry = new Country($this->id_country))) {
$message = Tools::displayError('country is invalid.');
} elseif ($this->id_state
&& (!Validate::isLoadedObject($objState = new State($this->id_state)) || $objState->id_country != $this->id_country)
) {
$message = Tools::displayError('State is invalid.');
} elseif (State::getStatesByIdCountry($this->id_country) && !$this->id_state) {
$message = Tools::displayError('State is required field.');
} elseif (empty($this->zipcode) && $objCountry->need_zip_code) {
$message = Tools::displayError('A Zip / Postal code is required.');
} elseif ($objCountry->zip_code_format && !$objCountry->checkZipCode($this->zipcode)) {
$message = sprintf(Tools::displayError('The Zip/Postal code you have entered is invalid. It must follow this format: %s'), str_replace('C', $objCountry->iso_code, str_replace('N', '0', str_replace('L', 'A', $objCountry->zip_code_format))));
} elseif ($this->zipcode && !Validate::isPostCode($this->zipcode)) {
$message = Tools::displayError('The Zip / Postal code is invalid.');
} else {
if ($addressValidation = Address::getValidationRules('Address')) {
foreach ($addressValidation['size'] as $field => $maxSize) {
if ('phone' == $field && Tools::strlen($this->phone) > $maxSize) {
$message = sprintf(
Tools::displayError('The Hotel phone number is too long (%1$d chars max).'),
$maxSize
);
break;
} elseif ('address1' == $field && Tools::strlen($this->address) > $maxSize) {
$message = sprintf(
Tools::displayError('The Hotel address is too long (%1$d chars max).'),
$maxSize
);
break;
} elseif ('city' == $field && Tools::strlen($this->city) > $maxSize) {
$message = sprintf(
Tools::displayError('The Hotel city name is too long (%1$d chars max).'),
$maxSize
);
break;
} elseif ('postcode' == $field && Tools::strlen($this->zipcode) > $maxSize) {
$message = sprintf(
Tools::displayError('The Hotel zip code is too long (%1$d chars max).'),
$maxSize
);
break;
}
}
}
}
if (isset($message) && $message != '') {
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
if (!$this->use_global_max_order_date) {
$maxOrderDateFormatted = date('Y-m-d', strtotime($this->max_order_date));
if ($this->max_order_date == '') {
$message = Tools::displayError('Maximum date to book a room is required.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif (!Validate::isDate($this->max_order_date)) {
$message = Tools::displayError('Maximum date to book a room is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif (strtotime($maxOrderDateFormatted) < strtotime(date('Y-m-d'))) {
$message = Tools::displayError('Maximum Global Date to book a room can not be a past date. Please use a future date.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
if (!$this->use_global_preparation_time) {
if ($this->preparation_time === '') {
$message = Tools::displayError('Minimum booking offset is a required.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
} elseif ($this->preparation_time !== '0' && !Validate::isUnsignedInt($this->preparation_time)) {
$message = Tools::displayError('Minimum booking offset is invalid.');
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
}
return parent::validateFields($die, $error_return);
@@ -1272,6 +1190,11 @@ class HotelBranchInformation extends ObjectModel
}
$objCountry = new Country();
$countryName = $objCountry->getNameById($idLang, $this->id_country);
$linkRewriteArray = array();
foreach (Language::getLanguages(true) as $lang) {
$linkRewriteArray[$lang['id_lang']] = Tools::link_rewrite($this->hotel_name[$lang['id_lang']]);
}
if ($catCountry = $this->addCategory($countryName, false, $groupIds)) {
if ($this->id_state) {
$objState = new State();
@@ -1284,8 +1207,15 @@ class HotelBranchInformation extends ObjectModel
if ($catState) {
if ($catCity = $this->addCategory($this->city, $catState, $groupIds)) {
$hotelCatName = $this->hotel_name[Configuration::get('PS_LANG_DEFAULT')];
if ($catHotel = $this->addCategory(
$hotelCatName, $catCity, $groupIds, 1, $this->id
if ($this->id_category) {
$objCategory = new Category($this->id_category);
$objCategory->name = $this->hotel_name;
$objCategory->link_rewrite = $linkRewriteArray;
$objCategory->id_parent = $catCity;
$objCategory->save();
Category::regenerateEntireNtree();
} else if ($catHotel = $this->addCategory(
$hotelCatName, $catCity, $groupIds, 1, $this->id, $linkRewriteArray
)) {
$this->id_category = $catHotel;
$this->save();

View File

@@ -1905,13 +1905,31 @@ class HotelCartBookingData extends ObjectModel
}
}
public function update($null_values = false)
{
if (!$this->extra_demands) {
$this->extra_demands = json_encode(array());
}
return parent::update($null_values);
}
public function add($auto_date = true, $null_values = false)
{
if (!$this->extra_demands) {
$this->extra_demands = json_encode(array());
}
return parent::add($auto_date, $null_values);
}
// Webservice :: get extra demands for the cart booking
public function getWsExtraDemands()
{
$extraDemands = json_decode($this->extra_demands, true);
if (count($extraDemands)) {
foreach ($extraDemands as &$demnad) {
$demnad['id'] = $demnad['id_global_demand'];
if ($extraDemands) {
foreach ($extraDemands as &$demand) {
$demand['id'] = $demand['id_global_demand'];
}
return $extraDemands;
}

View File

@@ -2730,11 +2730,7 @@ class HotelHelper
if (isset($rooms[$roomType['value']])) {
$roomType['children'] = $rooms[$roomType['value']];
}
$roomType['hint'] = 'This is Room type hint';
$roomType['badge'] = array(
'class' => 'badge-danger',
'title' => 'Disabled'
);
if ($previousElements) {
$return[$roomType['id_hotel']][] = $roomType;
} else {

View File

@@ -34,6 +34,9 @@ class HotelRoomInformation extends ObjectModel
const STATUS_INACTIVE = 2;
const STATUS_TEMPORARY_INACTIVE = 3;
const STATUS_SEARCH_LOS_UNSATISFIED = 4;
const STATUS_SEARCH_OCCUPANCY_UNSATISFIED = 5;
public static $definition = array(
'table' => 'htl_room_information',
'primary' => 'id',
@@ -76,7 +79,7 @@ class HotelRoomInformation extends ObjectModel
{
if ($idRoom = $this->id) {
// delete rooms from cart which are set inactive
if ($this->id_status == self::STATUS_INACTIVE) {
if ($this->id_status == HotelRoomInformation::STATUS_INACTIVE) {
$objCartBookingData = new HotelCartBookingData();
if (!$objCartBookingData->deleteCartBookingData(0, 0, $idRoom)) {
return false;
@@ -138,25 +141,37 @@ class HotelRoomInformation extends ObjectModel
public function getAllRoomStatus()
{
$moduleInstance = Module::getInstanceByName('hotelreservationsystem');
$status = array(
'STATUS_ACTIVE' => array(
'id' => self::STATUS_ACTIVE,
'status' => $moduleInstance->l('Active', 'hotelreservationsystem')
'id' => HotelRoomInformation::STATUS_ACTIVE,
'status' => self::getRoomStatusTitle(HotelRoomInformation::STATUS_ACTIVE)
),
'STATUS_INACTIVE' => array(
'id' => self::STATUS_INACTIVE,
'status' => $moduleInstance->l('Inactive', 'hotelreservationsystem')
'id' => HotelRoomInformation::STATUS_INACTIVE,
'status' => self::getRoomStatusTitle(HotelRoomInformation::STATUS_INACTIVE)
),
'STATUS_TEMPORARY_INACTIVE' => array(
'id' => self::STATUS_TEMPORARY_INACTIVE,
'status' => $moduleInstance->l('Temporarily Inactive', 'hotelreservationsystem')
'id' => HotelRoomInformation::STATUS_TEMPORARY_INACTIVE,
'status' => self::getRoomStatusTitle(HotelRoomInformation::STATUS_TEMPORARY_INACTIVE)
),
);
return $status;
}
public static function getRoomStatusTitle($idStatus)
{
$moduleInstance = Module::getInstanceByName('hotelreservationsystem');
$status = array(
HotelRoomInformation::STATUS_ACTIVE => $moduleInstance->l('Active', 'hotelreservationsystem'),
HotelRoomInformation::STATUS_INACTIVE => $moduleInstance->l('Inactive', 'hotelreservationsystem'),
HotelRoomInformation::STATUS_TEMPORARY_INACTIVE => $moduleInstance->l('Temporarily Inactive', 'hotelreservationsystem'),
HotelRoomInformation::STATUS_SEARCH_LOS_UNSATISFIED => $moduleInstance->l('Length of stay restriction not satisfied', 'hotelreservationsystem'),
HotelRoomInformation::STATUS_SEARCH_OCCUPANCY_UNSATISFIED => $moduleInstance->l('Occupancy exceeds room capacity', 'hotelreservationsystem'),
);
return isset($status[$idStatus]) ? $status[$idStatus] : '';
}
/**
* [getHotelRoomInfoByProductId :: To get all rooms information belong to a room type(product) by product id]
* @param [int] $id_product [Id of the product]
@@ -285,7 +300,10 @@ class HotelRoomInformation extends ObjectModel
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($this->id_product)) {
$this->id_hotel = $roomTypeInfo['id_hotel'];
return $this->add($autodate, $null_values);
} else {
WebserviceRequest::getInstance()->setError(400, 'Invalid id product', 134);
}
return false;
}
@@ -296,7 +314,10 @@ class HotelRoomInformation extends ObjectModel
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($this->id_product)) {
$this->id_hotel = $roomTypeInfo['id_hotel'];
return $this->update($null_values);
} else {
WebserviceRequest::getInstance()->setError(400, 'Invalid id product', 134);
}
return false;
}

View File

@@ -419,4 +419,24 @@ class HotelRoomType extends ObjectModel
'SELECT `id` FROM `'._DB_PREFIX_.'htl_room_information` WHERE `id_product` = '.(int)$this->id_product.' ORDER BY `id` ASC'
);
}
public function validateFields($die = true, $error_return = false)
{
if (isset($this->webservice_validation) && $this->webservice_validation) {
if (!(int) $this->id_product || !Validate::isLoadedObject(new Product((int) $this->id_product))) {
$message = Tools::displayError('Invalid Id product.');
} elseif (!(int)$this->id_hotel || !Validate::isLoadedObject(new HotelBranchInformation((int) $this->id_hotel))) {
$message = Tools::displayError('Invalid Id hotel.');
}
if (isset($message)) {
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
return parent::validateFields($die, $error_return);
}
}

View File

@@ -82,10 +82,6 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
protected $webserviceParameters = array(
'objectsNodeName' => 'feature_prices',
'objectNodeName' => 'feature_price',
'objectMethods' => array(
'add' => 'addWs',
'update' => 'updateWs',
),
'fields' => array(
'id_product' => array(
'xlink_resource' => array(
@@ -277,7 +273,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
$date_from = date('Y-m-d', strtotime($date_from));
$date_to = date('Y-m-d', strtotime($date_to));
for($date = $date_from; $date < $date_to; $date = date('Y-m-d', strtotime('+1 day', strtotime($date)))) {
$currentDate = date('Y-m-d', $date);
$currentDate = date('Y-m-d', strtotime($date));
$nextDayDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate)));
if ($id_product) {
$bookingParams = array(
@@ -924,72 +920,37 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
return true;
}
// Webservice :: function will run when feature price added from API
public function addWs($autodate = true, $null_values = false)
public function validateFields($die = true, $error_return = false)
{
$postData = trim(file_get_contents('php://input'));
libxml_use_internal_errors(true);
$xml = simplexml_load_string(utf8_decode($postData));
$postFieldsObj = json_decode(json_encode($xml));
// we will check this also as empty value comes in empty std class
$specialDaysArray = (array) $postFieldsObj->feature_price->special_days;
if (!empty($postFieldsObj->feature_price->special_days)
&& $postFieldsObj->feature_price->special_days
&& $specialDaysArray
) {
if (isset($this->webservice_validation) && $this->webservice_validation) {
$weekDays = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
$specialDays = json_decode($postFieldsObj->feature_price->special_days, true);
if (is_array($specialDays) && $specialDays) {
if (count(array_diff($specialDays, $weekDays))) {
WebserviceRequest::getInstance()->setError(400, 'Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', 134);
return false;
if($this->is_special_days_exists) {
if ($this->special_days
&& ($specialDays = json_decode($this->special_days, true))
) {
if (is_array($specialDays) && $specialDays) {
if (count(array_diff($specialDays, $weekDays))) {
$message = Tools::displayError('Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', false);
}
} else {
$message = Tools::displayError('Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', false);
}
} else {
$message = Tools::displayError('Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', false);
}
} else {
WebserviceRequest::getInstance()->setError(400, 'Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', 134);
}
return false;
if (isset($message) && $message != '') {
if ($die) {
throw new PrestaShopException($message);
}
return $error_return ? $message : false;
}
}
return $this->add($autodate, $null_values);
return parent::validateFields($die, $error_return);
}
// Webservice :: function will run when feature price updated from API
public function updateWs($null_values = false)
{
$postData = trim(file_get_contents('php://input'));
libxml_use_internal_errors(true);
$xml = simplexml_load_string(utf8_decode($postData));
$postFieldsObj = json_decode(json_encode($xml));
// we will check this also as empty value comes in empty std class
$specialDaysArray = (array) $postFieldsObj->feature_price->special_days;
if (!empty($postFieldsObj->feature_price->special_days)
&& $postFieldsObj->feature_price->special_days
&& $specialDaysArray
) {
$weekDays = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
$specialDays = json_decode($postFieldsObj->feature_price->special_days, true);
if (is_array($specialDays) && $specialDays) {
if (count(array_diff($specialDays, $weekDays))) {
WebserviceRequest::getInstance()->setError(400, 'Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', 134);
return false;
}
} else {
WebserviceRequest::getInstance()->setError(400, 'Invalid special days. format must match with : ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]', 134);
return false;
}
}
return $this->update($null_values);
}
public static function createAutoFeaturePrice($params)
{
$context = Context::getContext();

View File

@@ -107,11 +107,15 @@ class WebserviceSpecificManagementQlo implements WebserviceSpecificManagementInt
if (!isset($this->wsObject->urlFragments['id_hotel']) ) {
throw new WebserviceException('You have to set \'id_hotel\', \'date_from\' and \'date_to\'parameters to get a result', array(100, 400));
}
$kwargs = [
$dateFrom = isset($this->wsObject->urlFragments['date_from']) ? $this->wsObject->urlFragments['date_from'] : date('Y-m-d');
$dateTo = isset($this->wsObject->urlFragments['date_to']) ? $this->wsObject->urlFragments['date_to'] : date('Y-m-d', strtotime($dateFrom.' + 1 day'));
$kwargs = array(
'idHotel' => $this->wsObject->urlFragments['id_hotel'],
'dateFrom' => $this->wsObject->urlFragments['date_from'],
'dateTo' => $this->wsObject->urlFragments['date_to'],
];
'dateFrom' => $dateFrom,
'dateTo' => $dateTo,
'idRoomType' => isset($this->wsObject->urlFragments['id_room_type']) ? $this->wsObject->urlFragments['id_room_type'] : 0,
);
$this->output .= $objQloRoomType->getRoomRates($kwargs);
break;

View File

@@ -379,6 +379,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
'link' => $this->context->link
));
if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {

View File

@@ -128,6 +128,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$this->fields_list['total_pending_requests'] = array(
'title' => $this->l('Pending Requests'),
'align' => 'center',
'type' => 'range',
'havingFilter' => true,
);
}

View File

@@ -54,6 +54,7 @@ class HotelReservationSystem extends Module
'bookings' => array('description' => 'Order bookings', 'class' => 'HotelBookingDetail'),
'booking_extra_demands' => array('description' => 'Booking extra demands', 'class' => 'HotelBookingDemands'),
'extra_demands' => array('description' => 'Extra demands', 'class' => 'HotelRoomTypeGlobalDemand'),
'extra_services' => array('description' => 'Extra services', 'class' => 'Product', 'parameters_attribute' => 'webserviceRoomTypeServicesParameters'),
'demand_advance_options' => array('description' => 'Extra demand advance options', 'class' => 'HotelRoomTypeGlobalDemandAdvanceOption'),
'hotel_ari' => array('description' => 'Search availability, rates and inventory', 'specific_management' => true),
'qlo' => array('description' => 'qlo API', 'specific_management' => true),

View File

@@ -216,7 +216,13 @@ p.room_cat_data
font-weight: 700;
margin-bottom: 0px;
}
.status-info-tooltip {
position: relative;
display: inline-block;
left: 100%;
margin-left: -10px;
padding: 0px;
}
.color_indicate
{
width: 10px;
@@ -239,6 +245,7 @@ p.room_cat_data
margin: 10px 0px;
}
.cart-table-thead
{
border-bottom: 1px solid #555!important;
@@ -279,7 +286,10 @@ p.room_cat_data
font-size: 14px!important;
font-weight: 600!important;
}
#htl_rooms_list table td {
padding-top: 10px;
padding-bottom: 10px;
}
#room-status-tabs li
{
font-size: 14px;

View File

@@ -954,10 +954,56 @@ $(document).ready(function() {
success: function(result) {
if (result.success) {
$(".htl_room_data_cont").html(result.data.stats_panel);
initstatstooltip();
}
}
});
}
initstatstooltip();
function initstatstooltip()
{
$(".htl_room_data_cont").find('.status-info-tooltip').tooltip({
trigger : 'hover',
show: {
delay: 100,
},
hide: {
delay: 300,
},
open: function(event, ui)
{
if(event.buttons == 1 || event.buttons == 3){
ui.tooltip.remove();
}
if (typeof(event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
// ajax function to pull in data and add it to the tooltip goes here
},
close: function(event, ui)
{
ui.tooltip.hover(function() {
$(this).stop(true).fadeTo(300, 1);
},
function() {
$(this).fadeOut('300', function()
{
$(this).remove();
});
});
}
});
}
var allotmentTypes = {
auto: ALLOTMENT_AUTO,

View File

@@ -203,6 +203,7 @@
<tr>
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Order' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Message' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Allotment Type' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Reallocate' mod='hotelreservationsystem'}</span></th>
@@ -216,6 +217,7 @@
<td rowspan="{$booked_v['detail']|count}">{$booked_v['room_num']|escape:'htmlall':'UTF-8'} {hook h='displayRoomNumAfter' data=$booked_v key=$rm_dtl_k type='booked'}</td>
{/if}
<td>{dateFormat date=date('Y-m-d', strtotime($rm_dtl_v['date_from']))} - {dateFormat date=date('Y-m-d', strtotime($rm_dtl_v['date_to']))}</td>
<td><a href="{$link->getAdminLink('AdminOrders')}&id_order={$rm_dtl_v['id_order']|intval}&vieworder" target="_blank">#{$rm_dtl_v['id_order']}</a></td>
<td>{$rm_dtl_v['comment']|escape:'htmlall':'UTF-8'}</td>
<td>
{if $rm_dtl_v['booking_type'] == HotelBookingDetail::ALLOTMENT_AUTO}{l s='Auto Allotment' mod='hotelreservationsystem'}{elseif $rm_dtl_v['booking_type'] == HotelBookingDetail::ALLOTMENT_MANUAL}{l s='Manual Allotment' mod='hotelreservationsystem'}{/if}
@@ -242,15 +244,29 @@
<thead>
<tr>
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Status' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Message' mod='hotelreservationsystem'}</span></th>
</tr>
</thead>
<tbody>
{foreach from=$book_v['data']['unavailable'] key=unavai_k item=unavai_v}
<tr>
<td>{$unavai_v['room_num']|escape:'htmlall':'UTF-8'}</td>
<td>{$unavai_v['room_comment']|escape:'htmlall':'UTF-8'}</td>
</tr>
{foreach from=$unavai_v['detail'] key=rm_dtl_k item=unavail_dtl_v}
<tr>
{if $unavail_dtl_v@first}
<td rowspan="{$unavai_v['detail']|count}">{$unavai_v['room_num']|escape:'htmlall':'UTF-8'}</td>
{/if}
<td>{HotelRoomInformation::getRoomStatusTitle($unavail_dtl_v['id_status'])|escape:'htmlall':'UTF-8'}</td>
<td>
{if $unavail_dtl_v['date_from'] && $unavail_dtl_v['date_to']}
{dateFormat date=date('Y-m-d', strtotime($unavail_dtl_v['date_from']))} - {dateFormat date=date('Y-m-d', strtotime($unavail_dtl_v['date_to']))}
{else}
--
{/if}
</td>
<td>{$unavail_dtl_v['room_comment']|escape:'htmlall':'UTF-8'}</td>
</tr>
{/foreach}
{/foreach}
</tbody>
</table>

View File

@@ -1,4 +1,7 @@
<div class="htl_room_data_cont">
<div class="status-info-tooltip" title="{l s='Due to the dynamic nature of room availability, a single room can fall under multiple categories in the stats panel. For example, if a room is booked from 1st to 3th and then marked as unavailable for maintenance on 4th to 5th, it would be counted in both the "Booked Rooms" and "Unavailable Rooms" categories for those respective dates if search is done from 1st to 6th. This allows admin to understand the room\'s status across different periods accurately.' mod='hotelreservationsystem'}">
<i class="icon-info-circle"></i>
</div>
<div class="row">
<div class="col-sm-6">
<div class="row">

View File

@@ -271,9 +271,15 @@
margin-right: 5px;
}
#hotel-reviews .review-sort-by-container {
display: inline-block;
position: relative;
}
#hotel-reviews .review-sort-by button {
text-align: left;
min-width: 170px;
position: relative;
}
#hotel-reviews .dropdown-menu {
@@ -285,3 +291,12 @@
top: 15px;
right: 12px;
}
#hotel-reviews.rtl .sort-by {
margin-left: 5px;
margin-right: unset;
}
#hotel-reviews.rtl [class*=col]{
float: right !important;
}

View File

@@ -23,17 +23,19 @@
<div class="">
<div class="dropdown review-sort-by">
<label class="sort-by">{l s='SORT BY' mod='qlohotelreview'}</label>
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" data-value="{QhrHotelReview::QHR_SORT_BY_TIME_NEW}">
<span>{l s='Newest First' mod='qlohotelreview'}</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu text-left">
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_RELEVANCE}" href="#">{l s='Most Relevant' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_TIME_NEW}" href="#">{l s='Newest First' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_TIME_OLD}" href="#">{l s='Oldest First' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_RATING_HIGH}" href="#">{l s='Positive First' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_RATING_LOW}" href="#">{l s='Negative First' mod='qlohotelreview'}</a></li>
</ul>
<div class="review-sort-by-container">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" data-value="{QhrHotelReview::QHR_SORT_BY_TIME_NEW}">
<span>{l s='Newest First' mod='qlohotelreview'}</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu text-left">
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_RELEVANCE}" href="#">{l s='Most Relevant' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_TIME_NEW}" href="#">{l s='Newest First' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_TIME_OLD}" href="#">{l s='Oldest First' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_RATING_HIGH}" href="#">{l s='Positive First' mod='qlohotelreview'}</a></li>
<li><a class="sort-by-option" data-id-hotel="{$id_hotel}" data-value="{QhrHotelReview::QHR_SORT_BY_RATING_LOW}" href="#">{l s='Negative First' mod='qlohotelreview'}</a></li>
</ul>
</div>
</div>
</div>
</div>

View File

@@ -17,7 +17,7 @@
* @license LICENSE.txt
*}
<div id="hotel-reviews" class="tab-pane card">
<div id="hotel-reviews" class="tab-pane card {if isset($language_is_rtl) && $language_is_rtl} rtl {/if}">
{if is_array($reviews) && count($reviews)}
{include file='./_partials/review-summary.tpl'}
{include file='./_partials/media-list.tpl'}

View File

@@ -41,6 +41,12 @@
border-top: 0;
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
}
.rtl .chosen-container .chosen-drop {
right: -9999px;
}
.rtl .chosen-container.chosen-with-drop .chosen-drop {
right: 0;
}
.chosen-container.chosen-container-single-nosearch .chosen-drop {
top: 100%;
}
@@ -173,6 +179,10 @@
left: -9999px;
}
.rtl .chosen-container-single.chosen-container-single-nosearch .chosen-search {
display:none;
}
/* @end */
/* @group Results */
.chosen-container .chosen-results {

View File

@@ -215,9 +215,7 @@
border-radius: 4px;}
.submit_occupancy_btn {
background-color: #1292FF;
font-size: 13px;
border: none;
padding: 5px 20px;
border-radius: 4px;}
@@ -229,7 +227,7 @@
overflow: auto;
box-shadow: 0 8px 25px -4px rgba(0,0,0,0.39);
left: 0px;
padding: 12px 20px;}
padding: 15px 20px;}
#search_occupancy_wrapper.top {
top: unset;
bottom: 100%; }
@@ -253,8 +251,11 @@
font-weight: bold;
text-decoration: none;
font-size: 14px;
color: #0000FF;
line-height: 24px;}
color: #0000FF;}
#search_occupancy_wrapper .occupancy_block_actions {
display: flex;
justify-content: space-between;
align-items: center;}
#search_occupancy_wrapper .add_new_occupancy_btn:active, #search_occupancy_wrapper .add_new_occupancy_btn:focus, #search_occupancy_wrapper .add_new_occupancy_btn:hover {
text-decoration: none;
color: #0000FF;}

View File

@@ -40,7 +40,7 @@
<input type="hidden" id="max_order_date" name="max_order_date" value="{if isset($max_order_date)}{$max_order_date|escape:'htmlall':'UTF-8'}{/if}">
<input type="hidden" id="preparation_time" name="preparation_time" value="{if isset($preparation_time)}{$preparation_time|escape:'htmlall':'UTF-8'}{/if}">
<div class="hotel-selector-wrap">
<div class="hotel-selector-wrap {if isset($language_is_rtl) && $language_is_rtl}rtl{/if}">
<select name="id_hotel" class="chosen header-rmsearch-input" data-placeholder="{l s='Select Hotel' mod='wkroomsearchblock'}" id="id_hotel_button">
<option value=""></option>
{foreach $hotels_info as $name_val}
@@ -210,12 +210,12 @@
</div>
{/if}
</div>
<div>
<div class="occupancy_block_actions">
<span id="add_new_occupancy">
<a class="add_new_occupancy_btn" href="#"><i class="icon-plus"></i> <span>{l s='Add Room' mod='wkroomsearchblock'}</span></a>
</span>
<span>
<button class="submit_occupancy_btn btn btn btn-primary pull-right">{l s='Done' mod='wkroomsearchblock'}</button>
<button class="submit_occupancy_btn btn btn-primary">{l s='Done' mod='wkroomsearchblock'}</button>
</span>
</div>
</div>

View File

@@ -175,7 +175,7 @@
</div>
{/if}
</div>
<div>
<div class="occupancy_block_actions">
<span class="add_occupancy_block">
<a class="add_new_occupancy_btn{if isset($occupancies) && $occupancies && isset($total_available_rooms) && $total_available_rooms <= count($occupancies)} disabled{/if}" data-title-available="{l s='Click to add more rooms.'}" data-title-unavailable="{l s='No more rooms available.'}" href="#">
<i class="icon-plus"></i>
@@ -183,7 +183,7 @@
</a>
</span>
<span>
<button type="submit" class="submit_occupancy_btn btn btn btn-primary pull-right">{l s='Done'}</button>
<button type="submit" class="submit_occupancy_btn btn btn-primary">{l s='Done'}</button>
</span>
</div>
</div>

View File

@@ -23,91 +23,83 @@
</div>
<div class="card-body">
{if (isset($extraDemands) && $extraDemands) || (isset($additionalServices) && $additionalServices)}
<div class="">
<ul class="nav nav-tabs">
{if isset($extraDemands) && $extraDemands}
<li class="active"><a href="#room_type_demands_desc" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if isset($additionalServices) && $additionalServices}
<li{if !isset($extraDemands) || !$extraDemands} class="active"{/if}><a href="#room_type_service_product_desc" data-toggle="tab">{l s='Services'}</a></li>
{/if}
</ul>
<div class="tab-content">
{if isset($extraDemands) && $extraDemands}
<div id="room_type_demands_desc" class="tab-pane active">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Facilities chosen for this booking.'}</p>
</div>
{assign var=roomCount value=1}
{foreach $extraDemands as $roomDemand}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomDemand['adults']} <= 9}0{$roomDemand['adults']}{else}{$roomDemand['adults']}{/if} {if $roomDemand['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $roomDemand['children'] > 0}, {if {$roomDemand['children']} <= 9}0{$roomDemand['children']}{else}{$roomDemand['children']}{/if} {if $roomDemand['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="room_demand_block">
<div class="">{$demand['name']|escape:'html':'UTF-8'}</div>
<ul class="nav nav-tabs">
{if isset($additionalServices) && $additionalServices}
<li class="active"><a href="#room_type_service_product_desc" data-toggle="tab">{l s='Services'}</a></li>
{/if}
{if isset($extraDemands) && $extraDemands}
<li {if !isset($additionalServices) || !$additionalServices} class="active" {/if}><a href="#room_type_demands_desc" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
</ul>
<div class="tab-content">
{if isset($additionalServices) && $additionalServices}
<div id="room_type_service_product_desc" class="tab-pane {if isset($additionalServices) && $additionalServices}active{/if}">
{assign var=roomCount value=1}
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomAdditionalService['adults']} <= 9}0{$roomAdditionalService['adults']}{else}{$roomAdditionalService['adults']}{/if} {if $roomAdditionalService['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $roomAdditionalService['children'] > 0}, {if {$roomAdditionalService['children']} <= 9}0{$roomAdditionalService['children']}{else}{$roomAdditionalService['children']}{/if} {if $roomAdditionalService['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomAdditionalService['additional_services'] as $additionalService}
<div class="room_demand_block">
<div class="">
<div class="">
<span>
{if $useTax}
{displayPrice price="{$demand['total_price_tax_incl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{else}
{displayPrice price="{$demand['total_price_tax_excl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{/if}
</span>
{$additionalService['name']|escape:'html':'UTF-8'}
{if $additionalService['allow_multiple_quantity']}
<span class="quantity">{l s='(Quantity: %s)' sprintf=[$additionalService['quantity']|string_format:'%02d']}</span>
{/if}
</div>
</div>
{/foreach}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
{if isset($additionalServices) && $additionalServices}
<div id="room_type_service_product_desc" class="tab-pane{if !isset($extraDemands) || !$extraDemands} active{/if}">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Services chosen for this booking.'}</p>
</div>
{assign var=roomCount value=1}
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomAdditionalService['adults']} <= 9}0{$roomAdditionalService['adults']}{else}{$roomAdditionalService['adults']}{/if} {if $roomAdditionalService['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $roomAdditionalService['children'] > 0}, {if {$roomAdditionalService['children']} <= 9}0{$roomAdditionalService['children']}{else}{$roomAdditionalService['children']}{/if} {if $roomAdditionalService['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomAdditionalService['additional_services'] as $additionalService}
<div class="room_demand_block">
<div class="">
<div class="">
{$additionalService['name']|escape:'html':'UTF-8'}
{if $additionalService['allow_multiple_quantity']}
<span class="quantity">{l s='(Quantity: %s)' sprintf=[$additionalService['quantity']|string_format:'%02d']}</span>
{/if}
</div>
</div>
<div class="">
<span>
{if $useTax}
{displayPrice price=$additionalService['total_price_tax_incl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{else}
{displayPrice price=$additionalService['total_price_tax_excl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{/if}
</span>
</div>
<div class="">
<span>
{if $useTax}
{displayPrice price=$additionalService['total_price_tax_incl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{else}
{displayPrice price=$additionalService['total_price_tax_excl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{/if}
</span>
</div>
{/foreach}
</div>
</div>
{/foreach}
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
{if isset($extraDemands) && $extraDemands}
<div id="room_type_demands_desc" class="tab-pane {if !isset($additionalServices) || !$additionalServices}active{/if}">
{assign var=roomCount value=1}
{foreach $extraDemands as $roomDemand}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomDemand['adults']} <= 9}0{$roomDemand['adults']}{else}{$roomDemand['adults']}{/if} {if $roomDemand['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $roomDemand['children'] > 0}, {if {$roomDemand['children']} <= 9}0{$roomDemand['children']}{else}{$roomDemand['children']}{/if} {if $roomDemand['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="room_demand_block">
<div class="">{$demand['name']|escape:'html':'UTF-8'}</div>
<div class="">
<span>
{if $useTax}
{displayPrice price="{$demand['total_price_tax_incl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{else}
{displayPrice price="{$demand['total_price_tax_excl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
</div>
</div>
{/if}
</div>
{/if}
</div>

View File

@@ -37,7 +37,7 @@
</p>
{/if}
</div>
<div class="rm_desc">{$room_v['description']|truncate:190:"":true}&nbsp;<a href="{$room_v['product_link']|escape:'htmlall':'UTF-8'}">{l s='View More'}....</a></div>
<div class="rm_desc">{$room_v['description']|truncate:190:"":true}&nbsp;<a class="view_more" href="{$room_v['product_link']|escape:'htmlall':'UTF-8'}">{l s='View More'}....</a></div>
<div class="room_features_cont">
<div class="row">
<div class="col-sm-12 col-md-5 col-lg-6">

View File

@@ -165,7 +165,7 @@
<div class="col-xs-8">
<p class="hotel-name"><span>{$hotel['hotel_name']}</span></p>
<p class="hotel-branch-info-value">{$hotel['address']}, {$hotel['city']}, {if {$hotel['state_name']}}{$hotel['state_name']},{/if} {$hotel['country_name']}, {$hotel['postcode']}</p>
{if $hotel['latitude'] != 0 || $hotel['longitude'] != 0 && $viewOnMap}
{if ($hotel['latitude'] != 0 || $hotel['longitude'] != 0) && $viewOnMap}
<p class="hotel-branch-info-value">
<a class="btn htl-map-direction-btn" href="http://maps.google.com/maps?daddr=({$hotel['latitude']},{$hotel['longitude']})" target="_blank">
<span class="">{l s='View on map'}</span>

View File

@@ -324,4 +324,8 @@ p.capa_txt {
color:#e85757;
font-size:18px;
display: block;
}
.rm_desc .view_more {
display: inline-block;
}

View File

@@ -8981,7 +8981,6 @@ a.open_rooms_extra_services_panel {
margin-bottom: 18px;} */
#rooms_extra_services .room_demand_block {
margin-bottom: 15px;
color: #333;
font-size: 14px;}
#rooms_extra_services .checkbox {

View File

@@ -23,8 +23,13 @@
overflow: auto;
box-shadow: 0 8px 25px -4px rgba(0,0,0,0.39);
left: 0px;
padding: 20px;
padding: 15px 20px;
min-width: 280px}
.booking_occupancy_wrapper .btn {
font-weight: 600;}
.booking_occupancy_wrapper .btn-primary {
background-color: #1292FF;
color: #FFF;}
.booking_occupancy_wrapper .occupancy-info-separator {
margin-bottom: 15px;
margin-top: 15px;
@@ -53,8 +58,11 @@
font-weight: bold;
text-decoration: none;
font-size: 14px;
color: #0000FF;
line-height: 24px;}
color: #0000FF;}
.booking_occupancy_wrapper .occupancy_block_actions {
display: flex;
justify-content: space-between;
align-items: center;}
.booking_occupancy_wrapper .add_new_occupancy_btn:active, .booking_occupancy_wrapper .add_new_occupancy_btn:focus, .booking_occupancy_wrapper .add_new_occupancy_btn:hover {
text-decoration: none;
color: #0000FF;}

View File

@@ -113,12 +113,15 @@
}
/* card-tabs - end */
#rooms_extra_services .card-body{
padding: 0px 18px;
}
#rooms_extra_services .nav-tabs {
border-bottom: none;
}
#rooms_extra_services .nav-tabs > li {
width: 50%;
text-align: center;
margin: 0;
}
@@ -160,7 +163,6 @@
}
#rooms_extra_services .tab-content .room_demands {
padding: 0 18px;
margin-top: 20px;
}
@@ -190,4 +192,24 @@
#rooms_extra_services .nav-tabs > li.active:after {
content: unset;
}
}
#rooms_extra_services .services_not_booked {
text-align: center;
margin: 30px 0px;
font-size: 14px;
}
.price-info-tooltip-cont {
min-width: 180px;
}
.price-info-tooltip-cont .list-row {
display: flex;
justify-content: space-between;
margin: 5px 0;
}
.price-info-tooltip-cont .list-row p {
margin: 0;
}

View File

@@ -750,16 +750,6 @@
display: none;
}
.ui-tooltip.price-tootip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 2px 10px;
max-height: 310px;
overflow-y: auto;
}
.price-info-tooltip-cont {
min-width: 180px;
}
@@ -1013,12 +1003,15 @@
line-height: 24px;
}
#popup-view-extra-services .card-body{
padding: 0px 18px;
}
#popup-view-extra-services .nav-tabs {
border-bottom: none;
}
#popup-view-extra-services .nav-tabs > li {
width: 50%;
text-align: center;
margin: 0;
}
@@ -1059,7 +1052,6 @@
}
#popup-view-extra-services .tab-content .room_demands {
padding: 0 18px;
margin-top: 20px;
}
@@ -1083,6 +1075,17 @@
#popup-view-extra-services .tab-content .room_demand_block:not(:last-of-type) {
margin-bottom: 12px;
}
.payment-summary tr, .guest-details tr {
display: flex;
justify-content: space-between;
align-items: center;
}
#popup-view-extra-services .services_not_booked {
text-align: center;
margin: 30px 0px;
font-size: 14px;
}
/* Guest Tracking page styles - start */
.transform-account .card-text p {

View File

@@ -1741,6 +1741,10 @@ ul.service-product-nav > li:hover {
.hotel_name{
margin-right: 10px;
}
.rtl .hotel_name{
margin-left: 10px;
margin-right: 0px;
}
}
@media (max-width:768px) {
#hotel_rating {

View File

@@ -8,6 +8,53 @@
text-align: right !important; }
/* globals - start */
.pull-left {
float: right !important;
}
.pull-right {
float: left !important;
}
.text-right {
text-align: left !important;
}
.text-left {
text-align: right !important;
}
.icon-angle-double-left:before,
.icon-double-angle-left:before {
content: "" !important;
}
.icon-angle-double-right:before,
.icon-double-angle-right:before {
content: "" !important;
}
.icon-angle-left:before {
content: "" !important;
}
.icon-angle-right:before {
content: "" !important;
}
.btn-edit-guest-info {
margin-left: 10px;
}
.header-rmsearch-wrapper .filter_header .header-bottom-hr {
float: right !important;
}
.booking_guest_occupancy.input-occupancy {
padding-right: 35px;
background-position-x: calc(100% - 10px), 10px !important;
}
.booking_guest_occupancy.input-occupancy .pull-left {
float: right !important;
}
.owl-stage-outer {
direction: rtl !important;
}
@@ -166,6 +213,11 @@ ul.footer_links li .button.button-small span i {
margin-right: 0;
}
div.uploader .filename, div.uploader .action {
float : right !important;
margin-right: 2px;
}
/* room search block - start */
#search_hotel_block_form .header-rmsearch-input.input-location {
padding-right: 35px;
@@ -203,6 +255,30 @@ ul.footer_links li .button.button-small span i {
#search_hotel_block_form .header-rmsearch-input.input-occupancy .pull-left {
float: right !important;
}
#search_hotel_block_form #id_hotel_button{
background-position-x: calc(100% - 10px), 10px !important;
}
#search_hotel_block_form #id_hotel_button_chosen .chosen-single, #search_hotel_block_form .chosen-container-single .chosen-search input[type="text"]{
padding-right: 35px;
background-position-x: calc(100% - 10px), 10px !important;
}
#search_hotel_block_form .chosen-container-single .chosen-single div {
right: unset !important;
left: 5px !important;
}
#search_hotel_block_form .chosen-container-single .chosen-search::after {
right: unset !important;
left: 10px !important;
}
#search_hotel_block_form .chosen-container-single .chosen-single span {
margin-right: unset;
}
/* room search block - end */
/* sidebar - start */
@@ -307,6 +383,71 @@ ul.footer_links li .button.button-small span i {
}
/* my account - end */
/* Room type - start */
#image-block-cont {
padding-left: 15px !important;
}
.close_room_serach_wrapper {
right: unset !important;
left: 0px;
}
/* Room type - end */
/* order-opc - start */
#order-opc .avail_vouchers_block .avail_voucher_name>.voucher_name,
#tc_txt, .product_info_label{
float: right !important;
}
#order-opc .cart_total_detail_block .cart_total_values {
float: left !important;
}
p.payment_module a:after {
right: unset !important;
content: "\f053" !important;
left: 12px !important;
}
p.payment_module a {
padding: 30px 100px 27px 25px;
background-position-x: calc(100% - 10px) !important;
}
.room-type-feature {
float: right !important;
margin-bottom: 5px;
padding: 0px 0px 0px 10px !important;
line-height: 24px !important;
}
/* order-opc - end */
/* contact-us - start */
#contact_type {
text-align: right !important;
}
/* contact-us - end */
/* order-detail - start */
@media (min-width: 576px) {
.booking-room-detail .num-refunded-rooms {
float: left !important;
}
}
.fancybox-wrap.fancybox-order-detail .fancybox-close {
right: unset !important;
left: 12px !important;
}
/* order-detail - start */
/* Booking refund requests - start */
#order-return .form-group.row div {
float: right !important;
}
/* Booking refund requests - end */
/* footer - start */
.footer-section-heading hr {
float: right !important;

View File

@@ -0,0 +1,594 @@
.col-xs-1,
.col-xs-2,
.col-xs-3,
.col-xs-4,
.col-xs-5,
.col-xs-6,
.col-xs-7,
.col-xs-8,
.col-xs-9,
.col-xs-10,
.col-xs-11 {
float: right
}
.col-xs-1 {
width: 8.33333%
}
.col-xs-2 {
width: 16.66667%
}
.col-xs-3 {
width: 25%
}
.col-xs-4 {
width: 33.33333%
}
.col-xs-5 {
width: 41.66667%
}
.col-xs-6 {
width: 50%
}
.col-xs-7 {
width: 58.33333%
}
.col-xs-8 {
width: 66.66667%
}
.col-xs-9 {
width: 75%
}
.col-xs-10 {
width: 83.33333%
}
.col-xs-11 {
width: 91.66667%
}
.col-xs-12 {
width: 100%
}
@media (min-width: 768px) {
.container {
max-width: 728px
}
.col-sm-1,
.col-sm-2,
.col-sm-3,
.col-sm-4,
.col-sm-5,
.col-sm-6,
.col-sm-7,
.col-sm-8,
.col-sm-9,
.col-sm-10,
.col-sm-11 {
float: right
}
.col-sm-1 {
width: 8.33333%
}
.col-sm-2 {
width: 16.66667%
}
.col-sm-3 {
width: 25%
}
.col-sm-4 {
width: 33.33333%
}
.col-sm-5 {
width: 41.66667%
}
.col-sm-6 {
width: 50%
}
.col-sm-7 {
width: 58.33333%
}
.col-sm-8 {
width: 66.66667%
}
.col-sm-9 {
width: 75%
}
.col-sm- {
width: 83.33333%
}
.col-sm- {
width: 91.66667%
}
.col-sm-12 {
width: 100%
}
.col-sm-push-1 {
right: 8.33333%
}
.col-sm-push-2 {
right: 16.66667%
}
.col-sm-push-3 {
right: 25%
}
.col-sm-push-4 {
right: 33.33333%
}
.col-sm-push-5 {
right: 41.66667%
}
.col-sm-push-6 {
right: 50%
}
.col-sm-push-7 {
right: 58.33333%
}
.col-sm-push-8 {
right: 66.66667%
}
.col-sm-push-9 {
right: 75%
}
.col-sm-push-10 {
right: 83.33333%
}
.col-sm-push-11 {
right: 91.66667%
}
.col-sm-pull-0 {
left: auto;
right: auto
}
.col-sm-pull-1 {
left: 8.33333%;
right: auto
}
.col-sm-pull-2 {
left: 16.66667%;
right: auto
}
.col-sm-pull-3 {
left: 25%;
right: auto
}
.col-sm-pull-4 {
left: 33.33333%;
right: auto
}
.col-sm-pull-5 {
left: 41.66667%;
right: auto
}
.col-sm-pull-6 {
left: 50%;
right: auto
}
.col-sm-pull-7 {
left: 58.33333%;
right: auto
}
.col-sm-pull-8 {
left: 66.66667%;
right: auto
}
.col-sm-pull-9 {
left: 75%;
right: auto
}
.col-sm-pull-10 {
left: 83.33333%;
right: auto
}
.col-sm-pull-11 {
left: 91.66667%;
right: auto
}
.col-sm-offset-1 {
margin-right: 8.33333%
}
.col-sm-offset-2 {
margin-right: 16.66667%
}
.col-sm-offset-3 {
margin-right: 25%
}
.col-sm-offset-4 {
margin-right: 33.33333%
}
.col-sm-offset-5 {
margin-right: 41.66667%
}
.col-sm-offset-6 {
margin-right: 50%
}
.col-sm-offset-7 {
margin-right: 58.33333%
}
.col-sm-offset-8 {
margin-right: 66.66667%
}
.col-sm-offset-9 {
margin-right: 75%
}
.col-sm-offset-10 {
margin-right: 83.33333%
}
.col-sm-offset-11 {
margin-right: 91.66667%
}
.col-sm-offset-1,
.col-sm-offset-2,
.col-sm-offset-3,
.col-sm-offset-4,
.col-sm-offset-5,
.col-sm-offset-6,
.col-sm-offset-7,
.col-sm-offset-8,
.col-sm-offset-9,
.col-sm-offset-10,
.col-sm-offset-11 {
margin-left: 0
}
}
@media (min-width: 992px) {
.container {
max-width: 940px
}
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11 {
float: right
}
.col-md-1 {
width: 8.33333%
}
.col-md-2 {
width: 16.66667%
}
.col-md-3 {
width: 25%
}
.col-md-4 {
width: 33.33333%
}
.col-md-5 {
width: 41.66667%
}
.col-md-6 {
width: 50%
}
.col-md-7 {
width: 58.33333%
}
.col-md-8 {
width: 66.66667%
}
.col-md-9 {
width: 75%
}
.col-md-10 {
width: 83.33333%
}
.col-md-11 {
width: 91.66667%
}
.col-md-12 {
width: 100%
}
.col-md-push-1 {
right: 8.33333%
}
.col-md-push-2 {
right: 16.66667%
}
.col-md-push-3 {
right: 25%
}
.col-md-push-4 {
right: 33.33333%
}
.col-md-push-5 {
right: 41.66667%
}
.col-md-push-6 {
right: 50%
}
.col-md-push-7 {
right: 58.33333%
}
.col-md-push-8 {
right: 66.66667%
}
.col-md-push-9 {
right: 75%
}
.col-md-push-10 {
right: 83.33333%
}
.col-md-push-11 {
right: 91.66667%
}
.col-md-pull-0 {
left: auto;
right: auto
}
.col-md-pull-1 {
left: 8.33333%;
right: auto
}
.col-md-pull-2 {
left: 16.66667%;
right: auto
}
.col-md-pull-3 {
left: 25%;
right: auto
}
.col-md-pull-4 {
left: 33.33333%;
right: auto
}
.col-md-pull-5 {
left: 41.66667%;
right: auto
}
.col-md-pull-6 {
left: 50%;
right: auto
}
.col-md-pull-7 {
left: 58.33333%;
right: auto
}
.col-md-pull-8 {
left: 66.66667%;
right: auto
}
.col-md-pull-9 {
left: 75%;
right: auto
}
.col-md-pull-10 {
left: 83.33333%;
right: auto
}
.col-md-pull-11 {
left: 91.66667%;
right: auto
}
.col-md-offset-1 {
margin-right: 8.33333%
}
.col-md-offset-2 {
margin-right: 16.66667%
}
.col-md-offset-3 {
margin-right: 25%
}
.col-md-offset-4 {
margin-right: 33.33333%
}
.col-md-offset-5 {
margin-right: 41.66667%
}
.col-md-offset-6 {
margin-right: 50%
}
.col-md-offset-7 {
margin-right: 58.33333%
}
.col-md-offset-8 {
margin-right: 66.66667%
}
.col-md-offset-9 {
margin-right: 75%
}
.col-md-offset-10 {
margin-right: 83.33333%
}
.col-md-offset-11 {
margin-right: 91.66667%
}
.col-md-offset-1,
.col-md-offset-2,
.col-md-offset-3,
.col-md-offset-4,
.col-md-offset-5,
.col-md-offset-6,
.col-md-offset-7,
.col-md-offset-8,
.col-md-offset-9,
.col-md-offset-10,
.col-md-offset-11 {
margin-left: 0
}
}
@media (min-width: 1200px) {
.container {
max-width: 1170px
}
.col-lg-1,
.col-lg-2,
.col-lg-3,
.col-lg-4,
.col-lg-5,
.col-lg-6,
.col-lg-7,
.col-lg-8,
.col-lg-9,
.col-lg-10,
.col-lg-11 {
float: right
}
.col-lg-1 {
width: 8.33333%
}
.col-lg-2 {
width: 16.66667%
}
.col-lg-3 {
width: 25%
}
.col-lg-4 {
width: 33.33333%
}
.col-lg-5 {
width: 41.66667%
}
.col-lg-6 {
width: 50%
}
.col-lg-7 {
width: 58.33333%
}
.col-lg-8 {
width: 66.66667%
}
.col-lg-9 {
width: 75%
}
.col-lg-10 {
width: 83.33333%
}
.col-lg-11 {
width: 91.66667%
}
.col-lg-12 {
width: 100%
}
.col-lg-push-1 {
right: 8.33333%
}
.col-lg-push-2 {
right: 16.66667%
}
.col-lg-push-3 {
right: 25%
}
.col-lg-push-4 {
right: 33.33333%
}
.col-lg-push-5 {
right: 41.66667%
}
.col-lg-push-6 {
right: 50%
}
.col-lg-push-7 {
right: 58.33333%
}
.col-lg-push-8 {
right: 66.66667%
}
.col-lg-push-9 {
right: 75%
}
.col-lg-push-10 {
right: 83.33333%
}
.col-lg-push-11 {
right: 91.66667%
}
.col-lg-pull-0 {
left: auto;
right: auto
}
.col-lg-pull-1 {
left: 8.33333%;
right: auto
}
.col-lg-pull-2 {
left: 16.66667%;
right: auto
}
.col-lg-pull-3 {
left: 25%;
right: auto
}
.col-lg-pull-4 {
left: 33.33333%;
right: auto
}
.col-lg-pull-5 {
left: 41.66667%;
right: auto
}
.col-lg-pull-6 {
left: 50%;
right: auto
}
.col-lg-pull-7 {
left: 58.33333%;
right: auto;
right: unset
}
.col-lg-pull-8 {
left: 66.66667%;
right: auto
}
.col-lg-pull-9 {
left: 75%;
right: auto
}
.col-lg-pull-10 {
left: 83.33333%;
right: auto
}
.col-lg-pull-11 {
left: 91.66667%;
right: auto
}
.col-lg-offset-1 {
margin-right: 8.33333%
}
.col-lg-offset-2 {
margin-right: 16.66667%
}
.col-lg-offset-3 {
margin-right: 25%
}
.col-lg-offset-4 {
margin-right: 33.33333%
}
.col-lg-offset-5 {
margin-right: 41.66667%
}
.col-lg-offset-6 {
margin-right: 50%
}
.col-lg-offset-7 {
margin-right: 58.33333%
}
.col-lg-offset-8 {
margin-right: 66.66667%
}
.col-lg-offset-9 {
margin-right: 75%
}
.col-lg-offset-10 {
margin-right: 83.33333%
}
.col-lg-offset-11 {
margin-right: 91.66667%
}
.col-lg-offset-1,
.col-lg-offset-2,
.col-lg-offset-3,
.col-lg-offset-4,
.col-lg-offset-5,
.col-lg-offset-6,
.col-lg-offset-7,
.col-lg-offset-8,
.col-lg-offset-9,
.col-lg-offset-10,
.col-lg-offset-11 {
margin-left: 0
}
}

View File

@@ -64,8 +64,10 @@ $(document).ready(function() {
$("#header .shopping_cart a:first").hover(
function() {
if (ajaxCart.nb_total_products > 0 || parseInt($('.ajax_cart_quantity').html()) > 0)
$("#header .cart_block").stop(true, true).slideDown(450);
if (!is_touch_enabled) {
if (ajaxCart.nb_total_products > 0 || parseInt($('.ajax_cart_quantity').html()) > 0)
$("#header .cart_block").stop(true, true).slideDown(450);
}
},
function() {
setTimeout(function() {

View File

@@ -70,4 +70,41 @@ $(document).ready(function(){
},
});
});
});
initPriceTooltip();
});
function initPriceTooltip() {
if ($('.order-price-info').length) {
$('.order-price-info').each(function () {
$(this).tooltip({
content: $(this).closest('td').find('.price-info-container').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'price-tootip',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function (event, ui) {
ui.tooltip.hover(function () {
$(this).stop(true).fadeTo(400, 1);
},
function () {
$(this).fadeOut('400', function () {
$(this).remove();
});
});
}
});
});
}
}

View File

@@ -66,7 +66,7 @@
<!-- left infos-->
<div class="pb-left-column col-xs-12 col-sm-8 col-md-8">
<div class="room_type_img_containter card">
<div class="room_hotel_name_block">
<div class="room_hotel_name_block {if isset($language_is_rtl) && $language_is_rtl}rtl{/if}">
<div class="hotel_name_block">
<h1><span class="hotel_name">{$product->name}
{* Block for booking products *}