Merge branch 'webkul:develop' into text-changes-2

This commit is contained in:
abhishek-webkul
2024-02-09 12:59:49 +05:30
committed by GitHub
133 changed files with 1372 additions and 612 deletions

View File

@@ -58,6 +58,8 @@ if ($excludeIds && $excludeIds != 'NaN') {
$excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', true);
$exclude_packs = (bool)Tools::getValue('exclude_packs', true);
$bookingProduct = (int) Tools::getValue('booking_product');
$context = Context::getContext();
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`
@@ -72,6 +74,7 @@ $sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, imag
(!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' ').
($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : '').
($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : '').
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '').
' GROUP BY p.id_product';
$items = Db::getInstance()->executeS($sql);

View File

@@ -200,6 +200,8 @@ $chosen-sprite-path: '../img/chosen-sprite.png'
input
position: absolute
@include left(-9000px)
&:before
visibility: hidden
.chosen-container-multi
.chosen-choices

View File

@@ -311,7 +311,7 @@
@extend .icon-cogs
.icon-AdminAdmin
@extend .icon-cog
.icon-AdminParentStats
.icon-AdminStats
@extend .icon-bar-chart
.icon-AdminStock
@extend .icon-archive

View File

@@ -84,7 +84,7 @@
<i class="icon-info"></i>
{l s='Server information'}
</h3>
{if count($uname)}
{if Tools::strlen($uname) > 0}
<p>
<strong>{l s='Server information:'}</strong> {$uname|escape:'html':'UTF-8'}
</p>

View File

@@ -36,7 +36,7 @@
<div class="panel">
<div class="row">
<div class="col-lg-3 col-md-4 col-sm-12 col-xs-12">
<img class="img-responsive" alt="PrestaShop Addons" src="themes/default/img/prestashop-addons-logo.png">
<img class="img-responsive" alt="QloApps Addons" src="themes/default/img/prestashop-addons-logo.png">
</div>
<div class="col-lg-4 col-lg-offset-1 col-md-4 col-sm-7 col-xs-12 addons-style-search-bar">
<form id="addons-search-form" method="get" action="http://addons.prestashop.com/{$iso_code}/search" class="float">
@@ -64,7 +64,7 @@
<div class="form-wrapper">
<div class="form-group">
<p>{l s='To add a new module, simply connect to your PrestaShop Addons account and all your purchases will be automatically imported.'}</p>
<p>{l s='To add a new module, simply connect to your QloApps Addons account and all your purchases will be automatically imported.'}</p>
</div>
</div><!-- /.form-wrapper -->
@@ -82,7 +82,7 @@
<div class="alert alert-info">
<h4>{l s='Can I add my own modules?'}</h4>
<p>{l s='Please note that for security reasons, you can only add modules that are being distributed on PrestaShop Addons, the official marketplace.'}</p>
<p>{l s='Please note that for security reasons, you can only add modules that are being distributed on QloApps Addons, the official marketplace.'}</p>
</div>
</div>

View File

@@ -67,20 +67,22 @@
<div>{l s='Recommended Modules and Services'}</div>
</a>
</li>
{if $add_permission eq '1' && ($context_mode != Context::MODE_HOST)}
<li>
<a id="desc-module-new" class="toolbar_btn anchor" href="#" onclick="$('#module_install').slideToggle();" title="{l s='Add a new module'}">
<i class="process-icon-new"></i>
<div>{l s='Add a new module'}</div>
</a>
</li>
{else}
<li>
<a id="desc-module-new" class="toolbar_btn" href="{$link->getAdminLink('AdminModules')}&addnewmodule" title="{l s='Add a new module'}">
<i class="process-icon-new"></i>
<div>{l s='Add a new module'}</div>
</a>
</li>
{if $add_permission eq '1'}
{if $context_mode != Context::MODE_HOST}
<li>
<a id="desc-module-new" class="toolbar_btn anchor" href="#" onclick="$('#module_install').slideToggle();" title="{l s='Add a new module'}">
<i class="process-icon-new"></i>
<div>{l s='Add a new module'}</div>
</a>
</li>
{else}
<li>
<a id="desc-module-new" class="toolbar_btn" href="{$link->getAdminLink('AdminModules')}&addnewmodule" title="{l s='Add a new module'}">
<i class="process-icon-new"></i>
<div>{l s='Add a new module'}</div>
</a>
</li>
{/if}
{/if}
{if isset($help_link)}
{* <li>

View File

@@ -395,7 +395,7 @@ $(document).ready(function () {
<div class="col-lg-9">
<div class="row">
{if !$multi_shop}
<input type="hidden" name="sp_id_shop" value="0" />
<input type="hidden" name="sp_id_shop" value="1" />
{else}
<div class="col-lg-3">
<select name="sp_id_shop" id="sp_id_shop">

View File

@@ -43,97 +43,70 @@
</thead>
<tbody>
{foreach from=$order->getDocuments() item=document}
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
<tr id="delivery_{$document->id}">
{else}
<tr id="invoice_{$document->id}">
{/if}
{elseif get_class($document) eq 'OrderSlip'}
<tr id="orderslip_{$document->id}">
{/if}
<td>{dateFormat date=$document->date_add}</td>
<td>
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
{l s='Delivery slip'}
{else}
{l s='Invoice'}
{/if}
{elseif get_class($document) eq 'OrderSlip'}
{l s='Credit Slip'}
{/if}
</td>
<td>
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&amp;submitAction=generateDeliverySlipPDF&amp;id_order_invoice={$document->id}">
{else}
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&amp;submitAction=generateInvoicePDF&amp;id_order_invoice={$document->id}">
{/if}
{elseif get_class($document) eq 'OrderSlip'}
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&amp;submitAction=generateOrderSlipPDF&amp;id_order_slip={$document->id}">
{/if}
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number}
{else}
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{/if}
{elseif get_class($document) eq 'OrderSlip'}
{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
{/if}
</a>
</td>
<td>
<td>{dateFormat date=$document->date_add}</td>
<td>
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
--
{else}
{displayPrice price=$document->total_paid_tax_incl currency=$currency->id}&nbsp;
{if $document->getTotalPaid()}
<span>
{if $document->getRestPaid() > 0}
({displayPrice price=$document->getRestPaid() currency=$currency->id} {l s='not paid'})
{elseif $document->getRestPaid() < 0}
({displayPrice price=-$document->getRestPaid() currency=$currency->id} {l s='overpaid'})
{/if}
</span>
{/if}
{/if}
{l s='Invoice'}
{elseif get_class($document) eq 'OrderSlip'}
{displayPrice price=$document->total_products_tax_incl+$document->total_shipping_tax_incl currency=$currency->id}
{l s='Credit Slip'}
{/if}
</td>
<td class="text-right document_action">
</td>
<td>
{if get_class($document) eq 'OrderInvoice'}
{if !isset($document->is_delivery)}
{if $document->getRestPaid()}
<a href="#form_add_payment_panel" class="js-set-payment btn btn-default anchor" data-amount="{$document->getRestPaid()}" data-id-invoice="{$document->id}" title="{l s='Set payment form'}">
<i class="icon-money"></i>
{l s='Enter payment'}
</a>
{/if}
<a href="#" class="btn btn-default" onclick="$('#invoiceNote{$document->id}').show(); return false;" title="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}">
{if $document->note eq ''}
<i class="icon-plus-sign-alt"></i>
{l s='Add note'}
{else}
<i class="icon-pencil"></i>
{l s='Edit note'}
{/if}
</a>
{/if}
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&amp;submitAction=generateInvoicePDF&amp;id_order_invoice={$document->id}">
{elseif get_class($document) eq 'OrderSlip'}
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&amp;submitAction=generateOrderSlipPDF&amp;id_order_slip={$document->id}">
{/if}
</td>
</tr>
{if get_class($document) eq 'OrderInvoice'}
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{elseif get_class($document) eq 'OrderSlip'}
{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
{/if}
</a>
</td>
<td>
{if get_class($document) eq 'OrderInvoice'}
{displayPrice price=$document->total_paid_tax_incl currency=$currency->id}&nbsp;
{if $document->getTotalPaid()}
<span>
{if $document->getRestPaid() > 0}
({displayPrice price=$document->getRestPaid() currency=$currency->id} {l s='not paid'})
{elseif $document->getRestPaid() < 0}
({displayPrice price=-$document->getRestPaid() currency=$currency->id} {l s='overpaid'})
{/if}
</span>
{/if}
{elseif get_class($document) eq 'OrderSlip'}
{displayPrice price=$document->total_products_tax_incl+$document->total_shipping_tax_incl currency=$currency->id}
{/if}
</td>
<td class="text-right document_action">
{if get_class($document) eq 'OrderInvoice'}
{if $document->getRestPaid()}
<a href="#form_add_payment_panel" class="js-set-payment btn btn-default anchor" data-amount="{$document->getRestPaid()}" data-id-invoice="{$document->id}" title="{l s='Set payment form'}">
<i class="icon-money"></i>
{l s='Enter payment'}
</a>
{/if}
<a href="#" class="btn btn-default" onclick="$('#invoiceNote{$document->id}').show(); return false;" title="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}">
{if $document->note eq ''}
<i class="icon-plus-sign-alt"></i>
{l s='Add note'}
{else}
<i class="icon-pencil"></i>
{l s='Edit note'}
{/if}
</a>
{/if}
</td>
</tr>
{if get_class($document) eq 'OrderInvoice'}
{if !isset($document->is_delivery)}
<tr id="invoiceNote{$document->id}" style="display:none">
<td colspan="5">
<form action="{$current_index}&amp;viewOrder&amp;id_order={$order->id}{if isset($smarty.get.token)}&amp;token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
@@ -155,7 +128,6 @@
</form>
</td>
</tr>
{/if}
{/if}
{foreachelse}
<tr>

View File

@@ -32,10 +32,10 @@
</a>
{/if}
{* Generate HTML code for printing Delivery Icon with link *}
{if $order->delivery_number}
{* {if $order->delivery_number}
<a class="btn btn-default _blank" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&amp;submitAction=generateDeliverySlipPDF&amp;id_order={$order->id}">
<i class="icon-truck"></i>
</a>
{/if}
{/if} *}
</span>
</span>

View File

@@ -182,7 +182,7 @@
<td class="text-center">
<span class="extra_service_show">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
{if ($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) > 0}
{if $data['extra_demands']|count || $data['additional_services']|count}
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}">
<i class="icon icon-lg icon-info-circle"></i>
</a>

View File

@@ -98,6 +98,7 @@
selectFirst: false,
scroll: false,
dataType: "json",
cacheLength: 0,
formatItem: function(data, i, max, value, term) {
return value;
},
@@ -115,7 +116,8 @@
ajax: "1",
token: "{getAdminToken tab='AdminCartRules'}",
tab: "AdminCartRules",
action: "searchCartRuleVouchers"
action: "searchCartRuleVouchers",
id_customer: function () { return window.id_customer },
}
}
)
@@ -808,7 +810,9 @@
ajax: "1",
tab: "AdminCustomers",
action: "searchCustomers",
customer_search: $('#customer').val()},
customer_search: $('#customer').val(),
skip_deleted: "1",
},
success : function(res)
{
if(res.found)

View File

@@ -24,7 +24,7 @@
*}
<div class="form-group">
<div class="col-lg-12">
<input id="{$id|escape:'html':'UTF-8'}" type="file" name="{$name|escape:'html':'UTF-8'}[]"{if isset($url)} data-url="{$url}"{/if}{if isset($multiple) && $multiple} multiple="multiple"{/if} style="width:0px;height:0px;" />
<input id="{$id|escape:'html':'UTF-8'}" type="file" accept="image/gif, image/jpg, image/jpeg, image/png" name="{$name|escape:'html':'UTF-8'}[]"{if isset($url)} data-url="{$url}"{/if}{if isset($multiple) && $multiple} multiple="multiple"{/if} style="width:0px;height:0px;" />
<button class="btn btn-default" data-style="expand-right" data-size="s" type="button" id="{$id|escape:'html':'UTF-8'}-add-button">
<i class="icon-folder-open"></i> {if isset($multiple) && $multiple}{l s='Add files...'}{else}{l s='Add file...'}{/if}
</button>

View File

@@ -137,7 +137,7 @@
{l s='Select Hotel'}
</label>
<div class="col-sm-5">
<select name="id_hotel" id="hotel_place" class="form-control">
<select name="id_hotel" id="hotel_place" class="form-control chosen">
{foreach from=$htl_info item=htl_dtl}
<option value="{$htl_dtl['id']}" >{$htl_dtl['hotel_name']}</option>
{/foreach}

View File

@@ -494,7 +494,7 @@ $(document).ready(function () {
<div class="col-lg-9">
<div class="row">
{if !$multi_shop}
<input type="hidden" name="sp_id_shop" value="0" />
<input type="hidden" name="sp_id_shop" value="1" />
{else}
<div class="col-lg-3">
<select name="sp_id_shop" id="sp_id_shop">

View File

@@ -180,7 +180,7 @@ class AddressCore extends ObjectModel
{
// for customer address we need to check of customer address already exists.
if ($this->id_customer) {
if ($id_address = Customer::getCustomerIdAddress($this->id_customer)) {
if ($id_address = Customer::getCustomerIdAddress($this->id_customer, false)) {
return false;
}
}

View File

@@ -601,7 +601,7 @@ class CartRuleCore extends ObjectModel
// Check if the cart rule is only usable by a specific customer, and if the current customer is the right one
if ($this->id_customer && $context->cart->id_customer != $this->id_customer) {
if (!Context::getContext()->customer->isLogged()) {
if (!defined('_PS_ADMIN_DIR_') && !Context::getContext()->customer->isLogged()) {
return (!$display_error) ? false : (Tools::displayError('You cannot use this voucher').' - '.Tools::displayError('Please log in first'));
}
return (!$display_error) ? false : Tools::displayError('You cannot use this voucher');
@@ -1466,15 +1466,16 @@ class CartRuleCore extends ObjectModel
* @param $id_lang
* @return array
*/
public static function getCartsRuleByCode($name, $id_lang, $extended = false)
public static function getCartsRuleByCode($name, $id_lang, $extended = false, $id_customer = 0)
{
$sql_base = 'SELECT cr.*, crl.*
FROM '._DB_PREFIX_.'cart_rule cr
LEFT JOIN '._DB_PREFIX_.'cart_rule_lang crl ON (cr.id_cart_rule = crl.id_cart_rule AND crl.id_lang = '.(int)$id_lang.')';
FROM '._DB_PREFIX_.'cart_rule cr
LEFT JOIN '._DB_PREFIX_.'cart_rule_lang crl ON (cr.id_cart_rule = crl.id_cart_rule AND crl.id_lang = '.(int)$id_lang.')
WHERE 1'.($id_customer ? ' AND (cr.`id_customer` = 0 OR cr.`id_customer` = '.(int) $id_customer.')' : '');
if ($extended) {
return Db::getInstance()->executeS('('.$sql_base.' WHERE code LIKE \'%'.pSQL($name).'%\') UNION ('.$sql_base.' WHERE name LIKE \'%'.pSQL($name).'%\')');
return Db::getInstance()->executeS('('.$sql_base.' AND code LIKE \'%'.pSQL($name).'%\') UNION ('.$sql_base.' AND name LIKE \'%'.pSQL($name).'%\')');
} else {
return Db::getInstance()->executeS($sql_base.' WHERE code LIKE \'%'.pSQL($name).'%\'');
return Db::getInstance()->executeS($sql_base.' AND code LIKE \'%'.pSQL($name).'%\'');
}
}
}

View File

@@ -115,7 +115,6 @@ class ConfigurationTestCore
'register_globals' => false,
'gz' => false,
'mbstring' => false,
'magicquotes' => false,
'dom' => false,
);
}
@@ -181,11 +180,6 @@ class ConfigurationTestCore
return extension_loaded('simplexml');
}
public static function test_magicquotes()
{
return function_exists('get_magic_quotes_gpc') ? !get_magic_quotes_gpc() : true;
}
public static function test_upload()
{
return ini_get('file_uploads');

View File

@@ -93,7 +93,7 @@ class CookieCore
$this->_path = str_replace('%7E', '~', $this->_path);
$this->_domain = $this->getDomain($shared_urls);
$this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE');
$this->_name = 'PrestaShop-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);
$this->_name = 'QloApps-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);
$this->_allow_writing = true;
$this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_;
if ($this->_standalone) {

View File

@@ -465,10 +465,10 @@ class CustomerCore extends ObjectModel
return Cache::retrieve($cache_id);
}
public static function getCustomerIdAddress($id_customer)
public static function getCustomerIdAddress($id_customer, $use_cache = true)
{
$cache_id = 'Customer::getCustomerIdAddress'.(int)$id_customer;
if (!Cache::isStored($cache_id)) {
if (!$use_cache || !Cache::isStored($cache_id)) {
$sql = 'SELECT id_address
FROM `'._DB_PREFIX_.'address` a
WHERE `id_customer` = '.(int)$id_customer.' AND a.`deleted` = 0';
@@ -528,14 +528,16 @@ class CustomerCore extends ObjectModel
* @return array|false|mysqli_result|null|PDOStatement|resource Corresponding customers
* @throws PrestaShopDatabaseException
*/
public static function searchByName($query, $limit = null)
public static function searchByName($query, $limit = null, $skip_deleted = false)
{
$sql_base = 'SELECT *
FROM `'._DB_PREFIX_.'customer`';
$sql = '('.$sql_base.' WHERE `email` LIKE \'%'.pSQL($query).'%\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
$sql .= ' UNION ('.$sql_base.' WHERE `id_customer` = '.(int)$query.' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
$sql .= ' UNION ('.$sql_base.' WHERE `lastname` LIKE \'%'.pSQL($query).'%\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
$sql .= ' UNION ('.$sql_base.' WHERE `firstname` LIKE \'%'.pSQL($query).'%\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
FROM `'._DB_PREFIX_.'customer`';
$where_deleted = $skip_deleted ? ' AND `deleted` = 0' : '';
$sql = '('.$sql_base.' WHERE `email` LIKE \'%'.pSQL($query).'%\' '.$where_deleted.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
$sql .= ' UNION ('.$sql_base.' WHERE `id_customer` = '.(int)$query.' '.$where_deleted.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
$sql .= ' UNION ('.$sql_base.' WHERE `lastname` LIKE \'%'.pSQL($query).'%\' '.$where_deleted.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
$sql .= ' UNION ('.$sql_base.' WHERE `firstname` LIKE \'%'.pSQL($query).'%\' '.$where_deleted.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).')';
if ($limit) {
$sql .= ' LIMIT 0, '.(int)$limit;

View File

@@ -300,6 +300,11 @@ class DispatcherCore
} else {
$controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/');
if (!isset($controllers[strtolower($this->controller)])) {
// If this is a parent tab, load the first child
if (Validate::isLoadedObject($tab) && $tab->id_parent == 0 && ($tabs = Tab::getTabs(Context::getContext()->language->id, $tab->id)) && isset($tabs[0])) {
Tools::redirectAdmin(Context::getContext()->link->getAdminLink($tabs[0]['class_name']));
}
$this->controller = $this->controller_not_found;
$controller_class = 'AdminNotFoundController';
} else {

View File

@@ -646,17 +646,17 @@ abstract class PaymentModuleCore extends Module
// THEN
// The voucher is cloned with a new value corresponding to the remainder
$reduction_amount_converted = $cart_rule['obj']->reduction_amount;
if ((int) $cart_rule['obj']->reduction_currency !== (int) $cart->id_currency) {
if ((int) $cart_rule['obj']->reduction_currency !== (int) $this->context->cart->id_currency) {
$reduction_amount_converted = Tools::convertPriceFull(
$cart_rule['obj']->reduction_amount,
new Currency($cart_rule['obj']->reduction_currency),
new Currency($cart->id_currency)
new Currency($this->context->cart->id_currency)
);
}
if ($cart_rule['obj']->reduction_tax) {
$remaining_amount = $reduction_amount_converted - $values['tax_incl'];
$remaining_amount = $values['tax_incl'] - $order->total_products_wt;
} else {
$remaining_amount = $reduction_amount_converted - $values['tax_excl'];
$remaining_amount = $values['tax_excl'] - $order->total_products;
}
if ($remaining_amount > 0 && $cart_rule['obj']->partial_use == 1 && $reduction_amount_converted > 0) {
// Create a new voucher from the original

View File

@@ -145,7 +145,12 @@ class SpecificPriceCore extends ObjectModel
FROM `'._DB_PREFIX_.'specific_price`
WHERE 1 '.self::filterOutField('id_product', $id_product).
($id_product_attribute ? ' AND id_product_attribute = '.(int) $id_product_attribute : '').'
AND id_cart = '.(int) $id_cart
AND id_cart = '.(int) $id_cart.'
GROUP BY
case when id_specific_price_rule <> 0
then id_specific_price_rule
else id_specific_price
end'
);
}

View File

@@ -881,7 +881,7 @@ class AdminControllerCore extends Controller
$key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`';
// as in database 0 means position 1 in the renderlist
if (isset($field['position'])) {
if (isset($field['position']) && Validate::isInt($value)) {
$value -= 1;
}

View File

@@ -795,6 +795,9 @@ class FrontControllerCore extends Controller
'HOOK_MAINTENANCE' => Hook::exec('displayMaintenance', array()),
'allowEmployee' => Configuration::get('PS_ALLOW_EMP'),
'maintenance' => $this->context->link->getAdminLink('AdminMaintenance', false),
'languages' => Language::getLanguages(true, $this->context->shop->id),
'lang_iso' => $this->context->language->iso_code,
'link' => $this->context->link,
));
// If the controller is a module, then getTemplatePath will try to find the template in the modules, so we need to instanciate a real frontcontroller
$front_controller = preg_match('/ModuleFrontController$/', get_class($this)) ? new FrontController() : $this;
@@ -917,8 +920,16 @@ class FrontControllerCore extends Controller
}
$excluded_key = array('isolang', 'id_lang', 'controller', 'fc', 'id_product', 'id_category', 'id_manufacturer', 'id_supplier', 'id_cms');
foreach ($_GET as $key => $value) {
if (!in_array($key, $excluded_key) && Validate::isUrl($key) && Validate::isUrl($value)) {
$params[Tools::safeOutput($key)] = Tools::safeOutput($value);
if (!in_array($key, $excluded_key)) {
if (is_array($value)) {
if (Validate::isUrl($key)) {
$params[Tools::safeOutput($key)] = $this->sanitizeQueryOutput($value);
}
} else {
if (Validate::isUrl($key) && Validate::isUrl($value)) {
$params[Tools::safeOutput($key)] = Tools::safeOutput($value);
}
}
}
}
@@ -943,6 +954,24 @@ class FrontControllerCore extends Controller
}
}
protected function sanitizeQueryOutput($query)
{
$params = array();
foreach ($query as $key => $value) {
if (Validate::isUrl($key)) {
if (is_array($value)) {
$params[Tools::safeOutput($key)] = $this->sanitizeQueryOutput($value);
} else {
if (Validate::isUrl($value)) {
$params[Tools::safeOutput($key)] = Tools::safeOutput($value);
}
}
}
}
return $params;
}
/**
* Geolocation management
*

View File

@@ -37,6 +37,8 @@ abstract class ModuleGraphCore extends Module
/**@var array string graph titles */
protected $_titles = array('main' => null, 'x' => null, 'y' => null);
protected $_formats = array('x' => null, 'y' => null);
/** @var ModuleGraphEngine graph engine */
protected $_render;
@@ -258,6 +260,7 @@ abstract class ModuleGraphCore extends Module
$this->_render->setSize($width, $height);
$this->_render->setLegend($this->_legend);
$this->_render->setTitles($this->_titles);
$this->_render->setFormat($this->_formats);
}
public function draw()

