Merge branch 'develop' into gli-2963
This commit is contained in:
@@ -1572,6 +1572,7 @@
|
||||
id_room: idRoom,
|
||||
id_cart: idCart,
|
||||
id_product: idProduct,
|
||||
id_customer: id_customer,
|
||||
id_hotel_cart_booking: idHotelCartBooking,
|
||||
action: 'getRoomTypeCartDemands',
|
||||
ajax: true
|
||||
@@ -1877,7 +1878,7 @@
|
||||
<i class="icon-user"></i>
|
||||
{l s='Customer'}
|
||||
</div>
|
||||
<div id="search-customer-form-group" class="form-group">
|
||||
<div id="search-customer-form-group" {if isset($cart->id_customer) && $cart->id_customer && isset($customer) && $customer }style="display:none;"{/if} class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Search for an existing customer by typing the first letters of his/her name.'}">
|
||||
{l s='Search for a customer'}
|
||||
@@ -1904,7 +1905,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="customers"></div>
|
||||
<div id="customers">
|
||||
{if isset($cart->id_customer) && $cart->id_customer && isset($customer) && $customer }
|
||||
<div class="customerCard col-lg-4 selected-customer">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-ok text-success"></i>{$customer->firstname} {$customer->lastname} <span class="pull-right">#{$customer->id}</span>
|
||||
</div>
|
||||
<span>{$customer->email}</span><br>
|
||||
<span class="text-muted"></span><br>
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminCustomers')}&id_customer={$customer->id}&viewcustomer&liteDisplaying=1" class="btn btn-default fancybox">
|
||||
<i class="icon-search"></i> Details </a>
|
||||
<button type="button" data-id_cart="6" data-customer="2" class="btn btn-default pull-right change-customer">
|
||||
<i class="icon-refresh"></i> Change
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{*<div id="carts">
|
||||
<button type="button" id="show_old_carts" class="btn btn-default pull-right" data-toggle="collapse" data-target="#old_carts_orders">
|
||||
@@ -1962,7 +1982,7 @@
|
||||
</div>
|
||||
{include file='controllers/orders/_current_cart_details_data.tpl'}
|
||||
|
||||
<form class="form-horizontal" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&addorder=1&cart_id={$cart->id}" method="post" style="display:none" id="cart_detail_form">
|
||||
<form class="form-horizontal" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&addorder=1&cart_id={$cart->id}" method="post" {if !isset($customer) && !$customer }style="display:none;"{/if} id="cart_detail_form">
|
||||
<div class="panel" id="products_part" style="display:none;">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-shopping-cart"></i>
|
||||
|
||||
@@ -1477,10 +1477,7 @@ class CartRuleCore extends ObjectModel
|
||||
*/
|
||||
public static function isFeatureActive()
|
||||
{
|
||||
static $is_feature_active = null;
|
||||
if ($is_feature_active === null) {
|
||||
$is_feature_active = (bool)Configuration::get('PS_CART_RULE_FEATURE_ACTIVE');
|
||||
}
|
||||
$is_feature_active = (bool)Configuration::get('PS_CART_RULE_FEATURE_ACTIVE');
|
||||
return $is_feature_active;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,11 +141,18 @@ class ProfileCore extends ObjectModel
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'access` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab
|
||||
WHERE `id_profile` = '.(int)$id_profile);
|
||||
if ($result = Db::getInstance()->executeS('
|
||||
SELECT * FROM `'._DB_PREFIX_.'access` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab
|
||||
WHERE `id_profile` = '.(int)$id_profile)
|
||||
) {
|
||||
foreach ($result as $key => $profileAccess) {
|
||||
$result[$key]['view'] = (int) $profileAccess['view'];
|
||||
$result[$key]['delete'] = (int) $profileAccess['delete'];
|
||||
$result[$key]['add'] = (int) $profileAccess['add'];
|
||||
$result[$key]['edit'] = (int) $profileAccess['edit'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($result as $row) {
|
||||
self::$_cache_accesses[$id_profile][$type][$row[$type]] = $row;
|
||||
|
||||
@@ -2608,29 +2608,26 @@ FileETag none
|
||||
public static function getDefaultIndexContent()
|
||||
{
|
||||
return '<?php
|
||||
/**
|
||||
* 2007-'.date('Y').' PrestaShop
|
||||
*
|
||||
/*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-'.date('Y').' PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
|
||||
3
classes/cache/CacheFs.php
vendored
3
classes/cache/CacheFs.php
vendored
@@ -37,7 +37,8 @@ class CacheFsCore extends Cache
|
||||
|
||||
$keys_filename = $this->getFilename(self::KEYS_NAME);
|
||||
if (@filemtime($keys_filename)) {
|
||||
$this->keys = unserialize(file_get_contents($keys_filename));
|
||||
$keys = @unserialize(file_get_contents($keys_filename));
|
||||
$this->keys = is_array($keys) ? $keys : array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
|
||||
$formattedRooms[$key]['occupancy'] = $occupancy;
|
||||
if (isset($room['id_tax_rules_group'])) {
|
||||
$formattedRooms[$key]['id_tax_rules_group'] = $room['id_tax_rules_group'];
|
||||
} else if ($room['total_tax']) {
|
||||
} else if (isset($room['total_tax'])) {
|
||||
$formattedRooms[$key]['total_tax'] = $room['total_tax'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3223,7 +3223,25 @@ class AdminImportControllerCore extends AdminController
|
||||
|
||||
public function utf8EncodeArray($array)
|
||||
{
|
||||
return (is_array($array) ? array_map('utf8_encode', $array) : mb_convert_encoding($array, 'UTF-8', 'ISO-8859-1'));
|
||||
if (is_array($array)) {
|
||||
return array_map(function ($value) {
|
||||
if (is_array($value)) {
|
||||
return $this->utf8EncodeArray($value);
|
||||
}
|
||||
|
||||
if (!is_string($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
|
||||
}, $array);
|
||||
}
|
||||
|
||||
if (!is_string($array)) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
return mb_convert_encoding($array, 'UTF-8', 'ISO-8859-1');
|
||||
}
|
||||
|
||||
protected function getNbrColumn($handle, $glue)
|
||||
|
||||
@@ -485,6 +485,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'advance_payment_amount_without_tax' => $cart->getOrderTotal(false, Cart::ADVANCE_PAYMENT),
|
||||
'advance_payment_amount_with_tax' => $cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT),
|
||||
'cart' => $cart,
|
||||
'customer' => $cart->id_customer ? new Customer($cart->id_customer): null ,
|
||||
'currencies' => Currency::getCurrenciesByIdShop(Context::getContext()->shop->id),
|
||||
'langs' => Language::getLanguages(true, Context::getContext()->shop->id),
|
||||
'payment_modules' => $payment_modules,
|
||||
|
||||
@@ -1209,7 +1209,9 @@ class AdminThemesControllerCore extends AdminController
|
||||
');
|
||||
|
||||
foreach ($hook_list as &$row) {
|
||||
$row['exceptions'] = trim(preg_replace('/(,,+)/', ',', $row['exceptions']), ',');
|
||||
if($row['exceptions']){
|
||||
$row['exceptions'] = trim(preg_replace('/(,,+)/', ',', $row['exceptions']), ',');
|
||||
}
|
||||
}
|
||||
|
||||
$native_modules = $this->getNativeModule();
|
||||
|
||||
@@ -219,6 +219,60 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
|
||||
|
||||
}
|
||||
|
||||
public function processBulkEnableSelection()
|
||||
{
|
||||
if (!is_array($this->boxes) || empty($this->boxes)) {
|
||||
return parent::processBulkEnableSelection();
|
||||
}
|
||||
|
||||
$objFeaturePriceRule = new HotelRoomTypeFeaturePricingRestriction();
|
||||
$result = true;
|
||||
|
||||
foreach ($this->boxes as $id) {
|
||||
$objFeaturePricing = new $this->className((int)$id);
|
||||
if (!Validate::isLoadedObject($objFeaturePricing)) {
|
||||
$this->errors[] = sprintf($this->l('Invalid advanced price rule ID %d.'), (int) $id);
|
||||
$result = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($objFeaturePricing->active) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
$objFeaturePricing->getDuplicateRestrictions(
|
||||
$objFeaturePricing->id_product,
|
||||
$objFeaturePricing->getGroups($objFeaturePricing->id),
|
||||
$objFeaturePricing->id,
|
||||
$objFeaturePriceRule->getRestrictionsByIdFeaturePrice($objFeaturePricing->id),
|
||||
)
|
||||
) {
|
||||
$this->errors[] = sprintf(
|
||||
$this->l('Unable to activate Advanced Price Rule with ID #%d. A rule with similar conditions already exists.'),
|
||||
(int) $id);
|
||||
return;
|
||||
}
|
||||
|
||||
$objFeaturePricing->setFieldsToUpdate(array('active' => true));
|
||||
$objFeaturePricing->active = 1;
|
||||
$isUpdated = (bool) $objFeaturePricing->update();
|
||||
$result = $result && $isUpdated;
|
||||
|
||||
if (!$isUpdated) {
|
||||
$this->errors[] = sprintf($this->l('Can\'t update #%d status.'), (int) $id);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$this->redirect_after = self::$currentIndex.'&conf=5&token='.$this->token;
|
||||
} else {
|
||||
$this->errors[] = $this->l('An error occurred while updating the status.');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
parent::initToolbar();
|
||||
|
||||
@@ -45,3 +45,15 @@
|
||||
@keyframes rotate {
|
||||
0% {transform: rotate(0deg);}
|
||||
100% {transform: rotate(360deg);}}
|
||||
|
||||
p.payment_module a#qlo_paypal_btn {
|
||||
background: url(../../img/paypal-payment-icon.png) 15px 8px no-repeat #fbfbfb;
|
||||
}
|
||||
|
||||
.qlo_paypal_methods_wrapper {
|
||||
text-align: center;
|
||||
padding: 20px 15px;
|
||||
background: #fbfbfb;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d6d4d4;
|
||||
}
|
||||
|
||||
32
modules/qlopaypalcommerce/views/img/index.php
Normal file
32
modules/qlopaypalcommerce/views/img/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
BIN
modules/qlopaypalcommerce/views/img/paypal-payment-icon.png
Normal file
BIN
modules/qlopaypalcommerce/views/img/paypal-payment-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -20,82 +20,114 @@
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*}
|
||||
|
||||
<div id="paypal-button-container"></div>
|
||||
|
||||
<div id="wk-overlay" style="display:none;">
|
||||
<div class="wk-spinner"></div><br/>
|
||||
{l s='Please wait...' mod='qlopaypalcommerce'}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
<p class="payment_module">
|
||||
<a id="qlo_paypal_btn" style="cursor:pointer;" href="javascript:void(0);"
|
||||
title="{l s='PayPal Checkout' mod='qlopaypalcommerce'}">
|
||||
{l s='PayPal Checkout' mod='qlopaypalcommerce'} <span>{l s='(Pay with PayPal Account or Cards)' mod='qlopaypalcommerce'}</span>
|
||||
</a>
|
||||
<div class="qlo_paypal_methods_wrapper" style="display:none;">
|
||||
<div id="qlo_paypal_container"></div>
|
||||
<div id="wk-overlay" style="display:none;">
|
||||
<div class="wk-spinner"></div><br />
|
||||
{l s='Please wait...' mod='qlopaypalcommerce'}
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
paypal.Buttons({
|
||||
env: pp_environment,
|
||||
style: {
|
||||
layout: 'vertical', // horizontal | vertical
|
||||
size: 'responsive', // medium | large | responsive
|
||||
shape: 'rect', // pill | rect
|
||||
color: 'gold' // gold | blue | silver | black,
|
||||
},
|
||||
commit: false,
|
||||
createOrder: function() {
|
||||
return fetch(create_order, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
'update': null,
|
||||
'flow': 'shortcut'
|
||||
}),
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(dataJson) {
|
||||
return dataJson.data.id;
|
||||
});
|
||||
},
|
||||
onApprove: function(data, actions) {
|
||||
$('#wk-overlay').show();
|
||||
$(document).ready(function() {
|
||||
var rendered = false;
|
||||
|
||||
return fetch(capture_order, {
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
orderID: data.orderID,
|
||||
getOrderData: true,
|
||||
}),
|
||||
method: "POST",
|
||||
}).then(function(res) {
|
||||
return res.json();
|
||||
}).then(function(details) {
|
||||
if (details.id) {
|
||||
const postData = {
|
||||
key: "order_id",
|
||||
value: details.id
|
||||
$('#qlo_paypal_btn').on('click', function() {
|
||||
$(this).toggleClass("active");
|
||||
if (!rendered) {
|
||||
rendered = true;
|
||||
$(".qlo_paypal_methods_wrapper").slideDown();
|
||||
renderPayPalButton();
|
||||
} else {
|
||||
$(".qlo_paypal_methods_wrapper").slideToggle();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function renderPayPalButton() {
|
||||
paypal.Buttons({
|
||||
env: pp_environment,
|
||||
style: {
|
||||
layout: 'vertical', // horizontal | vertical
|
||||
size: 'responsive', // medium | large | responsive
|
||||
shape: 'rect', // pill | rect
|
||||
color: 'gold' // gold | blue | silver | black,
|
||||
},
|
||||
commit: false,
|
||||
createOrder: function() {
|
||||
return fetch(create_order, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
'update': null,
|
||||
'flow': 'shortcut'
|
||||
}),
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(dataJson) {
|
||||
return dataJson.data.id;
|
||||
});
|
||||
},
|
||||
onApprove: function(data, actions) {
|
||||
$('#wk-overlay').show();
|
||||
|
||||
return fetch(capture_order, {
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
orderID: data.orderID,
|
||||
getOrderData: true,
|
||||
}),
|
||||
method: "POST",
|
||||
}).then(function(res) {
|
||||
return res.json();
|
||||
}).then(function(details) {
|
||||
if (details.id) {
|
||||
const postData = {
|
||||
key: "order_id",
|
||||
value: details.id
|
||||
};
|
||||
submitForm(capture_order, postData);
|
||||
} else if (details.details[0].issue === 'INSTRUMENT_DECLINED') {
|
||||
return actions.restart();
|
||||
} else {
|
||||
window.location.replace(error_order + '?err_name=' + details.details[0]
|
||||
.issue +
|
||||
'&err_msg=' + details.details[0].description);
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: function(data) {
|
||||
let url = cancel_order,
|
||||
postData = {
|
||||
key: "error",
|
||||
value: JSON.stringify(data)
|
||||
};
|
||||
submitForm(capture_order, postData);
|
||||
} else if (details.details[0].issue === 'INSTRUMENT_DECLINED') {
|
||||
return actions.restart();
|
||||
} else {
|
||||
console.log(details);
|
||||
window.location.replace(error_order + '?err_name=' + details.details[0].issue + '&err_msg=' + details.details[0].description);
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: function(data) {
|
||||
let url = cancel_order,
|
||||
postData = {
|
||||
key: "error",
|
||||
value: JSON.stringify(data)
|
||||
};
|
||||
submitForm(url, postData);
|
||||
},
|
||||
onError: function (error) {
|
||||
console.log(error.data.details[0].issue + ' : ' + error.data.details[0].description);
|
||||
window.location.replace(error_order + '?err_name=' + error.data.details[0].issue + '&err_msg=' + error.data.details[0].description);
|
||||
}
|
||||
}).render('#paypal-button-container');
|
||||
submitForm(url, postData);
|
||||
},
|
||||
onError: function(error) {
|
||||
window.location.replace(error_order + '?err_name=' + error.data.details[0].issue +
|
||||
'&err_msg=' +
|
||||
error.data.details[0].description);
|
||||
}
|
||||
}).render('#qlo_paypal_container');
|
||||
}
|
||||
|
||||
|
||||
function submitForm(url, data) {
|
||||
let form = document.createElement('form'),
|
||||
|
||||
input = document.createElement('input');
|
||||
input.name = data.key;
|
||||
input.value = data.value;
|
||||
@@ -107,4 +139,4 @@
|
||||
|
||||
form.submit();
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user