Merge branch 'webkul:develop' into gli-1637

This commit is contained in:
abhishek-webkul
2024-02-13 12:40:36 +05:30
committed by GitHub
76 changed files with 903 additions and 399 deletions

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

@@ -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

@@ -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

@@ -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

@@ -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;

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();
}
@@ -1095,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

@@ -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

@@ -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

@@ -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

@@ -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'));
@@ -389,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.';
}
}
@@ -466,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
@@ -591,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) {
@@ -627,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.');
}
}

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')) {
@@ -154,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

@@ -554,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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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);

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

@@ -860,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

@@ -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'}";

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

@@ -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);
}

View File

@@ -234,6 +234,10 @@ class StatsSales extends ModuleGraph
return $this->getOrderStatusesData();
}
if ($this->option == 1) {
$this->_formats['y'] = 'd';
}
$this->query = 'SELECT o.`invoice_date`, ROUND(o.`total_paid_real` / o.`conversion_rate`, 2) as total_paid_real,
(
SELECT hbd.`id_hotel`

View File

@@ -157,6 +157,7 @@ class StatsVisits extends ModuleGraph
protected function getData($layers)
{
$this->setDateGraph($layers, true);
$this->_formats['y'] = 'd';
}
protected function setAllTimeValues($layers)

View File

@@ -19,7 +19,7 @@
<div id="filter_results" class="row block">
<div class="col-sm-12">
{if isset($config) && $config['SHOW_AMENITIES_FILTER']}
{if isset($config) && $config['SHOW_AMENITIES_FILTER'] && $all_feat}
<div class="row margin-lr-0 layered_filter_cont">
<div class="col-sm-12 layered_filter_heading">
<div class="row margin-lr-0">

View File

@@ -152,7 +152,7 @@ class WkHotelRoomDisplay extends ObjectModel
// update global configuration values in multilang
Configuration::updateValue('HOTEL_ROOM_DISPLAY_HEADING', $HOTEL_ROOM_DISPLAY_HEADING);
Configuration::updateValue('HOTEL_ROOM_DISPLAY_DESCRIPTION', $HOTEL_ROOM_DISPLAY_DESCRIPTION);
if ($roomTypes = HotelHelper::getPsProducts(Configuration::get('PS_LANG_DEFAULT'), 0, 5)) {
if ($roomTypes = HotelHelper::getPsProducts(Configuration::get('PS_LANG_DEFAULT'), 0, 5, 1)) {
foreach ($roomTypes as $product) {
if (Validate::isLoadedObject($objProduct = new Product($product['id_product']))) {
$objRoomBlock = new WkHotelRoomDisplay();

View File

@@ -23,22 +23,17 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="pagenotfound">
<h1>{l s='This page is not available'}</h1>
<img class="img-responsive" src="{$img_dir}404.png">
<h1>{l s='Page not found!!!'}</h1>
<p>
{l s='We\'re sorry, but the Web address you\'ve entered is no longer available.'}
</p>
<h3>{l s='To find a room type, please type its name in the field below.'}</h3>
<form action="{$link->getPageLink('search')|escape:'html':'UTF-8'}" method="post" class="std">
<fieldset>
<div>
<label for="search_query">{l s='Search our catalog:'}</label>
<input id="search_query" name="search_query" type="text" class="form-control grey" />
<button type="submit" name="Submit" value="OK" class="btn btn-default button button-small"><span>{l s='Search'}</span></button>
</div>
</fieldset>
</form>
<div class="buttons"><a class="btn btn-default button button-medium" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Home'}"><span><i class="icon-chevron-left left"></i>{l s='Home page'}</span></a></div>
<div class="buttons">
<a class="btn btn-primary" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Home'}">
<span>{l s='Home Page'}</span>
</a>
</div>
</div>

View File

@@ -63,8 +63,8 @@
</div>
<div class="form-group col-sm-7 col-xs-6 occupancy_count_block">
<div class="row">
<label class="col-sm-12 clearfix">{l s='Children'}</label>
<div class="col-sm-12">
<label class="col-sm-12">{l s='Children'}</label>
<div class="col-sm-12 clearfix">
<input type="hidden" class="num_occupancy num_children room_occupancies" name="occupancy[{$key|escape:'htmlall':'UTF-8'}][children]" max="{}" value="{$occupancy['children']|escape:'htmlall':'UTF-8'}">
<div class="occupancy_count pull-left">
<span>{$occupancy['children']|escape:'htmlall':'UTF-8'}</span>
@@ -174,7 +174,10 @@
{/if}
</div>
<div class="add_occupancy_block">
<a class="add_new_occupancy_btn" href="#"><i class="icon-plus"></i> <span>{l s='Add Room'}</span></a>
<a class="add_new_occupancy_btn{if isset($occupancies) && $occupancies && isset($total_available_rooms) && $total_available_rooms <= count($occupancies)} disabled{/if}" data-title-available="{l s='Click to add more rooms.'}" data-title-unavailable="{l s='No more rooms available.'}" href="#">
<i class="icon-plus"></i>
<span>{l s='Add Room'}</span>
</a>
</div>
</div>
</div>

View File

@@ -464,49 +464,51 @@
<input type="password" class="is_required validate form-control" data-validate="isPasswd" name="passwd" id="passwd" />
<span class="form_info">{l s='(Five characters minimum)'}</span>
</div>
<div class="form-group">
<label>{l s='Date of Birth'}</label>
<div class="row">
<div class="col-xs-4">
<select id="days" name="days" class="form-control">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
{/foreach}
</select>
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
</div>
<div class="col-xs-4">
<select id="months" name="months" class="form-control">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="years" name="years" class="form-control">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
{/foreach}
</select>
{if isset($birthday) && $birthday}
<div class="form-group">
<label>{l s='Date of Birth'}</label>
<div class="row">
<div class="col-xs-4">
<select id="days" name="days" class="form-control">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
{/foreach}
</select>
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
</div>
<div class="col-xs-4">
<select id="months" name="months" class="form-control">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="years" name="years" class="form-control">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
</div>
</div>
</div>
{/if}
{if isset($newsletter) && $newsletter}
<div class="checkbox">
<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) AND $smarty.post.newsletter == 1} checked="checked"{/if} />

View File

@@ -8312,47 +8312,36 @@ table.discount i {
#pagenotfound .pagenotfound {
max-width: 824px;
margin: 100px auto 100px auto;
margin: 0px auto;
text-align: center; }
#pagenotfound .pagenotfound .img-404 {
padding: 8px 0 27px 0; }
#pagenotfound .pagenotfound .img-404 img {
max-width: 100%; }
#pagenotfound .pagenotfound img {
margin: 0 auto; }
#pagenotfound .pagenotfound h1 {
font: 600 28px/34px 'Oxygen', serif;
font-size: 40px;
font-weight: 700;
color: #333;
text-transform: uppercase;
margin-bottom: 7px; }
#pagenotfound .pagenotfound p {
font: 600 16px/20px 'Oxygen', serif;
color: #555454;
text-transform: uppercase;
border-bottom: 1px solid #d6d4d4;
padding-bottom: 19px;
margin-bottom: 20px; }
#pagenotfound .pagenotfound h3 {
font-weight: bold;
color: #333;
font-size: 13px;
line-height: normal;
margin-bottom: 18px; }
#pagenotfound .pagenotfound label {
font-weight: normal; }
@media (max-width: 767px) {
#pagenotfound .pagenotfound label {
display: block; } }
#pagenotfound .pagenotfound .form-control {
max-width: 293px;
display: inline-block;
margin-right: 5px; }
@media (max-width: 767px) {
#pagenotfound .pagenotfound .form-control {
margin: 0 auto 15px auto;
display: block; } }
margin-top: 30px;
font-size: 18px;
line-height: 24px;
margin-bottom: 0; }
#pagenotfound .pagenotfound .buttons {
padding: 48px 0 20px 0; }
#pagenotfound .pagenotfound .buttons .button-medium i.left {
font-size: 17px; }
margin-top: 5px; }
#pagenotfound .pagenotfound .buttons a.btn-primary {
border: none;
border-radius: 2px;
font-size: 14px;
padding: 15px 20px;
font-weight: 600;
background-color: #1292FF;
color: #FFFFFF; }
#pagenotfound .pagenotfound .buttons a.btn-primary:hover {
opacity: 0.8; }
#pagenotfound .pagenotfound .buttons a.btn-primary:hover span {
background: none; }
#account-creation_form fieldset.reversoform {
padding: 10px !important; }

