Merge branch 'develop' into gli-1825

This commit is contained in:
vishalsingh.qlo325
2024-05-15 19:31:27 +05:30
97 changed files with 4373 additions and 3098 deletions

View File

@@ -191,6 +191,84 @@ body.display-modal
margin: 15px 0 0!important
height: 40px!important
//list header
.list_action_wrapper
margin-bottom: 15px
.list_availibility_container
position: relative
.dropdown-menu
right: 0
padding: 8px 12px
label
font-weight: 400
#selected_filter_container
background-color: #fff
padding: 8px 20px
border: solid 1px #d3d8db
border-radius: 5px 5px 0 0
font-size: 14px
min-height: 52px
margin-top: 15px
.selected_filters > span
font-size: 12px
padding: 6px 10px
display: inline-block
background: #F5F8F9
border: 1px solid #A0D0EB
border-radius: 3px
&+ span
margin-left: 12px
.filter_value
font-weight: 700
i
cursor: pointer
#list_filters_panel
margin-top: 15px
margin-bottom: 0
#selected_filter_container + #list_filters_panel
margin-top: 0
#selected_filter_container + div.panel
border-top: transparent
border-radius: 0 0 5px 5px
.list_filters
padding: 0 30px
display: grid
grid-template-columns: repeat(3, minmax(0, 1fr))
gap: 8px 40px
&>.row
display: flex
align-items: center
.date_range, .input_range
display: flex
justify-content: space-between
gap: 15px
.date_range .input-group:first-child
margin-bottom: 0
label
text-align: right
font-weight: 400
.actions
grid-column-start: 1
grid-column-end: 4
@media (max-width: $screen-desktop)
.list_filters
grid-template-columns: repeat(2, 1fr)
.actions
grid-column-start: 1
grid-column-end: 3
@media (max-width: $screen-tablet)
.list_filters
grid-template-columns: repeat(1, 1fr)
.actions
grid-column-start: 1
grid-column-end: 2
label
text-align: left
//help containers
#main.helpOpen
width: 70%

View File

@@ -1,35 +0,0 @@
<?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.
* 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
*/
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;

View File

@@ -1,36 +0,0 @@
{*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/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.
*
* 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/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/list/list_header.tpl"}
{block name=leadin}
{if isset($category_tree)}
<div class="bloc-leadin">
<div id="container_category_tree">
{$category_tree}
</div>
</div>
{/if}
{/block}

View File

@@ -65,446 +65,91 @@
</div>
{/if}
{/block}
{block name="tableFilter"}{/block}
{block name="override_form_extra"}
{if !$simple_header && $show_filters}
<script>
$(function() {
if ($("#list_filters_panel .datepicker").length > 0) {
$("#list_filters_panel .datepicker").datepicker({
prevText: '',
nextText: '',
altFormat: 'yy-mm-dd'
});
}
});
</script>
<div class="list_action_wrapper">
<div class="row">
<div class="col-xs-4 col-sm-3 col-md-2">
<div class="list_availibility_container">
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
<span>{l s='Available Fields'}
<i class="icon-caret-down pull-right"></i>
</button>
<ul id="optional-list-toggle" class="dropdown-menu">
{foreach $fields_optional as $key => $field}
<li>
<label>
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
{$field['title']}
</label>
</li>
{/foreach}
{assign var="fields_optional" value=array()}
</ul>
</div>
</div>
<div class="col-xs-3 col-xs-offset-5 col-sm-2 col-sm-offset-7 col-md-1 col-md-offset-9">
<div class="list_filter_container">
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
<i class="icon-sliders"></i>
<span>{l s='Filters'}
</button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{if $filters_has_value}
<div id="selected_filter_container">
{l s='Filters: '}
<span class="selected_filters">
{foreach $fields_display AS $key => $params}
{if (!isset($params.search) || $params.search) && $params.value != ''}
{if ($params.type == 'date' || $params.type == 'datetime' || $params.type == 'range') && $params.value|is_array}
{assign var="filter_value" value=''}
{foreach $params.value as $value}
{if (isset($value) && ($value !== '' || $value === 0))}
{if !(isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
{assign var="filter_value" value=$value}
{else}
{assign var="filter_value" value="`$filter_value` - `$value`"}
{/if}
{/if}
{/foreach}
{if (isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{elseif $params.type == 'select'}
{if isset($params.multiple) && $params.multiple}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}" data-multiple="{$params.multiple|intval}" data-operator="{$params.operator}">
{$params['title']|escape:'html':'UTF-8'}:
<span class="filter_value">
{foreach from=$params.value item=option name=foreachInfo}
{$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if}
{/foreach}
</span>
<i class="icon-times"></i>
</span>
{else}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|replace: '&nbsp;' : ''}</span>
<i class="icon-times"></i>
</span>
{/if}
{else}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{/if}
{/foreach}
</span>
</div>
{/if}
<div class="panel collapse" id="list_filters_panel">
<div class="row">
<div class="col-sm-12">
<div class="list_filters">
{foreach $fields_display AS $key => $params}
{if !isset($params.search) || $params.search}
<div class="row">
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
<div class="col-xs-9">
{if $params.type == 'range'}
<div class="input_range">
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
</div>
{elseif $params.type == 'bool'}
<select id="filter_input_{$key}" class="filter fixed-width-sm center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
<option value="">-</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select>
{elseif $params.type == 'date' || $params.type == 'datetime'}
<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($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($params.value.1)}{$params.value.1}{/if}">
<span class="input-group-addon">
<i class="icon-calendar"></i>
</span>
</div>
<script>
$(function() {
var dateStart = parseDate($("#{$params.id_date}_0").val());
var dateEnd = parseDate($("#{$params.id_date}_1").val());
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
if (dateStart !== null){
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
}
if (dateEnd !== null){
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
}
$('#local_{$params.id_date}_0').datepicker('option', {
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
onClose: function() {
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
let dateTo = $('#local_{$params.id_date}_1').val().trim();
if ((dateFrom && dateTo) && (dateFrom >= dateTo)) {
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
objDateToMin.setDate(objDateToMin.getDate());
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
}
},
});
$('#local_{$params.id_date}_1').datepicker('option', {
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
beforeShow: function() {
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
if (typeof dateFrom != 'undefined' && dateFrom != '') {
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
objDateToMin.setDate(objDateToMin.getDate());
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
}
},
});
});
</script>
</div>
{elseif $params.type == 'select'}
{if isset($params.multiple) && $params.multiple}
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{else}
{if isset($params.filter_key)}
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" {if !isset($params.remove_onchange) || !$params.remove_onchange}onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();"{/if} name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{/if}
{/if}
{else}
<input type="text" id="filter_input_{$key}" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
{/if}
</div>
</div>
{/if}
{/foreach}
{if $has_actions || $show_filters}
<div class="actions">
<hr>
{if $show_filters}
<span class="pull-right">
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
<i class="icon-search"></i> {l s='Search'}
</button>
{if $filters_has_value}
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
<i class="icon-eraser"></i> {l s='Reset'}
</button>
{/if}
</span>
{/if}
</div>
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#selected_filter_container .selected_filters span i').on('click', function() {
let form = $(this).closest('form');
let type = $(this).parent().data('filter_type');
$(this).parent().remove();
if (type == 'date' || type == 'datetime') {
$('#list_filters_panel').find('[name*="'+$(this).parent().data('filter_key')+'"]').val('');
} else if (type == 'range') {
$('#list_filters_panel').find('[name*="orderFilter_'+$(this).parent().data('filter_key')+'"]').val('');
} else if (type == 'select') {
$('#list_filters_panel').find('select[name*="orderFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
} else {
$('#list_filters_panel').find('input[name="orderFilter_'+$(this).parent().data('filter_key')+'"]').val('');
}
function updateRoomTypeFilter() {
let filterInputHotelName = $('#filter_input_hotel_name');
let filterInputRoomTypeName = $('#filter_input_room_type_name');
// set post data for empty multi-select filters
$(form).find('select[multiple]').each(function (i, selectElement) {
if ($(selectElement).find('option:selected').length == 0) {
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
}
});
let idHotel = parseInt($(filterInputHotelName).val() || '0');
form.submit();
});
$.ajax({
url: currentIndex + '&token=' + token,
data: {
ajax: true,
action: 'GetHotelRoomTypes',
id_hotel: idHotel,
},
type: 'POST',
dataType: 'JSON',
success: function(response) {
if (response.status) {
if (response.has_room_types) {
$(filterInputRoomTypeName).html(response.html_room_types);
} else {
$(filterInputRoomTypeName).find('option').not(':first').remove();
}
$('#form-order').submit(function () {
let form = $(this);
$(form).find('select[multiple]').each(function (i, selectElement) {
if ($(selectElement).val() == null) {
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
}
});
return true;
});
});
function updateRoomTypeFilter() {
let filterInputHotelName = $('#filter_input_hotel_name');
let filterInputRoomTypeName = $('#filter_input_room_type_name');
let idHotel = parseInt($(filterInputHotelName).val() || '0');
$.ajax({
url: currentIndex + '&token=' + token,
data: {
ajax: true,
action: 'GetHotelRoomTypes',
id_hotel: idHotel,
},
type: 'POST',
dataType: 'JSON',
success: function(response) {
if (response.status) {
if (response.has_room_types) {
$(filterInputRoomTypeName).html(response.html_room_types);
} else {
$(filterInputRoomTypeName).find('option').not(':first').remove();
// destroy current chosen and re-initialize
$(filterInputRoomTypeName).chosen('destroy');
$(filterInputRoomTypeName).chosen({
disable_search_threshold: 5,
search_contains: true,
});
}
},
});
}
// destroy current chosen and re-initialize
$(filterInputRoomTypeName).chosen('destroy');
$(filterInputRoomTypeName).chosen({
disable_search_threshold: 5,
search_contains: true,
});
}
},
});
}
function updateHotelRoomsFilter(useRoomType = true) {
let filterInputHotelName = $('#filter_input_hotel_name');
let filterInputRoomTypeName = $('#filter_input_room_type_name');
let filterInputRoomNumber = $('#filter_input_id_room_information');
function updateHotelRoomsFilter(useRoomType = true) {
let filterInputHotelName = $('#filter_input_hotel_name');
let filterInputRoomTypeName = $('#filter_input_room_type_name');
let filterInputRoomNumber = $('#filter_input_id_room_information');
let idHotel = parseInt($(filterInputHotelName).val() || '0');
let idProduct = parseInt($(filterInputRoomTypeName).val() || '0');
let idHotel = parseInt($(filterInputHotelName).val() || '0');
let idProduct = parseInt($(filterInputRoomTypeName).val() || '0');
$.ajax({
url: currentIndex + '&token=' + token,
data: {
ajax: true,
action: 'GetHotelRooms',
id_hotel: idHotel,
id_product: useRoomType ? idProduct : 0,
},
type: 'POST',
dataType: 'JSON',
success: function(response) {
if (response.status) {
if (response.has_hotel_rooms) {
$(filterInputRoomNumber).html(response.html_hotel_rooms);
} else {
$(filterInputRoomNumber).find('option').not(':first').remove();
}
$.ajax({
url: currentIndex + '&token=' + token,
data: {
ajax: true,
action: 'GetHotelRooms',
id_hotel: idHotel,
id_product: useRoomType ? idProduct : 0,
},
type: 'POST',
dataType: 'JSON',
success: function(response) {
if (response.status) {
if (response.has_hotel_rooms) {
$(filterInputRoomNumber).html(response.html_hotel_rooms);
} else {
$(filterInputRoomNumber).find('option').not(':first').remove();
// destroy current chosen and re-initialize
$(filterInputRoomNumber).chosen('destroy');
$(filterInputRoomNumber).chosen({
disable_search_threshold: 5,
search_contains: true,
});
}
},
});
}
// destroy current chosen and re-initialize
$(filterInputRoomNumber).chosen('destroy');
$(filterInputRoomNumber).chosen({
disable_search_threshold: 5,
search_contains: true,
});
}
},
// manage Hotel and Room type filter inputs
$(document).on('change', '#filter_input_hotel_name', function () {
updateRoomTypeFilter();
updateHotelRoomsFilter(false);
});
}
// manage Hotel and Room type filter inputs
$(document).on('change', '#filter_input_hotel_name', function () {
updateRoomTypeFilter();
updateHotelRoomsFilter(false);
});
$(document).on('change', '#filter_input_room_type_name', function () {
updateHotelRoomsFilter();
$(document).on('change', '#filter_input_room_type_name', function () {
updateHotelRoomsFilter();
});
});
</script>
<style>
.list_action_wrapper {
margin-bottom: 15px;
}
.list_availibility_container {
position: relative;}
.list_availibility_container .dropdown-menu {
right: 0;
padding: 8px 12px;}
.list_availibility_container .dropdown-menu label {
font-weight: 400;}
#selected_filter_container {
background-color: #fff;
padding: 8px 20px;
border: solid 1px #d3d8db;
border-radius: 5px 5px 0 0;
font-size: 14px;
min-height: 52px;
margin-top: 15px;}
#selected_filter_container .selected_filters > span {
font-size: 12px;
padding: 6px 10px;
display: inline-block;
background: #F5F8F9;
border: 1px solid #A0D0EB;
border-radius: 3px;}
#selected_filter_container .selected_filters > span + span {
margin-left: 12px;}
#selected_filter_container .selected_filters > span .filter_value {
font-weight: 700;
}
#selected_filter_container .selected_filters > span i {
cursor: pointer;}
#content.bootstrap #list_filters_panel{
margin-top: 15px;
margin-bottom: 0;
}
#content.bootstrap #selected_filter_container + #list_filters_panel {
margin-top: 0;
}
#content.bootstrap #selected_filter_container + div.panel {
border-top: transparent;
border-radius: 0 0 5px 5px;
}
.list_filters {
padding: 0 30px;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));;
gap: 8px 40px;}
.list_filters > .row {
display: flex;
align-items: center;}
.list_filters .date_range, .list_filters .input_range {
display: flex;
justify-content: space-between;
gap: 15px;}
.list_filters .date_range .input-group:first-child {
margin-bottom: 0;}
.list_filters label {
text-align: right;
font-weight: 400;}
.list_filters .actions {
grid-column-start: 1;
grid-column-end: 4;}
@media (max-width: 992px) {
.list_filters {
grid-template-columns: repeat(2, 1fr);}
.list_filters .actions {
grid-column-start: 1;
grid-column-end: 3;}
}
@media (max-width: 768px) {
.list_filters {
grid-template-columns: repeat(1, 1fr);}
.list_filters .actions {
grid-column-start: 1;
grid-column-end: 2;}
.list_filters label {
text-align: left;
}
}
</style>
{/if}
{/block}

View File

@@ -1,417 +0,0 @@
{*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/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.
*
* 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/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/list/list_header.tpl"}
{block name="tableFilter"}{/block}
{block name="override_form_extra"}
{if !$simple_header && $show_filters}
<script>
$(function() {
if ($("#list_filters_panel .datepicker").length > 0) {
$("#list_filters_panel .datepicker").datepicker({
prevText: '',
nextText: '',
altFormat: 'yy-mm-dd'
});
}
});
</script>
<div class="list_action_wrapper">
<div class="row">
<div class="col-xs-4 col-sm-3 col-md-2">
<div class="list_availibility_container">
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
<span>{l s='Available Fields'}
<i class="icon-caret-down pull-right"></i>
</button>
<ul id="optional-list-toggle" class="dropdown-menu">
{foreach $fields_optional as $key => $field}
<li>
<label>
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
{$field['title']}
</label>
</li>
{/foreach}
{assign var="fields_optional" value=array()}
</ul>
</div>
</div>
<div class="col-xs-3 col-xs-offset-5 col-sm-2 col-sm-offset-7 col-md-1 col-md-offset-9">
<div class="list_filter_container">
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
<i class="icon-sliders"></i>
<span>{l s='Filters'}
</button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{if $filters_has_value}
<div id="selected_filter_container">
{l s='Filters: '}
<span class="selected_filters">
{foreach $fields_display AS $key => $params}
{if (!isset($params.search) || $params.search) && $params.value != ''}
{if ($params.type == 'date' || $params.type == 'datetime') && $params.value|is_array}
{assign var="filter_value" value=''}
{foreach $params.value as $value}
{if ($value|is_string && !empty($value))}
{if empty($filter_value)}
{assign var="filter_value" value=$value}
{else}
{assign var="filter_value" value="`$filter_value` - `$value`"}
{/if}
{/if}
{/foreach}
{if !empty($filter_value)}
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{elseif $params.type == 'range' && $params.value|is_array}
{assign var="filter_value" value=''}
{foreach $params.value as $value}
{if (isset($value) && ($value !== '' || $value === 0))}
{if !(isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
{assign var="filter_value" value=$value}
{else}
{assign var="filter_value" value="`$filter_value` - `$value`"}
{/if}
{/if}
{/foreach}
{if (isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{elseif $params.type == 'select'}
{if isset($params.multiple) && $params.multiple}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}" data-multiple="{$params.multiple|intval}" data-operator="{$params.operator}">
{$params['title']|escape:'html':'UTF-8'}:
<span class="filter_value">
{foreach from=$params.value item=option name=foreachInfo}
{$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if}
{/foreach}
</span>
<i class="icon-times"></i>
</span>
{else}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|replace: '&nbsp;' : ''}</span>
<i class="icon-times"></i>
</span>
{/if}
{elseif $params.type == 'bool' && $key == 'advance_payment'}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{if $params['value'] == 1}{l s='Yes'}{elseif $params['value'] == 0}{l s='No'}{/if}</span>
<i class="icon-times"></i>
</span>
{else}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{/if}
{/foreach}
</span>
</div>
{/if}
<div class="panel collapse" id="list_filters_panel">
<div class="row">
<div class="col-sm-12">
<div class="list_filters">
{foreach $fields_display AS $key => $params}
{if !isset($params.search) || $params.search}
<div class="row">
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
<div class="col-xs-9">
{if $params.type == 'range'}
<div class="input_range">
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
</div>
{else if $params.type == 'bool'}
<select id="filter_input_{$key}" class="filter center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
<option value="">-</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select>
{elseif $params.type == 'date' || $params.type == 'datetime'}
<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($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($params.value.1)}{$params.value.1}{/if}">
<span class="input-group-addon">
<i class="icon-calendar"></i>
</span>
</div>
<script>
$(function() {
var dateStart = parseDate($("#{$params.id_date}_0").val());
var dateEnd = parseDate($("#{$params.id_date}_1").val());
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
if (dateStart !== null){
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
}
if (dateEnd !== null){
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
}
$('#local_{$params.id_date}_0').datepicker('option', {
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
beforeShow: function() {
let dateTo = $('#local_{$params.id_date}_1').val().trim();
if (typeof dateTo != 'undefined' && dateTo != '') {
let objDateToMax = $.datepicker.parseDate('yy-mm-dd', dateTo);
objDateToMax.setDate(objDateToMax.getDate() - 1);
$('#local_{$params.id_date}_0').datepicker('option', 'maxDate', objDateToMax);
}
},
onClose: function() {
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
let dateTo = $('#local_{$params.id_date}_1').val().trim();
if (dateFrom >= dateTo) {
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
objDateToMin.setDate(objDateToMin.getDate() + 1);
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
}
},
});
$('#local_{$params.id_date}_1').datepicker('option', {
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
beforeShow: function() {
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
if (typeof dateFrom != 'undefined' && dateFrom != '') {
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
objDateToMin.setDate(objDateToMin.getDate() + 1);
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
}
},
});
});
</script>
</div>
{elseif $params.type == 'select'}
{if isset($params.multiple) && $params.multiple}
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{else}
{if isset($params.filter_key)}
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" {if !isset($params.remove_onchange) || !$params.remove_onchange}onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();"{/if} name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{/if}
{/if}
{else}
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
{/if}
</div>
</div>
{/if}
{/foreach}
{if $has_actions || $show_filters}
<div class="actions">
<hr>
{if $show_filters}
<span class="pull-right">
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
<i class="icon-search"></i> {l s='Search'}
</button>
{if $filters_has_value}
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
<i class="icon-eraser"></i> {l s='Reset'}
</button>
{/if}
</span>
{/if}
</div>
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#selected_filter_container .selected_filters span i').on('click', function() {
let form = $(this).closest('form');
let type = $(this).parent().data('filter_type');
$(this).parent().remove();
if (type == 'date' || type == 'datetime') {
$('#list_filters_panel').find('[name*="'+$(this).parent().data('filter_key')+'"]').val('');
} else if (type == 'range') {
$('#list_filters_panel').find('[name*="productFilter_'+$(this).parent().data('filter_key')+'"]').val('');
} else if (type == 'select') {
$('#list_filters_panel').find('select[name*="productFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
} else if (type == 'bool' && $(this).parent().data('filter_key') == 'advance_payment') {
$('#list_filters_panel').find('select[name*="productFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
} else {
$('#list_filters_panel').find('input[name*="productFilter_'+$(this).parent().data('filter_key')+'"]').val('');
}
// set post data for empty multi-select filters
$(form).find('select[multiple]').each(function (i, selectElement) {
if ($(selectElement).find('option:selected').length == 0) {
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
}
});
form.submit();
});
$('#form-product').submit(function () {
let form = $(this);
$(form).find('select[multiple]').each(function (i, selectElement) {
if ($(selectElement).val() == null) {
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
}
});
return true;
});
});
</script>
<style>
.list_action_wrapper {
margin-bottom: 15px;
}
.list_availibility_container {
position: relative;}
.list_availibility_container .dropdown-menu {
right: 0;
padding: 8px 12px;}
.list_availibility_container .dropdown-menu label {
font-weight: 400;}
#selected_filter_container {
background-color: #fff;
padding: 8px 20px;
border: solid 1px #d3d8db;
border-radius: 5px 5px 0 0;
font-size: 14px;
min-height: 52px;
margin-top: 15px;}
#selected_filter_container .selected_filters > span {
font-size: 12px;
padding: 6px 10px;
display: inline-block;
background: #F5F8F9;
border: 1px solid #A0D0EB;
border-radius: 3px;}
#selected_filter_container .selected_filters > span + span {
margin-left: 12px;}
#selected_filter_container .selected_filters > span .filter_value {
font-weight: 700;
}
#selected_filter_container .selected_filters > span i {
cursor: pointer;}
#content.bootstrap #list_filters_panel{
margin-top: 15px;
margin-bottom: 0;
}
#content.bootstrap #selected_filter_container + #list_filters_panel {
margin-top: 0;
}
#content.bootstrap #selected_filter_container + div.panel {
border-top: transparent;
border-radius: 0 0 5px 5px;
}
.list_filters {
padding: 0 30px;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px 40px;}
.list_filters > .row {
display: flex;
align-items: center;}
.list_filters .date_range, .list_filters .input_range {
display: flex;
justify-content: space-between;
gap: 15px;}
.list_filters .date_range .input-group:first-child {
margin-bottom: 0;}
.list_filters label {
text-align: right;
font-weight: 400;}
.list_filters .actions {
grid-column-start: 1;
grid-column-end: 4;}
@media (max-width: 992px) {
.list_filters {
grid-template-columns: repeat(2, 1fr);}
.list_filters .actions {
grid-column-start: 1;
grid-column-end: 3;}
}
@media (max-width: 768px) {
.list_filters {
grid-template-columns: repeat(1, 1fr);}
.list_filters .actions {
grid-column-start: 1;
grid-column-end: 2;}
.list_filters label {
text-align: left;
}
}
</style>
{/if}
{/block}

