Merge branch 'develop' into gli-2941

This commit is contained in:
amit sharma
2026-09-16 20:02:11 +05:30
98 changed files with 1686 additions and 302 deletions

View File

@@ -302,11 +302,11 @@
<div class="col-lg-6">
{if isset($hotels) && $hotels}
<div class="panel">
<h3>{l s='Hotel Permissions'}</h3>
<h3>{l s='Property Permissions'}</h3>
<table class="table" id="table_hotel_{$profile.id_profile}">
<thead>
<tr>
<th>{l s='Hotel'}</th>
<th>{l s='Property'}</th>
<th>
<input type="checkbox"{if $access_edit == 1} class="changeHotelAccess" data-rel="-1||all||{$profile.id_profile}"{else} disabled="disabled"{/if}/>
{l s='All'}

View File

@@ -102,7 +102,7 @@
<td>{dateFormat date=$room['date_from'] full=$is_full_date} - {dateFormat date=$room['date_to'] full=$is_full_date}</td>
<td>
<span>
{if $room['adults']}{$room['adults']}{/if} {if $room['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$room['children']}}, {$room['children']} {if $room['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
{if $stay['adults']}{$stay['adults']}{/if} {if $stay['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$stay['children']}}, {$stay['children']} {if $stay['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</span>
</td>
<td>{displayWtPriceWithCurrency price=$room['feature_price_tax_excl'] currency=$currency}</td>
@@ -131,7 +131,7 @@
<span aria-hidden="true">&times;</span>
</button>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active" ><a href="#room_type_service_product_desc_{$room['id']}" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
<li role="presentation" class="active" ><a href="#room_type_service_product_desc_{$stay['id']}" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
</ul>
<div class="tab-content panel">
{if isset($room['selected_services']) && $room['selected_services']}

View File

@@ -263,7 +263,7 @@
<div class="form-group" id="associated_hotel_tree" {if !Product::isSellableWithHotel($product->id)}style="display:none;"{/if}>
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
<label class="control-label col-lg-2" for="hotel_block">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select hotels for which this service will be available.'}">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select properties for which this service will be available.'}">
{l s='Associated Hotels'}
</span>
</label>
@@ -276,7 +276,7 @@
<div class="form-group" id="associated_hotel_rooms_tree" {if !Product::isSellableWithRoomType($product->id) && $product->selling_preference_type != 0}style="display:none;"{/if}>
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
<label class="control-label col-lg-2" for="hotel_room_block">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select room type and hotels for which this service will be available.'}">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select Room type and properties for which this service will be available.'}">
{l s='Associated Room Types'}
</span>
</label>

View File

@@ -27,7 +27,7 @@
<table class="table" id="customer_cart_details">
<thead>
<tr>
<th class="center"><span ><p>{l s='Room'}</p></span></th>
<th class="center"><span ><p>{l s='Unit'}</p></span></th>
<th class="center"><span >{l s='Image'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Booking check-in and check-out dates'}">{l s='Duration'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Number of adults and children'}">{l s='Occupancy'}</span></th>

View File

@@ -767,7 +767,7 @@
{if $hotel_booking}
<div class="panel">
<div class="panel-heading">
<i class="icon-bed"></i> &nbsp;{l s='Rooms Booking Detail'} <span class="badge">{$order_detail_data|@count}</span>
<i class="icon-bed"></i> &nbsp;{l s='Booking Detail'} <span class="badge">{$order_detail_data|@count}</span>
{if $can_edit && ($currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED') && $currentState->id != Configuration::get('PS_OS_NO_SHOW'))}
<button type="button" id="add_room" class="btn btn-primary pull-right">
<i class="icon-plus-sign"></i> {l s='Add Rooms'}

View File

@@ -45,7 +45,7 @@
<th></th>
<th>{l s='Room No.'}</th>
<th>{l s='Room Type'}</th>
<th>{l s='Hotel Name'}</th>
<th>{l s='Property Name'}</th>
<th>{l s='Duration'}</th>
<th>{l s='Total Price (Tax incl.)'}</th>
</tr>

View File

@@ -23,7 +23,7 @@
{if isset($product->id)}
<div id="product-configuration" class="panel product-tab">
<input type="hidden" name="submitted_tabs[]" value="Configuration" />
<h3 class="tab"> <i class="icon-AdminAdmin"></i> {l s='Rooms'}</h3>
<h3 class="tab"> <i class="icon-AdminAdmin"></i> {$htl_room_type['selling_object_plural_name']}</h3>
<input type="hidden" id="checkConfSubmit" value="0" name="checkConfSubmit">
@@ -34,35 +34,35 @@
<th class="center"></th>
<th class="col-sm-2 center">
<label class="control-label required">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter room number. For eg. A-101, A-102 etc. Invalid characters <>;=#{}'}">
{l s='Room No.'}
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter %s number. For eg. A-101, A-102 etc. Invalid characters <>;=#{}' sprintf=$htl_room_type['selling_object_name']}">
{l s='%s No.' sprintf=$htl_room_type['selling_object_name']}
</span>
</label>
</th>
<th class="col-sm-2 center">
<label class="control-label">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter floor of the room. For eg. First, Second etc. Invalid characters <>;=#{}'}">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter floor of the %s. For eg. First, Second etc. Invalid characters <>;=#{}' sprintf=$htl_room_type['selling_object_name']}">
{l s='Floor'}
</span>
</label>
</th>
<th class="col-sm-2 center">
<label class="control-label">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Select status of the room.'}">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Select status of the %s.' sprintf=$htl_room_type['selling_object_name']}">
{l s='Status'}
</span>
</label>
</th>
<th class="col-sm-3 center">
<label class="control-label">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter extra information about this room. Leave empty if not required.'}">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter extra information about this %s. Leave empty if not required.' sprintf=$htl_room_type['selling_object_plural_name']}">
{l s='Extra Information'}
</span>
</label>
</th>
<th class="col-sm-2 center">
<label class="control-label">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Set date ranges when room is set to Temporarily Inactive.'}">
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Set date ranges when %s is set to Temporarily Inactive.' sprintf=$htl_room_type['selling_object_plural_name']}">
{l s='Disable Dates'}
</span>
</label>
@@ -70,8 +70,8 @@
<th class="col-sm-1 center">
<label class="control-label">
<span class="label-tooltip" data-toggle="tooltip"
data-original-title="{l s='Manage connected rooms for this room'}">
{l s='Connected Rooms'}
data-original-title="{l s='Manage connected rooms for this %s' sprintf=$htl_room_type['selling_object_name']}">
{l s='Connected %s' sprintf=$htl_room_type['selling_object_plural_name']}
</span>
</label>
</th>
@@ -224,14 +224,14 @@
<li class="divider"></li>
<li>
<a id="bulk-create-rooms-button" class="bulkCreateRoomModal" data-toggle="modal" data-target="#bulkCreateRoomModal" type="button" data-size="s" data-style="expand-right">
<i class="icon-plus"></i>&nbsp;{l s='Create Rooms'}
<i class="icon-plus"></i>&nbsp;{l s='Create %s' sprintf=$htl_room_type['selling_object_plural_name']}
</a>
</li>
</ul>
</div>
<button id="add-more-rooms-button" class="btn btn-default" type="button" data-size="s" data-style="expand-right">
<i class="icon icon-plus"></i>
{l s='Add More Rooms'}
{l s='Add More %s' sprintf=$htl_room_type['selling_object_plural_name']}
</button>
</div>
</div>
@@ -276,7 +276,7 @@
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<ul class="list-unstyled">
<li>{l s='Please save this room first to add dates.'}</li>
<li>{l s='Please save this %s first to add dates.' sprintf=$htl_room_type['selling_object_plural_name']}</li>
</ul>
</div>
</div>
@@ -348,7 +348,7 @@
<button type="button" class="close margin-right-10" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Bulk Update Rooms'}</h4>
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Bulk Update %s' sprintf=$htl_room_type['selling_object_plural_name']}</h4>
</div>
<div class="modal-body padding-top-20">
<div class="text-left errors-wrap" style="display: none;"></div>
@@ -424,13 +424,13 @@
<button type="button" class="close margin-right-10" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Bulk Create Rooms'}</h4>
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Bulk Create %s' sprintf=$htl_room_type['selling_object_plural_name']}</h4>
</div>
<div class="modal-body padding-top-20">
<div class="text-left errors-wrap" style="display: none;"></div>
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<p>{l s='If both the Room Prefix and Starting Room No. fields are left blank, the room name will be generated using the acronym of the Room Type name.'}</p>
<p>{l s='If both the %s Prefix and Starting %s No. fields are left blank, the %s name will be generated using the acronym of the Room Type name.' sprintf=array($htl_room_type['selling_object_name'], $htl_room_type['selling_object_plural_name'], $htl_room_type['selling_object_name'])}</p>
<p>
<strong>{l s='Example:'}</strong>
{l s='For the Room Type'}
@@ -441,7 +441,7 @@
</div>
<div class="form-group">
<label class="control-label col-lg-3">
<span>{l s='Room prefix'}</span>
<span>{l s='%s prefix' sprintf=$htl_room_type['selling_object_name']}</span>
</label>
<div class="col-lg-6">
<input type="text" name="bulk_create_room_prefix"/>
@@ -449,7 +449,7 @@
</div>
<div class="form-group">
<label class="control-label col-lg-3">
<span>{l s='Starting Room No.'}</span>
<span>{l s='Starting %s No.' sprintf=$htl_room_type['selling_object_name']}</span>
</label>
<div class="col-lg-6">
<input type="text" name="bulk_create_room_num"/>
@@ -457,7 +457,7 @@
</div>
<div class="form-group">
<label class="control-label required col-lg-3">
<span>{l s='Number of Rooms'}</span>
<span>{l s='Number of %s' sprintf=$htl_room_type['selling_object_plural_name']}</span>
</label>
<div class="col-lg-6">
<input type="text" name="bulk_create_room_qty"/>
@@ -593,13 +593,13 @@
<li class="enable_selected_dates btn btn-default">
<span class="enable_selected_dates">
<i class="icon-check"></i>
{l s='Make Room Available'}
{l s='Make %s Available' sprintf=$htl_room_type['selling_object_name']}
</span>
</li>
<li class="disabled_selected_dates btn btn-default">
<span class="disabled_selected_dates">
<i class="icon-ban"></i>
{l s='Disable Room'}
{l s='Disable %s' sprintf=$htl_room_type['selling_object_name']}
</span>
</li>
</ul>
@@ -1606,7 +1606,7 @@
$('#deactiveDatesModal').attr('data-room-row-index', roomRowIndex);
$('#deactiveDatesModal').attr('data-id-room', idRoom);
if ($.trim(roomNum) != '') {
roomNum = '( '+'{l s='Room No'}'+' '+roomNum+')';
roomNum = '( '+'{l s='%s No' sprintf=$htl_room_type['selling_object_plural_name']}'+' '+roomNum+')';
}
$('#deactiveDatesModal .disable_dates_room_num').html(roomNum);

View File

@@ -53,6 +53,119 @@
</div>
{/if}
<table class="table">
<thead>
<tr>
<th></th>
<th><span class="title_box">{l s='Feature'}</span></th>
<th><span class="title_box">{l s='Feature Image'}</span></th>
<!-- <th><span class="title_box"><u>{l s='or'}</u> {l s='Customized value'}</span></th> --><!-- by webkul -->
</tr>
</thead>
<tbody>
{foreach from=$available_features item=available_feature}
<tr>
{foreach from=$available_feature.featureValues item=value}
<td>
<input type="checkbox" class="checkbox select_hotel_feature" name="feature_{$available_feature.id_feature}_check" value="{$value.id_feature_value}" {if $available_feature.current_item == $value.id_feature_value}checked="checked"{/if}/>
</td>
<td>{$available_feature.name}</td>
<td>
<input type="hidden" id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value" value="{$value.id_feature_value}">
<img class="img img-responsive" width="15px" src="{$base_url}img/rf/{$value.value}" title="Stay image" />
</td>
{/foreach}
{*--<td>
{if sizeof($available_feature.featureValues)}
<select id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value"
onchange="$('.custom_{$available_feature.id_feature}_').val('');">
<option value="0">---</option>
{foreach from=$available_feature.featureValues item=value}
<option value="{$value.id_feature_value}"{if $available_feature.current_item == $value.id_feature_value}selected="selected"{/if} >
{$value.value|truncate:40}
</option>
{/foreach}
</select>
{else}
<input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" />
<span>{l s='N/A'} -
<a href="{$link->getAdminLink('AdminFeatures')|escape:'html':'UTF-8'}&amp;addfeature_value&amp;id_feature={$available_feature.id_feature}"
class="confirm_leave btn btn-link"><i class="icon-plus-sign"></i> {l s='Add pre-defined values first'} <i class="icon-external-link-sign"></i></a>
</span>
{/if} *}<!-- By Webkul -->
</td>
{* <td>
<div class="row lang-0" style='display: none;'>
<div class="col-lg-9">
<textarea class="custom_{$available_feature.id_feature}_ALL textarea-autosize" name="custom_{$available_feature.id_feature}_ALL"
cols="40" style='background-color:#CCF' rows="1" onkeyup="{foreach from=$languages key=k item=language}$('.custom_{$available_feature.id_feature}_{$language.id_lang}').val($(this).val());{/foreach}" >{$available_feature.val[1].value|escape:'html':'UTF-8'|default:""}</textarea>
</div>
{if $languages|count > 1}
<div class="col-lg-3">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{l s='ALL'}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li>
<a href="javascript:void(0);" onclick="restore_lng($(this),{$language.id_lang});">{$language.iso_code}</a>
</li>
{/foreach}
</ul>
</div>
{/if}
</div>
{foreach from=$languages key=k item=language}
{if $languages|count > 1}
<div class="row translatable-field lang-{$language.id_lang}">
<div class="col-lg-9">
{/if}
<textarea
class="custom_{$available_feature.id_feature}_{$language.id_lang} textarea-autosize"
name="custom_{$available_feature.id_feature}_{$language.id_lang}"
cols="40"
rows="1"
onkeyup="if (isArrowKey(event)) return ;$('#feature_{$available_feature.id_feature}_value').val(0);" >{$available_feature.val[$language.id_lang].value|escape:'html':'UTF-8'|default:""}</textarea>
{if $languages|count > 1}
</div>
<div class="col-lg-3">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:void(0);" onclick="all_languages($(this));">{l s='ALL'}</a></li>
{foreach from=$languages item=language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.iso_code}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/if}
{/foreach}
</td> *}<!-- By Webkul -->
</tr>
{foreachelse}
<tr>
<td colspan="3" style="text-align:center;"><i class="icon-warning-sign"></i> {l s='No features have been defined'}</td>
</tr>
{/foreach}
</tbody>
</table>
<a href="{$link->getAdminLink('AdminFeatures')|escape:'html':'UTF-8'}&amp;addfeature" class="btn btn-link confirm_leave button">
<i class="icon-plus-sign"></i> {l s='Add a new feature'} <i class="icon-external-link-sign"></i>
</a>
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&amp;submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel'}</a>
<button type="submit" name="submitAddproduct" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save'}</button>

View File

@@ -125,16 +125,16 @@
<div class="form-group" id="hotel_selection">
{if isset($htl_room_type)}
<label class="control-label col-sm-3 required">
{l s='Hotel'}
{l s='Property'}
</label>
<div class="col-sm-5">
<input type="text" class="form-control" value="{$htl_full_info['hotel_name']}" readonly>
<input type="hidden" name="id_hotel" value="{$htl_room_type['id_hotel']}">
<p class="help-block">{l s='Hotel once assigned cannot be reassigned'}</p>
<p class="help-block">{l s='Property once assigned cannot be reassigned'}</p>
</div>
{else}
<label class="control-label col-sm-3 required" for="hotel_place">
{l s='Select Hotel'}
{l s='Select Property'}
</label>
<div class="col-sm-5">
{if isset($htl_info) && $htl_info}
@@ -143,15 +143,32 @@
<option value="{$htl_dtl['id_hotel']}" >{$htl_dtl['hotel_name']}</option>
{/foreach}
</select>
<p class="help-block">{l s='Hotel once assigned cannot be reassigned'}</p>
<p class="help-block">{l s='Property once assigned cannot be reassigned'}</p>
{else}
<div class="control-label col-sm-3 text-danger">{l s='No hotel are available'}</div>
<div class="control-label col-sm-3 text-danger">{l s='No property are available'}</div>
{/if}
</div>
{/if}
</div>
{if isset($selling_object_info) && $selling_object_info}
<div class="form-group" id="room_type_selection">
<label class="control-label col-sm-3">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select the room selling type for this room type.'}">
{l s='Selling Object'}
</span>
</label>
<div class="col-sm-5">
<select name="id_selling_object" id="id_selling_object" class="form-control chosen" >
{foreach from=$selling_object_info item=selling_object_type}
<option value="{$selling_object_type['id_room_type_selling_object']}" {if isset($selected_room_type_selling_object) && $selling_object_type['id_room_type_selling_object'] == $selected_room_type_selling_object}selected{/if}>{$selling_object_type['name']}</option>
{/foreach}
</select>
</div>
</div>
{/if}
<div class="form-group hidden">
<label class="control-label col-lg-3" for="reference">
<span class="label-tooltip" data-toggle="tooltip"

View File

@@ -60,7 +60,7 @@
<div class="form-group">
<label class="control-label col-sm-3 required" for="max_los">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Enter maximum length of stay for the hotel. set 0 day for setting no limit on maximum length of stay.'}">{l s='Maximum length of stay'}</span>
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Enter maximum length of stay for the property. set 0 day for setting no limit on maximum length of stay.'}">{l s='Maximum length of stay'}</span>
</label>
<div class="col-sm-9">
<div class="row">

View File

@@ -901,6 +901,15 @@ abstract class PaymentModuleCore extends Module
$objBookingDetail->zipcode = $hotelAddress['postcode'];
$objBookingDetail->phone = $hotelAddress['phone'];
}
$objBookingDetail->property_type_name = $objHotelBranch->propertyTypeName;
}
// Save room selling object and property type names as they are at the time of order creation
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct, $idLang)) {
$objBookingDetail->selling_object_name = $roomTypeInfo['selling_object_name'];
$objBookingDetail->selling_object_plural_name = $roomTypeInfo['selling_object_plural_name'];
}
/*for saving details of the advance payment product wise*/

View File