View File

@@ -129,6 +129,154 @@ button[type='button'].cancel-login {
color: #FFF;
}
.header-container {
display: flex;
justify-content: center;
align-items: center;
margin-right: auto;
margin-left: auto;
position: relative;
}
.header-container.multilang .language-selector-wrap {
position: absolute;
right: 0;
}
@media (min-width: 768px) {
.header-container {
width: 750px;
}
}
@media (min-width: 992px) {
.header-container {
width: 970px;
}
}
@media (min-width: 1200px) {
.header-container {
width: 1170px;
}
}
.header-container img {
display: block;
max-height: 60px;
max-width: 100%;
margin: 0 auto;
}
.header-container .language-selector-wrap {
display: flex;
justify-content: end;
}
/* language-selector - start */
.dropdown {
position: relative;
}
.dropdown-toggle {
display: inline-block;
background-color: transparent;
padding: 0;
margin-bottom: 0;
font-size: 14px;
font-weight: bold;
color: #333;
line-height: 1.42857;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 0px;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-toggle .caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 0;
vertical-align: middle;
border-top-color: white;
border-top: 4px solid #000;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-bottom: 0 dotted;
content: "";
}
.dropdown-menu {
position: absolute;
top: 100%;
right: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: 400;
line-height: 1.42857143;
color: #333333;
text-decoration: none;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #fff;
background-color: #337ab7;
outline: 0;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #777777;
pointer-events: none;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
/* language-selector - end */
#maintenance .logo {
padding: 12px;
text-align: center; }

