Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
Kevin Granger
2013-06-17 19:19:28 +02:00
29 changed files with 141 additions and 99 deletions
@@ -60,7 +60,7 @@
$tem[$k] = $v;
}
$tem['path'] = backslashToSlash($path);
$tem['path'] = addslashes(backslashToSlash($path));
$tem['type'] = "file";
$tem['size'] = transformFileSize($tem['size']);
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
@@ -73,7 +73,7 @@
$info .= sprintf(", %s:'%s'", $k, $v);
}
$info .= sprintf(", url:'%s'", getFileUrl($path));
$info .= sprintf(", url:'%s'", addslashes(getFileUrl($path)));
$info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);
@@ -99,9 +99,9 @@
{
$v = transformFileSize($v);
}
echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
echo (($j++ > 1)?",":'') . "'" . addslashes($k) . "':'" . addslashes($v) . "'";
}
echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
echo (($j++ > 1)?",":'') . "'url':'" . addslashes(getFileUrl($file['path'])) . "'";
echo "}\n";
}
echo "};</script>\n";
+4 -4
View File
@@ -33,15 +33,15 @@
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];
$this->fileInfo['path'] = $path;
$this->fileInfo['name'] = basename($path);
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['is_writable'] = $this->isWritable();
$this->fileInfo['is_readable'] = $this->isReadable();
}elseif(is_dir($this->filePath))
{
$this->fileStat = @stat($path);
$this->fileInfo['name'] = basename($path);
$this->fileInfo['path'] = $path;
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];
+1 -1
View File
@@ -25,5 +25,5 @@
*/
define('_PS_ADMIN_DIR_', getcwd());
require(_PS_ADMIN_DIR_.'/config/config.inc.php');
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
Controller::getController('GetFileController')->run();
@@ -49,8 +49,10 @@
if (perm == 'all' && $(this).parent().parent().hasClass('parent'))
{
checked = enabled ? 'checked': '';
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').attr('checked', checked);
if (enabled)
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').attr('checked', 'checked');
else
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').removeAttr('checked');
$.ajax({
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false,
@@ -68,15 +70,12 @@
},
success : function(res,textStatus,jqXHR)
{
try
{
try {
if (res == 'ok')
showSuccessMessage("{l s='Update successful'}");
else
showErrorMessage("{l s='Update error'}");
}
catch(e)
{
} catch(e) {
jAlert('Technical error');
}
}
@@ -28,13 +28,13 @@
var changed_shipping_price = false;
var shipping_price_selected_carrier = '';
var current_index = '{$current}&token={$token}';
var admin_cart_link = '{$link->getAdminLink('AdminCarts')|escape:'html'}';
var admin_cart_link = '{$link->getAdminLink('AdminCarts')|addslashes}';
var cart_quantity = new Array();
var currencies = new Array();
var id_currency = '';
var id_lang = '';
var txt_show_carts = '{l s='Show carts and orders for this customer.'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.'}';
var txt_show_carts = '{l s='Show carts and orders for this customer.' js='1'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.' js='1'}';
var defaults_order_state = new Array();
var customization_errors = false;
var pic_dir = '{$pic_dir}';
@@ -661,17 +661,17 @@
{
$.each(this.customized_datas[this.id_product][this.id_product_attribute][id_address_delivery], function() {
var customized_desc = '';
if(this.datas[1].length)
if (this.datas[1].length)
{
$.each(this.datas[1],function() {
customized_desc += this.name+':'+this.value+'<br />';
customized_desc += this.name + ': ' + this.value + '<br />';
id_customization = this.id_customization;
});
}
if(this.datas[0] && this.datas[0].length)
if (this.datas[0] && this.datas[0].length)
{
$.each(this.datas[0],function() {
customized_desc += this.name+':<img src="'+pic_dir+this.value+'_small" /><br />';
customized_desc += this.name + ': <img src="' + pic_dir + this.value + '_small" /><br />';
id_customization = this.id_customization;
});
}
@@ -159,7 +159,10 @@
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if}
<div class="conf">
<a class="delete_virtual_product" id="delete_downloadable_product" onclick="return confirm('{l s='Delete this file'}')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<script>
delete_this_file = '{l s='Delete this file'}';
</script>
<a class="delete_virtual_product" id="delete_downloadable_product" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</div>
@@ -173,7 +176,7 @@
</td>
<td class="col-right">
{$product->productDownload->getHtmlLink(false, true)}
<a onclick="return confirm('{l s='Delete this file'})')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red delete_virtual_product">
<a href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red delete_virtual_product">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</td>
+1 -1
View File
@@ -229,7 +229,7 @@
<ul class="submenu">
{foreach from=$t.sub_tabs item=t2}
{if $t2.active}
<li><a href="{$t2.href|escape:'htmlall':'UTF-8'}">{if $t2.name eq ''}{$t2.class_name}{else}{$t2.name|escape:'htmlall':'UTF-8'}{/if}
<li {if $t2.current} class="active"{/if}><a href="{$t2.href|escape:'htmlall':'UTF-8'}">{if $t2.name eq ''}{$t2.class_name}{else}{$t2.name|escape:'htmlall':'UTF-8'}{/if}
<i class="icon-chevron-sign-right pull-right"></i>
</a></li>
{/if}
+1 -1
View File
@@ -222,7 +222,7 @@ class AddressCore extends ObjectModel
public function validateController($htmlentities = true)
{
$errors = parent::validateController($htmlentities);
if (!Configuration::get('VATNUMBER_CHECKING'))
if (!Configuration::get('VATNUMBER_MANAGEMENT') || !Configuration::get('VATNUMBER_CHECKING'))
return $errors;
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
if (class_exists('VatNumber', false))
+2 -1
View File
@@ -637,7 +637,8 @@ class CartRuleCore extends ObjectModel
FROM `'._DB_PREFIX_.'cart_product` cp
LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product
WHERE cp.`id_cart` = '.(int)$context->cart->id.'
AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')');
AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')
AND cp.`id_product` <> '.(int)$this->gift_product);
$countMatchingProducts = 0;
$matchingProductsList = array();
foreach ($cartCategories as $cartCategory)
+1
View File
@@ -4565,6 +4565,7 @@ class ProductCore extends ObjectModel
*/
public function setWsAccessories($accessories)
{
$this->deleteAccessories();
foreach ($accessories as $accessory)
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'accessory` (`id_product_1`, `id_product_2`) VALUES ('.(int)$this->id.', '.(int)$accessory['id'].')');
+2 -2
View File
@@ -1855,8 +1855,8 @@ exit;
{
$backtrace = debug_backtrace();
$callee = next($backtrace);
$error = 'Parameter <b>'.$parameter.'</b> in function <b>'.(isset($callee['function']) ? $callee['function'] : '').'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.(isset($callee['Line']) ? $callee['Line'] : '').'</b><br />';
$message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.$callee['Line'].') is deprecated and will be removed in the next major version.';
$error = 'Parameter <b>'.$parameter.'</b> in function <b>'.(isset($callee['function']) ? $callee['function'] : '').'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.(isset($callee['line']) ? $callee['line'] : '(undefined)').'</b><br />';
$message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.(isset($callee['line']) ? $callee['line'] : 'undefined').') is deprecated and will be removed in the next major version.';
$class = isset($callee['class']) ? $callee['class'] : null;
Tools::throwDeprecated($error, $message, $class);
+5 -3
View File
@@ -1336,11 +1336,13 @@ class AdminControllerCore extends Controller
foreach ($sub_tabs as $index2 => $sub_tab)
{
// class_name is the name of the class controller
if (Tab::checkTabRights($sub_tab['id_tab']) === true
&& (bool)$sub_tab['active'])
if (Tab::checkTabRights($sub_tab['id_tab']) === true && (bool)$sub_tab['active'])
{
$sub_tabs[$index2]['href'] = $this->context->link->getAdminLink($sub_tab['class_name']);
$sub_tabs[$index2]['current'] = ($sub_tab['class_name'].'Controller' == get_class($this));
}
else
unset($sub_tabs[$index2]);
unset($sub_tabs[$index2]);
}
$tabs[$index]['sub_tabs'] = $sub_tabs;
+18 -21
View File
@@ -153,35 +153,32 @@ class AdminAccessControllerCore extends AdminController
$join = 'LEFT JOIN `'._DB_PREFIX_.'tab` t ON (t.`id_tab` = a.`id_tab`)';
}
if ($id_tab == -1 && $perm == 'all' && $enabled == 0)
$sql = '
UPDATE `'._DB_PREFIX_.'access` a
SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.'
WHERE `id_profile` = '.(int)$id_profile.' AND `id_tab` != '.(int)$this->id_tab_access;
else if ($id_tab == -1 && $perm == 'all')
$sql = '
if ($id_tab == -1)
{
if ($perm == 'all')
$sql = '
UPDATE `'._DB_PREFIX_.'access` a
SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.'
WHERE `id_profile` = '.(int)$id_profile;
else if ($id_tab == -1)
$sql = '
else
$sql = '
UPDATE `'._DB_PREFIX_.'access` a
SET `'.bqSQL($perm).'` = '.(int)$enabled.'
WHERE `id_profile` = '.(int)$id_profile;
else if ($perm == 'all')
$sql = '
UPDATE `'._DB_PREFIX_.'access` a
'.$join.'
SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.'
WHERE '.$where.' = '.(int)$id_tab.'
AND `id_profile` = '.(int)$id_profile;
}
else
$sql = '
UPDATE `'._DB_PREFIX_.'access` a
'.$join.'
{
if ($perm == 'all')
$sql = '
UPDATE `'._DB_PREFIX_.'access` a '.$join.'
SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.'
WHERE '.$where.' = '.(int)$id_tab.' AND `id_profile` = '.(int)$id_profile;
else
$sql = '
UPDATE `'._DB_PREFIX_.'access` a '.$join.'
SET `'.bqSQL($perm).'` = '.(int)$enabled.'
WHERE '.$where.' = '.(int)$id_tab.'
AND `id_profile` = '.(int)$id_profile;
WHERE '.$where.' = '.(int)$id_tab.' AND `id_profile` = '.(int)$id_profile;
}
$res = Db::getInstance()->execute($sql) ? 'ok' : 'error';
+3 -3
View File
@@ -273,15 +273,15 @@ class AdminCartsControllerCore extends AdminController
$field_id = 'customization_'.$id_product.'_'.$customization_field['id_customization_field'];
if ($customization_field['type'] == Product::CUSTOMIZE_TEXTFIELD)
{
if (!isset($_POST[$field_id]) || empty($_POST[$field_id]))
if (!Tools::getValue($field_id))
{
if ($customization_field['required'])
$errors[] = Tools::displayError('Please fill in all the required fields.');
continue;
}
if (!Validate::isMessage($_POST[$field_id]) || empty($_POST[$field_id]))
if (!Validate::isMessage(Tools::getValue($field_id)))
$errors[] = Tools::displayError('Invalid message');
$this->context->cart->addTextFieldToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_TEXTFIELD, $_POST[$field_id]);
$this->context->cart->addTextFieldToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_TEXTFIELD, Tools::getValue($field_id));
}
elseif ($customization_field['type'] == Product::CUSTOMIZE_FILE)
{
@@ -549,7 +549,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$orders_ok[] = $order;
$total_ok += $order['total_paid_real'];
}
$orders[$key]['date_add'] = Tools::displayDate($order['date_add'], $this->context->language->id);
$orders[$key]['date_add'] = Tools::displayDate($order['date_add']);
$orders[$key]['total_paid_real'] = Tools::displayPrice($order['total_paid_real'], new Currency((int)$order['id_currency']));
}
}
@@ -557,7 +557,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$products = $customer->getBoughtProducts();
if ($products && count($products))
foreach ($products as $key => $product)
$products[$key]['date_add'] = Tools::displayDate($product['date_add'],null , true);
$products[$key]['date_add'] = Tools::displayDate($product['date_add'], null, true);
}
foreach ($messages as $key => $message)
@@ -595,7 +595,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
if (!empty($message['id_product']) && empty($message['employee_name']))
$id_order_product = Order::getIdOrderProduct((int)$message['id_customer'], (int)$message['id_product']);
}
$message['date_add'] = Tools::displayDate($message['date_add'],null , true);
$message['date_add'] = Tools::displayDate($message['date_add'], null, true);
$message['user_agent'] = strip_tags($message['user_agent']);
$message['message'] = preg_replace(
'/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui',
@@ -165,6 +165,15 @@ class AdminEmailsControllerCore extends AdminController
);
}
public function updateOptionPsMailPasswd($value)
{
if (Tools::getValue('PS_MAIL_PASSWD') == '' && Configuration::get('PS_MAIL_PASSWD'))
return true;
else
Configuration::updateValue('PS_MAIL_PASSWD', Tools::getValue('PS_MAIL_PASSWD'));
}
/**
* AdminController::initContent() override
* @see AdminController::initContent()
@@ -297,7 +297,7 @@ class AdminEmployeesControllerCore extends AdminController
}
$this->fields_form['input'][] = array(
'type' => 'select',
'label' => $this->l('Profile:'),
'label' => $this->l('Profile Permission:'),
'name' => 'id_profile',
'required' => true,
'options' => array(
+2 -2
View File
@@ -53,7 +53,7 @@ class AdminImagesControllerCore extends AdminController
);
// No need to display the old image system if the install has been made later than 2013-03-26
$this->display_move = (defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true;
$this->display_move = (!Configuration::get('PS_LEGACY_IMAGES') && defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true;
$this->fields_options = array(
'images' => array(
@@ -62,7 +62,7 @@ class AdminImagesControllerCore extends AdminController
'top' => '',
'bottom' => '',
'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a larger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').'
<br /><br />'.$this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'),
<br /><br />'.$this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'),
'fields' => array(
'PS_IMAGE_QUALITY' => array(
'title' => $this->l('Image quality'),
@@ -440,6 +440,7 @@ class AdminManufacturersControllerCore extends AdminController
'type' => 'text',
'label' => $this->l('Zip Code/Postal Code'),
'name' => 'postcode',
'required' => true,
'size' => 33,
'required' => false,
);
+18 -17
View File
@@ -1048,16 +1048,17 @@ class AdminOrdersControllerCore extends AdminController
}
$cart_rules = array();
$discount_value = (float)str_replace(',', '.', Tools::getValue('discount_value'));
switch (Tools::getValue('discount_type'))
{
// Percent type
case 1:
if (Tools::getValue('discount_value') < 100)
if ($discount_value < 100)
{
if (isset($order_invoice))
{
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * Tools::getValue('discount_value') / 100, 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * Tools::getValue('discount_value') / 100, 2);
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * $discount_value / 100, 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * $discount_value / 100, 2);
// Update OrderInvoice
$this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']);
@@ -1067,8 +1068,8 @@ class AdminOrdersControllerCore extends AdminController
$order_invoices_collection = $order->getInvoicesCollection();
foreach ($order_invoices_collection as $order_invoice)
{
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * Tools::getValue('discount_value') / 100, 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * Tools::getValue('discount_value') / 100, 2);
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * $discount_value / 100, 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * $discount_value / 100, 2);
// Update OrderInvoice
$this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']);
@@ -1076,8 +1077,8 @@ class AdminOrdersControllerCore extends AdminController
}
else
{
$cart_rules[0]['value_tax_incl'] = Tools::ps_round($order->total_paid_tax_incl * Tools::getValue('discount_value') / 100, 2);
$cart_rules[0]['value_tax_excl'] = Tools::ps_round($order->total_paid_tax_excl * Tools::getValue('discount_value') / 100, 2);
$cart_rules[0]['value_tax_incl'] = Tools::ps_round($order->total_paid_tax_incl * $discount_value / 100, 2);
$cart_rules[0]['value_tax_excl'] = Tools::ps_round($order->total_paid_tax_excl * $discount_value / 100, 2);
}
}
else
@@ -1087,12 +1088,12 @@ class AdminOrdersControllerCore extends AdminController
case 2:
if (isset($order_invoice))
{
if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl)
if ($discount_value > $order_invoice->total_paid_tax_incl)
$this->errors[] = Tools::displayError('The discount value is greater than the order invoice total.');
else
{
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round(Tools::getValue('discount_value') / (1 + ($order->getTaxesAverageUsed() / 100)), 2);
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($discount_value, 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($discount_value / (1 + ($order->getTaxesAverageUsed() / 100)), 2);
// Update OrderInvoice
$this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']);
@@ -1103,12 +1104,12 @@ class AdminOrdersControllerCore extends AdminController
$order_invoices_collection = $order->getInvoicesCollection();
foreach ($order_invoices_collection as $order_invoice)
{
if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl)
if ($discount_value > $order_invoice->total_paid_tax_incl)
$this->errors[] = Tools::displayError('The discount value is greater than the order invoice total.').$order_invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop).')';
else
{
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round(Tools::getValue('discount_value') / (1 + ($order->getTaxesAverageUsed() / 100)), 2);
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($discount_value, 2);
$cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($discount_value / (1 + ($order->getTaxesAverageUsed() / 100)), 2);
// Update OrderInvoice
$this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']);
@@ -1117,12 +1118,12 @@ class AdminOrdersControllerCore extends AdminController
}
else
{
if (Tools::getValue('discount_value') > $order->total_paid_tax_incl)
if ($discount_value > $order->total_paid_tax_incl)
$this->errors[] = Tools::displayError('The discount value is greater than the order total.');
else
{
$cart_rules[0]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2);
$cart_rules[0]['value_tax_excl'] = Tools::ps_round(Tools::getValue('discount_value') / (1 + ($order->getTaxesAverageUsed() / 100)), 2);
$cart_rules[0]['value_tax_incl'] = Tools::ps_round($discount_value, 2);
$cart_rules[0]['value_tax_excl'] = Tools::ps_round($discount_value / (1 + ($order->getTaxesAverageUsed() / 100)), 2);
}
}
break;
@@ -1173,7 +1174,7 @@ class AdminOrdersControllerCore extends AdminController
$cartRuleObj->quantity = 0;
$cartRuleObj->quantity_per_user = 1;
if (Tools::getValue('discount_type') == 1)
$cartRuleObj->reduction_percent = Tools::getValue('discount_value');
$cartRuleObj->reduction_percent = $discount_value;
elseif (Tools::getValue('discount_type') == 2)
$cartRuleObj->reduction_amount = $cart_rule['value_tax_excl'];
elseif (Tools::getValue('discount_type') == 3)
@@ -52,6 +52,9 @@ class AdminTrackingControllerCore extends AdminController
public function initContent()
{
if ($id_category = Tools::getValue('id_category') && Tools::getIsset('viewcategory'))
Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_category='.(int)$id_category.'&viewcategory');
$this->_helper_list = new HelperList();
if (!Configuration::get('PS_STOCK_MANAGEMENT'))
@@ -151,8 +154,6 @@ class AdminTrackingControllerCore extends AdminController
$this->tpl_list_vars = array('sub_title' => $this->l('List of products with attributes but without available quantities for sale:'));
return $this->renderList();
}
@@ -47,6 +47,13 @@ class NewProductsControllerCore extends FrontController
$this->productSort();
// Override default configuration values: cause the new products page must display latest products first.
if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby'))
{
$this->orderBy = 'date_add';
$this->orderWay = 'DESC';
}
$nbProducts = (int)Product::getNewProducts(
$this->context->language->id,
(isset($this->p) ? (int)($this->p) - 1 : null),
+7 -1
View File
@@ -30,7 +30,13 @@
</ul>
<script type="text/javascript">
if (typeof psuser_assistance != 'undefined')
psuser_assistance.setStep('install_<?php echo addslashes($this->step) ?>');
{
var errors = new Array();
$.each($('li.fail'), function(i, item){
errors.push($(this).text().trim());
});
psuser_assistance.setStep('install_<?php echo addslashes($this->step) ?>', {'error':errors});
}
</script>
</body>
</html>
@@ -52,9 +52,14 @@ function p1540_add_missing_columns()
}
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');;
if (is_array($key_exists))
if (is_array($key_exists) && count($key_exists))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`'))
$errors[] = Db::getInstance()->getMsgError();
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "id_product_2"');;
if (is_array($key_exists) && count($key_exists))
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `id_product_2`'))
$errors[] = Db::getInstance()->getMsgError();
if (count($errors))
return array('error' => 1, 'msg' => implode(',', $errors)) ;
+17 -13
View File
@@ -1356,23 +1356,27 @@ product_tabs['VirtualProduct'] = new function(){
// Bind file deletion
$(('#product-tab-content-VirtualProduct')).delegate('a.delete_virtual_product', 'click', function(e){
e.preventDefault();
if (!$('#virtual_product_id').val())
if (confirm(delete_this_file))
{
$('#upload_input').show();
$('#virtual_product_name').val('');
$('#virtual_product_file').val('');
$('#upload-confirmation').hide().find('span').remove();
}
else
{
var object = this;
ajaxAction(this.href, 'deleteVirtualProduct', function(){
$(object).closest('tr').remove();
if (!$('#virtual_product_id').val())
{
$('#upload_input').show();
$('#virtual_product_name').val('');
$('#virtual_product_file').val('');
$('#virtual_product_id').remove();
});
$('#upload-confirmation').hide().find('span').remove();
}
else
{
var object = this;
ajaxAction(this.href, 'deleteVirtualProduct', function(){
$(object).closest('tr').remove();
$('#upload_input').show();
$('#virtual_product_name').val('');
$('#virtual_product_file').val('');
$('#virtual_product_id').remove();
});
}
}
});
}
+5
View File
@@ -6,6 +6,11 @@
margin-top:8px;
}
#header_right #header_user.header_user_catalog {
margin-top: 15px;
min-height: 60px;
}
#header_user #header_nav {
list-style-type:none;
float:right;
+1 -1
View File
@@ -24,7 +24,7 @@
*}
<!-- Block user information module HEADER -->
<div id="header_user">
<div id="header_user" {if $PS_CATALOG_MODE}class="header_user_catalog"{/if}>
<ul id="header_nav">
{if !$PS_CATALOG_MODE}
<li id="shopping_cart">
+1 -1
View File
@@ -125,7 +125,7 @@
<textarea id="message" name="message" rows="15" cols="10">{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea>
</p>
<p class="submit">
<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send'}" class="button_large" onclick="$(this).hide();" />
<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send'}" class="button_large" />
</p>
</fieldset>
</form>