@@ -56,6 +56,13 @@ class ProductCore extends ObjectModel
/** @var string Manufacturer name */
public $manufacturer_name;
/** @var string Room Type Selling Object name */
public $selling_object_name;
/** @var string Room Type Selling Object plural name */
public $selling_object_plural_name;
/** @var string Supplier name */
public $supplier_name;
@@ -250,6 +257,7 @@ class ProductCore extends ObjectModel
public $is_virtual;
public $booking_product;
public $id_pack_product_attribute;
public $id_selling_object;
public $cache_default_attribute;
/**
@@ -345,6 +353,7 @@ class ProductCore extends ObjectModel
'show_price' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'indexed' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'visibility' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isProductVisibility', 'values' => array('both', 'catalog', 'search', 'none'), 'default' => 'both'),
'id_selling_object' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => false),
'cache_default_attribute' => array('type' => self::TYPE_INT, 'shop' => true),
'advanced_stock_management' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'date_add' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDate'),
@@ -590,6 +599,9 @@ class ProductCore extends ObjectModel
$this->tax_name = 'deprecated'; // The applicable tax may be BOTH the product one AND the state one (moreover this variable is some deadcode)
$this->manufacturer_name = Manufacturer::getNameById((int)$this->id_manufacturer);
$this->supplier_name = Supplier::getNameById((int)$this->id_supplier);
$sellingObject = RoomTypeSellingObject::getRoomTypeSellingObjectBySellingObjectId((int)$this->id_selling_object, (int)$id_lang);
$this->selling_object_name = $sellingObject ? $sellingObject['name'] : null;
$this->selling_object_plural_name = $sellingObject ? $sellingObject['plural_name'] : null;
$address = null;
$id_address = Cart::getIdAddressForTaxCalculation($this->id);
$this->tax_rate = $this->getTaxesRate(new Address($id_address));

View File

@@ -0,0 +1,95 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a 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
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
class RoomTypeSellingObjectCore extends ObjectModel
{
public $active;
public $date_add;
public $date_upd;
public $name;
public $plural_name;
public static $definition = array(
'table' => 'room_type_selling_object',
'primary' => 'id_room_type_selling_object',
'multilang' => true,
'fields' => array(
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true),
'plural_name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true),
),
);
public function isUsed()
{
return (bool) Db::getInstance()->getValue(
'SELECT COUNT(*) FROM `'._DB_PREFIX_.'product` WHERE `id_selling_object` = '.(int) $this->id
);
}
public static function getRoomTypeSellingObjectBySellingObjectId($idSellingObject = null, $idLang = null)
{
if (!$idLang) {
$idLang = Context::getContext()->language->id;
}
$cache_key = 'RoomTypeSellingObject::getRoomTypeSellingObjectBySellingObjectId_'.(int)$idSellingObject.'_'.(int)$idLang;
if (!Cache::isStored($cache_key)) {
$sql = 'SELECT hrstl.`name`, hrstl.`plural_name`
FROM `'._DB_PREFIX_.'room_type_selling_object` hrst
LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object_lang` hrstl
ON (hrst.`id_room_type_selling_object` = hrstl.`id_room_type_selling_object`
AND hrstl.`id_lang` = '.(int)$idLang.')
WHERE hrst.`id_room_type_selling_object` = '.(int)$idSellingObject;
$res = Db::getInstance()->getRow($sql);
Cache::store($cache_key, $res);
}
return Cache::retrieve($cache_key);
}
public static function getRoomTypeSellingObjects($idLang = null, $active = true)
{
if (!$idLang) {
$idLang = Context::getContext()->language->id;
}
$cache_key = 'RoomTypeSellingObject::getRoomTypeSellingObjects'.(int)$idLang.'_'.(int)$active;
if (!Cache::isStored($cache_key)) {
$sql = 'SELECT hrst.`id_room_type_selling_object` AS `id_room_type_selling_object`, hrstl.`name`, hrstl.`plural_name`
FROM `'._DB_PREFIX_.'room_type_selling_object` hrst
LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object_lang` hrstl
ON (hrst.`id_room_type_selling_object` = hrstl.`id_room_type_selling_object`
AND hrstl.`id_lang` = '.(int)$idLang.')'.
($active ? ' WHERE hrst.`active` = 1' : '').
' ORDER BY hrstl.`name` ASC';
$res = Db::getInstance()->executeS($sql);
Cache::store($cache_key, $res);
}
return Cache::retrieve($cache_key);
}
}

View File

@@ -314,6 +314,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$service_product_data = array();
$room_additinal_services = array();
$formattedHotelAddress = '';
$propertyType = '';
if (Module::isInstalled('hotelreservationsystem')) {
$obj_htl_bk_dtl = new HotelBookingDetail();
$objServiceProductOrderDetail = new ServiceProductOrderDetail();
@@ -392,6 +393,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$unit_price_tax_incl = $order_details_obj->unit_price_tax_incl;
$cart_htl_data[$type_key]['hotel_name'] = $data_v['hotel_name'];
$propertyType = $data_v['property_type_name'];
$cart_htl_data[$type_key]['name'] = $order_details_obj->product_name;
$cart_htl_data[$type_key]['unit_price_tax_excl'] = $unit_price_tax_excl;
$cart_htl_data[$type_key]['unit_price_tax_incl'] = $unit_price_tax_incl;
@@ -628,6 +631,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
'delivery_address' => $formatted_delivery_address,
'invoice_address' => $formatted_invoice_address,
'hotel_address' => $formattedHotelAddress,
'property_type' => $propertyType,
'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address),
'tax_excluded_display' => $tax_excluded_display,
'display_product_images' => $display_product_images,

View File

@@ -255,7 +255,7 @@ class AdminDashboardControllerCore extends AdminController
$objHotelInfo = new HotelBranchInformation();
$idsHotel = $objHotelInfo->getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
$hotelOptions = array(array('id_hotel' => false, 'hotel_name' => $this->l('All Hotels')));
$hotelOptions = array(array('id_hotel' => false, 'hotel_name' => $this->l('All Properties')));
foreach ($idsHotel as $idHotel) {
$objHotelBranchInfo = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);

View File

@@ -86,7 +86,7 @@ class AdminImagesControllerCore extends AdminController
'orderby' => false
),
'hotels' => array(
'title' => $this->l('Hotels'),
'title' => $this->l('Properties'),
'align' => 'center',
'type' => 'bool',
'active' => 'hotels',
@@ -301,7 +301,7 @@ class AdminImagesControllerCore extends AdminController
),
array(
'type' => 'switch',
'label' => $this->l('Hotels'),
'label' => $this->l('Properties'),
'name' => 'hotels',
'required' => false,
'is_bool' => true,
@@ -503,7 +503,7 @@ class AdminImagesControllerCore extends AdminController
$types = array(
'categories' => $this->l('Categories'),
'products' => $this->l('Room Types/Products'),
'hotels' => $this->l('Hotels'),
'hotels' => $this->l('Properties'),
// 'manufacturers' => $this->l('Manufacturers'),
// 'suppliers' => $this->l('Suppliers'),
// 'scenes' => $this->l('Scenes'),

View File

@@ -78,7 +78,7 @@ class AdminImportControllerCore extends AdminController
{
$this->bootstrap = true;
$this->entities = array(
$this->l('Hotels'),
$this->l('Properties'),
$this->l('Room Types'),
$this->l('Rooms'),
$this->l('Categories'),
@@ -108,7 +108,7 @@ class AdminImportControllerCore extends AdminController
'parent' => Configuration::get('PS_HOME_CATEGORY'),
);
break;
case $this->entities[$this->l('Hotels')]:
case $this->entities[$this->l('Properties')]:
$this->required_fields = array(
'hotel_name',
'phone',
@@ -132,7 +132,7 @@ class AdminImportControllerCore extends AdminController
'no' => array('label' => $this->l('Ignore this column')),
'id' => array('label' => $this->l('ID')),
'active' => array('label' => $this->l('Active (0/1)')),
'hotel_name' => array('label' => $this->l('Hotel Name *')),
'hotel_name' => array('label' => $this->l('Property Name *')),
'short_description' => array('label' => $this->l('Short Description')),
'description' => array('label' => $this->l('Description')),
'phone' => array('label' => $this->l('Mobile phone *')),
@@ -146,7 +146,7 @@ class AdminImportControllerCore extends AdminController
'city' => array('label' => $this->l('City *')),
'postcode' => array('label' => $this->l('Zip Code *')),
'fax' => array('label' => $this->l('Fax')),
'policies' => array('label' => $this->l('Hotel Policies')),
'policies' => array('label' => $this->l('Property 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_checkout_offset' => array('label' => $this->l('Maximum checkout offset')),
@@ -168,7 +168,7 @@ class AdminImportControllerCore extends AdminController
'id' => array('label' => $this->l('ID')),
'active' => array('label' => $this->l('Active (0/1)')),
'name' => array('label' => $this->l('Name *')),
'id_hotel' => array('label' => $this->l('Hotel ID *')),
'id_hotel' => array('label' => $this->l('Property ID *')),
'price' => array('label' => $this->l('Pre-tax retail price')),
'wholesale_price' => array('label' => $this->l('Pre-tax operating cost')),
'id_tax_rules_group' => array('label' => $this->l('Tax rule ID')),
@@ -1472,8 +1472,8 @@ class AdminImportControllerCore extends AdminController
}
}
} else {
$this->warnings[] = $this->l('Hotel creation for the ').$objCountry->name.
$this->l(' is currently unavailable. Kindly activate the country for hotel creation.');
$this->warnings[] = $this->l('Property creation for the ').$objCountry->name.
$this->l(' is currently unavailable. Kindly activate the country for property creation.');
}
}
}
@@ -3273,7 +3273,7 @@ class AdminImportControllerCore extends AdminController
}
}
break;
case $this->entities[$this->l('Hotels')]:
case $this->entities[$this->l('Properties')]:
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_info_lang`');
Db::getInstance()->execute('DELETE c, cl FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.id_category = cl.id_category
@@ -3462,7 +3462,7 @@ class AdminImportControllerCore extends AdminController
$import_type = false;
Db::getInstance()->disableCache();
switch ((int)Tools::getValue('entity')) {
case $this->entities[$import_type = $this->l('Hotels')]:
case $this->entities[$import_type = $this->l('Properties')]:
$this->hotelImport();
$this->clearSmartyCache();
break;

View File

@@ -330,7 +330,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
),
array(
'value' => Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_HOTEL,
'name' => $this->l('Hotel Address')
'name' => $this->l('Property Address')
),
array(
'value' => Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOM,
@@ -374,8 +374,8 @@ class AdminOrderPreferencesControllerCore extends AdminController
'identifier' => 'value',
'js' => "changeStandardProductAddressType()",
'hint' => $this->l('Select address for standard product tax calculation, this will be used to calculate the tax for the standard product price.'),
'desc' => $this->l('The selected address will be used to calculate tax for standard products. To change the hotel address, update the "Primary Hotel" in the').
'<a href="'.$this->context->link->getAdminLink('AdminHotelGeneralSettings').'"> '.$this->l('Hotel General Configuration.').'</a>'
'desc' => $this->l('The selected address will be used to calculate tax for standard products. To change the property address, update the "Primary Property" in the').
'<a href="'.$this->context->link->getAdminLink('AdminHotelGeneralSettings').'"> '.$this->l('Property General Configuration.').'</a>'
),
'PS_STANDARD_PRODUCT_ORDER_ADDRESS' => array(
'title' => $this->l('Custom address for tax calculation'),

View File

@@ -169,7 +169,7 @@ class AdminOrdersControllerCore extends AdminController
'visible_default' => true
),
'hotel_name' => array(
'title' => $this->l('Hotel'),
'title' => $this->l('Property Name'),
'type' => 'select',
'filter_key' => 'hbd!id_hotel',
'list' => $this->hotelsArray,
@@ -5585,11 +5585,15 @@ class AdminOrdersControllerCore extends AdminController
$objBookingDetail->email = $objHotelBranch->email;
$objBookingDetail->check_in_time = $objHotelBranch->check_in;
$objBookingDetail->check_out_time = $objHotelBranch->check_out;
$objBookingDetail->property_type_name = $objHotelBranch->propertyTypeName;
}
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct, $idLang)) {
$objBookingDetail->adults = $objCartBookingData->adults;
$objBookingDetail->children = $objCartBookingData->children;
$objBookingDetail->child_ages = $objCartBookingData->child_ages;
$objBookingDetail->selling_object_name = $roomTypeInfo['selling_object_name'];
$objBookingDetail->selling_object_plural_name = $roomTypeInfo['selling_object_plural_name'];
}
if ($objBookingDetail->save()) {

View File

@@ -179,7 +179,7 @@ class AdminPPreferencesControllerCore extends AdminController
),
'PS_BACKOFFICE_ROOM_BOOKING_TYPE' => array(
'title' => $this->l('In back-office, add rooms to cart with'),
'hint' => $this->l('In Room occupancy, while adding rooms in cart customer has to select per room occupancy and in room quantity customer only has to select number of rooms.'),
'hint' => $this->l('In Room occupancy, while adding room in cart customer has to select per room occupancy and in rooms quantity customer only has to select number of rooms.'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
@@ -437,14 +437,6 @@ class AdminPPreferencesControllerCore extends AdminController
Db::getInstance()->execute($sql);
}
if (Tools::getValue('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
$_POST['PS_FRONT_ROOM_UNIT_SELECTION_TYPE'] = HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
}
if (Tools::getValue('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
$_POST['PS_BACKOFFICE_ROOM_BOOKING_TYPE'] = HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
}
if (Tools::getIsset('PS_CATALOG_MODE')) {
Tools::clearSmartyCache();
Media::clearCache();

View File

@@ -289,7 +289,7 @@ class AdminProductsControllerCore extends AdminController
}
$this->fields_list['hotel_name'] = array(
'title' => $this->l('Hotel'),
'title' => $this->l('Property'),
'type' => 'select',
'multiple' => true,
'operator' => 'or',
@@ -2204,6 +2204,8 @@ class AdminProductsControllerCore extends AdminController
return false;
}
$this->assignRoomType($object);
// update position in category
$object->setPositionInCategory(Tools::getValue('category_position'));
@@ -2368,6 +2370,7 @@ class AdminProductsControllerCore extends AdminController
$saveShort = Tools::getValue('description_short');
$_POST['description_short'] = strip_tags(Tools::getValue('description_short'));
}
$_POST['id_selling_object'] = Tools::getValue('id_selling_object') ?? 0;
// Check description short size without html
$limit = (int)Configuration::get('PS_SHORT_DESC_LIMIT');
@@ -3134,8 +3137,12 @@ class AdminProductsControllerCore extends AdminController
if (Validate::isLoadedObject($product)) {
if ($id_hotel = Tools::getValue('id_hotel')) {
$objRoomType = new HotelRoomType();
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($product->id)) {
$objRoomType = new HotelRoomType((int)$roomTypeInfo['id']);
}
$objRoomType->id_product = $product->id;
$objRoomType->id_hotel = $id_hotel;
$objRoomType->id_selling_object = (int)$product->id_selling_object;
$objRoomType->save();
}
}
@@ -4513,6 +4520,12 @@ class AdminProductsControllerCore extends AdminController
$data->assign('htl_full_info', $hotelFullInfo);
}
$roomTypeSellingObjects = RoomTypeSellingObject::getRoomTypeSellingObjects($this->context->language->id);
$data->assign('selling_object_info', $roomTypeSellingObjects);
if (!empty($product->id_selling_object)) {
$data->assign('selected_room_type_selling_object', $product->id_selling_object);
}
$this->tpl_form_vars['product'] = $product;
$this->tpl_form_vars['custom_form'] = $data->fetch();
}
@@ -5517,15 +5530,15 @@ class AdminProductsControllerCore extends AdminController
if (!empty($roomNumber = trim(Tools::getValue('num')))
&& !Validate::isUnsignedInt($roomNumber)
) {
$this->errors[] = Tools::displayError('Invalid Starting Room No.');
$this->errors[] = sprintf(Tools::displayError('Invalid Starting %s No.') , $roomTypeInfo['selling_object_name']);
}
if (!($roomQuantity = Tools::getValue('qty'))) {
$this->errors[] = Tools::displayError('Number of rooms is required.');
$this->errors[] = sprintf(Tools::displayError('Number of %s is required.') ,$roomTypeInfo['selling_object_name']);
} else if (!Validate::isUnsignedInt($roomQuantity) || $roomQuantity < 1) {
$this->errors[] = Tools::displayError('Invalid value for number of rooms.');
$this->errors[] = sprintf(Tools::displayError('Invalid value for number of %s.') ,$roomTypeInfo['selling_object_name']);
} else if ($roomQuantity > 50) {
$this->errors[] = Tools::displayError('You cannot create more than 50 rooms at a time.');
$this->errors[] = sprintf(Tools::displayError('You cannot create more than 50 %s at a time.'), $roomTypeInfo['selling_object_name']);
}
if (trim($comment = Tools::getValue('room_comment'))) {
@@ -5538,7 +5551,7 @@ class AdminProductsControllerCore extends AdminController
$disableDates = Tools::getValue('disable_dates');
$roomsInfo['disable_dates_json'] = json_encode($disableDates);
if (!$disableDates) {
$this->errors[] = Tools::displayError('Please add at least one date range for updating the rooms status to temporary inactive.');
$this->errors[] = sprintf(Tools::displayError('Please add at least one date range for updating the %s status to temporary inactive.') , $roomTypeInfo['selling_object_name']);
} else {
$hasMissingRowError = false;
foreach ($disableDates as $key => $dateRange) {

View File

@@ -0,0 +1,230 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a 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
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
class AdminRoomTypeSellingObjectsController extends AdminController
{
public function __construct()
{
$this->bootstrap = true;
$this->table = 'room_type_selling_object';
$this->className = 'RoomTypeSellingObject';
$this->identifier = 'id_room_type_selling_object';
$this->lang = true;
$this->context = Context::getContext();
$this->toolbar_title = $this->l('Room Type Selling Objects');
parent::__construct();
$this->fields_list = array(
'id_room_type_selling_object' => array(
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs',
),
'name' => array(
'title' => $this->l('Name'),
'align' => 'left',
),
'plural_name' => array(
'title' => $this->l('Plural Name'),
'align' => 'left',
),
'active' => array(
'title' => $this->l('Status'),
'align' => 'center',
'active' => 'status',
'type' => 'bool',
'orderby' => false,
),
);
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->bulk_actions = array(
'delete' => array(
'text' => $this->l('Delete selected'),
'confirm' => $this->l('Delete selected items?'),
'icon' => 'icon-trash',
),
);
}
public function initPageHeaderToolbar()
{
if (!$this->display || $this->display == 'list') {
$this->page_header_toolbar_btn['new_room_selling_type'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add new Selling Object', null, null, false),
'icon' => 'process-icon-new',
);
}
parent::initPageHeaderToolbar();
}
public function renderForm()
{
if (!$this->loadObject(true)) {
return;
}
$this->fields_form = array(
'legend' => array(
'title' => $this->l('Room Type Selling Object'),
'icon' => 'icon-tags',
),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Name'),
'name' => 'name',
'lang' => true,
'required' => true,
'hint' => $this->l('Displayed name for this room type selling object.'),
),
array(
'type' => 'text',
'label' => $this->l('Plural Name'),
'name' => 'plural_name',
'lang' => true,
'required' => true,
'hint' => $this->l('Displayed name when more than one is booked.'),
),
array(
'type' => 'switch',
'label' => $this->l('Enabled'),
'name' => 'active',
'is_bool' => true,
'default_value' => 1,
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled'),
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled'),
),
),
),
),
'submit' => array(
'title' => $this->l('Save'),
),
'buttons' => array(
'save-and-stay' => array(
'title' => $this->l('Save and stay'),
'name' => 'submitAdd'.$this->table.'AndStay',
'type' => 'submit',
'class' => 'btn btn-default pull-right',
'icon' => 'process-icon-save',
),
),
);
return parent::renderForm();
}
public function postProcess()
{
if (Tools::isSubmit('submitAdd'.$this->table) || Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
$languages = Language::getLanguages(false);
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
$idSellingObject = Tools::getValue($this->identifier);
if (!trim(Tools::getValue('name_'.$defaultLangId))) {
$this->errors[] = $this->l('Name is required at least in ').$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('name_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('name_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid Name in ').$lang['name'];
}
}
}
}
if (!trim(Tools::getValue('plural_name_'.$defaultLangId))) {
$this->errors[] = $this->l('Plural Name is required at least in ').$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('plural_name_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('plural_name_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid Plural Name in ').$lang['name'];
}
}
}
}
$this->display = $idSellingObject ? 'edit' : 'add';
if (!$this->errors) {
parent::postProcess();
}
} else {
parent::postProcess();
}
}
public function processDelete()
{
$object = $this->loadObject();
if (!$this->checkDeletion($object)) {
return false;
}
return parent::processDelete();
}
protected function processBulkDelete()
{
if (is_array($this->boxes) && !empty($this->boxes)) {
foreach ($this->boxes as $idSellingObject) {
$object = new RoomTypeSellingObject((int) $idSellingObject);
if (!$this->checkDeletion($object)) {
return false;
}
}
}
return parent::processBulkDelete();
}
protected function checkDeletion($object)
{
if (Validate::isLoadedObject($object)) {
if ($object->isUsed()) {
$this->errors[] = $this->l('You cannot delete this room type selling object because it is currently assigned to one or more room types.');
} else {
return true;
}
} else {
$this->errors[] = Tools::displayError('An error occurred while deleting the object.').'
<b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
}
return false;
}
}

View File

@@ -182,6 +182,12 @@ class OrderConfirmationControllerCore extends FrontController
$cart_htl_data[$type_key]['adults'] = $rm_dtl['adults'];
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
// Prefer the name stored at order-creation time so it stays historically accurate
if (!empty($order_bk_data[0]['selling_object_name'])) {
$cart_htl_data[$type_key]['selling_object_name'] = $order_bk_data[0]['selling_object_name'];
$cart_htl_data[$type_key]['selling_object_plural_name'] = $order_bk_data[0]['selling_object_plural_name'];
}
foreach ($order_bk_data as $data_k => $data_v) {
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
/*Product price when order was created*/