View File

@@ -56,6 +56,13 @@
.booking_occupancy_wrapper .add_new_occupancy_btn:active, .booking_occupancy_wrapper .add_new_occupancy_btn:focus, .booking_occupancy_wrapper .add_new_occupancy_btn:hover {
text-decoration: none;
color: #0000FF;}
.booking_occupancy_wrapper .add_new_occupancy_btn.disabled,
.booking_occupancy_wrapper .add_new_occupancy_btn.disabled:active,
.booking_occupancy_wrapper .add_new_occupancy_btn.disabled:focus,
.booking_occupancy_wrapper .add_new_occupancy_btn.disabled:hover {
color: #333;
opacity: 0.5;
cursor: not-allowed;}
.booking_occupancy_wrapper .occupancy_info_head {
font-size: 14px;
color: #333333;

View File

@@ -84,51 +84,53 @@
</label>
<input class="is_required validate form-control" data-validate="isEmail" type="email" name="email" id="email" value="{$smarty.post.email}" />
</div>
<div class="form-group">
<label>
{l s='Date of Birth'}
</label>
<div class="row">
<div class="col-xs-4">
<select name="days" id="days" class="form-control">
<option value="">-</option>
{foreach from=$days item=v}
<option value="{$v}" {if ($sl_day == $v)}selected="selected"{/if}>{$v}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
<select id="months" name="months" class="form-control">
<option value="">-</option>
{foreach from=$months key=k item=v}
<option value="{$k}" {if ($sl_month == $k)}selected="selected"{/if}>{l s=$v}&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="years" name="years" class="form-control">
<option value="">-</option>
{foreach from=$years item=v}
<option value="{$v}" {if ($sl_year == $v)}selected="selected"{/if}>{$v}&nbsp;&nbsp;</option>
{/foreach}
</select>
{if isset($birthday) && $birthday}
<div class="form-group">
<label>
{l s='Date of Birth'}
</label>
<div class="row">
<div class="col-xs-4">
<select name="days" id="days" class="form-control">
<option value="">-</option>
{foreach from=$days item=v}
<option value="{$v}" {if ($sl_day == $v)}selected="selected"{/if}>{$v}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
<select id="months" name="months" class="form-control">
<option value="">-</option>
{foreach from=$months key=k item=v}
<option value="{$k}" {if ($sl_month == $k)}selected="selected"{/if}>{l s=$v}&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="years" name="years" class="form-control">
<option value="">-</option>
{foreach from=$years item=v}
<option value="{$v}" {if ($sl_year == $v)}selected="selected"{/if}>{$v}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
</div>
</div>
</div>
{/if}
<div class="required form-group">
<label for="old_passwd" class="required">
{l s='Current Password'}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

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

@@ -31,7 +31,7 @@ $(document).ready(function(){
});
var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length);
if (countRooms < $(booking_occupancy_wrapper).find('.max_avail_type_qty').val()) {
$(booking_occupancy_wrapper).find('.add_new_occupancy_btn').show();
$(booking_occupancy_wrapper).find('.add_new_occupancy_btn').removeClass('disabled');
}
setRoomTypeGuestOccupancy($(booking_occupancy_inner).closest('.booking_occupancy_wrapper'));
});
@@ -264,7 +264,7 @@ $(document).ready(function(){
// objDiv.scrollTop = objDiv.scrollHeight;
$(booking_occupancy_wrapper).animate({ scrollTop: $(booking_occupancy_wrapper).prop('scrollHeight') }, "slow");
if (countRooms >= $(booking_occupancy_wrapper).find('.max_avail_type_qty').val()) {
$(this).hide();
$(this).addClass('disabled');
}
}
@@ -299,6 +299,14 @@ $(document).ready(function(){
$(this).closest('.rm_qty_cont').find('.qty_count > span').text(elementVal);
$(document).trigger( "QloApps:updateRoomQuantity", [element]);
});
$(document).on('hover', '.add_new_occupancy_btn', function(e) {
if ($(this).hasClass('disabled')) {
$(this).attr('title', $(this).attr('data-title-unavailable'));
} else {
$(this).attr('title', $(this).attr('data-title-available'));
}
});
});

View File

@@ -1320,3 +1320,10 @@ $(document).on('click', '.btn-edit-guest-info', function(e) {
$('#collapse-guest-info .card-body:nth-child(1)').hide();
$('#collapse-guest-info .card-body:nth-child(2)').toggleClass('hidden');
});
$(document).on('keydown', '#new_account_form input', function(e) {
if (e.keyCode === 13) {
e.preventDefault();
$('#new_account_form #opc_account_form:visible button[type="submit"]').click();
}
});

View File

@@ -1434,7 +1434,7 @@ var BookingForm = {
return data;
},
refresh: function() {
refresh: function(resetOccupancy = false) {
BookingForm.currentRequest = $.ajax({
url: product_controller_url,
type: 'POST',
@@ -1456,6 +1456,10 @@ var BookingForm = {
if (response.status == true) {
$('.booking-form').replaceWith(response.html_booking_form);
BookingForm.init();
if (resetOccupancy) {
BookingForm.resetOccupancy();
}
}
},
complete: function() {
@@ -1464,6 +1468,9 @@ var BookingForm = {
}
});
},
resetOccupancy: function () {
resetOccupancyField($('.booking-form .booking_occupancy_wrapper'));
}
}
function loadHotelImagesByPage(page = 1) {

View File

@@ -45,9 +45,34 @@
<body>
<div id="maintenance">
<div class="logo">
<img src="{$logo_url}" {if $logo_image_width}width="{$logo_image_width}" {/if}
{if $logo_image_height}height="{$logo_image_height}" {/if} alt="logo" />
<div class="header-container{if count($languages) > 1} multilang{/if}">
<div class="logo-container">
<img src="{$logo_url}" alt="logo" />
</div>
{if count($languages) > 1}
<div class="language-selector-wrap">
<div class="dropdown">
{foreach from=$languages item=language}
{if $language.iso_code == $lang_iso}
<button class="dropdown-toggle" type="button" data-toggle="dropdown">
{$language.name|regex_replace:'/\s\(.*\)$/':''}
<span class="caret"></span>
</button>
{/if}
{/foreach}
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li {if $language.iso_code == $lang_iso}class="disabled"{/if}>
<a href="{$link->getLanguageLink($language.id_lang)|escape:'html':'UTF-8'}" title="{$language.name}">
<span>{$language.name|regex_replace:'/\s\(.*\)$/':''}</span>
</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/if}
</div>
<div class="margin-l-r">
{if isset($errors) && $errors}

View File

@@ -104,37 +104,39 @@
</div>
</div>
{if $PS_CUSTOMER_ADDRESS_CREATION}
<div class="row">
<div class="select form-group date-select col-sm-12">
<label>{l s='Date of Birth'}</label>
<div class="row">
<div class="col-xs-4">
<select id="days" name="days">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day|escape:'html':'UTF-8'}" {if isset($guestInformations) && isset($guestInformations.sl_day) && ($guestInformations.sl_day == $day)} selected="selected"{/if}>{$day|escape:'html':'UTF-8'}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="months" name="months">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k|escape:'html':'UTF-8'}" {if isset($guestInformations) && isset($guestInformations.sl_month) && ($guestInformations.sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="years" name="years">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year|escape:'html':'UTF-8'}" {if isset($guestInformations) && isset($guestInformations.sl_year) && ($guestInformations.sl_year == $year)} selected="selected"{/if}>{$year|escape:'html':'UTF-8'}&nbsp;&nbsp;</option>
{/foreach}
</select>
{if isset($birthday) && $birthday}
<div class="row">
<div class="select form-group date-select col-sm-12">
<label>{l s='Date of Birth'}</label>
<div class="row">
<div class="col-xs-4">
<select id="days" name="days">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day|escape:'html':'UTF-8'}" {if isset($guestInformations) && isset($guestInformations.sl_day) && ($guestInformations.sl_day == $day)} selected="selected"{/if}>{$day|escape:'html':'UTF-8'}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="months" name="months">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k|escape:'html':'UTF-8'}" {if isset($guestInformations) && isset($guestInformations.sl_month) && ($guestInformations.sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
</div>
<div class="col-xs-4">
<select id="years" name="years">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year|escape:'html':'UTF-8'}" {if isset($guestInformations) && isset($guestInformations.sl_year) && ($guestInformations.sl_year == $year)} selected="selected"{/if}>{$year|escape:'html':'UTF-8'}&nbsp;&nbsp;</option>
{/foreach}
</select>
</div>
</div>
</div>
</div>
</div>
{/if}
{if isset($newsletter) && $newsletter}
<div class="checkbox">