Merge branch 'develop' into gli-3051
4
admin/themes/default/img/icon-info.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="8" cy="8" r="8" fill="#7EC77B"/>
|
||||
<path d="M8.06536 3C8.30937 3 8.51561 3.07032 8.6841 3.21097C8.85839 3.34693 8.94553 3.51336 8.94553 3.71027C8.94553 3.90717 8.85839 4.07595 8.6841 4.2166C8.51561 4.35724 8.30937 4.42757 8.06536 4.42757C7.82135 4.42757 7.6122 4.35724 7.43791 4.2166C7.26362 4.07595 7.17647 3.90717 7.17647 3.71027C7.17647 3.51336 7.26071 3.34693 7.42919 3.21097C7.60349 3.07032 7.81554 3 8.06536 3ZM8.78867 6.3685V11.5443C8.78867 11.9475 8.82353 12.2171 8.89325 12.353C8.96877 12.4843 9.07625 12.5827 9.21569 12.6484C9.36093 12.714 9.62237 12.7468 10 12.7468V13H6.122V12.7468C6.51126 12.7468 6.77269 12.7164 6.90632 12.6554C7.03994 12.5945 7.14452 12.4937 7.22004 12.353C7.30138 12.2124 7.34205 11.9428 7.34205 11.5443V9.06188C7.34205 8.36334 7.3159 7.91092 7.26362 7.70464C7.22295 7.55462 7.15904 7.45148 7.0719 7.39522C6.98475 7.33427 6.86565 7.3038 6.7146 7.3038C6.55192 7.3038 6.35439 7.33896 6.122 7.40928L6 7.15612L8.40523 6.3685H8.78867Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -478,4 +478,42 @@ $(document).ready(function() {
|
||||
$('.no-htl-access-option').on('click', function() {
|
||||
$(this).prop('selected', false);
|
||||
});
|
||||
initTooltip();
|
||||
}); //end dom ready
|
||||
|
||||
function initTooltip($target, contentFn, items) {
|
||||
var $elements = $target || $('.tooltip-trigger');
|
||||
if (!$elements.length) {
|
||||
return;
|
||||
}
|
||||
$elements.each(function () {
|
||||
var $this = $(this);
|
||||
if (!contentFn && $this.data('ui-tooltip')) {
|
||||
return;
|
||||
}
|
||||
$this.tooltip({
|
||||
content: contentFn || $this.next('.tooltip-content').html(),
|
||||
items: items || 'span',
|
||||
trigger: 'hover',
|
||||
tooltipClass: 'tooltip-popup',
|
||||
open: function (event, ui) {
|
||||
if (event.buttons == 1 || event.buttons == 3) {
|
||||
ui.tooltip.remove();
|
||||
}
|
||||
if (typeof event.originalEvent === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
var $id = $(ui.tooltip).attr('id');
|
||||
if ($('div.ui-tooltip').not('#' + $id).length) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
close: function (event, ui) {
|
||||
ui.tooltip.hover(
|
||||
function () { $(this).stop(true).fadeTo(300, 1); },
|
||||
function () { $(this).fadeOut(300, function () { $(this).remove(); }); }
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -3,6 +3,10 @@ Modernizr.load([
|
||||
test: window.matchMedia,
|
||||
nope: ["themes/default/js/vendor/matchMedia.js", "themes/default/js/vendor/matchMedia.addListener.js"]
|
||||
},
|
||||
"themes/default/js/vendor/enquire.min.js",
|
||||
"themes/default/js/admin-theme.js",
|
||||
{
|
||||
load: ["themes/default/js/vendor/enquire.min.js", "themes/default/js/admin-theme.js"],
|
||||
complete: function() {
|
||||
$(document).trigger('admin-theme.js.ready');
|
||||
}
|
||||
}
|
||||
]);
|
||||
@@ -1,5 +1,4 @@
|
||||
.tooltip_cont
|
||||
min-width: 280px
|
||||
width: 100%
|
||||
font-size: 14px
|
||||
font-weight: 600
|
||||
@@ -7,6 +6,7 @@
|
||||
margin-bottom: 10px
|
||||
.tip-body > div
|
||||
margin-bottom: 6px
|
||||
margin-right: 10px
|
||||
|
||||
.tip_element_head
|
||||
font-size: 12px
|
||||
@@ -28,3 +28,30 @@
|
||||
border: none
|
||||
padding: 10px
|
||||
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.15)
|
||||
width: auto
|
||||
|
||||
.tooltip-trigger
|
||||
cursor: pointer
|
||||
display: inline-block
|
||||
vertical-align: middle
|
||||
|
||||
|
||||
|
||||
.ui-tooltip.tooltip-popup
|
||||
ul
|
||||
margin: 0
|
||||
padding: 0 0 0 16px
|
||||
list-style: disc
|
||||
li
|
||||
padding: 2px 0
|
||||
|
||||
.tooltip-popup-row
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
align-items: center
|
||||
gap: 12px
|
||||
margin: 3px 0
|
||||
white-space: nowrap
|
||||
label
|
||||
font-weight: 600
|
||||
margin: 0
|
||||
|
||||
@@ -124,8 +124,15 @@
|
||||
{/if}
|
||||
<td id="cart_detail_data_unit_price_{$data.id|escape:'html':'UTF-8'}">
|
||||
{assign var=shown_room_type_price value=$data.feature_price_tax_excl}
|
||||
{if isset($can_edit_booking_carts)}
|
||||
{assign var=can_edit_booking_cart_price value=$can_edit_booking_carts}
|
||||
{elseif isset($can_edit)}
|
||||
{assign var=can_edit_booking_cart_price value=$can_edit}
|
||||
{else}
|
||||
{assign var=can_edit_booking_cart_price value=0}
|
||||
{/if}
|
||||
<div class="input-group">
|
||||
<input type="text" class="room_unit_price" value="{Tools::ps_round($shown_room_type_price, $smarty.const._PS_PRICE_DISPLAY_PRECISION_)|escape:'html':'UTF-8'}">
|
||||
<input type="text" class="room_unit_price" value="{Tools::ps_round($shown_room_type_price, $smarty.const._PS_PRICE_DISPLAY_PRECISION_)|escape:'html':'UTF-8'}"{if !$can_edit_booking_cart_price} readonly="readonly"{/if}>
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
{**
|
||||
* 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
|
||||
*}
|
||||
|
||||
{capture name='stay_periods_tooltip'}
|
||||
<div class="bootstrap tooltip_cont">
|
||||
<div class="tip_header">
|
||||
<div>{l s='Stay Periods'}</div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="tip_element_head">{l s='Duration'}</th>
|
||||
<th class="tip_element_head">{l s='Rooms'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$stay_periods item=stay_period}
|
||||
<tr>
|
||||
<td class="tip_element_value">{$stay_period.from} – {$stay_period.to}</td>
|
||||
<td class="tip_element_value center">{$stay_period.count}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/capture}
|
||||
{capture name='stay_periods_tooltip_title'}<span class="badge tooltip-trigger">+{$extra_stay_periods_count}</span>{/capture}
|
||||
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.stay_periods_tooltip tooltip_title=$smarty.capture.stay_periods_tooltip_title}
|
||||
@@ -27,6 +27,8 @@
|
||||
var id_cart = {$cart->id|intval};
|
||||
{/if}
|
||||
var id_customer = 0;
|
||||
var can_edit_booking_carts = {if isset($can_edit_booking_carts) && $can_edit_booking_carts}true{else}false{/if};
|
||||
var can_add_addresses = {if isset($can_add_addresses) && $can_add_addresses}true{else}false{/if};
|
||||
var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}";
|
||||
var changed_shipping_price = false;
|
||||
var shipping_price_selected_carrier = '';
|
||||
@@ -620,6 +622,10 @@
|
||||
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
|
||||
}
|
||||
{/literal}
|
||||
|
||||
if (!can_edit_booking_carts || !can_add_addresses) {
|
||||
$('#address_part').hide();
|
||||
}
|
||||
});
|
||||
|
||||
function resetBind()
|
||||
@@ -958,7 +964,9 @@
|
||||
{if isset($cart->id) && $cart->id}
|
||||
id_cart = "{$cart->id}";
|
||||
{/if}
|
||||
$('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer));
|
||||
if (address_link) {
|
||||
$('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer));
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url : "{$link->getAdminLink('AdminCarts')|addslashes}",
|
||||
@@ -1406,6 +1414,7 @@
|
||||
{
|
||||
$("#customer_cart_details").empty();
|
||||
$("#customer_cart_details").append(res.cart_detail_html);
|
||||
initTooltip();
|
||||
|
||||
displaySummary(res);
|
||||
}
|
||||
@@ -1515,13 +1524,20 @@
|
||||
if (addresses.length == 0)
|
||||
{
|
||||
$('#address_delivery, #address_invoice').hide();
|
||||
$("#new_address").show();
|
||||
if (can_edit_booking_carts && can_add_addresses) {
|
||||
$('#address_part').show();
|
||||
$("#new_address").show();
|
||||
} else {
|
||||
$('#address_part').hide();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#addresses_err').hide();
|
||||
$("#new_address").hide();
|
||||
$('#address_delivery, #address_invoice').show();
|
||||
$('#address_part').show();
|
||||
$('#address_part .panel-heading').show();
|
||||
}
|
||||
|
||||
$('#id_address_delivery').html(addresses_delivery_options).hide();
|
||||
@@ -1906,13 +1922,15 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<span class="form-control-static">{l s='Or'} </span>
|
||||
<a class="fancybox_customer btn btn-default" href="{$link->getAdminLink('AdminCustomers')|escape:'html':'UTF-8'}&addcustomer&liteDisplaying=1&submitFormAjax=1#">
|
||||
<i class="icon-plus-sign-alt"></i>
|
||||
{l s='Add new customer'}
|
||||
</a>
|
||||
</div>
|
||||
{if isset($can_edit_booking_carts) && $can_edit_booking_carts && isset($can_add_customers) && $can_add_customers}
|
||||
<div class="col-lg-6">
|
||||
<span class="form-control-static">{l s='Or'} </span>
|
||||
<a class="fancybox_customer btn btn-default" href="{$link->getAdminLink('AdminCustomers')|escape:'html':'UTF-8'}&addcustomer&liteDisplaying=1&submitFormAjax=1#">
|
||||
<i class="icon-plus-sign-alt"></i>
|
||||
{l s='Add new customer'}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1930,7 +1948,7 @@
|
||||
<a href="{$link->getAdminLink('AdminCustomers')}&id_customer={$customer->id}&viewcustomer&liteDisplaying=1" class="btn btn-default fancybox">
|
||||
<i class="icon-search"></i> Details </a>
|
||||
<button type="button" data-id_cart="6" data-customer="2" class="btn btn-default pull-right change-customer">
|
||||
<i class="icon-refresh"></i> Change
|
||||
<i class="icon-refresh"></i> Change
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2139,13 +2157,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<span class="form-control-static">{l s='Or'} </span>
|
||||
<a class="fancybox btn btn-default" href="{$link->getAdminLink('AdminCartRules')|escape:'html':'UTF-8'}&addcart_rule&liteDisplaying=1&submitFormAjax=1#">
|
||||
<i class="icon-plus-sign-alt"></i>
|
||||
{l s='Add new voucher'}
|
||||
</a>
|
||||
</div>
|
||||
{if isset($can_edit_booking_carts) && $can_edit_booking_carts && isset($can_add_vouchers) && $can_add_vouchers}
|
||||
<div class="col-lg-6">
|
||||
<span class="form-control-static">{l s='Or'} </span>
|
||||
<a class="fancybox btn btn-default" href="{$link->getAdminLink('AdminCartRules')|escape:'html':'UTF-8'}&addcart_rule&liteDisplaying=1&submitFormAjax=1#">
|
||||
<i class="icon-plus-sign-alt"></i>
|
||||
{l s='Add new voucher'}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2167,7 +2187,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel" id="address_part" style="">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-heading" id="address_panel_heading">
|
||||
<i class="icon-envelope"></i>
|
||||
{l s='Addresses'}
|
||||
</div>
|
||||
@@ -2201,6 +2221,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if isset($can_edit_booking_carts) && $can_edit_booking_carts && isset($can_add_addresses) && $can_add_addresses}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<a class="fancybox btn btn-default" id="new_address" href="{$link->getAdminLink('AdminAddresses')|escape:'html':'UTF-8'}&addaddress&id_customer=42&liteDisplaying=1&submitFormAjax=1#">
|
||||
@@ -2209,6 +2230,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="panel" id="carriers_part" style="display:none;">
|
||||
<div class="panel-heading">
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<span class="input-group-addon">
|
||||
{$cartCurrency->sign}
|
||||
</span>
|
||||
<input class="service_cart_price_input" id="service_cart_price_{$selectedRoomServiceProduct['id']}_{$product['id_product']}" type="text" value="{$product.price_tax_exc}" name="service_price[{$product['id_product']|escape:'html':'UTF-8'}]"/>
|
||||
<input class="service_cart_price_input" id="service_cart_price_{$selectedRoomServiceProduct['id']}_{$product['id_product']}" type="text" value="{$product.price_tax_exc}" name="service_price[{$product['id_product']|escape:'html':'UTF-8'}]"{if isset($can_edit) && !$can_edit} readonly{/if}/>
|
||||
{if Product::PRICE_CALCULATION_METHOD_PER_DAY == $product['price_calculation_method']}
|
||||
<span class="input-group-addon">{l s='/ night'}</span>
|
||||
{/if}
|
||||
|
||||
124
admin/themes/default/template/controllers/products/amenities.tpl
Normal file
@@ -0,0 +1,124 @@
|
||||
{**
|
||||
* 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
|
||||
*}
|
||||
|
||||
{if isset($product->id)}
|
||||
<div id="product-amenities" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Amenities" />
|
||||
<h3>{l s='Amenities'}</h3>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='If you want to add a new amenity, please use the following link.'}
|
||||
<a href="{$link->getAdminLink('AdminHotelAmenities')|escape:'html':'UTF-8'}" class="btn btn-link button" target="_blank">
|
||||
<i class="icon-plus-sign"></i> {l s='Manage amenities'} <i class="icon-external-link-sign"></i>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{if isset($room_type_amenities_tree) && $room_type_amenities_tree}
|
||||
<div class="form-group">
|
||||
<label for="room-type-amenities-tree" class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Select the amenities available for this room type.'}">
|
||||
{l s='Select amenities'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-7 room_features_tree">
|
||||
{$room_type_amenities_tree}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Select which of the chosen amenities should be featured for this room type.'}">
|
||||
{l s='Featured amenities'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-7">
|
||||
<select name="featured_amenities[]" id="rt_featured_amenities" class="form-control" multiple>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
<i class="icon-warning-sign"></i> {l s='No amenities have been defined yet.'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&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>
|
||||
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
var featuredIds = {if isset($featured_amenity_ids)}{$featured_amenity_ids|json_encode}{else}[]{/if};
|
||||
var chosenReady = false;
|
||||
|
||||
function syncAmenitiesToFeatured() {
|
||||
var $select = $('#rt_featured_amenities');
|
||||
var existing = {};
|
||||
$select.find('option').each(function () {
|
||||
existing[$(this).val()] = true;
|
||||
});
|
||||
$('input[name="room_type_amenities[]"]').each(function () {
|
||||
var $checkbox = $(this);
|
||||
var id = $checkbox.val();
|
||||
var name = $checkbox.siblings('label.tree-toggler').text().trim();
|
||||
if ($checkbox.is(':checked')) {
|
||||
if (!existing[id]) {
|
||||
var selected = featuredIds.indexOf(parseInt(id)) !== -1;
|
||||
$select.append($('<option></option>').val(id).text(name).prop('selected', selected));
|
||||
}
|
||||
} else {
|
||||
$select.find('option[value="' + id + '"]').remove();
|
||||
}
|
||||
});
|
||||
if (chosenReady) {
|
||||
$select.trigger('chosen:updated');
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '#room-type-amenities-tree :input[type="checkbox"]', function () {
|
||||
setTimeout(syncAmenitiesToFeatured, 0);
|
||||
});
|
||||
$(document).on('click', '#check-all-room-type-amenities-tree, #uncheck-all-room-type-amenities-tree', function () {
|
||||
setTimeout(syncAmenitiesToFeatured, 0);
|
||||
});
|
||||
|
||||
function initChosen() {
|
||||
var $select = $('#rt_featured_amenities');
|
||||
syncAmenitiesToFeatured();
|
||||
$select.chosen({ disable_search_threshold: 5, search_contains: true });
|
||||
chosenReady = true;
|
||||
$select.trigger('chosen:updated');
|
||||
}
|
||||
|
||||
var $tabContent = $('#product-tab-content-Amenities');
|
||||
if ($tabContent.is(':visible')) {
|
||||
initChosen();
|
||||
} else {
|
||||
$tabContent.one('displayed', initChosen);
|
||||
}
|
||||
}(jQuery));
|
||||
</script>
|
||||
{/if}
|
||||
@@ -20,63 +20,22 @@
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*}
|
||||
{if isset($htl_connected_rooms) && $htl_connected_rooms|@count > 0}
|
||||
<span class="connected-room-tooltip-trigger"
|
||||
data-connected-details='{json_encode($htl_connected_rooms.connected_room_types)|escape:'html':'UTF-8'}'>
|
||||
<i class="icon-random" style="color: #008abd; cursor: pointer;"></i>
|
||||
</span>
|
||||
{capture name='connected_room_tooltip'}
|
||||
<div class="tooltip_cont">
|
||||
<div class="tip_header"><div class="tip_date">{l s='Connected Rooms'}</div></div>
|
||||
<div class="tip-body tip-body-grid">
|
||||
{foreach from=$htl_connected_rooms.connected_room_types item=group}
|
||||
<div>
|
||||
<div class="tip_element_head">{$group.room_type_name|escape:'html':'UTF-8'}</div>
|
||||
<div class="tip_element_value">
|
||||
{foreach from=$group.connected_rooms item=room name=connected_rooms}
|
||||
{$room.name|escape:'html':'UTF-8'}{if !$smarty.foreach.connected_rooms.last}, {/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/capture}
|
||||
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.connected_room_tooltip tooltip_icon_class='icon-random' tooltip_icon_style='color: #008abd;' }
|
||||
{/if}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
{literal}
|
||||
if (typeof window.initConnectedRoomTooltips === 'undefined') {
|
||||
window.initConnectedRoomTooltips = function() {
|
||||
if (typeof $.fn.tooltip === 'undefined' || typeof $.ui === 'undefined' || typeof $.ui.tooltip === 'undefined') {
|
||||
return;
|
||||
}
|
||||
$('.connected-room-tooltip-trigger').each(function() {
|
||||
if ($(this).data('ui-tooltip')) {
|
||||
return;
|
||||
}
|
||||
$(this).tooltip({
|
||||
items: '.connected-room-tooltip-trigger',
|
||||
content: function() {
|
||||
var details = $(this).data('connected-details');
|
||||
if (!details || $.isEmptyObject(details)) {
|
||||
return "{/literal}{l s='No rooms connected' js=1}{literal}";
|
||||
}
|
||||
var html = '<div class="tooltip_cont">';
|
||||
html += '<div class="tip_header"><div class="tip_date">{/literal}{l s="Connected Rooms" js=1}{literal}</div></div>';
|
||||
html += '<div class="tip-body tip-body-grid">';
|
||||
for (var typeId in details) {
|
||||
var group = details[typeId];
|
||||
var names = [];
|
||||
for (var i = 0; i < group.connected_rooms.length; i++) {
|
||||
names.push(group.connected_rooms[i].name);
|
||||
}
|
||||
html += '<div>';
|
||||
html += '<div class="tip_element_head">' + group.room_type_name + '</div>';
|
||||
html += '<div class="tip_element_value">' + names.join(', ') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div></div>';
|
||||
return html;
|
||||
},
|
||||
position: { my: "left top+10", at: "left bottom", collision: "flipfit", within: "#content" },
|
||||
close: function(event, ui) {
|
||||
ui.tooltip.hover(function() {
|
||||
$(this).stop(true).fadeTo(300, 1);
|
||||
},
|
||||
function() {
|
||||
$(this).fadeOut('300', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
window.initConnectedRoomTooltips();
|
||||
{/literal}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -28,162 +28,35 @@
|
||||
<input type="hidden" name="submitted_tabs[]" value="Features" />
|
||||
<h3>{l s='Assign features to this room type'}</h3>
|
||||
|
||||
{if isset($room_type_features_tree) && $room_type_features_tree}
|
||||
<div class="alert alert-info">
|
||||
{l s='You can specify a value for each relevant feature regarding this room type. Empty fields will not be displayed.'}<br/>
|
||||
{l s='You can either create a specific value, or select among the existing pre-defined values you\'ve previously added.'}
|
||||
|
||||
<p>{l s='If you want to add a new feature, please use the following link.'}
|
||||
<a href="{$link->getAdminLink('AdminFeatures')|escape:'html':'UTF-8'}" class="btn btn-link button" target="_blank">
|
||||
<i class="icon-plus-sign"></i> {l s='Add a new feature'} <i class="icon-external-link-sign"></i>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="room-type-features-tree" class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Select the feature values available for this room type.'}">
|
||||
{l s='Select feature values'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-7 room_features_tree">
|
||||
{$room_type_features_tree}
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
<i class="icon-warning-sign"></i> {l s='No features have been defined'}
|
||||
</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="Room 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'}&addfeature_value&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'}&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}&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>
|
||||
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
if (tabs_manager.allow_hide_other_languages)
|
||||
hideOtherLanguage({$default_form_language});
|
||||
{literal}
|
||||
$(".textarea-autosize").autosize();
|
||||
|
||||
function all_languages(pos)
|
||||
{
|
||||
{/literal}
|
||||
{if isset($languages) && is_array($languages)}
|
||||
{foreach from=$languages key=k item=language}
|
||||
pos.parents('td').find('.lang-{$language.id_lang}').addClass('nolang-{$language.id_lang}').removeClass('lang-{$language.id_lang}');
|
||||
{/foreach}
|
||||
{/if}
|
||||
pos.parents('td').find('.translatable-field').hide();
|
||||
pos.parents('td').find('.lang-0').show();
|
||||
{literal}
|
||||
}
|
||||
|
||||
function restore_lng(pos,i)
|
||||
{
|
||||
{/literal}
|
||||
{if isset($languages) && is_array($languages)}
|
||||
{foreach from=$languages key=k item=language}
|
||||
pos.parents('td').find('.nolang-{$language.id_lang}').addClass('lang-{$language.id_lang}').removeClass('nolang-{$language.id_lang}');
|
||||
{/foreach}
|
||||
{/if}
|
||||
{literal}
|
||||
pos.parents('td').find('.lang-0').hide();
|
||||
hideOtherLanguage(i);
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{/if}
|
||||
|
||||
@@ -465,21 +465,6 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group" id="bed_types_selection">
|
||||
<label class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select all bed types available for this room type.'}">
|
||||
{l s='Bed Types'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
<select name="id_bed_types[]" id="id_bed_types" class="form-control chosen" multiple>
|
||||
{foreach from=$bed_types_info item=bed_type_info}
|
||||
<option value="{$bed_type_info['id_bed_type']}" {if isset($selected_bed_types) && in_array($bed_type_info['id_bed_type'], $selected_bed_types)}selected{/if}>{$bed_type_info['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div class="form-group">
|
||||
<label class="control-label col-lg-3" for="tags_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
|
||||
@@ -300,8 +300,8 @@
|
||||
{if $params.type == 'range'}
|
||||
{$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$field_name}[0]" placeholder="{l s='From'}" value="{if isset($smarty.post[$field_name][0]) && $smarty.post[$field_name][0]}{$smarty.post[$field_name][0]}{elseif isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$field_name}[1]" placeholder="{l s='To'}" value="{if isset($smarty.post[$field_name][1]) && $smarty.post[$field_name][1]}{$smarty.post[$field_name][1]}{elseif isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$field_name}[0]" placeholder="{l s='From'}" value="{if isset($smarty.post[$field_name][0]) && $smarty.post[$field_name][0]}{$smarty.post[$field_name][0]|escape:'html':'UTF-8'}{elseif isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$field_name}[1]" placeholder="{l s='To'}" value="{if isset($smarty.post[$field_name][1]) && $smarty.post[$field_name][1]}{$smarty.post[$field_name][1]|escape:'html':'UTF-8'}{elseif isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{elseif $params.type == 'bool'}
|
||||
{$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
|
||||
@@ -314,14 +314,14 @@
|
||||
<div class="date_range">
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($smarty.post[$params.name_date][0]) && $smarty.post[$params.name_date][0]}{$smarty.post[$params.name_date][0]}{elseif isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($smarty.post[$params.name_date][0]) && $smarty.post[$params.name_date][0]}{$smarty.post[$params.name_date][0]|escape:'html':'UTF-8'}{elseif isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($smarty.post[$params.name_date][1]) && $smarty.post[$params.name_date][1]}{$smarty.post[$params.name_date][1]}{elseif isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($smarty.post[$params.name_date][1]) && $smarty.post[$params.name_date][1]}{$smarty.post[$params.name_date][1]|escape:'html':'UTF-8'}{elseif isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
@@ -398,7 +398,7 @@
|
||||
{/if}
|
||||
{else}
|
||||
{$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
|
||||
<input type="text" id="filter_input_{$key}" class="filter" name="{$field_name}" value="{if isset($smarty.post.$field_name) && $smarty.post.$field_name}{$smarty.post.$field_name}{else}{$params.value|escape:'html':'UTF-8'}{/if}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
<input type="text" id="filter_input_{$key}" class="filter" name="{$field_name}" value="{if isset($smarty.post.$field_name) && $smarty.post.$field_name}{$smarty.post.$field_name|escape:'html':'UTF-8'}{else}{$params.value|escape:'html':'UTF-8'}{/if}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
38
admin/themes/default/template/helpers/tooltip.tpl
Normal file
@@ -0,0 +1,38 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<span class="tooltip-trigger{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
|
||||
{if isset($tooltip_title) && $tooltip_title}
|
||||
{$tooltip_title nofilter}
|
||||
{elseif isset($tooltip_icon_class) && $tooltip_icon_class}
|
||||
<i class="{$tooltip_icon_class|escape:'html':'UTF-8'}"{if isset($tooltip_icon_style) && $tooltip_icon_style} style="{$tooltip_icon_style|escape:'html':'UTF-8'}"{/if}></i>
|
||||
{else}
|
||||
<img src="themes/default/img/icon-info.svg" alt="" />
|
||||
{/if}
|
||||
</span>
|
||||
<div class="tooltip-content" style="display: none;">
|
||||
{if isset($allow_html) && !$allow_html}
|
||||
{$tooltip_content|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{$tooltip_content nofilter}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
{**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
@@ -19,14 +18,9 @@
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
*}
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
<div class="tree-panel-heading-controls clearfix">
|
||||
{if isset($title) && $title}<span class="tree-panel-label-title">{$title}</span>{/if}
|
||||
{if isset($toolbar)}{$toolbar}{/if}
|
||||
</div>
|
||||
@@ -919,9 +919,9 @@ class LanguageCore extends ObjectModel
|
||||
$file = _PS_TRANSLATIONS_DIR_.(string)$iso.'.gzip';
|
||||
|
||||
if (!$lang_pack_link = Tools::file_get_contents(_QLO_API_URL_.'/lang_pack/get_lang_pack.php?version='.$version.'&iso_lang='.Tools::strtolower((string)$iso))) {
|
||||
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
||||
$errors[] = Tools::displayError('Archive cannot be downloaded from QloApps Api.');
|
||||
} elseif (!$lang_pack = json_decode($lang_pack_link)) {
|
||||
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
||||
$errors[] = Tools::displayError('Error occurred when language was checked according to your QloApps version.');
|
||||
} elseif (empty($lang_pack->error) && ($content = Tools::file_get_contents($lang_pack->download_link))) {
|
||||
if (!@file_put_contents($file, $content)) {
|
||||
if (is_writable(dirname($file))) {
|
||||
|
||||
@@ -229,11 +229,17 @@ abstract class PaymentModuleCore extends Module
|
||||
$this->currentOrderReference = $reference;
|
||||
|
||||
$order_creation_failed = false;
|
||||
$cart_total_paid = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
$full_cart_total = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH), _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$amount_paid = !$dont_touch_amount ? Tools::ps_round((float)$amount_paid, _PS_PRICE_COMPUTE_PRECISION_) : $amount_paid;
|
||||
|
||||
if ($amount_paid >= $full_cart_total) {
|
||||
$is_advance_payment = false;
|
||||
$cart_total_paid = $full_cart_total;
|
||||
} else {
|
||||
$is_advance_payment = true;
|
||||
$cart_total_paid = (float)Tools::ps_round(
|
||||
(float)$this->context->cart->getOrderTotal(true, CART::ADVANCE_PAYMENT),
|
||||
(float)$this->context->cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT),
|
||||
_PS_PRICE_COMPUTE_PRECISION_
|
||||
);
|
||||
}
|
||||
@@ -314,7 +320,6 @@ abstract class PaymentModuleCore extends Module
|
||||
$order->gift_message = $this->context->cart->gift_message;
|
||||
$order->mobile_theme = $this->context->cart->mobile_theme;
|
||||
$order->conversion_rate = $this->context->currency->conversion_rate;
|
||||
$amount_paid = !$dont_touch_amount ? Tools::ps_round((float)$amount_paid, _PS_PRICE_COMPUTE_PRECISION_) : $amount_paid;
|
||||
$order->total_paid_real = 0;
|
||||
|
||||
$order->total_products = (float)$this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS, $order->product_list, $id_carrier);
|
||||
@@ -371,7 +376,7 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
|
||||
// advance payment information
|
||||
$order->is_advance_payment = $this->context->cart->is_advance_payment;
|
||||
$order->is_advance_payment = (int)$is_advance_payment;
|
||||
$order->amount_paid = 0;
|
||||
if ($order->is_advance_payment) {
|
||||
$order->advance_paid_amount = (float)Tools::ps_round(
|
||||
@@ -892,7 +897,7 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
/*for saving details of the advance payment product wise*/
|
||||
$objBookingDetail->total_paid_amount = $total_price['total_price_tax_incl'];
|
||||
if ($this->context->cart->is_advance_payment) {
|
||||
if ($is_advance_payment) {
|
||||
$prod_adv_payment = $objAdvancedPayment->getIdAdvPaymentByIdProduct($idProduct);
|
||||
if (!$prod_adv_payment
|
||||
|| (isset($prod_adv_payment['payment_type']) && $prod_adv_payment['payment_type'])
|
||||
|
||||
@@ -1073,9 +1073,6 @@ class ProductCore extends ObjectModel
|
||||
if (!$this->deleteServiceInfo()) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
$objHotelRoomTypeBedType->deleteRoomTypeBedTypes(false, $this->id);
|
||||
}
|
||||
|
||||
Hook::exec('actionProductDelete', array('id_product' => (int)$this->id, 'product' => $this));
|
||||
@@ -1083,6 +1080,7 @@ class ProductCore extends ObjectModel
|
||||
!GroupReduction::deleteProductReduction($this->id) ||
|
||||
!$this->deleteCategories(true) ||
|
||||
!$this->deleteProductFeatures() ||
|
||||
!HotelRoomTypeAmenities::deleteByProduct((int)$this->id) ||
|
||||
!$this->deleteTags() ||
|
||||
!$this->deleteAttributesImpacts() ||
|
||||
!$this->deleteAttachments(false) ||
|
||||
@@ -6873,4 +6871,55 @@ class ProductCore extends ObjectModel
|
||||
|
||||
return $price * (int)$quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare grouped core features and values for a room type, with selection state.
|
||||
*
|
||||
* @param int $idProduct
|
||||
* @param int $idLang defaults to current context language
|
||||
* @return array
|
||||
*/
|
||||
public static function getRoomTypeFeatureTreeData($idProduct, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$product = new self((int) $idProduct);
|
||||
$features = Feature::getFeatures(
|
||||
$idLang,
|
||||
(Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)
|
||||
);
|
||||
$selectedFeatureValues = array();
|
||||
foreach ($product->getFeatures() as $productFeature) {
|
||||
$selectedFeatureValues[(int) $productFeature['id_feature']][] = (int) $productFeature['id_feature_value'];
|
||||
}
|
||||
|
||||
foreach ($features as &$feature) {
|
||||
$featureValues = FeatureValue::getFeatureValuesWithLang(
|
||||
$idLang,
|
||||
(int) $feature['id_feature']
|
||||
);
|
||||
$feature['value'] = (int) $feature['id_feature'];
|
||||
$feature['input_name'] = 'feature_value_parents';
|
||||
$feature['children'] = array();
|
||||
$selectedValues = isset($selectedFeatureValues[(int) $feature['id_feature']])
|
||||
? $selectedFeatureValues[(int) $feature['id_feature']]
|
||||
: array();
|
||||
|
||||
foreach ($featureValues as $featureValue) {
|
||||
$featureValue['name'] = $featureValue['value'];
|
||||
$featureValue['value'] = (int) $featureValue['id_feature_value'];
|
||||
$featureValue['input_name'] = 'feature_values['.(int) $feature['id_feature'].']';
|
||||
$featureValue['selected'] = in_array((int) $featureValue['id_feature_value'], $selectedValues);
|
||||
$feature['children'][] = $featureValue;
|
||||
}
|
||||
|
||||
if ($feature['children'] && count($selectedValues) === count($feature['children'])) {
|
||||
$feature['selected'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $features;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,6 +695,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
'cart_detail_data' => $cart_detail_data,
|
||||
'cart' => $objCart,
|
||||
'currency' => new Currency((int)$this->context->cart->id_currency),
|
||||
'can_edit_booking_carts' => ($this->tabAccess['edit'] === 1),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
'ajax' => true
|
||||
));
|
||||
@@ -1265,7 +1266,8 @@ class AdminCartsControllerCore extends AdminController
|
||||
'serviceProducts' => $serviceProducts,
|
||||
'selectedRoomServiceProduct' => $selectedRoomServiceProduct,
|
||||
'customServiceAllowed' => Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING'),
|
||||
'loaderImg' => $this->context->link->getMediaLink(_PS_IMG_.'admin/ajax-loader.gif')
|
||||
'loaderImg' => $this->context->link->getMediaLink(_PS_IMG_.'admin/ajax-loader.gif'),
|
||||
'can_edit' => $this->tabAccess['edit'],
|
||||
));
|
||||
|
||||
$response['html_exta_demands'] = $this->context->smarty->fetch(
|
||||
@@ -1574,6 +1576,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
'serviceProducts' => $serviceProducts,
|
||||
'selectedRoomServiceProduct' => $selectedRoomServiceProduct,
|
||||
'customServiceAllowed' => Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING'),
|
||||
'can_edit' => $this->tabAccess['edit'],
|
||||
));
|
||||
|
||||
$servicesTpl = $this->context->smarty->fetch(
|
||||
@@ -1589,7 +1592,9 @@ class AdminCartsControllerCore extends AdminController
|
||||
{
|
||||
$response = array('hasError' => false);
|
||||
// Check tab access is allowed to edit
|
||||
if ($this->tabAccess['add'] === 1) {
|
||||
$canAdd = ($this->tabAccess['add'] === 1);
|
||||
$canEdit = ($this->tabAccess['edit'] === 1);
|
||||
if ($canAdd || $canEdit) {
|
||||
$idCartBooking = Tools::getValue('id_hotel_cart_booking');
|
||||
if (Validate::isLoadedObject($objHotelCartBookingData = new HotelCartBookingData($idCartBooking))) {
|
||||
$objCart = new Cart($objHotelCartBookingData->id_cart);
|
||||
@@ -1667,7 +1672,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
))) {
|
||||
$originalPrice = Product::getPriceStatic($idServiceProduct, false);
|
||||
// if price is different than the original service price then update the price
|
||||
if ($operator == 'up' && $originalPrice != $unitPrice) {
|
||||
if ($canEdit && $operator == 'up' && $originalPrice != $unitPrice) {
|
||||
if ($specificPriceInfo = SpecificPrice::getSpecificPrice(
|
||||
(int)$idServiceProduct,
|
||||
0,
|
||||
|
||||
@@ -80,6 +80,9 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'gender_lang gl ON (a.id_gender = gl.id_gender AND gl.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'group_lang grl ON (a.id_default_group = grl.id_group AND grl.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (a.id_customer = o.id_customer)';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'address ad ON (ad.id_customer = a.id_customer AND ad.deleted = 0)';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'state adstate ON (adstate.id_state = ad.id_state)';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'country_lang adcountry ON (adcountry.id_country = ad.id_country AND adcountry.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_group = 'GROUP BY a.`id_customer`';
|
||||
|
||||
$this->fields_list = array(
|
||||
@@ -119,6 +122,11 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->fields_list = array_merge($this->fields_list, array(
|
||||
'phone' => array(
|
||||
'title' => $this->l('Phone'),
|
||||
'filter_key' => 'a!phone',
|
||||
'visible_default' => true,
|
||||
),
|
||||
'default_group_name' => array(
|
||||
'title' => $this->l('Default Group'),
|
||||
'optional' => true,
|
||||
@@ -144,11 +152,82 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'align' => 'text-right',
|
||||
'badge_success' => true
|
||||
),
|
||||
'phone' => array(
|
||||
'title' => $this->l('Phone'),
|
||||
'filter_key' => 'a!phone',
|
||||
'address_company' => array(
|
||||
'title' => $this->l('Company'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'vat_number' => array(
|
||||
'title' => $this->l('VAT number'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'address1' => array(
|
||||
'title' => $this->l('Address'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'search' => false,
|
||||
'orderby' => false,
|
||||
),
|
||||
'address2' => array(
|
||||
'title' => $this->l('Address (2)'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'search' => false,
|
||||
'orderby' => false,
|
||||
),
|
||||
'city' => array(
|
||||
'title' => $this->l('City'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'state' => array(
|
||||
'title' => $this->l('State'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'postcode' => array(
|
||||
'title' => $this->l('Zip/Postal Code'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'country' => array(
|
||||
'title' => $this->l('Country'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'address_phone' => array(
|
||||
'title' => $this->l('Home phone'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'phone_mobile' => array(
|
||||
'title' => $this->l('Mobile phone'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'havingFilter' => true,
|
||||
'orderby' => false,
|
||||
),
|
||||
'dni' => array(
|
||||
'title' => $this->l('Identification Number'),
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
'search' => false,
|
||||
'orderby' => false,
|
||||
),
|
||||
'active' => array(
|
||||
'title' => $this->l('Enabled'),
|
||||
@@ -171,7 +250,9 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'align' => 'text-center',
|
||||
'type' => 'bool',
|
||||
'callback' => 'printOptinIcon',
|
||||
'orderby' => false
|
||||
'orderby' => false,
|
||||
'optional' => true,
|
||||
'visible_default' => false
|
||||
),
|
||||
'date_add' => array(
|
||||
'title' => $this->l('Registration'),
|
||||
@@ -183,12 +264,15 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'title' => $this->l('Last visit'),
|
||||
'type' => 'datetime',
|
||||
'search' => false,
|
||||
'havingFilter' => true
|
||||
'havingFilter' => true,
|
||||
'optional' => true,
|
||||
'visible_default' => false,
|
||||
),
|
||||
'deleted' => array(
|
||||
'title' => $this->l('Banned'),
|
||||
'type' => 'bool',
|
||||
'displayed' => false,
|
||||
'filter_key' => 'a!deleted',
|
||||
'callback' => 'getCustomerStatusLabel',
|
||||
),
|
||||
'order_date' => array(
|
||||
@@ -211,7 +295,11 @@ class AdminCustomersControllerCore extends AdminController
|
||||
WHERE g.id_customer = a.id_customer
|
||||
ORDER BY c.date_add DESC
|
||||
LIMIT 1
|
||||
) as connect';
|
||||
) as connect,
|
||||
ad.company as address_company, ad.vat_number,
|
||||
ad.address1, ad.address2, ad.city, adstate.name as state,
|
||||
ad.postcode, adcountry.name as country, ad.phone as address_phone,
|
||||
ad.phone_mobile, ad.dni';
|
||||
|
||||
// Check if we can add a customer
|
||||
if (Shop::isFeatureActive() && (Shop::getContext() == Shop::CONTEXT_ALL || Shop::getContext() == Shop::CONTEXT_GROUP)) {
|
||||
|
||||
@@ -91,13 +91,22 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if (($id = Tools::getValue('id_feature')) && Tools::getIsset('viewfeature')) {
|
||||
self::$currentIndex .= '&id_feature='.(int)$id.'&viewfeature';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AdminController::renderList() override
|
||||
* @see AdminController::renderList()
|
||||
*/
|
||||
public function renderList()
|
||||
{
|
||||
/*$this->addRowAction('view');*//*by webkul*/
|
||||
$this->addRowAction('view');
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('delete');
|
||||
|
||||
@@ -154,7 +163,6 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
);
|
||||
|
||||
$this->_where = sprintf('AND `id_feature` = %d', (int)$id);
|
||||
self::$currentIndex = self::$currentIndex.'&id_feature='.(int)$id.'&viewfeature';
|
||||
$this->processFilter();
|
||||
return parent::renderList();
|
||||
}
|
||||
@@ -322,8 +330,14 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$bread_extended[] = $this->feature_name[$this->context->employee->id_lang];
|
||||
$this->addMetaTitle($bread_extended[count($bread_extended) - 1]);
|
||||
if (!$this->feature_name && ($id = Tools::getValue('id_feature'))) {
|
||||
$obj = new Feature((int)$id);
|
||||
$this->feature_name = $obj->name;
|
||||
}
|
||||
if ($this->feature_name) {
|
||||
$bread_extended[] = $this->feature_name[$this->context->employee->id_lang];
|
||||
$this->addMetaTitle($bread_extended[count($bread_extended) - 1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'editFeatureValue':
|
||||
@@ -334,7 +348,7 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if (Validate::isLoadedObject($obj = new FeatureValue((int)Tools::getValue('id_feature_value')))) {
|
||||
$bread_extended[] = sprintf($this->l('Edit: %s'), $obj->value[$this->context->employee->id_lang]);
|
||||
$bread_extended[] = sprintf($this->l('Edit: %s'), $obj->value[$this->context->employee->id_lang]);
|
||||
}
|
||||
} else {
|
||||
$bread_extended[] = $this->l('Edit Value');
|
||||
@@ -549,13 +563,15 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
{
|
||||
$object = parent::processAdd();
|
||||
|
||||
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) {
|
||||
if ($this->table == 'feature_value' && ($this->display == 'edit' || $this->display == 'add')) {
|
||||
$this->redirect_after = self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token;
|
||||
if ('feature_value' === $this->table && !count($this->errors)) {
|
||||
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && ($this->display == 'edit' || $this->display == 'add')) {
|
||||
$this->redirect_after = self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&conf=3&token='.$this->token;
|
||||
} else {
|
||||
$this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int) $object->id.'&conf=3&update'.$this->table.'&token='.$this->token;
|
||||
$this->redirect_after = self::$currentIndex.'&id_feature='.(int)Tools::getValue('id_feature').'&viewfeature&conf=3&token='.$this->token;
|
||||
}
|
||||
} elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && count($this->errors) && $this->table == 'feature_value') { // enter only if feature is submitted
|
||||
} elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) {
|
||||
$this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int) $object->id.'&conf=3&update'.$this->table.'&token='.$this->token;
|
||||
} elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && count($this->errors) && 'feature_value' === $this->table) { // enter only if feature is submitted
|
||||
$this->display = 'editFeatureValue';
|
||||
}
|
||||
|
||||
@@ -570,8 +586,14 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
{
|
||||
$object = parent::processUpdate();
|
||||
|
||||
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) {
|
||||
$this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int) Tools::getValue('id_feature').'&conf=4&update'.$this->table.'&token='.$this->token;
|
||||
if ('feature_value' === $this->table && !count($this->errors)) {
|
||||
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
|
||||
$this->redirect_after = self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&conf=4&token='.$this->token;
|
||||
} else {
|
||||
$this->redirect_after = self::$currentIndex.'&id_feature='.(int)Tools::getValue('id_feature').'&viewfeature&conf=4&token='.$this->token;
|
||||
}
|
||||
} elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) {
|
||||
$this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int)$object->id.'&conf=4&update'.$this->table.'&token='.$this->token;
|
||||
}
|
||||
|
||||
return $object;
|
||||
@@ -628,24 +650,12 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
$this->errors[] = $this->l('Some error occurred while uploding room feature logo. Please try again.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($featureValues = FeatureValue::getFeatureValuesWithLang(
|
||||
$this->context->language->id,
|
||||
$objFeature->id
|
||||
)) {
|
||||
$objFeatureValue = new FeatureValue($featureValues[0]['id_feature_value']);
|
||||
} else {
|
||||
$objFeatureValue = new FeatureValue();
|
||||
}
|
||||
|
||||
$objFeatureValue->id_feature = $objFeature->id;
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$objFeatureValue->value[$lang['id_lang']] = $objFeature->id.'.jpg';
|
||||
}
|
||||
$objFeatureValue->save();
|
||||
return $objFeature;
|
||||
}
|
||||
|
||||
return $objFeature;
|
||||
}
|
||||
|
||||
return parent::processSave();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3326,7 +3326,7 @@ class AdminImportControllerCore extends AdminController
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_image`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_access`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_booking_detail`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_features`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_amenity`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_cart_booking_data`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_refund_rules`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_order_restrict_date`');
|
||||
|
||||
@@ -72,6 +72,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`id_order` = a.`id_order`) as total_guests,
|
||||
(SELECT SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`id_order` = a.`id_order`) as los,
|
||||
hbd.`id_room` AS id_room_information,
|
||||
(SELECT GROUP_CONCAT(CONCAT(ps.period, \'~\', ps.cnt) ORDER BY ps.period SEPARATOR \'::\') FROM (SELECT CONCAT(hbd.`date_from`, \'|\', hbd.`date_to`) AS period, COUNT(*) AS cnt FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`id_order` = a.`id_order` GROUP BY hbd.`date_from`, hbd.`date_to`) AS ps) AS stay_periods,
|
||||
(SELECT COUNT(spod.`id_service_product_order_detail`) FROM `'._DB_PREFIX_.'service_product_order_detail` spod WHERE spod.`id_order` = a.`id_order` AND spod.`id_htl_booking_detail`=0) as num_products';
|
||||
|
||||
$this->_join = '
|
||||
@@ -196,6 +197,15 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'type'=>'date',
|
||||
'displayed' => false,
|
||||
),
|
||||
'stay_periods' => array(
|
||||
'title' => $this->l('Stay Periods'),
|
||||
'type' => 'text',
|
||||
'callback' => 'formatStayPeriods',
|
||||
'optional' => true,
|
||||
'search' => false,
|
||||
'displayed' => true,
|
||||
'visible_default' => true,
|
||||
),
|
||||
'total_guests' => array(
|
||||
'title' => $this->l('Guests'),
|
||||
'type' => 'range',
|
||||
@@ -212,7 +222,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'visible_default' => true
|
||||
),
|
||||
'los' => array(
|
||||
'title' => $this->l('Stay period'),
|
||||
'title' => $this->l('Stay duration'),
|
||||
'align' => 'text-center',
|
||||
'type' => 'range',
|
||||
'havingFilter' => true,
|
||||
@@ -359,6 +369,43 @@ class AdminOrdersControllerCore extends AdminController
|
||||
return Tools::displayPrice($echo, (int)$idCurrency);
|
||||
}
|
||||
|
||||
public function formatStayPeriods($value, $row)
|
||||
{
|
||||
if (empty($value)) {
|
||||
return '--';
|
||||
}
|
||||
|
||||
$stayPeriods = array();
|
||||
foreach (explode('::', $value) as $stays) {
|
||||
$countStays = explode('~', $stays);
|
||||
$stayDates = explode('|', $countStays[0]);
|
||||
if (count($stayDates) === 2) {
|
||||
$stayPeriods[] = array(
|
||||
'from' => Tools::displayDate(trim($stayDates[0])),
|
||||
'to' => Tools::displayDate(trim($stayDates[1])),
|
||||
'count' => isset($countStays[1]) ? (int)$countStays[1] : 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$datesDisplay = array();
|
||||
foreach (array_slice($stayPeriods, 0, 1) as $stayPeriod) {
|
||||
$datesDisplay[] = $stayPeriod['from'].' - '.$stayPeriod['to'];
|
||||
}
|
||||
|
||||
$stayPeriodHtml = implode('<br>', $datesDisplay);
|
||||
$uniqueStayPeriods = count($stayPeriods);
|
||||
|
||||
if ($uniqueStayPeriods > 1) {
|
||||
$this->context->smarty->assign(array(
|
||||
'stay_periods' => $stayPeriods,
|
||||
'extra_stay_periods_count' => $uniqueStayPeriods - 1,
|
||||
));
|
||||
$stayPeriodHtml .= ' '.$this->createTemplate('_stay_periods_tooltip.tpl')->fetch();
|
||||
}
|
||||
return $stayPeriodHtml;
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
if (empty($this->display)) {
|
||||
@@ -484,6 +531,22 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$objHotelAdvancedPayment = new HotelAdvancedPayment();
|
||||
$adminCartsAccess = Profile::getProfileAccess(
|
||||
(int) $this->context->employee->id_profile,
|
||||
(int) Tab::getIdFromClassName('AdminCarts')
|
||||
);
|
||||
$adminCustomersAccess = Profile::getProfileAccess(
|
||||
(int) $this->context->employee->id_profile,
|
||||
(int) Tab::getIdFromClassName('AdminCustomers')
|
||||
);
|
||||
$adminCartRulesAccess = Profile::getProfileAccess(
|
||||
(int) $this->context->employee->id_profile,
|
||||
(int) Tab::getIdFromClassName('AdminCartRules')
|
||||
);
|
||||
$adminAddressesAccess = Profile::getProfileAccess(
|
||||
(int) $this->context->employee->id_profile,
|
||||
(int) Tab::getIdFromClassName('AdminAddresses')
|
||||
);
|
||||
$this->context->smarty->assign(array(
|
||||
'order_total' => $cart->getOrderTotal(true),
|
||||
'is_advance_payment_active' => $objHotelAdvancedPayment->isAdvancePaymentAvailableForCurrentCart(),
|
||||
@@ -497,6 +560,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'payment_types' => $paymentTypes,
|
||||
'PAYMENT_TYPE_PAY_AT_HOTEL' => OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL,
|
||||
'currency' => new Currency((int)$cart->id_currency),
|
||||
'can_edit_booking_carts' => (!empty($adminCartsAccess['edit']) && (int) $adminCartsAccess['edit'] === 1),
|
||||
'can_add_customers' => (!empty($adminCustomersAccess['add']) && (int) $adminCustomersAccess['add'] === 1),
|
||||
'can_add_vouchers' => (!empty($adminCartRulesAccess['add']) && (int) $adminCartRulesAccess['add'] === 1),
|
||||
'can_add_addresses' => (!empty($adminAddressesAccess['add']) && (int) $adminAddressesAccess['add'] === 1),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
));
|
||||
@@ -1354,7 +1422,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
$this->addJqueryUI('ui.datepicker');
|
||||
$this->addJqueryUI('ui.tooltip', 'base', true);
|
||||
|
||||
$this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js');
|
||||
|
||||
if ($this->display == 'view') {
|
||||
@@ -3950,10 +4017,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$this->errors[] = $this->l('Please select a file to upload.');
|
||||
} elseif ($objHotelBookingDocument->fileInfo['size'] > Tools::getMaxUploadSize()) {
|
||||
$this->errors[] = $this->l('Uploaded file size is too large.');
|
||||
} elseif(!(ImageManager::isRealImage($objHotelBookingDocument->fileInfo['tmp_name'])
|
||||
|| $objHotelBookingDocument->fileInfo['mime'] == 'application/pdf')
|
||||
) {
|
||||
$this->errors[] = $this->l('Please upload an image or a PDF file only. Allowed image formats: .gif, .jpg, .jpeg and .png');
|
||||
} else {
|
||||
$objHotelBookingDocument->setFileType();
|
||||
if (!$objHotelBookingDocument->file_type) {
|
||||
$this->errors[] = $this->l('Please upload an image or a PDF file only. Allowed image formats: .gif, .jpg, .jpeg and .png');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('You do not have permission to edit this order.');
|
||||
|
||||
@@ -107,6 +107,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
'Images' => $this->l('Images'),
|
||||
'ServiceProduct' => $this->l('Service Products'),
|
||||
// 'Associations' => $this->l('Associations'),
|
||||
'Amenities' => $this->l('Amenities'),
|
||||
'Features' => $this->l('Features'),
|
||||
'Configuration' => $this->l('Rooms'),
|
||||
'Occupancy' => $this->l('Occupancy'),
|
||||
@@ -121,9 +122,10 @@ class AdminProductsControllerCore extends AdminController
|
||||
'Seo' => 2,
|
||||
// 'Associations' => 3,
|
||||
'Images' => 4,
|
||||
'Features' => 5,
|
||||
'Configuration' => 6,
|
||||
'Occupancy' => 7,
|
||||
'Amenities' => 5,
|
||||
'Features' => 6,
|
||||
'Configuration' => 7,
|
||||
'Occupancy' => 8,
|
||||
'ServiceProduct' => 9,
|
||||
'LengthOfStay' => 10,
|
||||
'AdditionalFacilities' => 11,
|
||||
@@ -944,12 +946,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
$id_hotel_new = $room_type_info['id_hotel'];
|
||||
}
|
||||
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
if ($roomTypeBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($id_product_old)) {
|
||||
$roomTypeBedTypes = array_column($roomTypeBedTypes, 'id_bed_type');
|
||||
$objHotelRoomTypeBedType->updateRoomTypeBedTypes($roomTypeBedTypes, $product->id);
|
||||
}
|
||||
|
||||
if ($product->hasAttributes()) {
|
||||
Product::updateDefaultAttribute($product->id);
|
||||
} else {
|
||||
@@ -1143,34 +1139,45 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product')))) {
|
||||
// delete all objects
|
||||
$product->deleteFeatures();
|
||||
|
||||
// add new objects
|
||||
$languages = Language::getLanguages(false);
|
||||
foreach ($_POST as $key => $val) {
|
||||
if (preg_match('/^feature_([0-9]+)_check/i', $key, $match)) {
|
||||
if ($val) {
|
||||
$product->addFeaturesToDB($match[1], $val);
|
||||
} else {
|
||||
if ($default_value = $this->checkFeatures($languages, $match[1])) {
|
||||
$id_value = $product->addFeaturesToDB($match[1], 0, 1);
|
||||
foreach ($languages as $language) {
|
||||
if ($cust = Tools::getValue('custom_'.$match[1].'_'.(int)$language['id_lang'])) {
|
||||
$product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $cust);
|
||||
} else {
|
||||
$product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $default_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$this->saveRoomTypeFeatures($product)) {
|
||||
$this->errors[] = Tools::displayError('An error occurred while saving room type features.');
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('A room type must be created before adding features.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save assigned core feature values for a room type.
|
||||
*
|
||||
* @param Product $product
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function saveRoomTypeFeatures(Product $product)
|
||||
{
|
||||
$product->deleteFeatures();
|
||||
|
||||
$featureValues = Tools::getValue('feature_values', array());
|
||||
if (!is_array($featureValues) || empty($featureValues)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($featureValues as $idFeature => $selectedValues) {
|
||||
$idFeature = (int)$idFeature;
|
||||
if (!$idFeature) {
|
||||
continue;
|
||||
}
|
||||
foreach (array_unique(array_map('intval', $selectedValues)) as $idFeatureValue) {
|
||||
if ($idFeatureValue) {
|
||||
$product->addFeaturesToDB($idFeature, $idFeatureValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is never called at the moment (specific prices cannot be edited)
|
||||
*/
|
||||
@@ -1925,14 +1932,29 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->copyFromPost($this->object, $this->table);
|
||||
$this->object->booking_product = true;
|
||||
if ($this->object->add()) {
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
$objHotelRoomTypeBedType->updateRoomTypeBedTypes(Tools::getValue('id_bed_types'), $this->object->id);
|
||||
// associateroom type to hotel
|
||||
// if ($this->object->is_virtual) {
|
||||
|
||||
// }
|
||||
|
||||
$this->assignRoomType($this->object);
|
||||
if ($this->isTabSubmitted('Amenities')) {
|
||||
$categories = HotelAmenities::getCategories();
|
||||
if ($categories && !HotelAmenities::getAmenities()) {
|
||||
$this->errors[] = Tools::displayError('No amenities have been created. Please add amenities to at least one category before assigning them.');
|
||||
return false;
|
||||
}
|
||||
$selectedAmenities = Tools::getValue('room_type_amenities', array());
|
||||
$featuredAmenities = Tools::getValue('featured_amenities', array());
|
||||
if (!(new HotelRoomTypeAmenities())->saveRoomTypeAmenities((int)$this->object->id, $selectedAmenities, $featuredAmenities)) {
|
||||
$this->errors[] = Tools::displayError('An error occurred while saving room type amenities.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ($this->isTabSubmitted('Features') && !$this->saveRoomTypeFeatures($this->object)) {
|
||||
$this->errors[] = Tools::displayError('An error occurred while saving room type features.');
|
||||
return false;
|
||||
}
|
||||
|
||||
PrestaShopLogger::addLog(sprintf($this->l('%s addition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
|
||||
|
||||
@@ -2175,8 +2197,18 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if ($object->update()) {
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
$objHotelRoomTypeBedType->updateRoomTypeBedTypes(Tools::getValue('id_bed_types'), $object->id);
|
||||
if ($this->isTabSubmitted('Amenities')) {
|
||||
$selectedAmenities = Tools::getValue('room_type_amenities', array());
|
||||
$featuredAmenities = Tools::getValue('featured_amenities', array());
|
||||
if (!(new HotelRoomTypeAmenities())->saveRoomTypeAmenities((int)$object->id, $selectedAmenities, $featuredAmenities)) {
|
||||
$this->errors[] = Tools::displayError('An error occurred while saving room type amenities.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ($this->isTabSubmitted('Features') && !$this->saveRoomTypeFeatures($object)) {
|
||||
$this->errors[] = Tools::displayError('An error occurred while saving room type features.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// update position in category
|
||||
$object->setPositionInCategory(Tools::getValue('category_position'));
|
||||
@@ -2200,9 +2232,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
if ($this->isTabSubmitted('Suppliers')) {
|
||||
// $this->processSuppliers();
|
||||
}
|
||||
if ($this->isTabSubmitted('Features')) {
|
||||
$this->processFeatures();
|
||||
}
|
||||
if ($this->isTabSubmitted('Combinations')) {
|
||||
$this->processProductAttribute();
|
||||
}
|
||||
@@ -4601,15 +4630,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
$data->assign('htl_full_info', $hotelFullInfo);
|
||||
}
|
||||
|
||||
$objHotelBedType = new HotelBedType();
|
||||
$bedTypes = $objHotelBedType->getAllBedTypes($this->context->language->id);
|
||||
$data->assign('bed_types_info', $bedTypes);
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
if ($selectedBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($product->id)) {
|
||||
$selectedBedTypes = array_column($selectedBedTypes, 'id_bed_type');
|
||||
$data->assign('selected_bed_types', $selectedBedTypes);
|
||||
}
|
||||
|
||||
$this->tpl_form_vars['product'] = $product;
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
@@ -4851,37 +4871,17 @@ class AdminProductsControllerCore extends AdminController
|
||||
} else {
|
||||
if ($obj->id) {
|
||||
if ($this->product_exists_in_shop) {
|
||||
$features = Feature::getFeatures($this->context->language->id, (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP));
|
||||
|
||||
foreach ($features as $k => $tab_features) {
|
||||
$features[$k]['current_item'] = false;
|
||||
$features[$k]['val'] = array();
|
||||
|
||||
$custom = true;
|
||||
foreach ($obj->getFeatures() as $tab_products) {
|
||||
if ($tab_products['id_feature'] == $tab_features['id_feature']) {
|
||||
$features[$k]['current_item'] = $tab_products['id_feature_value'];
|
||||
}
|
||||
}
|
||||
|
||||
$features[$k]['featureValues'] = FeatureValue::getFeatureValuesWithLang($this->context->language->id, (int)$tab_features['id_feature']);
|
||||
if (count($features[$k]['featureValues'])) {
|
||||
foreach ($features[$k]['featureValues'] as $value) {
|
||||
if ($features[$k]['current_item'] == $value['id_feature_value']) {
|
||||
$custom = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($custom) {
|
||||
$feature_values_lang = FeatureValue::getFeatureValueLang($features[$k]['current_item']);
|
||||
foreach ($feature_values_lang as $feature_value) {
|
||||
$features[$k]['val'][$feature_value['id_lang']] = $feature_value;
|
||||
}
|
||||
}
|
||||
$features = Product::getRoomTypeFeatureTreeData($obj->id);
|
||||
if ($features) {
|
||||
$tree = new HelperTree('room-type-features-tree', $features);
|
||||
$tree->setShowCollapseExpandButton(true)
|
||||
->setUseCheckBox(true)
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true)
|
||||
->setUseSearch(true)
|
||||
->setHeaderTemplate('tree_header_room.tpl');
|
||||
$data->assign('room_type_features_tree', $tree->render());
|
||||
}
|
||||
|
||||
$data->assign('available_features', $features);
|
||||
$data->assign('product', $obj);
|
||||
$data->assign('link', $this->context->link);
|
||||
$data->assign('default_form_language', $this->default_form_language);
|
||||
@@ -4895,6 +4895,50 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the amenities form tab for a room type.
|
||||
*
|
||||
* @param Product $obj
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws SmartyException
|
||||
*/
|
||||
public function initFormAmenities($obj)
|
||||
{
|
||||
if (!$this->default_form_language) {
|
||||
$this->getLanguages();
|
||||
}
|
||||
|
||||
$data = $this->createTemplate($this->tpl_form);
|
||||
$data->assign('default_form_language', $this->default_form_language);
|
||||
$data->assign('languages', $this->_languages);
|
||||
$data->assign('link', $this->context->link);
|
||||
$data->assign('product', $obj);
|
||||
|
||||
if ($obj->id) {
|
||||
if ($this->product_exists_in_shop) {
|
||||
$roomTypeAmenities = HotelRoomTypeAmenities::getRoomTypeAmenitiesTreeData((int) $obj->id);
|
||||
if ($roomTypeAmenities) {
|
||||
$tree = new HelperTree('room-type-amenities-tree', $roomTypeAmenities);
|
||||
$tree->setShowCollapseExpandButton(true)
|
||||
->setUseCheckBox(true)
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true)
|
||||
->setUseSearch(true)
|
||||
->setHeaderTemplate('tree_header_room.tpl');
|
||||
$data->assign('room_type_amenities_tree', $tree->render());
|
||||
$data->assign('featured_amenity_ids', array_column(HotelRoomTypeAmenities::getAmenities((int)$obj->id, 0, true), 'id'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save the room type in this shop before adding amenities.'));
|
||||
}
|
||||
} else {
|
||||
$this->displayWarning($this->l('You must save this room type before adding amenities.'));
|
||||
}
|
||||
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
public function getModalDuplicateOptions()
|
||||
{
|
||||
$idsHotel = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
|
||||
|
||||
@@ -38,7 +38,7 @@ class AdminSearchControllerCore extends AdminController
|
||||
'AdminOrderRefundRules' => 1,
|
||||
'AdminRoomTypeGlobalDemand' => 1,
|
||||
'AdminGroups' => 1,
|
||||
'AdminHotelFeatures' => 1,
|
||||
'AdminHotelAmenities' => 1,
|
||||
'AdminCustomers' => 1,
|
||||
'AdminAddHotel' => 1,
|
||||
'AdminNormalProducts' => 1,
|
||||
@@ -190,7 +190,7 @@ class AdminSearchControllerCore extends AdminController
|
||||
|
||||
if (!$searchType) {
|
||||
$this->searchAddress();
|
||||
$this->searchHotelFeatures();
|
||||
$this->searchHotelAmenities();
|
||||
$this->searchAdditionalFacilities();
|
||||
$this->searchRefundRules();
|
||||
}
|
||||
@@ -428,23 +428,23 @@ class AdminSearchControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function searchHotelFeatures()
|
||||
public function searchHotelAmenities()
|
||||
{
|
||||
if (class_exists('HotelFeatures')) {
|
||||
if (isset($this->controllerAccess['AdminHotelFeatures']) && $this->controllerAccess['AdminHotelFeatures']) {
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
if ($hotelFeatures = $objHotelFeatures->searchByName($this->query, $this->context->language->id)) {
|
||||
$features = array();
|
||||
foreach ($hotelFeatures as $key => $hotelFeature) {
|
||||
$features[$hotelFeature['id']]['name'] = $hotelFeature['name'];
|
||||
if ($hotelFeature['parent_feature_id']) {
|
||||
$features[$hotelFeature['id']]['id'] = $hotelFeature['parent_feature_id'];
|
||||
if (class_exists('HotelAmenities')) {
|
||||
if (isset($this->controllerAccess['AdminHotelAmenities']) && $this->controllerAccess['AdminHotelAmenities']) {
|
||||
$objHotelAmenities = new HotelAmenities();
|
||||
if ($hotelAmenities = $objHotelAmenities->searchByName($this->query, $this->context->language->id)) {
|
||||
$amenities = array();
|
||||
foreach ($hotelAmenities as $key => $hotelAmenity) {
|
||||
$amenities[$hotelAmenity['id_amenity']]['name'] = $hotelAmenity['name'];
|
||||
if ($hotelAmenity['id_parent']) {
|
||||
$amenities[$hotelAmenity['id_amenity']]['id'] = $hotelAmenity['id_parent'];
|
||||
} else {
|
||||
$features[$hotelFeature['id']]['id'] = $hotelFeature['id'];
|
||||
$amenities[$hotelAmenity['id_amenity']]['id'] = $hotelAmenity['id_amenity'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->_list['hotel_features'] = $features;
|
||||
$this->_list['hotel_amenities'] = $amenities;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -681,10 +681,10 @@ class AdminSearchControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
protected function initHotelFeatureList()
|
||||
protected function initHotelAmenityList()
|
||||
{
|
||||
$this->show_toolbar = false;
|
||||
$this->fields_list['hotel_features'] = array(
|
||||
$this->fields_list['hotel_amenities'] = array(
|
||||
'name' => array('title' => $this->l('name'), 'width' => 'auto'),
|
||||
);
|
||||
}
|
||||
@@ -929,26 +929,26 @@ class AdminSearchControllerCore extends AdminController
|
||||
$this->tpl_view_vars['customers'] = $view;
|
||||
}
|
||||
|
||||
if (isset($this->_list['hotel_features']) && count($this->_list['hotel_features'])) {
|
||||
if (isset($this->_list['hotel_amenities']) && count($this->_list['hotel_amenities'])) {
|
||||
$view = '';
|
||||
$this->initHotelFeatureList();
|
||||
$this->initHotelAmenityList();
|
||||
|
||||
$helper = new HelperList();
|
||||
$helper->shopLinkType = '';
|
||||
$helper->simple_header = true;
|
||||
$helper->identifier = 'id';
|
||||
$helper->identifier = 'id_amenity';
|
||||
$helper->actions = array('edit', 'view');
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = 'htl_features';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminHotelFeatures', false);
|
||||
$helper->token = Tools::getAdminTokenLite('AdminHotelFeatures');
|
||||
$helper->table = 'htl_amenity';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminHotelAmenities', false);
|
||||
$helper->token = Tools::getAdminTokenLite('AdminHotelAmenities');
|
||||
|
||||
if ($this->_list['hotel_features']) {
|
||||
$view = $helper->generateList($this->_list['hotel_features'], $this->fields_list['hotel_features']);
|
||||
if ($this->_list['hotel_amenities']) {
|
||||
$view = $helper->generateList($this->_list['hotel_amenities'], $this->fields_list['hotel_amenities']);
|
||||
}
|
||||
|
||||
$this->tpl_view_vars['num_hotel_features'] = count($this->_list['hotel_features']);
|
||||
$this->tpl_view_vars['hotel_features'] = $view;
|
||||
$this->tpl_view_vars['num_hotel_amenities'] = count($this->_list['hotel_amenities']);
|
||||
$this->tpl_view_vars['hotel_amenities'] = $view;
|
||||
}
|
||||
if (isset($this->_list['groups']) && count($this->_list['groups'])) {
|
||||
$view = '';
|
||||
|
||||
@@ -245,7 +245,6 @@ class CategoryControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
$feat_img_dir = _PS_IMG_.'rf/';
|
||||
$ratting_img = _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png';
|
||||
$this->context->smarty->assign(array(
|
||||
'warning_num' => $warning_num,
|
||||
@@ -258,7 +257,7 @@ class CategoryControllerCore extends FrontController
|
||||
'display_all_room_types' => $displayAllRoomsTypes,
|
||||
'id_hotel' => $id_hotel,
|
||||
'currency' => $currency,
|
||||
'feat_img_dir' => $feat_img_dir,
|
||||
'amenity_img_dir' => _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/',
|
||||
'ratting_img' => $ratting_img,
|
||||
));
|
||||
|
||||
|
||||
@@ -237,11 +237,11 @@ class ContactControllerCore extends FrontController
|
||||
$this->addJS(_PS_JS_DIR_.'validate.js');
|
||||
|
||||
// GOOGLE MAP
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && ($PS_MAP_ID = Configuration::get('PS_MAP_ID')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
|
||||
'PS_MAP_ID' => $PS_MAP_ID,
|
||||
'PS_MAP_ID' => Configuration::get('PS_MAP_ID'),
|
||||
)
|
||||
);
|
||||
$this->addJS(
|
||||
|
||||
@@ -639,7 +639,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
if (Validate::isLoadedObject($objHotelBranchInformation)) {
|
||||
if (($apiKey = Configuration::get('PS_API_KEY'))
|
||||
&& Configuration::get('WK_GOOGLE_ACTIVE_MAP')
|
||||
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
|
||||
) {
|
||||
if (floatval($objHotelBranchInformation->latitude) != 0
|
||||
&& floatval($objHotelBranchInformation->longitude) != 0
|
||||
@@ -647,7 +646,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
Media::addJsDef(array(
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
|
||||
'initiateMap' => 1,
|
||||
'PS_MAP_ID' => $PS_MAP_ID,
|
||||
'PS_MAP_ID' => Configuration::get('PS_MAP_ID'),
|
||||
));
|
||||
|
||||
$this->addJS(
|
||||
|
||||
@@ -523,8 +523,18 @@ class OrderDetailControllerCore extends FrontController
|
||||
{
|
||||
$response = array('extra_demands' => false);
|
||||
|
||||
$idOrder = (int) Tools::getValue('id_order');
|
||||
$order = new Order($idOrder);
|
||||
|
||||
if (!Validate::isLoadedObject($order)
|
||||
|| $order->id_customer != $this->context->customer->id
|
||||
|| $order->secure_key != Tools::getValue('secure_key')
|
||||
) {
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& $idOrder
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
@@ -568,7 +578,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'objOrder' => new Order($idOrder),
|
||||
'objOrder' => $order,
|
||||
));
|
||||
|
||||
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl');
|
||||
@@ -874,7 +884,6 @@ class OrderDetailControllerCore extends FrontController
|
||||
if (Validate::isLoadedObject($objHotelBranchInformation)) {
|
||||
if (($apiKey = Configuration::get('PS_API_KEY'))
|
||||
&& Configuration::get('WK_GOOGLE_ACTIVE_MAP')
|
||||
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
|
||||
) {
|
||||
if (floatval($objHotelBranchInformation->latitude) != 0
|
||||
&& floatval($objHotelBranchInformation->longitude) != 0
|
||||
@@ -882,7 +891,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
Media::addJsDef(array(
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
|
||||
'initiateMap' => 1,
|
||||
'PS_MAP_ID' => $PS_MAP_ID,
|
||||
'PS_MAP_ID' => Configuration::get('PS_MAP_ID'),
|
||||
));
|
||||
$this->addJS(
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places,marker&loading=async&callback=initMap&language='.
|
||||
|
||||
@@ -111,7 +111,7 @@ class OurPropertiesControllerCore extends FrontController
|
||||
$hotelsInfo = array_slice($hotelsInfo, $page * 10, 10);
|
||||
}
|
||||
|
||||
if ($displayHotelMap && Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP') && Configuration::get('PS_MAP_ID')) {
|
||||
if ($displayHotelMap && Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
|
||||
if ($hotelLocations = $objHotelInfo->getMapFormatHotelsInfo(Configuration::get('WK_MAP_HOTEL_ACTIVE_ONLY'))) {
|
||||
$hotelLocationArray = str_replace(array('\n', '\r'), '', json_encode($hotelLocations));
|
||||
}
|
||||
@@ -144,11 +144,11 @@ class OurPropertiesControllerCore extends FrontController
|
||||
$this->addJS(_THEME_JS_DIR_.'our-properties.js');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'our-properties.css');
|
||||
// GOOGLE MAP
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && ($PS_MAP_ID = Configuration::get('PS_MAP_ID')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
|
||||
'PS_MAP_ID' => $PS_MAP_ID
|
||||
'PS_MAP_ID' => Configuration::get('PS_MAP_ID')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -66,9 +66,7 @@ class ProductControllerCore extends FrontController
|
||||
$this->addJqueryPlugin('jqzoom');
|
||||
}
|
||||
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY'))
|
||||
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
|
||||
) {
|
||||
if ($PS_API_KEY = Configuration::get('PS_API_KEY')) {
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($roomTypeInfo['id_hotel']);
|
||||
@@ -81,7 +79,7 @@ class ProductControllerCore extends FrontController
|
||||
'longitude' => $objHotelBranchInformation->longitude,
|
||||
),
|
||||
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
|
||||
'PS_MAP_ID' => $PS_MAP_ID
|
||||
'PS_MAP_ID' => Configuration::get('PS_MAP_ID')
|
||||
));
|
||||
|
||||
$this->addJS(
|
||||
@@ -352,12 +350,12 @@ class ProductControllerCore extends FrontController
|
||||
$hotel_location = $addressInfo['city'].
|
||||
($addressInfo['id_state']?', '.$addressInfo['state']:'').', '.$addressInfo['country'];
|
||||
|
||||
$obj_hotel_feaures_ids = $obj_hotel_branch->getFeaturesOfHotelByHotelId($hotel_id);
|
||||
$obj_hotel_amenities_ids = $obj_hotel_branch->getAmenitiesOfHotelByHotelId($hotel_id);
|
||||
|
||||
if (isset($obj_hotel_feaures_ids) && $obj_hotel_feaures_ids) {
|
||||
foreach ($obj_hotel_feaures_ids as $key => $value) {
|
||||
$obj_htl_ftr = new HotelFeatures();
|
||||
$htl_info = $obj_htl_ftr->getFeatureInfoById($value['feature_id']);
|
||||
if (isset($obj_hotel_amenities_ids) && $obj_hotel_amenities_ids) {
|
||||
foreach ($obj_hotel_amenities_ids as $key => $value) {
|
||||
$obj_htl_amenity = new HotelAmenities();
|
||||
$htl_info = $obj_htl_amenity->getAmenityInfoById($value['amenity_id']);
|
||||
$htl_features[] = $htl_info['name'];
|
||||
}
|
||||
}
|
||||
@@ -415,19 +413,9 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
$objHotelBedType = new HotelBedType();
|
||||
if ($bedTypes = $objHotelBedType->getAllBedTypes($this->context->language->id)) {
|
||||
foreach ($bedTypes as $bedTypeKey => $bedType) {
|
||||
$bedTypes[$bedTypeKey]['area'] = Tools::ps_round($bedType['width'], 2).' * '.Tools::ps_round($bedType['length'], 2);
|
||||
}
|
||||
|
||||
$bedTypes = array_column($bedTypes, null, 'id_bed_type');
|
||||
}
|
||||
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
if ($selectedBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($this->product->id)) {
|
||||
$selectedBedTypes = array_column($selectedBedTypes, 'id_bed_type');
|
||||
}
|
||||
$roomFeatures = $this->product->getFrontFeatures($this->context->language->id);
|
||||
$roomAmenities = HotelRoomTypeAmenities::getAmenities($this->product->id, $this->context->language->id);
|
||||
$hotelAmenities = HotelBranchAmenities::getAmenities($hotel_id, $this->context->language->id);
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
@@ -455,14 +443,14 @@ class ProductControllerCore extends FrontController
|
||||
'hotel_description' => $hotel_info_by_id['description'],
|
||||
'hotel_policies' => $hotel_policies,
|
||||
'hotel_features' => $htl_features,
|
||||
'room_type_features' => $roomFeatures,
|
||||
'room_dynamic_amenities' => $roomAmenities,
|
||||
'hotel_dynamic_amenities' => $hotelAmenities,
|
||||
'amenity_img_dir' => _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/',
|
||||
'hotel_image_link' => $hotelImageLink,
|
||||
'hotel_has_images' => (bool) HotelImage::getCover($hotel_id),
|
||||
'ftr_img_src' => _PS_IMG_.'rf/',
|
||||
'order_date_restrict' => $order_date_restrict,
|
||||
'PS_SERVICE_PRODUCT_CATEGORY_FILTER' => Configuration::get('PS_SERVICE_PRODUCT_CATEGORY_FILTER'),
|
||||
'bed_types_info' => $bedTypes,
|
||||
'selected_bed_types' => $selectedBedTypes,
|
||||
'dimension_unit' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
8744
docs/CHANGELOG.txt
@@ -1,17 +0,0 @@
|
||||
Adress ID;Alias*;Active (0/1);Customer e-mail*;Customer ID;Manufacturer;Supplier;Company;Lastname*;Firstname*;Address 1*;Address 2;Zipcode*;City*;Country*;State;Other;Phone;Mobile Phone;VAT number;DNI
|
||||
1;Peter.Pan / New York;1;Peter.Pan@prestashop.com;;;;;Pan;Peter;360W, 42nd Street;;12001;New York;United States;New York;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
2;Wendy.Moira.Darling / New York;1;Wendy.Moira.Darling@prestashop.com;;;;;Darling;Wendy Moira;360W, 42nd Street;;12001;New York;United States;New York;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
3;Wendy.Moira.Darling / London;1;Wendy.Moira.Darling@prestashop.com;;;;;Darling;Wendy Moira;Lansdowne road 50 London;Kensington;W11;London;United Kingdom;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
4;Tiger.Lily / Arizona;1;Tiger.Lily@prestashop.com;;;;;Lily;Tiger;Brackin Ranch Road;;86001;Flagstaff;United States;Arizona;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
5;Tiger.Lily / Le Chesnay;1;Tiger.Lily@prestashop.com;;;;;Lily;Tiger;53 passage des pas sages;;78150;Le Chesnay;France;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
6;James.Hook / Home;1;James.Hook@prestashop.com;;;;;Hook;James;Mass Gravesite;P.O. Box 007;2101;Cayman Brac;Cayman Islands;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
7;James Hook / Pro;1;James.Hook@prestashop.com;;;;Räuber Schätze GmBH;Hook;James;12 Leipziger Platz;;13505;Berlin;Germany;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
8;Tinker.Bell / Napaiiri;1;Tinker.Bell@prestashop.com;;;;Santa Clauss Inc.;Bell;Tinker;Tähtikuja 1;;96930;Napapiiri;Finland;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
9;Smee / Fiji;1;Bob.Smee@prestashop.com;;;;;Smee;Bob;Cross Island rd 321;Vanua Levu;;Savusavu;Fiji;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
10;Smee / Portland;1;Bob.Smee@prestashop.com;;;;Lattice Semiconductor;Smee;Bob;5555 NE Moore Ct;;97124;Hillsboro;United States;Oregon;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
11;Tictac Crocodile / Home;1;Tictac.Crocodile@prestashop.com;;;;;Crocodile;Tictac;Old State Rd 4A;Saddlebunch keys;33040;Bay Point;United States;Florida;Beware the Shark :);01 02 03 04 05;06 02 03 04 05;;;
|
||||
12;Apple / address1;1;;;Apple;;;Doe;John;1–6 Infinite Loop;;95014;Cupertino;United States;California;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
13;Shure / address1;1;;;Shure;;;Non-Doe;John;5800W Touhy Avenue;;60714;Niles;United States;Illinois;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
14;Shure / address2;1;;;Shure;;;Schuss-mayer;Kurt;Jakob-Dieffenbacher-Str. 12;;75031;Eppingen;Germany;;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
15;UPS / address1;1;;;;U.P.S;;Austin;Steve;55NE Glenlake Parkway;;30328;Atlanta;United States;Georgia;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
16;FedEX / address1;1;;;;FedEX;;Noland;Chuck;3640 Hacks Cross Rd;;32125;Memphis;United States;Tennessee;;01 02 03 04 05;06 02 03 04 05;;;
|
||||
|
@@ -1,5 +0,0 @@
|
||||
Alias ID;Alias *;Search *;Active (0/1)
|
||||
1;htl, hotle;Hotel;1
|
||||
2;rom, roms;Room;1
|
||||
2;romblk, romblk;Room Block;1
|
||||
3;ordre;Order;1
|
||||
|
@@ -1,28 +0,0 @@
|
||||
Product ID*;Attribute (Name:Type:Position)*;Value (Value:Position)*;Supplier reference;Reference;EAN13;UPC;Wholesale price;Impact on price;Ecotax;Quantity;Minimal quantity;Impact on weight;Default (0 = No, 1 = Yes);Combination available date;Image position;Image URL;Delete existing images (0 = No, 1 = Yes);ID / Name of shop;Advanced Stock Managment;Depends on stock;Warehouse
|
||||
1;Color:color:0, Disk space:select:1;Blue:0, 16GB:1;RF-Nano-Blue-16GB;RP-Nano-Blue-16GB;0000080446392;116052426077;100;40;0;10;1;0;0;2014-01-01;1;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Blue:0, 8GB:1;RF-Nano-Blue-8GB;RP-Nano-Blue-8GB;0000080446393;457698445011;80;0;0;10;1;0;0;2014-01-02;2;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Yellow:0, 16GB:1;RF-Nano-Yellow-16GB;RP-Nano-Yellow-16GB;0000080446394;541661772012;100;40;0;10;1;0;0;2014-01-03;3;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Yellow:0, 8GB:1;RF-Nano-Yellow-8GB;RP-Nano-Yellow-8GB;0000080446395;080064075921;80;0;0;10;1;0;1;2014-01-04;4;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Metal:0, 16GB:1;RF-Nano-Metal-16GB;RP-Nano-Metal-16GB;0000080446396;943284585394;100;40;0;10;1;0;0;2014-01-05;5;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Metal:0, 8GB:1;RF-Nano-Metal-8GB;RP-Nano-Metal-8GB;0000080446397;779589194980;80;0;0;10;1;0;0;2014-01-06;6;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Black:0, 16GB:1;RF-Nano-Black-16GB;RP-Nano-Black-16GB;0000080446398;633319125866;100;40;0;10;1;0;0;2014-01-07;7;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Black:0, 8GB:1;RF-Nano-Black-8GB;RP-Nano-Black-8GB;0000080446399;397444719890;80;0;0;10;1;0;0;2014-01-08;8;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Orange:0, 16GB:1;RF-Nano-Orange-16GB;RP-Nano-Orange-16GB;0000080446400;295437962413;100;40;0;10;1;0;0;2014-01-09;9;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Orange:0, 8GB:1;RF-Nano-Orange-8GB;RP-Nano-Orange-8GB;0000080446401;879526174964;80;0;0;10;1;0;0;2014-01-10;10;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Pink:0, 16GB:1;RF-Nano-Pink-16GB;RP-Nano-Pink-16GB;0000080446402;850089888307;100;40;0;10;1;0;0;2014-01-11;11;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Pink:0, 8GB:1;RF-Nano-Pink-8GB;RP-Nano-Pink-8GB;0000080446403;681363175404;80;0;0;10;1;0;0;2014-01-12;12;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Green:0, 16GB:1;RF-Nano-Green-16GB;RP-Nano-Green-16GB;0000080446404;343278201887;100;40;0;10;1;0;0;2014-01-13;13;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Green:0, 8GB:1;RF-Nano-Green-8GB;RP-Nano-Green-8GB;0000080446405;910409113499;80;0;0;10;1;0;0;2014-01-14;14;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Purple:0, 16GB:1;RF-Nano-Purple-16GB;RP-Nano-Purple-16GB;0000080446406;835747175053;100;40;0;10;1;0;0;2014-01-15;15;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
1;Color:color:0, Disk space:select:1;Purple:0, 8GB:1;RF-Nano-Purple-8GB;RP-Nano-Purple-8GB;0000080446407;825739577313;80;0;0;10;1;0;0;2014-01-16;16;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
2;Color:color:0;Metal:0;RF-Shuffle-Metal;RP-Shuffle-Metal;0685387000000;623892618739;40;0;0;12;1;0;1;2014-01-17;1;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
2;Color:color:0;Blue:0;RF-Shuffle-Blue;RP-Shuffle-Blue;0685387000000;848279119061;40;0;0;12;1;0;0;2014-01-18;2;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
2;Color:color:0;Pink:0;RF-Shuffle-Pink;RP-Shuffle-Pink;0685387000000;745140261407;40;0;0;12;1;0;0;2014-01-19;3;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
2;Color:color:0;Green:0;RF-Shuffle-Green;RP-Shuffle-Green;0685387000000;180143857886;40;0;0;12;1;0;0;2014-01-20;4;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
3;Color:color:0, Disk space:select:1, ICU:select:2;Metal:0, 80GB Parallel ATA Drive @ 4200 rpm:1, 1.60GHz Intel Core 2 Duo:2;RF-MacBookAir80GB-1.6MHz;RP-MacBookAir80GB-1.6MHz;0123457000000;959149242374;0;750;0;10;1;0;0;2014-01-21;1;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
3;Color:color:0, Disk space:select:1, ICU:select:2;Metal:0, 80GB Parallel ATA Drive @ 4200 rpm:1, 1.80GHz Intel Core 2 Duo:2;RF-MacBookAir80GB-1.6MHz;RP-MacBookAir80GB-1.6MHz;0123457000000;110179337894;0;0;0;10;1;0;1;2014-01-22;2;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
3;Color:color:0, Disk space:select:1, ICU:select:2;Metal:0, Optional 64GB solid-state drive:1, 1.60GHz Intel Core 2 Duo:2;RF-MacBookAir64GB-1.8MHz;RP-MacBookAir64GB-1.8MHz;0123457000000;576786535242;0;225;0;10;1;0;0;2014-01-23;3;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
3;Color:color:0, Disk space:select:1, ICU:select:2;Metal:0, Optional 64GB solid-state drive:1, 1.60GHz Intel Core 2 Duo:2;RF-MacBookAir64GB-1.8MHz;RP-MacBookAir64GB-1.8MHz;0123457000000;288200093419;0;975;0;10;1;0;0;2014-01-24;4;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
5;Disk space:select:1;8GB:0;RF-IpodTouch8GB;RP-IpodTouch8GB;8456120000000;626733005930;200;0;0;10;1;0;1;2014-01-25;1;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
5;Disk space:select:1;16GB:0;RF-IpodTouch16GB;RP-IpodTouch16GB;8456120000000;604116319829;250;75;0;10;1;0;0;2014-01-26;2;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
5;Disk space:select:1;32GB:0;RF-IpodTouch32GB;RP-IpodTouch32GB;8456120000000;635894030063;300;150;0;10;1;0;0;2014-01-27;3;http://youdomain.com/img.jpg;1;0;0;0;
|
||||
|
@@ -1,35 +1,32 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* 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:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* 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 license@prestashop.com so we can send you a copy immediately.
|
||||
* 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 PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* 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 PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -1,63 +0,0 @@
|
||||
Manufacturer ID;Active (0/1);Name *;Description;Short description;Meta title;Meta keywords;Meta description;Image URL
|
||||
1;1;Apple;"<p style=""text-align: justify;"">The company was founded on April 1, 1976, and incorporated as Apple Computer, Inc. on January 3, 1977.The word ""Computer"" was removed from its name on January 9, 2007, the same day Steve Jobs introduced the iPhone, reflecting its shifted focus towards consumer electronics.<br /><br />Apple is the world's second-largest information technology company by revenue after Samsung Electronics, and the world's third-largest mobile phone maker after Samsung and Nokia.Fortune magazine named Apple the most admired company in the United States in 2008, and in the world from 2008 to 2012. However, the company has received criticism for its contractors' labor practices, and for Apple's own environmental and business practices.<br /><br />As of May 2013, Apple maintains 408 retail stores in fourteen countries as well as the online Apple Store and iTunes Store, the latter of which is the world's largest music retailer. Apple is the largest publicly traded corporation in the world by market capitalization, with an estimated value of US$415 billion as of March 2013. As of Sept 29 2012, the company had 72,800 permanent full-time employees and 3,300 temporary full-time employees worldwide. Its worldwide annual revenue in 2012 totalled $156 billion. In May 2013, Apple entered the top ten of the Fortune 500 list of companies for the first time, rising 11 places above its 2012 ranking to take the sixth position.</p>
|
||||
<p> </p>
|
||||
<p style=""text-align: right;""><a href=""http://en.wikipedia.org/wiki/Apple_Inc."" target=""_blank""><span style=""color: #008080;""><em><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps atn"">(</span><span>For more,</span> <span class=""hps"">go to the</span> </span></span><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps"">original article</span></span></span><span style=""color: #008080;""><span id=""result_box"" lang=""en""> <span class=""hps"">on</span> </span></span><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps"">Wikipedia)</span></span></span></em></span></a></p>";"<p> </p>
|
||||
<div class=""floatnone""><strong><span class=""image""><img style=""display: block; margin-left: auto; margin-right: auto;"" src=""http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Apple_logo_black.svg/101px-Apple_logo_black.svg.png"" alt=""1998-present"" width=""101"" height=""121"" /></span></strong></div>
|
||||
<div class=""floatnone""> </div>
|
||||
<p style=""text-align: justify;""> </p>
|
||||
<p style=""text-align: justify;""><strong>Apple Inc.,</strong> formerly Apple Computer, Inc., is an American multinational corporation headquartered in Cupertino, California that designs, develops, and sells consumer electronics, computer software and personal computers.</p>";MetaTitle-Apple;MetaKeywords-Apple;Meta description-Apple;http://localhost/prestashop/img/m/1.jpg
|
||||
2;1;Shure;"<h2 style=""text-align: justify;""><span class=""mw-headline""><br /></span></h2>
|
||||
<h2 style=""text-align: justify;""><span id=""Company_history"" class=""mw-headline"">Company history</span></h2>
|
||||
<p style=""text-align: justify;"">Shure was founded by Sidney N. Shure in 1925 as ""The Shure Radio Company"", selling radio parts kits in the days before complete manufactured radios were available. The company's office was located at 19 South Wells Street in downtown Chicago, Illinois. The following year, Shure published its first direct mail catalog, which was one of only six radio parts catalogs in the United States at the time. By 1928, the company had grown to over 75 employees, and Sidney's brother, Samuel J. Shure, joined the company, which was renamed Shure Brothers Company. The company moved into new offices at 335 West Madison Street in Chicago. In 1929, with the advent of the Great Depression and the increased availability of factory-built radios, Shure Brothers Company was forced to greatly reduce their staff and became the exclusive US distributor of a small microphone manufacturer. In 1930, Samuel J. Shure left the company.</p>
|
||||
<p style=""text-align: justify;"">In 1931, Shure and engineer Ralph Glover began development of the first Shure microphone, and the following year, the Model 33N Two-Button Carbon Microphone was introduced, making Shure one of only four microphone manufacturers in the U.S.. Shure's first condenser microphone, crystal microphone, and microphone suspension support system (for which they received their first patent) were all introduced that same decade. In 1939, Shure introduced the Model 55 Unidyne Microphone, which went on to become one of the world's most recognized microphones.</p>
|
||||
<p style=""text-align: justify;"">In 1941, Shure was contracted by the United States armed forces to supply microphones during World War II, and by the following year, the T-17B was the microphone most widely used by the U.S. Army and Navy. Shure also manufactured throat, headset, and oxygen mask microphones, and adopted the United States Military Standard for all Shure microphones.</p>
|
||||
<p style=""text-align: justify;"">By the mid-1940s, Shure was also manufacturing and supplying phonograph cartridges to major phonograph manufacturers including Philco, RCA, Emerson, Magnavox, Admiral, and Motorola, and was the largest producer of phonograph cartridges in the U.S. at that time. Among Shure's innovations in phonograph cartridge design was Ralph Glover and Ben Bauer's ""needle-tilt"" principle for minimizing record wear while improving sound reproduction, and Jim Kogen's engineering concept of ""trackability."" Shure produced the first phonograph cartridge capable of playing both long-playing and 78 rpm records, the first cartridge with tracking force of only one gram, and the first cartridge meeting the requirements of stereo recording. At the peak of Shure's phonograph cartridge production, the company was producing approximately 28,000 cartridges per day, with 25,000 of those coming from a Shure phonograph cartridge plant in Phoenix, Arizona. After the introduction of compact discs in the 1980s reduced the demand for phonograph cartridges, Shure closed the Phoenix facility but continued manufacturing phonograph cartridges, and continues to manufacture them today.</p>
|
||||
<p style=""text-align: justify;"">Shure also developed and produced products for medical applications. In 1937, their 66A piezoelectric stethophone was designed to accurately reproduce chest sounds, and in the early 1960s, the SP-5, SP-5S and SP-6 stethoscope pickups were produced. Shure also produced hearing aid cartridges used in hearing aid products from manufacturers like Maico, Telex, Dictograph, Otarian, Vocalite, and Trimm.</p>
|
||||
<p style=""text-align: justify;"">In 1956, Shure moved its corporate headquarters to Hartrey Avenue in Evanston, Illinois, where it remained for 47 years. Beginning in the 1956, Shure manufactured magnetic tape recording heads and two years later, the company announced it was ready to mass-produce 4-ch recording heads. By 1964, however, Shure announced it would no longer produce tape recording heads due to increased competition.</p>
|
||||
<p style=""text-align: justify;"">In 1953, Shure introduced their first wireless microphone system for performers, and in 1959, they introduced the Unidyne III Microphone, which was the predecessor to the SM57, which would be introduced, along with the SM58, six years later. Shure also produced portable equipment for broadcast field recording like Vocal Master, the M67 Portable Mixer, and the FP31 Portable Mixer. In 1990, Shure entered the wireless microphone market with the L-Series.</p>
|
||||
<p style=""text-align: justify;"">In 1981, James Kogen, Executive Vice President, Operations, was promoted to President and General Manager of Shure. In 1995, Sidney N. Shure died at the age of 93, and Rose L. Shure was elected Chairman of the Board of Directors. In 1996, James Kogen retired; Santo (Sandy) LaMantia, Vice President of Engineering, was named President and CEO. Shure Brothers Incorporated was officially renamed Shure Incorporated in 1999.</p>
|
||||
<p>In 2001, Shure acquired the Popper Stopper brand of studio pop filters from Middle Atlantic Products Inc. The following year, Shure adopted hearing conservation as the company’s corporate cause and established the Shure Bid for Hearing program. In 2003, Shure moved into new corporate headquarters in Niles, Illinois, into a building designed by architect Helmut Jahn which was originally the headquarters of <span class=""new"">HA•LO Industries</span>. The 65,000-square-foot (6,000 m<sup>2</sup>) Technology Annex designed by Krueck and Sexton Architects, opened in 2005, houses Shure's Performance Listening Center. In 2008, Shure celebrated the opening of The S.N. Shure Theater and Interactive Display at their corporate headquarters.</p>
|
||||
<h3 style=""text-align: justify;""><span id=""International_offices"" class=""mw-headline"">International offices</span></h3>
|
||||
<ul style=""text-align: justify;"">
|
||||
<li>1991: Shure Europe GmbH opened in Heilbronn, Germany to provide sales, service and support to Shure distribution centers in 34 European countries.</li>
|
||||
<li>1999: Shure Asia Limited is opened in Hong Kong to serve Distribution Centers and distributors throughout Asia and the Pacific Rim.</li>
|
||||
<li>2002: Shure Distribution GmbH established as a subsidiary of Shure Europe GmbH, to handle direct sales with Shure dealers in Germany.</li>
|
||||
<li>2003: HW International, Shure's United Kingdom Distribution Center, acquired and renamed Shure Distribution UK.</li>
|
||||
<li>2005: Sales and marketing office opened in Shanghai, China.</li>
|
||||
<li>2006: Sales and marketing office opened in Tokyo, Japan.</li>
|
||||
<li>2010: New subsidiary formed in the Netherlands</li>
|
||||
</ul>
|
||||
<h3 style=""text-align: justify;""><span id=""Production_facility_expansion"" class=""mw-headline"">Production facility expansion</span></h3>
|
||||
<ul style=""text-align: justify;"">
|
||||
<li>1982: Manufacturing facility opened in Wheeling, Illinois</li>
|
||||
<li>1983: Phonograph cartridge manufacturing facility opened in Agua Prieta, Mexico</li>
|
||||
<li>1984: Wired microphone manufacturing facility opened in Juarez, Mexico</li>
|
||||
<li>1989: Juarez, Mexico facility expanded</li>
|
||||
<li>1994: Agua Prieta facility expanded in 1994</li>
|
||||
<li>2005: Manufacturing facility opened in Suzhou, China</li>
|
||||
</ul>
|
||||
<p><sup id=""cite_ref-The_History_of_Shure_Incorporated_7-1"" class=""reference""><span><a href=""http://en.wikipedia.org/wiki/Samsung"" target=""_blank""><span style=""color: #008080;""><em><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps""><br class=""hps atn"" /></span></span></span></em></span></a></span></sup></p>
|
||||
<p style=""text-align: right;""><a href=""http://en.wikipedia.org/wiki/Shure"" target=""_blank""><span><span style=""color: #008080;""><em><span style=""color: #008080;""><span lang=""en""><span class=""hps""><span style=""color: #008080;""><em><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps atn"">(</span><span>For more,</span> <span class=""hps"">go to the</span> <span class=""hps"">original article</span> <span class=""hps"">on</span> <span class=""hps"">Wikipedia)</span></span></span></em></span></span></span></span></em></span></span></a></p>";"<p> </p>
|
||||
<p style=""text-align: center;""><span class=""image""><img class=""thumbimage"" src=""http://upload.wikimedia.org/wikipedia/en/thumb/f/f7/Shure_us_pro_circle_s_logo.gif/220px-Shure_us_pro_circle_s_logo.gif"" alt="""" width=""131"" height=""131"" /></span></p>
|
||||
<p> </p>
|
||||
<p style=""text-align: justify;""><strong>Shure Incorporated</strong> is an American corporation originally founded by Sidney N. Shure in Chicago, Illinois in 1925 as a supplier of radio parts kits. The company became a consumer and professional audio-electronics manufacturer of microphones, wireless microphone systems, phonograph cartridges, discussion systems, mixers, and digital signal processing.</p>
|
||||
<p style=""text-align: justify;"">The company also produces listening products, including headphones, high-end earbuds and personal monitor systems.</p>";MetaTitle-Shure;MetaKeywords-Shure;Meta description-Shure;http://localhost/prestashop/img/m/2.jpg
|
||||
3;1;Sony;"<h2><span class=""mw-headline""><br /></span></h2>
|
||||
<h2><span id=""History"" class=""mw-headline"">History</span></h2>
|
||||
<p>Sony found its beginning in the wake of World War II. In 1946, Masaru Ibuka started an electronics shop in a bomb-damaged department store building in Tokyo. The company had $530 in capital and a total of eight employees. The next year, he was joined by his colleague, Akio Morita, and they founded a company called <strong>Tokyo Tsushin Kogyo</strong> (Tokyo Telecommunications Engineering Corporation). The company built Japan's first tape recorder, called the Type-G. In 1958 the company name was changed to Sony.</p>
|
||||
<p style=""text-align: justify;"">In the early 1950s, Ibuka traveled in the United States and heard about Bell Labs' invention of the...</p>
|
||||
<p style=""text-align: right;""><span style=""color: #008080;""><em><a href=""http://en.wikipedia.org/wiki/Sony"" target=""_blank""><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps atn"">(</span><span>For more,</span> <span class=""hps"">go to the</span> <span class=""hps"">original article</span> <span class=""hps"">on</span> <span class=""hps"">Wikipedia)</span></span><br /></span></a></em></span></p>";"<p style=""text-align: justify;""> </p>
|
||||
<p><span class=""image""><img style=""display: block; margin-left: auto; margin-right: auto;"" src=""http://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/Sony_logo.svg/220px-Sony_logo.svg.png"" alt=""Sony logo.svg"" width=""220"" height=""37"" /></span></p>
|
||||
<p> </p>
|
||||
<p><strong><br /></strong></p>
|
||||
<p style=""text-align: justify;""><strong>Sony Corporation</strong>, commonly referred to as Sony, is a Japanese multinational conglomerate corporation headquartered in Konan Minato, Tokyo, Japan. Its diversified business is primarily focused on the electronics, game, entertainment and financial services sectors. The company is one of the leading manufacturers of electronic products for the consumer and professional markets. Sony is ranked 87th on the 2012 list of Fortune Global 500.</p>";MetaTitle-Sony;MetaKeywords-Sony;Meta description-Sony;http://localhost/prestashop/img/m/3.jpg
|
||||
4;1;Samsung;"<p style=""text-align: justify;"">Samsung was founded by Lee Byung-chul in 1938 as a trading company. Over the next three decades the group diversified into areas including food processing, textiles, insurance, securities and retail. Samsung entered the electronics industry in the late 1960s and the construction and shipbuilding industries in the mid-1970s; these areas would drive its subsequent growth. Following Lee's death in 1987, Samsung was separated into four business groups – Samsung Group, Shinsegae Group, CJ Group and Hansol Group. Since the 1990s Samsung has increasingly globalized its activities, and electronics, particularly mobile phones and semiconductors, have become its most important source of income.</p>
|
||||
<p>Notable Samsung industrial subsidiaries include Samsung Electronics (the <span class=""mw-redirect"">world's largest information technology company</span> measured by 2012 revenues, and 4th in market value), Samsung Heavy Industries (the world's 2nd-largest <span class=""mw-redirect"">shipbuilder</span> measured by 2010 revenues), and Samsung Engineering and <span class=""mw-redirect"">Samsung C&T</span> (respectively the world's 13th and 36th-largest construction companies). Other notable subsidiaries include Samsung Life Insurance (the world's 14th-largest life insurance company), Samsung Everland (operator of Everland Resort, the oldest <span class=""mw-redirect"">theme park</span> in South Korea), Samsung Techwin (an aerospace, surveillance and defense company) and <span class=""new"">Cheil Worldwide</span> (the world's 16th-largest advertising agency measured by 2011 revenues).</p>
|
||||
<p>Samsung has a powerful influence on South Korea's economic development, politics, media and culture, and has been a major driving force behind the ""Miracle on the Han River"". Its affiliate companies produce around a fifth of South Korea's total exports. Samsung's revenue was equal to 17% of the South Korea's $1,082 billion GDP.</p>
|
||||
<p style=""text-align: justify;"">In 2013, Samsung began construction on building the world's largest ...</p>
|
||||
<p style=""text-align: right;""><a href=""http://en.wikipedia.org/wiki/Samsung"" target=""_blank""><span style=""color: #008080;""><em><span style=""color: #008080;""><span id=""result_box"" lang=""en""><span class=""hps atn"">(</span><span>For more,</span> <span class=""hps"">go to the</span> <span class=""hps"">original article</span> <span class=""hps"">on</span> <span class=""hps"">Wikipedia)</span></span></span></em></span></a></p>";"<p><strong><br /></strong></p>
|
||||
<div class=""center"">
|
||||
<div class=""floatnone"" style=""text-align: center;""><span class=""image""><img src=""http://upload.wikimedia.org/wikipedia/commons/thumb/2/24/Samsung_Logo.svg/200px-Samsung_Logo.svg.png"" alt=""Samsung Logo.svg"" width=""200"" height=""68"" /></span></div>
|
||||
</div>
|
||||
<p><strong><br /></strong></p>
|
||||
<p style=""text-align: justify;""><strong>Samsung Group</strong> is a South Korean multinational conglomerate company headquartered in Samsung Town, Seoul. It comprises numerous subsidiaries and affiliated businesses, most of them united under the <em>Samsung</em> brand, and is the largest South Korean <em>chaebol</em> (business conglomerate).</p>";MetaTitle-Samsung;MetaKeywords-Samsung;Meta description-Samsung;http://localhost/prestashop/img/m/4.jpg
|
||||
|
@@ -1,8 +0,0 @@
|
||||
Product ID;Active (0/1);Name *;Categories (x,y,z...);Price tax excluded or Price tax included;Tax rules ID;Wholesale price;On sale (0/1);Discount amount;Discount percent;Discount from (yyyy-mm-dd);Discount to (yyyy-mm-dd);Reference #;Supplier reference #;Supplier;Manufacturer;EAN13;UPC;Ecotax;Width;Height;Depth;Weight;Quantity;Minimal quantity;Visibility;Additional shipping cost;Unity;Unit price;Short description;Description;Tags (x,y,z...);Meta title;Meta keywords;Meta description;URL rewritten;Text when in stock;Text when backorder allowed;Available for order (0 = No, 1 = Yes);Product available date;Product creation date;Show price (0 = No, 1 = Yes);Image URLs (x,y,z...);Delete existing images (0 = No, 1 = Yes);Feature(Name:Value:Position);Available online only (0 = No, 1 = Yes);Condition;Customizable (0 = No, 1 = Yes);Uploadable files (0 = No, 1 = Yes);Text fields (0 = No, 1 = Yes);Out of stock;ID / Name of shop;Advanced stock management;Depends On Stock;Warehouse
|
||||
1;1;iPod Nano;iPods;100;1;80;1;;5.5;2013-06-01;2018-12-31;RP-demo_1;RF-demo_1;Applestore;Apple;1234567890123;;1;0.6;0.2;0.4;0.068357;160;1;;;;;<p>New design.</p>;<p>New design.</p>;apple, ipod, nano;Meta title-Nano;Meta keywords-Nano;Meta description-Nano;iPod-Nano;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-01;1;http://localhost/prestashop/img/p/1/5/15.jpg;0;;0;new;0;0;0;0;0;0;0;0
|
||||
2;1;iPod shuffle;iPods;60;1;40;1;;;2013-06-01;2018-12-31;RP-demo_2;RF-demo_2;Applestore;Apple;1234567890123;;1;0.1;0.1;0.1;0.027563;120;1;both;;;;<p>New design.</p>;<p>New design.</p>;ipod, shuffle;Meta title-Shuffle;Meta keywords-Shuffle;Meta description-Shuffle;iPod-shuffle;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-02;1;http://localhost/prestashop/img/p/2/3/23.jpg;0;;0;new;0;0;0;0;0;0;0;0
|
||||
3;1;MacBook Air;Laptops;1500;1;1000;1;100;;2013-06-01;2018-12-31;RP-demo_3;RF-demo_3;Applestore;Apple;1234567890123;;2;1.31;0.3;1;2.976846;400;1;catalog;;;;<p>New design.</p>;<p>New design.</p>;MacBook, Air;Meta title-McBookAir;Meta keywords-McBookAir;Meta description-McBookAir;MacBook-Air;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-03;1;http://localhost/prestashop/img/p/1/1.jpg;1;;0;new;0;0;0;0;0;0;0;0
|
||||
4;1;MacBook;Laptops;1150;1;750;1;;;2013-06-01;2018-12-31;RP-demo_4;RF-demo_4;Applestore;Apple;1234567890123;;2;1.31;0.3;1;4.454244;75;1;search;;;;<p>New design.</p>;<p>New design.</p>;MacBook, Pro;Meta title-McBookPro;Meta keywords-McBookPro;Meta description-McBookPro;MacBook;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-04;1;http://localhost/prestashop/img/p/6/6.jpg;1;;0;new;0;0;0;0;0;0;0;0
|
||||
5;1;iPod touch;iPods;240;1;150;1;;;2013-06-01;2018-12-31;RP-demo_5;RF-demo_5;Applestore;Apple;1234567890123;;1;0.6;0.2;0.4;0.194046;120;1;none;;;;<p>New design.</p>;<p>New design.</p>;Ipod touch;Meta title-IpodTouch;Meta keywords-IpodTouch;Meta description-IpodTouch;iPod-touch;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-05;1;http://localhost/prestashop/img/p/7/7.jpg;0;;1;used;0;0;0;0;0;0;0;0
|
||||
6;1;Belkin Leather Folio for iPod nano - Black / Chocolate;Accessories;25;1;150;1;;;2013-06-01;2018-12-31;RP-demo_6;RF-demo_6;Nippon Electronic Import;Belkin;1234567890123;;0;0.6;0.2;0.4;0.038588;25;1;;20;;;<p>New design.</p>;<p>New design.</p>;Folio, leather;Meta title-BelkinLeatherFolio;Meta keywords-BelkinLeatherFolio;Meta description-BelkinLeatherFolio;Belkin-Leather-Folio-for-iPod-nano---Black-Chocolate;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-06;1;http://localhost/prestashop/img/p/1/3/13.jpg;0;;1;refurbished;0;0;0;0;0;0;0;0
|
||||
7;1;Shure SE210 Sound-Isolating Earphones for iPod and iPhone;Accessories;125;2;80;1;;;2013-06-01;2018-12-31;RP-demo_7;RF-demo_7;Shure Online Store;Shure;1234567890123;;0;0.1;0.1;0.1;0.040793;15;1;;;;;<p>New design.</p>;<p>New design.</p>;Headphones;Meta title-ShureEarphones;Meta keywords-ShureEarphones;Meta description-ShureEarphones;Shure-SE210-Sound-Isolating-Earphones-for-iPod-and-iPhone;In Stock;Current supply. Ordering availlable;1;2013-03-01;2013-01-07;1;http://localhost/prestashop/img/p/1/4/14.jpg;0;;1;new;0;0;0;0;0;0;0;0
|
||||
|
@@ -1,4 +0,0 @@
|
||||
Supplier ID;Active (0/1);Name *;Description;Short description;Meta title;Meta keywords;Meta description;Image URL
|
||||
1;1;Applestore;<p>The Apple Store is a chain of retail stores owned and operated by Apple Inc., dealing in computers and consumer electronics. The stores sell Macintosh personal computers, software, iPods, iPads, iPhones, third-party accessories, and other consumer electronics such as Apple TV. Some high profile stores feature a Theatre for presentations and workshops and a Studio for training with Apple products; all stores offer a Genius Bar for technical support and repairs, as well as free workshops available to the public. Under the leadership of Ron Johnson, the former Senior Vice President of Retail Operations, the Apple Stores have, according to an article in the New York Times, been responsible for "[turning] the boring computer sales floor into a sleek playroom filled with gadgets".</p>;Meta title-Applestore;Meta keywords-Applestore;Meta description-Applestore;http://localhost/prestashop/img/su/Pic-of-this-supplier.jpg
|
||||
2;1;Shure Online Store;<p><em>- No description -</em></p>;<p><em>- No description -</em></p>;Meta title-Shure Online Store;Meta keywords-Shure Online Store;Meta description-Shure Online Store;http://localhost/prestashop/img/su/Pic-of-this-supplier-2.jpg
|
||||
3;1;Nippon Electronic Import;<p><em>- No description -</em></p>;<p><em>- No description -</em></p>;Meta title-Nippon Electronic Import;Meta keywords-Nippon Electronic Import;Meta description-Nippon Electronic Import;http://localhost/prestashop/img/su/Pic-of-this-supplier-3.jpg
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 718.
|
@@ -1,21 +0,0 @@
|
||||
Supply Order Reference *;Product ID *;Product Attribute ID;Unit Price (tax excl.)*;Quantity Expected *;Discount Rate;Tax Rate
|
||||
Ref Apple 01;1;1;100;25;0;19,6
|
||||
Ref Apple 01;1;2;80;25;0;19,6
|
||||
Ref Apple 01;1;3;100;25;0;19,6
|
||||
Ref Apple 01;1;4;80;25;0;19,6
|
||||
Ref Apple 01;1;5;100;25;0;19,6
|
||||
Ref Apple 01;1;6;80;25;0;19,6
|
||||
Ref Apple 01;1;7;100;25;0;19,6
|
||||
Ref Apple 01;1;8;80;25;0;19,6
|
||||
Ref Apple 01;1;9;100;25;0;19,6
|
||||
Ref Apple 01;1;10;80;25;0;19,6
|
||||
Ref Apple 01;1;11;100;25;0;19,6
|
||||
Ref Apple 01;1;12;80;25;0;19,6
|
||||
Ref Apple 01;1;13;100;25;0;19,6
|
||||
Ref Apple 01;1;14;80;25;0;19,6
|
||||
Ref Apple 01;1;15;100;25;0;19,6
|
||||
Ref Apple 01;1;16;80;25;0;19,6
|
||||
Ref Apple 01;2;17;40;25;0;19,6
|
||||
Ref Apple 01;2;18;40;25;0;19,6
|
||||
Ref Apple 01;2;19;40;25;0;19,6
|
||||
Ref Apple 01;2;20;40;25;0;19,6
|
||||
|
@@ -1,5 +0,0 @@
|
||||
Supply Order ID;Supplier ID *;Lang ID;Warehouse ID *;Currency ID *;Supply Order Reference *;Delivery Date (Y-M-D)*;Discount Rate;Template
|
||||
1;1;1;1;1;Ref Apple 01;2013-11-01;;
|
||||
2;3;1;1;1;Nippon Electronic Import;2013-11-01;;
|
||||
3;2;1;1;1;Shure Online Store;2013-11-01;;
|
||||
4;1;1;2;2;Ref Apple 02;2013-11-01;;
|
||||
|
@@ -1,35 +1,32 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* This source file is subject to the Academic Free License (AFL 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:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* https://opensource.org/licenses/afl-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 license@prestashop.com so we can send you a copy immediately.
|
||||
* 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 PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* 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 PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -1,35 +1,32 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* 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:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* 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 license@prestashop.com so we can send you a copy immediately.
|
||||
* 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 PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* 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 PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -1,79 +0,0 @@
|
||||
2007-2017 PrestaShop
|
||||
|
||||
NOTICE OF LICENSE
|
||||
|
||||
This source file is subject to the Open Software License (OSL 3.0)
|
||||
that is bundled with this package in the file LICENSE.txt.
|
||||
It is also available through the world-wide-web at this URL:
|
||||
http://opensource.org/licenses/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 license@prestashop.com so we can send you a copy immediately.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
versions in the future. If you wish to customize PrestaShop for your
|
||||
needs please refer to http://www.prestashop.com for more information.
|
||||
|
||||
@author PrestaShop SA <contact@prestashop.com>
|
||||
@copyright 2007-2017 PrestaShop SA
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
VORBEREITUNG
|
||||
===========
|
||||
|
||||
Zur Installation von PrestaShop benötigen Sie einen Remote-Web-Server oder
|
||||
Ihren Computer (MAMP) mit Zugriff auf eine Datenbank wie MySQL.
|
||||
Sie benötigen Zugriff auf phpMyAdmin, um eine Datenbank zu erstellen und die
|
||||
Informationen in der Datenbank im Installer anzuzeigen.
|
||||
|
||||
Wenn Sie keinen Hosting-Provider haben und Ihren Shop selbst nicht erstellen
|
||||
können, bieten wir einen schlüsselfertigen Shop, mit dem Sie Ihren eigenen
|
||||
Online-Shop in weniger als 10 Minuten ohne jegliche technische Kenntnisse
|
||||
erstellen können.
|
||||
Besuchen Sie:
|
||||
http://www.prestabox.com/
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
Gehen Sie einfach zu Ihrem PrestaShop Web-Verzeichnis und verwenden Sie den
|
||||
Installer :-)
|
||||
|
||||
Falls ein PHP-Fehler auftritt, haben Sie vielleicht kein PHP5 oder müssen es
|
||||
auf Ihrem Web-Host aktivieren.
|
||||
Die Vorinstallationseinstellungen (PHP 5, htaccess) für bestimmte
|
||||
Hosting-Dienste (1&1, Free, Lycos, OVH, Infomaniak, Amen, GoDaddy, etc.)
|
||||
finden Sie in unserem Forum.
|
||||
|
||||
Spezifische englische Webhosting-Einstellungen:
|
||||
http://www.prestashop.com/forums/viewthread/2946/installation_configuration___upgrade/preinstallation_settings_php_5_htaccess_for_certain_hosting_servi
|
||||
ces
|
||||
|
||||
Wenn Sie keine Lösung zum Starten des Installers finden, posten Sie bitte
|
||||
Ihr Problem in unserem Forum:
|
||||
http://www.prestashop.com/forums/viewforum/7/installation_configuration___upgrade
|
||||
|
||||
Es gibt immer Lösungen für Ihre Fragen ;-)
|
||||
|
||||
DOKUMENTATION
|
||||
=============
|
||||
|
||||
Für zusätzliche Benutzerhinweise (how-to), lesen Sie bitte unser Wiki:
|
||||
http://doc.prestashop.com
|
||||
|
||||
FOREN
|
||||
======
|
||||
|
||||
Sie können außerdem mit der PrestaShop Community in unseren Foren
|
||||
diskutieren, Hilfe finden und eigene Beiträge liefern unter:
|
||||
http://www.prestashop.com/forums/
|
||||
|
||||
Danke für Ihren Download und die Nutzung der PrestaShop E-Commerce-Open-Source-Lösung!
|
||||
|
||||
==========================
|
||||
= The PrestaTeam' =
|
||||
= www.PrestaShop.com =
|
||||
==========================
|
||||
@@ -1,61 +0,0 @@
|
||||
2007-2017 PrestaShop
|
||||
|
||||
NOTICE OF LICENSE
|
||||
|
||||
This source file is subject to the Open Software License (OSL 3.0)
|
||||
that is bundled with this package in the file LICENSE.txt.
|
||||
It is also available through the world-wide-web at this URL:
|
||||
http://opensource.org/licenses/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 license@prestashop.com so we can send you a copy immediately.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
versions in the future. If you wish to customize PrestaShop for your
|
||||
needs please refer to http://www.prestashop.com for more information.
|
||||
|
||||
@author PrestaShop SA <contact@prestashop.com>
|
||||
@copyright 2007-2017 PrestaShop SA
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
PREPARATION
|
||||
===========
|
||||
|
||||
To install PrestaShop, you need a remote web server or on your computer (MAMP), with access to a database like MySQL.
|
||||
You'll need access to phpMyAdmin to create a database and to indicate the information in the database in the installer.
|
||||
|
||||
If you do not host and unable to create your store, we offer a turnkey store, which lets you create your online store in less than 10 minutes without any technical knowledge.
|
||||
We invite you to visit: http://www.prestabox.com/
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
Simply go to your PrestaShop web directory and use installer :-)
|
||||
|
||||
If you have any PHP error, perhaps you don't have PHP5 or you need to activate it on your web host.
|
||||
Please go to our forum to find pre-installation settings (PHP 5, htaccess) for certain hosting services (1&1, Free, Lycos, OVH, Infomaniak, Amen, GoDaddy, etc).
|
||||
|
||||
English webhost specifics settings:
|
||||
http://www.prestashop.com/forums/topic/2946-pre-installation-settings-php-5-htaccess-for-certain-hosting-services/
|
||||
|
||||
If you don't find any solution to launch installer, please post on our forum:
|
||||
http://www.prestashop.com/forums/forum/7-installing-prestashop/
|
||||
|
||||
There are always solutions for your issues ;-)
|
||||
|
||||
DOCUMENTATION
|
||||
=============
|
||||
|
||||
For any extra documentation (how-to), please read our Online documentation:
|
||||
http://doc.prestashop.com/dashboard.action
|
||||
|
||||
FORUMS
|
||||
======
|
||||
|
||||
You can also discuss, help and contribute with PrestaShop community on our forums:
|
||||
http://www.prestashop.com/forums/
|
||||
|
||||
Thanks for downloading and using PrestaShop e-commerce Open-source solution!
|
||||
@@ -1,67 +0,0 @@
|
||||
2007-2017 PrestaShop
|
||||
|
||||
NOTICE OF LICENSE
|
||||
|
||||
This source file is subject to the Open Software License (OSL 3.0)
|
||||
that is bundled with this package in the file LICENSE.txt.
|
||||
It is also available through the world-wide-web at this URL:
|
||||
http://opensource.org/licenses/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 license@prestashop.com so we can send you a copy immediately.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
versions in the future. If you wish to customize PrestaShop for your
|
||||
needs please refer to http://www.prestashop.com for more information.
|
||||
|
||||
@author PrestaShop SA <contact@prestashop.com>
|
||||
@copyright 2007-2017 PrestaShop SA
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
PREPARACIÓN
|
||||
===========
|
||||
|
||||
Para instalar PrestaShop, necesita un servidor web remoto o en su ordenador (MAMP), con acceso a una base de datos como MySQL.
|
||||
Tendrá acceso a phpMyAdmin para crear una base de datos y para indicar la información en la base de datos en el instalador.
|
||||
|
||||
Si no de acogida y no puede crear su tienda, le ofrecemos una tienda "llave en mano, que le permite crear su tienda en línea en menos de 10 minutos sin ningún conocimiento técnico.
|
||||
Le invitamos a visitar:
|
||||
http://www.prestabox.com/
|
||||
|
||||
INSTALACIÓN
|
||||
============
|
||||
|
||||
Simplemente vaya a su directorio web y el uso PrestaShop instalador :-)
|
||||
|
||||
Si usted tiene cualquier error de PHP, tal vez usted no tiene PHP5 o necesitas activarlo en su web host.
|
||||
Por favor, vaya a nuestro foro para encontrar la configuración de la instalación pre-(PHP 5, htaccess) para determinados servicios de hospedaje (1 & 1, gratis, Lycos, OVH, Infomaniak, Amén, GoDaddy, etc.)
|
||||
|
||||
Inglés webhost ajustes específicos:
|
||||
http://www.prestashop.com/forums/viewthread/2946/installation_configuration___upgrade/preinstallation_settings_php_5_htaccess_for_certain_hosting_services
|
||||
|
||||
Si usted no encuentra ninguna solución para lanzar el instalador, por favor enviar en nuestro foro:
|
||||
http://www.prestashop.com/forums/viewforum/7/installation_configuration___upgrade
|
||||
|
||||
Siempre hay soluciones para sus problemas ;-)
|
||||
|
||||
DOCUMENTACIÓN
|
||||
=============
|
||||
|
||||
Para cualquier documentación adicional (procedimientos), por favor lea nuestra wiki:
|
||||
http://doc.prestashop.com
|
||||
|
||||
FOROS
|
||||
======
|
||||
|
||||
Usted puede también discute, ayudar y contribuir con la comunidad PrestaShop en nuestros foros:
|
||||
http://www.prestashop.com/forums/
|
||||
|
||||
Gracias por descargar y utilizar el comercio electrónico PrestaShop solución de código abierto!
|
||||
|
||||
==========================
|
||||
= The PrestaTeam' =
|
||||
= www.PrestaShop.com =
|
||||
==========================
|
||||
@@ -1,67 +0,0 @@
|
||||
2007-2017 PrestaShop
|
||||
|
||||
NOTICE OF LICENSE
|
||||
|
||||
This source file is subject to the Open Software License (OSL 3.0)
|
||||
that is bundled with this package in the file LICENSE.txt.
|
||||
It is also available through the world-wide-web at this URL :
|
||||
http://opensource.org/licenses/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 license@prestashop.com so we can send you a copy immediately.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
versions in the future. If you wish to customize PrestaShop for your
|
||||
needs please refer to http://www.prestashop.com for more information.
|
||||
|
||||
@author PrestaShop SA <contact@prestashop.com>
|
||||
@copyright 2007-2017 PrestaShop SA
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
PREPARATION
|
||||
===========
|
||||
|
||||
Pour installer PrestaShop, vous avez besoin d'un serveur web distant ou sur votre ordinateur (MAMP), avec un accès à une base de données de type MySQL.
|
||||
Vous aurez besoin d'un accès à PhpMyAdmin afin de créer un base de données, et d'indiquer les informations de la base de données dans l'installeur.
|
||||
|
||||
Si vous n'avez pas d'hébergeur et pas la possibilité de créer votre boutique, nous vous proposons un service de boutique clé en main, qui vous permet de créer votre boutique en ligne en moins de 10 minutes sans aucunes notions techniques.
|
||||
Nous vous invitons à vous rendre sur :
|
||||
http://www.prestabox.com/
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
Il suffit d'aller dans votre répertoire web PrestaShop et de lancer l'installateur (dans /install) :-)
|
||||
|
||||
Si vous avez des erreurs de PHP, peut-être que vous n'avez pas PHP5 ou peut être devez vous l'activer via votre hébergeur.
|
||||
Merci de vous rendre sur notre forum pour trouver les paramètres de pré-installation (PHP 5, htaccess) pour certains services d'hébergement (1 & 1, Free, Lycos, OVH, Infomaniak, Amen, GoDaddy, etc.)
|
||||
|
||||
Topic français sur notre forum officiel :
|
||||
http://www.prestashop.com/forums/viewthread/446/installation_configuration_et_mise_a_jour/preinstallation_settings_php_5_htaccess_for_certain_hosting_services
|
||||
|
||||
Si vous ne trouvez pas de solution pour lancer l'installateur, merci de vous rendre à cette adresse:
|
||||
http://www.prestashop.com/forums/viewforum/7/installation_configuration___upgrade
|
||||
|
||||
Il ya toujours des solutions pour vos questions ;-)
|
||||
|
||||
DOCUMENTATION
|
||||
=============
|
||||
|
||||
Pour toute documentation supplémentaire (how-to), vous trouverez notre wiki à cette adresse :
|
||||
http://doc.prestashop.com
|
||||
|
||||
FORUMS
|
||||
======
|
||||
|
||||
Vous pouvez également discuter, aider et contribuer avec la communauté PrestaShop sur nos forums :
|
||||
http://www.prestashop.com/forums/
|
||||
|
||||
Merci d'avoir télécharger et d'utiliser PrestaShop, solution e-commerce open-source !
|
||||
|
||||
==========================
|
||||
= The PrestaTeam' =
|
||||
= www.PrestaShop.com =
|
||||
==========================
|
||||
@@ -1,67 +0,0 @@
|
||||
2007-2017 PrestaShop
|
||||
|
||||
NOTICE OF LICENSE
|
||||
|
||||
This source file is subject to the Open Software License (OSL 3.0)
|
||||
that is bundled with this package in the file LICENSE.txt.
|
||||
It is also available through the world-wide-web at this URL:
|
||||
http://opensource.org/licenses/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 license@prestashop.com so we can send you a copy immediately.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
versions in the future. If you wish to customize PrestaShop for your
|
||||
needs please refer to http://www.prestashop.com for more information.
|
||||
|
||||
@author PrestaShop SA <contact@prestashop.com>
|
||||
@copyright 2007-2017 PrestaShop SA
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
PREPARAZIONE
|
||||
===========
|
||||
|
||||
Per installare PrestaShop, hai bisogno di un server remoto o nel tuo computer (MAMP), con accesso ad un database come MySQL.
|
||||
Dovrai accedere a phpMyAdmin per creare un database e per indicare le informazioni nel database all'installatore.
|
||||
|
||||
Sei non hai un host e non sai come creare il tuo negozio, ti offriamo un negozio già pronto che ti farà realizzare il tuo negozio online in meno di 10 minuti senza nessun bisogno di competenze tecniche.
|
||||
Ti invitiamo a visitare:
|
||||
http://www.prestabox.com/
|
||||
|
||||
INSTALLAZIONE
|
||||
============
|
||||
|
||||
Devi solo andare nella tua directory PrestaShop e usare l'installatore :-)
|
||||
|
||||
Se si verifica un qualsiasi errore PHP, forse non hai PHP5 oppure devi attivarlo nel tuo web host.
|
||||
Vai nel nostro forum e cerca le impostazioni di pre-installazione (PHP 5, htaccess) per alcuni hosting services (1&1, Free, Lycos, OVH, Infomaniak, Amen, GoDaddy, etc).
|
||||
|
||||
Impostazioni specifiche per web host in inglese:
|
||||
http://www.prestashop.com/forums/viewthread/2946/installation_configuration___upgrade/preinstallation_settings_php_5_htaccess_for_certain_hosting_services
|
||||
|
||||
Se non trovi nessuna soluzione per lanciare l'installatore, scrivi un post sul nostro forum:
|
||||
http://www.prestashop.com/forums/viewforum/7/installation_configuration___upgrade
|
||||
|
||||
Troverai sempre una soluzione ai tuoi problemi :-)
|
||||
|
||||
INFORMAZIONI
|
||||
=============
|
||||
|
||||
Per qualsiasi informazione ulteriore (come fare per?), leggi il nostro wiki:
|
||||
http://doc.prestashop.com
|
||||
|
||||
FORUM
|
||||
======
|
||||
|
||||
Puoi anche inserirti, chattare, e contribuire alla community PrestaShop nei nostri forum:
|
||||
http://www.prestashop.com/forums/
|
||||
|
||||
Ti ringraziamo per l'uso della soluzione open-source PrestaShop per il commercio online!
|
||||
|
||||
==========================
|
||||
= The PrestaTeam' =
|
||||
= www.PrestaShop.com =
|
||||
==========================
|
||||
BIN
img/rf/1.jpg
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/10.jpg
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
img/rf/11.jpg
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
img/rf/12.jpg
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/13.jpg
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
img/rf/2.jpg
|
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 1.2 KiB |
BIN
img/rf/3.jpg
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 1.2 KiB |
BIN
img/rf/4.jpg
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 1.1 KiB |
BIN
img/rf/5.jpg
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/6.jpg
|
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/7.jpg
|
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 1.1 KiB |
BIN
img/rf/8.jpg
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/9.jpg
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
@@ -831,7 +831,7 @@ CREATE TABLE `PREFIX_feature_product` (
|
||||
`id_feature` int(10) unsigned NOT NULL,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_feature_value` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_feature`,`id_product`),
|
||||
PRIMARY KEY (`id_feature`,`id_product`,`id_feature_value`),
|
||||
KEY `id_feature_value` (`id_feature_value`),
|
||||
KEY `id_product` (`id_product`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
@@ -347,7 +347,10 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
if (InstallSession::getInstance()->safe_mode) {
|
||||
Language::checkAndAddLanguage($iso, false, true, $params_lang);
|
||||
} else {
|
||||
Language::downloadAndInstallLanguagePack($iso, _QLO_INSTALL_VERSION_, $params_lang);
|
||||
$lang_pack_response = Language::downloadAndInstallLanguagePack($iso, _QLO_INSTALL_VERSION_, $params_lang);
|
||||
if ($lang_pack_response !== true) {
|
||||
Language::checkAndAddLanguage($iso, false, true, $params_lang);
|
||||
}
|
||||
}
|
||||
|
||||
Language::loadLanguages();
|
||||
|
||||
291
modules/hotelreservationsystem/classes/HotelAmenities.php
Normal file
@@ -0,0 +1,291 @@
|
||||
<?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 HotelAmenities extends ObjectModel
|
||||
{
|
||||
public $name;
|
||||
public $id_parent;
|
||||
public $position;
|
||||
public $active;
|
||||
public $logo_type;
|
||||
public $logo;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_amenity',
|
||||
'primary' => 'id_amenity',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'id_parent' => array('type' => self::TYPE_INT, 'required' => true),
|
||||
'position' => array('type' => self::TYPE_INT),
|
||||
'active' => array('type' => self::TYPE_INT, 'required' => true),
|
||||
'logo_type' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
|
||||
'logo' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
// lang fields
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'required' => true),
|
||||
),
|
||||
);
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'hotel_amenities',
|
||||
'objectNodeName' => 'hotel_amenity',
|
||||
'fields' => array(),
|
||||
);
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if ($id = $this->id) {
|
||||
$imgFile = dirname(__FILE__).'/../views/img/hotel_amenities/'.(int)$id.'.jpg';
|
||||
if (file_exists($imgFile)) {
|
||||
unlink($imgFile);
|
||||
}
|
||||
return parent::delete();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all categories (id_parent = 0) with their child amenities.
|
||||
*
|
||||
* @param int $idLang
|
||||
* @return array|false
|
||||
*/
|
||||
public function getAmenitiesTree($idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$rows = Db::getInstance()->executeS(
|
||||
'SELECT ha.`id_amenity`, ha.`id_parent`, ha.`position`, ha.`active`, ha.`logo_type`, ha.`logo`, hal.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_amenity` ha
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = ha.`id_amenity` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
ORDER BY ha.`id_parent` ASC, ha.`position` ASC'
|
||||
);
|
||||
|
||||
if (!$rows) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$amenitiesByCategory = array();
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if ($row['id_parent'] == 0) {
|
||||
$result[$row['id_amenity']] = array(
|
||||
'id' => $row['id_amenity'],
|
||||
'name' => $row['name'],
|
||||
'position' => $row['position'],
|
||||
'children' => array(),
|
||||
);
|
||||
} else {
|
||||
$row['id'] = $row['id_amenity'];
|
||||
$amenitiesByCategory[$row['id_parent']][] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($amenitiesByCategory as $categoryId => $amenities) {
|
||||
if (isset($result[$categoryId])) {
|
||||
$result[$categoryId]['children'] = $amenities;
|
||||
}
|
||||
}
|
||||
|
||||
return $result ?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all amenity categories with children, marking which are selected for a hotel/room type.
|
||||
*
|
||||
* @param array $selectedIds flat array of selected amenity IDs
|
||||
* @param int $idLang
|
||||
* @return array|false
|
||||
*/
|
||||
public function hotelBranchSelectedAmenities($selectedIds, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$rows = Db::getInstance()->executeS(
|
||||
'SELECT ha.`id_amenity`, ha.`id_parent`, hal.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_amenity` ha
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = ha.`id_amenity` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
ORDER BY ha.`id_parent` ASC'
|
||||
);
|
||||
|
||||
if (!$rows) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if ($row['id_parent'] == 0) {
|
||||
$result[$row['id_amenity']]['name'] = $row['name'];
|
||||
} else {
|
||||
$result[$row['id_parent']]['children'][] = array(
|
||||
'id_amenity' => $row['id_amenity'],
|
||||
'id' => $row['id_amenity'],
|
||||
'name' => $row['name'],
|
||||
'selected' => in_array($row['id_amenity'], $selectedIds) ? 1 : 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $result ?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $idLang
|
||||
* @return array|false
|
||||
*/
|
||||
public function getAmenityInfoById($id, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
return Db::getInstance()->getRow(
|
||||
'SELECT ha.`id_amenity`, hal.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_amenity` ha
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = ha.`id_amenity` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
WHERE ha.`id_amenity` = '.(int)$id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $parentId
|
||||
* @return array|false
|
||||
*/
|
||||
public function getChildAmenitiesByParentAmenityId($parentId)
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `id_amenity` FROM `'._DB_PREFIX_.'htl_amenity` WHERE `id_parent` = '.(int)$parentId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a category and all its child amenities.
|
||||
*
|
||||
* @param int $deleteId
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteCategory($idCategory)
|
||||
{
|
||||
$rows = Db::getInstance()->executeS(
|
||||
'SELECT `id_amenity` FROM `'._DB_PREFIX_.'htl_amenity`
|
||||
WHERE `id_parent` = '.(int)$idCategory.' OR `id_amenity` = '.(int)$idCategory
|
||||
);
|
||||
|
||||
if ($rows) {
|
||||
foreach ($rows as $row) {
|
||||
$objHotelAmenities = new HotelAmenities((int)$row['id_amenity']);
|
||||
$objHotelAmenities->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param int $idLang
|
||||
* @return array|false
|
||||
*/
|
||||
public function searchByName($query, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT ha.*, hal.* FROM `'._DB_PREFIX_.'htl_amenity` ha
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal ON hal.`id_amenity` = ha.`id_amenity`
|
||||
WHERE hal.`name` LIKE \'%'.pSQL($query).'%\'
|
||||
AND hal.`id_lang` = '.(int)$idLang
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all amenity categories (id_parent = 0), ordered by position.
|
||||
*
|
||||
* @param int $idLang
|
||||
* @return array
|
||||
*/
|
||||
public static function getCategories($idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT ha.`id_amenity`, hal.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_amenity` ha
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = ha.`id_amenity` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
WHERE ha.`id_parent` = 0
|
||||
ORDER BY ha.`position` ASC'
|
||||
) ?: array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all active child amenities (id_parent > 0).
|
||||
*
|
||||
* @param int $idLang
|
||||
* @return array
|
||||
*/
|
||||
public static function getAmenities($idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT ha.`id_amenity`, hal.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_amenity` ha
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = ha.`id_amenity` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
WHERE ha.`id_parent` > 0
|
||||
AND ha.`active` = 1
|
||||
ORDER BY hal.`name` ASC'
|
||||
) ?: array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return image path for amenity logo stored in views/img/hotel_amenities/.
|
||||
*
|
||||
* @param int $id
|
||||
* @return string
|
||||
*/
|
||||
public static function getAmenityImagePath($id)
|
||||
{
|
||||
return _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/'.(int)$id.'.jpg';
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?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 HotelBedType extends ObjectModel
|
||||
{
|
||||
public $length;
|
||||
public $width;
|
||||
public $name;
|
||||
|
||||
public static $definition =array(
|
||||
'table' => 'htl_bed_type',
|
||||
'primary' => 'id_bed_type',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'length' => array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat'),
|
||||
'width' => array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat'),
|
||||
// lang fields
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 128),
|
||||
),
|
||||
);
|
||||
|
||||
public function getAllBedTypes($idLang)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$sql = 'SELECT hbt.*, hbtl.`name` FROM `'._DB_PREFIX_.$this->table.'` hbt
|
||||
LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` hbtl ON hbt.`id_bed_type` = hbtl.`id_bed_type`
|
||||
WHERE 1 AND hbtl.`id_lang` ='.(int) $idLang;
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
$objHotelRoomTypeBedType->deleteRoomTypeBedTypes($this->id);
|
||||
|
||||
return parent::delete();
|
||||
}
|
||||
}
|
||||
@@ -1779,19 +1779,15 @@ class HotelBookingDetail extends ObjectModel
|
||||
if (!$only_search_data) {
|
||||
if (!empty($bookingData)) {
|
||||
foreach ($bookingData['rm_data'] as $key => $value) {
|
||||
$product_feature = Product::getFrontFeaturesStatic($context->language->id, $value['id_product']);
|
||||
$prod_amen = array();
|
||||
// featured amenities for display in room type list
|
||||
$product_feature = HotelRoomTypeAmenities::getAmenities(
|
||||
$value['id_product'],
|
||||
$context->language->id,
|
||||
true
|
||||
);
|
||||
if (!empty($amenities) && $amenities) {
|
||||
$prod_amen = $amenities;
|
||||
foreach ($product_feature as $a_key => $a_val) {
|
||||
if (($pa_key = array_search($a_val['id_feature'], $prod_amen)) !== false) {
|
||||
unset($prod_amen[$pa_key]);
|
||||
if (empty($prod_amen)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($prod_amen)) {
|
||||
$roomAmenityIds = array_column(HotelRoomTypeAmenities::getAmenities($value['id_product']), 'id');
|
||||
if (array_diff($amenities, $roomAmenityIds)) {
|
||||
unset($bookingData['rm_data'][$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -133,16 +133,19 @@ class HotelBookingDocument extends ObjectModel
|
||||
|
||||
public function getDestinationFilePath()
|
||||
{
|
||||
$fileExtension = pathinfo($this->fileInfo['rename'], PATHINFO_EXTENSION);
|
||||
|
||||
return $this->documentFolder.$this->id.'.'.$fileExtension;
|
||||
return $this->documentFolder.$this->id.'.'.$this->getFileExtension();
|
||||
}
|
||||
|
||||
public function setFileType()
|
||||
{
|
||||
if (ImageManager::isRealImage($this->fileInfo['tmp_name'])) {
|
||||
$content = @file_get_contents($this->fileInfo['tmp_name']);
|
||||
$activeContentPattern = '/\/(JavaScript|JS|OpenAction|AA|Launch|SubmitForm|ImportData)\b/i';
|
||||
|
||||
$this->imageInfo = @getimagesize($this->fileInfo['tmp_name']);
|
||||
|
||||
if ($this->imageInfo && ImageManager::isRealImage($this->fileInfo['tmp_name'])) {
|
||||
$this->file_type = self::FILE_TYPE_IMAGE;
|
||||
} elseif ($this->fileInfo['mime'] == 'application/pdf') {
|
||||
} elseif ($content !== false && substr($content, 0, 5) === '%PDF-' && !preg_match($activeContentPattern, $content)) {
|
||||
$this->file_type = self::FILE_TYPE_PDF;
|
||||
} else {
|
||||
$this->file_type = 0;
|
||||
@@ -151,8 +154,22 @@ class HotelBookingDocument extends ObjectModel
|
||||
|
||||
public function setFileName()
|
||||
{
|
||||
$fileExtension = pathinfo($this->fileInfo['rename'], PATHINFO_EXTENSION);
|
||||
$this->file_name = $this->id.'.'.$fileExtension;
|
||||
$this->file_name = $this->id.'.'.$this->getFileExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extension is derived from the file's real, validated content
|
||||
* (getimagesize()/PDF signature), captured once in setFileType(),
|
||||
* never from the uploaded filename or mime header (both are
|
||||
* attacker-controlled).
|
||||
*/
|
||||
public function getFileExtension()
|
||||
{
|
||||
if ($this->file_type == self::FILE_TYPE_PDF) {
|
||||
return 'pdf';
|
||||
}
|
||||
|
||||
return image_type_to_extension($this->imageInfo[2], false);
|
||||
}
|
||||
|
||||
public function getContentType()
|
||||
|
||||
146
modules/hotelreservationsystem/classes/HotelBranchAmenities.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?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 HotelBranchAmenities extends ObjectModel
|
||||
{
|
||||
public $id_hotel;
|
||||
public $amenity_id;
|
||||
public $is_featured;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_branch_amenity',
|
||||
'primary' => 'id_branch_amenity',
|
||||
'fields' => array(
|
||||
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'amenity_id' => array('type' => self::TYPE_INT),
|
||||
'is_featured' => array('type' => self::TYPE_INT),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* @param int $idHotel
|
||||
* @param int $idLang defaults to current context language
|
||||
* @param bool $featuredOnly true = is_featured=1 only; false = all active child amenities
|
||||
* @return array
|
||||
*/
|
||||
public static function getAmenities($idHotel, $idLang = 0, $featuredOnly = false)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$filter = $featuredOnly ? 'AND hba.`is_featured` = 1' : '';
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
|
||||
'SELECT ha.`id_amenity` AS `id`, ha.`logo_type`, ha.`logo`, hal.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_branch_amenity` hba
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_amenity` ha
|
||||
ON (ha.`id_amenity` = hba.`amenity_id`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = hba.`amenity_id` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hba.`id_hotel` = '.(int)$idHotel.'
|
||||
AND ha.`active` = 1
|
||||
AND ha.`id_parent` > 0
|
||||
'.$filter.'
|
||||
ORDER BY ha.`position` ASC, hal.`name` ASC'
|
||||
) ?: array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare amenities tree data for a hotel form, with selection state.
|
||||
*
|
||||
* @param int $idHotel
|
||||
* @param int $idLang defaults to current context language
|
||||
* @return array
|
||||
*/
|
||||
public static function getBranchAmenitiesTreeData($idHotel, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$objHotelAmenities = new HotelAmenities();
|
||||
$amenities = $objHotelAmenities->hotelBranchSelectedAmenities(
|
||||
array_column(self::getAmenities($idHotel), 'id'),
|
||||
$idLang
|
||||
);
|
||||
|
||||
if (!$amenities) {
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach ($amenities as $idAmenity => &$amenity) {
|
||||
$amenity['value'] = $idAmenity;
|
||||
$amenity['input_name'] = 'id_amenity_parents';
|
||||
|
||||
$selectedChildAmenities = 0;
|
||||
if (!empty($amenity['children'])) {
|
||||
foreach ($amenity['children'] as &$childAmenity) {
|
||||
$childAmenity['value'] = $childAmenity['id'];
|
||||
$childAmenity['input_name'] = 'id_amenities';
|
||||
if (!empty($childAmenity['selected'])) {
|
||||
$selectedChildAmenities++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($selectedChildAmenities === count($amenity['children'])) {
|
||||
$amenity['selected'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $amenities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete existing assignments then save new ones for a hotel.
|
||||
*
|
||||
* @param int $idHotel
|
||||
* @param array $amenityIds
|
||||
* @param array $featuredIds amenity IDs that should be marked is_featured=1
|
||||
* @return bool
|
||||
*/
|
||||
public function saveBranchAmenities($idHotel, array $amenityIds, array $featuredIds = array())
|
||||
{
|
||||
Db::getInstance()->delete('htl_branch_amenity', '`id_hotel` = '.(int)$idHotel);
|
||||
|
||||
$featuredSet = array_flip(array_map('intval', $featuredIds));
|
||||
|
||||
foreach ($amenityIds as $amenityId) {
|
||||
$objHotelBranchAmenities = new self();
|
||||
$objHotelBranchAmenities->id_hotel = (int)$idHotel;
|
||||
$objHotelBranchAmenities->amenity_id = (int)$amenityId;
|
||||
$objHotelBranchAmenities->is_featured = isset($featuredSet[$amenityId]) ? 1 : 0;
|
||||
if (!$objHotelBranchAmenities->save()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<?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 HotelBranchFeatures extends ObjectModel
|
||||
{
|
||||
public $id;
|
||||
public $id_hotel;
|
||||
public $feature_id;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
public static $definition = array(
|
||||
'table' => 'htl_branch_features',
|
||||
'primary' => 'id',
|
||||
'fields' => array(
|
||||
'id_hotel' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'feature_id' => array('type' => self::TYPE_STRING),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
));
|
||||
|
||||
/**
|
||||
* [deleteBranchFeaturesByHotelId : For deleting features of a hotel by hotel id]
|
||||
* @param [int] $idHotel [Hotel's id , which hotel's features to be deleted]
|
||||
* @return [Boolean] [true if deleted or false if no deleted]
|
||||
*/
|
||||
public function deleteBranchFeaturesByHotelId($idHotel)
|
||||
{
|
||||
return Db::getInstance()->delete('htl_branch_features', '`id_hotel` = '.(int) $idHotel);
|
||||
}
|
||||
|
||||
/**
|
||||
* [assignFeaturesToHotel : For assigning Hotel features to a hotel]
|
||||
* @param [int] $idHotel [Hotel's id , To which features to be assigned]
|
||||
* @param [Array] $features [array of features to be assigned to the hotel]
|
||||
* @return [Boolean] [true]
|
||||
*/
|
||||
public function assignFeaturesToHotel($idHotel, $features)
|
||||
{
|
||||
if ($features) {
|
||||
foreach ($features as $feature) {
|
||||
$obj_htl_features = new HotelBranchFeatures();
|
||||
$obj_htl_features->id_hotel = $idHotel;
|
||||
$obj_htl_features->feature_id = $feature;
|
||||
$obj_htl_features->save();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -55,8 +55,8 @@ class HotelBranchInformation extends ObjectModel
|
||||
'check_in' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
'check_out' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'latitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'longitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'latitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isCoordinate'),
|
||||
'longitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isCoordinate'),
|
||||
'map_formated_address' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'),
|
||||
'map_input_text' => array('type' => self::TYPE_STRING, 'validate' => 'isString'),
|
||||
'active_refund' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
@@ -128,8 +128,8 @@ class HotelBranchInformation extends ObjectModel
|
||||
'resource' => 'image',
|
||||
'fields' => array('id' => array())
|
||||
),
|
||||
'hotel_features' => array(
|
||||
'resource' => 'hotel_feature',
|
||||
'hotel_amenities' => array(
|
||||
'resource' => 'hotel_amenity',
|
||||
'fields' => array('id' => array('required' => true))
|
||||
),
|
||||
'hotel_refund_rules' => array(
|
||||
@@ -506,31 +506,25 @@ class HotelBranchInformation extends ObjectModel
|
||||
$sql = 'SELECT hbi.`id`, hbl.`hotel_name` FROM `'._DB_PREFIX_.'htl_branch_info` hbi
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbl
|
||||
ON (hbl.`id` = hbi.`id` AND hbl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hbi.`id` NOT IN (SELECT DISTINCT id_hotel FROM `'._DB_PREFIX_.'htl_branch_features`)';
|
||||
WHERE hbi.`id` NOT IN (SELECT DISTINCT id_hotel FROM `'._DB_PREFIX_.'htl_branch_amenity`)';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* [getFeaturesOfHotelByHotelId : To get assigned Features of a hotel by its id].
|
||||
*
|
||||
* @param [type] $id_hotel [id of the hotel]
|
||||
*
|
||||
* @return [array | false] [If no feature found then returns false otherwise returns array of all features assigned to the hotel]
|
||||
* @param int $id_hotel
|
||||
* @return array|false
|
||||
*/
|
||||
public function getFeaturesOfHotelByHotelId($id_hotel)
|
||||
public function getAmenitiesOfHotelByHotelId($id_hotel)
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT feature_id FROM `'._DB_PREFIX_.'htl_branch_features` WHERE id_hotel='.(int)$id_hotel
|
||||
'SELECT amenity_id FROM `'._DB_PREFIX_.'htl_branch_amenity` WHERE id_hotel='.(int)$id_hotel
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* [getFeaturesOfHotelByHotelId : To get Hotel's id by its category id].
|
||||
*
|
||||
* @param [int] $id_category [id_category of the hotel]
|
||||
*
|
||||
* @return [array | int] [If no hotel found then returns false otherwise returns id of the hotel]
|
||||
* @param int $id_category
|
||||
* @return int|false
|
||||
*/
|
||||
public static function getHotelIdByIdCategory($id_category)
|
||||
{
|
||||
@@ -548,11 +542,8 @@ class HotelBranchInformation extends ObjectModel
|
||||
}
|
||||
|
||||
/**
|
||||
* [getFeaturesOfHotelByHotelId : To get Category Information by its id_category].
|
||||
*
|
||||
* @param [int] $id_category [id of the category , Which innformation is wanted]
|
||||
*
|
||||
* @return [array | false] [If no Category found then returns false otherwise returns array of information of that category]
|
||||
* @param int $id_category
|
||||
* @return array|false
|
||||
*/
|
||||
public function getCategoryDataByIdCategory($id_category)
|
||||
{
|
||||
@@ -802,11 +793,11 @@ class HotelBranchInformation extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
$objHotelfeatures = new HotelBranchFeatures();
|
||||
$objHotelAmenities = new HotelBranchAmenities();
|
||||
$objHotelImage = new HotelImage();
|
||||
if (!$objHotelfeatures->deleteBranchFeaturesByHotelId($idHotel)) {
|
||||
if (!$objHotelAmenities->saveBranchAmenities($idHotel, array())) {
|
||||
$contextController->errors[] = $this->moduleInstance->l(
|
||||
'Some error has occurred while deleting hotel feature data.',
|
||||
'Some error has occurred while deleting hotel amenity data.',
|
||||
'HotelBranchInformation'
|
||||
);
|
||||
}
|
||||
@@ -1003,25 +994,25 @@ class HotelBranchInformation extends ObjectModel
|
||||
return $ids;
|
||||
}
|
||||
|
||||
// Webservice:: function to prepare id parameter for hotel features in a hotel api
|
||||
public function getWsHotelFeatures()
|
||||
// Webservice:: function to prepare id parameter for hotel amenities in a hotel api
|
||||
public function getWsHotelAmenities()
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `feature_id` as `id` FROM `'._DB_PREFIX_.'htl_branch_features` WHERE `id_hotel` = '.(int)$this->id.
|
||||
' ORDER BY `feature_id` ASC'
|
||||
'SELECT `amenity_id` as `id` FROM `'._DB_PREFIX_.'htl_branch_amenity` WHERE `id_hotel` = '.(int)$this->id.
|
||||
' ORDER BY `amenity_id` ASC'
|
||||
);
|
||||
}
|
||||
|
||||
// Webservice:: function to prepare id parameter for hotel features in a hotel api
|
||||
public function setWsHotelFeatures($branchFeatures)
|
||||
// Webservice:: function to set hotel amenities in a hotel api
|
||||
public function setWsHotelAmenities($branchAmenities)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_branch_features`
|
||||
DELETE FROM `'._DB_PREFIX_.'htl_branch_amenity`
|
||||
WHERE `id_hotel` = '.(int)$this->id
|
||||
);
|
||||
|
||||
foreach ($branchFeatures as $feature) {
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'htl_branch_features` (`id_hotel`, `feature_id`, `date_add`, `date_upd`) VALUES ('.(int)$this->id.', '.(int)$feature['id'].', NOW(), NOW())');
|
||||
foreach ($branchAmenities as $amenity) {
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'htl_branch_amenity` (`id_hotel`, `amenity_id`, `date_add`, `date_upd`) VALUES ('.(int)$this->id.', '.(int)$amenity['id'].', NOW(), NOW())');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1535,7 +1535,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
$objCartBooking = new self();
|
||||
$objRoomType = new HotelRoomType();
|
||||
$objHotelBranch = new HotelBranchInformation();
|
||||
$objHtlFeatures = new HotelFeatures();
|
||||
$objHtlFeatures = new HotelAmenities();
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$objRoomDemands = new HotelRoomTypeDemand();
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
@@ -1609,17 +1609,16 @@ class HotelCartBookingData extends ObjectModel
|
||||
$addressInfo['country'].', '.$addressInfo['postcode'];
|
||||
|
||||
|
||||
// append hotel features
|
||||
if ($hotelFeaureIds = $objHotelBranch->getFeaturesOfHotelByHotelId($roomDetail['id_hotel'])) {
|
||||
$hotelFeatures = array();
|
||||
foreach ($hotelFeaureIds as $value) {
|
||||
$htlFeatureInfo = $objHtlFeatures->getFeatureInfoById($value['feature_id']);
|
||||
if ($htlFeatureInfo = $objHtlFeatures->getFeatureInfoById($value['feature_id'])) {
|
||||
$hotelFeatures[] = $htlFeatureInfo['name'];
|
||||
// append hotel amenities
|
||||
if ($hotelAmenityIds = $objHotelBranch->getAmenitiesOfHotelByHotelId($roomDetail['id_hotel'])) {
|
||||
$hotelAmenities = array();
|
||||
foreach ($hotelAmenityIds as $value) {
|
||||
if ($htlAmenityInfo = $objHtlFeatures->getAmenityInfoById($value['amenity_id'])) {
|
||||
$hotelAmenities[] = $htlAmenityInfo['name'];
|
||||
}
|
||||
}
|
||||
if ($hotelFeatures) {
|
||||
$hotelInfo['htl_features'] = $hotelFeatures;
|
||||
if ($hotelAmenities) {
|
||||
$hotelInfo['htl_features'] = $hotelAmenities;
|
||||
}
|
||||
}
|
||||
// append roomtype features
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
<?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 HotelFeatures extends ObjectModel
|
||||
{
|
||||
public $name;
|
||||
public $parent_feature_id;
|
||||
public $position;
|
||||
public $active;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_features',
|
||||
'primary' => 'id',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'parent_feature_id' => array('type' => self::TYPE_INT, 'required' => true),
|
||||
'position' => array('type' => self::TYPE_INT),
|
||||
'active' => array('type' => self::TYPE_INT, 'required' => true),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
//lang fields
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'required' => true),
|
||||
)
|
||||
);
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'hotel_features',
|
||||
'objectNodeName' => 'hotel_feature',
|
||||
'fields' => array(),
|
||||
);
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if ($id = $this->id) {
|
||||
if (Db::getInstance()->delete('htl_branch_features', '`feature_id` = '.(int) $id)) {
|
||||
return parent::delete();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* [getFeatureInfoById :: To get feature in formation by its id]
|
||||
* @param [int] $id [description]
|
||||
* @return [false | array] [Returns false if no data found otherwise returns array of the information of the
|
||||
* feature]
|
||||
*/
|
||||
public function getFeatureInfoById($id, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
return Db::getInstance()->getRow(
|
||||
'SELECT hf.`id` , hfl.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_features` hf
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_features_lang` hfl
|
||||
ON (hfl.`id` = hf.`id` AND hfl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hf.`id`='.(int) $id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* [HotelAllCommonFeaturesArray :: To get array of all hotel features information according to parents feature and
|
||||
* children features under parent feature]
|
||||
* @return [boolean] [If data found returns array of all common features as parent then children under this parent]
|
||||
*/
|
||||
public function HotelAllCommonFeaturesArray($idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
$result = array();
|
||||
if ($parentFeatures = Db::getInstance()->executeS(
|
||||
'SELECT hf.`id`, hf.`position`, hfl.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_features` hf
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_features_lang` hfl
|
||||
ON (hfl.`id` = hf.`id` AND hfl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hf.`parent_feature_id`=0 order by position'
|
||||
)) {
|
||||
foreach ($parentFeatures as $value) {
|
||||
$result[$value['id']]['name'] = $value['name'];
|
||||
$result[$value['id']]['id'] = $value['id'];
|
||||
$result[$value['id']]['position'] = $value['position'];
|
||||
if ($childFeatures = Db::getInstance()->executeS(
|
||||
'SELECT hf.`id`, hfl.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_features` hf
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_features_lang` hfl
|
||||
ON (hfl.`id` = hf.`id` AND hfl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hf.`parent_feature_id`='.(int) $value['id']
|
||||
)) {
|
||||
foreach ($childFeatures as $value1) {
|
||||
$result[$value['id']]['children'][] = $value1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* [deleteHotelFeatures :: Deletes the feature which id is $deleteId and also delete all the child features which
|
||||
* parent id is $deleteId]
|
||||
* @param [int] $deleteId [id(primary_key) of the htl_features table]
|
||||
* @return [boolean] [true if deleted otherwise false]
|
||||
*/
|
||||
public function deleteHotelFeatures($deleteId, $deleteOnlyChilds = 0)
|
||||
{
|
||||
$sql = 'SELECT `id` FROM `'._DB_PREFIX_.'htl_features` WHERE `parent_feature_id`='.(int) $deleteId;
|
||||
|
||||
if (!$deleteOnlyChilds) {
|
||||
$sql .= ' OR `id`='.(int) $deleteId;
|
||||
}
|
||||
if ($idsToDetele = Db::getInstance()->executeS($sql)) {
|
||||
foreach ($idsToDetele as $value) {
|
||||
$objHotelFeatures = new HotelFeatures($value['id']);
|
||||
$objHotelFeatures->delete();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* [HotelBranchSelectedFeaturesArray :: To get array of all hotel features information according to parents and
|
||||
* children including which child features are selected for a hotel]
|
||||
* @param [array] $htl_features [array containing information of the features of a hotel]
|
||||
* @return [boolean] [If data found returns array of all common features as parent then children under this parent
|
||||
* and also set an index in the array that defines whether the child feature is selected for the hotel or not]
|
||||
*/
|
||||
public function HotelBranchSelectedFeaturesArray($htl_features, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
$result = array();
|
||||
if ($parentFeatures = Db::getInstance()->executeS(
|
||||
'SELECT hf.`id`, hfl.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_features` hf
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_features_lang` hfl
|
||||
ON (hfl.`id` = hf.`id` AND hfl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hf.`parent_feature_id`=0'
|
||||
)) {
|
||||
foreach ($parentFeatures as $value) {
|
||||
$result[$value['id']]['name'] = $value['name'];
|
||||
if ($childFeatures = Db::getInstance()->executeS(
|
||||
'SELECT hf.`id`, hfl.`name`
|
||||
FROM `'._DB_PREFIX_.'htl_features` hf
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_features_lang` hfl
|
||||
ON (hfl.`id` = hf.`id` AND hfl.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hf.`parent_feature_id`='.(int) $value['id']
|
||||
)) {
|
||||
foreach ($childFeatures as $value1) {
|
||||
$flag =0;
|
||||
if ($htl_features) {
|
||||
foreach ($htl_features as $ftr) {
|
||||
if ($value1['id'] == $ftr['feature_id']) {
|
||||
$flag = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($flag) {
|
||||
$value1['selected'] = 1;
|
||||
} else {
|
||||
$value1['selected'] = 0;
|
||||
}
|
||||
|
||||
$result[$value['id']]['children'][] = $value1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getChildFeaturesByParentFeatureId($parent_feature_id)
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT `id` FROM `'._DB_PREFIX_.'htl_features` WHERE `parent_feature_id`='.(int)$parent_feature_id
|
||||
);
|
||||
}
|
||||
|
||||
public function updateHotelFeatureInfoByParentFeatureId($parent_feature_id, $update_params)
|
||||
{
|
||||
return Db::getInstance()->update('htl_features', $update_params, 'id='.(int) $parent_feature_id);
|
||||
}
|
||||
|
||||
public function searchByName($query, $idLang = false)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT hf.*, hfl.* FROM `'._DB_PREFIX_.'htl_features` hf
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_features_lang` hfl
|
||||
ON hfl.`id` = hf.`id`
|
||||
WHERE hfl.`name` LIKE \'%'.pSQL($query).'%\'
|
||||
AND hfl.`id_lang`='.(int) $idLang
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -43,9 +43,9 @@ class HotelHelper
|
||||
Media::addJsDef($jsVars);
|
||||
}
|
||||
|
||||
public function insertHotelCommonFeatures()
|
||||
public function insertHotelCommonAmenities()
|
||||
{
|
||||
$parent_features_arr = array(
|
||||
$parent_amenities_arr = array(
|
||||
'Business Services' => array(
|
||||
'name' => array(
|
||||
'en' => 'Business Services',
|
||||
@@ -55,7 +55,7 @@ class HotelHelper
|
||||
'ru' => 'Бизнес-услуги',
|
||||
'es' => 'Servicios empresariales',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Business Center',
|
||||
'nl' => 'Businesscentrum',
|
||||
@@ -123,7 +123,7 @@ class HotelHelper
|
||||
'ru' => 'Дополнительные услуги',
|
||||
'es' => 'Servicios complementarios',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Internet Access Free',
|
||||
'nl' => 'Gratis internettoegang',
|
||||
@@ -175,7 +175,7 @@ class HotelHelper
|
||||
'ru' => 'Развлечения',
|
||||
'es' => 'Entretenimiento',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'DiscoTheatre',
|
||||
'nl' => 'Discotheek/theater',
|
||||
@@ -243,7 +243,7 @@ class HotelHelper
|
||||
'ru' => 'Удобства',
|
||||
'es' => 'Instalaciones',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Laundry Service',
|
||||
'nl' => 'Wasservice',
|
||||
@@ -359,7 +359,7 @@ class HotelHelper
|
||||
'ru' => 'Общие услуги',
|
||||
'es' => 'Servicios generales',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Room Service',
|
||||
'nl' => 'Roomservice',
|
||||
@@ -443,7 +443,7 @@ class HotelHelper
|
||||
'ru' => 'В помещении',
|
||||
'es' => 'Interior',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Parking',
|
||||
'nl' => 'Parkeren',
|
||||
@@ -479,7 +479,7 @@ class HotelHelper
|
||||
'ru' => 'Интернет',
|
||||
'es' => 'Internet',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Internet Access-Surcharge',
|
||||
'nl' => 'Internettoegang - toeslag',
|
||||
@@ -507,7 +507,7 @@ class HotelHelper
|
||||
'ru' => 'На открытом воздухе',
|
||||
'es' => 'Al aire libre',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Gardens',
|
||||
'nl' => 'Tuinen',
|
||||
@@ -591,7 +591,7 @@ class HotelHelper
|
||||
'ru' => 'Парковка',
|
||||
'es' => 'Aparcamiento',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Parking (Surcharge)',
|
||||
'nl' => 'Parkeren (toeslag)',
|
||||
@@ -627,7 +627,7 @@ class HotelHelper
|
||||
'ru' => 'Спорт и отдых',
|
||||
'es' => 'Deportes y recreación',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Health Club / Gym Facility Available',
|
||||
'nl' => 'Health Club / Sportschool beschikbaar',
|
||||
@@ -823,7 +823,7 @@ class HotelHelper
|
||||
'ru' => 'Водные удобства',
|
||||
'es' => 'Instalaciones acuáticas',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Swimming Pool',
|
||||
'nl' => 'Zwembad',
|
||||
@@ -875,7 +875,7 @@ class HotelHelper
|
||||
'ru' => 'Вино и ужин',
|
||||
'es' => 'Vino y cena',
|
||||
),
|
||||
'features' => array(
|
||||
'amenities' => array(
|
||||
array(
|
||||
'en' => 'Bar / Lounge',
|
||||
'nl' => 'Bar / Lounge',
|
||||
@@ -977,34 +977,46 @@ class HotelHelper
|
||||
);
|
||||
// lang fields
|
||||
$languages = Language::getLanguages(false);
|
||||
$imgDir = dirname(__FILE__).'/../views/img/hotel_amenities/';
|
||||
$i = 1;
|
||||
foreach ($parent_features_arr as $key => $value) {
|
||||
$obj_feature = new HotelFeatures();
|
||||
$defaultImageIndex = 0;
|
||||
foreach ($parent_amenities_arr as $key => $value) {
|
||||
$obj_amenity = new HotelAmenities();
|
||||
foreach ($languages as $lang) {
|
||||
if (isset($value['name'][$lang['iso_code']])) {
|
||||
$obj_feature->name[$lang['id_lang']] = $value['name'][$lang['iso_code']];
|
||||
$obj_amenity->name[$lang['id_lang']] = $value['name'][$lang['iso_code']];
|
||||
} else {
|
||||
$obj_feature->name[$lang['id_lang']] = $value['name']['en'];
|
||||
$obj_amenity->name[$lang['id_lang']] = $value['name']['en'];
|
||||
}
|
||||
}
|
||||
|
||||
$obj_feature->active = 1;
|
||||
$obj_feature->position = $i;
|
||||
$obj_feature->parent_feature_id = 0;
|
||||
$obj_feature->save();
|
||||
$parent_feature_id = $obj_feature->id;
|
||||
foreach ($value['features'] as $val) {
|
||||
$obj_feature = new HotelFeatures();
|
||||
$obj_amenity->active = 1;
|
||||
$obj_amenity->position = $i;
|
||||
$obj_amenity->id_parent = 0;
|
||||
$obj_amenity->save();
|
||||
$idParent = $obj_amenity->id;
|
||||
foreach ($value['amenities'] as $val) {
|
||||
++$defaultImageIndex;
|
||||
$obj_amenity = new HotelAmenities();
|
||||
foreach ($languages as $lang) {
|
||||
if (isset($val[$lang['iso_code']])) {
|
||||
$obj_feature->name[$lang['id_lang']] = $val[$lang['iso_code']];
|
||||
$obj_amenity->name[$lang['id_lang']] = $val[$lang['iso_code']];
|
||||
} else {
|
||||
$obj_feature->name[$lang['id_lang']] = $val['en'];
|
||||
$obj_amenity->name[$lang['id_lang']] = $val['en'];
|
||||
}
|
||||
}
|
||||
$obj_amenity->active = 1;
|
||||
$obj_amenity->id_parent = $idParent;
|
||||
$obj_amenity->save();
|
||||
|
||||
$srcImg = $imgDir.'_default/'.$defaultImageIndex.'.jpg';
|
||||
if (file_exists($srcImg)) {
|
||||
if (ImageManager::resize($srcImg, $imgDir.$obj_amenity->id.'.jpg')) {
|
||||
$obj_amenity->logo_type = 'image';
|
||||
$obj_amenity->logo = $obj_amenity->id.'.jpg';
|
||||
$obj_amenity->save();
|
||||
}
|
||||
}
|
||||
$obj_feature->active = 1;
|
||||
$obj_feature->parent_feature_id = $parent_feature_id;
|
||||
$obj_feature->save();
|
||||
}
|
||||
++$i;
|
||||
}
|
||||
@@ -1139,233 +1151,57 @@ class HotelHelper
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed default core room features and values used by room types.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function createHotelRoomDefaultFeatures()
|
||||
{
|
||||
$htl_room_ftrs = array(
|
||||
'Wi-Fi' => array(
|
||||
'en' => 'Wi-Fi',
|
||||
'nl' => 'Wi-Fi',
|
||||
'fr' => 'Wi-Fi',
|
||||
'de' => 'Wi-Fi',
|
||||
'ru' => 'Wi-Fi',
|
||||
'es' => 'Wi-Fi'
|
||||
),
|
||||
'News Paper' => array(
|
||||
'en' => 'News Paper',
|
||||
'nl' => 'Krant',
|
||||
'fr' => 'Journal',
|
||||
'de' => 'Zeitung',
|
||||
'ru' => 'Газета',
|
||||
'es' => 'Periódico'
|
||||
),
|
||||
'Power BackUp' => array(
|
||||
'en' => 'Power BackUp',
|
||||
'nl' => 'Stroomvoorziening',
|
||||
'fr' => 'Alimentation de secours',
|
||||
'de' => 'Notstromversorgung',
|
||||
'ru' => 'Резервное электропитание',
|
||||
'es' => 'Energía de respaldo'
|
||||
),
|
||||
'Refrigerator' => array(
|
||||
'en' => 'Refrigerator',
|
||||
'nl' => 'Koelkast',
|
||||
'fr' => 'Réfrigérateur',
|
||||
'de' => 'Kühlschrank',
|
||||
'ru' => 'Холодильник',
|
||||
'es' => 'Refrigerador'
|
||||
),
|
||||
'Restaurant' => array(
|
||||
'en' => 'Restaurant',
|
||||
'nl' => 'Restaurant',
|
||||
'fr' => 'Restaurant',
|
||||
'de' => 'Restaurant',
|
||||
'ru' => 'Ресторан',
|
||||
'es' => 'Restaurante'
|
||||
),
|
||||
'Room Service' => array(
|
||||
'en' => 'Room Service',
|
||||
'nl' => 'Roomservice',
|
||||
'fr' => 'Service de chambre',
|
||||
'de' => 'Zimmerservice',
|
||||
'ru' => 'Обслуживание номеров',
|
||||
'es' => 'Servicio de habitaciones'
|
||||
),
|
||||
'Gym' => array(
|
||||
'en' => 'Gym',
|
||||
'nl' => 'Fitnessruimte',
|
||||
'fr' => 'Salle de sport',
|
||||
'de' => 'Fitnessraum',
|
||||
'ru' => 'Фитнес',
|
||||
'es' => 'Gimnasio'
|
||||
)
|
||||
);
|
||||
$idLang = (int) Configuration::get('PS_LANG_DEFAULT');
|
||||
$position = 0;
|
||||
|
||||
// image value in rf/ folder
|
||||
$pos = 1;
|
||||
$languages = Language::getLanguages(true);
|
||||
foreach ($htl_room_ftrs as $room_ftr_k => $room_ftr_v) {
|
||||
$obj_feature = new Feature();
|
||||
foreach ($languages as $lang) {
|
||||
if (isset($room_ftr_v[$lang['iso_code']])) {
|
||||
$obj_feature->name[$lang['id_lang']] = $room_ftr_v[$lang['iso_code']];
|
||||
} else {
|
||||
$obj_feature->name[$lang['id_lang']] = $room_ftr_v['en'];
|
||||
}
|
||||
foreach ($this->getDefaultRoomFeatures() as $featureName => $featureValues) {
|
||||
$idFeature = (int) Feature::addFeatureImport($featureName, $position);
|
||||
if (!$idFeature) {
|
||||
return false;
|
||||
}
|
||||
$obj_feature->position = $pos-1;
|
||||
$obj_feature->save();
|
||||
if ($obj_feature->id) {
|
||||
$obj_feature_value = new FeatureValue();
|
||||
$obj_feature_value->id_feature = $obj_feature->id;
|
||||
|
||||
foreach ($languages as $lang) {
|
||||
$obj_feature_value->value[$lang['id_lang']] = $obj_feature->id.'.jpg';
|
||||
}
|
||||
|
||||
$obj_feature_value->save();
|
||||
if ($obj_feature_value->id) {
|
||||
if (file_exists(_PS_IMG_DIR_.'rf/'.$pos.'.jpg')) {
|
||||
rename(_PS_IMG_DIR_.'rf/'.$pos.'.jpg', _PS_IMG_DIR_.'rf/'.$obj_feature->id.'.jpg');
|
||||
}
|
||||
foreach ($featureValues as $featureValue) {
|
||||
$idFeatureValue = (int) FeatureValue::addFeatureValueImport($idFeature, $featureValue, null, $idLang, false);
|
||||
if (!$idFeatureValue) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$pos++;
|
||||
++$position;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function createHotelDefaultBedTypes()
|
||||
/**
|
||||
* Return the default room feature/value seed set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getDefaultRoomFeatures()
|
||||
{
|
||||
$htlBedTypes = array(
|
||||
array(
|
||||
'length' => '6.25',
|
||||
'width' => '3.16',
|
||||
'name' => array(
|
||||
'en' => 'Twin Bed',
|
||||
'nl' => 'Eenpersoonsbed',
|
||||
'fr' => 'Lit simple',
|
||||
'de' => 'Einzelbett',
|
||||
'ru' => 'Односпальная кровать',
|
||||
'es' => 'Cama individual',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.66',
|
||||
'width' => '3.16',
|
||||
'name' => array(
|
||||
'en' => 'Twin XL Bed',
|
||||
'nl' => 'Eenpersoonsbed XL',
|
||||
'fr' => 'Lit simple XL',
|
||||
'de' => 'Einzelbett XL',
|
||||
'ru' => 'Односпальная кровать XL',
|
||||
'es' => 'Cama individual XL',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.25',
|
||||
'width' => '4.5',
|
||||
'name' => array(
|
||||
'en' => 'Full Bed',
|
||||
'nl' => 'Tweepersoonsbed',
|
||||
'fr' => 'Lit double',
|
||||
'de' => 'Doppelbett',
|
||||
'ru' => 'Двуспальная кровать',
|
||||
'es' => 'Cama doble',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.66',
|
||||
'width' => '5',
|
||||
'name' => array(
|
||||
'en' => 'Queen Bed',
|
||||
'nl' => 'Queen size bed',
|
||||
'fr' => 'Lit Queen',
|
||||
'de' => 'Queen-Size-Bett',
|
||||
'ru' => 'Кровать Queen Size',
|
||||
'es' => 'Cama Queen',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.66',
|
||||
'width' => '6.33',
|
||||
'name' => array(
|
||||
'en' => 'King Bed',
|
||||
'nl' => 'King size bed',
|
||||
'fr' => 'Lit King',
|
||||
'de' => 'King-Size-Bett',
|
||||
'ru' => 'Кровать King Size',
|
||||
'es' => 'Cama King',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '7',
|
||||
'width' => '6',
|
||||
'name' => array(
|
||||
'en' => 'California King Bed',
|
||||
'nl' => 'California King bed',
|
||||
'fr' => 'Lit California King',
|
||||
'de' => 'California King-Bett',
|
||||
'ru' => 'Калифорнийская кровать King Size',
|
||||
'es' => 'Cama California King',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.25',
|
||||
'width' => '3.16',
|
||||
'name' => array(
|
||||
'en' => 'Bunk Bed',
|
||||
'nl' => 'Stapelbed',
|
||||
'fr' => 'Lit superposé',
|
||||
'de' => 'Etagenbett',
|
||||
'ru' => 'Двухъярусная кровать',
|
||||
'es' => 'Litera',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.25',
|
||||
'width' => '4.5',
|
||||
'name' => array(
|
||||
'en' => 'Sofa Bed',
|
||||
'nl' => 'Slaapbank',
|
||||
'fr' => 'Canapé-lit',
|
||||
'de' => 'Schlafsofa',
|
||||
'ru' => 'Диван-кровать',
|
||||
'es' => 'Sofá cama',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'length' => '6.66',
|
||||
'width' => '5',
|
||||
'name' => array(
|
||||
'en' => 'Murphy Bed',
|
||||
'nl' => 'Inklapbed',
|
||||
'fr' => 'Lit escamotable',
|
||||
'de' => 'Klappbett',
|
||||
'ru' => 'Откидная кровать',
|
||||
'es' => 'Cama abatible',
|
||||
),
|
||||
),
|
||||
return array(
|
||||
'Bed Type' => array('Single', 'Double', 'Queen', 'King', 'Super King', 'Twin', 'Bunk Bed', 'Sofa Bed', 'Futon', 'Murphy Bed', 'Water Bed'),
|
||||
'Extra Bed Available' => array('Yes', 'No', 'On Request', 'Chargeable'),
|
||||
'Crib/Cot Available' => array('Yes', 'No', 'On Request'),
|
||||
'Room Size' => array('150 sq ft', '200 sq ft', '300 sq ft', '400 sq ft', '500 sq ft', '600 sq ft', '800 sq ft', '1000+ sq ft'),
|
||||
'View' => array('Sea/Ocean View', 'Garden View', 'City View', 'Pool View', 'Mountain View', 'Lake View', 'River View', 'Park View', 'Courtyard View', 'Desert View', 'No View/Interior'),
|
||||
'Balcony Type' => array('Private Balcony', 'Shared Terrace', 'Juliet Balcony', 'Rooftop Access', 'Patio', 'Veranda', 'None'),
|
||||
'Bathroom Type' => array('Private/Ensuite', 'Shared', 'Jack and Jill (shared between 2 rooms)', 'Half Bath'),
|
||||
'AC Type' => array('Split AC', 'Central AC', 'Window AC', 'No AC', 'Fan Only'),
|
||||
'Heating Type' => array('Central Heating', 'Room Heater', 'Underfloor Heating', 'Fireplace', 'No Heating'),
|
||||
'TV Type' => array('No TV', 'LED TV', 'Smart TV', 'OLED TV'),
|
||||
'Wi-Fi Speed' => array('No Wi-Fi', 'Basic', 'High Speed', 'Premium/Fiber'),
|
||||
'Smoke Detection' => array('Smoke Detector', 'Sprinkler', 'None'),
|
||||
'Smoking Policy' => array('Smoking Not Allowed', 'Smoking Allowed'),
|
||||
);
|
||||
|
||||
$languages = Language::getLanguages(true);
|
||||
foreach ($htlBedTypes as $htlBedType) {
|
||||
$objBedType = new HotelBedType();
|
||||
foreach ($languages as $lang) {
|
||||
if (isset($htlBedType['name'][$lang['iso_code']])) {
|
||||
$objBedType->name[$lang['id_lang']] = $htlBedType['name'][$lang['iso_code']];
|
||||
} else {
|
||||
$objBedType->name[$lang['id_lang']] = $htlBedType['name']['en'];
|
||||
}
|
||||
|
||||
$objBedType->width = $htlBedType['width'];
|
||||
$objBedType->length = $htlBedType['length'];
|
||||
$objBedType->save();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getPsProducts($id_lang, $start = 0, $limit = 0, $booking_product = null)
|
||||
@@ -1804,14 +1640,14 @@ class HotelHelper
|
||||
return $htl_id;
|
||||
}
|
||||
|
||||
public function saveDummyHotelFeatures($id_hotel)
|
||||
public function saveDummyHotelAmenities($id_hotel)
|
||||
{
|
||||
$branch_ftr_ids = array(1, 2, 4, 7, 8, 9, 11, 12, 14, 16, 17, 18, 21);
|
||||
foreach ($branch_ftr_ids as $value_ftr) {
|
||||
$htl_ftr_obj = new HotelBranchFeatures();
|
||||
$htl_ftr_obj->id_hotel = $id_hotel;
|
||||
$htl_ftr_obj->feature_id = $value_ftr;
|
||||
$htl_ftr_obj->save();
|
||||
$branch_amenity_ids = array(2, 4, 7, 8, 11, 12, 14, 16, 17, 18, 21);
|
||||
foreach ($branch_amenity_ids as $amenityId) {
|
||||
$objHotelAmenities = new HotelBranchAmenities();
|
||||
$objHotelAmenities->id_hotel = $id_hotel;
|
||||
$objHotelAmenities->amenity_id = $amenityId;
|
||||
$objHotelAmenities->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1820,7 +1656,6 @@ class HotelHelper
|
||||
$roomTypeDemoDataLang = array(
|
||||
array(
|
||||
'price' => 1000,
|
||||
'id_bed_types' => array(4),
|
||||
'en' => array(
|
||||
'name' => 'General Rooms',
|
||||
'description_short' => 'Our General Rooms offer space and comfort with multiple bedrooms and a cozy living area. Enjoy flat-screen TVs, complimentary Wi-Fi, and a kitchenette for a perfect family getaway.',
|
||||
@@ -1854,7 +1689,6 @@ class HotelHelper
|
||||
),
|
||||
array(
|
||||
'price' => 1500,
|
||||
'id_bed_types' => array(4, 5),
|
||||
'en' => array(
|
||||
'name' => 'Delux Rooms',
|
||||
'description_short' => 'Enjoy lake views from our Deluxe Rooms with a king-sized bed, elegant furnishings, and a spacious sitting area. Perfect for guests seeking comfort, luxury, and modern amenities.',
|
||||
@@ -1888,7 +1722,6 @@ class HotelHelper
|
||||
),
|
||||
array(
|
||||
'price' => 2000,
|
||||
'id_bed_types' => array(5, 6),
|
||||
'en' => array(
|
||||
'name' => 'Executive Rooms',
|
||||
'description_short' => 'Indulge in our Executive Rooms, featuring separate living and sleeping areas, a luxurious bathroom, and exclusive lounge access. Ideal for business travelers seeking privacy',
|
||||
@@ -1922,7 +1755,6 @@ class HotelHelper
|
||||
),
|
||||
array(
|
||||
'price' => 2500,
|
||||
'id_bed_types' => array(6, 8),
|
||||
'en' => array(
|
||||
'name' => 'Luxury Rooms',
|
||||
'description_short' => 'Retreat to tranquility in our Luxury Rooms with expansive views. Featuring a queen-sized bed, workspace, and serene decor, perfect for business and leisure travelers alike.',
|
||||
@@ -1956,7 +1788,6 @@ class HotelHelper
|
||||
),
|
||||
);
|
||||
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
$languages = Language::getLanguages(true);
|
||||
foreach ($roomTypeDemoDataLang as $key => $roomTypeData) {
|
||||
// Add Product
|
||||
@@ -2077,16 +1908,8 @@ class HotelHelper
|
||||
|
||||
$htl_rm_type->save();
|
||||
|
||||
// Add features to the product
|
||||
$ftr_arr = array(0 => 1, 1 => 2, 2 => 3, 3 => 4);
|
||||
$ftr_val_arr = array(0 => 1, 1 => 2, 2 => 3, 3 => 4);
|
||||
foreach ($ftr_arr as $key_htl_ftr => $val_htl_ftr) {
|
||||
$product->addFeaturesToDB($val_htl_ftr, $ftr_val_arr[$key_htl_ftr]);
|
||||
}
|
||||
|
||||
// save advance payment information
|
||||
$this->saveAdvancedPaymentInfo($product_id);
|
||||
$objHotelRoomTypeBedType->updateRoomTypeBedTypes($roomTypeData['id_bed_types'], $product_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2474,7 +2297,7 @@ class HotelHelper
|
||||
{
|
||||
$htl_id = $this->saveDummyHotelBranchInfo();
|
||||
$this->saveDummyHotelImages($htl_id);
|
||||
$this->saveDummyHotelFeatures($htl_id);
|
||||
$this->saveDummyHotelAmenities($htl_id);
|
||||
$this->saveDummyProductsAndRelatedInfo($htl_id);
|
||||
$this->saveDummyServiceProductsAndRelatedInfo();
|
||||
|
||||
|
||||
@@ -91,32 +91,50 @@ class HotelReservationSystemDb
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_features` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`feature_id` varchar(255) DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`parent_feature_id` int(10) unsigned NOT NULL,
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_amenity` (
|
||||
`id_amenity` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_parent` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL,
|
||||
`active` int(2) NOT NULL DEFAULT '0',
|
||||
`logo_type` varchar(10) NOT NULL DEFAULT 'icon',
|
||||
`logo` varchar(255) NOT NULL DEFAULT '',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id_amenity`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_amenity_lang` (
|
||||
`id_amenity` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
PRIMARY KEY (`id_amenity`, `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,
|
||||
`amenity_id` int(10) unsigned NOT NULL,
|
||||
`is_featured` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_branch_amenity`),
|
||||
CONSTRAINT `fk_htl_branch_amenity_amenity` FOREIGN KEY (`amenity_id`)
|
||||
REFERENCES `"._DB_PREFIX_."htl_amenity` (`id_amenity`) ON DELETE CASCADE
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_amenity` (
|
||||
`id_room_type_amenity` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`amenity_id` int(10) unsigned NOT NULL,
|
||||
`is_featured` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_amenity`),
|
||||
KEY `id_product` (`id_product`),
|
||||
CONSTRAINT `fk_htl_room_type_amenity_amenity` FOREIGN KEY (`amenity_id`)
|
||||
REFERENCES `"._DB_PREFIX_."htl_amenity` (`id_amenity`) ON DELETE CASCADE
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_cart_booking_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
@@ -494,26 +512,7 @@ class HotelReservationSystemDb
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_settings_link`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_bed_type` (
|
||||
`id_bed_type` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`length` DECIMAL(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`width` DECIMAL(20,6) NOT NULL DEFAULT '0.000000',
|
||||
PRIMARY KEY (`id_bed_type`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_bed_type_lang`(
|
||||
`id_bed_type` INT(11) NOT NULL,
|
||||
`name` VARCHAR(255) DEFAULT NULL,
|
||||
`id_lang` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`id_bed_type`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_bed_type` (
|
||||
`id_room_type_bed_type` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` INT(11) NOT NULL,
|
||||
`id_bed_type` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_bed_type`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link` (`id_settings_link`, `icon`, `link`, `new_window`, `position`, `unremovable`, `active`, `date_add`, `date_upd`) VALUES
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."htl_settings_link` (`id_settings_link`, `icon`, `link`, `new_window`, `position`, `unremovable`, `active`, `date_add`, `date_upd`) VALUES
|
||||
(1, 'icon-cogs', 'index.php?controller=AdminHotelGeneralSettings', 0, 0, 1, 1, NOW(), NOW()),
|
||||
(2, 'icon-dollar', 'index.php?controller=AdminHotelFeaturePricesSettings', 0, 2, 1, 1, NOW(), NOW()),
|
||||
(3, 'icon-plus-square', 'index.php?controller=AdminRoomTypeGlobalDemand', 0, 3, 1, 1, NOW(), NOW()),
|
||||
@@ -528,27 +527,27 @@ class HotelReservationSystemDb
|
||||
PRIMARY KEY (`id_settings_link`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 1, `id_lang`, 'General Settings', 'Configure Your hotel general settings using this option.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 2, `id_lang`, 'Advanced Price Rules', 'Here set Advanced price rules for specific dates.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 3, `id_lang`, 'Additional Facilities', 'Here create Additional facilities and their prices for room types.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 4, `id_lang`, 'Hotel Interior Block', 'Configure Hotel Interior block. You can display hotel interior images using this block. This block will be displayed on home page.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
|
||||
"INSERT INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."htl_settings_link_lang` (`id_settings_link`, `id_lang`, `name`, `hint`)
|
||||
SELECT 5, `id_lang`, 'Hotel Amenities Block', 'Configure Hotels Amenities settings. You can display hotel amenities images using this block. This block will be displayed on home page.'
|
||||
FROM `"._DB_PREFIX_."lang`
|
||||
ORDER BY `id_lang`;",
|
||||
@@ -589,9 +588,10 @@ class HotelReservationSystemDb
|
||||
`'._DB_PREFIX_.'htl_branch_info`,
|
||||
`'._DB_PREFIX_.'htl_branch_info_lang`,
|
||||
`'._DB_PREFIX_.'htl_image`,
|
||||
`'._DB_PREFIX_.'htl_branch_features`,
|
||||
`'._DB_PREFIX_.'htl_features`,
|
||||
`'._DB_PREFIX_.'htl_features_lang`,
|
||||
`'._DB_PREFIX_.'htl_branch_amenity`,
|
||||
`'._DB_PREFIX_.'htl_room_type_amenity`,
|
||||
`'._DB_PREFIX_.'htl_amenity`,
|
||||
`'._DB_PREFIX_.'htl_amenity_lang`,
|
||||
`'._DB_PREFIX_.'htl_cart_booking_data`,
|
||||
`'._DB_PREFIX_.'htl_booking_detail`,
|
||||
`'._DB_PREFIX_.'htl_booking_document`,
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
<?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 HotelRoomTypeAmenities extends ObjectModel
|
||||
{
|
||||
public $id_product;
|
||||
public $amenity_id;
|
||||
public $is_featured;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'htl_room_type_amenity',
|
||||
'primary' => 'id_room_type_amenity',
|
||||
'fields' => array(
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'amenity_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'is_featured' => array('type' => self::TYPE_INT),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* @param int $idProduct
|
||||
* @param int $idLang defaults to current context language
|
||||
* @param bool $featuredOnly true = is_featured=1 only; false = all active child amenities
|
||||
* @return array
|
||||
*/
|
||||
public static function getAmenities($idProduct, $idLang = 0, $featuredOnly = false)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$filter = $featuredOnly ? 'AND hrta.`is_featured` = 1' : '';
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
|
||||
'SELECT ha.`id_amenity` AS `id`, ha.`logo_type`, ha.`logo`, hal.`name`, hrta.`is_featured`
|
||||
FROM `'._DB_PREFIX_.'htl_room_type_amenity` hrta
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_amenity` ha
|
||||
ON (ha.`id_amenity` = hrta.`amenity_id`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_amenity_lang` hal
|
||||
ON (hal.`id_amenity` = hrta.`amenity_id` AND hal.`id_lang` = '.(int)$idLang.')
|
||||
WHERE hrta.`id_product` = '.(int)$idProduct.'
|
||||
AND ha.`active` = 1
|
||||
AND ha.`id_parent` > 0
|
||||
'.$filter.'
|
||||
ORDER BY ha.`position` ASC, hal.`name` ASC'
|
||||
) ?: array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $idProduct
|
||||
* @return bool
|
||||
*/
|
||||
public static function deleteByProduct($idProduct)
|
||||
{
|
||||
return (bool)Db::getInstance()->delete('htl_room_type_amenity', '`id_product` = '.(int)$idProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare amenities tree data for a room type form, with selection state.
|
||||
*
|
||||
* @param int $idProduct
|
||||
* @param int $idLang defaults to current context language
|
||||
* @return array
|
||||
*/
|
||||
public static function getRoomTypeAmenitiesTreeData($idProduct, $idLang = 0)
|
||||
{
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
|
||||
$objHotelAmenities = new HotelAmenities();
|
||||
$amenities = $objHotelAmenities->hotelBranchSelectedAmenities(
|
||||
array_column(self::getAmenities($idProduct), 'id'),
|
||||
$idLang
|
||||
);
|
||||
|
||||
if (!$amenities) {
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach ($amenities as $idAmenityGroup => &$amenityGroup) {
|
||||
$amenityGroup['value'] = (int) $idAmenityGroup;
|
||||
$amenityGroup['input_name'] = 'room_type_amenity_parents';
|
||||
|
||||
$selectedAmenities = 0;
|
||||
if (!empty($amenityGroup['children'])) {
|
||||
foreach ($amenityGroup['children'] as &$amenity) {
|
||||
$amenity['value'] = (int) $amenity['id'];
|
||||
$amenity['input_name'] = 'room_type_amenities';
|
||||
if (!empty($amenity['selected'])) {
|
||||
++$selectedAmenities;
|
||||
}
|
||||
}
|
||||
|
||||
if ($selectedAmenities === count($amenityGroup['children'])) {
|
||||
$amenityGroup['selected'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $amenities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete existing assignments then save new ones for a room type.
|
||||
*
|
||||
* @param int $idProduct
|
||||
* @param array $amenityIds
|
||||
* @param array $featuredIds amenity IDs that should be marked is_featured=1
|
||||
* @return bool
|
||||
*/
|
||||
public function saveRoomTypeAmenities($idProduct, array $amenityIds, array $featuredIds = array())
|
||||
{
|
||||
static::deleteByProduct($idProduct);
|
||||
|
||||
$featuredSet = array_flip(array_map('intval', $featuredIds));
|
||||
|
||||
foreach (array_unique(array_filter(array_map('intval', $amenityIds))) as $amenityId) {
|
||||
$objHotelRoomTypeAmenities = new self();
|
||||
$objHotelRoomTypeAmenities->id_product = (int)$idProduct;
|
||||
$objHotelRoomTypeAmenities->amenity_id = (int)$amenityId;
|
||||
$objHotelRoomTypeAmenities->is_featured = isset($featuredSet[$amenityId]) ? 1 : 0;
|
||||
if (!$objHotelRoomTypeAmenities->save()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
<?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 HotelRoomTypeBedType extends ObjectModel
|
||||
{
|
||||
public $id_product;
|
||||
public $id_bed_type;
|
||||
|
||||
public static $definition =array(
|
||||
'table' => 'htl_room_type_bed_type',
|
||||
'primary' => 'id_room_type_bed_type',
|
||||
'fields' => array(
|
||||
'id_bed_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
),
|
||||
);
|
||||
|
||||
public function getRoomTypeBedTypes($idProduct)
|
||||
{
|
||||
$sql = 'SELECT * FROM `'._DB_PREFIX_.$this->table.'`
|
||||
WHERE `id_product` ='.(int) $idProduct;
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public function updateRoomTypeBedTypes($idBedTypes, $idProduct)
|
||||
{
|
||||
$res = true;
|
||||
if ($roomTypeBedTypes = $this->getRoomTypeBedTypes($idProduct)) {
|
||||
$roomTypeBedTypes = array_column($roomTypeBedTypes, 'id_room_type_bed_type', 'id_bed_type');
|
||||
}
|
||||
|
||||
if ($idBedTypes) {
|
||||
foreach ($idBedTypes as $idBedType) {
|
||||
// If room type bed type mapping already exits no need to update it.
|
||||
if (isset($roomTypeBedTypes[$idBedType])) {
|
||||
unset($roomTypeBedTypes[$idBedType]);
|
||||
} else {
|
||||
$objHotelRoomTypeBedType = new self();
|
||||
$objHotelRoomTypeBedType->id_product = $idProduct;
|
||||
$objHotelRoomTypeBedType->id_bed_type = $idBedType;
|
||||
$res &=$objHotelRoomTypeBedType->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Removing the non selected bed types.
|
||||
if ($roomTypeBedTypes) {
|
||||
$res &= $this->deleteRoomTypeBedTypesById($roomTypeBedTypes);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function deleteRoomTypeBedTypesById($idRoomTypeBedTypes)
|
||||
{
|
||||
$res = true;
|
||||
if ($idRoomTypeBedTypes) {
|
||||
foreach ($idRoomTypeBedTypes as $idRoomTypeBedType) {
|
||||
$objHotelRoomTypeBedType = new self($idRoomTypeBedType);
|
||||
$res &= $objHotelRoomTypeBedType->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function deleteRoomTypeBedTypes($idBedType = false, $idProduct = false)
|
||||
{
|
||||
return Db::getInstance()->delete(
|
||||
$this->table,
|
||||
' 1 '.($idBedType ? ' AND `id_bed_type`='.(int) $idBedType : '').($idProduct ? ' AND `id_product`='.(int) $idProduct : '')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -176,35 +176,15 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
}
|
||||
|
||||
$smartyVars['order_restrict_date_info'] = HotelOrderRestrictDate::getDataByHotelId($idHotel);
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
$hotelFeatures = $this->object->getFeaturesOfHotelByHotelId($this->object->id);
|
||||
if ($features = $objHotelFeatures->HotelBranchSelectedFeaturesArray($hotelFeatures)) {
|
||||
foreach ($features as $idFeature => $feature) {
|
||||
$features[$idFeature]['value'] = $idFeature;
|
||||
$features[$idFeature]['input_name'] = 'id_feature_parents';
|
||||
if (isset($feature['children']) && $feature['children']) {
|
||||
$selectedChildFeatures = 0;
|
||||
foreach ($feature['children'] as $childKey => $childFeature) {
|
||||
$features[$idFeature]['children'][$childKey]['value'] = $childFeature['id'];
|
||||
$features[$idFeature]['children'][$childKey]['input_name'] = 'id_features';
|
||||
if (isset($childFeature['selected']) && $childFeature['selected']) {
|
||||
$selectedChildFeatures++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($selectedChildFeatures == count($feature['children'])) {
|
||||
$features[$idFeature]['selected'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tree = new HelperTree('hotel-features-tree', $features);
|
||||
if ($amenities = HotelBranchAmenities::getBranchAmenitiesTreeData((int)$idHotel)) {
|
||||
$tree = new HelperTree('hotel-amenities-tree', $amenities);
|
||||
$tree->setShowCollapseExpandButton(true)
|
||||
->setUseCheckBox(true)
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true);
|
||||
$treeContent = $tree->render();
|
||||
$smartyVars['hotel_feature_tree'] = $treeContent;
|
||||
->setUseBulkActions(true)
|
||||
->setUseSearch(true);
|
||||
$smartyVars['hotel_amenity_tree'] = $tree->render();
|
||||
$smartyVars['hotel_featured_amenity_ids'] = array_column(HotelBranchAmenities::getAmenities((int)$idHotel, 0, true), 'id');
|
||||
}
|
||||
|
||||
$smartyVars['rewrite_url'] = [];
|
||||
@@ -231,7 +211,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
}
|
||||
|
||||
$smartyVars['state_var'] = $stateOptions;
|
||||
$smartyVars['enabledDisplayMap'] = Configuration::get('PS_API_KEY') && Configuration::get('PS_MAP_ID') && Configuration::get('WK_GOOGLE_ACTIVE_MAP');
|
||||
$smartyVars['enabledDisplayMap'] = Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP');
|
||||
$smartyVars['ps_img_dir'] = _PS_IMG_.'l/';
|
||||
$smartyVars['PS_MAX_CHECKOUT_OFFSET'] = (int) Configuration::get('PS_MAX_CHECKOUT_OFFSET');
|
||||
$smartyVars['PS_MIN_BOOKING_OFFSET'] = (int) Configuration::get('PS_MIN_BOOKING_OFFSET');
|
||||
@@ -278,11 +258,12 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$maxCheckoutOffset = trim(Tools::getValue('max_checkout_offset'));
|
||||
$enableUseGlobalMinBookingOffset = Tools::getValue('enable_use_global_min_booking_offset');
|
||||
$minBookingOffset = trim(Tools::getValue('min_booking_offset'));
|
||||
$latitude = Tools::getValue('loclatitude');
|
||||
$longitude = Tools::getValue('loclongitude');
|
||||
$latitude = number_format((float) Tools::getValue('loclatitude'), 8, '.', '');
|
||||
$longitude = number_format((float) Tools::getValue('loclongitude'), 8, '.', '');
|
||||
$map_formated_address = Tools::getValue('locformatedAddr');
|
||||
$map_input_text = Tools::getValue('googleInputField');
|
||||
$hotelFeatures = Tools::getValue('id_features', array());
|
||||
$hotelAmenities = Tools::getValue('id_amenities', array());
|
||||
$hotelFeaturedAmenities = Tools::getValue('hotel_featured_amenities', array());
|
||||
$shortDescriptionMaxChar = Configuration::get('PS_SHORT_DESC_LIMIT') ? Configuration::get('PS_SHORT_DESC_LIMIT') : Configuration::PS_SHORT_DESC_LIMIT;
|
||||
|
||||
// check if field is atleast in default language. Not available in default prestashop
|
||||
@@ -496,6 +477,11 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
}
|
||||
}
|
||||
|
||||
$amenityCategories = HotelAmenities::getCategories();
|
||||
if ($amenityCategories && !HotelAmenities::getAmenities()) {
|
||||
$this->errors[] = $this->l('No amenities have been created. Please add amenities to at least one category before assigning them.');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
if ($idHotel) {
|
||||
$objHotelBranch = new HotelBranchInformation($idHotel);
|
||||
@@ -624,8 +610,8 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$objHotelBranch->check_in = $check_in;
|
||||
$objHotelBranch->check_out = $check_out;
|
||||
$objHotelBranch->rating = $rating;
|
||||
$objHotelBranch->latitude = Validate::isFloat($latitude) ? Tools::ps_round($latitude, 8) : $latitude;
|
||||
$objHotelBranch->longitude = Validate::isFloat($longitude) ? Tools::ps_round($longitude, 8) : $longitude;
|
||||
$objHotelBranch->latitude = Validate::isCoordinate($latitude) ? Tools::ps_round($latitude, 8) : $latitude;
|
||||
$objHotelBranch->longitude = Validate::isCoordinate($longitude) ? Tools::ps_round($longitude, 8) : $longitude;
|
||||
$objHotelBranch->map_formated_address = $map_formated_address;
|
||||
$objHotelBranch->map_input_text = $map_input_text;
|
||||
$objHotelBranch->save();
|
||||
@@ -819,10 +805,9 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
|
||||
$objHotelOrderRestrictDate->save();
|
||||
|
||||
$objHotelFeatures = new HotelBranchFeatures();
|
||||
$objHotelFeatures->deleteBranchFeaturesByHotelId($idHotel);
|
||||
if (!$objHotelFeatures->assignFeaturesToHotel($idHotel, $hotelFeatures)) {
|
||||
$this->errors[] = $this->l('Some problem occurred while assigning features to the hotel.');
|
||||
$objHotelAmenities = new HotelBranchAmenities();
|
||||
if (!$objHotelAmenities->saveBranchAmenities($idHotel, $hotelAmenities, $hotelFeaturedAmenities)) {
|
||||
$this->errors[] = $this->l('Some problem occurred while assigning amenities to the hotel.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1009,7 +994,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
// GOOGLE MAP
|
||||
$language = $this->context->language;
|
||||
$country = $this->context->country;
|
||||
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && $PS_MAP_ID) {
|
||||
if ($PS_API_KEY = Configuration::get('PS_API_KEY')) {
|
||||
$this->addJS(
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$PS_API_KEY.'&libraries=places,marker&loading=async&language='.
|
||||
$language->iso_code.'®ion='.$country->iso_code.'&callback=initGoogleMaps'
|
||||
|
||||
@@ -34,7 +34,11 @@ class AdminBookingDocumentController extends ModuleAdminController
|
||||
$contentLength = $objHotelBookingDocument->getContentLength();
|
||||
$filePath = $objHotelBookingDocument->getPhysicalPath();
|
||||
$downloadFileName = $objHotelBookingDocument->getDownloadFileName();
|
||||
$contentDisposition = Tools::getValue('is_preview') ? 'inline' : 'attachment';
|
||||
// Only images are safe to render inline; PDFs can carry embedded JavaScript
|
||||
// that executes when opened inline, so they always force a download instead.
|
||||
$contentDisposition = (Tools::getValue('is_preview')
|
||||
&& $objHotelBookingDocument->file_type == HotelBookingDocument::FILE_TYPE_IMAGE)
|
||||
? 'inline' : 'attachment';
|
||||
|
||||
if (Tools::file_exists_cache($filePath)) {
|
||||
if (ob_get_level() && ob_get_length() > 0) {
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
<?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 AdminHotelAmenitiesController extends ModuleAdminController
|
||||
{
|
||||
const IMG_DIR = 'views/img/hotel_amenities/';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'htl_amenity';
|
||||
$this->className = 'HotelAmenities';
|
||||
$this->identifier = 'id_amenity';
|
||||
$this->toolbar_title = $this->l('Manage Amenities');
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->display = 'view';
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
parent::initToolbar();
|
||||
|
||||
if ($this->display == 'view') {
|
||||
$this->page_header_toolbar_btn['add_category'] = array(
|
||||
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||
'desc' => $this->l('Add new Amenity Category'),
|
||||
'imgclass' => 'new',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
if (Tools::isSubmit('add'.$this->table) || Tools::isSubmit('update'.$this->table)
|
||||
|| Tools::isSubmit('add'.$this->table.'_item') || Tools::isSubmit('update'.$this->table.'_item')
|
||||
) {
|
||||
$this->display = 'edit';
|
||||
}
|
||||
|
||||
$this->initTabModuleList();
|
||||
$this->initToolbar();
|
||||
$this->initPageHeaderToolbar();
|
||||
|
||||
if ($this->display == 'edit') {
|
||||
$this->content = $this->renderForm();
|
||||
} else {
|
||||
$this->content = $this->renderView();
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'content' => $this->content,
|
||||
'url_post' => self::$currentIndex.'&token='.$this->token,
|
||||
'show_page_header_toolbar' => $this->show_page_header_toolbar,
|
||||
'page_header_toolbar_title' => $this->page_header_toolbar_title,
|
||||
'page_header_toolbar_btn' => $this->page_header_toolbar_btn,
|
||||
));
|
||||
}
|
||||
|
||||
public function renderView()
|
||||
{
|
||||
$objHotelAmenities = new HotelAmenities();
|
||||
$this->context->smarty->assign(array(
|
||||
'amenities_tree' => $objHotelAmenities->getAmenitiesTree(),
|
||||
'img_base_url' => $this->module->getPathUri().self::IMG_DIR,
|
||||
'current_index' => self::$currentIndex,
|
||||
'token' => $this->token,
|
||||
'admin_link' => Context::getContext()->link->getAdminLink('AdminHotelAmenities'),
|
||||
));
|
||||
|
||||
return parent::renderView();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$languages = Language::getLanguages(false);
|
||||
$defaultLang = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$adminLink = Context::getContext()->link->getAdminLink('AdminHotelAmenities');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'languages' => $languages,
|
||||
'default_lang_id' => $defaultLang,
|
||||
'current_index' => self::$currentIndex,
|
||||
'token' => $this->token,
|
||||
'admin_link' => $adminLink,
|
||||
));
|
||||
|
||||
if (Tools::isSubmit('add'.$this->table.'_item') || Tools::isSubmit('update'.$this->table.'_item')) {
|
||||
$idAmenity = (int)Tools::getValue('id');
|
||||
$idCategory = (int)Tools::getValue('id_category');
|
||||
$amenity = array();
|
||||
|
||||
if ($idAmenity) {
|
||||
$objHotelAmenities = new HotelAmenities($idAmenity);
|
||||
if (Validate::isLoadedObject($objHotelAmenities)) {
|
||||
$idCategory = (int)$objHotelAmenities->id_parent;
|
||||
$amenity = array(
|
||||
'id' => $objHotelAmenities->id,
|
||||
'id_parent' => $idCategory,
|
||||
'active' => (int)$objHotelAmenities->active,
|
||||
'logo_type' => $objHotelAmenities->logo_type,
|
||||
'logo' => $objHotelAmenities->logo,
|
||||
'name' => is_array($objHotelAmenities->name) ? $objHotelAmenities->name : array(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$imgPath = $this->module->getLocalPath().self::IMG_DIR.$idAmenity.'.jpg';
|
||||
$this->context->smarty->assign(array(
|
||||
'amenity' => $amenity,
|
||||
'id_category' => $idCategory,
|
||||
'existing_img' => ($idAmenity && file_exists($imgPath))
|
||||
? $this->module->getPathUri().self::IMG_DIR.$idAmenity.'.jpg'
|
||||
: false,
|
||||
));
|
||||
} else {
|
||||
$idCategory = (int)Tools::getValue('id');
|
||||
$category = array();
|
||||
|
||||
if ($idCategory) {
|
||||
$objHotelAmenities = new HotelAmenities($idCategory);
|
||||
if (Validate::isLoadedObject($objHotelAmenities)) {
|
||||
$category = array(
|
||||
'id' => $objHotelAmenities->id,
|
||||
'position' => $objHotelAmenities->position,
|
||||
'name' => is_array($objHotelAmenities->name) ? $objHotelAmenities->name : array(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('category', $category);
|
||||
}
|
||||
|
||||
$this->fields_form = array('submit' => array('title' => $this->l('Save')));
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitHtlCategory') || Tools::isSubmit('submitHtlCategoryAndStay')) {
|
||||
$idCategory = (int)Tools::getValue('id');
|
||||
$pos = (int)Tools::getValue('position');
|
||||
$languages = Language::getLanguages(false);
|
||||
$defaultLang = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
|
||||
if (!$pos || !Validate::isUnsignedInt($pos)) {
|
||||
$this->errors[] = $this->l('Position is invalid.');
|
||||
}
|
||||
|
||||
$nameDefault = trim(Tools::getValue('cat_name_'.$defaultLang));
|
||||
if (!$nameDefault) {
|
||||
$this->errors[] = $this->l('Category name is required in default language.');
|
||||
} elseif (!Validate::isGenericName($nameDefault)) {
|
||||
$this->errors[] = $this->l('Category name is invalid.');
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
$this->display = 'edit';
|
||||
return;
|
||||
}
|
||||
|
||||
$objHotelAmenities = $idCategory ? new HotelAmenities($idCategory) : new HotelAmenities();
|
||||
foreach ($languages as $lang) {
|
||||
$val = trim(Tools::getValue('cat_name_'.$lang['id_lang']));
|
||||
$objHotelAmenities->name[$lang['id_lang']] = $val ?: $nameDefault;
|
||||
}
|
||||
$objHotelAmenities->id_parent = 0;
|
||||
$objHotelAmenities->position = $pos;
|
||||
$objHotelAmenities->active = 1;
|
||||
|
||||
if (!$objHotelAmenities->save()) {
|
||||
$this->errors[] = $this->l('Error saving category.');
|
||||
$this->display = 'edit';
|
||||
return;
|
||||
}
|
||||
|
||||
$conf = $idCategory ? 4 : 3;
|
||||
if (Tools::isSubmit('submitHtlCategoryAndStay')) {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&id='.(int)$objHotelAmenities->id.'&update'.$this->table.'&conf='.$conf.'&token='.$this->token);
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf='.$conf.'&token='.$this->token);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitHtlAmenityItem') || Tools::isSubmit('submitHtlAmenityItemAndStay')) {
|
||||
$idAmenity = (int)Tools::getValue('id');
|
||||
$idCategory = (int)Tools::getValue('id_category');
|
||||
$active = (int)Tools::getValue('active');
|
||||
$logoType = Tools::getValue('logo_type');
|
||||
$languages = Language::getLanguages(false);
|
||||
$defaultLang = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
|
||||
if (!$idCategory) {
|
||||
$this->errors[] = $this->l('Category is required.');
|
||||
}
|
||||
|
||||
$nameDefault = trim(Tools::getValue('amenity_name_'.$defaultLang));
|
||||
if (!$nameDefault) {
|
||||
$this->errors[] = $this->l('Amenity name is required in default language.');
|
||||
} elseif (!Validate::isGenericName($nameDefault)) {
|
||||
$this->errors[] = $this->l('Amenity name is invalid.');
|
||||
}
|
||||
|
||||
$logoValue = '';
|
||||
if ($logoType === 'icon') {
|
||||
$logoValue = trim(Tools::getValue('logo_icon'));
|
||||
if (!$logoValue) {
|
||||
$this->errors[] = $this->l('Icon class is required.');
|
||||
} elseif (!preg_match('/^icon-/', $logoValue)) {
|
||||
$this->errors[] = $this->l('Icon class must start with "icon-" (e.g. icon-wifi).');
|
||||
} elseif (!Validate::isGenericName(str_replace('-', ' ', $logoValue))) {
|
||||
$this->errors[] = $this->l('Icon name is invalid.');
|
||||
}
|
||||
} else {
|
||||
$hasUpload = isset($_FILES['logo_image']) && !empty($_FILES['logo_image']['tmp_name']);
|
||||
$hasExisting = $idAmenity && file_exists($this->module->getLocalPath().self::IMG_DIR.$idAmenity.'.jpg');
|
||||
if (!$hasUpload && !$hasExisting) {
|
||||
$this->errors[] = $this->l('Please upload an image for this amenity.');
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
$this->display = 'edit';
|
||||
return;
|
||||
}
|
||||
|
||||
$objHotelAmenities = $idAmenity ? new HotelAmenities($idAmenity) : new HotelAmenities();
|
||||
foreach ($languages as $lang) {
|
||||
$val = trim(Tools::getValue('amenity_name_'.$lang['id_lang']));
|
||||
$objHotelAmenities->name[$lang['id_lang']] = $val ?: $nameDefault;
|
||||
}
|
||||
$objHotelAmenities->id_parent = $idCategory;
|
||||
$objHotelAmenities->active = $active;
|
||||
$objHotelAmenities->logo_type = ($logoType === 'icon') ? 'icon' : 'image';
|
||||
$objHotelAmenities->logo = ($logoType === 'icon') ? $logoValue : $objHotelAmenities->logo;
|
||||
|
||||
if (!$objHotelAmenities->save()) {
|
||||
$this->errors[] = $this->l('Error saving amenity.');
|
||||
$this->display = 'edit';
|
||||
return;
|
||||
}
|
||||
|
||||
if ($logoType === 'icon') {
|
||||
$imgFile = $this->module->getLocalPath().self::IMG_DIR.$objHotelAmenities->id.'.jpg';
|
||||
if (file_exists($imgFile)) {
|
||||
unlink($imgFile);
|
||||
}
|
||||
}
|
||||
|
||||
if ($logoType === 'image' && isset($_FILES['logo_image']) && $_FILES['logo_image']['tmp_name']) {
|
||||
$imgFile = $_FILES['logo_image'];
|
||||
if ($error = ImageManager::validateUpload($imgFile, Tools::getMaxUploadSize())) {
|
||||
$this->errors[] = $error;
|
||||
} else {
|
||||
$imgDir = $this->module->getLocalPath().self::IMG_DIR;
|
||||
if (!is_dir($imgDir)) {
|
||||
mkdir($imgDir, 0755, true);
|
||||
}
|
||||
if (ImageManager::resize($imgFile['tmp_name'], $imgDir.$objHotelAmenities->id.'.jpg')) {
|
||||
$objHotelAmenities->logo = $objHotelAmenities->id.'.jpg';
|
||||
$objHotelAmenities->save();
|
||||
} else {
|
||||
$this->errors[] = $this->l('Error uploading amenity image.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
$this->display = 'edit';
|
||||
return;
|
||||
}
|
||||
|
||||
$conf = $idAmenity ? 4 : 3;
|
||||
if (Tools::isSubmit('submitHtlAmenityItemAndStay')) {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&id='.(int)$objHotelAmenities->id.'&id_category='.(int)$idCategory.'&update'.$this->table.'_item&conf='.$conf.'&token='.$this->token);
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf='.$conf.'&token='.$this->token);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($this->errors)) {
|
||||
parent::postProcess();
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessDeleteCategory()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
|
||||
if ($this->tabAccess['delete']) {
|
||||
$objHotelAmenities = new HotelAmenities();
|
||||
if ($objHotelAmenities->deleteCategory((int)Tools::getValue('id_category'))) {
|
||||
$response['status'] = true;
|
||||
} else {
|
||||
$response['msg'] = $this->l('Error deleting category.');
|
||||
}
|
||||
} else {
|
||||
$response['msg'] = $this->l('You do not have permission to delete.');
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessDeleteAmenityItem()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
|
||||
if ($this->tabAccess['delete']) {
|
||||
$objHotelAmenities = new HotelAmenities((int)Tools::getValue('id_amenity'));
|
||||
if (Validate::isLoadedObject($objHotelAmenities) && $objHotelAmenities->delete()) {
|
||||
$response['status'] = true;
|
||||
} else {
|
||||
$response['msg'] = $this->l('Error deleting amenity.');
|
||||
}
|
||||
} else {
|
||||
$response['msg'] = $this->l('You do not have permission to delete.');
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJs(_MODULE_DIR_.'hotelreservationsystem/views/js/hotelAmenity.js');
|
||||
$this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/hotelAmenity.css');
|
||||
}
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
<?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 AdminHotelBedTypesController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'htl_bed_type';
|
||||
$this->className = 'HotelBedType';
|
||||
$this->identifier = 'id_bed_type';
|
||||
$this->context = Context::getContext();
|
||||
$this->lang = true;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->_new_list_header_design = true;
|
||||
// field options for global fields
|
||||
$this->fields_options = array(
|
||||
'global' => array(
|
||||
'title' => $this->l('Dimension Unit Setting'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'WK_DIMENSION_UNIT' => array(
|
||||
'title' => $this->l('Dimension Unit'),
|
||||
'type' => 'textLang',
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'validation' => 'isGenericName',
|
||||
'hint' => $this->l('Enter a dimension unit for the bed types.')
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
);
|
||||
|
||||
$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 initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
// to customize the view as per our requirements
|
||||
if ($this->display != 'add' && $this->display != 'edit') {
|
||||
$this->content = $this->renderOptions();
|
||||
$this->content .= $this->renderList();
|
||||
$this->context->smarty->assign('content', $this->content);
|
||||
}
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
if (!$this->display || $this->display == 'list') {
|
||||
$this->page_header_toolbar_btn['new_product'] = array(
|
||||
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||
'desc' => $this->l('Add new', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
|
||||
parent::initPageHeaderToolbar();
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
$this->toolbar_btn = array();
|
||||
}
|
||||
|
||||
public function renderList()
|
||||
{
|
||||
// added here instead of the constructor since the dimension unit will be update afer post processs.
|
||||
$this->fields_list = array(
|
||||
'id_bed_type' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'align' => 'center',
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Name'),
|
||||
'align' => 'center',
|
||||
),
|
||||
'width' => array(
|
||||
'title' => $this->l('Width'),
|
||||
'align' => 'center',
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id)
|
||||
),
|
||||
'length' => array(
|
||||
'title' => $this->l('Lenght'),
|
||||
'align' => 'center',
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id)
|
||||
),
|
||||
);
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
if (!$this->loadObject(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Bed Type'),
|
||||
'icon' => 'icon-bed'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Bed Type Name'),
|
||||
'name' => 'name',
|
||||
'required' => true,
|
||||
'col' => 4,
|
||||
'lang' => true,
|
||||
'hint' => $this->l('Enter the name of Bed type.')
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Width'),
|
||||
'name' => 'width',
|
||||
'required' => true,
|
||||
'col' => 4,
|
||||
'hint' => $this->l('Enter the width of the Bed type in ').Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Length'),
|
||||
'name' => 'length',
|
||||
'col' => 4,
|
||||
'required' => true,
|
||||
'hint' => $this->l('Enter the length of the Bed type in ').Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id),
|
||||
),
|
||||
),
|
||||
'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 beforeUpdateOptions()
|
||||
{
|
||||
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
|
||||
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
|
||||
$languages = Language::getLanguages(false);
|
||||
if (!trim(Tools::getValue('WK_DIMENSION_UNIT_'.$defaultLangId))
|
||||
&& Tools::getValue('WK_DIMENSION_UNIT_'.$defaultLangId)
|
||||
) {
|
||||
$this->errors[] = $this->l('Default dimension unit is required at least in ').$objDefaultLanguage['name'];
|
||||
} else {
|
||||
foreach ($languages as $lang) {
|
||||
if (Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang'])
|
||||
&& (!trim(Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang']))
|
||||
|| !Validate::isGenericName(Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang'])))
|
||||
) {
|
||||
$this->errors[] = $this->l('Invalid dimension unit in ').$lang['name'];
|
||||
}
|
||||
|
||||
if (!trim(Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang']))) {
|
||||
$_POST['WK_DIMENSION_UNIT_'.$lang['id_lang']] = Tools::getValue('WK_DIMENSION_UNIT_'.$defaultLangId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function processSave()
|
||||
{
|
||||
if (!$this->loadObject(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
|
||||
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
|
||||
$languages = Language::getLanguages(false);
|
||||
if (!trim(Tools::getValue('name_'.$defaultLangId))) {
|
||||
$this->errors[] = $this->l('Bed type name is required at least in ').$objDefaultLanguage['name'];
|
||||
} else {
|
||||
foreach ($languages as $lang) {
|
||||
if (trim(Tools::getValue('name_'.$lang['id_lang'])) && !Validate::isGenericName(Tools::getValue('name_'.$lang['id_lang']))) {
|
||||
$this->errors[] = $this->l('Invalid bed type name in ').$lang['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(float) Tools::getValue('width')) {
|
||||
$this->errors[] = $this->l('The width field is required');
|
||||
}
|
||||
|
||||
if (!(float) Tools::getValue('length')) {
|
||||
$this->errors[] = $this->l('The length field is required');
|
||||
}
|
||||
|
||||
return parent::processSave();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -398,13 +398,15 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
|
||||
'PS_API_KEY' => array(
|
||||
'title' => $this->l('Google Maps API Key'),
|
||||
'hint' => $this->l('Unique API key for Google Maps.'),
|
||||
'validation' => 'isGenericName',
|
||||
'type' => 'text',
|
||||
'desc' => $this->l('Google Maps API Key is required to display Google Maps.')
|
||||
),
|
||||
'PS_MAP_ID' => array(
|
||||
'title' => $this->l('Google Map ID'),
|
||||
'hint' => $this->l('Map Id for Google Maps.'),
|
||||
'type' => 'text',
|
||||
'desc' => $this->l('Google Maps API Key and Google Map ID is required to display Google Maps.')
|
||||
'hint' => $this->l('Map Id for Google Maps (optional).'),
|
||||
'validation' => 'isGenericName',
|
||||
'type' => 'text'
|
||||
),
|
||||
'WK_GOOGLE_ACTIVE_MAP' => array(
|
||||
'title' => $this->l('Display Google Maps For Hotel Location'),
|
||||
@@ -621,9 +623,6 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
|
||||
if (!Tools::getValue('PS_API_KEY')) {
|
||||
$this->errors[] = $this->l('Please enter Google API key.');
|
||||
}
|
||||
if (!Tools::getValue('PS_MAP_ID')) {
|
||||
$this->errors[] = $this->l('Please enter Google Map Id.');
|
||||
}
|
||||
}
|
||||
if (!trim(Tools::getValue('PS_SHOP_NAME'))) {
|
||||
$this->errors[] = $this->l('Website name field is required');
|
||||
|
||||
@@ -31,6 +31,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
protected $date_to;
|
||||
protected $booking_product;
|
||||
protected $occupancy;
|
||||
protected $eventColors;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'htl_booking_detail';
|
||||
@@ -43,6 +45,13 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
|
||||
$this->_conf[52] = $this->l('Room in the booking is successfully reallocated');
|
||||
$this->_conf[53] = $this->l('Room in the booking is successfully swapped');
|
||||
|
||||
$this->eventColors = array(
|
||||
'available' => array('event' => '#7EC77B', 'cell' => '#D9EFD8'),
|
||||
'partially_available' => array('event' => '#FFC224', 'cell' => '#FFF3CD'),
|
||||
'booked' => array('event' => '#00AFF0', 'cell' => '#C3E1FB'),
|
||||
'unavailable' => array('event' => '#FF3838', 'cell' => '#FFC4C4'),
|
||||
);
|
||||
}
|
||||
|
||||
public function init()
|
||||
@@ -373,6 +382,11 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
|
||||
$adminCartsAccess = Profile::getProfileAccess(
|
||||
(int) $this->context->employee->id_profile,
|
||||
(int) Tab::getIdFromClassName('AdminCarts')
|
||||
);
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'adults' => $adults,
|
||||
'children' => $children,
|
||||
@@ -386,6 +400,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'link' => $this->context->link,
|
||||
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
|
||||
'can_add_booking_carts' => (!empty($adminCartsAccess['add']) && (int) $adminCartsAccess['add'] === 1),
|
||||
'htl_connected_rooms' => HotelConnectedRoom::getConnectedRooms(null, null, $this->id_hotel, $this->context->language->id),
|
||||
));
|
||||
|
||||
@@ -506,13 +521,9 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function ajaxProcessGetCalenderData()
|
||||
public function ajaxProcessGetCalenderData()
|
||||
{
|
||||
$events = array();
|
||||
// No use of adults, child, num_rooms
|
||||
$adults = 0;
|
||||
$children = 0;
|
||||
$num_rooms = 1;
|
||||
|
||||
$start_date = date('Y-m-d', strtotime(Tools::getValue('start')));
|
||||
$last_day_this_month = date('Y-m-d', strtotime(Tools::getValue('end')));
|
||||
@@ -524,10 +535,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$bookingParams = array();
|
||||
$bookingParams['hotel_id'] = $searchIdHotel;
|
||||
$bookingParams['id_room_type'] = $searchIdRoomType;
|
||||
$bookingParams['adults'] = $adults;
|
||||
$bookingParams['children'] = $children;
|
||||
$bookingParams['num_rooms'] = $num_rooms;
|
||||
$bookingParams['for_calendar'] = 1;
|
||||
$bookingParams['search_available'] = 1;
|
||||
$bookingParams['search_partial'] = 1;
|
||||
$bookingParams['search_booked'] = 1;
|
||||
@@ -538,30 +545,148 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
|
||||
while ($start_date <= $last_day_this_month) {
|
||||
$cal_date_from = $start_date;
|
||||
$cal_date_to = date('Y-m-d', strtotime('+1 day', strtotime($cal_date_from)));
|
||||
$bookingParams['date_from'] = $cal_date_from;
|
||||
$bookingParams['date_to'] = $cal_date_to;
|
||||
$eventData = $objBookingDetail->getBookingData($bookingParams);
|
||||
if (!$eventData) {
|
||||
$eventData['stats'] = array(
|
||||
'total_room_type' => 0,
|
||||
'total_rooms' => 0,
|
||||
'max_avail_occupancy' => 0,
|
||||
'num_unavail' => 0,
|
||||
'num_cart' => 0,
|
||||
'num_booked' => 0,
|
||||
'num_avail' => 0,
|
||||
'num_part_avai' => 0,
|
||||
$rangeParams = $bookingParams;
|
||||
$rangeParams['date_from'] = $start_date;
|
||||
$rangeParams['date_to'] = date('Y-m-d', strtotime('+1 day', strtotime($last_day_this_month)));
|
||||
$rangeParams['search_available'] = 0;
|
||||
$rangeParams['search_partial'] = 0;
|
||||
$bookingData = $objBookingDetail->getBookingData($rangeParams);
|
||||
|
||||
$bookedDates = array();
|
||||
$unavailableDates = array();
|
||||
$cartDates = array();
|
||||
$numCart = 0;
|
||||
|
||||
if (!empty($bookingData['rm_data'])) {
|
||||
$roomsByProduct = array();
|
||||
foreach (HotelRoomInformation::getHotelRoomsInfo($searchIdHotel, $searchIdRoomType) ?: array() as $room) {
|
||||
$roomsByProduct[$room['id_product']][$room['id']] = array(
|
||||
'id_room' => $room['id'],
|
||||
'room_num' => $room['room_num'],
|
||||
);
|
||||
}
|
||||
|
||||
$eventData['date_format'] = Tools::displayDate($cal_date_from);
|
||||
$events[strtotime($bookingParams['date_from'])] = array(
|
||||
foreach ($bookingData['rm_data'] as $key => $roomType) {
|
||||
$bookingData['rm_data'][$key]['all_rooms'] = isset($roomsByProduct[$roomType['id_product']])
|
||||
? $roomsByProduct[$roomType['id_product']]
|
||||
: array();
|
||||
|
||||
// booked rooms.
|
||||
foreach ($roomType['data']['booked'] ?: array() as $bookedRoom) {
|
||||
foreach ($bookedRoom['detail'] as $detail) {
|
||||
for (
|
||||
$d = date('Y-m-d', strtotime($detail['date_from']));
|
||||
strtotime($d) < strtotime($detail['date_to']);
|
||||
$d = date('Y-m-d', strtotime('+1 day', strtotime($d)))
|
||||
) {
|
||||
$bookedDates[$d][$roomType['id_product']][$bookedRoom['id_room']] = $bookedRoom['id_room'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// unavailable rooms
|
||||
foreach ($roomType['data']['unavailable'] ?: array() as $unavailableRoom) {
|
||||
foreach ($unavailableRoom['detail'] as $detail) {
|
||||
if ($detail['date_from'] && $detail['date_to']) {
|
||||
$unavailFrom = $detail['date_from'];
|
||||
$unavailTo = $detail['date_to'];
|
||||
} else {
|
||||
$unavailFrom = $rangeParams['date_from'];
|
||||
$unavailTo = $rangeParams['date_to'];
|
||||
}
|
||||
for (
|
||||
$d = date('Y-m-d', strtotime($unavailFrom));
|
||||
strtotime($d) < strtotime($unavailTo);
|
||||
$d = date('Y-m-d', strtotime('+1 day', strtotime($d)))
|
||||
) {
|
||||
$unavailableDates[$d][$roomType['id_product']][$unavailableRoom['id_room']] = $unavailableRoom['id_room'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cart-rooms
|
||||
foreach ($roomType['data']['cart_rooms'] ?: array() as $cartRoom) {
|
||||
$numCart++;
|
||||
for (
|
||||
$d = date('Y-m-d', strtotime($cartRoom['date_from']));
|
||||
strtotime($d) < strtotime($cartRoom['date_to']);
|
||||
$d = date('Y-m-d', strtotime('+1 day', strtotime($d)))
|
||||
) {
|
||||
$cartDates[$d][$roomType['id_product']][$cartRoom['id_room']] = $cartRoom['id_room'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while ($start_date <= $last_day_this_month) {
|
||||
$cal_date_from = $start_date;
|
||||
|
||||
$stats = array(
|
||||
'total_room_type' => 0,
|
||||
'total_rooms' => 0,
|
||||
'max_avail_occupancy' => 0,
|
||||
'num_unavail' => 0,
|
||||
'num_cart' => $numCart,
|
||||
'num_booked' => 0,
|
||||
'num_avail' => 0,
|
||||
'num_part_avai' => 0,
|
||||
);
|
||||
|
||||
if (!empty($bookingData['rm_data'])) {
|
||||
$stats['total_room_type'] = $bookingData['stats']['total_room_type'];
|
||||
$stats['total_rooms'] = $bookingData['stats']['total_rooms'];
|
||||
|
||||
foreach ($bookingData['rm_data'] as $roomType) {
|
||||
$allRooms = $roomType['all_rooms'] ?: array();
|
||||
|
||||
// available initially all rooms
|
||||
$available = $allRooms;
|
||||
$booked = array();
|
||||
$unavail = array();
|
||||
|
||||
// remove booked rooms
|
||||
if (!empty($bookedDates[$cal_date_from][$roomType['id_product']])) {
|
||||
$booked = array_intersect_key($allRooms, $bookedDates[$cal_date_from][$roomType['id_product']]);
|
||||
$available = array_diff_key($available, $booked);
|
||||
}
|
||||
|
||||
// remove unavailable rooms
|
||||
if (!empty($unavailableDates[$cal_date_from][$roomType['id_product']])) {
|
||||
$unavail = array_intersect_key($allRooms, $unavailableDates[$cal_date_from][$roomType['id_product']]);
|
||||
$available = array_diff_key($available, $unavail);
|
||||
}
|
||||
|
||||
// remove cart rooms
|
||||
if (!empty($cartDates[$cal_date_from][$roomType['id_product']])) {
|
||||
$available = array_diff_key($available, array_intersect_key($allRooms, $cartDates[$cal_date_from][$roomType['id_product']]));
|
||||
}
|
||||
|
||||
$stats['num_booked'] += count($booked);
|
||||
$stats['num_unavail'] += count($unavail);
|
||||
$stats['num_avail'] += count($available);
|
||||
$stats['max_avail_occupancy'] += count($available) * (int) $roomType['max_guests'];
|
||||
}
|
||||
}
|
||||
|
||||
$eventData = array(
|
||||
'stats' => $stats,
|
||||
'date_format' => Tools::displayDate($cal_date_from),
|
||||
);
|
||||
|
||||
if ($stats['num_avail'] > 0) {
|
||||
$cellBgColor = $this->eventColors['available']['cell'];
|
||||
} elseif ($stats['num_part_avai'] > 0) {
|
||||
$cellBgColor = $this->eventColors['partially_available']['cell'];
|
||||
} elseif ($stats['num_booked'] == $stats['total_rooms'] && $stats['total_rooms'] != 0) {
|
||||
$cellBgColor = $this->eventColors['booked']['cell'];
|
||||
} else {
|
||||
$cellBgColor = $this->eventColors['unavailable']['cell'];
|
||||
}
|
||||
$events[strtotime($cal_date_from)] = array(
|
||||
'is_notification' => 1,
|
||||
'title' => $this->l('icon'),
|
||||
'start' => date('Y-m-d H:i:s', strtotime($bookingParams['date_from'])),
|
||||
'start' => $cal_date_from,
|
||||
'display' => 'background',
|
||||
'backgroundColor' => $cellBgColor,
|
||||
'data' => $eventData
|
||||
);
|
||||
|
||||
@@ -571,24 +696,25 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$bookingParams['date_to'] = $searchDateTo;
|
||||
if ($bookingData = $objBookingDetail->getBookingData($bookingParams)) {
|
||||
if ($bookingData['stats']['num_avail']) {
|
||||
$eventColor = '#7EC77B';
|
||||
$title = sprintf($this->l('Available Rooms : %s'), $bookingData['stats']['num_avail']);
|
||||
$eventColor = $this->eventColors['available']['event'];
|
||||
$title = sprintf($this->l('%s Available Rooms'), $bookingData['stats']['num_avail']);
|
||||
} elseif ($bookingData['stats']['num_part_avai']) {
|
||||
$eventColor = '#FFC224';
|
||||
$title = sprintf($this->l('Partially Available Rooms : %s'), $bookingData['stats']['num_part_avai']);
|
||||
$eventColor = $this->eventColors['partially_available']['event'];
|
||||
$title = sprintf($this->l('%s Partially Available Rooms'), $bookingData['stats']['num_part_avai']);
|
||||
} elseif ($bookingData['stats']['num_booked'] == $bookingData['stats']['total_rooms'] && $bookingData['stats']['total_rooms'] != 0 && $bookingData['stats']['num_unavail'] == 0) {
|
||||
$eventColor = $this->eventColors['booked']['event'];
|
||||
$title = sprintf($this->l('%s Available Rooms'), $bookingData['stats']['num_avail']);
|
||||
} else {
|
||||
$eventColor = '#FF3838';
|
||||
$title = sprintf($this->l('Available Rooms : %s'), $bookingData['stats']['num_avail']);
|
||||
$eventColor = $this->eventColors['unavailable']['event'];
|
||||
$title = sprintf($this->l('%s Available Rooms'), $bookingData['stats']['num_avail']);
|
||||
}
|
||||
$bookingData['date_from_format'] = Tools::displayDate($searchDateFrom);
|
||||
$bookingData['date_to_format'] = Tools::displayDate($searchDateTo);
|
||||
$bookingData['eventColor'] = $eventColor;
|
||||
$events[] = array(
|
||||
'title' => $title,
|
||||
'start' => date('Y-m-d', strtotime($searchDateFrom)),
|
||||
'end' => date('Y-m-d', strtotime($searchDateTo)),
|
||||
'backgroundColor' => $eventColor,
|
||||
'color' => $eventColor,
|
||||
'textColor' => '#FFF',
|
||||
'data' => $bookingData
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,321 +0,0 @@
|
||||
<?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 AdminHotelFeaturesController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'htl_features';
|
||||
$this->className = 'HotelFeatures';
|
||||
$this->identifier = 'id';
|
||||
$this->toolbar_title = $this->l('Manage Hotel Features');
|
||||
|
||||
parent::__construct();
|
||||
$this->display = 'view';
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
parent::initToolbar();
|
||||
|
||||
$this->page_header_toolbar_btn['addfeatures'] = array(
|
||||
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||
'desc' => $this->l('Add new Features'),
|
||||
'imgclass' => 'new'
|
||||
);
|
||||
}
|
||||
|
||||
public function renderView()
|
||||
{
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
$featuresList = $objHotelFeatures->HotelAllCommonFeaturesArray();
|
||||
$this->context->smarty->assign('features_list', $featuresList);
|
||||
return parent::renderView();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
if (!$this->loadObject(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$smartyVars = array();
|
||||
//lang vars
|
||||
$languages = Language::getLanguages(false);
|
||||
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
|
||||
$currentLang = Language::getLanguage((int) $currentLangId);
|
||||
$smartyVars['languages'] = $languages;
|
||||
$smartyVars['currentLang'] = $currentLang;
|
||||
$smartyVars['ps_img_dir'] = _PS_IMG_.'l/';
|
||||
if ($id = $this->object->id) {
|
||||
$smartyVars['edit'] = 1;
|
||||
if (Validate::isLoadedObject($objFeatures = new HotelFeatures($id))) {
|
||||
$featureInfo = (array) $objFeatures;
|
||||
if ($childFeatures = $objFeatures->getChildFeaturesByParentFeatureId($id)) {
|
||||
$featureInfo['child_features'] = array();
|
||||
foreach ($childFeatures as $value) {
|
||||
$objChildFeatures = new HotelFeatures($value['id']);
|
||||
$featureInfo['child_features'][] = (array) $objChildFeatures;
|
||||
}
|
||||
}
|
||||
$smartyVars['featureInfo'] = $featureInfo;
|
||||
}
|
||||
}
|
||||
$this->context->smarty->assign($smartyVars);
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'currentLang' => $currentLang,
|
||||
'languages' => $languages,
|
||||
'img_dir_l' => _PS_IMG_.'l/',
|
||||
)
|
||||
);
|
||||
$this->fields_form = array(
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save')
|
||||
)
|
||||
);
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (!$this->loadObject(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitHtlFeatures') || Tools::isSubmit('submitHtlFeaturesAndStay')) {
|
||||
$conf = 3;
|
||||
if ($parentFeatureId = Tools::getValue('id')) {
|
||||
$conf = 4;
|
||||
}
|
||||
|
||||
$pos = Tools::getValue('position');
|
||||
|
||||
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
|
||||
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
|
||||
$languages = Language::getLanguages(false);
|
||||
|
||||
if (empty($pos) || !Validate::isUnsignedInt($pos)) {
|
||||
$this->errors[] = $this->l('Position is Invalid.');
|
||||
}
|
||||
|
||||
if (!trim(Tools::getValue('parent_ftr_name_'.$defaultLangId))) {
|
||||
$this->errors[] = $this->l('Parent feature name is required at least in ').
|
||||
$objDefaultLanguage['name'];
|
||||
} elseif (!Validate::isGenericName(Tools::getValue('parent_ftr_name_'.$defaultLangId))) {
|
||||
$this->errors[] = $this->l('Parent feature name is invalid.');
|
||||
} else {
|
||||
foreach ($languages as $lang) {
|
||||
// validate non required fields
|
||||
if (trim(Tools::getValue('parent_ftr_name_'.$lang['id_lang']))) {
|
||||
if (!Validate::isGenericName(Tools::getValue('parent_ftr_name_'.$lang['id_lang']))) {
|
||||
$this->errors[] = $this->l('Invalid parent feature name in ').$lang['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($childFeaturesDefLang = Tools::getValue('child_features_'.$defaultLangId)) {
|
||||
foreach ($childFeaturesDefLang as $kChild => $childftr) {
|
||||
if (!trim($childftr)) {
|
||||
$this->errors[] = $this->l('Child features name is required at least in ').
|
||||
$objDefaultLanguage['name'];
|
||||
} elseif (!Validate::isGenericName($childftr)) {
|
||||
$this->errors[] = $this->l('Child features name is invalid : ').Tools::safeOutput($childftr);
|
||||
} else {
|
||||
foreach ($languages as $lang) {
|
||||
if ($childFtrLang = Tools::getValue('child_features_'.$lang['id_lang'])) {
|
||||
if (!Validate::isGenericName($childFtrLang[$kChild])) {
|
||||
$this->errors[] = $this->l('Invalid child feature name in ').$lang['name'].
|
||||
' : '.Tools::safeOutput($childFtrLang[$kChild]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = $this->l('Please add atleast one Child features.');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
if (isset($parentFeatureId) && $parentFeatureId) {
|
||||
$objHotelFeatures = new HotelFeatures($parentFeatureId);
|
||||
$childFeatureIds = Tools::getValue('child_feature_id');
|
||||
foreach ($languages as $lang) {
|
||||
if (!trim(Tools::getValue('parent_ftr_name_'.$lang['id_lang']))) {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
|
||||
'parent_ftr_name_'.$defaultLangId
|
||||
);
|
||||
} else {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
|
||||
'parent_ftr_name_'.$lang['id_lang']
|
||||
);
|
||||
}
|
||||
}
|
||||
$objHotelFeatures->active = 1;
|
||||
$objHotelFeatures->position = $pos;
|
||||
$objHotelFeatures->parent_feature_id = 0;
|
||||
$objHotelFeatures->save();
|
||||
|
||||
if ($childFeaturesDefLang) {
|
||||
// get previous child features of the parent feature
|
||||
if ($childFeaturesInfo = $objHotelFeatures->getChildFeaturesByParentFeatureId(
|
||||
$parentFeatureId
|
||||
)) {
|
||||
$prevChildIds = array();
|
||||
foreach ($childFeaturesInfo as $row) {
|
||||
$prevChildIds[] = $row['id'];
|
||||
}
|
||||
}
|
||||
$usedFeatures = array();
|
||||
foreach ($childFeaturesDefLang as $key => $childftr) {
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
// We will only create new child features other wise edit the previous child feature
|
||||
if ($prevChildIds
|
||||
&& isset($childFeatureIds[$key])
|
||||
&& in_array($childFeatureIds[$key], $prevChildIds)
|
||||
) {
|
||||
$objHotelFeatures = new HotelFeatures($childFeatureIds[$key]);
|
||||
// enter child feature id in the used child feature
|
||||
$usedFeatures[] = $childFeatureIds[$key];
|
||||
}
|
||||
foreach ($languages as $lang) {
|
||||
if (!trim(Tools::getValue('child_features_'.$lang['id_lang'])[$key])) {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = $childftr;
|
||||
} else {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
|
||||
'child_features_'.$lang['id_lang']
|
||||
)[$key];
|
||||
}
|
||||
}
|
||||
$objHotelFeatures->active = 1;
|
||||
$objHotelFeatures->parent_feature_id = $parentFeatureId;
|
||||
$objHotelFeatures->save();
|
||||
}
|
||||
// delete the child features which are not used now
|
||||
$notUsedChilds = array_diff($prevChildIds, $usedFeatures);
|
||||
if ($notUsedChilds = array_diff($prevChildIds, $usedFeatures)) {
|
||||
foreach ($notUsedChilds as $value) {
|
||||
if ($value) {
|
||||
$objHotelFeatures = new HotelFeatures($value);
|
||||
$objHotelFeatures->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Tools::isSubmit('submitHtlFeaturesAndStay')) {
|
||||
Tools::redirectAdmin(
|
||||
self::$currentIndex.'&id='.(int) $parentFeatureId.'&update'.$this->table.
|
||||
'&conf='.$conf.'&token='.$this->token
|
||||
);
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf='.$conf.'&token='.$this->token);
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = $this->l('Some error has been occurred while saving features.');
|
||||
}
|
||||
} else {
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
foreach ($languages as $lang) {
|
||||
if (!trim(Tools::getValue('parent_ftr_name_'.$lang['id_lang']))) {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
|
||||
'parent_ftr_name_'.$defaultLangId
|
||||
);
|
||||
} else {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
|
||||
'parent_ftr_name_'.$lang['id_lang']
|
||||
);
|
||||
}
|
||||
}
|
||||
$objHotelFeatures->active = 1;
|
||||
$objHotelFeatures->position = $pos;
|
||||
$objHotelFeatures->parent_feature_id = 0;
|
||||
$objHotelFeatures->save();
|
||||
if ($parentFeatureId = $objHotelFeatures->id) {
|
||||
if ($childFeaturesDefLang) {
|
||||
foreach ($childFeaturesDefLang as $key => $childftr) {
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
foreach ($languages as $lang) {
|
||||
if (!trim(Tools::getValue('child_features_'.$lang['id_lang'])[$key])) {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = $childftr;
|
||||
} else {
|
||||
$objHotelFeatures->name[$lang['id_lang']] = Tools::getValue(
|
||||
'child_features_'.$lang['id_lang']
|
||||
)[$key];
|
||||
}
|
||||
}
|
||||
$objHotelFeatures->active = 1;
|
||||
$objHotelFeatures->parent_feature_id = $parentFeatureId;
|
||||
$objHotelFeatures->save();
|
||||
}
|
||||
if (Tools::isSubmit('submitHtlFeaturesAndStay')) {
|
||||
Tools::redirectAdmin(
|
||||
self::$currentIndex.'&id='.(int) $parentFeatureId.'&update'.$this->table.
|
||||
'&conf='.$conf.'&token='.$this->token
|
||||
);
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf='.$conf.'&token='.$this->token);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = $this->l('Some error has been occurred while saving features.');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($parentFeatureId) {
|
||||
$this->display = 'edit';
|
||||
} else {
|
||||
$this->display = 'add';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->errors) || $this->ajax) {
|
||||
parent::postProcess();
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessDeleteFeature()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
if ($this->tabAccess['delete']) {
|
||||
$idFeature = Tools::getValue('feature_id');
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
if ($objHotelFeatures->deleteHotelFeatures($idFeature)) {
|
||||
$response['status'] = true;
|
||||
} else {
|
||||
$response['msg'] = $this->l('Some error occurred while deleting feature. Please try again.');
|
||||
}
|
||||
} else {
|
||||
$response['msg'] = $this->l('You do not have the permission to delete this.');
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
|
||||
$this->addJs(_MODULE_DIR_.'hotelreservationsystem/views/js/HotelReservationAdmin.js');
|
||||
$this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css');
|
||||
}
|
||||
}
|
||||
@@ -350,7 +350,6 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
'isRefundCompleted' => $objOrderReturn->hasBeenCompleted(),
|
||||
'paymentMethods' => $paymentMethods,
|
||||
'name_controller' => Tools::getValue('controller'),
|
||||
'info_icon_path' => $this->context->link->getMediaLink(_MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icon-info.svg'),
|
||||
'expiry_date' => time() + (3600 * 24 * 365.25)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -26,8 +26,9 @@ require_once 'classes/HotelRoomType.php';
|
||||
require_once 'classes/HotelRoomInformation.php';
|
||||
require_once 'classes/HotelBranchInformation.php';
|
||||
require_once 'classes/HotelImage.php';
|
||||
require_once 'classes/HotelFeatures.php';
|
||||
require_once 'classes/HotelBranchFeatures.php';
|
||||
require_once 'classes/HotelAmenities.php';
|
||||
require_once 'classes/HotelBranchAmenities.php';
|
||||
require_once 'classes/HotelRoomTypeAmenities.php';
|
||||
require_once 'classes/HotelBookingDetail.php';
|
||||
require_once 'classes/HotelCartBookingData.php';
|
||||
require_once 'classes/HotelAdvancedPayment.php';
|
||||
@@ -47,8 +48,6 @@ require_once 'classes/HotelRoomTypeRestrictionDateRange.php';
|
||||
|
||||
require_once 'classes/HotelRoomDisableDates.php';
|
||||
require_once 'classes/HotelBranchRefundRules.php';
|
||||
require_once 'classes/HotelBedType.php';
|
||||
require_once 'classes/HotelRoomTypeBedType.php';
|
||||
require_once 'classes/HotelConnectedRoom.php';
|
||||
|
||||
// linked products
|
||||
|
||||
@@ -33,7 +33,7 @@ class HotelReservationSystem extends Module
|
||||
{
|
||||
$this->name = 'hotelreservationsystem';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '1.7.0';
|
||||
$this->version = '1.7.1';
|
||||
$this->author = 'Webkul';
|
||||
$this->need_instance = 0;
|
||||
$this->bootstrap = true;
|
||||
@@ -48,7 +48,7 @@ class HotelReservationSystem extends Module
|
||||
$resources = array(
|
||||
'hotels' => array('description' => 'Hotel Branch Information','class' => 'HotelBranchInformation'),
|
||||
'hotel_room_types' => array('description' => 'Hotel room types','class' => 'HotelRoomType'),
|
||||
'hotel_features' => array('description' => 'The hotel features','class' => 'HotelFeatures'),
|
||||
'hotel_amenities' => array('description' => 'The hotel amenities', 'class' => 'HotelAmenities'),
|
||||
'hotel_refund_rules' => array('description' => 'The hotel refund rules','class' => 'HotelOrderRefundRules'),
|
||||
'hotel_rooms' => array('description' => 'The hotel rooms','class' => 'HotelRoomInformation'),
|
||||
'feature_prices' => array('description' => 'Feature prices', 'class' => 'HotelRoomTypeFeaturePricing'),
|
||||
@@ -288,8 +288,8 @@ class HotelReservationSystem extends Module
|
||||
if (Tools::getValue('controller') == 'category') {
|
||||
if (($apiKey = Configuration::get('PS_API_KEY'))
|
||||
&& Configuration::get('WK_GOOGLE_ACTIVE_MAP')
|
||||
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
|
||||
) {
|
||||
$PS_MAP_ID = Configuration::get('PS_MAP_ID');
|
||||
$idCategory = Tools::getValue('id_category');
|
||||
$idHotel = HotelBranchInformation::getHotelIdByIdCategory($idCategory);
|
||||
$objHotel = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
@@ -473,12 +473,11 @@ class HotelReservationSystem extends Module
|
||||
$langTables = array(
|
||||
'htl_room_type_feature_pricing',
|
||||
'htl_branch_info',
|
||||
'htl_features',
|
||||
'htl_amenity',
|
||||
'htl_room_type_global_demand',
|
||||
'htl_room_type_global_demand_advance_option',
|
||||
'htl_order_refund_rules',
|
||||
'htl_settings_link',
|
||||
'htl_bed_type'
|
||||
'htl_settings_link'
|
||||
);
|
||||
//If Admin update new language when we do entry in module all lang tables.
|
||||
HotelHelper::updateLangTables($newIdLang, $langTables);
|
||||
@@ -520,12 +519,11 @@ 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('AdminHotelAmenities', 'Manage Amenities', 'AdminHotelReservationSystemManagement');
|
||||
$this->installTab('AdminOrderRefundRules', 'Manage Order Refund Rules', 'AdminHotelReservationSystemManagement');
|
||||
$this->installTab('AdminOrderRefundRequests', 'Manage Order Refund Requests', 'AdminHotelReservationSystemManagement');
|
||||
|
||||
$this->installTab('AdminHotelConfigurationSetting', 'General Settings', 'AdminHotelReservationSystemManagement');
|
||||
$this->installTab('AdminHotelBedTypes', 'Bed Types', 'AdminCatalog');
|
||||
// Controllers without tabs
|
||||
$this->installTab('AdminHotelGeneralSettings', 'Hotel General Configuration', 'AdminHotelConfigurationSetting', false);
|
||||
$this->installTab('AdminHotelFeaturePricesSettings', 'Advanced Price Rules', 'AdminHotelConfigurationSetting', false);
|
||||
@@ -575,8 +573,7 @@ class HotelReservationSystem extends Module
|
||||
|| !$this->callInstallTab()
|
||||
|| !$objHtlHelper->insertDefaultHotelEntries()
|
||||
|| !$objHtlHelper->createHotelRoomDefaultFeatures()
|
||||
|| !$objHtlHelper->createHotelDefaultBedTypes()
|
||||
|| !$objHtlHelper->insertHotelCommonFeatures()
|
||||
|| !$objHtlHelper->insertHotelCommonAmenities()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -249,10 +249,10 @@ p.room_cat_data
|
||||
|
||||
.indi_cont
|
||||
{
|
||||
margin: 10px 0px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.cart-table-thead
|
||||
{
|
||||
border-bottom: 1px solid #555!important;
|
||||
@@ -549,9 +549,6 @@ p.room_cat_data
|
||||
|
||||
|
||||
/* book now full calender */
|
||||
.fc .fc-daygrid-day.fc-day-today {
|
||||
background-color: unset;
|
||||
}
|
||||
.fc-daygrid-day-top {
|
||||
justify-content: space-between;}
|
||||
.fc a.fc-daygrid-day-number {
|
||||
@@ -563,7 +560,8 @@ p.room_cat_data
|
||||
color: #FFFFFF;
|
||||
line-height: 1;
|
||||
border-radius: 50%;
|
||||
padding: 5px 8px;
|
||||
padding: 4px;
|
||||
margin: 2px 2px 0px 0px;
|
||||
}
|
||||
.fc-daygrid-day-top .day-info {
|
||||
|
||||
@@ -577,6 +575,57 @@ p.room_cat_data
|
||||
.fc-today-button:disabled {
|
||||
display: none;
|
||||
}
|
||||
#fullcalendar .fc-daygrid-day-events {
|
||||
height: 0 ;
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
#fullcalendar .fc-event.search-result-event:not(.fc-event-start) .fc-event-main {
|
||||
visibility: hidden;
|
||||
}
|
||||
#fullcalendar .fc-event.search-result-event {
|
||||
background-color: #FFFFFF;
|
||||
border: none;
|
||||
border-left: 5px solid;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
margin: 1px 4px;
|
||||
padding: 2px 4px;
|
||||
line-height: 1.4;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
#fullcalendar .fc-event.search-result-event .fc-event-main {
|
||||
overflow: hidden;
|
||||
}
|
||||
#fullcalendar .fc-event.search-result-event .fc-event-title {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#fullcalendar .fc-event.search-result-event:not(.fc-event-start) {
|
||||
border-left: none;
|
||||
padding-left: 13px;
|
||||
margin-left: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
#fullcalendar .fc-event.search-result-event:not(.fc-event-end) {
|
||||
margin-right: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.calendar-legend {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
#room-reallocation-modal .modal-footer {
|
||||
padding: 15px 0px 0px 0px
|
||||
@@ -604,4 +653,4 @@ p.room_cat_data
|
||||
margin-top: 15px;}
|
||||
.error-border {
|
||||
outline: rgb(210, 124, 130) solid 1px;
|
||||
border-radius: 2px;}
|
||||
border-radius: 2px;}
|
||||
@@ -24,9 +24,9 @@ body.adminorderrefundrequests .ui-tooltip {
|
||||
padding: 10px;
|
||||
box-shadow: 0px 0px 15px 0px #00000026;
|
||||
}
|
||||
.ui-tooltip.price_info-tooltip span {
|
||||
.ui-tooltip.tooltip-popup span {
|
||||
margin-left: 15px;
|
||||
}
|
||||
.ui-tooltip.price_info-tooltip label {
|
||||
.ui-tooltip.tooltip-popup label {
|
||||
font-weight: 600;
|
||||
}
|
||||
48
modules/hotelreservationsystem/views/css/hotelAmenity.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ---- View ---- */
|
||||
.htl-amenity-category-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 46px;
|
||||
}
|
||||
.htl-amenity-category-heading .pull-right {
|
||||
float: none !important;
|
||||
margin-left: auto;
|
||||
order: 2;
|
||||
}
|
||||
.htl-amenity-logo-img {
|
||||
max-height: 32px;
|
||||
max-width: 32px;
|
||||
}
|
||||
|
||||
/* ---- Form ---- */
|
||||
.htl-amenity-preview {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.htl-amenity-preview img {
|
||||
max-width: 80px;
|
||||
max-height: 80px;
|
||||
border: 1px solid #ddd;
|
||||
padding: 4px;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |