Merge pull request #1149 from vishal-singh-webkul/gli-2193

Updated: Preparation time to minimum booking offset and its definition in the admin order preferences controller.
This commit is contained in:
Rohit Jain
2024-07-11 18:22:07 +05:30
committed by GitHub
4 changed files with 10 additions and 10 deletions

View File

@@ -98,8 +98,8 @@ class AdminOrderPreferencesControllerCore extends AdminController
'class' => 'fixed-width-xxl readonly',
),
'GLOBAL_PREPARATION_TIME' => array(
'title' => $this->l('Preparation time'),
'hint' => $this->l('Number of days required to prepare a room for a guest\'s stay. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'),
'title' => $this->l('Minimum booking offset'),
'hint' => $this->l('The minimum booking offset is the minimum number of days before the check-in date that a guest must book a room. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'),
'desc' => $this->l('Set to 0 to disable this feature.'),
'type' => 'text',
'class' => 'fixed-width-xl',
@@ -346,9 +346,9 @@ class AdminOrderPreferencesControllerCore extends AdminController
}
if ($globalPreparationTime === '') {
$this->errors[] = Tools::displayError('Field \'Preparation time\' can not be empty.');
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' can not be empty.');
} elseif ($globalPreparationTime !== '0' && !Validate::isUnsignedInt($globalPreparationTime)) {
$this->errors[] = Tools::displayError('Field \'Preparation time\' is invalid.');
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' is invalid.');
}
}

View File

@@ -1228,13 +1228,13 @@ class HotelBranchInformation extends ObjectModel
if (!$this->use_global_preparation_time) {
if ($this->preparation_time === '') {
$message = Tools::displayError('Preparation time is a required.');
$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('Preparation time is invalid.');
$message = Tools::displayError('Minimum booking offset is invalid.');
if ($die) {
throw new PrestaShopException($message);
}

View File

@@ -345,9 +345,9 @@ class AdminAddHotelController extends ModuleAdminController
if (!$enableUseGlobalPreparationTime) {
if ($preparationTime === '') {
$this->errors[] = $this->l('Preparation time is a required field.');
$this->errors[] = $this->l('Minimum booking offset is a required field.');
} elseif ($preparationTime !== '0' && !Validate::isUnsignedInt($preparationTime)) {
$this->errors[] = $this->l('Preparation time is invalid.');
$this->errors[] = $this->l('Minimum booking offset is invalid.');
}
}
}

View File

@@ -368,7 +368,7 @@
</div>
<div class="form-group">
<label class="control-label col-lg-3">
<span>{l s='Use Global preparation time :' mod='hotelreservationsystem'}</span>
<span>{l s='Use Global minimum booking offset :' mod='hotelreservationsystem'}</span>
</label>
<div class="col-lg-6">
<span class="switch prestashop-switch fixed-width-lg">
@@ -382,7 +382,7 @@
</div>
</div>
<div class="form-group" {if isset($smarty.post.enable_use_global_preparation_time)}{if !$smarty.post.enable_use_global_preparation_time}style="display:block;"{else}style="display:none;"{/if}{elseif isset($order_restrict_date_info.use_global_preparation_time) && !$order_restrict_date_info.use_global_preparation_time}style="display:block;" {else} style="display:none;" {/if}>
<label class="control-label col-sm-3 required" for="preparation_time">{l s='Preparation time :' mod='hotelreservationsystem'}</label>
<label class="control-label col-sm-3 required" for="preparation_time">{l s='Minimum booking offset :' mod='hotelreservationsystem'}</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="preparation_time" name="preparation_time" value="{if isset($smarty.post.preparation_time)}{$smarty.post.preparation_time|escape:'html':'UTF-8'}{elseif isset($edit) && isset($order_restrict_date_info.preparation_time)}{$order_restrict_date_info.preparation_time|escape:'htmlall':'UTF-8'}{/if}" />
</div>