View File

@@ -99,6 +99,7 @@ class OrderDetailControllerCore extends FrontController
$total_convenience_fee_te = 0;
$total_convenience_fee_ti = 0;
$roomTypes = array();
$propertyType = null;
$objOrderReturn = new OrderReturn();
$refundedAmount = 0;
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
@@ -130,6 +131,13 @@ class OrderDetailControllerCore extends FrontController
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
$cartHotelData[$type_key]['cover_img'] = $type_value['cover_img'];
// Prefer the name stored at order-creation time so it stays historically accurate
if (!empty($order_bk_data[0]['selling_object_name'])) {
$cartHotelData[$type_key]['selling_object_name'] = $order_bk_data[0]['selling_object_name'];
$cartHotelData[$type_key]['selling_object_plural_name'] = $order_bk_data[0]['selling_object_plural_name'];
}
foreach ($order_bk_data as $data_k => $data_v) {
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
@@ -234,6 +242,7 @@ class OrderDetailControllerCore extends FrontController
$cartHotelData[$type_key]['date_diff'][$date_join]['feature_price_diff'] = $feature_price_diff;
$cartHotelData[$type_key]['hotel_name'] = $data_v['hotel_name'];
$propertyType = $data_v['property_type_name'];
// add extra services products in hotel detail.
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services'] = $objServiceProductOrderDetail->getRoomTypeServiceProducts(
$id_order,
@@ -410,10 +419,12 @@ class OrderDetailControllerCore extends FrontController
if ($idHotel = $addressTax->id_hotel) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
// Prefer the name stored at order-creation time so it stays historically accurate
$objHotelBranchRefundRules = new HotelBranchRefundRules();
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
$this->context->smarty->assign(array(
'obj_hotel_branch_information' => $objHotelBranchInformation,
'property_type' => $propertyType,
'hotel_address_info' => $hotelAddressInfo,
'hotel_refund_rules' => $hotelRefundRules,
));
@@ -501,6 +512,8 @@ class OrderDetailControllerCore extends FrontController
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objRoomType = new HotelRoomType();
$useTax = 0;
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
@@ -525,8 +538,10 @@ class OrderDetailControllerCore extends FrontController
));
}
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct);
$this->context->smarty->assign(array(
'objOrder' => $order,
'objOrder' => new Order($idOrder),
'room_type_info' => $roomTypeInfo,
));
$response['extra_services'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl');

View File

@@ -946,6 +946,7 @@ class OrderOpcControllerCore extends ParentOrderController
&& ($dateTo = Tools::getValue('date_to'))
) {
$objCartBookingData = new HotelCartBookingData();
$objRoomType = new HotelRoomType();
$objServiceProductCartDetail = new ServiceProductCartDetail();
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, true, 1);
@@ -988,10 +989,13 @@ class OrderOpcControllerCore extends ParentOrderController
? $availableServicePricing[$cartBookingData['id']]
: array();
}
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct);
unset($cartBookingData);
$this->context->smarty->assign(array(
'roomTypeServiceProducts' => $roomTypeServiceProducts,
'cartRooms' => $cartBookings
'cartRooms' => $cartBookings,
'room_type_info' => $roomTypeInfo
));
}
}

View File

