Updated the max booking offset to max checkout date

This commit is contained in:
vishalsingh.qlo325
2025-05-15 10:18:31 +05:30
parent 6018276fd2
commit 4d806ec8c8
10 changed files with 96 additions and 96 deletions

View File

@@ -148,8 +148,8 @@ class AdminImportControllerCore extends AdminController
'policies' => array('label' => $this->l('Hotel Policies')),
'active_refund' => array('label' => $this->l('Allow Refund (0 = No, 1 = Yes)')),
'refund_ids' => array('label' => $this->l('Refund IDs (x,y,z...)')),
'max_booking_offset' => array('label' => $this->l('Max booking offset')),
'min_booking_offset' => array('label' => $this->l('Min booking offset')),
'max_checkout_offset' => array('label' => $this->l('Maximum checkout offset')),
'min_booking_offset' => array('label' => $this->l('Minimum booking offset')),
'image' => array('label' => $this->l('Image URLs (x,y,z...)')),
'delete_existing_images' => array(
'label' => $this->l('Delete existing images (0 = No, 1 = Yes)')
@@ -1410,20 +1410,20 @@ class AdminImportControllerCore extends AdminController
}
$objHotelOrderRestrictDate->id_hotel = $objHotelBranch->id;
$objHotelOrderRestrictDate->use_global_max_booking_offset = true;
$objHotelOrderRestrictDate->use_global_max_checkout_offset = true;
$objHotelOrderRestrictDate->use_global_min_booking_offset = true;
if (isset($info['max_booking_offset'])
&& (Configuration::get('PS_MIN_BOOKING_OFFSET') < $info['max_booking_offset']
|| isset($info['min_booking_offset']) && $info['min_booking_offset'] < $info['max_booking_offset'])
if (isset($info['max_checkout_offset'])
&& (Configuration::get('PS_MIN_BOOKING_OFFSET') < $info['max_checkout_offset']
|| isset($info['min_booking_offset']) && $info['min_booking_offset'] < $info['max_checkout_offset'])
) {
$objHotelOrderRestrictDate->use_global_max_booking_offset = false;
$objHotelOrderRestrictDate->max_booking_offset = $info['max_booking_offset'];
$objHotelOrderRestrictDate->use_global_max_checkout_offset = false;
$objHotelOrderRestrictDate->max_checkout_offset = $info['max_checkout_offset'];
}
if (isset($info['min_booking_offset'])
&& (Configuration::get('PS_MAX_BOOKING_OFFSET') > $info['min_booking_offset']
|| isset($info['max_booking_offset']) && $info['max_booking_offset'] > $info['min_booking_offset'])
&& (Configuration::get('PS_MAX_CHECKOUT_OFFSET') > $info['min_booking_offset']
|| isset($info['max_checkout_offset']) && $info['max_checkout_offset'] > $info['min_booking_offset'])
) {
$objHotelOrderRestrictDate->use_global_min_booking_offset = false;
$objHotelOrderRestrictDate->min_booking_offset = $info['min_booking_offset'];

View File

@@ -87,9 +87,9 @@ class AdminOrderPreferencesControllerCore extends AdminController
'title' => $this->l('Order Restrict'),
'icon' => 'icon-cogs',
'fields' => array(
'PS_MAX_BOOKING_OFFSET' => array(
'title' => $this->l('Maximum booking offset'),
'hint' => $this->l('The maximum booking offset defines the number of days from today till which bookings can be made. It is used to limiting how far in advance reservations are allowed to the guest.'),
'PS_MAX_CHECKOUT_OFFSET' => array(
'title' => $this->l('Maximum checkout offset'),
'hint' => $this->l('The maximum checkout offset defines how many days from today checkout is allowed. For example, if this value is set to 10 and someone is booking on March 1st, they can only select a checkout date up to March 11th.'),
'type' => 'text',
'class' => 'fixed-width-xl',
'suffix' => $this->l('day(s)'),
@@ -329,12 +329,12 @@ class AdminOrderPreferencesControllerCore extends AdminController
$this->errors[] = Tools::displayError('Please assign a valid CMS page for Terms and Conditions.');
}
$maxBookingOffset = Tools::getValue('PS_MAX_BOOKING_OFFSET');
$maxCheckoutOffset = Tools::getValue('PS_MAX_CHECKOUT_OFFSET');
$minBookingOffset = Tools::getValue('PS_MIN_BOOKING_OFFSET');
if ($maxBookingOffset === '') {
$this->errors[] = Tools::displayError('Field \'Maximum booking offset\' can not be empty.');
} elseif (!$maxBookingOffset || !Validate::isUnsignedInt($maxBookingOffset)) {
$this->errors[] = Tools::displayError('Field \'Maximum booking offset\' is invalid.');
if ($maxCheckoutOffset === '') {
$this->errors[] = Tools::displayError('Field \'Maximum checkout offset\' can not be empty.');
} elseif (!$maxCheckoutOffset || !Validate::isUnsignedInt($maxCheckoutOffset)) {
$this->errors[] = Tools::displayError('Field \'Maximum checkout offset\' is invalid.');
}
if ($minBookingOffset === '') {
@@ -343,8 +343,8 @@ class AdminOrderPreferencesControllerCore extends AdminController
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' is invalid.');
}
if ($maxBookingOffset && $maxBookingOffset <= $minBookingOffset) {
$this->errors[] = Tools::displayError('Field \'Maximum booking offset\' cannot be be less than or equal to \'Minimum booking offset\'.');
if ($maxCheckoutOffset && $maxCheckoutOffset <= $minBookingOffset) {
$this->errors[] = Tools::displayError('Field \'Maximum checkout offset\' cannot be be less than or equal to \'Minimum booking offset\'.');
}
}

View File

@@ -71,8 +71,8 @@ class HotelBranchInformation extends ObjectModel
public $zipcode;
public $address;
public $phone;
public $use_global_max_booking_offset = 1;
public $max_booking_offset = '1000';
public $use_global_max_checkout_offset = 1;
public $max_checkout_offset = '1000';
public $use_global_min_booking_offset = 1;
public $min_booking_offset = '0';
@@ -106,8 +106,8 @@ class HotelBranchInformation extends ObjectModel
'subResourceName' => 'hotels'
)
),
'use_global_max_booking_offset' => array(),
'max_booking_offset' => array(),
'use_global_max_checkout_offset' => array(),
'max_checkout_offset' => array(),
'use_global_min_booking_offset' => array(),
'min_booking_offset' => array(),
),
@@ -149,8 +149,8 @@ class HotelBranchInformation extends ObjectModel
}
if ($hotelRestrictions = HotelOrderRestrictDate::getDataByHotelId($id)) {
$this->use_global_max_booking_offset = $hotelRestrictions['use_global_max_booking_offset'];
$this->max_booking_offset = $hotelRestrictions['max_booking_offset'];
$this->use_global_max_checkout_offset = $hotelRestrictions['use_global_max_checkout_offset'];
$this->max_checkout_offset = $hotelRestrictions['max_checkout_offset'];
$this->use_global_min_booking_offset = $hotelRestrictions['use_global_min_booking_offset'];
$this->min_booking_offset = $hotelRestrictions['min_booking_offset'];
}
@@ -1064,7 +1064,7 @@ class HotelBranchInformation extends ObjectModel
public function setWsHotelRestrictions()
{
if ($this->id) {
// save maximum booking offset and min booking offset
// save Maximum checkout offset and min booking offset
if ($restrictDateInfo = HotelOrderRestrictDate::getDataByHotelId($this->id)) {
$objHotelRestrictDate = new HotelOrderRestrictDate($restrictDateInfo['id']);
} else {
@@ -1072,9 +1072,9 @@ class HotelBranchInformation extends ObjectModel
}
$objHotelRestrictDate->id_hotel = $this->id;
$objHotelRestrictDate->use_global_max_booking_offset = $this->use_global_max_booking_offset;
if (!$this->use_global_max_booking_offset) {
$objHotelRestrictDate->max_booking_offset = $this->max_booking_offset;
$objHotelRestrictDate->use_global_max_checkout_offset = $this->use_global_max_checkout_offset;
if (!$this->use_global_max_checkout_offset) {
$objHotelRestrictDate->max_checkout_offset = $this->max_checkout_offset;
}
$objHotelRestrictDate->use_global_min_booking_offset = $this->use_global_min_booking_offset;
if (!$this->use_global_min_booking_offset) {
@@ -1111,34 +1111,34 @@ class HotelBranchInformation extends ObjectModel
$message = Tools::displayError('City is required field.');
} elseif (!Validate::isCityName($this->city)) {
$message = Tools::displayError('Enter a Valid City Name.');
} elseif (!Validate::isBool($this->use_global_max_booking_offset)) {
$message = Tools::displayError('invalid value for use_global_max_booking_offset.');
} elseif (!Validate::isBool($this->use_global_max_checkout_offset)) {
$message = Tools::displayError('invalid value for use global max checkout offset.');
} elseif (!Validate::isBool($this->use_global_min_booking_offset)) {
$message = Tools::displayError('invalid value for use_global_min_booking_offset.');
} elseif (!$this->use_global_max_booking_offset && $this->max_booking_offset == '') {
$message = Tools::displayError('Maximum booking offset is required.');
} elseif (!$this->use_global_max_booking_offset && (!$this->max_booking_offset || !Validate::isUnsignedInt($this->max_booking_offset))) {
$message = Tools::displayError('Maximum booking offset is invalid.');
$message = Tools::displayError('invalid value for use global min booking offset.');
} elseif (!$this->use_global_max_checkout_offset && $this->max_checkout_offset == '') {
$message = Tools::displayError('Maximum checkout offset is required.');
} elseif (!$this->use_global_max_checkout_offset && (!$this->max_checkout_offset || !Validate::isUnsignedInt($this->max_checkout_offset))) {
$message = Tools::displayError('Maximum checkout offset is invalid.');
} elseif (!$this->use_global_min_booking_offset && $this->min_booking_offset === '') {
$message = Tools::displayError('Minimum booking offset is a required.');
} elseif (!$this->use_global_min_booking_offset && !Validate::isUnsignedInt($this->min_booking_offset)) {
$message = Tools::displayError('Minimum booking offset is invalid.');
} else if (!$this->use_global_min_booking_offset
&& !$this->use_global_max_booking_offset
&& $this->max_booking_offset
&& $this->max_booking_offset <= $this->min_booking_offset
&& !$this->use_global_max_checkout_offset
&& $this->max_checkout_offset
&& $this->max_checkout_offset <= $this->min_booking_offset
) {
$message = Tools::displayError('Maximum booking cannot be less than or equal to Minimum booking offset.');
} else if (!$this->use_global_max_booking_offset
$message = Tools::displayError('Maximum checkout offset cannot be less than or equal to Minimum booking offset.');
} else if (!$this->use_global_max_checkout_offset
&& $this->use_global_min_booking_offset
&& $this->max_booking_offset <= Configuration::get('PS_MIN_BOOKING_OFFSET')
&& $this->max_checkout_offset <= Configuration::get('PS_MIN_BOOKING_OFFSET')
) {
$message = Tools::displayError('Maximum booking cannot be less than or equal to Global Minimum booking offset.');
} else if ($this->use_global_max_booking_offset
$message = Tools::displayError('Maximum checkout offset cannot be less than or equal to Global Minimum booking offset.');
} else if ($this->use_global_max_checkout_offset
&& !$this->use_global_min_booking_offset
&& $this->min_booking_offset >= Configuration::get('PS_MAX_BOOKING_OFFSET')
&& $this->min_booking_offset >= Configuration::get('PS_MAX_CHECKOUT_OFFSET')
) {
$message = Tools::displayError('Minimum booking offset cannot be be greater than or equal to Global Maximum booking offset.');
$message = Tools::displayError('Minimum booking offset cannot be be greater than or equal to Global Maximum checkout offset.');
} elseif (!Validate::isLoadedObject($objCountry = new Country($this->id_country))) {
$message = Tools::displayError('country is invalid.');
} elseif ($this->id_state

View File

@@ -1063,7 +1063,7 @@ class HotelHelper
Configuration::updateValue('WK_GLOBAL_CHILD_MAX_AGE', 15);
Configuration::updateValue('WK_GLOBAL_MAX_CHILD_IN_ROOM', 0);
Configuration::updateValue('PS_MAX_BOOKING_OFFSET', 365);
Configuration::updateValue('PS_MAX_CHECKOUT_OFFSET', 365);
Configuration::updateValue('PS_MIN_BOOKING_OFFSET', 0);
Configuration::updateValue('HTL_FEATURE_PRICING_PRIORITY', 'specific_date;special_day;date_range');

View File

@@ -22,8 +22,8 @@ class HotelOrderRestrictDate extends ObjectModel
{
public $id;
public $id_hotel;
public $use_global_max_booking_offset;
public $max_booking_offset;
public $use_global_max_checkout_offset;
public $max_checkout_offset;
public $use_global_min_booking_offset;
public $min_booking_offset;
public $date_add;
@@ -34,8 +34,8 @@ class HotelOrderRestrictDate extends ObjectModel
'primary' => 'id',
'fields' => array(
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'use_global_max_booking_offset' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'max_booking_offset' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'use_global_max_checkout_offset' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'max_checkout_offset' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'use_global_min_booking_offset' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'min_booking_offset' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
@@ -56,33 +56,33 @@ class HotelOrderRestrictDate extends ObjectModel
/**
* @param int $id_hotel
* @return string Max date of ordering for order restrict
* @return string Maximum checkout date according to the max booking offset for the hotel.
*/
public static function getMaxOrderDate($idHotel)
{
$result = self::getDataByHotelId($idHotel);
if (is_array($result) && count($result) && !$result['use_global_max_booking_offset']) {
return date('Y-m-d H:i:s', strtotime('+ '.($result['max_booking_offset'] + 1).' days'));
if (is_array($result) && count($result) && !$result['use_global_max_checkout_offset']) {
return date('Y-m-d H:i:s', strtotime('+ '.$result['max_checkout_offset'].' days'));
}
// since this cannot be zero, this function will always return a date.
$globalBookingDate = (int) Configuration::get('PS_MAX_BOOKING_OFFSET');
$globalBookingDate = (int) Configuration::get('PS_MAX_CHECKOUT_OFFSET');
return date('Y-m-d H:i:s', strtotime('+ '.($globalBookingDate + 1).' days'));
return date('Y-m-d H:i:s', strtotime('+ '.$globalBookingDate.' days'));
}
/**
* @param int $id_hotel
* @return int Maximum allowable number of days between booking date and check-in date.
* @return int Maximum allowable number of days between booking date and checkout date.
*/
public static function getMaximumBookingOffset($idHotel)
public static function getMaximumCheckoutOffset($idHotel)
{
$result = self::getDataByHotelId($idHotel);
if (is_array($result) && count($result) && !$result['use_global_max_booking_offset']) {
return $result['max_booking_offset'];
if (is_array($result) && count($result) && !$result['use_global_max_checkout_offset']) {
return $result['max_checkout_offset'];
}
return (int) Configuration::get('PS_MAX_BOOKING_OFFSET');
return (int) Configuration::get('PS_MAX_CHECKOUT_OFFSET');
}
/**

View File

@@ -268,8 +268,8 @@ class HotelReservationSystemDb
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_restrict_date` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_hotel` int(11) NOT NULL,
`use_global_max_booking_offset` tinyint(1) NOT NULL,
`max_booking_offset` int(11) NOT NULL,
`use_global_max_checkout_offset` tinyint(1) NOT NULL,
`max_checkout_offset` int(11) NOT NULL,
`use_global_min_booking_offset` tinyint(1) NOT NULL,
`min_booking_offset` int(11) NOT NULL,
`date_add` datetime NOT NULL,

View File

@@ -212,7 +212,7 @@ class AdminAddHotelController extends ModuleAdminController
$smartyVars['state_var'] = $stateOptions;
$smartyVars['enabledDisplayMap'] = Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP');
$smartyVars['ps_img_dir'] = _PS_IMG_.'l/';
$smartyVars['PS_MAX_BOOKING_OFFSET'] = (int) Configuration::get('PS_MAX_BOOKING_OFFSET');
$smartyVars['PS_MAX_CHECKOUT_OFFSET'] = (int) Configuration::get('PS_MAX_CHECKOUT_OFFSET');
$smartyVars['PS_MIN_BOOKING_OFFSET'] = (int) Configuration::get('PS_MIN_BOOKING_OFFSET');
$smartyVars['WK_ORDER_REFUND_ALLOWED'] = Configuration::get('WK_ORDER_REFUND_ALLOWED');
@@ -251,8 +251,8 @@ class AdminAddHotelController extends ModuleAdminController
$address = Tools::getValue('address');
$active = Tools::getValue('ENABLE_HOTEL');
$activeRefund = Tools::getValue('active_refund');
$enableUseGlobalMaxBookingOffset = Tools::getValue('enable_use_global_max_booking_offset');
$maxBookingOffset = trim(Tools::getValue('max_booking_offset'));
$enableUseGlobalMaxCheckoutOffset = Tools::getValue('enable_use_global_max_checkout_offset');
$maxCheckoutOffset = trim(Tools::getValue('max_checkout_offset'));
$enableUseGlobalMinBookingOffset = Tools::getValue('enable_use_global_min_booking_offset');
$minBookingOffset = trim(Tools::getValue('min_booking_offset'));
$latitude = Tools::getValue('loclatitude');
@@ -428,11 +428,11 @@ class AdminAddHotelController extends ModuleAdminController
}
if ($idHotel) {
if (!$enableUseGlobalMaxBookingOffset) {
if ($maxBookingOffset === '') {
$this->errors[] = $this->l('Maximum booking offset is a required field.');
} elseif (!$maxBookingOffset || !Validate::isUnsignedInt($maxBookingOffset)) {
$this->errors[] = $this->l('Maximum booking offset is invalid.');
if (!$enableUseGlobalMaxCheckoutOffset) {
if ($maxCheckoutOffset === '') {
$this->errors[] = $this->l('Maximum checkout offset is a required field.');
} elseif (!$maxCheckoutOffset || !Validate::isUnsignedInt($maxCheckoutOffset)) {
$this->errors[] = $this->l('Maximum checkout offset is invalid.');
}
}
@@ -445,15 +445,15 @@ class AdminAddHotelController extends ModuleAdminController
}
if (empty($this->errors)) {
if (!$enableUseGlobalMaxBookingOffset && !$enableUseGlobalMinBookingOffset) {
if ($maxBookingOffset && $maxBookingOffset <= $minBookingOffset) {
$this->errors[] = $this->l('Field Maximum booking offset cannot be be less than or equal to Minimum booking offset.');
if (!$enableUseGlobalMaxCheckoutOffset && !$enableUseGlobalMinBookingOffset) {
if ($maxCheckoutOffset && $maxCheckoutOffset <= $minBookingOffset) {
$this->errors[] = $this->l('Field Maximum checkout offset cannot be be less than or equal to Minimum booking offset.');
}
} else {
if (!$enableUseGlobalMaxBookingOffset && $maxBookingOffset <= Configuration::get('PS_MIN_BOOKING_OFFSET')) {
$this->errors[] = $this->l('Field Maximum booking offset cannot be be less than or equal to global Minimum booking offset.');
} else if (!$enableUseGlobalMinBookingOffset && $minBookingOffset >= Configuration::get('PS_MAX_BOOKING_OFFSET')) {
$this->errors[] = $this->l('Field Minimum booking offset cannot be be greater than or equal to Global Maximum booking offset.');
if (!$enableUseGlobalMaxCheckoutOffset && $maxCheckoutOffset <= Configuration::get('PS_MIN_BOOKING_OFFSET')) {
$this->errors[] = $this->l('Field Maximum checkout offset cannot be be less than or equal to global Minimum booking offset.');
} else if (!$enableUseGlobalMinBookingOffset && $minBookingOffset >= Configuration::get('PS_MAX_CHECKOUT_OFFSET')) {
$this->errors[] = $this->l('Field Minimum booking offset cannot be be greater than or equal to Global Maximum checkout offset.');
}
}
}
@@ -741,7 +741,7 @@ class AdminAddHotelController extends ModuleAdminController
$objHotelBranch->updateRoomTypeCategories();
if ($idHotel) {
// save maximum booking offset and minimum booking offset
// save Maximum checkout offset and minimum booking offset
$objHotelOrderRestrictDate = new HotelOrderRestrictDate();
$restrictDateInfo = HotelOrderRestrictDate::getDataByHotelId($newIdHotel);
if ($restrictDateInfo) {
@@ -749,11 +749,11 @@ class AdminAddHotelController extends ModuleAdminController
}
$objHotelOrderRestrictDate->id_hotel = $newIdHotel;
$objHotelOrderRestrictDate->use_global_max_booking_offset = $enableUseGlobalMaxBookingOffset;
$objHotelOrderRestrictDate->use_global_max_checkout_offset = $enableUseGlobalMaxCheckoutOffset;
$objHotelOrderRestrictDate->use_global_min_booking_offset = $enableUseGlobalMinBookingOffset;
if (!$enableUseGlobalMaxBookingOffset) {
$objHotelOrderRestrictDate->max_booking_offset = $maxBookingOffset;
if (!$enableUseGlobalMaxCheckoutOffset) {
$objHotelOrderRestrictDate->max_checkout_offset = $maxCheckoutOffset;
}
if (!$enableUseGlobalMinBookingOffset) {

View File

@@ -789,11 +789,11 @@ $(document).ready(function() {
});
}
$('input[name="enable_use_global_max_booking_offset"]').on('change', function () {
$('input[name="enable_use_global_max_checkout_offset"]').on('change', function () {
if (parseInt($(this).val())) {
$('input[name="max_booking_offset"]').closest('.form-group').hide(200);
$('input[name="max_checkout_offset"]').closest('.form-group').hide(200);
} else {
$('input[name="max_booking_offset"]').closest('.form-group').show(200);
$('input[name="max_checkout_offset"]').closest('.form-group').show(200);
}
});

View File

@@ -427,23 +427,23 @@
{if isset($hotel_info.id) && $hotel_info.id}
<div class="form-group">
<label class="control-label col-lg-3">
<span>{l s='Use Global maximum booking offset:' mod='hotelreservationsystem'}</span>
<span>{l s='Use Global Maximum checkout offset:' mod='hotelreservationsystem'}</span>
</label>
<div class="col-lg-6">
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" {if isset($smarty.post.enable_use_global_max_booking_offset)} {if $smarty.post.enable_use_global_max_booking_offset} checked="checked"{/if} {elseif isset($edit) && isset($order_restrict_date_info.use_global_max_booking_offset) && $order_restrict_date_info.use_global_max_booking_offset} checked="checked" {else if isset($order_restrict_date_info) && !$order_restrict_date_info} checked="checked" {/if} value="1" id="enable_use_global_max_booking_offset_on" name="enable_use_global_max_booking_offset">
<label for="enable_use_global_max_booking_offset_on">{l s='Yes' mod='hotelreservationsystem'}</label>
<input type="radio" {if isset($smarty.post.enable_use_global_max_booking_offset)} {if !$smarty.post.enable_use_global_max_booking_offset} checked="checked"{/if} {elseif isset($edit) && isset($order_restrict_date_info.use_global_max_booking_offset) && !$order_restrict_date_info.use_global_max_booking_offset} checked="checked" {/if} value="0" id="enable_use_global_max_booking_offset_off" name="enable_use_global_max_booking_offset">
<label for="enable_use_global_max_booking_offset_off">{l s='No' mod='hotelreservationsystem'}</label>
<input type="radio" {if isset($smarty.post.enable_use_global_max_checkout_offset)} {if $smarty.post.enable_use_global_max_checkout_offset} checked="checked"{/if} {elseif isset($edit) && isset($order_restrict_date_info.use_global_max_checkout_offset) && $order_restrict_date_info.use_global_max_checkout_offset} checked="checked" {else if isset($order_restrict_date_info) && !$order_restrict_date_info} checked="checked" {/if} value="1" id="enable_use_global_max_checkout_offset_on" name="enable_use_global_max_checkout_offset">
<label for="enable_use_global_max_checkout_offset_on">{l s='Yes' mod='hotelreservationsystem'}</label>
<input type="radio" {if isset($smarty.post.enable_use_global_max_checkout_offset)} {if !$smarty.post.enable_use_global_max_checkout_offset} checked="checked"{/if} {elseif isset($edit) && isset($order_restrict_date_info.use_global_max_checkout_offset) && !$order_restrict_date_info.use_global_max_checkout_offset} checked="checked" {/if} value="0" id="enable_use_global_max_checkout_offset_off" name="enable_use_global_max_checkout_offset">
<label for="enable_use_global_max_checkout_offset_off">{l s='No' mod='hotelreservationsystem'}</label>
<a class="slide-button btn"></a>
</span>
<div class="help-block">{l s='Global maximum booking offset:' mod='hotelreservationsystem'} {$PS_MAX_BOOKING_OFFSET}</div>
<div class="help-block">{l s='Global Maximum checkout offset:' mod='hotelreservationsystem'} {$PS_MAX_CHECKOUT_OFFSET}</div>
</div>
</div>
<div class="form-group" {if isset($smarty.post.enable_use_global_max_booking_offset)} {if !$smarty.post.enable_use_global_max_booking_offset} style="display:block;" {else} style="display:none;" {/if} {elseif isset($order_restrict_date_info.use_global_max_booking_offset) && !$order_restrict_date_info.use_global_max_booking_offset} style="display:block;" {else} style="display:none;" {/if}>
<label class="control-label col-sm-3 required" for="max_booking_offset">{l s='Maximum booking offset :' mod='hotelreservationsystem'}</label>
<div class="form-group" {if isset($smarty.post.enable_use_global_max_checkout_offset)} {if !$smarty.post.enable_use_global_max_checkout_offset} style="display:block;" {else} style="display:none;" {/if} {elseif isset($order_restrict_date_info.use_global_max_checkout_offset) && !$order_restrict_date_info.use_global_max_checkout_offset} style="display:block;" {else} style="display:none;" {/if}>
<label class="control-label col-sm-3 required" for="max_checkout_offset">{l s='Maximum checkout offset :' mod='hotelreservationsystem'}</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="max_booking_offset" name="max_booking_offset" value="{if isset($smarty.post.max_booking_offset)}{$smarty.post.max_booking_offset}{elseif isset($order_restrict_date_info.max_booking_offset)}{$order_restrict_date_info.max_booking_offset|escape:'htmlall':'UTF-8'}{/if}" />
<input type="text" class="form-control" id="max_checkout_offset" name="max_checkout_offset" value="{if isset($smarty.post.max_checkout_offset)}{$smarty.post.max_checkout_offset}{elseif isset($order_restrict_date_info.max_checkout_offset)}{$order_restrict_date_info.max_checkout_offset|escape:'htmlall':'UTF-8'}{/if}" />
</div>
</div>
<div class="form-group">

View File

@@ -396,7 +396,7 @@ $(document).ready(function() {
if (selectedDateFrom < start_date
|| selectedDateTo < start_date
|| (max_order_date && max_order_date < selectedDateTo)
|| (max_order_date && (max_order_date < selectedDateTo))
) {
$('#check_in_time').val('');
$('#check_out_time').val('');