diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index f2e2a698c..da1ae5c0f 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -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']; diff --git a/controllers/admin/AdminOrderPreferencesController.php b/controllers/admin/AdminOrderPreferencesController.php index 4fcf356da..15ea3c8d4 100644 --- a/controllers/admin/AdminOrderPreferencesController.php +++ b/controllers/admin/AdminOrderPreferencesController.php @@ -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\'.'); } } diff --git a/modules/hotelreservationsystem/classes/HotelBranchInformation.php b/modules/hotelreservationsystem/classes/HotelBranchInformation.php index 2d600ee25..d831ca6e3 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchInformation.php +++ b/modules/hotelreservationsystem/classes/HotelBranchInformation.php @@ -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 diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 1dd4a74ed..5f2c59868 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -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'); diff --git a/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php b/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php index 0aed9c994..c2f7b99a9 100644 --- a/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php +++ b/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php @@ -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'); } /** diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index dd42c0245..d8f05fd2a 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -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, diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 75ad9dee4..89f4df737 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -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) { diff --git a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js index a4ef119f4..ade1d9abc 100644 --- a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js +++ b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js @@ -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); } }); diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index 937cada04..1f5ea4578 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -427,23 +427,23 @@ {if isset($hotel_info.id) && $hotel_info.id}
- - - - + + + + -
{l s='Global maximum booking offset:' mod='hotelreservationsystem'} {$PS_MAX_BOOKING_OFFSET}
+
{l s='Global Maximum checkout offset:' mod='hotelreservationsystem'} {$PS_MAX_CHECKOUT_OFFSET}
-
- +
+
- +
diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index 9f0a4330c..ca2d6919d 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -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('');