View File

@@ -1891,18 +1891,18 @@ class OrderCore extends ObjectModel
unset($invoices[$key]);
}
}
$delivery_slips = $this->getDeliverySlipsCollection()->getResults();
// @TODO review
foreach ($delivery_slips as $key => $delivery) {
$delivery->is_delivery = true;
$delivery->date_add = $delivery->delivery_date;
if (!$invoice->delivery_number) {
unset($delivery_slips[$key]);
}
}
// $delivery_slips = $this->getDeliverySlipsCollection()->getResults();
// // @TODO review
// foreach ($delivery_slips as $key => $delivery) {
// $delivery->is_delivery = true;
// $delivery->date_add = $delivery->delivery_date;
// if (!$invoice->delivery_number) {
// unset($delivery_slips[$key]);
// }
// }
$order_slips = $this->getOrderSlipsCollection()->getResults();
$documents = array_merge($invoices, $order_slips, $delivery_slips);
$documents = array_merge($invoices, $order_slips);
usort($documents, array('Order', 'sortDocuments'));
return $documents;

View File

@@ -768,7 +768,12 @@ class AdminCartRulesControllerCore extends AdminController
public function displayAjaxSearchCartRuleVouchers()
{
$found = false;
if ($vouchers = CartRule::getCartsRuleByCode(Tools::getValue('q'), (int)$this->context->language->id, true)) {
if ($vouchers = CartRule::getCartsRuleByCode(
Tools::getValue('q'),
(int)$this->context->language->id,
true,
(int) Tools::getValue('id_customer')
)) {
$found = true;
}
echo json_encode(array('found' => $found, 'vouchers' => $vouchers));

View File

@@ -333,6 +333,9 @@ class AdminCartsControllerCore extends AdminController
}
$this->context->cart = new Cart((int)$id_cart);
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
if (!$this->context->cart->id) {
$this->context->cart->recyclable = 0;
$this->context->cart->gift = 0;

View File

@@ -99,6 +99,13 @@ class AdminCustomerPreferencesControllerCore extends AdminController
'cast' => 'intval',
'type' => 'bool'
),
'PS_CUSTOMER_BIRTHDATE' => array(
'title' => $this->l('Enable date of birth'),
'hint' => $this->l('Display or not the date of birth field.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
'PS_CUSTOMER_NWSL' => array(
'title' => $this->l('Enable newsletter registration'),
'hint' => $this->l('Display or not the newsletter registration tick box.'),

View File

@@ -630,6 +630,10 @@ class AdminCustomersControllerCore extends AdminController
Tools::getValue('groupBox_'.$group['id_group'], in_array($group['id_group'], $customer_groups_ids));
}
if ($back = Tools::getValue('back')) {
$this->tpl_form_vars['back_url'] = Tools::htmlentitiesDecodeUTF8(Tools::safeOutput(urldecode($back)));
}
return parent::renderForm();
}
@@ -966,6 +970,21 @@ class AdminCustomersControllerCore extends AdminController
return parent::processSave();
}
protected function copyFromPost(&$object, $table)
{
parent::copyFromPost($object, $table);
$years = Tools::getValue('years');
$months = Tools::getValue('months');
$days = Tools::getValue('days');
if ($years != '' && $months != '' && $days != '') {
$object->birthday = (int) $years.'-'.(int) $months.'-'.(int) $days;
} else {
$object->birthday = '0000-00-00';
}
}
protected function afterDelete($object, $old_id)
{
$customer = new Customer($old_id);
@@ -1080,10 +1099,11 @@ class AdminCustomersControllerCore extends AdminController
public function ajaxProcessSearchCustomers()
{
$searches = explode(' ', Tools::getValue('customer_search'));
$skip_deleted = Tools::getValue('skip_deleted');
$customers = array();
$searches = array_unique($searches);
foreach ($searches as $search) {
if (!empty($search) && $results = Customer::searchByName($search, 50)) {
if (!empty($search) && $results = Customer::searchByName($search, 50, $skip_deleted)) {
foreach ($results as $result) {
if ($result['active']) {
$customers[$result['id_customer']] = $result;

View File

@@ -175,13 +175,12 @@ class AdminGroupsControllerCore extends AdminController
protected function renderCustomersList($group)
{
$genders = array(0 => '?');
$genders_icon = array('default' => 'unknown.gif');
foreach (Gender::getGenders() as $gender) {
/** @var Gender $gender */
$genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg';
$genders[$gender->id] = $gender->name;
$titles_array = array();
$genders = Gender::getGenders($this->context->language->id);
foreach ($genders as $gender) {
$titles_array[$gender->id_gender] = $gender->name;
}
$this->table = 'customer_group';
$this->lang = false;
$this->list_id = 'customer_group';
@@ -194,7 +193,7 @@ class AdminGroupsControllerCore extends AdminController
$this->fields_list = (array(
'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'filter_key' => 'c!id_customer', 'class' => 'fixed-width-xs'),
'id_gender' => array('title' => $this->l('Social title'), 'icon' => $genders_icon, 'list' => $genders),
'title' => array('title' => $this->l('Social title'), 'filter_key' => 'c!id_gender', 'type' => 'select', 'list' => $titles_array),
'firstname' => array('title' => $this->l('First name')),
'lastname' => array('title' => $this->l('Last name')),
'email' => array('title' => $this->l('Email address'), 'filter_key' => 'c!email', 'orderby' => true),
@@ -202,8 +201,9 @@ class AdminGroupsControllerCore extends AdminController
'date_add' => array('title' => $this->l('Registration date'), 'type' => 'date', 'class' => 'fixed-width-md', 'align' => 'center'),
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'class' => 'fixed-width-sm', 'type' => 'bool', 'search' => false, 'orderby' => false, 'filter_key' => 'c!active', 'callback' => 'printOptinIcon')
));
$this->_select = 'c.*, a.id_group';
$this->_select = 'c.*, a.id_group, gl.`name` AS title';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)';
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'gender_lang gl ON (gl.`id_gender` = c.`id_gender` AND gl.`id_lang` = '.(int) $this->context->language->id.')';
$this->_where = 'AND a.`id_group` = '.(int)$group->id.' AND c.`deleted` != 1';
$this->_where .= Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c');
self::$currentIndex = self::$currentIndex.'&id_group='.(int)$group->id.'&viewgroup';

View File

@@ -140,7 +140,6 @@ class AdminInformationControllerCore extends AdminController
'upload_max_filesize' => $this->l('In PHP configuration set upload_max_filesize to minimum 16M.'),
'max_execution_time' => $this->l('In PHP configuration set max_execution_time to minimum 500.'),
'mbstring' => $this->l('PHP Mbstring extension is not enabled.'),
'magicquotes' => $this->l('PHP magic quotes option is enabled.'),
'dom' => $this->l('PHP DOM extension is not loaded.'),
);

View File

@@ -1614,7 +1614,10 @@ class AdminOrdersControllerCore extends AdminController
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id_room']
$value['id_room'],
0,
null,
null
);
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,

View File

@@ -197,7 +197,7 @@ class AdminPPreferencesControllerCore extends AdminController
),
'submit' => array('title' => $this->l('Save'))
),
'order_by_pagination' => array(
/*'order_by_pagination' => array(
'title' => $this->l('Pagination'),
'fields' => array(
'PS_PRODUCTS_PER_PAGE' => array(
@@ -241,7 +241,7 @@ class AdminPPreferencesControllerCore extends AdminController
)
),
'submit' => array('title' => $this->l('Save'))
),
),*/
'fo_product_page' => array(
'title' => $this->l('Room type page'),
'fields' => array(

View File

@@ -99,7 +99,7 @@ class AdminProductsControllerCore extends AdminController
'Seo' => $this->l('SEO'),
'Images' => $this->l('Images'),
'ServiceProduct' => $this->l('Service Products'),
'Associations' => $this->l('Associations'),
// 'Associations' => $this->l('Associations'),
'Features' => $this->l('Features'),
'Configuration' => $this->l('Configuration'),
'Occupancy' => $this->l('Occupancy'),
@@ -112,7 +112,7 @@ class AdminProductsControllerCore extends AdminController
'Informations' => 0,
'Prices' => 1,
'Seo' => 2,
'Associations' => 3,
// 'Associations' => 3,
'Images' => 4,
'Features' => 5,
'Configuration' => 6,

View File

@@ -60,6 +60,9 @@ class AdminReferrersControllerCore extends AdminController
{
public function __construct()
{
// redirect to Dashboard for stats related to Referers
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminDashboard'));
$this->bootstrap = true;
$this->table = 'referrer';
$this->className = 'Referrer';

View File

@@ -171,9 +171,36 @@ class AdminSearchControllerCore extends AdminController
$this->context = Context::getContext();
if ($this->_list['products'] = Product::searchByName($this->context->language->id, $this->query)) {
$objRoomType = new HotelRoomType();
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$accessibleHotels = HotelBranchInformation::getProfileAccessedHotels(
$this->context->employee->id_profile,
1,
1
);
foreach ($this->_list['products'] as $key => $product) {
$roomInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']);
if (!in_array($roomInfo['id_hotel'], HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1))) {
$toUnset = false;
if ($product['booking_product']) {
$roomInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']);
if (!in_array($roomInfo['id_hotel'], $accessibleHotels)) {
$toUnset = true;
}
} else {
$associations = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product['id_product']);
// proceed only if access can not be determined from hotels
if (!count(array_intersect($associations['hotels'], $accessibleHotels))) {
$toUnset = true;
foreach ($associations['room_types'] as $idProduct) {
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct);
if (in_array($roomTypeInfo['id_hotel'], $accessibleHotels)) {
$toUnset = false;
break;
}
}
}
}
if ($toUnset) {
unset($this->_list['products'][$key]);
}
}

View File

@@ -31,6 +31,9 @@ class AdminSearchEnginesControllerCore extends AdminController
{
public function __construct()
{
// redirect to Dashboard for stats related to Search Engines
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminDashboard'));
$this->bootstrap = true;
$this->table = 'search_engine';
$this->className = 'SearchEngine';

View File

@@ -286,16 +286,25 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'title' => $this->l('Save')
),
);
if (($value = $this->getFieldValue($this->object, 'price')) != -1) {
$price = number_format($value, 6);
$price = $this->getFieldValue($this->object, 'price');
if ($price != -1 && Validate::isPrice($price)) {
$price = number_format($price, 6);
} else {
$price = '';
}
$reduction = $this->getFieldValue($this->object, 'reduction');
if (Validate::isPrice($reduction)) {
$reduction = number_format($reduction, 6);
} else {
$reduction = 0;
}
$this->fields_value = array(
'price' => $price,
'from_quantity' => (($value = $this->getFieldValue($this->object, 'from_quantity')) ? $value : 1),
'reduction' => number_format((($value = $this->getFieldValue($this->object, 'reduction')) ? $value : 0), 6),
'reduction' => $reduction,
'leave_bprice_on' => $price ? 0 : 1,
'shop_id' => (($value = $this->getFieldValue($this->object, 'id_shop')) ? $value : 1)
);

View File

@@ -99,16 +99,6 @@ class AdminStatusesControllerCore extends AdminController
'orderby' => false,
'class' => 'fixed-width-sm'
),
'delivery' => array(
'title' => $this->l('Delivery'),
'align' => 'text-center',
'active' => 'delivery',
'type' => 'bool',
'ajax' => true,
'orderby' => false,
'class' => 'fixed-width-sm'
)
,
'invoice' => array(
'title' => $this->l('Invoice'),
'align' => 'text-center',
@@ -412,28 +402,28 @@ class AdminStatusesControllerCore extends AdminController
'name' => 'name'
),
),
array(
'type' => 'checkbox',
'name' => 'pdf_delivery',
'values' => array(
'query' => array(
array('id' => 'on', 'name' => $this->l('Attach delivery slip PDF to email.'), 'val' => '1'),
),
'id' => 'id',
'name' => 'name'
),
),
array(
'type' => 'checkbox',
'name' => 'shipped',
'values' => array(
'query' => array(
array('id' => 'on', 'name' => $this->l('Set the order as shipped.'), 'val' => '1'),
),
'id' => 'id',
'name' => 'name'
)
),
// array(
// 'type' => 'checkbox',
// 'name' => 'pdf_delivery',
// 'values' => array(
// 'query' => array(
// array('id' => 'on', 'name' => $this->l('Attach delivery slip PDF to email.'), 'val' => '1'),
// ),
// 'id' => 'id',
// 'name' => 'name'
// ),
// ),
// array(
// 'type' => 'checkbox',
// 'name' => 'shipped',
// 'values' => array(
// 'query' => array(
// array('id' => 'on', 'name' => $this->l('Set the order as shipped.'), 'val' => '1'),
// ),
// 'id' => 'id',
// 'name' => 'name'
// )
// ),
array(
'type' => 'checkbox',
'name' => 'paid',
@@ -445,17 +435,17 @@ class AdminStatusesControllerCore extends AdminController
'name' => 'name'
)
),
array(
'type' => 'checkbox',
'name' => 'delivery',
'values' => array(
'query' => array(
array('id' => 'on', 'name' => $this->l('Show delivery PDF.'), 'val' => '1'),
),
'id' => 'id',
'name' => 'name'
)
),
// array(
// 'type' => 'checkbox',
// 'name' => 'delivery',
// 'values' => array(
// 'query' => array(
// array('id' => 'on', 'name' => $this->l('Show delivery PDF.'), 'val' => '1'),
// ),
// 'id' => 'id',
// 'name' => 'name'
// )
// ),
array(
'type' => 'select_template',
'is_customer_template' => 1,

View File

@@ -340,7 +340,7 @@ class AdminTabsControllerCore extends AdminController
{
$way = (int)(Tools::getValue('way'));
$id_tab = (int)(Tools::getValue('id'));
$positions = Tools::getValue('tab');
$positions = Tools::getValue('menu');
// when changing positions in a tab sub-list, the first array value is empty and needs to be removed
if (!$positions[0]) {

View File

@@ -118,6 +118,10 @@ class AdminWebserviceControllerCore extends AdminController
{
parent::processUpdateOptions();
Tools::generateHtaccess();
if (!count($this->errors)) {
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=6');
}
}
public function renderForm()

View File

@@ -221,6 +221,8 @@ class AddressControllerCore extends FrontController
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
$this->assignCountries();

View File

@@ -102,6 +102,7 @@ class AuthControllerCore extends FrontController
$newsletter = Configuration::get('PS_CUSTOMER_NWSL') || (Module::isInstalled('blocknewsletter') && Module::getInstanceByName('blocknewsletter')->active);
$this->context->smarty->assign('birthday', (bool) Configuration::get('PS_CUSTOMER_BIRTHDATE'));
$this->context->smarty->assign('newsletter', $newsletter);
$this->context->smarty->assign('optin', (bool)Configuration::get('PS_CUSTOMER_OPTIN'));
@@ -294,7 +295,9 @@ class AuthControllerCore extends FrontController
$this->errors[] = Tools::displayError('Password is required.');
} elseif (!Validate::isPasswd($passwd)) {
$this->errors[] = Tools::displayError('Invalid password.');
} else {
}
if (!count($this->errors)) {
$customer = new Customer();
$authentication = $customer->getByEmail(trim($email), trim($passwd));
if (isset($authentication->active) && !$authentication->active) {
@@ -321,6 +324,7 @@ class AuthControllerCore extends FrontController
}
}
}
if ($this->ajax) {
$return = array(
'hasError' => !empty($this->errors),
@@ -386,7 +390,7 @@ class AuthControllerCore extends FrontController
if (Validate::isEmail($email = Tools::getValue('email')) && !empty($email)) {
if (Customer::customerExists($email)) {
$this->errors[] = Tools::displayError('An account using this email address has already been registered.', false);
} elseif (Customer::customerExists($email, false, false)) {
} elseif (Tools::getValue('is_new_customer', 1) && Customer::customerExists($email, false, false)) {
$this->errors[] = Tools::displayError('You are already registered as a guest with this email address.').'&nbsp;<button type="submit" class="btn btn-link alert-link btn-transform" name="submitTransformAccount">'.Tools::displayError('Click here').'</button>'.Tools::displayError('').' to generate a password for your account.';
}
}
@@ -463,9 +467,11 @@ class AuthControllerCore extends FrontController
$this->processCustomerNewsletter($customer);
$customer->firstname = Tools::ucwords($customer->firstname);
$customer->birthday = (empty($_POST['years']) ? '' : (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days'));
if (!Validate::isBirthDate($customer->birthday)) {
$this->errors[] = Tools::displayError('Invalid date of birth.');
if (Configuration::get('PS_CUSTOMER_BIRTHDATE')) {
$customer->birthday = (empty($_POST['years']) ? '' : (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days'));
if (!Validate::isBirthDate($customer->birthday)) {
$this->errors[] = Tools::displayError('Invalid date of birth.');
}
}
// New Guest customer
@@ -588,26 +594,42 @@ class AuthControllerCore extends FrontController
}
if (!count($this->errors)) {
if (Customer::customerExists(Tools::getValue('email'))) {
$this->errors[] = Tools::displayError('An account using this email address has already been registered. Please enter a valid password or request a new one. ', false);
if (!Tools::getValue('is_new_customer', 1)) {
if ($idCustomer = Customer::customerExists(Tools::getValue('email'), true, false)) {
if ($idAddress = Customer::getCustomerIdAddress($idCustomer)) {
$address = new Address($idAddress);
}
}
} else {
if (Customer::customerExists(Tools::getValue('email'))) {
$this->errors[] = Tools::displayError('An account using this email address has already been registered. Please enter a valid password or request a new one. ', false);
}
}
$this->processCustomerNewsletter($customer);
$customer->birthday = (empty($_POST['years']) ? '' : (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days'));
if (!Validate::isBirthDate($customer->birthday)) {
$this->errors[] = Tools::displayError('Invalid date of birth');
if (Configuration::get('PS_CUSTOMER_BIRTHDATE')) {
$customer->birthday = (empty($_POST['years']) ? '' : (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days'));
if (!Validate::isBirthDate($customer->birthday)) {
$this->errors[] = Tools::displayError('Invalid date of birth');
}
}
if (!count($this->errors)) {
$customer->active = 1;
// New Guest customer
if (Tools::isSubmit('is_new_customer')) {
$customer->is_guest = !Tools::getValue('is_new_customer', 1);
if ($idCustomer) {
// update guest customer details
$customer = new Customer($idCustomer);
$customer->firstname = Tools::getValue('firstname');
$customer->lastname = Tools::getValue('lastname');
}
$customer->is_guest = 1;
} else {
$customer->is_guest = 0;
}
if (!$customer->add()) {
if (!$customer->save()) {
$this->errors[] = Tools::displayError('An error occurred while creating your account.');
} else {
foreach ($addresses_types as $addresses_type) {
@@ -624,7 +646,7 @@ class AuthControllerCore extends FrontController
if ($addresses_type == 'address_invoice') {
$_POST = $post_back;
}
if (!count($this->errors) && (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || $this->ajax || Tools::isSubmit('submitGuestAccount')) && !$$addresses_type->add()) {
if (!count($this->errors) && (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || $this->ajax || Tools::isSubmit('submitGuestAccount')) && !$$addresses_type->save()) {
$this->errors[] = Tools::displayError('An error occurred while creating your address.');
}
}
@@ -788,7 +810,6 @@ class AuthControllerCore extends FrontController
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
'{email}' => $customer->email,
'{passwd}' => str_repeat('*', strlen(Tools::getValue('passwd'))),
),
$customer->email,
$customer->firstname.' '.$customer->lastname

View File

@@ -319,25 +319,23 @@ class CartControllerCore extends FrontController
$serviceProducts = json_decode(Tools::getValue('serviceProducts'),true);
// valdiate occupancy if providede
if ($operator == 'up') {
if ($occupancyRequiredForBooking) {
foreach($occupancy as $key => $roomOccupancy) {
if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1));
if ($operator == 'up' && $occupancyRequiredForBooking) {
foreach($occupancy as $key => $roomOccupancy) {
if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1));
}
if (isset($roomOccupancy['children'])) {
if (!Validate::isUnsignedInt($roomOccupancy['children'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1));
}
if (isset($roomOccupancy['children'])) {
if (!Validate::isUnsignedInt($roomOccupancy['children'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1));
}
if ($roomOccupancy['children'] > 0) {
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) {
$this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1));
} else {
if (is_array($roomOccupancy['child_ages'])) {
foreach($roomOccupancy['child_ages'] as $childAge) {
if (!Validate::isUnsignedInt($childAge)) {
$this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1));
}
if ($roomOccupancy['children'] > 0) {
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) {
$this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1));
} else {
if (is_array($roomOccupancy['child_ages'])) {
foreach($roomOccupancy['child_ages'] as $childAge) {
if (!Validate::isUnsignedInt($childAge)) {
$this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1));
}
}
}
@@ -345,6 +343,20 @@ class CartControllerCore extends FrontController
}
}
}
if (!count($this->errors)) {
foreach($occupancy as $key => $roomOccupancy) {
if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']);
}
if ($roomOccupancy['children'] > $roomTypeInfo['max_children']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have children more than %s'), $key + 1, $roomTypeInfo['max_children']);
}
if ($roomOccupancy['adults'] + $roomOccupancy['children'] > $roomTypeInfo['max_guests']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have total guests more than %s'), $key + 1, $roomTypeInfo['max_guests']);
}
}
}
}
if ($id_hotel = $roomTypeInfo['id_hotel']) {
@@ -361,19 +373,7 @@ class CartControllerCore extends FrontController
$this->errors[] = Tools::displayError('You can\'t book room after date '.$maxOrdDate);
}
}
if ($occupancyRequiredForBooking) {
foreach($occupancy as $key => $roomOccupancy) {
if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']);
}
if ($roomOccupancy['children'] > $roomTypeInfo['max_children']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have children more than %s'), $key + 1, $roomTypeInfo['max_children']);
}
if ($roomOccupancy['adults'] + $roomOccupancy['children'] > $roomTypeInfo['max_guests']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have total guests more than %s'), $key + 1, $roomTypeInfo['max_guests']);
}
}
}
if (!$this->errors) {
$objBookingDetail = new HotelBookingDetail();
$num_days = $objBookingDetail->getNumberOfDays($date_from, $date_to);

View File

@@ -211,7 +211,7 @@ class CategoryControllerCore extends FrontController
'order_date_restrict' => $order_date_restrict
));
} else {
Tools::redirect($this->context->link->getPageLink('index'));
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
}
$feat_img_dir = _PS_IMG_.'rf/';

View File

@@ -37,6 +37,8 @@ class DiscountControllerCore extends FrontController
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
$cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false, true);

View File

@@ -53,6 +53,8 @@ class HistoryControllerCore extends FrontController
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
if ($orders = Order::getCustomerOrders($this->context->customer->id)) {
foreach ($orders as &$order) {

View File

@@ -53,12 +53,14 @@ class IdentityControllerCore extends FrontController
$email = trim(Tools::getValue('email'));
if (Tools::getValue('months') != '' && Tools::getValue('days') != '' && Tools::getValue('years') != '') {
$this->customer->birthday = (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days');
} elseif (Tools::getValue('months') == '' && Tools::getValue('days') == '' && Tools::getValue('years') == '') {
$this->customer->birthday = null;
} else {
$this->errors[] = Tools::displayError('Invalid date of birth.');
if (Configuration::get('PS_CUSTOMER_BIRTHDATE')) {
if (Tools::getValue('months') != '' && Tools::getValue('days') != '' && Tools::getValue('years') != '') {
$this->customer->birthday = (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days');
} elseif (Tools::getValue('months') == '' && Tools::getValue('days') == '' && Tools::getValue('years') == '') {
$this->customer->birthday = null;
} else {
$this->errors[] = Tools::displayError('Invalid date of birth.');
}
}
if (Tools::getIsset('old_passwd')) {
@@ -126,6 +128,8 @@ class IdentityControllerCore extends FrontController
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
if ($this->customer->birthday) {
@@ -152,6 +156,7 @@ class IdentityControllerCore extends FrontController
));
$newsletter = Configuration::get('PS_CUSTOMER_NWSL') || (Module::isInstalled('blocknewsletter') && Module::getInstanceByName('blocknewsletter')->active);
$this->context->smarty->assign('birthday', (bool) Configuration::get('PS_CUSTOMER_BIRTHDATE'));
$this->context->smarty->assign('newsletter', $newsletter);
$this->context->smarty->assign('optin', (bool)Configuration::get('PS_CUSTOMER_OPTIN'));

View File

@@ -67,9 +67,16 @@ class OrderConfirmationControllerCore extends FrontController
if (!Validate::isLoadedObject($order) || $order->id_customer != $this->context->customer->id || $this->secure_key != $order->secure_key) {
Tools::redirect($redirectLink);
}
$module = Module::getInstanceById((int)($this->id_module));
if ($order->module != $module->name) {
Tools::redirect($redirectLink);
if ($this->id_module == -1) {
if ($order->module != 'free_order') {
Tools::redirect($redirectLink);
}
} else {
$module = Module::getInstanceById((int)($this->id_module));
if ($order->module != $module->name) {
Tools::redirect($redirectLink);
}
}
}
@@ -405,6 +412,7 @@ class OrderConfirmationControllerCore extends FrontController
$this->context->smarty->assign(
array(
'refund_allowed' => (int) $order->isReturnable(),
'is_free_order' => $this->id_module == -1 && $order->module == 'free_order',
'any_back_order' => $any_back_order,
'shw_bo_msg' => $shw_bo_msg,
'back_ord_msg' => $bo_msg,

View File

@@ -37,8 +37,9 @@ class OrderFollowControllerCore extends FrontController
*/
public function initContent()
{
parent::initContent();
$this->show_breadcrump = true;
parent::initContent();
if (isset($this->context->customer->id) && $this->context->customer->id) {
$ordersReturns = OrderReturn::getOrdersReturn($this->context->customer->id, Tools::getValue('id_order'));
$this->context->smarty->assign('ordersReturns', $ordersReturns);

View File

@@ -121,6 +121,31 @@ class OrderOpcControllerCore extends ParentOrderController
$this->context->customer->newsletter = (int)Tools::isSubmit('newsletter');
$this->context->customer->optin = (int)Tools::isSubmit('optin');
$this->context->customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0);
if ($idAddressDelivery = Tools::getValue('opc_id_address_delivery')) {
$objAddress = new Address($idAddressDelivery);
if (Validate::isLoadedObject($objAddress)) {
$phoneMobile = Tools::getValue('phone_mobile');
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !$phoneMobile) {
$this->errors[] = Tools::displayError('Mobile phone number is a required field.', false);
}
if (!Validate::isPhoneNumber($phoneMobile)) {
$this->errors[] = Tools::displayError('Please enter a valid Mobile phone number.', false);
}
if (!count($this->errors)) {
$objAddress->phone_mobile = $phoneMobile;
$objAddress->firstname = $this->context->customer->firstname;
$objAddress->lastname = $this->context->customer->lastname;
if (!$objAddress->save()) {
$this->errors[] = Tools::displayError('Something went wrong while saving phone number. Please try again.', false);
}
}
}
}
$return = array(
'hasError' => !empty($this->errors),
'errors' => $this->errors,
@@ -221,10 +246,19 @@ class OrderOpcControllerCore extends ParentOrderController
if (($id_order = $this->_checkFreeOrder()) && $id_order) {
$order = new Order((int)$id_order);
$email = $this->context->customer->email;
$orderConfirmationUrl = $this->context->link->getPageLink('order-confirmation').'?id_cart='.$order->id_cart.'&id_module=-1'.'&id_order='.$id_order.'&key='.$order->secure_key;
if ($this->context->customer->is_guest) {
$this->context->customer->logout();
} // If guest we clear the cookie for security reason
$this->ajaxDie('freeorder:'.$order->reference.':'.$email);
$return = array(
'success' => true,
'reference' => $order->reference,
'email' => $email,
'order_confirmation_url' => $orderConfirmationUrl,
);
$this->ajaxDie(json_encode($return));
}
exit;
break;
@@ -520,6 +554,7 @@ class OrderOpcControllerCore extends ParentOrderController
Tools::safePostVars();
$newsletter = Configuration::get('PS_CUSTOMER_NWSL') || (Module::isInstalled('blocknewsletter') && Module::getInstanceByName('blocknewsletter')->active);
$this->context->smarty->assign('birthday', (bool) Configuration::get('PS_CUSTOMER_BIRTHDATE'));
$this->context->smarty->assign('newsletter', $newsletter);
$this->context->smarty->assign('optin', (bool)Configuration::get('PS_CUSTOMER_OPTIN'));
$this->context->smarty->assign('field_required', $this->context->customer->validateFieldsRequiredDatabase());

View File

@@ -48,6 +48,8 @@ class OrderSlipControllerCore extends FrontController
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
$this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)$this->context->cookie->id_customer));

View File

@@ -84,9 +84,6 @@ class PasswordControllerCore extends FrontController
'{passwd}' => $password
);
if (Mail::Send($this->context->language->id, 'password', Mail::l('Your new password'), $mail_params, $customer->email, $customer->firstname.' '.$customer->lastname)) {
$this->context->updateCustomer($customer);
$this->context->smarty->assign(array('confirmation' => 1, 'customer_email' => $customer->email));
} else {
$this->errors[] = Tools::displayError('An error occurred while sending the email.');

View File

@@ -327,10 +327,16 @@ class ProductControllerCore extends FrontController
if (!($date_from = Tools::getValue('date_from'))) {
$date_from = date('Y-m-d');
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
// set date to according to los
$objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange();
$los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from);
$date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from)));
}
if (!($date_to = Tools::getValue('date_to'))) {
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
// set date to according to los
$objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange();
$los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from);
$date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from)));
}
$hotel_branch_obj = new HotelBranchInformation($hotel_id);

View File

@@ -277,11 +277,12 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
$this->list_countries = array();
$countries = $this->language->getCountries();
$top_countries = array(
'fr', 'es', 'us',
'gb', 'it', 'de',
'nl', 'pl', 'id',
'be', 'br', 'se',
'ca', 'ru', 'cn',
'in', 'fr', 'es',
'us', 'gb', 'it',
'de', 'nl', 'pl',
'id', 'be', 'br',
'se', 'ca', 'ru',
'cn',
);
foreach ($top_countries as $iso) {

View File

@@ -137,7 +137,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp
'register_globals' => $this->l('PHP register_globals option is enabled'),
'gz' => $this->l('GZIP compression is not activated'),
'mbstring' => $this->l('Mbstring extension is not enabled'),
'magicquotes' => $this->l('PHP magic quotes option is enabled'),
'dom' => $this->l('Dom extension is not loaded'),
)
),

View File

@@ -878,6 +878,9 @@
<configuration id="PS_LOG_EMAILS" name="PS_LOG_EMAILS">
<value>1</value>
</configuration>
<configuration id="PS_CUSTOMER_BIRTHDATE" name="PS_CUSTOMER_BIRTHDATE">
<value>1</value>
</configuration>
<configuration id="PS_CUSTOMER_NWSL" name="PS_CUSTOMER_NWSL">
<value>1</value>
</configuration>

View File

@@ -60,9 +60,9 @@
<tab id="Administration" id_parent="" active="1" hide_host_mode="0">
<class_name>AdminAdmin</class_name>
</tab>
<tab id="Stats" id_parent="" active="1" hide_host_mode="0">
<!-- <tab id="Stats" id_parent="" active="1" hide_host_mode="0">
<class_name>AdminParentStats</class_name>
</tab>
</tab> -->
<tab id="Stock" id_parent="" active="1" hide_host_mode="0">
<class_name>AdminStock</class_name>
</tab>
@@ -282,15 +282,15 @@
<tab id="Menus" id_parent="Administration" active="1" hide_host_mode="0">
<class_name>AdminTabs</class_name>
</tab>
<tab id="Stats_1" id_parent="Stats" active="1" hide_host_mode="0">
<tab id="Stats_1" id_parent="" active="1" hide_host_mode="0">
<class_name>AdminStats</class_name>
</tab>
<tab id="Search_Engines" id_parent="Stats" active="1" hide_host_mode="0">
<!-- <tab id="Search_Engines" id_parent="Stats" active="1" hide_host_mode="0">
<class_name>AdminSearchEngines</class_name>
</tab>
<tab id="Referrers" id_parent="Stats" active="1" hide_host_mode="0">
</tab> -->
<!-- <tab id="Referrers" id_parent="Stats" active="1" hide_host_mode="0">
<class_name>AdminReferrers</class_name>
</tab>
</tab> -->
<tab id="Warehouses" id_parent="Stock" active="1" hide_host_mode="0">
<class_name>AdminWarehouses</class_name>
</tab>

View File

@@ -756,7 +756,7 @@ $(document).ready(function()
$('select.chosen').each(function(k, item){
$(item).chosen({disable_search_threshold: 10, search_contains: true});
$(item).chosen({disable_search_threshold: 5, search_contains: true});
});
// Apply chosen() when modal is loaded
$(document).on('shown.bs.modal', function (e) {

View File

@@ -139,7 +139,11 @@ function initTableDnD(table)
params['page'] = parseInt($('input[name=page]').val());
params['selected_pagination'] = parseInt($('input[name=selected_pagination]').val());
var data = $.tableDnD.serialize().replace(/table-/g, '');
if (tableId == 'tab') {
var data = $.tableDnD.serialize().replace(/table-tab/g, 'menu');
} else {
var data = $.tableDnD.serialize().replace(/table-/g, '');
}
if ((tableId == 'category') && (data.indexOf('_0&') != -1))
data += '&found_first=1';
$.ajax({

View File

@@ -18,4 +18,18 @@ $(document).ready(function(){
$("input[type='radio'][name='PS_SHOP_ENABLE']").change(function() {
$("#conf_id_PS_ALLOW_EMP").toggle('slow');
});
});
// manage dropdowns
$(document).on('click', function (e) {
const closestDropdown = $(e.target).closest('.dropdown');
if (closestDropdown.length) {
if ($(e.target).closest('.dropdown-toggle').length) {
$('.dropdown').not(closestDropdown).removeClass('open');
closestDropdown.toggleClass('open');
}
} else {
$('.dropdown').removeClass('open');
}
});
});

View File

@@ -90,7 +90,6 @@
<span style="color:#777">
Here are your login details:<br />
<span style="color:#333"><strong>E-mail address: <a href="mailto:{email}" style="color:#337ff1">{email}</a></strong></span><br />
<span style="color:#333"><strong>Password:</strong></span> {passwd}
</span>
</font>
</td>

View File

@@ -9,8 +9,6 @@ Here are your login details:
E-MAIL ADDRESS: {email}
PASSWORD: {passwd}
Important Security Tips:
* Always keep your account details safe.

View File

@@ -404,7 +404,7 @@ var ajaxCart = {
if (jsonData.avail_rooms == 0) {
disableRoomTypeDemands(1);
}
BookingForm.refresh();
BookingForm.refresh(true);
}
if (pagename == 'category') {
@@ -422,6 +422,13 @@ var ajaxCart = {
$(callerElement).closest(".room_cont").hide();
}
//$('#quantity_wanted_'+idProduct).val(1);
let addRoomButton = $(callerElement).closest('.room_info_cont').find('.booking_guest_occupancy_conatiner .dropdown-menu .add_occupancy_block .add_new_occupancy_btn');
if (jsonData.avail_rooms > 1) {
$(addRoomButton).removeClass('disabled');
} else {
$(addRoomButton).addClass('disabled');
}
}
@@ -664,6 +671,13 @@ var ajaxCart = {
$('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').hide();
}
});
let addRoomButton = $('.room_cont[data-id-product="'+idProduct+'"]').find('.room_info_cont').find('.booking_guest_occupancy_conatiner .dropdown-menu .add_occupancy_block .add_new_occupancy_btn');
if (jsonData.avail_rooms > 1) {
$(addRoomButton).removeClass('disabled');
} else {
$(addRoomButton).addClass('disabled');
}
}
if (pagename == 'orderopc') {
location.reload();

View File

@@ -17,26 +17,6 @@
* @license LICENSE.txt
*/
/* scrollbar design - start */
#dashguestcycle.dashboard-top ::-webkit-scrollbar {
height: 12px;
margin-bottom: 5px;
}
#dashguestcycle.dashboard-top ::-webkit-scrollbar-track {
background-color: #DDD;
margin: 0 6px;
border-radius: 10px;
}
#dashguestcycle.dashboard-top ::-webkit-scrollbar-thumb {
background-color: #BBB;
border-radius: 10px;
margin-bottom: 5px;
}
/* scrollbar design - end */
#dashguestcycle {
padding-bottom: 5px;
}

View File

@@ -35,6 +35,7 @@ class GraphNvD3 extends ModuleGraphEngine
private $_values;
private $_legend;
private $_titles;
private $_formats;
public function __construct($type = null)
{
@@ -113,6 +114,10 @@ class GraphNvD3 extends ModuleGraphEngine
if (jsonData.axisLabels.yAxis != null)
chart.yAxis.axisLabel(jsonData.axisLabels.yAxis);
if (jsonData.axisFormat.xAxis)
chart.xAxis.tickFormat(d3.format(jsonData.axisFormat.xAxis));
if (jsonData.axisFormat.yAxis)
chart.yAxis.tickFormat(d3.format(jsonData.axisFormat.yAxis));
d3.select("#nvd3_chart_'.($divid++).' svg")
.datum(jsonData.data)
.transition().duration(500)
@@ -148,10 +153,16 @@ class GraphNvD3 extends ModuleGraphEngine
$this->_titles = $titles;
}
public function setFormat($_formats)
{
$this->_formats = $_formats;
}
public function draw()
{
$array = array(
'axisLabels' => array('xAxis' => $this->_titles['x'], 'yAxis' => $this->_titles['y']),
'axisFormat' => array('xAxis' => $this->_formats['x'], 'yAxis' => $this->_formats['y']),
'data' => array()
);

View File

@@ -508,6 +508,8 @@ class HotelBookingDetail extends ObjectModel
$sql = $sql.' UNION '.$sql3;
}
$sql .= ' ORDER BY id_room ASC';
$unavailRoomTypes = array();
if ($unavailRooms = Db::getInstance()->executeS($sql)) {
foreach ($unavailRooms as $unavailRoomDetail) {
@@ -629,8 +631,8 @@ class HotelBookingDetail extends ObjectModel
$whereAvailRoomSearch = 'WHERE ri.`id_hotel`='.(int)$idHotel.' AND ri.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE.' AND ri.`id` NOT IN ('.$exclude_ids.') AND IF('.(int)$idRoomType.' > 0, ri.`id_product` = '.(int)$idRoomType.', 1) AND ri.`id_product` IN ('.$allowedIdRoomTypes.')';
$groupByAvailRoomSearch = '';
$orderByAvailRoomSearch = '';
$orderWayAvailRoomSearch = '';
$orderByAvailRoomSearch = 'ORDER BY ri.`id`';
$orderWayAvailRoomSearch = 'ASC';
Hook::exec('actionAvailRoomSearchSqlModifier',
array(
@@ -930,7 +932,7 @@ class HotelBookingDetail extends ObjectModel
(hrdd.`date_from` > \''.pSQL($dateFrom).'\' AND hrdd.`date_from` < \''.pSQL($dateTo).'\' 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;
$sql = $sql1.' UNION '.$sql2.' ORDER BY id_room ASC';
$part_arr = Db::getInstance()->executeS($sql);
// Get date wise available rooms
@@ -1224,7 +1226,8 @@ class HotelBookingDetail extends ObjectModel
$sql = 'SELECT bd.`id_product`, bd.`id_room`, bd.`id_hotel`, bd.`id_customer`, bd.`booking_type`, bd.`id_status` AS booking_status, bd.`comment`, rf.`room_num`, bd.`date_from`, bd.`date_to`
FROM `'._DB_PREFIX_.'htl_booking_detail` AS bd
INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = bd.`id_room`)
WHERE bd.`id_hotel`='.(int)$idHotel.' AND bd.`is_refunded` = 0 AND bd.`is_back_order` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.date_to >= \''.pSQL($dateTo).'\') AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')';
WHERE bd.`id_hotel`='.(int)$idHotel.' AND bd.`is_refunded` = 0 AND bd.`is_back_order` = 0 AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\', bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.date_to >= \''.pSQL($dateTo).'\') AND IF('.(int)$idRoomType.' > 0, rf.`id_product` = '.(int)$idRoomType.', 1) AND rf.`id_product` IN ('.$allowedIdRoomTypes.')
ORDER BY bd.`id_room` ASC';
$bookedRoomTypes = array();
if ($booked_rooms = Db::getInstance()->executeS($sql)) {

View File

@@ -976,7 +976,14 @@ class HotelCartBookingData extends ObjectModel
false
);
$cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData($value['id_product']);
$cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData(
$value['id_product'],
1,
0,
false,
2,
null
);
$cart_detail_data[$key]['selected_services'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
$value['id'],
0,

View File

@@ -305,15 +305,16 @@ class HotelHelper
return true;
}
public static function getPsProducts($id_lang, $start = 0, $limit = 0)
public static function getPsProducts($id_lang, $start = 0, $limit = 0, $booking_product = null)
{
$sql = 'SELECT p.`id_product`, pl.`name`
$sql = 'SELECT p.`id_product`, pl.`name`, p.`booking_product`
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` '.
Shop::addSqlRestrictionOnLang('pl').')
WHERE pl.`id_lang` = '.(int)$id_lang.
' ORDER BY pl.`name`'.
(isset($booking_product) ? ' AND p.`booking_product` = '.(int) $booking_product : '').'
ORDER BY pl.`name`'.
($limit > 0 ? ' LIMIT '.(int)$start.','.(int)$limit : '');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}
@@ -434,7 +435,7 @@ class HotelHelper
$product->description_short[$lang['id_lang']] = 'Fashion axe kogi yuccie, ramps shabby chic direct
trade before they sold out distillery bicycle rights. Slow-carb +1 quinoa VHS. +1 brunch trust fund,
meggings chartreuse sustainable everyday carry tumblr hoodie tacos tilde ramps post-ironic fixie.';
$product->link_rewrite[$lang['id_lang']] = Tools::link_rewrite('Super Delux Rooms');
$product->link_rewrite[$lang['id_lang']] = Tools::link_rewrite($value_prod);
}
$product->id_shop_default = Context::getContext()->shop->id;
$product->id_category_default = 2;
@@ -515,7 +516,7 @@ class HotelHelper
$htl_room_info_obj = new HotelRoomInformation();
$htl_room_info_obj->id_product = $product_id;
$htl_room_info_obj->id_hotel = $id_hotel;
$htl_room_info_obj->room_num = 'A-10'.$k;
$htl_room_info_obj->room_num = $value_prod[0].'R-10'.$k;
$htl_room_info_obj->id_status = 1;
$htl_room_info_obj->floor = 'First';
$htl_room_info_obj->save();
@@ -544,6 +545,170 @@ class HotelHelper
}
}
public function saveDummyServiceProductsAndRelatedInfo()
{
$idCategoryServices = (int) Configuration::get('PS_SERVICE_CATEGORY');
$idsGroup = array_column(Group::getGroups(Context::getContext()->language->id), 'id_group');
// create service categories
$categories = array(
'meals' => array(
'name' => 'Meals',
'id_category' => 'to_be_set_below',
),
'transfers' => array(
'name' => 'Transfers',
'id_category' => 'to_be_set_below',
)
);
foreach ($categories as &$category) {
$idCategory = $this->addCategory($category['name'], $idCategoryServices, $idsGroup);
$category['id_category'] = $idCategory;
}
// create service products
$serviceProducts = array(
array(
'name' => 'Room Maintenance Fees',
'id_category_default' => $idCategoryServices,
'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,
'show_at_front' => 0,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
),
array(
'name' => 'Internet Handling Charges',
'id_category_default' => $idCategoryServices,
'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,
'show_at_front' => 0,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_INDEPENDENT,
),
array(
'name' => 'Airport Shuttle',
'id_category_default' => $categories['transfers']['id_category'],
'description' => 'Experience convenience from touchdown to check-in with our efficient airport shuttle service, whisking you to your accommodation with ease and comfort.',
'price' => '50',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
),
array(
'name' => 'Cab on Demand',
'id_category_default' => $categories['transfers']['id_category'],
'description' => 'Explore the city conveniently with our cab-on-demand service, giving you the freedom to travel and discover local attractions at your own pace.',
'price' => '200',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
),
array(
'name' => 'Breakfast',
'id_category_default' => $categories['meals']['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,
'show_at_front' => 1,
),
array(
'name' => 'Dinner',
'id_category_default' => $categories['meals']['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,
'show_at_front' => 1,
),
);
foreach ($serviceProducts as $serviceProduct) {
$objProduct = new Product();
$objProduct->name = array();
$objProduct->description = array();
$objProduct->description_short = array();
$objProduct->link_rewrite = array();
// copy lang values
foreach (Language::getLanguages(true) as $language) {
$objProduct->name[$language['id_lang']] = $serviceProduct['name'];
$objProduct->description[$language['id_lang']] = $serviceProduct['description'];
$objProduct->description_short[$language['id_lang']] = $serviceProduct['description'];
$objProduct->link_rewrite[$language['id_lang']] = Tools::link_rewrite($serviceProduct['name']);
}
$objProduct->id_shop_default = Context::getContext()->shop->id;
$objProduct->id_category_default = $serviceProduct['id_category_default'];
$objProduct->price = $serviceProduct['price'];
$objProduct->active = 1;
$objProduct->quantity = 999999999;
$objProduct->booking_product = 0;
$objProduct->service_product_type = Product::SERVICE_PRODUCT_WITH_ROOMTYPE;
$objProduct->auto_add_to_cart = $serviceProduct['auto_add_to_cart'];
$objProduct->show_at_front = $serviceProduct['show_at_front'];
$objProduct->available_for_order = 1;
if ($serviceProduct['auto_add_to_cart']) {
$objProduct->price_addition_type = $serviceProduct['price_addition_type'];
}
$objProduct->is_virtual = 1;
$objProduct->indexed = 1;
$objProduct->save();
$idProduct = $objProduct->id;
// add to applicable categories
$objCategory = new Category($serviceProduct['id_category_default']);
if ($categories = $objCategory->getParentsCategories()) {
$idsCategory = array();
foreach ($categories as $category) {
$idsCategory[] = $category['id_category'];
}
$objProduct->addToCategories($idsCategory);
}
Search::indexation(Tools::link_rewrite($serviceProduct['name']), $idProduct);
StockAvailable::updateQuantity($idProduct, null, 999999999);
// save service product images
$imagesBasePath = _PS_MODULE_DIR_.'hotelreservationsystem/views/img/prod_imgs/'.$idProduct.'/';
$imagesTypes = ImageType::getImagesTypes('products');
if (is_dir($imagesBasePath) && $opendir = opendir($imagesBasePath)) {
while (($image = readdir($opendir)) !== false) {
$sourceImagePath = $imagesBasePath.$image;
if (ImageManager::isRealImage($sourceImagePath)
&& ImageManager::isCorrectImageFileExt($sourceImagePath)
) {
$objImage = new Image();
$objImage->id_product = $idProduct;
$objImage->position = Image::getHighestPosition($idProduct) + 1;
$objImage->cover = 1;
$objImage->add();
$destinationPath = $objImage->getPathForCreation();
foreach ($imagesTypes as $imageType) {
ImageManager::resize(
$sourceImagePath,
$destinationPath.'-'.$imageType['name'].'.jpg',
$imageType['width'],
$imageType['height']
);
}
ImageManager::resize($sourceImagePath, $destinationPath.'.jpg');
}
}
closedir($opendir);
}
// link to all demo room types
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$objRoomTypeServiceProduct->addRoomProductLink(
$idProduct,
array(1, 2, 3, 4),
RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE
);
}
}
public function saveAdvancedPaymentInfo($id_product)
{
$obj_adv_pmt = new HotelAdvancedPayment();
@@ -584,6 +749,7 @@ class HotelHelper
$this->saveDummyHotelImages($htl_id);
$this->saveDummyHotelFeatures($htl_id);
$this->saveDummyProductsAndRelatedInfo($htl_id);
$this->saveDummyServiceProductsAndRelatedInfo();
return true;
}

View File

@@ -186,14 +186,6 @@ class HotelOrderRefundRules extends ObjectModel
if ($refRule['payment_type'] == HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE) {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_PERCENTAGE;
$bookingCancellationDetail['cancelation_charge'] = $paidAmount * ($refundValue / 100);
if ($defaultCurrency != $orderCurrency) {
$bookingCancellationDetail['cancelation_charge'] = Tools::convertPriceFull(
$bookingCancellationDetail['cancelation_charge'],
$objDefaultCurrency,
$objOrderCurrency
);
}
} else {
$bookingCancellationDetail['reduction_type'] = HotelOrderRefundRules::WK_REFUND_RULE_PAYMENT_TYPE_FIXED;
if ($defaultCurrency != $orderCurrency) {

View File

@@ -190,7 +190,7 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_cart`, p.`auto_add_to_cart`, p.`allow_multiple_quantity`, cbd.`id` as `htl_cart_booking_id`,
p.`price_addition_type`, cbd.`id_product` as `room_type_id_product`, pl.`name`, cbd.`date_from`, cbd.`date_to`
FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
INNER JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')
WHERE 1';

View File

@@ -112,7 +112,8 @@ class AdminAddHotelController extends ModuleAdminController
$smartyVars['lang'] = true;
$smartyVars['iso'] = $this->context->language->iso_code;
//lang vars
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$smartyVars['languages'] = Language::getLanguages(false);
$smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId);
@@ -501,12 +502,20 @@ class AdminAddHotelController extends ModuleAdminController
if ($catState) {
if ($catCity = $objHotelBranch->addCategory($city, $catState, $groupIds)) {
$hotelCatName = $objHotelBranch->hotel_name;
if ($catHotel = $objHotelBranch->addCategory(
$hotelCatName, $catCity, $groupIds, 1, $newIdHotel
)) {
$objHotelBranch = new HotelBranchInformation($newIdHotel);
$objHotelBranch->id_category = $catHotel;
$objHotelBranch->save();
// add/update hotel category
if ($objHotelBranch->id_category) {
$objCategory = new Category($objHotelBranch->id_category);
$objCategory->name = $objHotelBranch->hotel_name;
$objCategory->save();
} else {
if ($catHotel = $objHotelBranch->addCategory(
$hotelCatName, $catCity, $groupIds, 1, $newIdHotel
)) {
$objHotelBranch = new HotelBranchInformation($newIdHotel);
$objHotelBranch->id_category = $catHotel;
$objHotelBranch->save();
}
}
}
}

View File

@@ -197,7 +197,7 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
$currencySign = $objCurrency->sign;
$dateFrom = date('d-m-Y');
$dateTo = date('d-m-Y', strtotime($dateFrom) + 86400);
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$smartyVars['languages'] = Language::getLanguages(false);
$smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId);

View File

@@ -44,8 +44,11 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$this->context->cookie->id_cart = (int) $objCart->id;
} else {
// use previous cart
if (!validate::isLoadedObject($objCart = new Cart($this->context->cookie->id_cart))) {
$objCart = new Cart($this->context->cookie->id_cart);
$isCartValid = Validate::isLoadedObject($objCart);
if (!$isCartValid || ($isCartValid && $objCart->orderExists())) {
$objCart = $this->createNewCart();
$this->context->cookie->id_cart = (int) $objCart->id;
}
}
$this->context->cart = $objCart;
@@ -418,7 +421,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$bookingParams['date_from'] = $searchDateFrom;
$bookingParams['date_to'] = $searchDateTo;
$bookingParams['hotel_id'] = $searchIdHotel;
$bookingParams['room_type'] = $searchIdRoomType;
$bookingParams['id_room_type'] = $searchIdRoomType;
$bookingParams['adults'] = $adults;
$bookingParams['children'] = $children;
$bookingParams['num_rooms'] = $num_rooms;

View File

@@ -61,7 +61,7 @@ class AdminHotelFeaturesController extends ModuleAdminController
$smartyVars = array();
//lang vars
$languages = Language::getLanguages(false);
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$currentLang = Language::getLanguage((int) $currentLangId);
$smartyVars['languages'] = $languages;
$smartyVars['currentLang'] = $currentLang;

View File

@@ -152,7 +152,7 @@ class AdminOrderRefundRulesController extends ModuleAdminController
}
//lang vars
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$smartyVars['languages'] = Language::getLanguages(false);
$smartyVars['currentLang'] = Language::getLanguage((int) $currentLangId);
@@ -244,14 +244,6 @@ class AdminOrderRefundRulesController extends ModuleAdminController
$this->errors[] = $this->l('Enter number of days before check-in date for this rule to be applicable.');
} else if (!Validate::isUnsignedInt($cancelationDays)) {
$this->errors[] = $this->l('Enter valid number of days.');
} else if ($objRefundRule->checkIfRuleExistsByCancelationdays($cancelationDays)) {
if ($idRefundRule) {
if ($objRefundRule->days != $cancelationDays) {
$this->errors[] = $this->l('Refund rule for ').$cancelationDays.$this->l(' days already exists.');
}
} else {
$this->errors[] = $this->l('Refund rule for ').$cancelationDays.$this->l(' days already exists.');
}
}
if (!count($this->errors)) {

View File

@@ -151,7 +151,7 @@ class AdminRoomTypeGlobalDemandController extends ModuleAdminController
$smartyVars = array();
$objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$smartyVars['defaultcurrencySign'] = $objCurrency->sign;
$currentLangId = Configuration::get('PS_LANG_DEFAULT');
$currentLangId = $this->default_form_language ? $this->default_form_language : Configuration::get('PS_LANG_DEFAULT');
$languages = Language::getLanguages(false);
$smartyVars['languages'] = $languages;
$currentLang = Language::getLanguage((int) $currentLangId);

View File

@@ -472,6 +472,22 @@ p.room_cat_data
border-color: #4d90fe;
}
.gm-style-iw-d h6 {
font-family: unset;
font-size: 14px;
color: #333;
font-weight: 500;
margin: 0;
}
.gm-style-iw-d p {
font-family: unset;
font-size: 13px;
color: #333;
font-weight: 400;
margin: 0;
}
/* ==== AdminHotelFeaturePricesSettingsController ==== */
.week_days {
display: none;

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 KiB

View File

@@ -69,7 +69,8 @@ var GoogleMapsManager = {
var that = this;
that.setDefaultLatLng(function() {
that.map = new google.maps.Map($(that.mapDiv).get(0), {
zoom: that.defaultZoom
zoom: that.defaultZoom,
clickableIcons: true,
});
that.map.setCenter(that.defaultLatLng);
if (that.defaultLatLng && that.formattedAddress) {
@@ -80,11 +81,78 @@ var GoogleMapsManager = {
// register marker events
that.map.addListener('click', function (e) {
var latLng = e.latLng;
that.geocoder.geocode({ location: latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results[0]) {
that.addMarker(latLng, results[0]);
}
});
var isInfoWindowNeeded = true;
// if it is a Place Of Interest (POI), event contains the property 'placeId'
if (Object.hasOwn(e, 'placeId')) {
isInfoWindowNeeded = false;
that.geocoder.geocode({ location: latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results[0]) {
var request = {
placeId: e.placeId,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
var content = '<div><h6>' + place.name + '</h6><p>' +
results[0].formatted_address + '</p></div>';
var callback = function (latLng) {
that.setFormVars({
lat: latLng.lat(),
lng: latLng.lng(),
formattedAddress: content,
inputText: $('#pac-input').val(),
});
}
that.addMarker(
latLng,
results[0],
null,
isInfoWindowNeeded,
callback(latLng)
);
}
});
}
});
} else {
that.geocoder.geocode({ location: latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results[0]) {
var request = {
placeId: results[0].place_id,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
var content = '<div><h6>' + place.name + '</h6><p>' +
results[0].formatted_address + '</p></div>';
var callback = function (latLng) {
that.setFormVars({
lat: latLng.lat(),
lng: latLng.lng(),
formattedAddress: content,
inputText: $('#pac-input').val(),
});
}
that.addMarker(
latLng,
results[0],
null,
isInfoWindowNeeded,
callback(latLng)
);
}
});
}
});
}
});
if(cb && typeof cb === 'function') {
cb();
@@ -122,7 +190,7 @@ var GoogleMapsManager = {
};
that.addMarker(latLng, place);
var content = '<div><strong>' + place.name + '</strong><br>' + place.formatted_address;
var content = '<div><h6>' + place.name + '</h6><p>' + place.formatted_address + '</p></div>';
that.setFormVars({
lat: latLng.lat,
lng: latLng.lng,
@@ -142,7 +210,7 @@ var GoogleMapsManager = {
}
});
},
addMarker: function(latLng, address = null, fa = null, cb = null) {
addMarker: function(latLng, address = null, fa = null, addInfoWindow = true, cb = null) {
var that = this;
that.clearAllMarkers();
var marker = new google.maps.Marker({
@@ -163,23 +231,36 @@ var GoogleMapsManager = {
});
});
if (address === null && fa) {
// open info window
that.addInfoWindow(marker, fa);
if (addInfoWindow) {
if (address === null && fa) {
// open info window
that.addInfoWindow(marker, fa);
} else {
var request = {
placeId: address.place_id,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
// open info window
var content = '<div><h6>' + place.name + '</h6><p>' + address.formatted_address + '</p></div>';
that.addInfoWindow(marker, content);
if(cb && typeof cb === 'function') {
cb();
}
}
});
}
} else {
var request = {
placeId: address.place_id,
fields: ['name'],
};
that.placesService.getDetails(request, function(place, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
// open info window
var content = '<div><strong>' + place.name + '</strong><br>' +
address.formatted_address + '</div>';
that.addInfoWindow(marker, content);
}
});
if(cb && typeof cb === 'function') {
cb();
}
return marker;
}
},
clearAllMarkers: function() {
for (var i = 0; i < this.markers.length; i++) {
@@ -190,13 +271,21 @@ var GoogleMapsManager = {
addInfoWindow: function(marker, content) {
if (typeof google === 'object') {
var that = this;
var infoWindow = new google.maps.InfoWindow({
content: content,
maxWidth: 200,
});
infoWindow.open({
anchor: marker,
map: that.map
});
google.maps.event.addListener(infoWindow, 'closeclick', function () {
that.clearAllMarkers();
});
var latLng = marker.getPosition();
that.setFormVars({
lat: latLng.lat(),
@@ -214,6 +303,10 @@ var GoogleMapsManager = {
},
}
$(document).on('click', 'button.gm-ui-hover-effect', function () {
GoogleMapsManager.clearAllMarkers();
});
function initGoogleMaps() {
if (typeof enabledDisplayMap != 'undefined'
&& typeof google === 'object'
@@ -767,6 +860,13 @@ function showLangField(select_lang_name, id_lang)
$('.all_lang_icon').attr('src', img_dir_l+id_lang+'.jpg');
$('#choosedLangId').val(id_lang);
var id_old_language = id_language;
id_language = id_lang;
if (id_old_language != id_lang) {
changeEmployeeLanguage();
}
}
/* ---- HotelConfigurationSettingController Admin ---- */

View File

@@ -28,6 +28,8 @@ $(document).ready(function() {
url: rooms_booking_url,
method: 'POST',
extraParams: function() {
removeInitializedTooltips();
return $.extend(
{
ajax: true,
@@ -183,6 +185,14 @@ $(document).ready(function() {
calendar.render();
}
function removeInitializedTooltips() {
$('#fullcalendar a.day-info, #fullcalendar .fc-daygrid-event').each(function () {
if ($(this).data('ui-tooltip')) {
$(this).tooltip('destroy');
}
});
}
function getSearchData()
{
return {
@@ -869,6 +879,12 @@ $(document).ready(function() {
$("#cartModal").html(result.cart_content);
}
$("#cart_record").html(result.total_products_in_cart);
if (parseInt(result.total_products_in_cart) > 0) {
$('#cart_record').closest('button').removeClass('disabled');
} else {
$('#cart_record').closest('button').addClass('disabled');
}
}
}
});

View File

@@ -292,7 +292,7 @@
{l s='Upload images' mod='hotelreservationsystem'}&nbsp;:&nbsp;&nbsp;
</label>
<div class="col-sm-5">
<input class="form-control-static" type="file" id="hotel_images" name="hotel_images[]" multiple>
<input class="form-control-static" type="file" accept="image/gif, image/jpg, image/jpeg, image/png" id="hotel_images" name="hotel_images[]" multiple>
</div>
</div>
<hr>
@@ -483,6 +483,9 @@
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
// for tiny mce setup
var iso = "{$iso|escape:'htmlall':'UTF-8'}";
var pathCSS = "{$smarty.const._THEME_CSS_DIR_|escape:'htmlall':'UTF-8'}";
@@ -497,4 +500,4 @@
});
</script>
{/block}
{/block}

View File

@@ -323,4 +323,11 @@
{addJsDef autocomplete_room_search_url = $link->getAdminLink('AdminHotelFeaturePricesSettings')}
{addJsDef defaultcurrency_sign = $defaultcurrency_sign mod='hotelreservationsystem'}
{addJsDef booking_date_from = $date_from mod='hotelreservationsystem'}
{/strip}
{/strip}
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -133,3 +133,10 @@
{addJsDefL name=chld_ftr_text_err}{l s='Enter child feature name.' js=1 mod='hotelreservationsystem'}{/addJsDefL}
{addJsDefL name=pos_numeric_err}{l s='Position should be numeric.' js=1 mod='hotelreservationsystem'}{/addJsDefL}
{/strip}
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -188,7 +188,7 @@
<div class="panel">
<div class="panel-heading">
<i class="icon-info"></i> {if !isset($booking_product) || (isset($booking_product) && $booking_product == 1)}{l s='Booking Calender' mod='hotelreservationsystem'}{else}{l s='Service Products' mod='hotelreservationsystem'}{/if }
<button type="button" class="btn btn-primary" id="cart_btn" data-toggle="modal" data-target="#cartModal"><i class="icon-shopping-cart"></i> {l s='Cart' mod='hotelreservationsystem'} <span class="badge" id="cart_record">{$total_products_in_cart}</span></button>
<button type="button" class="btn btn-primary {if $total_products_in_cart|intval == 0}disabled{/if}" id="cart_btn" data-toggle="modal" data-target="#cartModal"><i class="icon-shopping-cart"></i> {l s='Cart' mod='hotelreservationsystem'} <span class="badge" id="cart_record">{$total_products_in_cart}</span></button>
</div>
{if !isset($booking_product) || (isset($booking_product) && $booking_product == 1)}
<div id='fullcalendar'></div>

View File

@@ -133,3 +133,10 @@
</div>
</form>
</div>
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -274,4 +274,11 @@
</button>
</div>
</form>
</div>
</div>
{block name=script}
<script type="text/javascript">
var id_language = {$defaultFormLanguage|intval};
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
</script>
{/block}

View File

@@ -130,10 +130,6 @@ class StatsBestCategories extends ModuleGrid
<div class="panel-heading">
<i class="icon-sitemap"></i> '.$this->displayName.'
</div>';
if (!(Module::isEnabled('statsdata') && Configuration::get('PS_STATSDATA_PAGESVIEWS'))) {
$link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata';
$this->html .= '<div class="alert alert-info">'.$this->l('You must enable the "Save global page views" option from ').'<u><a href="'.$link.'" target="_blank">Data mining for statistics</a></u>'.$this->l(' module in order to display the most viewed hotels, or use the QloApps Google Analytics module.').'</div>';
}
$this->html .= $this->engine($engine_params).'
<div class="row form-horizontal">

View File

@@ -136,10 +136,7 @@ class StatsBestProducts extends ModuleGrid
}
$html = '<div class="panel-heading">'.$this->displayName.'</div>';
if (!(Module::isEnabled('statsdata') && Configuration::get('PS_STATSDATA_PAGESVIEWS'))) {
$link = $this->context->link->getAdminLink('AdminModules').'&configure=statsdata';
$html .= '<div class="alert alert-info">'.$this->l('You must enable the "Save global page views" option from ').'<u><a href="'.$link.'" target="_blank">Data mining for statistics</a></u>'.$this->l(' module in order to display the most viewed room types, or use the QloApps Google Analytics module.').'</div>';
}
$html .= $this->engine($engine_params).'
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI'].'&export=1').'">
<i class="icon-cloud-download"></i> '.$this->l('CSV Export').'

View File

@@ -26,7 +26,8 @@
min-width: 150px;
margin-bottom: 25px;
padding: 10px 15px;
border: 1.5px solid #555;
border: 1.5px solid transparent;
border-radius: 2px;
background-color: #CFE2F3;
color: #111;
}
@@ -37,7 +38,7 @@
}
connection {
border: 1px solid #000;
border: 1px solid #777;
}
connection span {

View File

@@ -129,6 +129,7 @@ class StatsNewsletter extends ModuleGraph
$this->_titles['main'][1] = $this->l('Visitors');
$this->_titles['main'][2] = $this->l('Newsletter statistics');
$this->_titles['main'][3] = $this->l('Both');
$this->_formats['y'] = 'd';
$this->_query = 'SELECT newsletter_date_add
FROM `'._DB_PREFIX_.'customer`

View File

@@ -314,7 +314,7 @@ class StatsPersonalInfos extends ModuleGraph
FROM `'._DB_PREFIX_.'customer`
WHERE (YEAR(CURDATE()) - YEAR(`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(`birthday`, 5)) >= 60
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
AND `birthday` IS NOT NULL';
AND `birthday` IS NOT NULL AND `birthday` != "0000-00-00"';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
if (isset($result['total']) && $result['total']) {
$this->_values[] = $result['total'];

View File

@@ -343,6 +343,7 @@ class StatsProduct extends ModuleGraph
$this->_titles['main'][1] = $this->l('Views (x100)');
$this->_titles['x'] = $this->l('Date');
$this->_titles['y'] = $this->l('Room nights, Views (x100)');
$this->_formats['y'] = 'd';
$this->query[0] = 'SELECT o.`date_add`, SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) AS total
FROM `'._DB_PREFIX_.'order_detail` od

View File

@@ -171,6 +171,7 @@ class StatsRegistrations extends ModuleGraph
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
AND `date_add` BETWEEN';
$this->_titles['main'] = $this->l('Number of customer registrations');
$this->_formats['y'] = 'd';
$this->setDateGraph($layers, true);
}

Some files were not shown because too many files have changed in this diff Show More