View File

@@ -75,8 +75,8 @@
$('#submitFilter{$list_id}').val(1);
});
if ($("table .datepicker").length > 0) {
$("table .datepicker").datepicker({
if ($("form .datepicker").length > 0) {
$("form .datepicker").datepicker({
prevText: '',
nextText: '',
altFormat: 'yy-mm-dd'
@@ -121,7 +121,305 @@
<input type="hidden" name="page" value="{$page|intval}"/>
<input type="hidden" name="selected_pagination" value="{$selected_pagination|intval}"/>
{block name="override_form_extra"}{/block}
<div class="panel col-lg-12">
{if !$simple_header && $show_filters}
<script>
$(document).ready(function(){
$('#selected_filter_container .selected_filters span i').on('click', function() {
let form = $(this).closest('form');
let type = $(this).parent().data('filter_type');
$(this).parent().remove();
if (type == 'date' || type == 'datetime') {
$(form).find('#list_filters_panel [name*="'+$(this).parent().data('filter_key')+'"]').val('');
} else if (type == 'range') {
$(form).find('#list_filters_panel [name*="{$list_id}Filter_'+$(this).parent().data('filter_key')+'"]').val('');
} else if (type == 'select' || type == 'bool') {
$(form).find('#list_filters_panel select[name*="{$list_id}Filter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
} else {
$(form).find('#list_filters_panel input[name="{$list_id}Filter_'+$(this).parent().data('filter_key')+'"]').val('');
}
// set post data for empty multi-select filters
$(form).find('select[multiple]').each(function (i, selectElement) {
if ($(selectElement).find('option:selected').length == 0) {
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
}
});
form.submit();
});
{if $fields_optional|count}
toggleVisibleColumns($('#form-{$list_id}'));
{/if}
$('#optional-list-toggle').on('click', function(e) {
e.stopPropagation();
})
$('#form-{$list_id} input[name="list_fields_visibility"]').on('change', function(){
toggleVisibleColumns($('#form-{$list_id}'));
})
});
function toggleVisibleColumns(form) {
var list_fields_visibility = [];
$(form).find('input[name="list_fields_visibility"]:checked').each(function(i, field){
list_fields_visibility.push($(field).val());
});
$(form).find('table.table .field_optional').hide();
$(form).find('table.table .field_optional').each(function(i, val) {
if (list_fields_visibility.includes($(this).data('key'))) {
$(this).show();
}
});
updateListVisibility(list_fields_visibility)
}
function updateListVisibility(list_fields_visibility) {
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: '{$action}',
data: {
ajax: 1,
action: 'updateListVisivility',
list_fields_visibility: list_fields_visibility
},
cache: false,
dataType: 'json'
});
}
</script>
{/if}
{block name="updatelist"}
{if $new_list_header_design}
<div class="list_action_wrapper">
<div class="row">
{if $fields_optional|count}
<div class="col-xs-4 col-sm-3 col-md-2">
<div class="list_availibility_container">
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
<span>{l s='Available Fields'}
<i class="icon-caret-down pull-right"></i>
</button>
<ul id="optional-list-toggle" class="dropdown-menu">
{foreach $fields_optional as $key => $field}
<li>
<label>
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
{$field['title']}
</label>
</li>
{/foreach}
</ul>
</div>
</div>
{/if}
{if !$simple_header && $show_filters}
<div class="col-xs-3 col-xs-offset-{if $fields_optional|count}}5{else}9{/if} col-sm-2 col-sm-offset-{if $fields_optional|count}}7{else}10{/if} col-md-1 col-md-offset-{if $fields_optional|count}9{else}11{/if}">
<div class="list_filter_container">
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
<i class="icon-sliders"></i>
<span>{l s='Filters'}
</button>
</div>
</div>
{/if}
</div>
<div class="row">
<div class="col-sm-12">
{if $filters_has_value}
<div id="selected_filter_container">
{l s='Filters: '}
<span class="selected_filters">
{foreach $fields_display AS $key => $params}
{if (!isset($params.search) || $params.search) && $params.value != ''}
{if ($params.type == 'date' || $params.type == 'datetime' || $params.type == 'range') && $params.value|is_array}
{assign var="filter_value" value=''}
{foreach $params.value as $value}
{if (isset($value) && ($value !== '' || $value === 0))}
{if !(isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
{assign var="filter_value" value=$value}
{else}
{assign var="filter_value" value="`$filter_value` - `$value`"}
{/if}
{/if}
{/foreach}
{if (isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{elseif $params.type == 'select'}
{if isset($params.multiple) && $params.multiple}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}" data-multiple="{$params.multiple|intval}" data-operator="{$params.operator}">
{$params['title']|escape:'html':'UTF-8'}:
<span class="filter_value">
{foreach from=$params.value item=option name=foreachInfo}
{$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if}
{/foreach}
</span>
<i class="icon-times"></i>
</span>
{else}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|replace: '&nbsp;' : ''}</span>
<i class="icon-times"></i>
</span>
{/if}
{elseif $params.type == 'bool'}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{if $params['value'] == 1}{l s='Yes'}{else}{l s='No'}{/if}</span>
<i class="icon-times"></i>
</span>
{else}
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
<i class="icon-times"></i>
</span>
{/if}
{/if}
{/foreach}
</span>
</div>
{/if}
<div class="panel collapse" id="list_filters_panel">
<div class="row">
<div class="col-sm-12">
<div class="list_filters">
{foreach $fields_display AS $key => $params}
{if !isset($params.search) || $params.search}
<div class="row">
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
<div class="col-xs-9">
{if $params.type == 'range'}
<div class="input_range">
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
</div>
{elseif $params.type == 'bool'}
<select id="filter_input_{$key}" class="filter center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
<option value="">-</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select>
{elseif $params.type == 'date' || $params.type == 'datetime'}
<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($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($params.value.1)}{$params.value.1}{/if}">
<span class="input-group-addon">
<i class="icon-calendar"></i>
</span>
</div>
<script>
$(function() {
var dateStart = parseDate($("#{$params.id_date}_0").val());
var dateEnd = parseDate($("#{$params.id_date}_1").val());
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
if (dateStart !== null){
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
}
if (dateEnd !== null){
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
}
$('#local_{$params.id_date}_0').datepicker('option', {
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
onClose: function() {
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
let dateTo = $('#local_{$params.id_date}_1').val().trim();
if ((dateFrom && dateTo) && (dateFrom >= dateTo)) {
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
objDateToMin.setDate(objDateToMin.getDate());
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
}
},
});
$('#local_{$params.id_date}_1').datepicker('option', {
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
beforeShow: function() {
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
if (typeof dateFrom != 'undefined' && dateFrom != '') {
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
objDateToMin.setDate(objDateToMin.getDate());
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
}
},
});
});
</script>
</div>
{elseif $params.type == 'select'}
{if isset($params.multiple) && $params.multiple}
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{else}
{if isset($params.filter_key)}
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
{/foreach}
{/if}
</select>
{/if}
{/if}
{else}
<input type="text" id="filter_input_{$key}" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
{/if}
</div>
</div>
{/if}
{/foreach}
{if $has_actions || $show_filters}
<div class="actions">
<hr>
{if $show_filters}
<span class="pull-right">
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
<i class="icon-search"></i> {l s='Search'}
</button>
{if $filters_has_value}
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
<i class="icon-eraser"></i> {l s='Reset'}
</button>
{/if}
</span>
{/if}
</div>
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{/if}
{/block}
<div class="panel col-lg-12">
{block name="panel_heading"}
<div class="panel-heading">
{if isset($icon)}<i class="{$icon}"></i> {/if}{if is_array($title)}{$title|end}{else}{$title}{/if}
@@ -138,7 +436,7 @@
</a>
{/if}
{/foreach}
{if $fields_optional|count}
{if $fields_optional|count && !$new_list_header_design}
<a class="list-toolbar-btn dropdown-toggle" data-toggle="dropdown" data-target="#dropdown-option-toggle">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Toggle list'}" data-html="true" data-placement="top">
<i class="process-icon-cogs"></i>
@@ -154,46 +452,6 @@
{/foreach}
</ul>
{/if}
<script type="text/javascript">
$(document).ready(function(){
updateListVisibility();
$('#optional-list-toggle').on('click', function(e) {
e.stopPropagation();
})
$('input[name="list_fields_visibility"]').on('change', function(){
updateListVisibility();
})
});
function updateListVisibility() {
var list_fields_visibility = [];
$('input[name="list_fields_visibility"]:checked').each(function(i, field){
list_fields_visibility.push($(field).val());
});
const table = $('table.table.{$table}');
$(table).find('.field_optional').hide();
$(table).find('.field_optional').each(function(i, val) {
if (list_fields_visibility.includes($(this).data('key'))) {
$(this).show();
}
});
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: '{$action}',
data: {
ajax: 1,
action: 'updateListVisivility',
list_fields_visibility: list_fields_visibility
},
cache: false,
dataType: 'json',
success: function(data) {
}
});
}
</script>
<a class="list-toolbar-btn" href="javascript:location.reload();">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Refresh list'}" data-html="true" data-placement="top">
<i class="process-icon-refresh"></i>
@@ -364,7 +622,7 @@
</tr>
{/block}
{block name="tableFilter"}
{if !$simple_header && $show_filters}
{if !$simple_header && $show_filters && !$new_list_header_design}
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
{if $has_bulk_actions}
<th class="text-center">
@@ -455,7 +713,7 @@
</div>
{elseif $params.type == 'select'}
{if isset($params.filter_key)}
<select class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<select class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}

View File

@@ -2407,7 +2407,8 @@ class CartCore extends ObjectModel
$product['cart_quantity'] = $selectedProduct['quantity'];
$product['total'] = $selectedProduct['total_price_tax_excl'];
$product['total_wt'] = $selectedProduct['total_price_tax_incl'];
$product['price_wt'] = $selectedProduct['unit_price_tax_incl'];
$product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $product['cart_quantity'];
$product['price'] = $selectedProduct['total_price_tax_excl'] / $product['cart_quantity'];
$product['id_hotel'] = $selectedProduct['id_hotel'];
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $product;
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {

View File

@@ -3437,14 +3437,9 @@ exit;
$post_data .= '&method=listing&action=install-modules';
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
break;
case 'catalog-recommendation':
$protocols[] = 'http';
$post_data .= '&method=content&action=catalogRecommendation';
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
break;
case 'dashboard-recommendation':
$protocols[] = 'http';
$post_data .= '&method=content&action=dashboardRecommendation';
case 'recommendation':
$post_data .= '&method=recommendation&controller=';
$post_data .= (isset($params['controller']) ? $params['controller'] : Context::getContext()->controller->controller_name);
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
break;
case 'check-version':

View File

@@ -197,6 +197,9 @@ class AdminControllerCore extends Controller
/** @var string */
protected $_filterHaving;
/** @var string */
protected $_new_list_header_design = false;
/** @var array Temporary SQL table WHERE clause determined by filter fields */
protected $_tmpTableFilter = '';
@@ -406,6 +409,9 @@ class AdminControllerCore extends Controller
const QLO_SEARCH_TYPE_MODULE = 7;
const QLO_SEARCH_TYPE_HOTEL = 8;
/** @var string path for recomendation content */
const RECOMMENDATION_CONTENT_FILE_PATH = '';
public function __construct()
{
global $timer_start;
@@ -2511,6 +2517,7 @@ class AdminControllerCore extends Controller
}
$this->setHelperDisplay($helper);
$helper->_new_list_header_design = $this->_new_list_header_design;
$helper->_default_pagination = $this->_default_pagination;
$helper->_pagination = $this->_pagination;
$helper->tpl_vars = $this->getTemplateListVars();
@@ -3985,17 +3992,65 @@ class AdminControllerCore extends Controller
public function ajaxProcessGetRecommendationContent()
{
$response = array('success' => false);
if (isset($this->context->cookie->{$this->controller_name.'_closed'}) && $this->context->cookie->{$this->controller_name.'_closed'}) {
$response['success'] = true;
} else {
if (method_exists($this, 'getRecommendationContent')) {
if ($content = $this->getRecommendationContent()) {
$response['success'] = true;
$response['content'] = $content;
if ($this->context->controller->getRecommendationFilePath()) {
$response = $this->getRecommendationContent();
}
$this->context->cookie->write();
$this->ajaxDie(json_encode($response));
}
public function getRecommendationContent()
{
$content = array(
'success' => false,
'cache' => true,
'html' => ''
);
if ($recommendationContent = $this->updateRecommendationContent()) {
$content['cache'] = false;
}
if (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
$content['success'] = true;
if (!isset($this->context->cookie->{$this->controller_name.'_closed'}) || !$this->context->cookie->{$this->controller_name.'_closed'}) {
$content['html'] = file_get_contents(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
}
}
return $content;
}
public function updateRecommendationContent()
{
if (!Tools::isFresh($this->context->controller->getRecommendationFilePath(), _TIME_1_DAY_, false)) {
if ($recommendationContent = Tools::addonsRequest(
'recommendation',
array('controller' => $this->context->controller->controller_name)
)) {
$recommendationContent = json_decode($recommendationContent, true);
if (!isset($this->context->cookie->{$this->context->controller->controller_name.'_key'})) {
$this->context->cookie->{$this->context->controller->controller_name.'_key'} = '';
}
if ($this->context->cookie->{$this->context->controller->controller_name.'_key'} != $recommendationContent['key']) {
unset($this->context->cookie->{$this->context->controller->controller_name.'_closed'});
}
$this->context->cookie->{$this->context->controller->controller_name.'_key'} = $recommendationContent['key'];
if (isset($recommendationContent['success']) && $recommendationContent['success']) {
@file_put_contents(
_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath(),
$recommendationContent['html']
);
} elseif (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
unlink(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
}
return $recommendationContent;
} else {
if (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
unlink(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
}
}
}
$this->ajaxDie(json_encode($response));
return false;
}
public function ajaxProcessRecommendationClosed()
@@ -4005,6 +4060,11 @@ class AdminControllerCore extends Controller
$this->ajaxDie(json_encode($response));
}
public function getRecommendationFilePath()
{
return static::RECOMMENDATION_CONTENT_FILE_PATH;
}
/**
* Save list visible columns
*

View File

@@ -38,6 +38,8 @@ class HelperListCore extends Helper
/** @var array WHERE clause determined by filter fields */
protected $_filter;
public $_new_list_header_design = false;
/** @var array Number of results in list per page (used in select field) */
public $_pagination = array(20, 50, 100, 300, 1000);
@@ -742,6 +744,7 @@ class HelperListCore extends Helper
Context::getContext()->smarty->assign(array(
'page' => $page,
'simple_header' => $this->simple_header,
'new_list_header_design' => $this->_new_list_header_design,
'total_pages' => $total_pages,
'selected_pagination' => $selected_pagination,
'pagination' => $this->_pagination,

View File

@@ -449,7 +449,7 @@ class OrderHistoryCore extends ObjectModel
);
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $order->id_lang);
$objHotelBranchInformation = new HotelBranchInformation($idHotel);
$fields = array_merge(
$objHotelBranchInformation->getFields(),
$objHotelBranchInformation->getFieldsLang()[$order->id_lang],

View File

@@ -45,8 +45,8 @@ class AdminCartsControllerCore extends AdminController
$this->_select = 'CONCAT(c.`firstname`, \' \', c.`lastname`) `customer`, a.id_cart total,
TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) AS `time_diff`,
IFNULL(GROUP_CONCAT(o.`id_order`), 0) AS `ids_order`,
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(o.`id_order`)) AS filter_ids_order,
IFNULL(GROUP_CONCAT(DISTINCT o.`id_order`), 0) AS `ids_order`,
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(DISTINCT o.`id_order`)) AS filter_ids_order,
IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency)
@@ -333,6 +333,11 @@ class AdminCartsControllerCore extends AdminController
public function ajaxPreProcess()
{
if ($this->tabAccess['edit'] === '1') {
// prevent cart creation when kpi visibility or kpi view is updated.
// @todo: move the below cart creation process required function.
if (in_array(Tools::getValue('action'), array('changeKpiVisibility', 'saveKpiView'))) {
return;
}
$id_customer = (int)Tools::getValue('id_customer');
$customer = new Customer((int)$id_customer);
$this->context->customer = $customer;

View File

@@ -71,7 +71,14 @@ class AdminCustomersControllerCore extends AdminController
$titles_array[$gender->id_gender] = $gender->name;
}
$groups_array = array();
$groups = Group::getGroups(Context::getContext()->language->id);
foreach ($groups as $group) {
$groups_array[$group['id_group']] = $group['name'];
}
$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->_use_found_rows = false;
$this->fields_list = array(
'id_customer' => array(
@@ -107,9 +114,25 @@ class AdminCustomersControllerCore extends AdminController
}
$this->fields_list = array_merge($this->fields_list, array(
'default_group_name' => array(
'title' => $this->l('Default Group'),
'optional' => true,
'type' => 'select',
'list' => $groups_array,
'filter_key' => 'a!id_default_group',
),
'total_orders' => array(
'title' => $this->l('Number of orders'),
'optional' => true,
'visible_default' => true,
'havingFilter' => true,
'order_key' => 'total_orders'
),
'total_spent' => array(
'title' => $this->l('Sales'),
'type' => 'price',
'optional' => true,
'visible_default' => true,
'search' => false,
'havingFilter' => true,
'align' => 'text-right',
@@ -155,13 +178,19 @@ class AdminCustomersControllerCore extends AdminController
parent::__construct();
$this->_select = '
a.date_add, gl.name as title, (
a.date_add, gl.name as title, grl.name as default_group_name, (
SELECT SUM(total_paid_real / conversion_rate)
FROM '._DB_PREFIX_.'orders o
WHERE o.id_customer = a.id_customer
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
AND o.valid = 1
) as total_spent, (
SELECT COUNT(o.`id_order`)
FROM '._DB_PREFIX_.'orders o
WHERE o.id_customer = a.id_customer
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
AND o.valid = 1
) as total_orders, (
SELECT c.date_add FROM '._DB_PREFIX_.'guest g
LEFT JOIN '._DB_PREFIX_.'connections c ON c.id_guest = g.id_guest
WHERE g.id_customer = a.id_customer
@@ -326,6 +355,8 @@ class AdminCustomersControllerCore extends AdminController
);
}
$this->_new_list_header_design = true;
return parent::renderList();
}
@@ -601,7 +632,7 @@ class AdminCustomersControllerCore extends AdminController
}
$birthday = explode('-', $this->getFieldValue($obj, 'birthday'));
$this->fields_value = array(
'years' => Tools::getValue('years', $this->getFieldValue($obj, 'birthday') ? $birthday[0] : 0),
'months' => Tools::getValue('months', $this->getFieldValue($obj, 'birthday') ? $birthday[1] : 0),
@@ -1062,7 +1093,7 @@ class AdminCustomersControllerCore extends AdminController
$days = Tools::getValue('days');
$months = Tools::getValue('months');
$years = Tools::getValue('years');
if ($days || $months || $years) {
if (!$days) {
$this->errors[] = Tools::displayError("Please select a valid date of birthday");
@@ -1074,10 +1105,10 @@ class AdminCustomersControllerCore extends AdminController
$this->errors[] = Tools::displayError("Please select a valid month of birthday");
}
}
$customer = new Customer();
$this->errors = array_merge($this->errors, $customer->validateFieldsRequiredDatabase());
return parent::processSave();
}

View File

@@ -27,7 +27,7 @@
class AdminDashboardControllerCore extends AdminController
{
const DASHBOARD_RECOMMENDATION_CONTENT = '/cache/dashboard_recommendation.html';
const RECOMMENDATION_CONTENT_FILE_PATH = '/cache/dashboard_recommendation.html';
public function __construct()
{
@@ -502,15 +502,4 @@ class AdminDashboardControllerCore extends AdminController
die(json_encode($return));
}
public function getRecommendationContent()
{
if (!Tools::isFresh(self::DASHBOARD_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
@file_put_contents(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT, Tools::addonsRequest('dashboard-recommendation'));
}
if (file_exists(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT)) {
return Tools::file_get_contents(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT);
}
return false;
}
}

View File

@@ -175,7 +175,7 @@ class AdminLocalizationControllerCore extends AdminController
if (($iso_localization_pack = Tools::getValue('iso_localization_pack')) && Validate::isFileName($iso_localization_pack)) {
if (Tools::getValue('download_updated_pack') == '1' || defined('_PS_HOST_MODE_')) {
$pack = @Tools::file_get_contents(_PS_API_URL_.'/localization/'.$version.'/'.$iso_localization_pack.'.xml');
$pack = @Tools::file_get_contents(_QLO_API_URL_.'/localization/'.$version.'/'.$iso_localization_pack.'.xml');
} else {
$pack = false;
}
@@ -226,7 +226,7 @@ class AdminLocalizationControllerCore extends AdminController
$localizations_pack = false;
$this->tpl_option_vars['options_content'] = $this->renderOptions();
$xml_localization = Tools::simplexml_load_file(_PS_API_URL_.'/rss/localization.xml');
$xml_localization = Tools::simplexml_load_file(_QLO_API_URL_.'/xml/localization.xml');
if (!$xml_localization) {
$localization_file = _PS_ROOT_DIR_.'/localization/localization.xml';
if (file_exists($localization_file)) {
@@ -248,7 +248,7 @@ class AdminLocalizationControllerCore extends AdminController
}
if (!$localizations_pack) {
return $this->displayWarning($this->l('Cannot connect to '._PS_API_URL_));
return $this->displayWarning($this->l('Cannot connect to '._QLO_API_URL_));
}
// Add local localization .xml files to the list if they are not already there

View File

@@ -23,7 +23,7 @@ class AdminModulesCatalogControllerCore extends AdminController
public $modules;
const CATALOG_RECOMMENDATION_CONTENT = '/cache/catalog_recommendation.html';
const RECOMMENDATION_CONTENT_FILE_PATH = '/cache/catalog_recommendation.html';
const ELEMENT_TYPE_MODULE = 1;
const ELEMENT_TYPE_THEME = 2;
@@ -240,17 +240,6 @@ class AdminModulesCatalogControllerCore extends AdminController
);
}
public function getRecommendationContent()
{
if (!Tools::isFresh(self::CATALOG_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
@file_put_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT, Tools::addonsRequest('catalog-recommendation'));
}
if (file_exists(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT)) {
return Tools::file_get_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT);
}
return false;
}
public function sortList(&$list, $type)
{

View File

@@ -168,6 +168,15 @@ class AdminNormalProductsControllerCore extends AdminController
$join_category = true;
}
$priceAdditionType = array(
Product::PRICE_ADDITION_TYPE_WITH_ROOM => $this->l('Add price in room price'),
Product::PRICE_ADDITION_TYPE_INDEPENDENT => $this->l('Convenience Fee')
);
$priceCalculationMethod = array(
Product::PRICE_CALCULATION_METHOD_PER_BOOKING => $this->l('Add price once for the booking range'),
Product::PRICE_CALCULATION_METHOD_PER_DAY => $this->l('Add price for each day of booking')
);
$this->_join .= '
LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0
'.StockAvailable::addSqlShopRestriction(null, null, 'sav').') ';
@@ -188,7 +197,7 @@ class AdminNormalProductsControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` rsp ON (rsp.`id_product` = a.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'address` aa ON (aa.`id_hotel` = hb.`id`)';
$this->_select .= ' IF(a.`auto_add_to_cart`, "'.$this->l('Yes').'", "'.$this->l('No').'") as auto_added, IF(a.`auto_add_to_cart`, 1, 0) as badge_success, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
$this->_select .= ' IF(a.`auto_add_to_cart`, "'.$this->l('Yes').'", "'.$this->l('No').'") as auto_added, IF(a.`auto_add_to_cart`, 1, 0) as badge_success, IF(a.`show_at_front`, "'.$this->l('Yes').'", "'.$this->l('No').'") as show_at_front_txt, IF(a.`price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_PER_DAY.', "'.$this->l('Per Day').'", "'.$this->l('Per Booking').'") as price_calculation_method_txt, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
$this->_select .= ' COUNT(rsp.`id_product`) as products_associated, hrt.`adults`, hrt.`children`, hb.`id` as id_hotel, aa.`city`, hbl.`hotel_name`, ';
$this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, ';
$this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`';
@@ -227,14 +236,62 @@ class AdminNormalProductsControllerCore extends AdminController
'title' => $this->l('Associated Rooms types'),
'class' => 'fixed-width-sm',
'havingFilter' => true,
'optional' => true,
'visible_default' => true,
);
$this->fields_list['auto_added'] = array(
'title' => $this->l('Auto Added'),
'filter_key' => 'a!auto_add_to_cart',
'align' => 'text-center',
'type' => 'bool',
'optional' => true,
'visible_default' => true,
'badge_success' => true
);
$this->fields_list['show_at_front_txt'] = array(
'title' => $this->l('Show at Front'),
'filter_key' => 'a!show_at_front',
'align' => 'text-center',
'type' => 'bool',
'optional' => true,
);
$this->fields_list['available_for_order'] = array(
'displayed' => false,
'title' => $this->l('Available for order'),
'filter_key' => 'a!available_for_order',
'type' => 'bool',
);
$this->fields_list['price_addition_type'] = array(
'displayed' => false,
'title' => $this->l('Price display preference'),
'filter_key' => 'a!price_addition_type',
'type' => 'select',
'list' => $priceAdditionType,
);
$this->fields_list['price_calculation_method_txt'] = array(
'title' => $this->l('Price calculation method'),
'filter_key' => 'a!price_calculation_method',
'type' => 'select',
'list' => $priceCalculationMethod,
'visible_default' => true,
'optional' => true,
);
$this->servicesCategory = array();
$idServiceCategory = Configuration::get('PS_SERVICE_CATEGORY');
$this->objLocationsCategory = new Category($idServiceCategory, $this->context->language->id);
$nestedCategories = Category::getNestedCategories($idServiceCategory);
if ($nestedCategories) {
foreach ($nestedCategories[$idServiceCategory]['children'] as $childCategory) {
$this->buildCategoryOptions($childCategory);
}
}
$this->fields_list['name_category'] = array(
'title' => $this->l('Default Category'),
'type' => 'select',
'list' => $this->servicesCategory,
'filter_key' => 'a!id_category_default',
'optional' => true,
);
// $serviceProductType = array(
// Product::SERVICE_PRODUCT_WITH_ROOMTYPE => $this->l('Bought with room type'),
// Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE => $this->l('Bought without room type')
@@ -288,6 +345,18 @@ class AdminNormalProductsControllerCore extends AdminController
}
}
private function buildCategoryOptions($category)
{
$space = str_repeat('&nbsp;', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1));
$this->servicesCategory[$category['id_category']] = $space.$category['name'];
if (isset($category['children']) && count($category['children'])) {
foreach ($category['children'] as $childCategory) {
$this->buildCategoryOptions($childCategory);
}
}
}
public function getBuyingOption($service_product_type, $row)
{
if ($service_product_type == Product::SERVICE_PRODUCT_WITH_ROOMTYPE) {
@@ -2446,6 +2515,9 @@ class AdminNormalProductsControllerCore extends AdminController
$this->addRowAction('edit');
$this->addRowAction('duplicate');
$this->addRowAction('delete');
$this->_new_list_header_design = true;
return parent::renderList();
}
@@ -3007,7 +3079,7 @@ class AdminNormalProductsControllerCore extends AdminController
} else {
$address->id_country = (int)$address_infos['id_country'];
$address->id_state = (int)$address_infos['id_state'];
$address->zipcode = $address_infos['postcode'];
$address->postcode = $address_infos['postcode'];
}
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);
$tax_rates = array(

View File

@@ -183,7 +183,6 @@ class AdminOrdersControllerCore extends AdminController
'list' => $this->hotelsArray,
'optional' => true,
'class' => 'chosen',
'remove_onchange' => true,
'visible_default' => true
),
'room_type_name' => array(
@@ -193,7 +192,6 @@ class AdminOrdersControllerCore extends AdminController
'list' => $this->roomTypesArray,
'optional' => false,
'class' => 'chosen',
'remove_onchange' => true,
'visible_default' => false,
'displayed' => false,
),
@@ -204,7 +202,6 @@ class AdminOrdersControllerCore extends AdminController
'list' => $this->roomsArray,
'optional' => false,
'class' => 'chosen',
'remove_onchange' => true,
'visible_default' => false,
'displayed' => false,
),
@@ -299,7 +296,6 @@ class AdminOrdersControllerCore extends AdminController
'filter_key' => 'a!source',
'list' => $this->all_order_sources,
'optional' => true,
'remove_onchange' => true,
'visible_default' => true
),
'osname' => array(
@@ -1119,6 +1115,8 @@ class AdminOrdersControllerCore extends AdminController
$this->tpl_list_vars['title'] = $this->l('Orders');
$this->_new_list_header_design = true;
return parent::renderList();
}
@@ -5605,13 +5603,14 @@ class AdminOrdersControllerCore extends AdminController
$new_date_to = trim(date('Y-m-d', strtotime($product_informations['date_to'])));
$obj_booking_detail = new HotelBookingDetail();
$product_quantity = (int) $obj_booking_detail->getNumberOfDays($new_date_from, $new_date_to);
$id_room = Tools::getValue('id_room');
if (trim(Tools::getValue('id_hotel')) == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Hotel Id is mising.'),
)));
} elseif (trim(Tools::getValue('id_room')) == '') {
} elseif (trim($id_room) == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Room Id is missing.'),
@@ -5619,22 +5618,22 @@ class AdminOrdersControllerCore extends AdminController
} elseif (trim(date('Y-m-d', strtotime($product_informations['date_from']))) == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Please Enter Check In Date.'),
'error' => Tools::displayError('Please enter check-in date.'),
)));
} elseif (!Validate::isDateFormat($new_date_from)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Please Enter a Valid Check In Date.'),
'error' => Tools::displayError('Please enter a valid check-in date.'),
)));
} elseif ($new_date_to == '') {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Please Enter Check Out Date.'),
'error' => Tools::displayError('Please enter check-out date.'),
)));
} elseif (!Validate::isDateFormat($new_date_to)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Please Enter a valid Check out Date.'),
'error' => Tools::displayError('Please enter a valid check-out date.'),
)));
}
if ($this->context->employee->isSuperAdmin()) {
@@ -5647,14 +5646,14 @@ class AdminOrdersControllerCore extends AdminController
if ($new_date_from < $compareDate) {
die(json_encode(array(
'result' => false,
'error' => sprintf(Tools::displayError('Check In date should not be date before %s.'),$compareDate)
'error' => sprintf(Tools::displayError('Check-in date should not be date before %s.'),$compareDate)
)));
}
}
if ($new_date_to <= $new_date_from) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Check out Date Should be after Check In date.'),
'error' => Tools::displayError('Check-out date should be after check-in date.'),
)));
} elseif (!Validate::isUnsignedInt($product_quantity)) {
die(json_encode(array(
@@ -5667,7 +5666,20 @@ class AdminOrdersControllerCore extends AdminController
if ($rooms_booked) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('This Room Unavailable For Selected Duration.'),
'error' => Tools::displayError('This room is unavailable for selected duration.'),
)));
}
$objHotelRoomDisableDates = new HotelRoomDisableDates();
$params = array(
'id_room' => $id_room,
'date_from' => $new_date_from,
'date_to' => $new_date_to
);
if ($objHotelRoomDisableDates->checkIfRoomAlreadyDisabled($params)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('This room is disabled in selected duration.'),
)));
}
}

View File

@@ -259,7 +259,6 @@ class AdminProductsControllerCore extends AdminController
'list' => $this->hotelsArray,
'optional' => true,
'class' => 'chosen',
'remove_onchange' => true,
'visible_default' => true,
);
}
@@ -308,7 +307,6 @@ class AdminProductsControllerCore extends AdminController
'list' => array(1 => $this->l('Yes'), 0 => $this->l('No')),
'optional' => true,
'visible_default' => true,
'remove_onchange' => true,
'orderby' => false
);
@@ -412,7 +410,6 @@ class AdminProductsControllerCore extends AdminController
'type' => 'select',
'list' => $this->locationsAndHotels,
'filter_key' => 'a!id_category_default',
'remove_onchange' => true,
'displayed' => false,
);
@@ -1090,16 +1087,18 @@ class AdminProductsControllerCore extends AdminController
}
$id_product = Tools::getValue('id_product');
$id_adv_pmt = Tools::getValue('id_adv_pmt');
if ($id_adv_pmt) {
$obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt);
} else {
$obj_adv_pmt = new HotelAdvancedPayment();
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($id_product)) {
// To prevent duplication from two separate tabs
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
}
}
$adv_payment_active = Tools::getValue('adv_payment_active');
$obj_adv_pmt->id_product = $id_product;
$obj_adv_pmt->active = $adv_payment_active;
@@ -2550,6 +2549,8 @@ class AdminProductsControllerCore extends AdminController
$this->tpl_list_vars['title'] = $this->l('Room Types');
$this->_new_list_header_design = true;
return parent::renderList();
}
@@ -3177,12 +3178,8 @@ class AdminProductsControllerCore extends AdminController
$objRoomTypeServiceProductPrice->id_element = $idProduct;
$objRoomTypeServiceProductPrice->element_type = RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE;
}
$objRoomTypeServiceProductPrice->price = $price;
if ($idTaxRulesGroup) {
$objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup;
}
$objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup;
$objRoomTypeServiceProductPrice->save();
} else {
// create new association
@@ -3909,7 +3906,7 @@ class AdminProductsControllerCore extends AdminController
} else {
$address->id_country = (int)$address_infos['id_country'];
$address->id_state = (int)$address_infos['id_state'];
$address->zipcode = $address_infos['postcode'];
$address->postcode = $address_infos['postcode'];
}
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);

View File

@@ -237,18 +237,18 @@ class AdminSearchControllerCore extends AdminController
&& ($this->_list['products'] = Product::searchByName($this->context->language->id, $this->query))
) {
$objRoomType = new HotelRoomType();
$accessableHotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
$accessibleHotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
foreach ($this->_list['products'] as $key => $product) {
if ($roomInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product'])) {
if (!in_array($roomInfo['id_hotel'], $accessableHotels)) {
if (!in_array($roomInfo['id_hotel'], $accessibleHotels)) {
unset($this->_list['products'][$key]);
}
} else if ($associatedData = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product['id_product'])) {
$count = 0;
foreach ($associatedData['room_types'] as $id_room_type) {
$objRoomType = new HotelRoomType($id_room_type);
if (in_array($objRoomType->id_hotel, $accessableHotels)) {
if (in_array($objRoomType->id_hotel, $accessibleHotels)) {
$count += 1;
}
}
@@ -261,14 +261,14 @@ class AdminSearchControllerCore extends AdminController
}
}
if (isset($this->controllerAccess['AdminProducts'])
&& $this->controllerAccess['AdminProducts']
if (!isset($this->controllerAccess['AdminProducts'])
|| !$this->controllerAccess['AdminProducts']
) {
unset($this->_list['products']);
}
if (isset($this->controllerAccess['AdminNormalProducts'])
&& $this->controllerAccess['AdminNormalProducts']
if (!isset($this->controllerAccess['AdminNormalProducts'])
|| !$this->controllerAccess['AdminNormalProducts']
) {
unset($this->_list['service_products']);
}

View File

@@ -92,10 +92,11 @@ class GuestTrackingControllerCore extends FrontController
$customer = new Customer((int)$order->id_customer);
if (!Validate::isLoadedObject($customer)) {
$this->errors[] = Tools::displayError('Invalid customer');
} elseif (!Tools::getValue('password')) {
} elseif (!Tools::getValue('password')
|| !Validate::isPasswd(Tools::getValue('password')
)) {
$this->errors[] = Tools::displayError('Invalid password.');
} elseif (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) {
// @todo clarify error message
$this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.');
} else {
$this->context->smarty->assign('transformSuccess', true);
@@ -105,6 +106,63 @@ class GuestTrackingControllerCore extends FrontController
}
}
public function displayAjaxGetRoomTypeBookingDemands()
{
$response = array('extra_demands' => false);
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objHotelBookingDemands = new HotelBookingDemands();
$useTax = 0;
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
));
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$this->context->smarty->assign(array(
'objOrder' => new Order($idOrder),
));
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl');
}
$this->ajaxDie(json_encode($response));
}
/**
* Assign template vars related to page content
* @see FrontController::initContent()
@@ -113,60 +171,6 @@ class GuestTrackingControllerCore extends FrontController
{
parent::initContent();
$method = Tools::getValue('method');
if ($method == 'getRoomTypeBookingDemands') {
$response = array('reload' => false);
$extraDemandsTpl = '';
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objBookingDemand = new HotelBookingDemands();
$customer = new Customer((int)$order->id_customer);
$useTax = 0;
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(
array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
)
);
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
$this->ajaxDie(json_encode($response));
}
/* Handle brute force attacks */
if (count($this->errors)) {
sleep(1);
@@ -216,6 +220,7 @@ class GuestTrackingControllerCore extends FrontController
$order->id_order_state = (int)$order->getCurrentState();
$order->invoice = (OrderState::invoiceAvailable((int)$order->id_order_state) && $order->invoice_number);
$order->order_history = $order->getHistory((int)$this->context->language->id, false, true);
$order->overbooking_order_states = OrderState::getOverBookingStates();
$order->carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
$order->address_invoice = new Address((int)$order->id_address_invoice);
$order->address_delivery = new Address((int)$order->id_address_delivery);
@@ -554,6 +559,13 @@ class GuestTrackingControllerCore extends FrontController
$customerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail);
}
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
$objHotelBranchRefundRules = new HotelBranchRefundRules();
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
// set order specific values
$order->total_convenience_fee_ti = $total_convenience_fee_ti;
$order->total_convenience_fee_te = $total_convenience_fee_te;
@@ -564,11 +576,14 @@ class GuestTrackingControllerCore extends FrontController
$order->back_ord_msg = Configuration::get('WK_BO_MESSAGE');
$order->order_has_invoice = $order->hasInvoice();
$order->cart_htl_data = $cartHotelData;
$order->non_requested_rooms = $nonRequestedRooms;
$order->customerGuestDetail = $customerGuestDetail;
$order->obj_hotel_branch_information = $objHotelBranchInformation;
$order->hotel_address_info = $hotelAddressInfo;
$order->hotel_refund_rules = $hotelRefundRules;
//end
Hook::exec('actionOrderDetail', array('carrier' => $order->carrier, 'order' => $order));
}
}
@@ -596,9 +611,48 @@ class GuestTrackingControllerCore extends FrontController
)
);
$this->addJS(_THEME_JS_DIR_.'history.js');
$this->addCSS(_THEME_CSS_DIR_.'history.css');
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
if (Tools::getValue('ajax') != 'true') {
$this->addCSS(_THEME_CSS_DIR_.'order-detail.css');
$this->addJS(array(
_THEME_JS_DIR_.'order-detail.js',
_THEME_JS_DIR_.'tools.js',
));
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
// load Google Maps library if configured
if (!count($this->errors)) {
$ordersCollection = Order::getByReference(Tools::getValue('order_reference'));
if ($objOrder = $ordersCollection->getFirst()) {
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($objOrder->id)) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
if (Validate::isLoadedObject($objHotelBranchInformation)) {
if ($apiKey = Configuration::get('PS_API_KEY')) {
if (floatval($objHotelBranchInformation->latitude) != 0
&& floatval($objHotelBranchInformation->longitude) != 0
) {
Media::addJsDef(array(
'hotel_location' => array(
'latitude' => $objHotelBranchInformation->latitude,
'longitude' => $objHotelBranchInformation->longitude,
'map_input_text' => $objHotelBranchInformation->map_input_text,
),
'hotel_name' => $objHotelBranchInformation->hotel_name,
));
$this->addJS(
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places&language='.
$this->context->language->iso_code.'&region='.$this->context->country->iso_code
);
}
}
}
}
}
}
}
}
protected function processAddressFormat(Address $delivery, Address $invoice)

View File

@@ -36,15 +36,9 @@ class HistoryControllerCore extends FrontController
parent::setMedia();
$this->addCSS(array(
_THEME_CSS_DIR_.'history.css',
_THEME_CSS_DIR_.'addresses.css'
));
$this->addJS(array(
_THEME_JS_DIR_.'history.js',
_THEME_JS_DIR_.'tools.js' // retro compat themes 1.5
));
$this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme
$this->addJqueryPlugin(array('scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJqueryPlugin(array('footable', 'footable-sort'));
}
/**

View File

@@ -43,283 +43,19 @@ class OrderDetailControllerCore extends FrontController
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
}
/**
* Start forms process
* @see FrontController::postProcess()
*/
public function postProcess()
{
if (Tools::isSubmit('submitMessage')) {
$idOrder = (int)Tools::getValue('id_order');
$msgText = Tools::getValue('msgText');
if (!$idOrder || !Validate::isUnsignedId($idOrder)) {
$this->errors[] = Tools::displayError('The order is no longer valid.');
} elseif (empty($msgText)) {
$this->errors[] = Tools::displayError('The message cannot be blank.');
} elseif (!Validate::isMessage($msgText)) {
$this->errors[] = Tools::displayError('This message is invalid (HTML is not allowed).');
}
if (!count($this->errors)) {
$order = new Order($idOrder);
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
//check if a thread already exist
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($this->context->customer->email, $order->id);
$id_product = (int)Tools::getValue('id_product');
$cm = new CustomerMessage();
if (!$id_customer_thread) {
$ct = new CustomerThread();
$ct->id_contact = 0;
$ct->id_customer = (int)$order->id_customer;
$ct->id_shop = (int)$this->context->shop->id;
if ($id_product && $order->orderContainProduct($id_product)) {
$ct->id_product = $id_product;
}
$ct->id_order = (int)$order->id;
$ct->id_lang = (int)$this->context->language->id;
$ct->email = $this->context->customer->email;
$ct->status = 'open';
$ct->token = Tools::passwdGen(12);
$ct->add();
} else {
$ct = new CustomerThread((int)$id_customer_thread);
$ct->status = 'open';
$ct->update();
}
$cm->id_customer_thread = $ct->id;
$cm->message = $msgText;
$cm->ip_address = (int)ip2long($_SERVER['REMOTE_ADDR']);
$cm->add();
if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) {
$to = strval(Configuration::get('PS_SHOP_EMAIL'));
} else {
$to = new Contact((int)Configuration::get('PS_MAIL_EMAIL_MESSAGE'));
$to = strval($to->email);
}
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$customer = $this->context->customer;
$product = new Product($id_product);
$product_name = '';
if (Validate::isLoadedObject($product) && isset($product->name[(int)$this->context->language->id])) {
$product_name = $product->name[(int)$this->context->language->id];
}
if (Validate::isLoadedObject($customer)) {
Mail::Send(
$this->context->language->id,
'order_customer_comment',
Mail::l('Message from a customer'),
array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{email}' => $customer->email,
'{id_order}' => (int)$order->id,
'{order_name}' => $order->getUniqReference(),
'{message}' => Tools::nl2br($msgText),
'{product_name}' => $product_name
),
$to,
$toName,
strval(Configuration::get('PS_SHOP_EMAIL')),
$customer->firstname.' '.$customer->lastname,
null,
null,
_PS_MAIL_DIR_,
false,
null,
null,
$customer->email
);
}
if (Tools::getValue('ajax') != 'true') {
Tools::redirect('index.php?controller=order-detail&id_order='.(int)$idOrder);
}
$this->context->smarty->assign('message_confirmation', true);
} else {
$this->errors[] = Tools::displayError('Order not found');
}
}
}
}
public function displayAjax()
{
$this->display();
}
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
if (!($id_order = (int) Tools::getValue('id_order')) || !Validate::isUnsignedId($id_order)) {
$this->errors[] = Tools::displayError('Order ID required');
Tools::redirect($this->context->link->getPageLink('history'));
} else {
$order = new Order($id_order);
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
// Here handle request from the ajax on order details page i.e refund, additional qty etc
$method = Tools::getValue('method');
// extra demands popup ajax
if ($method == 'getRoomTypeBookingDemands') {
$response = array('reload' => false);
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objBookingDemand = new HotelBookingDemands();
$useTax = 0;
$customer = Context::getContext()->customer;
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(
array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
)
);
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$this->context->smarty->assign(
array(
'objOrder' => new Order($idOrder)
)
);
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
die(json_encode($response));
} elseif ($method == 'submitRefundRequest') { // room cancellation ajax
$hasError = 0;
if (!$refundReason = Tools::getValue('cancellation_reason')) {
$hasError = 1;
} elseif (!Validate::isCleanHtml($refundReason)) {
$hasError = 1;
}
if ($bookingRefunds = Tools::getValue('bookings_to_refund')) {
if (!count($bookingRefunds = json_decode($bookingRefunds, true))) {
$hasError = 1;
} else {
foreach ($bookingRefunds as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
if ($objHotelBookingDetail->id_customer != $order->id_customer
|| OrderReturn::getOrdersReturnDetail($order->id, 0, $idHtlBooking)
) {
$hasError = 1;
break;
}
}
}
} else {
$hasError = 1;
}
$res = true;
if (!$hasError) {
$hasCancelled = 0;
// if amount paid is > 0 then create refund request else cancel the booking directly
if ($order->getTotalPaid() > 0) {
$objOrderReturn = new OrderReturn();
$objOrderReturn->id_customer = $order->id_customer;
$objOrderReturn->id_order = $order->id;
$objOrderReturn->state = 0;
$objOrderReturn->by_admin = 0;
$objOrderReturn->question = $refundReason;
$objOrderReturn->save();
if ($objOrderReturn->id) {
foreach ($bookingRefunds as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
$numDays = $objHtlBooking->getNumberOfDays(
$objHtlBooking->date_from,
$objHtlBooking->date_to
);
$objOrderReturnDetail = new OrderReturnDetail();
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
$objOrderReturnDetail->id_order_detail = $objHtlBooking->id_order_detail;
$objOrderReturnDetail->product_quantity = $numDays;
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
$objOrderReturnDetail->save();
}
}
// Emails to customer, admin on refund request state change
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
} else {
$hasCancelled = 1;
// cancel the booking directly
foreach ($bookingRefunds as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
if (!$objHtlBooking->processRefundInBookingTables()) {
die(json_encode(array('status' => 0)));
} else {
// set the message for the cancellation
$message = Tools::displayError('1 Room from').' '.', '.$objHtlBooking->room_type_name.' '.Tools::displayError('has been cancelled by the hotel.');
$message .= PHP_EOL.Tools::displayError('Reason').': '.$refundReason;
$objHtlBooking->setBookingCancellationMessage($refundReason);
}
}
// if all bookings are getting cancelled then cancel the order also
if ($order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG)) {
$objOrderHistory = new OrderHistory();
$objOrderHistory->id_order = (int)$order->id;
$idOrderState = Configuration::get('PS_OS_CANCELED');
$useExistingPayment = false;
if (!$order->hasInvoice()) {
$useExistingPayment = true;
}
$objOrderHistory->changeIdOrderState($idOrderState, $order, $useExistingPayment);
$objOrderHistory->addWithemail();
}
}
die(json_encode(array('status' => 1, 'has_cancelled' => $hasCancelled)));
}
die(json_encode(array('status' => 0)));
}
} else {
die(json_encode(array('status' => 0)));
}
// END ajax request handle
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
$id_order_state = (int)$order->getCurrentState();
$carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
@@ -376,9 +112,9 @@ class OrderDetailControllerCore extends FrontController
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'home_default');
} else {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'home_default');
}
if (isset($customer->id)) {
@@ -459,9 +195,18 @@ class OrderDetailControllerCore extends FrontController
}
}
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['id_htl_booking'] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['id_room'] = $data_v['id_room'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['children'] = $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['child_ages'] = $data_v['child_ages'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['is_cancelled'] = $data_v['is_cancelled'];
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_rooms'][] = $data_v['id_room'];
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$id_order,
@@ -637,6 +382,13 @@ class OrderDetailControllerCore extends FrontController
$objHotelBookingDetail = new HotelBookingDetail();
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
$objHotelBranchRefundRules = new HotelBranchRefundRules();
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
$this->context->smarty->assign(
array(
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),
@@ -651,6 +403,9 @@ class OrderDetailControllerCore extends FrontController
'order_has_invoice' => $order->hasInvoice(),
'cart_htl_data' => $cartHotelData,
'cart_service_products' => $cartServiceProducts,
'obj_hotel_branch_information' => $objHotelBranchInformation,
'hotel_address_info' => $hotelAddressInfo,
'hotel_refund_rules' => $hotelRefundRules,
)
);
// }
@@ -660,6 +415,7 @@ class OrderDetailControllerCore extends FrontController
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1)) {
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
}
$this->context->smarty->assign(
array(
'hasOrderPaid' => $order->hasBeenPaid(),
@@ -710,7 +466,7 @@ class OrderDetailControllerCore extends FrontController
unset($carrier, $addressInvoice, $addressDelivery);
} else {
$this->errors[] = Tools::displayError('This order cannot be found.');
$this->errors[] = Tools::displayError('The booking cannot be found.');
}
unset($order);
}
@@ -718,12 +474,335 @@ class OrderDetailControllerCore extends FrontController
$this->setTemplate(_PS_THEME_DIR_.'order-detail.tpl');
}
public function displayAjaxGetRoomTypeBookingDemands()
{
$response = array('extra_demands' => false);
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objHotelBookingDemands = new HotelBookingDemands();
$useTax = 0;
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
));
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$this->context->smarty->assign(array(
'objOrder' => new Order($idOrder),
));
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl');
}
$this->ajaxDie(json_encode($response));
}
public function displayAjaxSubmitRefundRequest()
{
$response = array('has_errors' => false);
$idOrder = Tools::getValue('id_order');
$idsHtlBooking = Tools::getValue('bookings_to_refund');
$cancellationReason = trim(Tools::getValue('cancellation_reason'));
if (!$idsHtlBooking) {
$this->errors[] = Tools::displayError('Please select at least on room for cancellation.');
}
if (!$cancellationReason) {
$this->errors[] = Tools::displayError('Please mention a reason for cancellation.');
} elseif ($cancellationReason && !Validate::isCleanHtml($cancellationReason)) {
$this->errors[] = Tools::displayError('Reason of cancellation is invalid. Please enter valid data.');
}
if (!count($this->errors)) {
$objOrder = new Order($idOrder);
if (!(Validate::isLoadedObject($objOrder) && $objOrder->id_customer == $this->context->customer->id)) {
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
} elseif ($idsHtlBooking) {
foreach ($idsHtlBooking as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
if ($objHotelBookingDetail->id_customer != $objOrder->id_customer) {
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
break;
}
if (OrderReturn::getOrdersReturnDetail($objOrder->id, 0, $idHtlBooking)) {
$this->errors[] = Tools::displayError('Some selected rooms have already been requested for cancellation.');
break;
}
}
}
if (!count($this->errors)) {
if ((int) $objOrder->total_paid_real == 0) {
foreach ($idsHtlBooking as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
$objHtlBooking->save();
}
}
// if amount paid is > 0 then create refund request else cancel the booking directly
if ($objOrder->getTotalPaid() > 0) {
$objOrderReturn = new OrderReturn();
$objOrderReturn->id_customer = $objOrder->id_customer;
$objOrderReturn->id_order = $objOrder->id;
$objOrderReturn->state = 0;
$objOrderReturn->by_admin = 0;
$objOrderReturn->question = $cancellationReason;
$objOrderReturn->save();
if ($objOrderReturn->id) {
foreach ($idsHtlBooking as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
$numDays = $objHotelBookingDetail->getNumberOfDays(
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
);
$objOrderReturnDetail = new OrderReturnDetail();
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
$objOrderReturnDetail->id_order_detail = $objHotelBookingDetail->id_order_detail;
$objOrderReturnDetail->product_quantity = $numDays;
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
$objOrderReturnDetail->save();
}
}
// Emails to customer, superadmin and employees on refund request state change
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
} else {
// cancel the booking directly
foreach ($idsHtlBooking as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
if (!$objHotelBookingDetail->processRefundInBookingTables()) {
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
} else {
// set the message for the cancellation
$message = Tools::displayError(sprintf(
"1 room from %s has been cancelled by hotel.\nReason: %s",
$objHotelBookingDetail->room_type_name,
$cancellationReason
));
$objHotelBookingDetail->setBookingCancellationMessage($message);
}
}
// if all bookings are getting cancelled then cancel the order also
if ($objOrder->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG)) {
$objOrderHistory = new OrderHistory();
$objOrderHistory->id_order = (int)$objOrder->id;
$idOrderState = Configuration::get('PS_OS_CANCELED');
$useExistingPayment = false;
if (!$objOrder->hasInvoice()) {
$useExistingPayment = true;
}
$objOrderHistory->changeIdOrderState($idOrderState, $objOrder, $useExistingPayment);
$objOrderHistory->addWithemail();
$response['order_cancelled'] = true;
}
}
}
}
if (count($this->errors)) {
$this->context->smarty->assign(array('errors' => $this->errors));
$response['errors_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'errors.tpl');
}
$response['has_errors'] = (bool) count($this->errors);
$this->ajaxDie(json_encode($response));
}
public function displayAjaxSubmitMessage()
{
$response = array('status' => false);
$idOrder = (int) Tools::getValue('id_order');
$msgText = Tools::getValue('msgText');
if (!$idOrder || !Validate::isUnsignedId($idOrder)) {
$this->errors[] = Tools::displayError('The order is no longer valid.');
} elseif (empty($msgText)) {
$this->errors[] = Tools::displayError('The message cannot be blank.');
} elseif (!Validate::isMessage($msgText)) {
$this->errors[] = Tools::displayError('This message is invalid (HTML is not allowed).');
}
if (!count($this->errors)) {
$order = new Order($idOrder);
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
//check if a thread already exist
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($this->context->customer->email, $order->id);
$id_product = (int)Tools::getValue('id_product');
$cm = new CustomerMessage();
if (!$id_customer_thread) {
$ct = new CustomerThread();
$ct->id_contact = 0;
$ct->id_customer = (int)$order->id_customer;
$ct->id_shop = (int)$this->context->shop->id;
if ($id_product && $order->orderContainProduct($id_product)) {
$ct->id_product = $id_product;
}
$ct->id_order = (int)$order->id;
$ct->id_lang = (int)$this->context->language->id;
$ct->email = $this->context->customer->email;
$ct->status = 'open';
$ct->token = Tools::passwdGen(12);
$ct->add();
} else {
$ct = new CustomerThread((int)$id_customer_thread);
$ct->status = 'open';
$ct->update();
}
$cm->id_customer_thread = $ct->id;
$cm->message = $msgText;
$cm->ip_address = (int)ip2long($_SERVER['REMOTE_ADDR']);
$cm->add();
if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) {
$to = strval(Configuration::get('PS_SHOP_EMAIL'));
} else {
$to = new Contact((int)Configuration::get('PS_MAIL_EMAIL_MESSAGE'));
$to = strval($to->email);
}
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$customer = $this->context->customer;
$product = new Product($id_product);
$product_name = '';
if (Validate::isLoadedObject($product) && isset($product->name[(int)$this->context->language->id])) {
$product_name = $product->name[(int)$this->context->language->id];
}
if (Validate::isLoadedObject($customer)) {
Mail::Send(
$this->context->language->id,
'order_customer_comment',
Mail::l('Message from a customer'),
array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{email}' => $customer->email,
'{id_order}' => (int)$order->id,
'{order_name}' => $order->getUniqReference(),
'{message}' => Tools::nl2br($msgText),
'{product_name}' => $product_name
),
$to,
$toName,
strval(Configuration::get('PS_SHOP_EMAIL')),
$customer->firstname.' '.$customer->lastname,
null,
null,
_PS_MAIL_DIR_,
false,
null,
null,
$customer->email
);
}
// send message html in json
$response['status'] = true;
$message = CustomerMessage::getMessagesByOrderId($order->id, false)[0];
$this->context->smarty->assign(array('message' => $message));
$response['message_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-message.tpl');
} else {
$this->errors[] = Tools::displayError('Order not found');
}
}
if (count($this->errors)) {
$this->context->smarty->assign(array('errors' => $this->errors));
$response['errors_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'errors.tpl');
}
$response['has_errors'] = (bool) count($this->errors);
$this->ajaxDie(json_encode($response));
}
public function setMedia()
{
if (Tools::getValue('ajax') != 'true') {
parent::setMedia();
$this->addCSS(_THEME_CSS_DIR_.'history.css');
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
$this->addCSS(_THEME_CSS_DIR_.'order-detail.css');
$this->addJS(array(
_THEME_JS_DIR_.'order-detail.js',
_THEME_JS_DIR_.'tools.js',
));
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
// load Google Maps library if configured
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder(Tools::getValue('id_order'))) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
if (Validate::isLoadedObject($objHotelBranchInformation)) {
if ($apiKey = Configuration::get('PS_API_KEY')) {
if (floatval($objHotelBranchInformation->latitude) != 0
&& floatval($objHotelBranchInformation->longitude) != 0
) {
Media::addJsDef(array(
'hotel_location' => array(
'latitude' => $objHotelBranchInformation->latitude,
'longitude' => $objHotelBranchInformation->longitude,
'map_input_text' => $objHotelBranchInformation->map_input_text,
),
'hotel_name' => $objHotelBranchInformation->hotel_name,
));
$this->addJS(
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places&language='.
$this->context->language->iso_code.'&region='.$this->context->country->iso_code
);
}
}
}
}
}
}
}

View File

@@ -173,7 +173,9 @@ class OrderOpcControllerCore extends ParentOrderController
if (!count($this->errors)) {
$customer = new Customer($this->context->customer->id);
if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
if (!$customer->isGuest()) {
$this->errors[] = Tools::displayError('This account is already registered as a customer.');
} else if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
$this->context->updateCustomer($customer);
} else {
$this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.');

View File

@@ -68,6 +68,10 @@
<page>history</page>
<configurable>1</configurable>
</meta>
<meta id="order-detail">
<page>order-detail</page>
<configurable>1</configurable>
</meta>
<meta id="identity">
<page>identity</page>
<configurable>1</configurable>

View File

@@ -15,31 +15,32 @@
<theme_meta id="theme_meta_6" id_theme="1" id_meta="6" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_7" id_theme="1" id_meta="7" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_8" id_theme="1" id_meta="8" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_10" id_theme="1" id_meta="9" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_11" id_theme="1" id_meta="10" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_12" id_theme="1" id_meta="11" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_13" id_theme="1" id_meta="12" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_14" id_theme="1" id_meta="13" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_15" id_theme="1" id_meta="14" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_16" id_theme="1" id_meta="15" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_17" id_theme="1" id_meta="16" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_18" id_theme="1" id_meta="17" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_19" id_theme="1" id_meta="18" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_20" id_theme="1" id_meta="19" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_21" id_theme="1" id_meta="20" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_22" id_theme="1" id_meta="21" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_23" id_theme="1" id_meta="22" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_24" id_theme="1" id_meta="23" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_25" id_theme="1" id_meta="24" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_26" id_theme="1" id_meta="25" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_27" id_theme="1" id_meta="26" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_28" id_theme="1" id_meta="28" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_29" id_theme="1" id_meta="29" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_30" id_theme="1" id_meta="27" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_31" id_theme="1" id_meta="30" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_32" id_theme="1" id_meta="31" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_33" id_theme="1" id_meta="32" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_34" id_theme="1" id_meta="33" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_35" id_theme="1" id_meta="34" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_9" id_theme="1" id_meta="9" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_10" id_theme="1" id_meta="10" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_11" id_theme="1" id_meta="11" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_12" id_theme="1" id_meta="12" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_13" id_theme="1" id_meta="13" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_14" id_theme="1" id_meta="14" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_15" id_theme="1" id_meta="15" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_16" id_theme="1" id_meta="16" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_17" id_theme="1" id_meta="17" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_18" id_theme="1" id_meta="18" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_19" id_theme="1" id_meta="19" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_20" id_theme="1" id_meta="20" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_21" id_theme="1" id_meta="21" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_22" id_theme="1" id_meta="22" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_23" id_theme="1" id_meta="23" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_24" id_theme="1" id_meta="24" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_25" id_theme="1" id_meta="25" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_26" id_theme="1" id_meta="26" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_27" id_theme="1" id_meta="27" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_28" id_theme="1" id_meta="28" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_29" id_theme="1" id_meta="29" left_column="1" right_column="0"/>
<theme_meta id="theme_meta_30" id_theme="1" id_meta="30" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_31" id_theme="1" id_meta="31" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_32" id_theme="1" id_meta="32" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_33" id_theme="1" id_meta="33" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_34" id_theme="1" id_meta="34" left_column="0" right_column="0"/>
<theme_meta id="theme_meta_35" id_theme="1" id_meta="35" left_column="0" right_column="0"/>
</entities>
</entity_theme_meta>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Детайл за резервацията</title>
<description/>
<keywords/>
<url_rewrite>detal-za-rezervaciata</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>বুকিং বিবরণ</title>
<description/>
<keywords/>
<url_rewrite>booking-biborn</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>পরিচয় </title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>histórico-de-pedidos</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Devezh bemdez</title>
<description/>
<keywords/>
<url_rewrite>devezh-bemdez</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Identificação</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>historie-objednavek</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detail rezervace</title>
<description/>
<keywords/>
<url_rewrite>detail-rezervace</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>bestellungsverlauf</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Buchungsdetails</title>
<description/>
<keywords/>
<url_rewrite>buchungsdetails</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Kennung</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Booking details</title>
<description/>
<keywords/>
<url_rewrite>order-detail</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>historial-compra</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detalle de reserva</title>
<description/>
<keywords/>
<url_rewrite>detalle-de-reserva</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Datos personales</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>جزئیات رزرو</title>
<description/>
<keywords/>
<url_rewrite>jazayiat-rezrv</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>مشخصات</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>historique-commandes</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Détails de réservation</title>
<description/>
<keywords/>
<url_rewrite>details-de-reservation</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Identité</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>הסטוריית-הזמנות</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>פרטי ההזמנה</title>
<description/>
<keywords/>
<url_rewrite>partei-hahazmana</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>זהות</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detalji rezervacije</title>
<description/>
<keywords/>
<url_rewrite>detalji-rezervacije</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Foglalás részletei</title>
<description/>
<keywords/>
<url_rewrite>foglalas-reszletei</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>riwayat-pembelian</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detail Pemesanan</title>
<description/>
<keywords/>
<url_rewrite>detail-pemesanan</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Identitas</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>cronologia-ordini</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Dettaglio prenotazione</title>
<description/>
<keywords/>
<url_rewrite>dettaglio-prenotazione</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Identità</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Užsakymo informacija</title>
<description/>
<keywords/>
<url_rewrite>uzsakymo-informacija</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Детали за резервацијата</title>
<description/>
<keywords/>
<url_rewrite>detali-za-rezervacijata</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>bestel-overzicht</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Boekingsdetails</title>
<description/>
<keywords/>
<url_rewrite>boekingsdetails</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Identiteit</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Bestillingsdetaljer</title>
<description/>
<keywords/>
<url_rewrite>bestillingsdetaljer</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>historia-zamowien</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Szczegóły rezerwacji</title>
<description/>
<keywords/>
<url_rewrite>szczegoly-rezerwacji</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Dane osobiste</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>historico-de-encomendas</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detalhe da reserva</title>
<description/>
<keywords/>
<url_rewrite>detalhe-da-reserva</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identidade</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>historique-commandes</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Détail de la réservation</title>
<description/>
<keywords/>
<url_rewrite>detail-de-la-reservation</url_rewrite>
</meta>
<meta id='identity' id_shop='1'>
<title>Identité</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>istoric-comenzi</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detalii rezervare</title>
<description/>
<keywords/>
<url_rewrite>detalii-rezervare</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identitate</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Детали бронирования</title>
<description/>
<keywords/>
<url_rewrite>detali-bronirovaniya</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Идентификация</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>ගිතේරිම් විස්තර</title>
<description/>
<keywords/>
<url_rewrite>githerims-wisthara</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Detalji rezervacije</title>
<description/>
<keywords/>
<url_rewrite>detalji-rezervacije</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Bokningsinformation</title>
<description/>
<keywords/>
<url_rewrite>bokningsinformation</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>預訂明細</title>
<description/>
<keywords/>
<url_rewrite>yùdìng-míngxi</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>識別</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>Chi tiết đặt phòng</title>
<description/>
<keywords/>
<url_rewrite>chi-tiet-dat-phong</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

View File

@@ -96,6 +96,12 @@
<keywords/>
<url_rewrite>order-history</url_rewrite>
</meta>
<meta id="order-detail" id_shop="1">
<title>预订详情</title>
<description/>
<keywords/>
<url_rewrite>yùdìng-xiángqíng</url_rewrite>
</meta>
<meta id="identity" id_shop="1">
<title>Identity</title>
<description/>

File diff suppressed because one or more lines are too long

View File

@@ -22,7 +22,7 @@
<ul id="footer">
<li><a href="<?php echo $this->getForumLink() ?>" title="<?php echo $this->l('Official forum'); ?>" target="_blank"><?php echo $this->l('Official forum'); ?></a> | </li>
<li><a href="https://qloapps.com/" title="qloapps.com" target="_blank">QloApps.com</a> | </li>
<li><a href="https://qloapps.com/" title="qloapps.com" target="_blank">QloApps</a> | </li>
<li><a href="<?php echo $this->getSupportLink() ?>" title="<?php echo $this->l('Support'); ?>" target="_blank"><?php echo $this->l('Support'); ?></a> | </li>
<li><a href="<?php echo $this->getDocumentationLink() ?>" title="<?php echo $this->l('Documentation'); ?>" target="_blank"><?php echo $this->l('Documentation'); ?></a> | </li>
<li><a href="<?php echo $this->getContactLink() ?>" title="<?php echo $this->l('Contact us'); ?>" target="_blank"><?php echo $this->l('Contact us'); ?></a> | </li>

View File

@@ -119,9 +119,9 @@ var admin = '<?php echo(file_exists('../admin-dev') ? '../admin-dev' : '../admin
<button type="button" class="btn-facebook" onclick="psinstall_facebook_click();">
<i></i> <?php echo $this->l('Share'); ?>
</button>
<button type="button" class="btn-google-plus" onclick="psinstall_google_click();">
<!-- <button type="button" class="btn-google-plus" onclick="psinstall_google_click();">
<i></i> <?php echo $this->l('Google+'); ?>
</button>
</button> -->
<!-- <button type="button" class="btn-pinterest" onclick="psinstall_pinterest_click();">
<i></i> <?php echo $this->l('Pinterest'); ?>
</button> -->

View File

@@ -1700,9 +1700,9 @@ function loadRecommendation()
token: token
},
success: function(res) {
if (res.success && res.content && res.content.trim()) {
if (res.success && res.html && res.html.trim()) {
$('#recommendation-wrapper-skeleton').fadeIn('slow');
$('#recommendation-wrapper').html(res.content);
$('#recommendation-wrapper').html(res.html);
let images = $('#recommendation-wrapper img');
let loaded = 0;
let total = $(images).length;

View File

@@ -482,7 +482,7 @@ var ajaxCart = {
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (XMLHttpRequest.readyState == 0) {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
} else {
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
@@ -620,7 +620,7 @@ var ajaxCart = {
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (XMLHttpRequest.readyState == 0) {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
} else {
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
@@ -694,8 +694,8 @@ var ajaxCart = {
deleteProductFromSummary(idProduct + '_' + idCombination + '_' + customizationId + '_' + idAddressDelivery);
}*/
},
error: function(jqXHR) {
if (jqXHR.readyState == 0) {
error: function() {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
} else {
var error = 'ERROR: unable to delete the product';

View File

@@ -17,8 +17,8 @@ $(document).on('click', '#blocknewsletter .newsletter-btn', function (e) {
let messageBlock = $('#blocknewsletter .message-block');
$(messageBlock).html(response.message_html).stop(true, true).fadeIn('fast');
},
error: function (jqXHR) {
if (jqXHR.readyState == 0) {
error: function () {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
}
},

View File

@@ -68,7 +68,7 @@ class HotelAdvancedPayment extends ObjectModel
*/
public function getIdAdvPaymentByIdProduct($id_product)
{
$result = Db::getInstance()->getRow("SELECT * FROM `"._DB_PREFIX_."htl_advance_payment` WHERE `id_product`=".$id_product);
$result = Db::getInstance()->getRow("SELECT * FROM `"._DB_PREFIX_."htl_advance_payment` WHERE `id_product`=".(int) $id_product);
if ($result) {
return $result;

View File

@@ -385,6 +385,7 @@ class HotelBookingDetail extends ObjectModel
$partiallyAvailRoomTypes = $partiallyAvailRoomTypes['partiallyAvailRooms'];
}
// Now we will formate the data after geting search result according to search type
$roomTypesDetail = $objRoomType->getRoomTypeDetailByRoomTypeIds($allowedIdRoomTypes);
if ($roomTypesDetail) {
// Formate data for response
@@ -503,15 +504,12 @@ class HotelBookingDetail extends ObjectModel
$sql1 = 'SELECT `id` AS `id_room`, `id_product`, `id_hotel`, `room_num`, `comment` AS `room_comment`
FROM `'._DB_PREFIX_.'htl_room_information`
WHERE `id_hotel`='.(int)$idHotel.' AND `id_status` = '. HotelRoomInformation::STATUS_INACTIVE.' AND IF('.(int)$idRoomType.' > 0, `id_product` = '.(int)$idRoomType.', 1) AND `id_product` IN ('.$allowedIdRoomTypes.')';
// if ($idRoomType) {
// $sql1 .= ' AND `id_product` ='.(int)$idRoomType;
// }
// check room is temperory inactive
$sql2 = 'SELECT hri.`id` AS `id_room`, hri.`id_product`, hri.`id_hotel`, hri.`room_num`, hri.`comment` AS `room_comment`
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd. id_room = hri.`id`)
WHERE hri.`id_hotel`='.$idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND hrdd.`date_from` < \''.pSql($dateTo).'\' AND hrdd.`date_to` > \''.pSql($dateFrom).'\' AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
WHERE hri.`id_hotel`='.$idHotel.' AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .' AND hrdd.`date_from` <= \''.pSql($dateFrom).'\' AND hrdd.`date_to` >= \''.pSql($dateTo).'\' AND IF('.(int)$idRoomType.' > 0, hri.`id_product` = '.(int)$idRoomType.', 1) AND hri.`id_product` IN ('.$allowedIdRoomTypes.')';
$sql = $sql1.' UNION '.$sql2;
@@ -567,6 +565,7 @@ class HotelBookingDetail extends ObjectModel
return $cartRoomTypes;
}
/**
* $params = array(
* 'idHotel' => ...,
@@ -906,7 +905,6 @@ class HotelBookingDetail extends ObjectModel
);
}
/**
* $params = array(
* 'idHotel' => ...,
@@ -1096,7 +1094,7 @@ class HotelBookingDetail extends ObjectModel
}
unset($datetimeObj);
// If all dates rae covered
// If all dates are covered
if (!$datesToCover) {
// array in ascending order of dates
ksort($dateWiseRoomTypes);
@@ -1106,19 +1104,28 @@ class HotelBookingDetail extends ObjectModel
if (!empty($idCart) && !empty($idGuest)) {
$sql = 'SELECT `id_product`, `id_room`, `date_from`
FROM `'._DB_PREFIX_.'htl_cart_booking_data`
WHERE `id_hotel` = '.(int)$idHotel.' AND `id_cart` = '.(int)$idCart.' AND `id_guest` = '.(int)$idGuest.' AND `is_refunded` = 0 AND `is_back_order` = 0 AND IF('.(int)$idRoomType.' > 0, `id_product` = '.(int)$idRoomType.', 1) AND `id_product` IN ('.$allowedIdRoomTypes.')';
WHERE `id_hotel` = '.(int)$idHotel.' AND `id_cart` = '.(int)$idCart.' AND `id_guest` = '.(int)$idGuest.' AND `is_refunded` = 0 AND `is_back_order` = 0 AND IF('.(int)$idRoomType.' > 0, `id_product` = '.(int)$idRoomType.', 1) AND `id_product` IN ('.$allowedIdRoomTypes.') AND (';
$datetimeObj = new DateTime();
$countIteration = 0;
foreach ($timeStampWiseRooms as $timeStamp => $roomList) {
$countIteration++;
$datetimeObj->setTimestamp($timeStamp);
$partialDateFrom = $datetimeObj->format('Y-m-d H:i:s');
$datetimeObj->modify('+1 day');
$partialDateTo = $datetimeObj->format('Y-m-d H:i:s');
$sql .= ' AND (`date_from` = \''.pSQL($partialDateFrom).'\' AND `date_to` = \''.pSQL($partialDateTo).'\' AND `id_room` IN ('.implode(",", $roomList).'))';
$sql .= '(`date_from` = \''.pSQL($partialDateFrom).'\' AND `date_to` = \''.pSQL($partialDateTo).'\' AND `id_room` IN ('.implode(",", $roomList).'))';
if (count($timeStampWiseRooms) > $countIteration) {
$sql .= ' OR ';
}
}
unset($datetimeObj);
$sql .= ')';
unset($datetimeObj, $countIteration);
$partiallyAvailCartRooms = Db::getInstance()->executeS($sql);
if ($partiallyAvailCartRooms) {
@@ -1215,9 +1222,8 @@ class HotelBookingDetail extends ObjectModel
$partiallyAvailRooms = array();
$dateWiseRoomTypes = array();
}
unset($datesToCover);
unset($timeStampWiseRooms);
unset($partiallyAvailRooms);
unset($datesToCover, $timeStampWiseRooms, $partiallyAvailRooms);
}
return array(

View File

@@ -555,14 +555,22 @@ class HotelHelper
// create service categories
$categories = array(
'meals' => array(
'name' => 'Meals',
'restaurant' => array(
'name' => 'Restaurant',
'id_category' => 'to_be_set_below',
),
'transfers' => array(
'name' => 'Transfers',
'id_category' => 'to_be_set_below',
)
),
'activities' => array(
'name' => 'Activities',
'id_category' => 'to_be_set_below',
),
'charges' => array(
'name' => 'Operational charges',
'id_category' => 'to_be_set_below',
),
);
foreach ($categories as &$category) {
@@ -574,7 +582,7 @@ class HotelHelper
$serviceProducts = array(
array(
'name' => 'Room Maintenance Fees',
'id_category_default' => $idCategoryServices,
'id_category_default' => $categories['charges']['id_category'],
'description' => 'Ensure a comfortable stay with our room maintenance service, keeping your accommodation pristine and hassle-free throughout your visit.',
'price' => '250',
'auto_add_to_cart' => 1,
@@ -584,7 +592,7 @@ class HotelHelper
),
array(
'name' => 'Internet Handling Charges',
'id_category_default' => $idCategoryServices,
'id_category_default' => $categories['charges']['id_category'],
'description' => 'Navigate our website effortlessly with seamless handling, ensuring reliable, high-speed access for an enjoyable browsing experience throughout your online journey.',
'price' => '250',
'auto_add_to_cart' => 1,
@@ -614,7 +622,7 @@ class HotelHelper
),
array(
'name' => 'Breakfast',
'id_category_default' => $categories['meals']['id_category'],
'id_category_default' => $categories['restaurant']['id_category'],
'description' => 'Start your day right with a delicious and hearty breakfast, thoughtfully prepared to fuel your adventures and make your mornings exceptional.',
'price' => '350',
'auto_add_to_cart' => 0,
@@ -624,7 +632,7 @@ class HotelHelper
),
array(
'name' => 'Dinner',
'id_category_default' => $categories['meals']['id_category'],
'id_category_default' => $categories['restaurant']['id_category'],
'description' => 'Wind down in the evening with a delectable dinner spread, offering a culinary journey that delights your taste buds and completes your day with satisfaction.',
'price' => '450',
'auto_add_to_cart' => 0,

View File

@@ -50,7 +50,7 @@ class HotelRoomDisableDates extends ObjectModel
public function checkIfRoomAlreadyDisabled($params)
{
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'htl_room_disable_dates` WHERE `id_room` = '.(int)$params['id_room'].' AND `date_from` <= \''.pSQL($params['date_from']).'\' AND `date_to` >= \''.pSQL($params['date_to']).'\'');
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'htl_room_disable_dates` WHERE `id_room` = '.(int)$params['id_room'].' AND `date_from` < \''.pSQL($params['date_to']).'\' AND `date_to` > \''.pSQL($params['date_from']).'\'');
}
public function updateDisableDateRanges($params)
@@ -118,4 +118,5 @@ class HotelRoomDisableDates extends ObjectModel
return Db::getInstance()->delete('htl_room_disable_dates', '`id_room_type`='.(int)$idRoomType);
}
}

View File

@@ -794,14 +794,14 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
* @param [int] $id_product [id of the product]
* @return [array] [returns all feature prices by product]
*/
public function getFeaturePricesbyIdProduct($id_product)
public function getFeaturePricesbyIdProduct($id_product, $id_cart = 0, $id_guest = 0, $id_room = 0)
{
$idLang = Context::getContext()->language->id;
return Db::getInstance()->executeS(
'SELECT hrfp.*, hrfpl.`feature_price_name` FROM `'._DB_PREFIX_.'htl_room_type_feature_pricing` hrfp
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_lang` hrfpl
ON(hrfp.`id_feature_price` = hrfpl.`id_feature_price` AND hrfpl.`id_lang` = '.(int)$idLang.')
WHERE `id_product` = '.(int)$id_product
WHERE `id_product` = '.(int)$id_product.' AND `id_cart` = '.(int)$id_cart.' AND `id_guest` = '.(int)$id_guest.' AND `id_room` = '.(int)$id_room
);
}

View File

@@ -493,7 +493,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$cartrule->date_from = date('Y-m-d H:i:s', $now);
$cartrule->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */
$cartrule->active = 1;
$cartrule->highlight = 1;
$cartrule->reduction_amount = $totalRefundedAmount;
$cartrule->reduction_tax = true;
$cartrule->minimum_amount_currency = $objOrder->id_currency;

View File

@@ -1,5 +1,5 @@
<div class="copyRightWrapper">
<p class="copyRight">
&copy; {$WK_HTL_ESTABLISHMENT_YEAR}-{'Y'|date}&nbsp;<a href="{$base_dir}">&nbsp;{$WK_HTL_CHAIN_NAME}</a>.&nbsp;{l s=' All rights reserved.' mod='hotelreservationsystem'}
&copy;{if isset($WK_HTL_ESTABLISHMENT_YEAR) && $WK_HTL_ESTABLISHMENT_YEAR} {$WK_HTL_ESTABLISHMENT_YEAR}-{'Y'|date}&nbsp;{/if}<a href="{$base_dir}">&nbsp;{$WK_HTL_CHAIN_NAME}</a>.&nbsp;{l s=' All rights reserved.' mod='hotelreservationsystem'}
</p>
</div>

View File

@@ -107,14 +107,14 @@ class QloHotelReview extends Module
public function reviewPopupResources()
{
$controllers = array('history', 'guesttracking');
$controllers = array('orderdetail', 'guesttracking');
$controller = Tools::getValue('controller');
if (!in_array($controller, $controllers)) {
return;
}
$idOrder = 0;
if ($controller == 'history') {
if ($controller == 'orderdetail') {
$idOrder = (int) Tools::getValue('id_order');
}
@@ -162,8 +162,6 @@ class QloHotelReview extends Module
public function loadMedia($idOrder)
{
Media::addJsDef(array('qlo_hotel_review_js_vars' => array(
'id_order' => (int) $idOrder, // 0 for guesttracking
'link' => $this->context->link->getPageLink('order-detail', true),
'review_ajax_link' => $this->context->link->getModuleLink($this->name),
'review_ajax_token' => $this->secure_key,
'raty_img_path' => $this->getPathUri().'views/img/raty',
@@ -201,7 +199,7 @@ class QloHotelReview extends Module
public function hookDisplayFooterBefore()
{
$controllers = array('history', 'guesttracking');
$controllers = array('orderdetail', 'guesttracking');
$controller = Tools::getValue('controller');
if (in_array($controller, $controllers)) {
$categories = QhrCategory::getAll();

View File

@@ -31,34 +31,22 @@
}
#add-review-popup {
width: 650px;
width: 600px;
margin: 0 auto;
padding-right: 20px;
padding-bottom: 20px;
}
#add-review-popup .card-body {
padding: 18px 15px;
}
#add-review-popup .form-group {
margin-bottom: 20px;
margin-bottom: 30px;
}
#add-review-popup label {
font-size: 14px;
text-transform: uppercase;
}
#add-review-popup .form-control {
padding: 18px 10px;
font-size: 14px;
line-height: 18px;
border-radius: 4px;
}
#add-review-popup .hotel-name {
font-size: 18px;
}
#add-review-popup .form-control.description {
padding: 10px 10px;
font-weight: normal;
margin-bottom: 14px;
}
#add-review-popup .review-error {
@@ -74,28 +62,18 @@
font-size: 12px;
}
#add-review-popup .review-actions-wrap .btn-review {
font-size: 14px;
padding: 12px 30px;
font-weight: 600;
text-transform: uppercase;
text-align: center;
margin-left: 10px;
}
#add-review-popup .review-actions-wrap .btn-review.disabled {
#add-review-popup .review-actions-wrap .btn.disabled {
background-color: #1292FF;
border: 1px solid #1292FF;
}
#add-review-popup .image-input-btn {
width: 100px;
height: 100px;
border-radius: 4px;
border: 1px dashed #999;
display: table-cell;
vertical-align: middle;
cursor: pointer;
display: flex;
align-items: center;
}
#add-review-popup .image-input-btn .img-camera-plus {
@@ -109,7 +87,8 @@
}
#add-review-popup .previews-wrap {
margin-bottom: 15px;
margin-top: 10px;
margin-bottom: 20px;
}
#add-review-popup .previews-wrap span {
@@ -120,9 +99,10 @@
#add-review-popup .previews-wrap span i {
position: absolute;
top: 3px;
right: 14px;
font-size: 21px;
color: #7f7f7f;
right: 16px;
font-size: 30px;
font-weight: 100;
color: #fff;
cursor: pointer;
}
@@ -135,14 +115,6 @@
}
/* success popup */
.fancybox-add-review-success {
top: 80px !important;
.fancybox-order-detail.feedback .add-review-success-popup i.text-info {
color: #1292FF;
}
.add-review-success-popup {
width: 650px;
}
.add-review-success-popup i {
font-size: 40px;
}

View File

@@ -205,10 +205,6 @@ $(document).on('shown.bs.tab', 'a[href="#hotel-reviews"]', function(e) {
});
$(document).ready(function () {
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.id_order) {
showOrder(1, qlo_hotel_review_js_vars.id_order, qlo_hotel_review_js_vars.link);
}
// init raty
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.raty_img_path) {
initRaty(qlo_hotel_review_js_vars.raty_img_path);

View File

@@ -21,14 +21,14 @@ var QhrReviewForm = {
init: function(idOrder, idHotel, hotelName) {
$('#add-review-form').find('[name="id_order"]').val(idOrder);
$('#add-review-form').find('[name="id_hotel"]').val(idHotel);
$('#add-review-form').find('.hotel-name').html(hotelName);
$('#add-review-popup').find('.hotel-name').html(hotelName);
QhrReviewImages.init();
},
show: function() {
$.fancybox.open({
href: '#add-review-popup',
wrapCSS: 'fancybox-add-review',
padding: 20,
wrapCSS: 'fancybox-add-review fancybox-order-detail',
padding: 0,
});
},
close: function() {
@@ -95,8 +95,8 @@ var QhrReviewForm = {
$.fancybox.open({
href: href,
wrapCSS: 'fancybox-add-review-success',
padding: 20,
wrapCSS: 'fancybox-order-detail feedback',
padding: 0,
});
},
reset: function() {
@@ -139,7 +139,7 @@ var QhrReviewImages = {
addFileToPreview: function(file, iInput, iFile) {
var reader = new FileReader();
reader.onload = function (e) {
$('.previews-wrap').append('<span><img data-i-input="'+iInput+'" data-i-file="'+iFile+'" src="'+e.target.result+'" class="img-preview"><i class="icon icon-times-circle-o"></i></span>');
$('.previews-wrap').append('<span><img data-i-input="'+iInput+'" data-i-file="'+iFile+'" src="'+e.target.result+'" class="img-preview"><i>×</i></span>');
};
reader.readAsDataURL(file);
},
@@ -249,10 +249,6 @@ $(document).on('change', 'input.input-images', function(e) {
});
$(document).ready(function () {
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.id_order) {
showOrder(1, qlo_hotel_review_js_vars.id_order, qlo_hotel_review_js_vars.link);
}
// init raty
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.raty_img_path) {
initRaty(qlo_hotel_review_js_vars.raty_img_path);

View File

@@ -18,98 +18,103 @@
*}
<div id="qlohotelreview" style="display: none;">
<div id="add-review-popup">
<div id="add-review-popup" class="card">
<div class="card-header">
<span class="hotel-name"></span>
</div>
<form action="{$action}" id="add-review-form" method="post" enctype="multipart/form-data">
<input type="hidden" name="id_order" value="0"/>
<input type="hidden" name="id_hotel" value="0"/>
<div class="card-body">
<input type="hidden" name="id_order" value="0"/>
<input type="hidden" name="id_hotel" value="0"/>
<div class="alert alert-danger" id="review-general-errors" style="display:none;"></div>
<div class="form-group">
<label>{l s='Hotel Name' mod='qlohotelreview'}</label>
<p class="hotel-name" type="text" name=""></p>
</div>
<div class="alert alert-danger" id="review-general-errors" style="display:none;"></div>
<div class="form-group images-field">
<label>{l s='Images' mod='qlohotelreview'}</label>
<div class="inputs-wrap"></div>
<div class="form-group images-field">
<label>{l s='Images' mod='qlohotelreview'}</label>
<div class="previews-wrap"></div>
<div class="inputs-wrap"></div>
<div class="image-input-btn">
<img class="img-camera-plus">
</div>
</div>
<div class="form-group">
<label>
{l s='Tell us about your Overall experience' mod='qlohotelreview'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_overall" data-score="0"></div>
</div>
</div>
{if isset($categories) && count($categories)}
<div class="categories-wrap">
<div class="form-group">
<label>
{l s='Tell us more what went well?' mod='qlohotelreview'}
</label>
<div class="image-input-btn">
<img class="img-camera-plus">
</div>
{foreach $categories as $category}
<div class="form-group">
<label class="label-category">
{$category.name|escape:'html':'UTF-8'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_categories[{$category.id_category}]" data-score="0"></div>
</div>
</div>
{/foreach}
<div class="previews-wrap"></div>
</div>
{/if}
<div class="form-group">
<label>
{l s='Sumup your review' mod='qlohotelreview'}
</label>
<input class="form-control" type="text" name="subject" />
<p class="review-error subject"></p>
<div class="form-group">
<label>
{l s='Tell us about your Overall experience' mod='qlohotelreview'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_overall" data-score="0"></div>
</div>
</div>
{if isset($categories) && count($categories)}
<div class="categories-wrap">
<div class="form-group">
<label>
{l s='Tell us more what went well?' mod='qlohotelreview'}
</label>
</div>
{foreach $categories as $category}
<div class="form-group">
<label class="label-category">
{$category.name|escape:'html':'UTF-8'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_categories[{$category.id_category}]" data-score="0"></div>
</div>
</div>
{/foreach}
</div>
{/if}
<div class="form-group">
<label>
{l s='Sum up your review' mod='qlohotelreview'}
</label>
<input class="form-control" type="text" name="subject" placeholder="{l s='Type here...' mod='qlohotelreview'}"/>
<p class="review-error subject"></p>
</div>
<div class="form-group">
<label>
{l s='Write in detail' mod='qlohotelreview'}
</label>
<textarea class="form-control description" type="text" rows="5" name="description" placeholder="{l s='Type here...' mod='qlohotelreview'}"></textarea>
<p class="review-error description"></p>
</div>
</div>
<div class="form-group">
<label>
{l s='Write in detail' mod='qlohotelreview'}
</label>
<textarea class="form-control description" type="text" rows="5" name="description"></textarea>
<p class="review-error description"></p>
</div>
<div class="review-actions-wrap text-right">
<a class="btn btn-default btn-review" id="btn-submit-review">
{l s='Make Review' mod='qlohotelreview'}
</a>
<a class="btn btn-default btn-review" id="btn-cancel-review">
{l s='Cancel' mod='qlohotelreview'}
</a>
<div class="card-footer clearfix review-actions-wrap">
<div class="pull-right">
<button class="btn btn-secondary" id="btn-cancel-review">
{l s='Cancel' mod='qlohotelreview'}
</button>
<button class="btn btn-primary" id="btn-submit-review">
{l s='Make Review' mod='qlohotelreview'}
</button>
</div>
</div>
</form>
</div>
<div id="popup-review-submit-success-no-approval"
class="add-review-success-popup">
<div class="text-center">
<div><i class="icon icon-check-circle text-success"></i></div>
<h3>{l s='Review added successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been added successfully.' mod='qlohotelreview'}</p>
<div id="popup-review-submit-success-no-approval" class="add-review-success-popup">
<div class="card">
<div class="text-center">
<div><i class="icon icon-check-circle text-info"></i></div>
<h3>{l s='Review added successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been added successfully.' mod='qlohotelreview'}</p>
</div>
</div>
</div>
<div id="popup-review-submit-success-with-approval"
class="add-review-success-popup">
<div class="text-center">
<div><i class="icon icon-check-circle text-success"></i></div>
<h3>{l s='Review submitted successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been submitted for approval.' mod='qlohotelreview'}</p>
<div id="popup-review-submit-success-with-approval" class="add-review-success-popup">
<div class="card">
<div class="text-center">
<div><i class="icon icon-check-circle text-info"></i></div>
<h3>{l s='Review submitted successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been submitted for approval.' mod='qlohotelreview'}</p>
</div>
</div>
</div>
</div>

View File

@@ -43,15 +43,19 @@ $(document).ready(function() {
if ($('.homeAmenitiesBlock').length) {
setAmenitiesDescContHeight();
}
});
$(window).resize(function() {
if ($('.home_amenities_wrapper').length) {
setAmenitiesWrapperHeight();
}
});
$(window).resize(function() {
if ($('.homeAmenitiesBlock').length) {
$('.amenity_desc_cont').css('height', 0);
setAmenitiesDescContHeight();
}
if ($('.home_amenities_wrapper').length) {
setAmenitiesWrapperHeight();
}
});

View File

@@ -159,11 +159,13 @@ class WkRoomSearchHelper
$searchedData['location'] = $objLocationCategory->name;
} else {
$locationCategoryId = $objCategory->id_parent;
$searchedData['location'] = $searchedData['htl_dtl']['city'];
if (isset($searchedData['htl_dtl']['state_name'])) {
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name'];
if ($searchedData['htl_dtl']) {
$searchedData['location'] = $searchedData['htl_dtl']['city'];
if (isset($searchedData['htl_dtl']['state_name'])) {
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name'];
}
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name'];
}
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name'];
}
$searchedData['location_category_id'] = $locationCategoryId;

View File

@@ -87,7 +87,7 @@
</div>
<div class="text-right">
<p>{displayPrice price=$product['price']}</p>
<a class="btn btn-sm btn-default remove_roomtype_product" data-id_product="{$product['id_product']}"><i class="icon-trash"></i></a>
<a class="btn btn-sm btn-default remove_roomtype_product" data-id-product="{$product['id_product']}"><i class="icon-trash"></i></a>
</div>
</div>
{/foreach}

View File

@@ -0,0 +1,114 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}
<div class="card">
<div class="card-header">
{l s='Extra Services'}
</div>
<div class="card-body">
{if (isset($extraDemands) && $extraDemands) || (isset($additionalServices) && $additionalServices)}
<div class="">
<ul class="nav nav-tabs">
{if isset($extraDemands) && $extraDemands}
<li class="active"><a href="#room_type_demands_desc" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if isset($additionalServices) && $additionalServices}
<li{if !isset($extraDemands) || !$extraDemands} class="active"{/if}><a href="#room_type_service_product_desc" data-toggle="tab">{l s='Services'}</a></li>
{/if}
</ul>
<div class="tab-content">
{if isset($extraDemands) && $extraDemands}
<div id="room_type_demands_desc" class="tab-pane active">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Facilities chosen for this booking.'}</p>
</div>
{assign var=roomCount value=1}
{foreach $extraDemands as $roomDemand}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomDemand['adults']} <= 9}0{$roomDemand['adults']}{else}{$roomDemand['adults']}{/if} {if $roomDemand['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $roomDemand['children'] > 0}, {if {$roomDemand['children']} <= 9}0{$roomDemand['children']}{else}{$roomDemand['children']}{/if} {if $roomDemand['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="room_demand_block">
<div class="">{$demand['name']|escape:'html':'UTF-8'}</div>
<div class="">
<span>
{if $useTax}
{displayPrice price="{$demand['total_price_tax_incl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{else}
{displayPrice price="{$demand['total_price_tax_excl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
{if isset($additionalServices) && $additionalServices}
<div id="room_type_service_product_desc" class="tab-pane{if !isset($extraDemands) || !$extraDemands} active{/if}">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Services chosen for this booking.'}</p>
</div>
{assign var=roomCount value=1}
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomAdditionalService['adults']} <= 9}0{$roomAdditionalService['adults']}{else}{$roomAdditionalService['adults']}{/if} {if $roomAdditionalService['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $roomAdditionalService['children'] > 0}, {if {$roomAdditionalService['children']} <= 9}0{$roomAdditionalService['children']}{else}{$roomAdditionalService['children']}{/if} {if $roomAdditionalService['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomAdditionalService['additional_services'] as $additionalService}
<div class="room_demand_block">
<div class="">
<div class="">
{$additionalService['name']|escape:'html':'UTF-8'}
{if $additionalService['allow_multiple_quantity']}
<span class="quantity">{l s='(Quantity: %s)' sprintf=[$additionalService['quantity']|string_format:'%02d']}</span>
{/if}
</div>
</div>
<div class="">
<span>
{if $useTax}
{displayPrice price=$additionalService['total_price_tax_incl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{else}
{displayPrice price=$additionalService['total_price_tax_excl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
</div>
</div>
{/if}
</div>
</div>

View File

@@ -0,0 +1,40 @@
{*
* 2010-2024 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2024 Webkul IN
* @license LICENSE.txt
*}
<div class="message {if isset($message.id_employee) && $message.id_employee}management{else}customer{/if}">
<div class="profile">
<div class="row">
<div class="col-sm-6">
<strong>
{if $message.id_employee}
{$obj_hotel_branch_information->hotel_name|escape:'html':'UTF-8'}
{else}
{$message.cfirstname|escape:'html':'UTF-8'} {$message.clastname|escape:'html':'UTF-8'}
{/if}
</strong>
</div>
<div class="col-sm-6 text-right">
{dateFormat date=$message.date_add full=1}
</div>
</div>
</div>
<div class="message-content">
{$message.message|escape:'html':'UTF-8'|nl2br}
</div>
</div>

View File

@@ -0,0 +1,156 @@
{*
* 2010-2024 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2024 Webkul IN
* @license LICENSE.txt
*}
<div class="booking-room-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
<div class="row">
<div class="col-xs-3 col-sm-2">
<a href="{$link->getProductLink($data_v.id_product)|escape:'html':'UTF-8'}" title="{$data_v.name|escape:'html':'UTF-8'}" target="_blank">
<img class="img img-responsive img-room-type" src="{$data_v.cover_img|escape:'html':'UTF-8'}" />
</a>
</div>
<div class="col-xs-9 col-sm-10 info-wrap">
<div class="row">
<div class="col-xs-12">
<a href="{$link->getProductLink($data_v.id_product)|escape:'html':'UTF-8'}" title="{$data_v.name|escape:'html':'UTF-8'}" target="_blank" class="room-type-name">
<h3>{$data_v.name|escape:'html':'UTF-8'}</h3>
</a>
</div>
<div class="col-xs-12">
<div class="description-list">
<dl class="">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Check-in'}</dt>
<dd class="col-xs-7">{$rm_v.data_form|date_format:'D'}, {dateFormat date=$rm_v.data_form}</dd>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Check-out'}</dt>
<dd class="col-xs-7">{$rm_v.data_to|date_format:'D'}, {dateFormat date=$rm_v.data_to}</dd>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Rooms'}</dt>
<dd class="col-xs-7">{$rm_v.num_rm|string_format:'%02d'}</dd>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Guests'}</dt>
<dd class="col-xs-7">
{$rm_v.adults|string_format:'%02d'} {if $rm_v.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v.children}, {$rm_v.children|string_format:'%02d'} {if $rm_v.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</dd>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Extra Services'}</dt>
<dd class="col-xs-7">
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
<a data-date_from="{$rm_v.data_form}" data-date_to="{$rm_v.data_to}" data-id_product="{$data_v.id_product}" data-id_order="{$order->id}" data-action="{$link->getPageLink({$page_name})}" class="btn-view-extra-services" href="#rooms_type_extra_services_form">
{/if}
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_te + $rm_v.additional_services_price_te) currency=$currency}
{/if}
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
</a>
{/if}
</dd>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Total Price'}</dt>
<dd class="col-xs-7">
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.extra_demands_price_te + $rm_v.additional_services_price_te + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
<span class="order-price-info">
<img src="{$img_dir}icon/icon-info.svg" />
</span>
<div class="price-info-container" style="display: none;">
<div class="price-info-tooltip-cont">
<div class="list-row">
<div>
<p>{l s='Room(s) cost:'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
</p>
</div>
</div>
<div class="list-row">
<div>
<p>{l s='Service(s) cost:'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_te + $rm_v.additional_services_price_te) currency=$currency}
{/if}
</p>
</div>
</div>
</div>
</div>
{/if}
</dd>
</div>
</div>
</div>
</dl>
</div>
</div>
</div>
</div>
</div>
{if $rm_v['count_refunded'] > 0}
<div class="num-refunded-rooms">
<span class="badge badge-danger">
{if $rm_v['count_refunded'] > 1}
{$rm_v['count_refunded']} {l s='Rooms Refunded'}
{else}
{$rm_v['count_refunded']} {l s='Room Refunded'}
{/if}
</span>
</div>
{/if}
</div>

View File

@@ -1,109 +0,0 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}
<section>
{if (isset($extraDemands) && $extraDemands) || (isset($additionalServices) && $additionalServices)}
<ul class="nav nav-tabs">
{if isset($extraDemands) && $extraDemands}
<li class="active"><a href="#room_type_demands_desc" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if isset($additionalServices) && $additionalServices}
<li{if !isset($extraDemands) || !$extraDemands} class="active"{/if}><a href="#room_type_service_product_desc" data-toggle="tab">{l s='Services'}</a></li>
{/if}
</ul>
<div class="tab-content">
{if isset($extraDemands) && $extraDemands}
<div id="room_type_demands_desc" class="tab-pane active">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Below are the facilities chosen by you in this booking'}</p>
</div>
{assign var=roomCount value=1}
{foreach $extraDemands as $roomDemand}
<div class="card">
<div class="row">
<div class="col-sm-12 demand_header">
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}&nbsp;
<span>({if {$roomDemand['adults']} <= 9}0{$roomDemand['adults']}{else}{$roomDemand['adults']}{/if} {if $roomDemand['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$roomDemand['children']} <= 9}0{$roomDemand['children']}{else}{$roomDemand['children']}{/if} {if $roomDemand['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</div>
<div class="col-sm-12 room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="row room_demand_block">
<div class="col-xs-6">{$demand['name']|escape:'html':'UTF-8'}</div>
<div class="col-xs-6">
<span class="pull-right">
{if $useTax}
{displayPrice price="{$demand['total_price_tax_incl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{else}
{displayPrice price="{$demand['total_price_tax_excl']|escape:'html':'UTF-8'}" currency=$objOrder->id_currency}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
{if isset($additionalServices) && $additionalServices}
<div id="room_type_service_product_desc" class="tab-pane{if !isset($extraDemands) || !$extraDemands} active{/if}">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Below are the services chosen by you in this booking'}</p>
</div>
{assign var=roomCount value=1}
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="card">
<div class="row">
<div class="col-sm-12 demand_header">
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}&nbsp;
<span>({if {$roomAdditionalService['adults']} <= 9}0{$roomAdditionalService['adults']}{else}{$roomAdditionalService['adults']}{/if} {if $roomAdditionalService['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$roomAdditionalService['children']} <= 9}0{$roomAdditionalService['children']}{else}{$roomAdditionalService['children']}{/if} {if $roomAdditionalService['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</div>
<div class="col-sm-12 room_demand_detail">
{foreach $roomAdditionalService['additional_services'] as $additionalService}
<div class="row room_demand_block">
<div class="col-xs-6">
<div>{$additionalService['name']|escape:'html':'UTF-8'}</div>
{if $additionalService['allow_multiple_quantity']}
<div class="quantity">{l s='Qty:'}&nbsp;{$additionalService['quantity']|escape:'html':'UTF-8'}</div>
{/if}
</div>
<div class="col-xs-6">
<span class="pull-right">
{if $useTax}
{displayPrice price=$additionalService['total_price_tax_incl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{else}
{displayPrice price=$additionalService['total_price_tax_excl']|escape:'html':'UTF-8' currency=$objOrder->id_currency}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
</div>
{/foreach}
</div>
{/if}
</div>
{/if}
</section>

View File

@@ -43,27 +43,33 @@
<div class="col-sm-12 service_product_action_block">
{if !$PS_CATALOG_MODE && !$order_date_restrict && ($product.show_price && !isset($restricted_country_mode))}
<span class="service-product-price">
<div class="service-product-price">
{if !$priceDisplay}{convertPrice price=$product.price_tax_incl}{else}{convertPrice price=$product.price_tax_exc}{/if}{if $product.price_calculation_method == Product::PRICE_CALCULATION_METHOD_PER_DAY}<span class="price-label">{l s='/Night'}</span>{/if}
</span>
{/if}
<div>
{if ($product.show_price && !isset($restricted_country_mode))}
{if $product.available_for_order && !$PS_CATALOG_MODE && !$order_date_restrict && !((isset($restricted_country_mode) && $restricted_country_mode))}
<button class="btn btn-service-product{if isset($product.selected) && $product.selected} btn-danger remove_roomtype_product{else} btn-success add_roomtype_product{/if} pull-right" data-id-product="{$product.id_product}">{if isset($product.selected) && $product.selected}{l s='Remove'}{else}{l s='Select'}{/if}</button>
{if $product.allow_multiple_quantity && $product.available_for_order}
<div class="qty_container pull-right">
<input type="hidden" class="service_product_qty" id="service_product_qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}">
<div class="qty_count pull-left">
<span>{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}</span>
</div>
<div class="qty_direction pull-left">
<a href="#" class="btn btn-default quantity_up service_product_qty_up"><span><i class="icon-plus"></i></span></a>
<a href="#" class="btn btn-default quantity_down service_product_qty_down"><span><i class="icon-minus"></i></span></a>
</div>
{if $product.allow_multiple_quantity && $product.available_for_order && $product.max_quantity > 0}
<div class="service-max-quantity-info">
{l s='Maximum'} {$product.max_quantity} {l s='quantity can be added'}.
</div>
{/if}
</div>
{/if}
{if ($product.show_price && !isset($restricted_country_mode))}
{if $product.available_for_order && !$PS_CATALOG_MODE && !$order_date_restrict && !((isset($restricted_country_mode) && $restricted_country_mode))}
<div class="service-product-actions">
{if $product.allow_multiple_quantity && $product.available_for_order}
<div class="qty_container">
<input type="hidden" class="service_product_qty" id="service_product_qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}">
<div class="qty_count pull-left">
<span>{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}</span>
</div>
<div class="qty_direction pull-left">
<a href="#" class="btn btn-default quantity_up service_product_qty_up"><span><i class="icon-plus"></i></span></a>
<a href="#" class="btn btn-default quantity_down service_product_qty_down"><span><i class="icon-minus"></i></span></a>
</div>
</div>
{/if}
<button class="btn btn-service-product {if isset($product.selected) && $product.selected} btn-danger remove_roomtype_product{else} btn-success add_roomtype_product{/if} select_room_service select_room_service_{$product.id_product} pull-right" data-id-product="{$product.id_product}">{if isset($product.selected) && $product.selected}{l s='Remove'}{else}{l s='Select'}{/if}</button>
</div>
{/if}
{/if}
</div>

View File

@@ -1,188 +0,0 @@
/************************************************************
History Page Styles
************************************************************/
#order-detail-content table .return_quantity_buttons {
margin-top: 3px; }
#order-detail-content table .return_quantity_buttons a {
display: none;
float: left; }
#order-detail-content table .return_quantity_buttons a + a {
margin-left: 3px; }
#order-detail-content table .order_qte_input {
display: none;
width: 57px;
height: 27px;
line-height: 27px;
padding: 0;
text-align: center; }
#order-detail-content table label {
font-weight: 400; }
.wk_booking_details_wrapper table {
margin-bottom: 10px!important;}
.table td.history_detail a + a {
margin-left: 14px; }
.table td.step-by-step-date {
width: 105px; }
.table tfoot strong {
color: #333; }
.info-order i {
font-size: 20px; }
.info-order i.icon-gift {
color: #f13340; }
.info-order i.icon-repeat {
color: #55c65e; }
#sendOrderMessage {
margin-bottom: 30px; }
#sendOrderMessage select.form-control {
width: 263px; }
/*# sourceMappingURL=history.css.map */
/* ----- Order cancellation in order detail page ---- */
.standard_refund_fields {
display: none;}
.loading_overlay {
display: none;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 100000;}
.loading-img {
position: absolute;
left: 50%;
top: 50%;}
.refund_reason_head {
margin-bottom: 15px;
font-size: 22px;
color: #414141;}
#reasonForRefund {
font-size: 14px;
color: #777777;}
.booking-actions-wrap {
margin-bottom: 10px;}
.booking-actions-wrap .btn {
font-size: 14px;
padding: 12px 30px;
font-weight: 600;
text-transform: uppercase;
text-align: center;
margin-left: 10px;}
.terms_btn {
background-color: #404040;
color: #ffffff;
font-size: 13px;
font-weight: 700;}
.totalOrdercancellation_btn {
background-color: #379bf0;
color: #ffffff;
font-size: 13px;
font-weight: 700;
margin-right: 10px;}
.reason_submit_wrapper {
text-align: center;}
/* ----- Order cancellation in order detail page ---- */
.back_o_msg {
color: red;
font-size: 14px;}
.cust_serv_lnk {
text-decoration: underline;}
.room_type_old_price {
text-decoration: line-through;
color:#979797;
font-size:12px;}
/* Fancy-box for extra demands Css */
/* #rooms_extra_demands {
font-size: 16px;}
.room_extra_demands .open_rooms_extra_demands {
font-size:12px;
font-weight: 600;
color: #0000FF;}
#rooms_extra_demands .demand_header {
padding-bottom: 15px;
border-bottom: 1px solid rgb(0, 0, 0, 0.1);
margin-bottom: 15px;}
#rooms_extra_demands .demand_detail .demand_detail_price_block {
font-size: 14px;
margin-bottom: 15px;}
#rooms_extra_demands .rooms_extra_demands_head {
margin-bottom: 18px;}
#rooms_extra_demands .card {
padding-bottom: 0px;} */
.cancel_requests_link_wrapper a {
font-weight: bold;
font-style: italic;
text-decoration: underline;
color: #000;}
/* refund buttons */
#history .checkbox {
margin-bottom: 15px;
line-height: 12px;}
#history .booking_refund_fields label {
font-size: 14px;
color: #333;
font-weight: bold;
padding-left: 6px;}
#history .refund_policy_link {
background-color: #D9D9D9;
border: 1px solid #D9D9D9;}
#history #order_refund_request {
background-color: #1292FF;
border: 1px solid #1292FF;
color: #FFF;}
@media screen and (max-width: 405px) {
#history #order_refund_request {
margin-bottom: 5px;}}
#history .cancel_request_btn {
background-color: #FF4B4B!important;
border: 1px solid #FF4B4B!important;}
#history #order_refund_request_submit {
background-color: #36BA46;
border: 1px solid #36BA46;
color: #fff;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
padding: 12px 30px;}
#history #submit_refund_reason {
background-color: #1292FF;
border: 1px solid #1292FF;
color: #fff;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
padding: 12px 30px;}
.refund_request_fields {
display: none;}
.ui-tooltip.price-tootip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 9px 15px;
max-height: 310px;
overflow-y: auto;
}
.price-info-tooltip-cont {
min-width: 180px;
}
.price-info-tooltip-cont .list-row {
display: flex;
justify-content: space-between;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1528,7 +1528,7 @@ ul.service-product-nav > li:hover {
.service_product_action_block {
display: flex;
justify-content: space-between;
align-items: end;
align-items: center;
flex-wrap: wrap;
}
.service-product-element .service-product-img {
@@ -1543,6 +1543,13 @@ ul.service-product-nav > li:hover {
font-size: 14px;
line-height: 22px;
}
.service-max-quantity-info {
font-size: 12px;
line-height: 1.3;
font-style: italic;
color: #959595;
font-weight: 400;
}
.service-product-element .service-product-price {
font-weight: 600;
font-size: 22px;
@@ -1554,10 +1561,6 @@ ul.service-product-nav > li:hover {
.service-product-element .service-product-actions {
display: flex;
justify-content: space-between;
}
.service-product-element .service-product-actions > div {
flex-grow: 1;
}
.service-product-element .qty_container > * {

View File

@@ -53,7 +53,7 @@
{/if}
{if $discountDetail.reduction_amount > 0}
{if $discountDetail.reduction_percent > 0} + {/if}
{convertPrice price=$discountDetail.reduction_amount} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{displayPrice price=$discountDetail.reduction_amount currency=$discountDetail.reduction_currency} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{/if}
{if $discountDetail.free_shipping}
{if $discountDetail.reduction_percent > 0 || $discountDetail.reduction_amount > 0} + {/if}
@@ -73,7 +73,7 @@
{if $discountDetail.minimal == 0}
{l s='None'}
{else}
{convertPrice price=$discountDetail.minimal} ({if $discountDetail.minimum_amount_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{displayPrice price=$discountDetail.minimal currency=$discountDetail.reduction_currency} ({if $discountDetail.minimum_amount_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{/if}
</td>
<td class="discount_cumulative">

View File

@@ -32,6 +32,7 @@
{assign var=order_state value=$order->getCurrentState()}
{assign var=invoice value=$order->invoice}
{assign var=order_history value=$order->order_history}
{assign var=overbooking_order_states value=$order->overbooking_order_states}
{assign var=carrier value=$order->carrier}
{assign var=address_invoice value=$order->address_invoice}
{assign var=address_delivery value=$order->address_delivery}
@@ -55,8 +56,10 @@
{assign var=back_ord_msg value=$order->back_ord_msg}
{assign var=order_has_invoice value=$order->order_has_invoice}
{assign var=cart_htl_data value=$order->cart_htl_data}
{assign var=non_requested_rooms value=$order->non_requested_rooms}
{assign var=customerGuestDetail value=$order->customerGuestDetail}
{assign var=obj_hotel_branch_information value=$order->obj_hotel_branch_information}
{assign var=hotel_address_info value=$order->hotel_address_info}
{assign var=hotel_refund_rules value=$order->hotel_refund_rules}
{if isset($order->total_old)}
{assign var=total_old value=$order->total_old}
@@ -72,41 +75,47 @@
</div>
{/foreach}
<h2 id="guestToCustomer" class="page-heading">{l s='For more advantages...'}</h2>
<div class="row">
<div class="col-md-8">
{if isset($transformSuccess)}
<p class="alert alert-success alert-transformed">{l s='Your guest account has been successfully transformed into a customer account. You can now log in as a registered user. '} <a href="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}">{l s='Log in now.'}</a></p>
{else}
<div class="card transform-account">
<div class="card-header">
{l s='For More Advantages'}
</div>
<div class="card-body">
<form method="post" action="{$action|escape:'html':'UTF-8'}#guestToCustomer" class="std">
{include file="$tpl_dir./errors.tpl"}
{include file="$tpl_dir./errors.tpl"}
<p class="card-subtitle">
{l s='Transform your guest account into a customer account and enjoy:'}
</p>
{if isset($transformSuccess)}
<p class="alert alert-success">{l s='Your guest account has been successfully transformed into a customer account. You can now log in as a registered user. '} <a href="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}">{l s='Log in now.'}</a></p>
{else}
<form method="post" action="{$action|escape:'html':'UTF-8'}#guestToCustomer" class="std">
<fieldset class="description_box box">
<div class="card-text">
<p>{l s='- Personalized and secure access.'}</p>
<p>{l s='- Fast and easy checkout'}</p>
<p>{l s='- Easier refund process'}</p>
</div>
<p><strong class="dark">{l s='Transform your guest account into a customer account and enjoy:'}</strong></p>
<ul>
<li> - {l s='Personalized and secure access'}</li>
<li> - {l s='Fast and easy checkout'}</li>
<li> - {l s='Easier refund process'}</li>
</ul>
<div class="row">
<div class="col-xs-12 col-sm-5 col-md-4 col-lg-3">
<div class="text form-group">
<label><strong class="dark">{l s='Set your password:'}</strong></label>
<input type="password" name="password" class="form-control" />
</div>
<div class="form-group password">
<label>{l s='Set your password:'}</label>
<input type="password" name="password" class="form-control" />
</div>
<input type="hidden" name="id_order" value="{if isset($order->id)}{$order->id}{else}{if isset($smarty.get.id_order)}{$smarty.get.id_order|escape:'html':'UTF-8'}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|escape:'html':'UTF-8'}{/if}{/if}{/if}" />
<input type="hidden" name="order_reference" value="{if isset($smarty.get.order_reference)}{$smarty.get.order_reference|escape:'html':'UTF-8'}{else}{if isset($smarty.post.order_reference)}{$smarty.post.order_reference|escape:'html':'UTF-8'}{/if}{/if}" />
<input type="hidden" name="email" value="{if isset($smarty.get.email)}{$smarty.get.email|escape:'html':'UTF-8'}{else}{if isset($smarty.post.email)}{$smarty.post.email|escape:'html':'UTF-8'}{/if}{/if}" />
<button type="submit" name="submitTransformGuestToCustomer" class="button button-medium btn btn-submit">
<span>{l s='Send'}</span>
</button>
</form>
</div>
</div>
<input type="hidden" name="id_order" value="{if isset($order->id)}{$order->id}{else}{if isset($smarty.get.id_order)}{$smarty.get.id_order|escape:'html':'UTF-8'}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|escape:'html':'UTF-8'}{/if}{/if}{/if}" />
<input type="hidden" name="order_reference" value="{if isset($smarty.get.order_reference)}{$smarty.get.order_reference|escape:'html':'UTF-8'}{else}{if isset($smarty.post.order_reference)}{$smarty.post.order_reference|escape:'html':'UTF-8'}{/if}{/if}" />
<input type="hidden" name="email" value="{if isset($smarty.get.email)}{$smarty.get.email|escape:'html':'UTF-8'}{else}{if isset($smarty.post.email)}{$smarty.post.email|escape:'html':'UTF-8'}{/if}{/if}" />
<p>
<button type="submit" name="submitTransformGuestToCustomer" class="button button-medium btn btn-default"><span>{l s='Send'}<i class="icon-chevron-right right"></i></span></button>
</p>
</fieldset>
</form>
{/if}
{/if}
</div>
</div>
{else}
{include file="$tpl_dir./errors.tpl"}
{if isset($show_login_link) && $show_login_link}

View File

@@ -61,7 +61,7 @@
{* {if isset($order.invoice) && $order.invoice && isset($order.virtual) && $order.virtual}
<img class="icon" src="{$img_dir}icon/download_product.gif" alt="{l s='Products to download'}" title="{l s='Products to download'}" />
{/if} *}
<a class="color-myaccount" href="javascript:showOrder(1, {$order.id_order|intval}, '{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}');">
<a class="color-myaccount" href="{$link->getPageLink('order-detail', true, NULL, "id_order={$order.id_order|intval}")|escape:'html':'UTF-8'}">
{Order::getUniqReferenceOf($order.id_order)}
</a>
</td>
@@ -103,7 +103,7 @@
{/if}
</td>
<td class="history_detail">
<a class="btn btn-default button button-small" href="javascript:showOrder(1, {$order.id_order|intval}, '{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}');">
<a class="btn btn-default button button-small" href="{$link->getPageLink('order-detail', true, NULL, "id_order={$order.id_order|intval}")|escape:'html':'UTF-8'}">
<span>
{l s='Details'}<i class="icon-chevron-right right"></i>
</span>
@@ -141,17 +141,3 @@
</a>
</li>
</ul>
<!-- By webkul added for history controller url on history.js -->
{strip}
{addJsDef historyUrl=$link->getPageLink("orderdetail", true)|escape:'quotes':'UTF-8'}
{addJsDefL name=req_sent_msg}{l s='Request Sent..' js=1}{/addJsDefL}
{addJsDefL name=wait_stage_msg}{l s='Waiting' js=1}{/addJsDefL}
{addJsDefL name=pending_state_msg}{l s='Pending...' js=1}{/addJsDefL}
{addJsDefL name=mail_sending_err}{l s='Some error occurred while sending mail to the customer' js=1}{/addJsDefL}
{addJsDefL name=refund_request_sending_error}{l s='Some error occurred while processing request for booking cancelation.' js=1}{/addJsDefL}
{addJsDefL name=no_bookings_selected}{l s='No rooms selected. Please select at least one room.' js=1}{/addJsDefL}
{addJsDefL name=refund_request_success_txt}{l s='Request for booking cancelation is successffully created.' js=1}{/addJsDefL}
{addJsDefL name=cancellation_success_txt}{l s='Your booking is successffully cancelled.' js=1}{/addJsDefL}
{addJsDefL name=cancel_req_txt}{l s='Cancel Request' js=1}{/addJsDefL}
{addJsDefL name=cancel_booking_txt}{l s='Cancel Bookings' js=1}{/addJsDefL}
{/strip}

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

View File

@@ -24,6 +24,7 @@
*/
//global variables
var responsiveflag = false;
var onlineFlag = true;
@@ -115,7 +116,6 @@ $(document).ready(function(){
});
$(document).on('click', '.open_rooms_extra_services_panel', function() {
console.log('dasdasd');
var idProduct = $(this).data('id_product');
var idOrder = $(this).data('id_order');
var dateFrom = $(this).data('date_from');
@@ -494,3 +494,11 @@ function showErrorMessage(msg) {
function showNoticeMessage(msg) {
$.growl.notice({ title: "", message:msg});
}
window.addEventListener('online', function () {
onlineFlag = true;
});
window.addEventListener('offline', function () {
onlineFlag = false;
});

View File

@@ -1,311 +0,0 @@
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/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.
*
* 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/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
//show the order-details with ajax
function showOrder(mode, var_content, file)
{
$.get(
file,
((mode === 1) ? {'id_order': var_content, 'ajax': true} : {'id_order_return': var_content, 'ajax': true}),
function(data)
{
$('#block-order-detail').fadeOut('slow', function()
{
$(this).html(data);
$('.footab').footable();
/* if return is allowed*/
if ($('#order-detail-content .order_cb').length > 0)
{
//return slip : check or uncheck every checkboxes
$('#order-detail-content th input[type=checkbox]').click(function()
{
$('#order-detail-content td input[type=checkbox]').each(function()
{
this.checked = $('#order-detail-content th input[type=checkbox]').is(':checked');
updateOrderLineDisplay(this);
});
});
//return slip : enable or disable 'global' quantity editing
$('#order-detail-content td input[type=checkbox]').click(function()
{
updateOrderLineDisplay(this);
});
//return slip : limit quantities
$('#order-detail-content td .order_qte_input').keyup(function()
{
var maxQuantity = parseInt($(this).parent().find('.order_qte_span').text());
var quantity = parseInt($(this).val());
if (isNaN($(this).val()) && $(this).val() !== '')
{
$(this).val(maxQuantity);
}
else
{
if (quantity > maxQuantity)
$(this).val(maxQuantity);
else if (quantity < 1)
$(this).val(1);
}
});
// The button to increment the product return value
$(document).on('click', '.return_quantity_down', function(e){
e.preventDefault();
var $input = $(this).parent().parent().find('input');
var count = parseInt($input.val()) - 1;
count = count < 1 ? 1 : count;
$input.val(count);
$input.change();
});
// The button to decrement the product return value
$(document).on('click', '.return_quantity_up', function(e){
e.preventDefault();
var maxQuantity = parseInt($(this).parent().parent().find('.order_qte_span').text());
var $input = $(this).parent().parent().find('input');
var count = parseInt($input.val()) + 1;
count = count > maxQuantity ? maxQuantity : count;
$input.val(count);
$input.change();
});
}
//catch the submit event of sendOrderMessage form
$('form#sendOrderMessage').submit(function(){
return sendOrderMessage();
});
$(this).fadeIn('slow', function() {
$('html, body').animate({
scrollTop: $('#block-order-detail').offset().top
}, 1200);
initPriceTooltip();
});
});
});
}
function updateOrderLineDisplay(domCheckbox)
{
var lineQuantitySpan = $(domCheckbox).parent().parent().find('.order_qte_span');
var lineQuantityInput = $(domCheckbox).parent().parent().find('.order_qte_input');
var lineQuantityButtons = $(domCheckbox).parent().parent().find('.return_quantity_up, .return_quantity_down');
if($(domCheckbox).is(':checked'))
{
lineQuantitySpan.hide();
lineQuantityInput.show();
lineQuantityButtons.show();
}
else
{
lineQuantityInput.hide();
lineQuantityButtons.hide();
lineQuantityInput.val(lineQuantitySpan.text());
lineQuantitySpan.show();
}
}
//send a message in relation to the order with ajax
function sendOrderMessage()
{
paramString = "ajax=true";
$('#sendOrderMessage').find('input, textarea, select').each(function(){
paramString += '&' + $(this).attr('name') + '=' + encodeURIComponent($(this).val());
});
$.ajax({
type: "POST",
headers: { "cache-control": "no-cache" },
url: $('#sendOrderMessage').attr("action") + '?rand=' + new Date().getTime(),
data: paramString,
beforeSend: function(){
$(".button[name=submitMessage]").prop("disabled", "disabled");
},
success: function(msg){
$('#block-order-detail').fadeOut('slow', function() {
$(this).html(msg);
//catch the submit event of sendOrderMessage form
$('#sendOrderMessage').submit(function(){
return sendOrderMessage();
});
$(this).fadeIn('slow');
$(".button[name=submitMessage]").prop("disabled", false);
});
},
error: function(){
$(".button[name=submitMessage]").prop("disabled", false);
}
});
return false;
}
function initPriceTooltip()
{
if ($('.order-price-info').length) {
$('.order-price-info').each(function() {
$(this).tooltip({
content: $(this).closest('td').find('.price-info-container').html(),
items: "span",
trigger : 'hover',
tooltipClass: "price-tootip",
open: function(event, ui) {
if (typeof(event.originalEvent) === 'undefined')
{
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
// ajax function to pull in data and add it to the tooltip goes here
},
close: function(event, ui) {
ui.tooltip.hover(function()
{
$(this).stop(true).fadeTo(400, 1);
},
function()
{
$(this).fadeOut('400', function()
{
$(this).remove();
});
});
}
});
});
}
}
$(document).ready(function(){
var page = $('html, body');
page.on('mousewheel', function () {
page.stop();
});
// If customer clicks for refund request then toggle refund request fields
$('body').on('click', '#order_refund_request', function(e) {
e.preventDefault();
if ($(this).attr('refund_fields_on') == 0) {
$('.standard_refund_fields').show();
$(this).attr('refund_fields_on', 1);
$(this).addClass('cancel_request_btn');
$(this).html('<i class="icon-close"></i> ' + cancel_req_txt);
} else {
$('.standard_refund_fields').hide();
$(this).attr('refund_fields_on', 0);
$(this).removeClass('cancel_request_btn');
$(this).text(cancel_booking_txt);
}
});
$('body').on('click', '#order_refund_request_submit', function(e) {
e.preventDefault();
// get the checked bookings to refund
var bookings_to_refund = $("input[name='bookings_to_refund[]']:checked").map(function(){return $(this).val();}).get();
// check if at least one room is selected for refund request
if (bookings_to_refund.length) {
bookings_to_refund = JSON.stringify(bookings_to_refund);
$.fancybox({
href: "#reason_fancybox_content",
minWidth : 500,
autoScale : true,
autoSize : true,
'hideOnContentClick': false,
beforeLoad: function () {
$('#htlRefundReasonForm #bookings_to_refund').val(bookings_to_refund);
},
beforeClose: function () {
$('#bookings_to_refund').val('');
$('.cancel_req_amount').hide();
$('.reasonForRefund').css('border','1px solid #d6d4d4');
$('.required_err').hide();
}
});
} else {
showErrorMessage(no_bookings_selected);
}
});
$('body').on('click', '#submit_refund_reason', function() {
var bookings_to_refund = $('#htlRefundReasonForm #bookings_to_refund').val();
if (bookings_to_refund) {
var cancellation_reason = $('.reasonForRefund').val();
var id_order = $(this).data('id_order');
if (cancellation_reason == '') {
$('.required_err').show();
$('.reasonForRefund').css('border','1px solid #AA1F00');
} else {
$(".loading_overlay").show();
$('#submit_refund_reason').attr('disabled', 'disabled');
$.ajax({
data:{
contentType: "application/json; charset=UTF-8",
id_order: id_order,
bookings_to_refund: bookings_to_refund,
cancellation_reason : cancellation_reason,
ajax : true,
method: 'submitRefundRequest',
},
method:'POST',
dataType:'JSON',
url:historyUrl,
success:function(data) {
if (data.status == '1') {
$(".roomRequestForRefund").parent().html('<p>'+req_sent_msg+'</p>');
if (data.has_cancelled == 1) {
showSuccessMessage(cancellation_success_txt);
} else {
showSuccessMessage(refund_request_success_txt);
}
$('.bookings_to_refund:checked').prop('disabled', true);
$.fancybox.close();
showOrder(1, $("input[name=id_order]").val(), historyUrl)
} else {
showErrorMessage(refund_request_sending_error);
$('#submit_refund_reason').attr('disabled', false);
}
$(".loading_overlay").hide();
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
showErrorMessage(textStatus);
$('#submit_refund_reason').attr('disabled', false);
$(".loading_overlay").hide();
}
});
}
} else {
showErrorMessage(no_bookings_selected);
}
});
initPriceTooltip();
});

View File

@@ -482,7 +482,7 @@ var ajaxCart = {
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (XMLHttpRequest.readyState == 0) {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
} else {
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
@@ -620,7 +620,7 @@ var ajaxCart = {
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (XMLHttpRequest.readyState == 0) {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
} else {
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
@@ -694,8 +694,8 @@ var ajaxCart = {
deleteProductFromSummary(idProduct + '_' + idCombination + '_' + customizationId + '_' + idAddressDelivery);
}*/
},
error: function(jqXHR) {
if (jqXHR.readyState == 0) {
error: function() {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
} else {
var error = 'ERROR: unable to delete the product';
@@ -1277,10 +1277,10 @@ function disableRoomTypeDemands(show) {
function disableRoomTypeServices(disable) {
if (disable) {
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('button.select_room_service').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
$('#service_products_cont').find('button.add_roomtype_product').removeAttr('disabled');
$('#service_products_cont').find('button.select_room_service').removeAttr('disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').removeAttr('disabled');
}
}

View File

@@ -42,8 +42,8 @@ $(document).on('click', '#blocknewsletter .newsletter-btn', function (e) {
let messageBlock = $('#blocknewsletter .message-block');
$(messageBlock).html(response.message_html).stop(true, true).fadeIn('fast');
},
error: function (jqXHR) {
if (jqXHR.readyState == 0) {
error: function () {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
}
},

View File

@@ -0,0 +1,344 @@
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/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.
*
* 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/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
// send a message in relation to the order with ajax
function sendOrderMessage() {
let paramString = 'ajax=true&action=submitMessage';
$('#sendOrderMessage').find('input, textarea, select').each(function () {
paramString += '&' + $(this).attr('name') + '=' + encodeURIComponent($(this).val());
});
$.ajax({
type: 'POST',
headers: { 'cache-control': 'no-cache' },
url: $('#sendOrderMessage').attr('action') + '?rand=' + new Date().getTime(),
data: paramString,
dataType: 'JSON',
beforeSend: function () {
$('.add-order-message .errors-block').hide(200).html('');
$('.button[name=submitMessage]').prop('disabled', 'disabled');
},
success: function (response) {
if (response.has_errors) {
$('.add-order-message .errors-block').html(response.errors_html).show(200);
} else if (response.status) {
if (!$('.order-messages .messages-list .message').length) {
$('.order-messages').removeClass('hide');
}
$('.order-messages .messages-list').prepend(response.message_html);
$('.add-order-message .select-room-type button span').html(order_message_choose_txt);
$('.add-order-message .select-room-type .id_product').val(0);
$('.add-order-message form textarea').val('');
showSuccessMessage(order_message_success_txt);
}
},
complete: function () {
$('.button[name=submitMessage]').prop('disabled', false);
}
});
}
function initPriceTooltip() {
if ($('.order-price-info').length) {
$('.order-price-info').each(function () {
$(this).tooltip({
content: $(this).closest('dd').find('.price-info-container').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'price-tootip',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function (event, ui) {
ui.tooltip.hover(function () {
$(this).stop(true).fadeTo(400, 1);
},
function () {
$(this).fadeOut('400', function () {
$(this).remove();
});
});
}
});
});
}
}
function initMap() {
const hotelLocation = {
lat: Number(hotel_location.latitude),
lng: Number(hotel_location.longitude),
};
$('.booking-hotel-map-container').each(function (i, element) {
const map = new google.maps.Map(element, {
zoom: 10,
center: hotelLocation,
disableDefaultUI: true,
fullscreenControl: true,
});
const marker = new google.maps.Marker({
position: hotelLocation,
map: map,
title: hotel_name,
});
marker.addListener('click', function() {
let query = '';
if (hotel_location.map_input_text != '') {
query = hotel_location.map_input_text;
} else {
query = hotel_location.latitude + ',' + hotel_location.longitude;
}
window.open('https://www.google.com/maps/search/?api=1&query='+encodeURIComponent(query), '_blank');
});
});
}
/* Refund management - start */
const BookingRefundManager = {
show: function() {
$.fancybox.open({
href: '#create-new-refund-popup',
wrapCSS: 'fancybox-order-detail',
padding: 0,
});
},
close: function() {
$.fancybox.close();
},
beforeSubmit: function() {
BookingRefundManager.hideGeneralErrors();
BookingRefundManager.disableSubmitButton();
},
validate: function() {
if (!$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').length) {
showErrorMessage(no_bookings_selected);
return false;
}
return true;
},
submit: function() {
BookingRefundManager.beforeSubmit();
const formData = new FormData($('#form-cancel-booking').get(0));
formData.append('ajax', true);
formData.append('token', token);
formData.append('action', 'SubmitRefundRequest');
$.ajax({
url: location.href,
data: formData,
processData: false,
contentType: false,
type: 'POST',
dataType: 'JSON',
success: function(response) {
if (response.has_errors) {
BookingRefundManager.showGeneralErrors(response.errors_html);
} else {
BookingRefundManager.close();
if (typeof response.order_cancelled != 'undefined' && response.order_cancelled) {
BookingRefundManager.showOrderCancelSuccessMessage();
} else {
BookingRefundManager.showRefundRequestSuccessMessage();
}
BookingRefundManager.reset();
}
},
complete: function() {
BookingRefundManager.enableSubmitButton();
},
});
},
reset: function () {
$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').closest('.room-details').addClass('cancelled');
$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').closest('span').removeClass('checked');
$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').attr('disabled', true);
$('#form-cancel-booking .num-selected-rooms').html('00');
$('#form-cancel-booking .count-total-rooms').html('00');
$('#form-cancel-booking .cancellation_reason').val('');
$('#form-cancel-booking .cancel-booking').show();
$('#form-cancel-booking .cancel-booking-preview').hide();
// disable next button if all rooms were selected cancelled
let countRooms = $('#form-cancel-booking input.bookings_to_refund').length;
let countDisabled = $('#form-cancel-booking input.bookings_to_refund:disabled').length;
if (countRooms == countDisabled) {
BookingRefundManager.disableNextButton();
}
},
updateSelectedRooms: function() {
let countSelected = $('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').length;
countSelected = (countSelected <= 9) ? ('0' + countSelected) : countSelected;
$('#form-cancel-booking .num-selected-rooms').html(countSelected);
$('#form-cancel-booking .count-total-rooms').html(countSelected);
},
showGeneralErrors: function(errors) {
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').stop().html(errors);
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').show(200);
},
hideGeneralErrors: function() {
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').hide(200, function() {
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').html('');
});
},
disableNextButton: function() {
$('#form-cancel-booking .btn-next').addClass('disabled');
},
enableSubmitButton: function() {
$('#form-cancel-booking .btn-submit').removeClass('disabled');
},
disableSubmitButton: function() {
$('#form-cancel-booking .btn-submit').addClass('disabled');
},
showRefundRequestSuccessMessage: function() {
$.fancybox.open({
href: '#popup-cancellation-submit-success',
wrapCSS: 'fancybox-order-detail feedback',
padding: 0,
});
},
showOrderCancelSuccessMessage: function() {
$.fancybox.open({
href: '#popup-cancellation-order-cancel-success',
wrapCSS: 'fancybox-order-detail feedback',
padding: 0,
});
},
}
$(document).on('click', '#order_refund_request', function(e) {
e.preventDefault();
BookingRefundManager.show();
});
$(document).on('click', '.fancybox-order-detail .cancel-booking .btn-cancel', function(e) {
e.preventDefault();
BookingRefundManager.close();
});
$(document).on('click', '.fancybox-order-detail .cancel-booking .btn-next', function(e) {
e.preventDefault();
if (BookingRefundManager.validate()) {
$('.fancybox-order-detail .cancel-booking').hide();
$('.fancybox-order-detail .cancel-booking-preview').show();
}
});
$(document).on('click', '.fancybox-order-detail .cancel-booking-preview .btn-back', function(e) {
e.preventDefault();
$('.fancybox-order-detail .cancel-booking-preview').hide();
$('.fancybox-order-detail .cancel-booking').show();
});
$(document).on('click', '.fancybox-order-detail .cancel-booking-preview .btn-submit', function(e) {
e.preventDefault();
BookingRefundManager.submit();
});
$(document).on('click', '.fancybox-order-detail input.bookings_to_refund', function() {
BookingRefundManager.updateSelectedRooms();
});
/* Refund management - end */
$(document).on('click', '.btn-view-extra-services', function(e) {
e.preventDefault();
let idProduct = $(this).data('id_product');
let idOrder = $(this).data('id_order');
let dateFrom = $(this).data('date_from');
let dateTo = $(this).data('date_to');
$.ajax({
type: 'POST',
headers: {
'cache-control': 'no-cache',
},
url: window.location,
dataType: 'json',
cache: false,
data: {
date_from: dateFrom,
date_to: dateTo,
id_product: idProduct,
id_order: idOrder,
action: 'getRoomTypeBookingDemands',
ajax: true,
token: static_token,
},
success: function(result) {
if (result.extra_demands) {
$('#popup-view-extra-services').html('');
$('#popup-view-extra-services').append(result.extra_demands);
$.fancybox.open({
href: '#popup-view-extra-services',
wrapCSS: 'fancybox-order-detail',
padding: 0,
});
}
},
});
});
$(document).ready(function () {
$(document).on('click', '.add-order-message .dropdown-menu li a', function (e) {
e.preventDefault();
$('.add-order-message .select-room-type button span').html($(this).html());
$('.add-order-message .select-room-type .id_product').val($(this).attr('value'));
});
$(document).on('click', '#submitMessage', function (e) {
e.preventDefault();
sendOrderMessage();
});
initPriceTooltip();
if (typeof google === 'object'
&& typeof google.maps === 'object'
&& typeof hotel_location === 'object'
) {
initMap();
}
});

View File

@@ -1118,6 +1118,7 @@ $(document).ready(function() {
}
$(this).closest('.qty_container').find('.qty_count span').text(newQuantity);
qtyfield.val(newQuantity);
updateServiceQuantity(this);
});
// The button to decrement the product value
@@ -1132,6 +1133,7 @@ $(document).ready(function() {
$(this).closest('.qty_container').find('.qty_count span').text(1);
qtyfield.val(1);
}
updateServiceQuantity(this);
});
var ajax_check_var = '';
@@ -1203,90 +1205,59 @@ $(document).ready(function() {
ajax_check_var.abort();
}
}
function addProductToRoomType(that) {
var id_product = $(that).data('id-product');
var qty = $('input#service_product_qty_'+id_product).val();
if (typeof(qty) == 'undefined') {
qty = 1;
}
var added_service_product = [];
$('#additional_products input.service_product').each(function () {
added_service_product.push({
'id_product': $(this).data('id_product'),
'quantity':$(this).val(),
});
});
$.ajax({
type: 'POST',
headers: {
"cache-control": "no-cache"
},
url: product_controller_url,
dataType: 'JSON',
cache: false,
data: {
date_from: $('#room_check_in').val(),
date_to: $('#room_check_out').val(),
qty: qty,
id_product: $('#product_page_product_id').val(),
service_product: id_product,
added_service_product: added_service_product,
action: 'checkServiceProductWithRoomType',
ajax: true,
token: static_token
},
success: function(result) {
if (result.success) {
if (result.add) {
if ($('input#service_product_'+ id_product).length) {
var prevQty = $('input#service_product_'+ id_product).val();
if (parseInt(prevQty) > 0) {
qty = parseInt(qty) + parseInt(prevQty);
}
$('input#service_product_'+ id_product).val(qty);
} else {
$('<input type="hidden">').attr({
id: 'service_product_'+ id_product,
name: 'service_product['+ id_product +'][]',
class: 'service_product',
'data-id_product': id_product,
value: qty
}).appendTo('#additional_products');
}
}
// reset input
$(that).closest('.service_product_action_block').find('input.service_product_qty').val(1);
$(that).closest('.service_product_action_block').find('.qty_count span').text(1);
if (result.msg) {
if (result.add) {
showSuccessMessage(result.msg);
} else {
showErrorMessage(result.msg);
}
}
BookingForm.refresh();
} else {
if (result.error) {
showErrorMessage(result.error);
}
}
},
error: function(jqXHR, textStatus, errorThrown)
{
if ((textStatus != 'error' || errorThrown != '') && textStatus != 'abort')
showErrorMessage(textStatus + ': ' + errorThrown);
}
});
}
function removeRoomtypeProduct(that)
{
var id_product = $(that).data('id_product');
$(document).find('input#service_product_'+ id_product).remove();
BookingForm.refresh();
}
});
function addProductToRoomType(that) {
var id_product = $(that).data('id-product');
var qty = $('input#service_product_qty_'+id_product).val();
if (typeof(qty) == 'undefined') {
qty = 1;
}
$(that).prop('disabled', true);
if ($('#additional_products input#service_product_'+ id_product).length) {
$('input#service_product_'+ id_product).val(qty);
} else {
$('<input type="hidden">').attr({
id: 'service_product_'+ id_product,
name: 'service_product['+ id_product +'][]',
class: 'service_product',
'data-id_product': id_product,
value: qty
}).appendTo('#additional_products');
}
BookingForm.refresh().then(function (res) {
$(that).text(unselect_txt).removeClass('btn-success').removeClass('add_roomtype_product').addClass('btn-danger').addClass('remove_roomtype_product').prop('disabled', false);
showSuccessMessage(service_added_txt);
});
}
function removeRoomtypeProduct(that) {
var id_product = $(that).data('id-product');
$(document).find('input#service_product_'+ id_product).remove();
$('.select_room_service_'+ id_product).closest('.service_product_action_block').find('input.service_product_qty').val(1);
$('.select_room_service_'+ id_product).closest('.service_product_action_block').find('.qty_count span').text(1);
$(that).prop('disabled', true);
BookingForm.refresh().then(function (res) {
$('.select_room_service_'+ id_product).text(select_txt).removeClass('btn-danger').removeClass('remove_roomtype_product').addClass('btn-success').addClass('add_roomtype_product').prop('disabled', false);
showSuccessMessage(service_removed_txt);
});
}
function updateServiceQuantity(that) {
var buttonElement = $(that).closest('.service_product_action_block').find('.btn-service-product');
if ($(buttonElement).hasClass('remove_roomtype_product')) {
var id_product = $(buttonElement).data('id-product');
var newQuantity = parseInt($('#service_product_qty_'+id_product).val());
var oldQuantity = parseInt($('#service_product_'+id_product).val());
if (newQuantity != oldQuantity) {
$('#service_product_'+id_product).val(newQuantity);
BookingForm.refresh().then(function (res) {
showSuccessMessage(service_updated_txt);
});
}
}
}
function initMap() {
const map = new google.maps.Map($('#room_type_map_tab .map-wrap').get(0), {
@@ -1439,42 +1410,45 @@ var BookingForm = {
return data;
},
refresh: function(resetOccupancy = false) {
BookingForm.currentRequest = $.ajax({
url: product_controller_url,
type: 'POST',
headers: { 'cache-control': 'no-cache' },
dataType: 'JSON',
cache: false,
data: $.extend({
ajax: true,
action: 'refreshBookingForm',
}, BookingForm.getFormData()),
beforeSend: function() {
if(BookingForm.currentRequest != null) {
BookingForm.currentRequest.abort();
}
$('.book_now_submit').prop('disabled', true).find('span:not(#booking_action_loader)').hide();
$('#booking_action_block').find('#booking_action_loader').addClass('active');
},
success: function(response) {
if (response.status == true) {
$('.booking-form').replaceWith(response.html_booking_form);
BookingForm.init();
if (resetOccupancy) {
BookingForm.resetOccupancy();
return new Promise((resolve, reject) => {
BookingForm.currentRequest = $.ajax({
url: product_controller_url,
type: 'POST',
headers: { 'cache-control': 'no-cache' },
dataType: 'JSON',
cache: false,
data: $.extend({
ajax: true,
action: 'refreshBookingForm',
}, BookingForm.getFormData()),
beforeSend: function() {
if(BookingForm.currentRequest != null) {
BookingForm.currentRequest.abort();
}
$('.book_now_submit').prop('disabled', true).find('span:not(#booking_action_loader)').hide();
$('#booking_action_block').find('#booking_action_loader').addClass('active');
},
success: function(response) {
if (response.status == true) {
$('.booking-form').replaceWith(response.html_booking_form);
BookingForm.init();
if (resetOccupancy) {
BookingForm.resetOccupancy();
}
resolve(response);
}
},
error: function() {
if (!onlineFlag) {
showErrorMessage(no_internet_txt);
}
},
complete: function() {
$('.book_now_submit').prop('disabled', false).find('span:not(#booking_action_loader)').show();
$('#booking_action_block').find('#booking_action_loader').removeClass('active');
}
},
error: function(jqXHR) {
if (jqXHR.readyState == 0) {
showErrorMessage(no_internet_txt);
}
},
complete: function() {
$('.book_now_submit').prop('disabled', false).find('span:not(#booking_action_loader)').show();
$('#booking_action_block').find('#booking_action_loader').removeClass('active');
}
});
});
},
resetOccupancy: function () {

File diff suppressed because it is too large Load Diff

View File

@@ -62,7 +62,7 @@
</span>
</td>
<td class="history_method">
<a class="color-myaccount" href="javascript:showOrder(1, {$slip.id_order|intval}, '{$link->getPageLink('order-detail')|escape:'html':'UTF-8'}');">
<a class="color-myaccount" href="{$link->getPageLink('order-detail', true, NULL, "id_order={$slip.id_order|intval}")|escape:'html':'UTF-8'}" target="_blank">
#{$slip.id_order|string_format:"%06d"}
</a>
</td>

View File

@@ -785,7 +785,9 @@
{addJsDefL name=wrong_qty_cond}{l s='you are trying for a invalid quantity.' js=1}{/addJsDefL}
{addJsDefL name=select_txt}{l s='Select' js=1}{/addJsDefL}
{addJsDefL name=remove_txt}{l s='Remove' js=1}{/addJsDefL}
{addJsDefL name=cart_extra_service_add}{l s='Service is added to cart' js=1}{/addJsDefL}
{addJsDefL name=unselect_txt}{l s='Unselect' js=1}{/addJsDefL}
{addJsDefL name=service_added_txt}{l s='Service added' js=1}{/addJsDefL}
{addJsDefL name=service_removed_txt}{l s='Service removed' js=1}{/addJsDefL}
{addJsDefL name=service_updated_txt}{l s='Service updated' js=1}{/addJsDefL}
{/strip}
{/if}