@@ -343,15 +343,15 @@ class ProductControllerCore extends FrontController
/*By webkul To send All needed Hotel Information on product.tpl*/
#####################################################################
$htl_features = array();
$htl_features = array();
$obj_hotel_room_type = new HotelRoomType();
$room_info_by_product_id = $obj_hotel_room_type->getRoomTypeInfoByIdProduct($this->product->id);
if ($hotel_id = $room_info_by_product_id['id_hotel']) {
$obj_hotel_branch = new HotelBranchInformation();
$obj_hotel_branch = new HotelBranchInformation($hotel_id);
$hotel_info_by_id = $obj_hotel_branch->hotelBranchesInfo(false, 2, 1, $hotel_id);
$hotel_policies = $hotel_info_by_id['policies'];
$hotel_name = $hotel_info_by_id['hotel_name'];
$propertyType = $obj_hotel_branch->propertyTypeName;
$addressInfo = HotelBranchInformation::getAddress($room_info_by_product_id['id_hotel']);
$hotel_location = $addressInfo['city'].
($addressInfo['id_state']?', '.$addressInfo['state']:'').', '.$addressInfo['country'];
@@ -436,6 +436,7 @@ class ProductControllerCore extends FrontController
'hotel_rating' => $hotel_info_by_id['rating'],
'hotel_description' => $hotel_info_by_id['description'],
'hotel_policies' => $hotel_policies,
'property_type' => $propertyType,
'hotel_features' => $htl_features,
'room_type_features' => $roomFeatures,
'room_dynamic_amenities' => $roomAmenities,

View File

@@ -1652,6 +1652,7 @@ CREATE TABLE `PREFIX_product` (
`cache_has_attachments` tinyint(1) NOT NULL DEFAULT '0',
`is_virtual` tinyint(1) NOT NULL DEFAULT '0',
`booking_product` tinyint(1) NOT NULL DEFAULT '1',
`id_selling_object` int(10) unsigned DEFAULT NULL,
`cache_default_attribute` int(10) unsigned DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
@@ -2903,3 +2904,19 @@ CREATE TABLE IF NOT EXISTS `PREFIX_maintenance_access` (
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_maintenance_access`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `PREFIX_room_type_selling_object` (
`id_room_type_selling_object` int(10) unsigned NOT NULL AUTO_INCREMENT,
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_room_type_selling_object`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `PREFIX_room_type_selling_object_lang` (
`id_room_type_selling_object` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`plural_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_room_type_selling_object`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

View File

@@ -84,9 +84,9 @@
<tab id="Features" id_parent="Catalog" active="1" hide_host_mode="0">
<class_name>AdminFeatures</class_name>
</tab>
<!-- <tab id="Manufacturers" id_parent="Catalog" active="1" hide_host_mode="0">
<class_name>AdminManufacturers</class_name>
</tab> -->
<tab id="Room_Type_Selling_Objects" id_parent="Catalog" active="1" hide_host_mode="0">
<class_name>AdminRoomTypeSellingObjects</class_name>
</tab>
<!-- <tab id="Suppliers" id_parent="Catalog" active="1" hide_host_mode="0">
<class_name>AdminSuppliers</class_name>
</tab> -->

View File

@@ -22,6 +22,7 @@
<tab id="Stock" name="Stock"/>
<tab id="Products" name="Manage Service Products"/>
<tab id="Room_Types" name="Manage Room Types"/>
<tab id="Room_Type_Selling_Objects" name="Room Selling Objects"/>
<tab id="Categories" name="Categories"/>
<tab id="Monitoring" name="Monitoring"/>
<tab id="Attributes_and_Values" name="Product Attributes"/>

View File

@@ -1246,6 +1246,57 @@ $(document).ready(function() {
});
});
$(document).on('click', '.del_room_additional_service', function(e){
e.preventDefault();
if (confirm(txt_confirm)) {
var idServiceProductOrderDetail = $(this).data('id_service_product_order_detail');
$currentItem = $(this);
if (idServiceProductOrderDetail) {
$(".loading_overlay").show();
$.ajax({
type: 'POST',
headers: {
"cache-control": "no-cache"
},
url: admin_order_tab_link,
dataType: 'JSON',
cache: false,
data: {
id_service_product_order_detail: idServiceProductOrderDetail,
action: 'DeleteRoomAdditionalService',
ajax: true
},
success: function(jsonData) {
if (!jsonData.hasError) {
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
}
showSuccessMessage(txtExtraServiceSucc);
} else {
showErrorMessage(jsonData.errors);
}
},
complete: function() {
$(".loading_overlay").hide();
}
});
} else {
showErrorMessage(txtInvalidDemandVal);
}
}
});
// change advance option of extra demand
$(document).on('change', '.demand_adv_option_block .id_option', function(e) {
var option_selected = $(this).find('option:selected');
var extra_demand_price = option_selected.attr("optionPrice")
extra_demand_price = parseFloat(extra_demand_price);
// extra_demand_price = formatCurrency(extra_demand_price, currency_format, currency_sign, currency_blank);
$(this).closest('.room_demand_block').find('.unit_price').val(extra_demand_price);
});
$(".textarea-autosize").autosize();
var date = new Date();

View File

@@ -7,7 +7,7 @@
<tr>
<th>{l s="Room Num"}</th>
<th>{l s="Room Type"}</th>
<th>{l s="Hotel"}</th>
<th>{l s="Property Name"}</th>
<th>{l s="Duration"}</th>
</tr>
</thead>

View File

@@ -6,7 +6,7 @@
</tr>
<tr>
<th>{l s="Room Type"}</th>
<th>{l s="Hotel"}</th>
<th>{l s="Property Name"}</th>
<th>{l s="Rooms Qty"}</th>
<th>{l s="Duration"}</th>
</tr>

View File

@@ -5,7 +5,7 @@
{l s="Room Type"}
{l s="Hotel"}
{l s="Property Name"}
{l s="Rooms Qty"}

View File

@@ -7,7 +7,7 @@
<tr>
<th>{l s="Room Image"}</th>
<th>{l s="Room Description"}</th>
<th>{l s="Room Capcity"}</th>
<th>{l s="Room Capacity"}</th>
<th>{l s="Unit Price"}</th>
<th>{l s="Rooms Qty"}</th>
<th>{l s="Check-in Date"}</th>

View File

@@ -1,12 +1,12 @@
{if isset($list['hotel_name']) && $list['hotel_name']}
<div style="font-size:12px; font-family:Open-sans, sans-serif; color:#555454;">
<p data-html-only="1" style="margin:3px 0 0px;font-weight:500;font-size:18px;padding-bottom: 10px;">
{l s='Hotel details'}:
{l s='Property details'}:
</p>
<p style="margin:3px 0 0px;">
<span style="color:#333"><strong>{l s='Hotel Name'}:</strong></span> {$list['hotel_name']}<br />
<span style="color:#333"><strong>{l s='Hotel Phone'}:</strong></span> {$list['hotel_phone']}<br />
<span style="color:#333"><strong>{l s='Hotel Email'}:</strong></span> {$list['hotel_email']}<br />
<span style="color:#333"><strong>{l s='Property Name'}:</strong></span> {$list['hotel_name']}<br />
<span style="color:#333"><strong>{l s='Property Phone'}:</strong></span> {$list['hotel_phone']}<br />
<span style="color:#333"><strong>{l s='Property Email'}:</strong></span> {$list['hotel_email']}<br />
<span style="color:#333"><strong>{l s='Total Rooms'}:</strong></span> {$list['num_rooms']}<br />
</p>
</div>

View File

@@ -1,9 +1,9 @@
{if isset($list['hotel_name']) && $list['hotel_name']}
{l s='Hotel details'}:
{l s='Property details'}:
{l s='Hotel Name'}: {$list['hotel_name']}
{l s='Hotel Phone'}: {$list['hotel_phone']}
{l s='Hotel Email'}: {$list['hotel_email']}
{l s='Property Name'}: {$list['hotel_name']}
{l s='Property Phone'}: {$list['hotel_phone']}
{l s='Property Email'}: {$list['hotel_email']}
{l s='Total Rooms'}: {$list['num_rooms']}
{/if}

View File

@@ -1234,13 +1234,19 @@ var ajaxCart = {
let rooms = 0;
let adults = 0;
let children = 0;
if (typeof product.layer_cart_attribute_label !== 'undefined') {
$('#layer_cart .layer_cart_attribute_type').text(product.layer_cart_attribute_label);
}
if(typeof product.layer_cart_room_success_msg !== 'undefined'){
$('#layer_cart .layer_cart_room_success_msg').text(product.layer_cart_room_success_msg);
}
if (occupancy_required_for_booking) {
$.each(product.occupancy, function(index, val) {
rooms++;
adults += parseInt(val.adults);
children += parseInt(val.children);
});
product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms,product.room_info.selling_object_name, product.room_info.selling_object_plural_name);
} else {
product_quantity_text = product.occupancy;
}

View File

@@ -275,6 +275,7 @@ class Blockcart extends Module
}
$objCartBookingData = new HotelCartBookingData();
$objRoomType = new HotelRoomType();
$addedProduct = false;
// get currently added product if exists
@@ -306,7 +307,18 @@ class Blockcart extends Module
'cart_default'
);
$addedProduct['booking_product'] = $objProduct->booking_product;
$room_info = $objRoomType->getRoomTypeInfoByIdProduct($objProduct->id, $this->context->language->id);
$addedProduct['room_info'] = $room_info;
if ($objProduct->booking_product) {
$occupancyRequiredForBooking = false;
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$occupancyRequiredForBooking = true;
}
$addedProduct['occupancy_required_for_booking'] = $occupancyRequiredForBooking;
$addedProduct['layer_cart_attribute_label'] = $addedProduct['occupancy_required_for_booking']
? sprintf($this->l('%s occupancy'), $room_info['selling_object_name'])
: sprintf($this->l('%s quantity added'), $room_info['selling_object_plural_name']);
$includeTourismTax = ($priceDisplayMethod != PS_TAX_EXC) && (bool) Configuration::get('QLO_TOURISM_TAX_GROSSED_UP');
$price = $addedProduct['price'] = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$objProduct->id,
@@ -321,6 +333,7 @@ class Blockcart extends Module
1,
$includeTourismTax
);
$addedProduct['layer_cart_room_success_msg'] = sprintf($this->l('%s successfully added to your cart'), $room_info['selling_object_name']);
if ($priceDisplayMethod == PS_TAX_EXC) {
$addedProduct['price'] = Tools::displayPrice($price['total_price_tax_excl']);
} else {

View File

@@ -205,7 +205,7 @@
<span class="cross" title="{l s='Close window' mod='blockcart'}"></span>
{block name='blockcart_layer_cart_left_heading'}
<h2 class="layer_cart_room_txt">
<i class="icon-check"></i>{l s='Room successfully added to your cart' mod='blockcart'}
<i class="icon-check"></i><span class="layer_cart_room_success_msg">{l s='Room successfully added to your cart' mod='blockcart'}</span>
</h2>
<h2 class="layer_cart_product_txt">
<i class="icon-check"></i>{l s='Product successfully added to your cart' mod='blockcart'}
@@ -224,7 +224,7 @@
<span id="layer_cart_product_time_duration"></span>
</div>
<div>
<strong class="dark layer_cart_product_txt">{l s='Hotel Name' mod='blockcart'} &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_product_txt">{l s='Property Name' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_hotel_name"></span>
</div>
<div>
@@ -232,12 +232,12 @@
<span id="layer_cart_product_unit_price"></span>
</div>
<div>
<strong class="dark layer_cart_room_txt">{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if} &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_room_txt"><span class="layer_cart_attribute_type">{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if}</span> &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_product_txt">{l s='Quantity' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_quantity"></span>
</div>
<div>
<strong class="dark layer_cart_room_txt">{l s='Room type cost' mod='blockcart'} &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_room_txt"><span class="layer_cart_room_type_cost_label">{l s='Room type cost' mod='blockcart'}</span> &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_product_txt">{l s='Total' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_price"></span>
</div>

View File

@@ -240,7 +240,7 @@ class DashGuestCycle extends Module
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Property'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_out' => array('title' => $this->l('Check-out (LOS)'), 'class' => 'text-left'),
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
@@ -300,7 +300,7 @@ class DashGuestCycle extends Module
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Property'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_in' => array('title' => $this->l('Check-in (LOS)'), 'class' => 'text-left'),
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
@@ -360,7 +360,7 @@ class DashGuestCycle extends Module
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Property'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_in' => array('title' => $this->l('Check-in'), 'class' => 'text-left'),
'check_out' => array('title' => $this->l('Check-out (LOS)'), 'class' => 'text-left'),
@@ -424,7 +424,7 @@ class DashGuestCycle extends Module
$header = array(
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Property'), 'class' => 'text-left'),
'total' => array('title' => $this->l('Total Rooms'), 'class' => 'text-center'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'order_total' => array('title' => $this->l('Order Total'), 'class' => 'text-right'),
@@ -488,7 +488,7 @@ class DashGuestCycle extends Module
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Property'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_in' => array('title' => $this->l('Check-in'), 'class' => 'text-left'),
'check_out' => array('title' => $this->l('Check-out'), 'class' => 'text-left'),

View File

@@ -58,7 +58,7 @@ class DashInsights extends Module
{
if (Tools::getValue('controller') == 'AdminDashboard') {
Media::addJsDef(array(
'hotel_txt' => $this->l('Hotel'),
'hotel_txt' => $this->l('Property'),
'nights_booked_txt' => $this->l('Nights Booked'),
'room_booked_txt' => $this->l('Rooms Booked'),
'length_of_stay_txt' => $this->l('Length Of Stay'),
@@ -127,7 +127,7 @@ class DashInsights extends Module
$addressInfo = HotelBranchInformation::getAddress($idHotel, $this->context->language->id);
$panelsLabel = sprintf('(%s, %s)', $objHotelBranchInformation->hotel_name, $addressInfo['city']);
} else {
$panelsLabel = $this->l('(All Hotels)');
$panelsLabel = $this->l('(All Properties)');
}
$return = array(
@@ -164,10 +164,10 @@ class DashInsights extends Module
$seriesWiseRoomNights = array();
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
// set room nights demo data
if ($idHotel == 0) { // if 'All Hotels' is selected
if ($idHotel == 0) { // if 'All Properties' is selected
$allHotelSeriesInfo = array(
'data' => array(),
'label' => $this->l('All Hotels'),
'label' => $this->l('All Properties'),
);
foreach ($this->discreteDates as $discreteDate) {
@@ -207,11 +207,11 @@ class DashInsights extends Module
);
}
} else {
if ($idHotel == 0) { // if 'All Hotels' is selected
if ($idHotel == 0) { // if 'All Properties' is selected
$idsHotel = $this->accessibleIdsHotel;
$allHotelSeriesInfo = array(
'data' => AdminStatsController::getRoomNightsData($dateFrom, $dateTo, $idsHotel),
'label' => $this->l('All Hotels'),
'label' => $this->l('All Properties'),
);
$seriesWiseRoomNights[] = $allHotelSeriesInfo;
@@ -271,10 +271,10 @@ class DashInsights extends Module
$seriesWiseDaysOfTheWeek = array();
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
// set room nights demo data
if ($idHotel == 0) { // if 'All Hotels' is selected
if ($idHotel == 0) { // if 'All Properties' is selected
$allHotelSeriesInfo = array(
'data' => array(),
'label' => $this->l('All Hotels'),
'label' => $this->l('All Properties'),
);
// 1 = SUN
@@ -316,11 +316,11 @@ class DashInsights extends Module
);
}
} else {
if ($idHotel == 0) { // if 'All Hotels' is selected
if ($idHotel == 0) { // if 'All Properties' is selected
$idsHotel = $this->accessibleIdsHotel;
$allHotelSeriesInfo = array(
'data' => AdminStatsController::getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo, $idsHotel),
'label' => $this->l('All Hotels'),
'label' => $this->l('All Properties'),
);
$seriesWiseDaysOfTheWeek[] = $allHotelSeriesInfo;
@@ -348,7 +348,7 @@ class DashInsights extends Module
$averageDaysOfTheWeekData = AdminStatsController::getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageDaysOfTheWeekData,
'label' => $this->l('Other Hotels Average'),
'label' => $this->l('Other Properties Average'),
);
$seriesWiseDaysOfTheWeek[] = $averageSeriesInfo;
@@ -409,10 +409,10 @@ class DashInsights extends Module
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
// set room nights demo data
if ($idHotel == 0) { // if 'All Hotels' is selected
if ($idHotel == 0) { // if 'All Properties' is selected
$allHotelSeriesInfo = array(
'data' => array(),
'label' => $this->l('All Hotels'),
'label' => $this->l('All Properties'),
);
$roomsOccupied = array(
@@ -486,11 +486,11 @@ class DashInsights extends Module
);
}
} else {
if ($idHotel == 0) { // if 'All Hotels' is selected
if ($idHotel == 0) { // if 'All Properties' is selected
$idsHotel = $this->accessibleIdsHotel;
$allHotelSeriesInfo = array(
'data' => AdminStatsController::getLengthOfStayInfo($day, $dateFrom, $dateTo, $idsHotel),
'label' => $this->l('All Hotels'),
'label' => $this->l('All Properties'),
);
$seriesWiseLengthOfStay[] = $allHotelSeriesInfo;

View File

@@ -146,7 +146,7 @@ class DashProducts extends Module
array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
array('title' => $this->l('Total Rooms'), 'class' => 'text-left'),
array('title' => $this->l('Order'), 'class' => 'text-left'),
array('title' => $this->l('Hotel'), 'class' => 'text-left'),
array('title' => $this->l('Property'), 'class' => 'text-left'),
array('title' => $this->l('Total').' '.$this->l('Tax excl.'), 'class' => 'text-left'),
array('title' => $this->l('Date'), 'class' => 'text-left'),
array('title' => $this->l('Status'), 'class' => 'text-left'),
@@ -235,7 +235,7 @@ class DashProducts extends Module
),
array(
'id' => 'category',
'title' => $this->l('Hotel'),
'title' => $this->l('Property'),
'class' => 'text-center',
),
array(
@@ -339,7 +339,7 @@ class DashProducts extends Module
),
array(
'id' => 'hotel',
'title' => $this->l('Hotel'),
'title' => $this->l('Property'),
'class' => 'text-center',
),
array(
@@ -448,7 +448,7 @@ class DashProducts extends Module
),
array(
'id' => 'reference',
'title' => $this->l('Hotel'),
'title' => $this->l('Property'),
'class' => 'text-center'
),
array(

View File

@@ -130,6 +130,9 @@ class HotelBookingDetail extends ObjectModel
// hotel information/location/contact
public $hotel_name;
public $room_type_name;
public $selling_object_name;
public $selling_object_plural_name;
public $property_type_name;
public $city;
public $state;
public $country;
@@ -165,7 +168,6 @@ class HotelBookingDetail extends ObjectModel
const SEARCH_TYPE_OWS = 1;
const SEARCH_TYPE_NORMAL = 2;
//
const PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY = 1;
const PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY = 2;
@@ -196,6 +198,9 @@ class HotelBookingDetail extends ObjectModel
// hotel information/location/contact
'room_num' => array('type' => self::TYPE_STRING, 'required' => true),
'room_type_name' => array('type' => self::TYPE_STRING, 'required' => true),
'selling_object_name' => array('type' => self::TYPE_STRING),
'selling_object_plural_name' => array('type' => self::TYPE_STRING),
'property_type_name' => array('type' => self::TYPE_STRING),
'hotel_name' => array('type' => self::TYPE_STRING, 'required' => true),
'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'size' => 64, 'required' => true),
'state' => array('type' => self::TYPE_STRING),

View File

@@ -29,6 +29,7 @@ class HotelBranchInformation extends ObjectModel
public $id_category;
public $hotel_name;
public $email;
public $id_property_type;
public $check_in;
public $check_out;
public $description;
@@ -47,6 +48,7 @@ class HotelBranchInformation extends ObjectModel
public $date_upd;
public $moduleInstance;
public $propertyTypeName;
public static $definition = array(
'table' => 'htl_branch_info',
@@ -55,6 +57,7 @@ class HotelBranchInformation extends ObjectModel
'fields' => array(
'id_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'email' => array('type' => self::TYPE_STRING,'validate' => 'isEmail', 'size' => 255, 'required' => true),
'id_property_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'rating' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'check_in' => array('type' => self::TYPE_STRING, 'required' => true),
'check_out' => array('type' => self::TYPE_STRING, 'required' => true),
@@ -166,6 +169,7 @@ class HotelBranchInformation extends ObjectModel
$this->use_global_min_booking_offset = $hotelRestrictions['use_global_min_booking_offset'];
$this->min_booking_offset = $hotelRestrictions['min_booking_offset'];
}
$this->propertyTypeName = self::getHotelPropertyTypeByPropertyId($this->id_property_type, $id_lang);
}
}
@@ -1406,4 +1410,23 @@ class HotelBranchInformation extends ObjectModel
return Db::getInstance()->executeS($sql);
}
public static function getHotelPropertyTypeByPropertyId($idPropertyType, $idLang = null)
{
$idPropertyType = (int) $idPropertyType;
$idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id;
$cacheKey = 'HotelPropertyType::getHotelPropertyTypeByPropertyId'.$idPropertyType.'_'.$idLang;
if (!Cache::isStored($cacheKey)) {
$sql = 'SELECT hptl.`name`
FROM `'._DB_PREFIX_.'htl_property_type_lang` hptl
WHERE hptl.`id_htl_property_type` = '.$idPropertyType.'
AND hptl.`id_lang` = '.$idLang;
Cache::store($cacheKey, Db::getInstance()->getValue($sql));
}
$propertyType = Cache::retrieve($cacheKey);
return $propertyType ? $propertyType : Module::getInstanceByName('hotelreservationsystem')->l('Hotel', 'HotelBranchInformation');
}
}

View File

@@ -1536,6 +1536,8 @@ class HotelCartBookingData extends ObjectModel
$cartHotelData[$prodKey]['total_num_rooms'] = 0;
$cartHotelData[$prodKey]['id_product'] = $product['id_product'];
$cartHotelData[$prodKey]['name'] = $objProduct->name;
$cartHotelData[$prodKey]['selling_object_name'] = $roomDetail['selling_object_name'];
$cartHotelData[$prodKey]['selling_object_plural_name'] = $roomDetail['selling_object_plural_name'];
$cartHotelData[$prodKey]['unit_price'] = $unitPrice;
$cartHotelData[$prodKey]['unit_price_without_reduction'] = $unitPriceWithoutReduction;
$cartHotelData[$prodKey]['total_room_type_amount'] = 0;

View File

@@ -1227,6 +1227,185 @@ class HotelHelper
);
}
public function createHotelDefaultPropertyTypes()
{
$propertyTypes = array(
'Hotel',
'Motel',
'Resort',
'Hostel',
'Guest House',
'Bed & Breakfast',
'Lodge',
'Apartment',
'Vacation Rental',
'Homestay',
'Co-Living',
'Camping',
'Glamping',
'Farm Stay',
'Houseboat',
'Boat Stay',
);
$languages = Language::getLanguages(true);
foreach ($propertyTypes as $typeName) {
$objType = new HotelPropertyType();
$objType->active = 1;
foreach ($languages as $lang) {
$objType->name[$lang['id_lang']] = $typeName;
}
$objType->save();
}
return true;
}
public function createDefaultRoomSellingObjects()
{
$roomTypeSellingObjects = array(
array(
'name' => 'Room',
'plural_name' => 'Rooms',
),
array(
'name' => 'Bed',
'plural_name' => 'Beds',
),
array(
'name' => 'Apartment',
'plural_name' => 'Apartments',
),
array(
'name' => 'Villa',
'plural_name' => 'Villas',
),
array(
'name' => 'Cottage',
'plural_name' => 'Cottages',
),
array(
'name' => 'Bungalow',
'plural_name' => 'Bungalows',
),
array(
'name' => 'House',
'plural_name' => 'Houses',
),
array(
'name' => 'Chalet',
'plural_name' => 'Chalets',
),
array(
'name' => 'Cabin',
'plural_name' => 'Cabins',
),
array(
'name' => 'Studio',
'plural_name' => 'Studios',
),
array(
'name' => 'Condo',
'plural_name' => 'Condos',
),
array(
'name' => 'Penthouse',
'plural_name' => 'Penthouses',
),
array(
'name' => 'Tent',
'plural_name' => 'Tents',
),
array(
'name' => 'Camping Pitch',
'plural_name' => 'Camping Pitches',
),
array(
'name' => 'Caravan Site',
'plural_name' => 'Caravan Sites',
),
array(
'name' => 'RV Site',
'plural_name' => 'RV Sites',
),
array(
'name' => 'Pod',
'plural_name' => 'Pods',
),
array(
'name' => 'Capsule',
'plural_name' => 'Capsules',
),
array(
'name' => 'Treehouse',
'plural_name' => 'Treehouses',
),
array(
'name' => 'Hut',
'plural_name' => 'Huts',
),
array(
'name' => 'Yurt',
'plural_name' => 'Yurts',
),
array(
'name' => 'Igloo',
'plural_name' => 'Igloos',
),
array(
'name' => 'Houseboat',
'plural_name' => 'Houseboats',
),
array(
'name' => 'Boat Cabin',
'plural_name' => 'Boat Cabins',
),
array(
'name' => 'Overwater Bungalow',
'plural_name' => 'Overwater Bungalows',
),
array(
'name' => 'Heritage Room',
'plural_name' => 'Heritage Rooms',
),
array(
'name' => 'Holiday Home',
'plural_name' => 'Holiday Homes',
),
array(
'name' => 'Farm Stay Unit',
'plural_name' => 'Farm Stay Units',
),
array(
'name' => 'Cave Room',
'plural_name' => 'Cave Rooms',
),
array(
'name' => 'Container Stay',
'plural_name' => 'Container Stays',
),
array(
'name' => 'Train Cabin',
'plural_name' => 'Train Cabins',
),
array(
'name' => 'Motorhome',
'plural_name' => 'Motorhomes',
),
);
$languages = Language::getLanguages(true);
foreach ($roomTypeSellingObjects as $typeName) {
$objType = new RoomTypeSellingObject();
$objType->active = 1;
foreach ($languages as $lang) {
$objType->name[$lang['id_lang']] = $typeName['name'];
$objType->plural_name[$lang['id_lang']] = $typeName['plural_name'];
}
$objType->save();
}
}
public function createDefaultBookingStatuses()
{
$htlBookingStatuses = array(
@@ -1340,6 +1519,7 @@ class HotelHelper
{
$obj_hotel_info = new HotelBranchInformation();
$obj_hotel_info->active = 1;
$obj_hotel_info->id_property_type = 1;
$obj_hotel_info->email = 'hotelprime@htl.com';
$obj_hotel_info->check_in = '12:00';
$obj_hotel_info->check_out = '11:00';
@@ -1938,6 +2118,7 @@ class HotelHelper
$product->show_at_front = 1;
$product->is_virtual = 1;
$product->indexed = 1;
$product->id_selling_object = 1;
$product->save();
$product_id = $product->id;
@@ -2018,6 +2199,7 @@ class HotelHelper
$htl_rm_type = new HotelRoomType();
$htl_rm_type->id_product = $product_id;
$htl_rm_type->id_hotel = $id_hotel;
$htl_rm_type->id_selling_object = $product->id_selling_object;
$htl_rm_type->adults = 2;
$htl_rm_type->children = 2;
$htl_rm_type->max_adults = 2;
@@ -2418,6 +2600,8 @@ class HotelHelper
$this->saveDummyHotelAmenities($htl_id);
$this->saveDummyProductsAndRelatedInfo($htl_id);
$this->saveDummyServiceProductsAndRelatedInfo();
$this->createHotelDefaultPropertyTypes();
$this->createDefaultRoomSellingObjects();
return true;
}

View File

@@ -0,0 +1,84 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a 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
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
class HotelPropertyType extends ObjectModel
{
public $active;
public $date_add;
public $date_upd;
public $name;
public static $definition = array(
'table' => 'htl_property_type',
'primary' => 'id_htl_property_type',
'multilang' => true,
'fields' => array(
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true),
),
);
/**
* Check if this property type is currently assigned to any property.
*
* @return bool
*/
public function isUsed()
{
return (bool) Db::getInstance()->getValue(
'SELECT COUNT(*) FROM `'._DB_PREFIX_.'htl_branch_info` WHERE `id_property_type` = '.(int) $this->id
);
}
/**
* Get the list of property types in the requested language.
*
* @param int|null $idLang
* @param bool $active
*
* @return array
*/
public static function getPropertyTypes($idLang = null, $active = true)
{
$idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id;
$active = (bool) $active;
$cacheKey = 'HotelPropertyType::getPropertyTypes'.$idLang.'_'.(int) $active;
if (!Cache::isStored($cacheKey)) {
$sql = 'SELECT hpt.`id_htl_property_type` AS `id_property_type`, hptl.`name`
FROM `'._DB_PREFIX_.'htl_property_type` hpt
LEFT JOIN `'._DB_PREFIX_.'htl_property_type_lang` hptl
ON (hpt.`id_htl_property_type` = hptl.`id_htl_property_type`
AND hptl.`id_lang` = '.$idLang.')'.
($active ? ' WHERE hpt.`active` = 1' : '').
' ORDER BY hptl.`name` ASC';
Cache::store($cacheKey, Db::getInstance()->executeS($sql));
}
return Cache::retrieve($cacheKey);
}
}

View File

@@ -30,6 +30,7 @@ class HotelReservationSystemDb
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_product` int(11) NOT NULL,
`id_hotel` int(11) NOT NULL,
`id_selling_object` int(10) unsigned DEFAULT NULL,
`adults` smallint(6) NOT NULL DEFAULT '2',
`children` smallint(6) NOT NULL DEFAULT '0',
`max_adults` smallint(6) NOT NULL DEFAULT '2',
@@ -59,6 +60,7 @@ class HotelReservationSystemDb
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_category` int(10) unsigned NOT NULL,
`email` varchar(128) NOT NULL,
`id_property_type` int(10) unsigned NOT NULL DEFAULT '0',
`check_in` varchar(255) DEFAULT NULL,
`check_out` varchar(255) DEFAULT NULL,
`rating` int(2) unsigned NOT NULL,
@@ -128,6 +130,20 @@ class HotelReservationSystemDb
PRIMARY KEY (`id_amenity`, `id_lang`)
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_property_type` (
`id_htl_property_type` int(10) unsigned NOT NULL AUTO_INCREMENT,
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_htl_property_type`)
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_property_type_lang` (
`id_htl_property_type` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id_htl_property_type`, `id_lang`)
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_amenity` (
`id_branch_amenity` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_hotel` int(10) unsigned NOT NULL,
@@ -201,6 +217,9 @@ class HotelReservationSystemDb
`is_back_order` tinyint(4) NOT NULL,
`hotel_name` varchar(255) DEFAULT NULL,
`room_type_name` varchar(255) DEFAULT NULL,
`selling_object_name` varchar(255) DEFAULT NULL,
`selling_object_plural_name` varchar(255) DEFAULT NULL,
`property_type_name` varchar(255) DEFAULT NULL,
`city` varchar(255) NOT NULL,
`state` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
@@ -605,6 +624,8 @@ class HotelReservationSystemDb
`'._DB_PREFIX_.'htl_bed_type`,
`'._DB_PREFIX_.'htl_bed_type_lang`,
`'._DB_PREFIX_.'htl_room_type_bed_type`,
`'._DB_PREFIX_.'htl_property_type`,
`'._DB_PREFIX_.'htl_property_type_lang`,
`'._DB_PREFIX_.'htl_access`,
`'._DB_PREFIX_.'htl_settings_link`,
`'._DB_PREFIX_.'htl_settings_link_lang`,

View File

@@ -26,6 +26,7 @@ class HotelRoomType extends ObjectModel
public $id;
public $id_product;
public $id_hotel;
public $id_selling_object;
public $adults;
public $children;
public $max_adults;
@@ -35,6 +36,8 @@ class HotelRoomType extends ObjectModel
public $max_los;
public $date_add;
public $date_upd;
public $selling_object_name;
public $selling_object_plural_name;
public static $definition = array(
'table' => 'htl_room_type',
@@ -42,6 +45,7 @@ class HotelRoomType extends ObjectModel
'fields' => array(
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'id_selling_object' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => false),
'adults' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'default' => 2),
'children' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'max_adults' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'default' => 2),
@@ -77,6 +81,14 @@ class HotelRoomType extends ObjectModel
),
);
public function __construct($id = null, $idLang = null, $idShop = null)
{
parent::__construct($id, $idLang, $idShop);
$module = Module::getInstanceByName('hotelreservationsystem');
$this->selling_object_name = $module->l('Room', 'HotelRoomType');
$this->selling_object_plural_name = $module->l('Rooms', 'HotelRoomType');
}
/**
* [duplicateRoomType :: duplicates room type].
*
@@ -108,6 +120,7 @@ class HotelRoomType extends ObjectModel
$objHotelRoomType = new HotelRoomType();
$objHotelRoomType->id_product = $idProductNew;
$objHotelRoomType->id_hotel = $idHotelNew;
$objHotelRoomType->id_selling_object = $roomType['id_selling_object'];
$objHotelRoomType->adults = $roomType['adults'];
$objHotelRoomType->children = $roomType['children'];
$objHotelRoomType->max_adults = $roomType['max_adults'];
@@ -234,13 +247,32 @@ class HotelRoomType extends ObjectModel
if (!$idLang) {
$idLang = Context::getContext()->language->id;
}
$sql = 'SELECT hrt.*, hbl.`hotel_name`
FROM `'._DB_PREFIX_.'htl_room_type` AS hrt
INNER JOIN `'._DB_PREFIX_.'htl_branch_info_lang` AS hbl
ON (hbl.`id` = hrt.`id_hotel` AND hbl.`id_lang` = '.(int)$idLang.')
WHERE hrt.`id_product` = '.(int)$id_product;
$cache_key = 'HotelRoomType::getRoomTypeInfoByIdProduct_'.$id_product.'_'.$idLang;
if (!Cache::isStored($cache_key)) {
$sql = 'SELECT hrt.*, hbl.`hotel_name`,
COALESCE(hrtstl.`name`, "'.pSQL($this->selling_object_name).'") AS `selling_object_name`,
COALESCE(hrtstl.`plural_name`, "'.pSQL($this->selling_object_plural_name).'") AS `selling_object_plural_name`
FROM `'._DB_PREFIX_.'htl_room_type` AS hrt
INNER JOIN `'._DB_PREFIX_.'htl_branch_info_lang` AS hbl
ON (hbl.`id` = hrt.`id_hotel`
AND hbl.`id_lang` = '.(int)$idLang.')
LEFT JOIN `'._DB_PREFIX_.'product` AS p
ON (p.`id_product` = hrt.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object` AS hrtso
ON (hrtso.`id_room_type_selling_object` = hrt.`id_selling_object`
AND hrtso.`active` = 1)
LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object_lang` AS hrtstl
ON (hrtstl.`id_room_type_selling_object` = hrtso.`id_room_type_selling_object`
AND hrtstl.`id_lang` = '.(int)$idLang.')
WHERE hrt.`id_product` = '.(int)$id_product;
return Db::getInstance()->getRow($sql);
$result = Db::getInstance()->getRow($sql);
Cache::store($cache_key, $result);
} else {
$result = Cache::retrieve($cache_key);
}
return $result;
}
/**
@@ -298,23 +330,39 @@ class HotelRoomType extends ObjectModel
$idLang = Context::getContext()->language->id;
}
$sql = 'SELECT pl.`name`, COUNT(hri.`id`) AS `numberOfRooms`, hrt.`id_product`, `adults`, `children`, `max_adults`, `max_children`, `max_guests`
'.($position ? ', cp.`position`' : '').'
'.($fullDetail ? ', pl.`link_rewrite`, pl.`description_short`' : '').'
FROM `'._DB_PREFIX_.'htl_room_type` AS `hrt`
INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS `hri` ON (hri.`id_product` = hrt.`id_product`)';
$sql .= ' INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (hrt.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')';
$cache_key = 'HotelRoomType::getRoomTypeDetailByRoomTypeIds_'.$roomTypesList.'_'.$position.'_'.$fullDetail.'_'.$idLang;
if (!Cache::isStored($cache_key)) {
if ($position) {
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_branch_info` hbi ON (hbi.`id` = hrt.`id_hotel`)
INNER JOIN `'._DB_PREFIX_.'category_product` cp ON cp.`id_category` = hbi.`id_category` AND cp.`id_product` = hrt.`id_product`';
$sql = 'SELECT pl.`name`, COUNT(hri.`id`) AS `numberOfRooms`, hrt.`id_product`, `adults`, `children`, `max_adults`, `max_children`, `max_guests`, COALESCE(hrtstl.`name`, "'.pSQL($this->selling_object_name).'") AS `selling_object_name`, COALESCE(hrtstl.`plural_name`, "'.pSQL($this->selling_object_plural_name).'") AS `selling_object_plural_name`
'.($position ? ', cp.`position`' : '').'
'.($fullDetail ? ', pl.`link_rewrite`, pl.`description_short`' : '').'
FROM `'._DB_PREFIX_.'htl_room_type` AS `hrt`
INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS `hri` ON (hri.`id_product` = hrt.`id_product`)';
$sql .= ' INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (hrt.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product` AS p ON (p.`id_product` = hrt.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object` AS hrtso
ON (hrtso.`id_room_type_selling_object` = p.`id_selling_object`
AND hrtso.`active` = 1)
LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object_lang` AS hrtstl
ON (hrtstl.`id_room_type_selling_object` = hrtso.`id_room_type_selling_object`
AND hrtstl.`id_lang` = '.(int)$idLang.')';
if ($position) {
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_branch_info` hbi ON (hbi.`id` = hrt.`id_hotel`)
INNER JOIN `'._DB_PREFIX_.'category_product` cp ON cp.`id_category` = hbi.`id_category` AND cp.`id_product` = hrt.`id_product`';
}
$sql .= 'WHERE hrt.`id_product` IN ('.$roomTypesList.')
GROUP BY hrt.`id_product`'.
($position ? ' ORDER BY cp.`position`' : '');
$result = Db::getInstance()->executeS($sql);
Cache::store($cache_key, $result);
} else {
$result = Cache::retrieve($cache_key);
}
$sql .= 'WHERE hrt.`id_product` IN ('.$roomTypesList.')
GROUP BY hrt.`id_product`'.
($position ? ' ORDER BY cp.`position`' : '');
return Db::getInstance()->executeS($sql);
return $result;
}
/**

View File

@@ -45,16 +45,24 @@ class AdminAddHotelController extends ModuleAdminController
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = aa.`id_state`)';
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl
ON (cl.`id_country` = aa.`id_country` AND cl.`id_lang` = '.(int) $this->context->language->id.')';
$this->_select = ' hbl.`hotel_name`, aa.`city`, s.`name` as `state_name`, cl.`name` as country_name';
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'htl_property_type_lang` hrtsl
ON (hrtsl.`id_htl_property_type` = a.`id_property_type` AND hrtsl.`id_lang` = '.(int) $this->context->language->id.')';
$this->_select = ' hrtsl.`name` as `property_type` , hbl.`hotel_name`, aa.`city`, s.`name` as `state_name`, cl.`name` as `country_name`';
$this->fields_list = array(
'id' => array(
'title' => $this->l('ID'),
'align' => 'center',
),
'property_type' => array(
'title' => $this->l('Property type'),
'align' => 'center',
'optional' => false,
'filter_key' => 'hrtsl!name',
'order_key' => 'hrtsl!name',
),
'hotel_name' => array(
'title' => $this->l('Hotel Name'),
'title' => $this->l('Name'),
'align' => 'center',
),
'city' => array(
@@ -219,6 +227,13 @@ class AdminAddHotelController extends ModuleAdminController
$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');
$hotelPropertyTypes = HotelPropertyType::getPropertyTypes($this->context->language->id);
$smartyVars['hotel_property_types_info'] = $hotelPropertyTypes;
$selectedHotelPropertyType = Tools::getValue('id_property_type');
if (!$selectedHotelPropertyType && isset($hotelBranchInfo)) {
$selectedHotelPropertyType = $hotelBranchInfo->id_property_type;
}
$smartyVars['selected_hotel_property_type'] = (int) $selectedHotelPropertyType;
$smartyVars['tourism_tax_collection_type'] = (int) $this->object->tourism_tax_collection_type;
$smartyVars['use_tourism_tax'] = (int) Configuration::get('QLO_USE_TOURISM_TAX');
@@ -259,6 +274,7 @@ class AdminAddHotelController extends ModuleAdminController
$fax = Tools::getValue('fax');
$vatNumber = trim(Tools::getValue('vat_number'));
$activeRefund = Tools::getValue('active_refund');
$idHotelPropertyType = Tools::getValue('id_property_type');
$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');
@@ -523,6 +539,7 @@ class AdminAddHotelController extends ModuleAdminController
$objHotelBranch->active_refund = $activeRefund;
$objHotelBranch->tourism_tax_collection_type = (int) Tools::getValue('tourism_tax_collection_type', 0);
$objHotelBranch->fax = $fax;
$objHotelBranch->id_property_type = $idHotelPropertyType;
// lang fields
$hotelCatName = array();

View File

@@ -122,7 +122,7 @@ class AdminHotelConfigurationSettingController extends ModuleAdminController
{
parent::initToolbar();
if ($this->display == 'view') {
$this->toolbar_title = $this->l('Hotel Settings');
$this->toolbar_title = $this->l('Property Settings');
$this->page_header_toolbar_btn['manage_links'] = array(
'icon' => 'process-icon-cogs',
'href' => self::$currentIndex.'&display=list&token='.$this->token,

View File

@@ -113,7 +113,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
'class' => 'chosen',
),
'hotel_name' => array(
'title' => $this->l('Hotel'),
'title' => $this->l('Property'),
'align' => 'center',
'type' => 'select',
'filter_key' => 'hrt!id_hotel',

View File

@@ -108,11 +108,11 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
'hint' => $this->l('Enable if you want the next booking search field to be focused automatically after setting value for a field.'),
),
'WK_HOTEL_NAME_SEARCH_THRESHOLD' => array(
'title' => $this->l('Hotel name search threshold'),
'title' => $this->l('Property name search threshold'),
'type' => 'text',
'required' => true,
'validation' => 'isUnsignedInt',
'hint' => $this->l('Enter the number of hotels after which user can search hotel by name.'),
'hint' => $this->l('Enter the number of properties after which user can search property by name.'),
'desc' => $this->l('Set to 0 to always show the search box.'),
'class' => 'fixed-width-xxl',
),
@@ -125,26 +125,26 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
'title' => $this->l('Website Configuration'),
'fields' => array(
'WK_HTL_CHAIN_NAME' => array(
'title' => $this->l('Hotel Brand Name'),
'title' => $this->l('Property Brand Name'),
'type' => 'textLang',
'lang' => true,
'required' => true,
'validation' => 'isGenericName',
'hint' => $this->l('Enter Hotel name in case of single hotel or enter your hotels chain name in case of multiple hotels.'),
'hint' => $this->l('Enter Property name in case of single property or enter your properties chain name in case of multiple properties.'),
),
'WK_HTL_SHORT_DESC' => array(
'title' => $this->l('Hotel Short Description'),
'title' => $this->l('Property Short Description'),
'type' => 'textareaLang',
'lang' => true,
'required' => true,
'rows' => '4',
'cols' => '2',
'validation' => 'isGenericName',
'hint' => $this->l('This will display hotel short description in footer. Note: number of letters must be less than 220.'),
'hint' => $this->l('This will display property short description in footer. Note: number of letters must be less than 220.'),
),
'WK_PRIMARY_HOTEL' => array(
'title' => $this->l('Primary hotel'),
'hint' => $this->l('Primary hotel is used to default address for your business. The hotel address will be considered as your registered business address.'),
'title' => $this->l('Primary property'),
'hint' => $this->l('Primary property is used to default address for your business. The property address will be considered as your registered business address.'),
'type' => 'select',
'identifier' => 'id',
'list' => $hotelsInfo,
@@ -535,30 +535,30 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
// End occupancy fields validation
if (!$hotelNameSearchThreshold && $hotelNameSearchThreshold !== '0') {
$this->errors[] = $this->l('Hotel name search threshold field is required.');
$this->errors[] = $this->l('Property name search threshold field is required.');
} elseif (!Validate::isUnsignedInt($hotelNameSearchThreshold)) {
$this->errors[] = $this->l('Hotel name search threshold field is invalid.');
$this->errors[] = $this->l('Property name search threshold field is invalid.');
}
if (!trim(Tools::getValue('WK_HTL_CHAIN_NAME_'.$defaultLangId))) {
$this->errors[] = $this->l('Hotel chain name is required at least in ').$objDefaultLanguage['name'];
$this->errors[] = $this->l('Property chain name is required at least in ').$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('WK_HTL_CHAIN_NAME_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('WK_HTL_CHAIN_NAME_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid hotel chain name in ').$lang['name'];
$this->errors[] = $this->l('Invalid property chain name in ').$lang['name'];
}
}
}
}
if (!trim(Tools::getValue('WK_HTL_SHORT_DESC_'.$defaultLangId))) {
$this->errors[] = $this->l('Hotel short description is required at least in ').
$this->errors[] = $this->l('Property short description is required at least in ').
$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('WK_HTL_SHORT_DESC_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('WK_HTL_SHORT_DESC_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid hotel short description in ').$lang['name'];
$this->errors[] = $this->l('Invalid property short description in ').$lang['name'];
}
}
}

View File

@@ -0,0 +1,206 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a 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
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
class AdminHotelPropertyTypesController extends ModuleAdminController
{
public function __construct()
{
$this->bootstrap = true;
$this->table = 'htl_property_type';
$this->className = 'HotelPropertyType';
$this->identifier = 'id_htl_property_type';
$this->lang = true;
$this->context = Context::getContext();
$this->toolbar_title = $this->l('Property Types');
parent::__construct();
$this->fields_list = array(
'id_htl_property_type' => array(
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs',
),
'name' => array(
'title' => $this->l('Name'),
'align' => 'left',
),
'active' => array(
'title' => $this->l('Status'),
'align' => 'center',
'active' => 'status',
'type' => 'bool',
'orderby' => false,
),
);
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->bulk_actions = array(
'delete' => array(
'text' => $this->l('Delete selected'),
'confirm' => $this->l('Delete selected items?'),
'icon' => 'icon-trash',
),
);
}
public function initPageHeaderToolbar()
{
if (!$this->display || $this->display == 'list') {
$this->page_header_toolbar_btn['new_property_type'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add New Property', null, null, false),
'icon' => 'process-icon-new',
);
}
parent::initPageHeaderToolbar();
}
public function renderForm()
{
if (!$this->loadObject(true)) {
return;
}
$this->fields_form = array(
'legend' => array(
'title' => $this->l('Property Type'),
'icon' => 'icon-building',
),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Name'),
'name' => 'name',
'lang' => true,
'required' => true,
'hint' => $this->l('Displayed name for this property type.'),
),
array(
'type' => 'switch',
'label' => $this->l('Enabled'),
'name' => 'active',
'is_bool' => true,
'default_value' => 1,
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled'),
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled'),
),
),
),
),
'submit' => array(
'title' => $this->l('Save'),
),
'buttons' => array(
'save-and-stay' => array(
'title' => $this->l('Save and stay'),
'name' => 'submitAdd'.$this->table.'AndStay',
'type' => 'submit',
'class' => 'btn btn-default pull-right',
'icon' => 'process-icon-save',
),
),
);
return parent::renderForm();
}
public function postProcess()
{
if (Tools::isSubmit('submitAdd'.$this->table) || Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
$languages = Language::getLanguages(false);
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
$idPropertyType = Tools::getValue($this->identifier);
if (!trim(Tools::getValue('name_'.$defaultLangId))) {
$this->errors[] = $this->l('Name is required at least in ').$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('name_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('name_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid Name in ').$lang['name'];
}
}
}
}
$this->display = $idPropertyType ? 'edit' : 'add';
if (!$this->errors) {
parent::postProcess();
}
} else {
parent::postProcess();
}
}
public function processDelete()
{
$object = $this->loadObject();
if (!$this->checkDeletion($object)) {
return false;
}
return parent::processDelete();
}
protected function processBulkDelete()
{
if (is_array($this->boxes) && !empty($this->boxes)) {
foreach ($this->boxes as $idPropertyType) {
$object = new HotelPropertyType((int) $idPropertyType);
if (!$this->checkDeletion($object)) {
return false;
}
}
}
return parent::processBulkDelete();
}
protected function checkDeletion($object)
{
if (Validate::isLoadedObject($object)) {
if ($object->isUsed()) {
$this->errors[] = $this->l('You cannot delete this property type because it is currently assigned to one or more properties.');
} else {
return true;
}
} else {
$this->errors[] = Tools::displayError('An error occurred while deleting the object.').'
<b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
}
return false;
}
}

View File

@@ -766,7 +766,7 @@ public function ajaxProcessGetCalenderData()
if (validate::isLoadedObject($objHotelBranch = new HotelBranchInformation($id_hotel))) {
$hotelIdAddress = $objHotelBranch->getHotelIdAddress();
} else {
$this->errrors[] = $this->l('Hotel not found');
$this->errrors[] = $this->l('Property not found');
}
}
@@ -1108,15 +1108,16 @@ public function ajaxProcessGetCalenderData()
'SELLING_PREFERENCE_WITH_ROOM_TYPE' => Product::SELLING_PREFERENCE_WITH_ROOM_TYPE,
'SELLING_PREFERENCE_WITH_STANDALONE' => Product::SELLING_PREFERENCE_WITH_STANDALONE,
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'rooms_reallocation_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
'opt_select_all' => $this->l('All Types', null, true),
'slt_another_htl' => $this->l('Select Another Hotel', null, true),
'slt_another_htl' => $this->l('Select Another Property', null, true),
'product_type_cond' => $this->l('Product type is required', null, true),
'from_date_cond' => $this->l('From date is required', null, true),
'to_date_cond' => $this->l('To date is required', null, true),
'hotel_name_cond' => $this->l('Hotel Name is required', null, true),
'hotel_name_cond' => $this->l('Property Name is required', null, true),
'num_rooms_cond' => $this->l('Number of Rooms is required', null, true),
'add_to_cart' => $this->l('Add To Cart', null, true),
'remove' => $this->l('Remove', null, true),

View File

@@ -252,7 +252,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
'callback' => 'getUniqueRoomTypeNames'
),
'hotel_name' => array(
'title' => $this->l('Hotel')
'title' => $this->l('Property Name')
),
'date_from' => array(
'title' => $this->l('Date From')
@@ -324,7 +324,12 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$objOrderReturn->id,
$booking['id']
);
$booking = array_merge($booking, array_shift($bookingCharges));
if (!empty($booking['selling_object_name'])) {
$booking['selling_object_name'] = $booking['selling_object_name'];
}
}
}

View File

@@ -46,6 +46,7 @@ require_once 'classes/HotelRoomTypeRestrictionDateRange.php';
require_once 'classes/HotelRoomDisableDates.php';
require_once 'classes/HotelBranchRefundRules.php';
require_once 'classes/HotelPropertyType.php';
require_once 'classes/HotelConnectedRoom.php';
// linked products

View File

@@ -480,6 +480,8 @@ class HotelReservationSystem extends Module
$this->installTab('AdminHotelReservationSystemManagement', 'Hotel Reservation System');
$this->installTab('AdminAddHotel', 'Manage Hotel', 'AdminHotelReservationSystemManagement');
$this->installTab('AdminHotelRoomsBooking', 'Book Now', 'AdminHotelReservationSystemManagement');
$this->installTab('AdminHotelFeatures', 'Manage Hotel Features', 'AdminHotelReservationSystemManagement');
$this->installTab('AdminHotelPropertyTypes', 'Manage Property Types', 'AdminHotelReservationSystemManagement');
$this->installTab('AdminHotelAmenities', 'Manage Amenities', 'AdminHotelReservationSystemManagement');
$this->installTab('AdminOrderRefundRules', 'Manage Order Refund Rules', 'AdminHotelReservationSystemManagement');
$this->installTab('AdminOrderRefundRequests', 'Manage Order Refund Requests', 'AdminHotelReservationSystemManagement');

View File

@@ -775,7 +775,8 @@ $(document).ready(function() {
var adults = 0;
var children = 0;
var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length;
var roomLabel = $(booking_occupancy_wrapper).data('attribute_type') || room_txt;
var roomsLabel = $(booking_occupancy_wrapper).data('attribute_types') || rooms_txt;
$(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) {
adults += parseInt($(this).val());
});
@@ -797,9 +798,9 @@ $(document).ready(function() {
}
}
if (parseInt(rooms) > 1) {
guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt;
guestButtonVal += ', ' + parseInt(rooms) + ' ' + roomsLabel;
} else {
guestButtonVal += ', ' + parseInt(rooms) + ' ' + room_txt;
guestButtonVal += ', ' + parseInt(rooms) + ' ' + roomLabel;
}
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
}

View File

@@ -23,9 +23,9 @@
<div class="panel">
<div class="panel-heading">
{if isset($edit)}
<i class='icon-pencil'></i> {l s='Edit Hotel' mod='hotelreservationsystem'}
<i class='icon-pencil'></i> {l s='Edit Property' mod='hotelreservationsystem'}
{else}
<i class='icon-plus'></i> {l s='Add New Hotel' mod='hotelreservationsystem'}
<i class='icon-plus'></i> {l s='Add New Property' mod='hotelreservationsystem'}
{/if}
</div>
@@ -119,7 +119,7 @@
<div class="form-group">
<label class="control-label col-lg-3">
<span>
{l s='Enable Hotel' mod='hotelreservationsystem'}
{l s='Enable' mod='hotelreservationsystem'}
</span>
</label>
<div class="col-lg-9 ">
@@ -132,9 +132,28 @@
</span>
</div>
</div>
{if isset($hotel_property_types_info) && $hotel_property_types_info}
<div class="form-group">
<label class="control-label col-sm-3 " for="id_property_type">
<span>
{l s='Property Type :' mod='hotelreservationsystem'}
</span>
</label>
<div class="col-sm-6">
<select name="id_property_type" id="id_property_type" class="form-control chosen">
{foreach from=$hotel_property_types_info item=property_type}
<option value="{$property_type.id_property_type|escape:'htmlall':'UTF-8'}"
{if isset($selected_hotel_property_type) && $selected_hotel_property_type == $property_type.id_property_type}selected{/if}>
{$property_type.name|escape:'htmlall':'UTF-8'}
</option>
{/foreach}
</select>
</div>
</div>
{/if}
<div class="form-group">
<label class="col-sm-3 control-label required" for="hotel_name" >
{l s='Hotel Name :' mod='hotelreservationsystem'}
{l s='Name :' mod='hotelreservationsystem'}
{include file="../../../_partials/htl-form-fields-flag.tpl"}
</label>
<div class="col-lg-6">
@@ -309,7 +328,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">
{l s='Hotel Policies :' mod='hotelreservationsystem'}
{l s='Policies :' mod='hotelreservationsystem'}
{include file="../../../_partials/htl-form-fields-flag.tpl"}
</label>
<div class="col-lg-6">
@@ -472,7 +491,7 @@
</div>
{else}
<div class="alert alert-warning">
{l s='Please save hotel information before saving hotel images.' mod='hotelreservationsystem'}
{l s='Please save property information before saving property images.' mod='hotelreservationsystem'}
</div>
{/if}
@@ -529,7 +548,7 @@
</div>
{else}
<div class="alert alert-warning">
{l s='Please save the hotel information before saving the hotel booking restrictions.' mod='hotelreservationsystem'}
{l s='Please save the property information before saving the property booking restrictions.' mod='hotelreservationsystem'}
</div>
{/if}
@@ -619,7 +638,7 @@
</div>
{else}
<div class="alert alert-warning">
{l s='Please save hotel information before saving refund policy options.' mod='hotelreservationsystem'}
{l s='Please save property information before saving refund policy options.' mod='hotelreservationsystem'}
</div>
{/if}
@@ -663,7 +682,7 @@
</div>
{else}
<div class="alert alert-warning">
{l s='Please save hotel information before assigning hotel amenities.' mod='hotelreservationsystem'}
{l s='Please save property information before assigning property amenities.' mod='hotelreservationsystem'}
</div>
{/if}

View File

@@ -0,0 +1,102 @@
{*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a 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
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*}
<form method="post" action="{$current|escape:'htmlall':'UTF-8'}&{if !empty($submit_action)}{$submit_action|escape:'htmlall':'UTF-8'}{/if}&token={$token|escape:'htmlall':'UTF-8'}" class="defaultForm form-horizontal {$name_controller|escape:'htmlall':'UTF-8'}" enctype="multipart/form-data">
{if isset($edit)}
<input name="edit_hotel_id" type="hidden" value="{$hotel_id}">
{/if}
<div class="panel">
<div class="panel-heading">
<i class="icon-user"></i> {l s='Assign Features' mod='hotelreservationsystem'}
</div>
{if isset($hotels) && $hotels}
<div class="form-wrapper">
<div class="form-group">
{if isset($edit)}
<label class="control-label col-sm-5">
<span>{l s='Property Name' mod='hotelreservationsystem'} : </span>
</label>
<select class="fixed-width-xl" name="id_hotel">
{foreach $hotels as $hotel}
{if $hotel_id == $hotel.id}
<option readonly="true" selected="true" value="{$hotel.id|escape:'html':'UTF-8'}" >{$hotel.hotel_name|escape:'html':'UTF-8'}</option>
{/if}
{/foreach}
</select>
{else}
<label class="control-label col-sm-5">
<span>{l s='Select Property' mod='hotelreservationsystem'} : </span>
</label>
<div class="col-sm-4">
<select class="fixed-width-xl" name="id_hotel">
<option value='0'>{l s='Select Property' mod='hotelreservationsystem'}</option>>
{foreach $hotels as $hotel}
<option value="{$hotel.id|escape:'html':'UTF-8'}" >{$hotel.hotel_name|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
</div>
{/if}
</div>
</div>
{if isset($features_list) && $features_list}
{assign var=i value=1}
{foreach from=$features_list item=value}
<div class="accordion">
<div class="accordion-section">
<a class="accordion-section-title" href="#accordion{$i}"><span class="icon-plus"></span>&nbsp&nbsp{l s={$value.name} mod='hotelreservationsyatem'}</a>
<div id="accordion{$i}" class="accordion-section-content">
<table id="" class="table" style="max-width:100%">
<tbody>
{if isset($value.children) && $value.children}
{foreach from=$value.children item=val}
<tr>
<td class="border_top border_bottom border_bold">
<span class=""> {l s={$val.name} mod='hotelreservationsyatem'} </span>
</td>
<td style="">
<input name="hotel_fac[]" type="checkbox" value="{$val.id}" class="form-control" {if isset($edit) && $val.selected}checked='true'{/if}>
</td>
</tr>
{/foreach}
{/if}
</tbody>
</table>
</div>
</div>
</div>
{assign var=i value=$i+1}
{/foreach}
{/if}
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminHotelFeatures')|escape:'html':'UTF-8'}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel' mod='hotelreservationsystem'}</a>
<button type="submit" name="submitAddhtl_features" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Assign' mod='hotelreservationsystem'}</button>
<!-- <button type="submit" name="submitAdd{$table|escape:'html':'UTF-8'}AndStay" class="btn btn-default pull-right">
<i class="process-icon-save"></i> {l s='Assign and stay' mod='hotelreservationsystem'}
</button> -->
</div>
{else}
<div class="alert alert-warning">
{l s='No property found to assign features.' mod='hotelreservationsystem'}
</div>
{/if}
</div>
</form>

View File

@@ -21,7 +21,7 @@
*}
<div class="panel htl_conf_panel">
<h3 class="tab"> <i class="icon-cogs"></i>&nbsp;&nbsp; {l s='Hotel Configuration' mod='hotelreservationsystem'}</h3>
<h3 class="tab"> <i class="icon-cogs"></i>&nbsp;&nbsp; {l s='Property Configuration' mod='hotelreservationsystem'}</h3>
<div class="panel-body">
{foreach from=$settings_links item=settings_link}
<div class="btn-group setting-link-div col-sm-3 col-xs-12">

View File

@@ -16,10 +16,10 @@
</div>
</div>
<ul class="nav nav-tabs">
<li class="active"><a href="#avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Available Rooms' mod='hotelreservationsystem'}</a></li>
<li class="active"><a href="#avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Available %s' sprintf=$book_v['selling_object_plural_name'] mod='hotelreservationsystem'}</a></li>
<li><a href="#part_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Partially Available' mod='hotelreservationsystem'}</a></li>
<li><a href="#book_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Booked Rooms' mod='hotelreservationsystem'}</a></li>
<li><a href="#unavail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Unavailable Rooms' mod='hotelreservationsystem'}</a></li>
<li><a href="#book_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Booked %s' sprintf=$book_v['selling_object_plural_name'] mod='hotelreservationsystem'}</a></li>
<li><a href="#unavail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Unavailable %s' sprintf=$book_v['selling_object_plural_name'] mod='hotelreservationsystem'}</a></li>
</ul>
<div class="tab-content panel">
<div id="avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" class="tab-pane active">
@@ -27,7 +27,7 @@
<table class="table">
<thead>
<tr>
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['selling_object_name'] 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>
<th><span class="title_box">{l s='Allotment Type' mod='hotelreservationsystem'}</span></th>
@@ -66,13 +66,13 @@
<button class="btn btn-default btn-left btn-block booking_guest_occupancy input-occupancy" type="button">
<span>{l s='Select occupancy' mod='hotelreservationsystem'}</span>
</button>
<div class="dropdown-menu booking_occupancy_wrapper well well-sm">
<div class="dropdown-menu booking_occupancy_wrapper well well-sm" data-attribute_types="{$book_v['selling_object_plural_name']}" data-attribute_type="{$book_v['selling_object_name']}">
<input type="hidden" class="max_adults" value="{if isset($book_v)}{$book_v['max_adults']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_children" value="{if isset($book_v)}{$book_v['max_children']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_guests" value="{if isset($book_v)}{$book_v['max_guests']|escape:'html':'UTF-8'}{/if}">
<div class="booking_occupancy_inner row">
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1' mod='hotelreservationsystem'}</label></div>
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='%s - 1' sprintf=$book_v['selling_object_name'] mod='hotelreservationsystem'}</label></div>
<div class="col-sm-12">
<div class="row">
<div class="form-group col-xs-6 occupancy_count_block">
@@ -123,7 +123,7 @@
<thead>
<tr>
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['selling_object_name'] mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='Allotment Type' mod='hotelreservationsystem'}</span></th>
{if $occupancy_required_for_booking}
<th class="fixed-width-xxl"><span class="title_box">{l s='Guests' mod='hotelreservationsystem'}</span></th>
@@ -161,7 +161,7 @@
<button class="btn btn-default btn-left btn-block booking_guest_occupancy input-occupancy" type="button">
<span>{l s='Select occupancy' mod='hotelreservationsystem'}</span>
</button>
<div class="dropdown-menu booking_occupancy_wrapper well well-sm">
<div class="dropdown-menu booking_occupancy_wrapper well well-sm" data-attribute_types="{$book_v['selling_object_plural_name']}" data-attribute_type="{$book_v['selling_object_name']}">
<input type="hidden" class="max_adults" value="{if isset($book_v)}{$book_v['max_adults']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_children" value="{if isset($book_v)}{$book_v['max_children']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_guests" value="{if isset($book_v)}{$book_v['max_guests']|escape:'html':'UTF-8'}{/if}">
@@ -216,7 +216,7 @@
<table class="table">
<thead>
<tr>
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['selling_object_name'] 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>
@@ -263,7 +263,7 @@
<table class="table">
<thead>
<tr>
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['selling_object_name'] 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>

View File

@@ -63,4 +63,23 @@
<hr class="hr_style" />
</div>
</div>
<div class="row">
<div class="col-sm-6 indi_cont clearfix">
<span class="color_indicate bg-green"></span>
<span class="indi_label">{l s='Available Rooms' mod='hotelreservationsystem'}</span>
</div>
<div class="col-sm-6 indi_cont clearfix">
<span class="color_indicate bg-yellow"></span>
<span class="indi_label">{l s='Partially Available' mod='hotelreservationsystem'}</span>
</div>
<div class="col-sm-6 indi_cont clearfix">
<span class="color_indicate bg-red"></span>
<span class="indi_label">{l s='Unavailable Rooms' mod='hotelreservationsystem'}</span>
</div>
<div class="col-sm-6 indi_cont clearfix">
<span class="color_indicate bg-blue"></span>
<span class="indi_label">{l s='Booked Rooms' mod='hotelreservationsystem'}</span>
</div>
</div>
</div>

View File

@@ -42,7 +42,7 @@
</div>
<div class="form-group col-sm-12">
<label for="id_hotel" class="control-label col-sm-4 required">
<span title="" data-toggle="tooltip" class="label-tooltip">{l s='Hotel Name' mod='hotelreservationsystem'}</span>
<span title="" data-toggle="tooltip" class="label-tooltip">{l s='Property Name' mod='hotelreservationsystem'}</span>
</label>
<div class="col-sm-8">
<select name="id_hotel" class="form-control" id="id_hotel">
@@ -51,7 +51,7 @@
<option value="{$name_val['id']|escape:'htmlall':'UTF-8'}" {if isset($id_hotel) && ($name_val['id'] == $id_hotel)}selected{/if}>{$name_val['hotel_name']|escape:'htmlall':'UTF-8'}</option>
{/foreach}
{else}
{l s='No hotels available' mod='hotelreservationsystem'}
{l s='No properties available' mod='hotelreservationsystem'}
{/if}
</select>
<input type="hidden" name="search_id_hotel" id="search_id_hotel" {if isset($id_hotel)}value="{$id_hotel|escape:'htmlall':'UTF-8'}"{/if}>
@@ -227,7 +227,7 @@
{else}
<div class="panel">
<div class="panel-heading">
<i class="icon-warning"></i> {l s='No Hotels' mod='hotelreservationsystem'}
<i class="icon-warning"></i> {l s='No Properties Available' mod='hotelreservationsystem'}
</div>
<div class="alert alert-warning">

View File

@@ -155,7 +155,7 @@
{/if}
<th>{l s='Room num' mod='hotelreservationsystem'}</th>
<th>{l s='Room type' mod='hotelreservationsystem'}</th>
<th>{l s='Hotel' mod='hotelreservationsystem'}</th>
<th>{l s='Property' mod='hotelreservationsystem'}</th>
<th>{l s='Duration' mod='hotelreservationsystem'}</th>
<th>{l s='Total cost (tax incl.)' mod='hotelreservationsystem'}</th>
<th>{l s='Total paid amount (tax incl.)' mod='hotelreservationsystem'}</th>
@@ -184,7 +184,7 @@
{displayPrice price=($booking['total_price_tax_incl'] + $booking['extra_service_total_price_tax_incl']) currency=$orderCurrency['id']}
{capture name='refund_total_tooltip'}
<div>
<label>{l s='Room cost:' mod='hotelreservationsystem'}</label>
<label>{l s='%s cost:' sprintf=$booking.selling_object_name mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
<div>
@@ -204,7 +204,7 @@
{displayPrice price=($booking['room_paid_amount'] + $booking['extra_service_total_paid_amount']) currency=$orderCurrency['id']}
{capture name='refund_paid_tooltip'}
<div>
<label>{l s='Room paid amount:' mod='hotelreservationsystem'}</label>
<label>{l s='%s paid amount:' sprintf=$booking.selling_object_name mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['room_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
<div>

View File

@@ -72,8 +72,8 @@ class AdminHotelReviewHotelReviewController extends ModuleAdminController
'class' => 'fixed-width-xs',
),
'hotel_name' => array(
'title' => $this->l('Hotel'),
'hint' => $this->l('Name of the hotel for which this review has been added.'),
'title' => $this->l('Property Name'),
'hint' => $this->l('Name of the property for which this review has been added.'),
'align' => 'left',
'callback' => 'getHotelLink',
),

View File

@@ -56,7 +56,7 @@ class StatsBestCategories extends ModuleGrid
$this->columns = array(
array(
'id' => 'name',
'header' => $this->l('Hotel name'),
'header' => $this->l('Property Name'),
'dataIndex' => 'hotel_name',
'align' => 'center'
),
@@ -65,14 +65,14 @@ class StatsBestCategories extends ModuleGrid
'header' => $this->l('Room nights booked'),
'dataIndex' => 'totalRoomsBooked',
'align' => 'center',
'tooltip' => $this->l('The room nights booked for the hotel.'),
'tooltip' => $this->l('The room nights booked for the property.'),
),
array(
'id' => 'availableRooms',
'header' => $this->l('Available room nights'),
'dataIndex' => 'availableRooms',
'align' => 'center',
'tooltip' => $this->l('The total room nights available for booking for the hotel.'),
'tooltip' => $this->l('The total room nights available for booking for the property.'),
),
array(
'id' => 'totalOrders',

View File

@@ -64,7 +64,7 @@ class StatsBestProducts extends ModuleGrid
),
array(
'id' => 'hotelName',
'header' => $this->l('Hotel name'),
'header' => $this->l('Property Name'),
'dataIndex' => 'hotelName',
'align' => 'center',
),

View File

@@ -46,7 +46,7 @@ class StatsCatalog extends Module
parent::__construct();
$this->displayName = $this->l('Hotel statistics');
$this->displayName = $this->l('Property statistics');
$this->description = $this->l('Adds a tab containing general statistics about your catalog to the Stats dashboard.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.7.0.99');
}
@@ -278,7 +278,7 @@ class StatsCatalog extends Module
<ul class="list-group">
<li class="list-group-item">'.$this->returnLine($this->l('Available room types'), '<span class="badge">'.(int)$total).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Average base price'), '<span class="badge">'.Tools::displayPrice($average_price, $this->context->currency)).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Hotel page views'), '<span class="badge">'.(int)$total_hotel_page_viewed).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Property page views'), '<span class="badge">'.(int)$total_hotel_page_viewed).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Room type page views'), '<span class="badge">'.(int)$total_room_type_page_viewed).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Booked room nights'), '<span class="badge">'.(int)$total_booked_rooms).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Average number of page visits'), '<span class="badge">'.number_format((float)$average_viewed, 2, '.', '')).'</span></li>

View File

@@ -167,7 +167,7 @@ class StatsCheckUp extends Module
<ul class="nav nav-tabs">
<li '.($activeTab == 'hotels' ? 'class="active"' : '').'>
<a href="#statscheckup_hotels" data-toggle="tab">
<span>'.$this->l('Hotels').'</span>
<span>'.$this->l('Properties').'</span>
</a>
</li>
<li '.($activeTab == 'services' ? 'class="active"' : '').'>
@@ -301,7 +301,7 @@ class StatsCheckUp extends Module
<thead>
<tr>
<th><span class="title_box active">'.$this->l('ID').'</span></th>
<th><span class="title_box active">'.(!$this->id_hotel ? $this->l('Hotel') : $this->l('Room type')).'</span></th>
<th><span class="title_box active">'.(!$this->id_hotel ? $this->l('Property') : $this->l('Room type')).'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>';
foreach ($languages as $language) {
$hotelsHtml .= '<th><span class="title_box active">'.$this->l('Desc.').' ('.Tools::strtoupper($language['iso_code']).')</span></th>';

View File

@@ -36,7 +36,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
$this->fields_options = array(
'global' => array(
'title' => $this->l('Hotel Interior Description'),
'title' => $this->l('Property Interior Description'),
'icon' => 'icon-cogs',
'fields' => array(
'HOTEL_INTERIOR_HEADING' => array(
@@ -188,7 +188,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
$this->fields_form = array(
'legend' => array(
'title' => $this->l('Add New Hotel Interior Image'),
'title' => $this->l('Add New Property Interior Image'),
'icon' => 'icon-list-ul'
),
'input' => array(
@@ -200,7 +200,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
),
array(
'type' => 'file',
'label' => $this->l('Hotel Interior Image'),
'label' => $this->l('Property Interior Image'),
'name' => 'interior_img',
'required' => true,
'display_image' => true,
@@ -252,7 +252,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
}
if (!(Tools::getValue("id_interior_image") && !$file['size'])) {
if (!$file['size']) {
$this->errors[] = $this->l('Hotel Interior Image Required.');
$this->errors[] = $this->l('Property Interior Image Required.');
} elseif ($error = ImageManager::validateUpload($file, Tools::getMaxUploadSize())) {
$this->errors[] = $error;
}

View File

@@ -42,7 +42,7 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController
// field options for global fields
$this->fields_options = array(
'global' => array(
'title' => $this->l('Hotel Amenity Setting'),
'title' => $this->l('Property Amenity Setting'),
'icon' => 'icon-cogs',
'fields' => array(
'HOTEL_AMENITIES_HEADING' => array(
@@ -278,7 +278,7 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController
}
if (!$hotelAmenityId || $file['size']) {
if (!$file['size']) {
$this->errors[] = $this->l('Hotel Amenity Image Required.');
$this->errors[] = $this->l('Property Amenity Image Required.');
} elseif ($error = ImageManager::validateUpload($file, Tools::getMaxUploadSize())) {
$this->errors[] = $error;
}

View File

@@ -40,8 +40,8 @@ class WkHotelFeaturesBlock extends Module
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Hotel Features');
$this->description = $this->l('Show Hotel Amenities on the home page using this module.');
$this->displayName = $this->l('Property Features');
$this->description = $this->l('Show Property Amenities on the home page using this module.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}

View File

@@ -41,7 +41,7 @@ class wkhotelfilterblock extends Module
parent::__construct();
$this->displayName = $this->l('Layered filters and sorting block');
$this->description = $this->l('Hotel filter and sorting block');
$this->description = $this->l('Property filter and sorting block');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}

View File

@@ -43,26 +43,26 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
$this->fields_options = array(
'global' => array(
'title' => $this->l('Hotel Room Display Setting'),
'title' => $this->l('Property Room Display Setting'),
'icon' => 'icon-cogs',
'fields' => array(
'HOTEL_ROOM_DISPLAY_HEADING' => array(
'title' => $this->l('Hotel Room Block Title'),
'title' => $this->l('Property Room Block Title'),
'type' => 'textLang',
'lang' => true,
'required' => true,
'validation' => 'isGenericName',
'hint' => $this->l('Enter a title for the hotel rooms block.'),
'hint' => $this->l('Enter a title for the property rooms block.'),
),
'HOTEL_ROOM_DISPLAY_DESCRIPTION' => array(
'title' => $this->l('Hotel room block description'),
'title' => $this->l('Property room block description'),
'type' => 'textareaLang',
'lang' => true,
'required' => true,
'validation' => 'isGenericName',
'rows' => '4',
'cols' => '2',
'hint' => $this->l('Enter a description for the hotel rooms block.'),
'hint' => $this->l('Enter a description for the property rooms block.'),
),
),
'submit' => array('title' => $this->l('Save'))
@@ -91,7 +91,7 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
'orderby' => false,
),
'hotel_name' => array(
'title' => $this->l('Hotel'),
'title' => $this->l('Property'),
'align' => 'center',
'orderby' => false,
),
@@ -335,25 +335,25 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
$languages = Language::getLanguages(false);
if (!trim(Tools::getValue('HOTEL_ROOM_DISPLAY_HEADING_'.$defaultLangId))) {
$this->errors[] = $this->l('Hotel rooms block title is required at least in ').
$this->errors[] = $this->l('Property rooms block title is required at least in ').
$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('HOTEL_ROOM_DISPLAY_HEADING_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('HOTEL_ROOM_DISPLAY_HEADING_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid hotel rooms block title in ').$lang['name'];
$this->errors[] = $this->l('Invalid property rooms block title in ').$lang['name'];
}
}
}
}
if (!trim(Tools::getValue('HOTEL_ROOM_DISPLAY_DESCRIPTION_'.$defaultLangId))) {
$this->errors[] = $this->l('Hotel rooms block description is required at least in ').
$this->errors[] = $this->l('Property rooms block description is required at least in ').
$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('HOTEL_ROOM_DISPLAY_DESCRIPTION_'.$lang['id_lang']))) {
if (!Validate::isGenericName(Tools::getValue('HOTEL_ROOM_DISPLAY_DESCRIPTION_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid hotel rooms block description in ').$lang['name'];
$this->errors[] = $this->l('Invalid property rooms block description in ').$lang['name'];
}
}
}

View File

@@ -28,7 +28,7 @@
{if isset($location_enabled) && $location_enabled}
<div class="form-group grid-item area-4" style="grid-column: span 4;">
<div class="dropdown">
<input type="text" class="form-control header-rmsearch-input input-location" id="hotel_location" name="hotel_location" autocomplete="off" placeholder="{l s='Hotel Location' mod='wkroomsearchblock'}" {if isset($search_data['location'])}value="{$search_data['location']|escape:'htmlall':'UTF-8'}"{/if}>
<input type="text" class="form-control header-rmsearch-input input-location" id="hotel_location" name="hotel_location" autocomplete="off" placeholder="{l s='Property Location' mod='wkroomsearchblock'}" {if isset($search_data['location'])}value="{$search_data['location']|escape:'htmlall':'UTF-8'}"{/if}>
<input hidden="hidden" name="location_category_id" id="location_category_id" {if isset($search_data['location_category_id'])}value="{$search_data['location_category_id']|escape:'htmlall':'UTF-8'}"{/if}>
<ul class="location_search_results_ul dropdown-menu"></ul>
</div>
@@ -50,7 +50,7 @@
<input type="hidden" id="min_booking_offset" name="min_booking_offset" value="{if isset($min_booking_offset)}{$min_booking_offset|escape:'htmlall':'UTF-8'}{/if}">
<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">
<select name="id_hotel" class="chosen header-rmsearch-input" data-placeholder="{l s='Select Property' mod='wkroomsearchblock'}" id="id_hotel_button">
<option value=""></option>
{foreach $hotels_info as $name_val}
<option class="search_result_li" value="{$name_val['id']|escape:'htmlall':'UTF-8'}" data-id-hotel="{$name_val['id']|escape:'htmlall':'UTF-8'}" data-hotel-cat-id="{$name_val['id_category']|escape:'htmlall':'UTF-8'}" data-max_order_date="{$name_val['max_order_date']}" data-min_booking_offset="{$name_val['min_booking_offset']|escape:'htmlall':'UTF-8'}" {if isset($search_data) && $name_val['id'] == $search_data['htl_dtl']['id']}selected{/if}>{$name_val['hotel_name']|escape:'htmlall':'UTF-8'}</option>

View File

@@ -71,13 +71,13 @@ class WkRoomSearchBlock extends Module
'autocompletesearch'
),
'no_results_found_cond' => $this->l('No results found for this search', false, true),
'hotel_name_cond' => $this->l('Please select a hotel name', false, true),
'hotel_name_cond' => $this->l('Please select a property name', false, true),
'check_in_time_cond' => $this->l('Please enter Check In time', false, true),
'check_out_time_cond' => $this->l('Please enter Check Out time', false, true),
'less_checkin_date' => $this->l('Check In date can not be before current date.', false, true),
'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.', false, true),
'hotel_location_txt' => $this->l('Hotel Location', false, true),
'select_htl_txt' => $this->l('Select Hotel', false, true),
'hotel_location_txt' => $this->l('Property Location', false, true),
'select_htl_txt' => $this->l('Select Property', false, true),
'select_age_txt' => $this->l('Select age', false, true),
'under_1_age' => $this->l('Under 1', false, true),
'room_txt' => $this->l('Room', false, true),

View File

@@ -37,7 +37,7 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController
$this->fields_options = array(
'modulesetting' => array(
'title' => $this->l('Hotel Testimonials Setting'),
'title' => $this->l('Property Testimonials Setting'),
'fields' => array(
'HOTEL_TESIMONIAL_BLOCK_HEADING' => array(
'title' => $this->l('Testimonial block title'),
@@ -154,7 +154,7 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController
$this->fields_form = array(
'legend' => array(
'title' => $this->l('Hotel Testimonial Configuration'),
'title' => $this->l('Property Testimonial Configuration'),
'icon' => 'icon-globe'
),
'input' => array(

View File

@@ -42,8 +42,8 @@ class WkTestimonialBlock extends Module
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Hotel Testimonial');
$this->description = $this->l('Show Hotel testimonials on home page using this module.');
$this->displayName = $this->l('Property Testimonial');
$this->description = $this->l('Show Property testimonials on home page using this module.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}

View File

@@ -33,7 +33,7 @@
</td> -->
<td width="33%">
{if !empty($hotel_address)}
<span class="bold">{l s='Hotel Detail' pdf='true'}</span><br/><br/>
<span class="bold">{l s='%s Detail' sprintf=$property_type pdf='true'}</span><br/><br/>
{$hotel_address}
{/if}
</td>

View File

@@ -31,7 +31,7 @@
</tr>
<tr>
<th class="product header">{l s='Room Type / Reference' pdf='true'}</th>
<th class="product header">{l s='Hotel' pdf='true'}</th>
<th class="product header">{l s='Property Name' pdf='true'}</th>
<th class="product header">{l s='Duration' pdf='true'}</th>
<th class="product header">{l s='Num rooms' pdf='true'}</th>
<th class="product header-right">{l s='Total Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>

View File

@@ -36,7 +36,7 @@
{block name='booking_form_hotel_location'}
{if isset($id_hotel) && $id_hotel}
<div class="form-group htl_location_block">
<label for="" class="control-label">{l s='Hotel Location'}</label>
<label for="" class="control-label">{l s='Property Location'}</label>
<p>{$hotel_location|escape:'html':'UTF-8'}</p>
</div>
{/if}
@@ -66,7 +66,7 @@
{include file="./occupancy_field.tpl"}
{/block}
{else}
<label class="control-label">{l s='No. of Rooms'}</label>
<label class="control-label">{l s='No. of %s' sprintf=$room_type_info['selling_object_plural_name']}</label>
{block name='quantity_field'}
{include file="./quantity_field.tpl"}
{/block}
@@ -79,7 +79,7 @@
<hr class="separator-hr-mg-10">
<div class="row price_desc_block">
<div class="col-sm-6">
<label class="control-label">{l s='Room Price'}</label>
<label class="control-label">{l s='%s Price' sprintf=$room_type_info['selling_object_name']}</label>
<p>
<span class="total_price_block">{convertPrice price=$rooms_price|floatval}</span>
<span class="pull-right plus-sign">+</span>
@@ -100,7 +100,7 @@
<div class="services-info-tooltip-cont">
{if isset($selected_service_product) && $selected_service_product}
<div class="extra-service-panel">
<p class="panel_title">{l s='Selected services'} <span>{l s='(Per room)'}</span></p>
<p class="panel_title">{l s='Selected services'} <span>{l s='(Per %s)' sprintf=$room_type_info['selling_object_name']}</span></p>
<div class="services-list">
{foreach $selected_service_product as $product}
<div class="services-list-row">
@@ -160,7 +160,7 @@
<span class="num_searched_avail_rooms">
{$total_available_rooms|escape:'html':'UTF-8'}
</span>
{if $total_available_rooms > 1} {l s='rooms left!'} {else} {l s='room left!'} {/if}
{if $total_available_rooms > 1} {l s='%s left!' sprintf=$room_type_info['selling_object_plural_name']} {else} {l s='%s left!' sprintf=$room_type_info['selling_object_name']} {/if}
</div>
{/if}
{/block}
@@ -200,7 +200,7 @@
{/if}
</span>
{else}
<span>{l s='All rooms sold out!'}</span>
<span>{l s='All %s sold out!' sprintf=$room_type_info['selling_object_plural_name']}</span>
{/if}
</div>
{/if}
@@ -228,6 +228,12 @@
</div> {l s='Buy Standalone.'}
</label>
</div>
<label class="control-label">{l s='Select Property'}</label>
<select class="chosen input-hotel" name="id_hotel" id="service_id_hotel">
{foreach $associated_hotels as $hotel}
<option value="{$hotel.id_hotel}" {if isset($service_id_hotel) && $service_id_hotel == $hotel['id_hotel']}selected{elseif $hotel@first}selected{/if}>{$hotel.name}</option>
{/foreach}
</select>
</div>
{/if}
{/block}
@@ -356,7 +362,7 @@
{/if}
{* {if $order_date_restrict}
<div class="order_restrict_alert">
<span>{l s='You can\'t book rooms after %s.' sprintf=[{dateFormat date=$max_order_date full=0}]}</span>
<span>{l s='You can\'t book stays after %s.' sprintf=[{dateFormat date=$max_order_date full=0}]}</span>
</div>
{/if} *}
</form>

View File

@@ -42,7 +42,7 @@
<div class="row accordion-section">
<div class="col-sm-12 additional_service_header">
<a class="accordion-section-title {if $roomCount == 1}active{/if}" href="#accordion_service_{$key|escape:'html':'UTF-8'}">
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}&nbsp;
{$room_type_info['selling_object_name']} {$roomCount|escape:'html':'UTF-8'}&nbsp;
<span>({if {$cartRoom['adults']} <= 9}0{$cartRoom['adults']}{else}{$cartRoom['adults']}{/if} {if $cartRoom['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$cartRoom['children']} <= 9}0{$cartRoom['children']}{else}{$cartRoom['children']}{/if} {if $cartRoom['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</a>
</div>

View File

@@ -25,7 +25,7 @@
<button class="form-control booking_guest_occupancy input-occupancy{if isset($error) && $error == 1} error_border{/if}" type="button">
<span class="">
{if isset($occupancies) && $occupancies}
{if (isset($occupancy_adults) && $occupancy_adults)}{$occupancy_adults} {if $occupancy_adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if isset($occupancy_children) && $occupancy_children}{$occupancy_children} {if $occupancy_children > 1} {l s='Children'}{else}{l s='Child'}{/if}, {/if}{$occupancies|count} {if $occupancies|count > 1}{l s='Rooms'}{else}{l s='Room'}{/if}{else}{l s='1 Adult, 1 Room'}{/if}
{if (isset($occupancy_adults) && $occupancy_adults)}{$occupancy_adults} {if $occupancy_adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if isset($occupancy_children) && $occupancy_children}{$occupancy_children} {if $occupancy_children > 1} {l s='Children'}{else}{l s='Child'}{/if}, {/if}{$occupancies|count} {if $occupancies|count > 1}{$room_type_info['selling_object_plural_name']|escape:'html':'UTF-8'}{else}{$room_type_info['selling_object_name']|escape:'html':'UTF-8'}{/if}{else}1 {l s='Adult'}, 1 {$room_type_info['selling_object_name']|escape:'html':'UTF-8'}{/if}
{else}
{l s='Select Occupancy'}
{/if}
@@ -34,7 +34,7 @@
{/block}
{block name='occupancy_field_content'}
<div class="dropdown-menu booking_occupancy_wrapper">
<div class="dropdown-menu booking_occupancy_wrapper" data-selling-object="{$room_type_info['selling_object_name']|escape:'html':'UTF-8'}" data-multiple-selling-object="{$room_type_info['selling_object_plural_name']|escape:'html':'UTF-8'}">
<input type="hidden" class="max_avail_type_qty" value="{if isset($total_available_rooms)}{$total_available_rooms|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_adults" value="{$room_type_info['max_adults']|escape:'html':'UTF-8'}">
<input type="hidden" class="max_children" value="{$room_type_info['max_children']|escape:'html':'UTF-8'}">
@@ -46,7 +46,7 @@
{assign var=countRoom value=1}
{foreach from=$occupancies key=key item=$occupancy name=occupancyInfo}
<div class="occupancy_info_block selected" occ_block_index="{$key|escape:'htmlall':'UTF-8'}">
<div class="occupancy_info_head"><span class="room_num_wrapper">{l s='Room'} - {$countRoom|escape:'htmlall':'UTF-8'} </span>{if !$smarty.foreach.occupancyInfo.first}<a class="remove-room-link pull-right" href="#">{l s='Remove'}</a>{/if}</div>
<div class="occupancy_info_head"><span class="room_num_wrapper">{$room_type_info['selling_object_name']|escape:'htmlall':'UTF-8'} - {$countRoom|escape:'htmlall':'UTF-8'} </span>{if !$smarty.foreach.occupancyInfo.first}<a class="remove-stay-link pull-right" href="#">{l s='Remove'}</a>{/if}</div>
<div class="row">
<div class="form-group col-sm-5 col-xs-6 occupancy_count_block">
<div class="row">
@@ -117,7 +117,7 @@
{/foreach}
{else}
<div class="occupancy_info_block" occ_block_index="0">
<div class="occupancy_info_head"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
<div class="occupancy_info_head"><span class="room_num_wrapper">{$room_type_info['selling_object_name']|escape:'htmlall':'UTF-8'} - 1</span></div>
<div class="row">
<div class="form-group col-sm-5 col-xs-6 occupancy_count_block">
<div class="row">
@@ -186,7 +186,7 @@
<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>
<span>{l s='Add Room'}</span>
<span>{l s='Add'} {$room_type_info['selling_object_name']|escape:'html':'UTF-8'}</span>
</a>
</span>
<span>

View File

@@ -41,7 +41,7 @@
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="room_additional_services">
<div class="additional_service_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
{$room_type_info['selling_object_name']} {$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_service_detail">

View File

@@ -19,7 +19,6 @@
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*}
<div class="product-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
<div class="row">
{block name='order_room_detail_room_image'}
@@ -42,20 +41,20 @@
{if $rm_v['count_cancelled'] > 0}
<span class="badge badge-danger">
{if $rm_v['count_cancelled'] > 1}
{$rm_v['count_cancelled']} {l s='Rooms Cancelled'}
{$rm_v['count_cancelled']} {l s='%s Cancelled' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}
{else}
{$rm_v['count_cancelled']} {l s='Room Cancelled'}
{$rm_v['count_cancelled']} {l s='%s Cancelled' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}
{/if}
</span>
{/if}
{if $rm_v['count_refunded'] > 0}
<span class="badge badge-danger">
{if $rm_v['count_refunded'] > 1}
{$rm_v['count_refunded']} {l s='Rooms Refunded'}
{else}
{$rm_v['count_refunded']} {l s='Room Refunded'}
{/if}
</span>
<span class="badge badge-danger">
{if $rm_v['count_refunded'] > 1}
{$rm_v['count_refunded']} {l s='%s Refunded' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}
{else}
{$rm_v['count_refunded']} {l s='%s Refunded' sprintf=$data_v.selling_object_name|escape:'html':'UTF-8'}
{/if}
</span>
{/if}
</div>
{/if}
@@ -82,7 +81,7 @@
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Rooms'}</dt>
<dt class="col-xs-5">{if $rm_v.num_rm > 1}{$data_v.selling_object_plural_name|escape:'html':'UTF-8'}{else}{$data_v.selling_object_name|escape:'html':'UTF-8'}{/if}</dt>
<dd class="col-xs-7">{$rm_v.num_rm|string_format:'%02d'}</dd>
</div>
</div>
@@ -128,7 +127,9 @@
{capture name='htl_room_price_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row">
<div><p>{l s='Room(s) cost:'}</p></div>
<div>
<p>{l s='%s cost:' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}

View File

@@ -45,7 +45,7 @@
<a href="{$room_v['product_link']|escape:'htmlall':'UTF-8'}"><p class="rm_heading col-sm-12 col-md-7">{$room_v['name']|escape:'htmlall':'UTF-8'}</p></a>
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
<p class="rm_left col-sm-12 col-md-5" {if !empty($display_all_room_types) || $room_v['room_left'] > $warning_num} style="display:none"{/if}>
{l s='Hurry!'} <span class="remain_rm_qty">{$room_v['room_left']|escape:'htmlall':'UTF-8'}</span> {l s='rooms left'}
{l s='Hurry!'} <span class="remain_rm_qty">{$room_v['room_left']|escape:'htmlall':'UTF-8'}</span> {l s='%s left' sprintf=$room_v['selling_object_plural_name']}
</p>
{/if}
</div>
@@ -158,7 +158,7 @@
{/foreach}
{else}
<div class="noRoomsAvailAlert">
<span>{l s='No room available for this hotel!'}</span>
<span>{l s='No room available for this property!'}</span>
</div>
{/if}

View File

@@ -1232,13 +1232,19 @@ var ajaxCart = {
let rooms = 0;
let adults = 0;
let children = 0;
if (typeof product.layer_cart_attribute_label !== 'undefined') {
$('#layer_cart .layer_cart_attribute_type').text(product.layer_cart_attribute_label);
}
if(typeof product.layer_cart_room_success_msg !== 'undefined'){
$('#layer_cart .layer_cart_room_success_msg').text(product.layer_cart_room_success_msg);
}
if (occupancy_required_for_booking) {
$.each(product.occupancy, function(index, val) {
rooms++;
adults += parseInt(val.adults);
children += parseInt(val.children);
});
product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms,product.room_info.selling_object_name, product.room_info.selling_object_plural_name);
} else {
product_quantity_text = product.occupancy;
}

View File

@@ -25,10 +25,11 @@ $(document).ready(function(){
booking_occupancy_inner = $(this).closest('.booking_occupancy_inner');
var booking_occupancy_wrapper = $(this).closest('.booking_occupancy_wrapper');
var room_type_selling_keys = getRoomTypeSellingObjects(booking_occupancy_wrapper);
$(this).closest('.occupancy_info_block').hide('fast', function(){
$(this).remove()
$(booking_occupancy_inner).find('.room_num_wrapper').each(function(key, val) {
$(this).text(room_txt + ' - '+ (key+1) );
$(this).text(room_type_selling_keys.selling_object + ' - '+ (key+1) );
});
var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length);
if (countRooms < $(booking_occupancy_wrapper).find('.max_avail_type_qty').val()) {
@@ -232,10 +233,11 @@ $(document).ready(function(){
return true;
}
$(document).on('click', '.booking_occupancy_wrapper .add_new_occupancy_btn', function(e) {
$(document).on('click', '.booking_occupancy_wrapper .add_new_occupancy_btn', function(e) {
e.preventDefault();
var booking_occupancy_wrapper = $(this).closest('.booking_occupancy_wrapper');
var room_type_selling_keys = getRoomTypeSellingObjects(booking_occupancy_wrapper);
var occupancy_block = '';
var roomBlockIndex = parseInt($(booking_occupancy_wrapper).find(".occupancy_info_block").last().attr('occ_block_index'));
roomBlockIndex += 1;
@@ -248,7 +250,7 @@ $(document).ready(function(){
&& countRooms <= $(booking_occupancy_wrapper).find('.max_avail_type_qty').val()
) {
occupancy_block += '<div class="occupancy_info_block" occ_block_index="'+roomBlockIndex+'" style="display:none;">';
occupancy_block += '<div class="occupancy_info_head"><span class="room_num_wrapper">'+ room_txt + ' - ' + countRooms + '</span><a class="remove-room-link pull-right" href="#">' + remove_txt + '</a></div>';
occupancy_block += '<div class="occupancy_info_head"><span class="room_num_wrapper">'+ room_type_selling_keys.selling_object + ' - ' + countRooms + '</span><a class="remove-room-link pull-right" href="#">' + remove_txt + '</a></div>';
occupancy_block += '<div class="row">';
occupancy_block += '<div class="form-group col-sm-5 col-xs-6 occupancy_count_block">';
occupancy_block += '<div class="row">';
@@ -359,6 +361,7 @@ function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
var adults = 0;
var children = 0;
var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length;
var room_type_selling_keys = getRoomTypeSellingObjects(booking_occupancy_wrapper);
$(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) {
adults += parseInt($(this).val());
@@ -366,11 +369,11 @@ function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
$(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) {
children += parseInt($(this).val());
});
guestButtonVal = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
guestButtonVal = getRoomTypeGuestOccupancyFormated(adults, children, rooms, room_type_selling_keys.selling_object, room_type_selling_keys.miltiple_selling_object);
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
}
function getRoomTypeGuestOccupancyFormated(adults, children, rooms)
function getRoomTypeGuestOccupancyFormated(adults, children, rooms, selling_object, miltiple_selling_object)
{
var guestButtonVal = parseInt(adults) + ' ';
if (parseInt(adults) > 1) {
@@ -386,14 +389,25 @@ function getRoomTypeGuestOccupancyFormated(adults, children, rooms)
}
}
if (parseInt(rooms) > 1) {
guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt;
guestButtonVal += ', ' + parseInt(rooms) + ' ' + miltiple_selling_object;
} else {
guestButtonVal += ', ' + parseInt(rooms) + ' ' + room_txt;
guestButtonVal += ', ' + parseInt(rooms) + ' ' + selling_object;
}
return guestButtonVal;
}
function getRoomTypeSellingObjects(booking_occupancy_wrapper)
{
var $wrapper = $(booking_occupancy_wrapper);
var selling_object = $wrapper.attr('data-selling-object');
var miltiple_selling_object = $wrapper.attr('data-multiple-selling-object');
return {
selling_object,
miltiple_selling_object
};
}
function resetOccupancyField(booking_occupancy_wrapper)
{

View File

@@ -205,7 +205,7 @@
<span class="cross" title="{l s='Close window' mod='blockcart'}"></span>
{block name='blockcart_layer_cart_left_heading'}
<h2 class="layer_cart_room_txt">
<i class="icon-check"></i>{l s='Room successfully added to your cart' mod='blockcart'}
<i class="icon-check"></i><span class="layer_cart_room_success_msg">{l s='Room successfully added to your cart' mod='blockcart'}</span>
</h2>
<h2 class="layer_cart_product_txt">
<i class="icon-check"></i>{l s='Product successfully added to your cart' mod='blockcart'}
@@ -224,7 +224,7 @@
<span id="layer_cart_product_time_duration"></span>
</div>
<div>
<strong class="dark layer_cart_product_txt">{l s='Hotel Name' mod='blockcart'} &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_product_txt">{l s='Property Name' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_hotel_name"></span>
</div>
<div>
@@ -232,12 +232,12 @@
<span id="layer_cart_product_unit_price"></span>
</div>
<div>
<strong class="dark layer_cart_room_txt">{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if} &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_room_txt"><span class="layer_cart_attribute_type">{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if}</span> &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_product_txt">{l s='Quantity' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_quantity"></span>
</div>
<div>
<strong class="dark layer_cart_room_txt">{l s='Room type cost' mod='blockcart'} &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_room_txt"><span class="layer_cart_room_type_cost_label">{l s='Room type cost' mod='blockcart'}</span> &nbsp;-&nbsp;</strong>
<strong class="dark layer_cart_product_txt">{l s='Total' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_price"></span>
</div>

View File

@@ -117,7 +117,7 @@
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Rooms'}</dt>
<dt class="col-xs-5">{if $rm_v.num_rm > 1}{$data_v['selling_object_plural_name']|escape:'html':'UTF-8'}{else}{$data_v['selling_object_name']}{/if}</dt>
<dd class="col-xs-7">{$rm_v.num_rm|string_format:'%02d'}</dd>
</div>
</div>
@@ -162,7 +162,9 @@
{capture name='htl_order_price_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row">
<div><p>{l s='Room cost'} : </p></div>
<div>
<p>{l s='%s cost' sprintf=$data_v['selling_object_plural_name']} : </p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}

View File

@@ -78,7 +78,7 @@
{if isset($obj_hotel_branch_information) && $obj_hotel_branch_information}
<div class="card hotel-details">
<div class="card-header">
{l s='Hotel Details'}
{l s='%s Details' sprintf=$property_type}
<div class="booking-actions-wrap">
<div class="row">
<div class="col-xs-12 clearfix">
@@ -102,7 +102,7 @@
<div class="description-list">
<dl class="">
<div class="row">
<dt class="col-xs-6 col-sm-3">{l s='Hotel Name'}</dt>
<dt class="col-xs-6 col-sm-3">{l s='%s Name' sprintf=$property_type}</dt>
<dd class="col-xs-6 col-sm-3">{$obj_hotel_branch_information->hotel_name}</dd>
<dt class="col-xs-6 col-sm-3">{l s='Phone Number'}</dt>
<dd class="col-xs-6 col-sm-3">
@@ -121,7 +121,7 @@
</dl>
</div>
{else}
<div class="card-text">{l s='Hotel details not available.'}</div>
<div class="card-text">{l s='Property details not available.'}</div>
{/if}
</div>
</div>
@@ -186,7 +186,7 @@
{if isset($obj_hotel_branch_information)}
<div class="card hotel-location visible-xs visible-sm hidden-md hidden-lg">
<div class="card-header">
{l s='Hotel Location'}
{l s='%s Location' sprintf=$property_type}
</div>
<div class="card-body">
<p class="card-subtitle">
@@ -201,7 +201,7 @@
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
</p>
{else}
<div class="card-text">{l s='Hotel location not available.'}</div>
<div class="card-text">{l s='%s location not available.' sprintf=$property_type}</div>
{/if}
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
@@ -258,7 +258,7 @@
{/block}
</div>
{else}
<div class="no-rooms card-text">{l s='Room details not available.'}</div>
<div class="no-stays card-text">{l s='Room details not available.'}</div>
{/if}
</div>
</div>
@@ -337,7 +337,7 @@
{assign var=total_standard_products_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL))}
{if isset($cart_htl_data) && $cart_htl_data}
<tr>
<td>{l s='Total rooms cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
<td>{l s='Total Rooms Cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
<td class="text-right">
{if $priceDisplay && $use_tax}
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_excl + $room_services_price_tax_excl - $total_convenience_fee_te) currency=$currency}</span>
@@ -513,7 +513,7 @@
<ul class="nav nav-tabs">
{if $has_general_hotel_policies}
<li class="active">
<a href="#tab-hotel-policies-general" data-toggle="tab">{l s='Hotel Policies'}</a>
<a href="#tab-hotel-policies-general" data-toggle="tab">{l s='%s Policies' sprintf=$property_type}</a>
</li>
{/if}
{if $has_refund_hotel_policies}
@@ -704,7 +704,7 @@
{if isset($obj_hotel_branch_information)}
<div class="card hotel-location hidden-xs hidden-sm visible-md">
<div class="card-header">
{l s='Hotel Location'}
{l s='%s Location' sprintf=$property_type}
</div>
<div class="card-body">
<p class="card-subtitle">
@@ -720,7 +720,7 @@
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
</p>
{else}
<div class="card-text">{l s='Hotel location not available.'}</div>
<div class="card-text">{l s='%s location not available.' sprintf=$property_type}</div>
{/if}
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
@@ -765,7 +765,7 @@
{if isset($cart_htl_data) && $cart_htl_data}
<tr>
<td>{l s='Total rooms cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
<td>{l s='Total Rooms Cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
<td class="text-right">
{if $priceDisplay && $use_tax}
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_excl + $room_services_price_tax_excl - $total_convenience_fee_te) currency=$currency}</span>
@@ -996,11 +996,11 @@
<div class="refund_element_summary clearfix">
<p class="refund_element_name">{$data_v.name}</p>
<div class="col-xs-3">
<p>{l s='Total Rooms'}</p>
<p>{l s='Total %s' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}</p>
<strong>{$rm_v.num_rm|string_format:'%02d'}</strong>
</div>
<div class="col-xs-3">
<p>{l s='Cancelled Rooms'}</p>
<p>{l s='Cancelled %s' sprintf=$data_v.selling_object_plural_name|escape:'html':'UTF-8'}</p>
<strong>{($rm_v.count_cancelled + $rm_v.count_refunded)|string_format:'%02d'}</strong>
</div>
</div>
@@ -1012,7 +1012,7 @@
<div class="checkbox">
<label for="bookings_to_refund_{$hotel_booking_detail.id_htl_booking}">
<input type="checkbox" class="bookings_to_refund" id="bookings_to_refund_{$hotel_booking_detail.id_htl_booking}" name="bookings_to_refund[]" value="{$hotel_booking_detail.id_htl_booking|escape:'html':'UTF-8'}" {if $is_room_cancelled || ($hotel_booking_detail.id_status != $ROOM_STATUS_ASSIGNED)}disabled{/if}/>
{l s='Room'} - {$smarty.foreach.foreachRefundRooms.iteration|string_format:'%02d'}
{l s='%s - %s' sprintf=[$data_v.selling_object_name|escape:'html':'UTF-8', $smarty.foreach.foreachRefundRooms.iteration|string_format:'%02d']}
</label>
<span>({$hotel_booking_detail.adults|string_format:'%02d'} {if $hotel_booking_detail.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $hotel_booking_detail.children > 0}{l s=', '}{$hotel_booking_detail.children|string_format:'%02d'} {if $hotel_booking_detail.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
@@ -1039,7 +1039,7 @@
</div>
{else}
<div class="extra-services-wrap clearfix">
<p class="text-muted">{l s='No extra services added for this room.'}</p>
<p class="text-muted">{l s='No extra services added for this %s.' sprintf=$data_v.selling_object_name|escape:'html':'UTF-8'}</p>
</div>
{/if}
</div>

View File

@@ -62,7 +62,7 @@
<div class="card-header" id="shopping-cart-summary-head">
{block name='order_opc_rooms_summary_heading'}
<h5 class="accordion-header" data-toggle="collapse" data-target="#collapse-shopping-cart" aria-expanded="true" aria-controls="collapse-shopping-cart">
<span>{l s='Rooms & Price Summary'}</span>
<span>{l s='Summary'}</span>
<i class="icon-angle-left pull-right accordion-left-arrow {if $step->step_is_current}hidden{/if}"></i>
</h5>
{/block}

View File

@@ -61,7 +61,7 @@
<tr>
<th>{l s='Rooms'}</th>
<th>{l s='Room type'}</th>
<th>{l s='Hotel'}</th>
<th>{l s='Property Name'}</th>
<th>{l s='Duration'}</th>
<th>{l s='Total rooms price (tax incl.)'}</th>
<th>{l s='Extra services price (tax incl.)'}</th>

View File

@@ -205,14 +205,13 @@
{/block}
{/if}
</div>
<div class="product_info_containter">
<!-- tab hook is added here -->
<!--HOOK_PRODUCT_TAB -->
<section class="page-product-box">
{block name='product_tabs'}
<ul class="nav nav-tabs product_description_tabs">
<li class="active"><a href="#product_info_tab" class="idTabHrefShort" data-toggle="tab">{if $product->booking_product}{l s='Room Information'}{else}{l s='Product Information'}{/if}</a></li>
<li class="active"><a href="#product_info_tab" class="idTabHrefShort" data-toggle="tab">{if $product->booking_product}{l s='%s Information' sprintf=$room_type_info['selling_object_name']}{else}{l s='Product Information'}{/if}</a></li>
{* Block for booking products *}
{if isset($id_hotel) && $id_hotel}
<li><a href="#refund_policies_tab" class="idTabHrefShort" data-toggle="tab">{l s='Refund Policies'}</a></li>
@@ -304,7 +303,7 @@
{if isset($room_dynamic_amenities) && $room_dynamic_amenities}
<div class="info_margin_div">
<div class="room_info_heading">
<span>{l s='Room Amenities'}</span>
<span>{l s='%s Amenities' sprintf=$property_type}</span>
</div>
<div class="room_info_content row">
{foreach from=$room_dynamic_amenities item=amenity}
@@ -352,7 +351,7 @@
{if isset($hotel_description) && $hotel_description}
<div class="info_margin_div">
<div class="room_info_heading">
<span>{l s='Hotel Description'}</span>
<span>{l s='%s Description' sprintf=$property_type}</span>
</div>
<div class="room_info_content">
{$hotel_description}
@@ -366,7 +365,7 @@
<div class="room_info_hotel_images_wrap">
<div class="info_margin_div">
<div class="room_info_heading">
<span>{l s='Hotel Images'}</span>
<span>{l s='Property Images'}</span>
</div>
<div class="room_info_content" id="room_info_hotel_images">
<div class="row images-wrap"></div>
@@ -401,7 +400,7 @@
{if isset($hotel_policies) && $hotel_policies}
<div class="info_margin_div">
<div class="room_info_heading">
<span>{l s='Hotel Policies'}</span>
<span>{l s='%s Policies' sprintf=$property_type}</span>
</div>
<div class="room_info_content">
<p class="">{$hotel_policies}</p>

View File

@@ -101,10 +101,23 @@
<p class="room_duration_block_value">{$rm_v['data_to']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_to']|date_format:"%H:%M"}{/if}</p>
</div>
<div class="col-sm-6 col-xs-6">
<p class="room_duration_block_head">{l s='OCCUPANCY'}</p>
<p class="room_duration_block_value">
{if {$rm_v['adults']} <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else}{$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}, {if {$rm_v['num_rm']} <= 9}0{/if}{$rm_v['num_rm']}{if $rm_v['num_rm'] > 1} {l s='Rooms'}{else} {l s='Room'}{/if}
</p>
{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}
<p class="room_duration_block_head">{l s='OCCUPANCY'}</p>
<p class="room_duration_block_value">
{if {$rm_v['adults']} <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else}{$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}, {if {$rm_v['num_rm']} <= 9}0{/if}{$rm_v['num_rm']}{if $rm_v['num_rm'] > 1} {$data_v['selling_object_plural_name']|escape:'html':'UTF-8'}{else} {$data_v['selling_object_name']|escape:'html':'UTF-8'}{/if}
</p>
{else}
<p class="room_duration_block_head">{l s='QUANTITY'}</p>
<p class="room_duration_block_value">
{if $rm_v['num_rm'] <= 9}0{/if}{$rm_v['num_rm']}
{if $rm_v['num_rm'] > 1}
{$data_v['selling_object_plural_name']|escape:'html':'UTF-8'}
{else}
{$data_v['selling_object_name']|escape:'html':'UTF-8'}
{/if}
</p>
{/if}
</div>
</div>
{/block}
@@ -133,7 +146,7 @@
{/if}
</div>
<p class="total_price_detial">
{l s='Total rooms price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
{l s='Total %s price' sprintf=$data_v['selling_object_plural_name']|escape:'html':'UTF-8'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
</p>
</div>
</div>