diff --git a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl
index 7cbc61b89..5e8d4e00d 100755
--- a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl
+++ b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl
@@ -161,6 +161,13 @@ function add_condition(id_condition_group, type, value)
function delete_condition(condition)
{
delete conditions[condition];
+
+ to_delete = $('#'+condition).prev();
+ if ($(to_delete).children().hasClass('btn_delete_condition'))
+ $(to_delete).remove();
+ else
+ $('#'+condition).next().remove();
+
$('#'+condition).remove();
return false;
}
@@ -178,7 +185,7 @@ function new_condition_group()
function appendConditionToGroup(html)
{
if ($('#condition_group_'+current_id_condition_group+' table tbody tr').length > 0)
- $('#condition_group_'+current_id_condition_group+' table tbody').append('
| {l s='AND' js=1} |
');
+ $('#condition_group_'+current_id_condition_group+' table tbody').append('| {l s='AND' js=1} |
');
$('#condition_group_'+current_id_condition_group+' table tbody').append(html);
}
diff --git a/classes/AttributeGroup.php b/classes/AttributeGroup.php
index 17f12cadf..55ab9b459 100644
--- a/classes/AttributeGroup.php
+++ b/classes/AttributeGroup.php
@@ -142,14 +142,15 @@ class AttributeGroupCore extends ObjectModel
if (!AttributeGroup::cleanDeadCombinations())
return false;
/* Also delete related attributes */
- if (Db::getInstance()->execute('
+ if (count($to_remove))
+ if (!Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_lang`
- WHERE `id_attribute` IN ('.implode(',', $to_remove).')') === false ||
- Db::getInstance()->execute('
+ WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
+ !Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_shop`
- WHERE `id_attribute` IN ('.implode(',', $to_remove).')') === false ||
- Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false)
- return false;
+ WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
+ !Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id))
+ return false;
$this->cleanPositions();
}
$return = parent::delete();
diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php
index ea597bab7..469b6c641 100644
--- a/classes/tax/TaxRulesGroup.php
+++ b/classes/tax/TaxRulesGroup.php
@@ -53,22 +53,15 @@ class TaxRulesGroupCore extends ObjectModel
protected static $_taxes = array();
- public static function getTaxRulesGroups($only_active = true, $multiShop = false)
+ public static function getTaxRulesGroups($only_active = true)
{
- if ((bool)$multiShop) {
- return Db::getInstance()->executeS('
- SELECT *
+ return Db::getInstance()->executeS('
+ SELECT DISTINCT g.id_tax_rules_group, g.name, g.active
FROM `'._DB_PREFIX_.'tax_rules_group` g'
.Shop::addSqlAssociation('tax_rules_group', 'g')
.($only_active ? ' WHERE g.`active` = 1' : '').'
ORDER BY name ASC');
- } else {
- return Db::getInstance()->executeS('
- SELECT *
- FROM `'._DB_PREFIX_.'tax_rules_group` g'
- .($only_active ? ' WHERE g.`active` = 1' : '').'
- ORDER BY name ASC');
- }
+
}
/**
diff --git a/controllers/admin/AdminCarrierWizardController.php b/controllers/admin/AdminCarrierWizardController.php
index 1625d99ba..1f9066d82 100644
--- a/controllers/admin/AdminCarrierWizardController.php
+++ b/controllers/admin/AdminCarrierWizardController.php
@@ -718,7 +718,7 @@ class AdminCarrierWizardControllerCore extends AdminController
&& (!isset($logo['error']) || !$logo['error'])
&& preg_match('/\.(jpe?g|gif|png)$/', $logo['name'])
&& is_uploaded_file($logo['tmp_name'])
- && ImageManager::isRealImage($logo['tmp_name']))
+ && ImageManager::isRealImage($logo['tmp_name'], $logo['type']))
{
$file = $logo['tmp_name'];
do $tmp_name = uniqid().'.jpg';
diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php
index 9a8c10e11..69db3dc17 100644
--- a/controllers/admin/AdminCategoriesController.php
+++ b/controllers/admin/AdminCategoriesController.php
@@ -557,7 +557,7 @@ class AdminCategoriesControllerCore extends AdminController
$id_parent = (int)Tools::getValue('id_parent');
// if true, we are in a root category creation
- if (!$id_parent && !Tools::isSubmit('is_root_category'))
+ if (!$id_parent)
{
$_POST['is_root_category'] = $_POST['level_depth'] = 1;
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
diff --git a/controllers/admin/AdminLogsController.php b/controllers/admin/AdminLogsController.php
index 265e420f1..b1b33bdb7 100644
--- a/controllers/admin/AdminLogsController.php
+++ b/controllers/admin/AdminLogsController.php
@@ -33,9 +33,6 @@ class AdminLogsControllerCore extends AdminController
$this->lang = false;
$this->noLink = true;
- $this->addRowAction('delete');
- $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
-
$this->fields_list = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100),
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index 0f3a5216c..2fe0243a7 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -2993,7 +2993,7 @@ class AdminProductsControllerCore extends AdminController
$data->assign(array(
'link' => $this->context->link,
'currency' => $currency = $this->context->currency,
- 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true),
+ 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true),
'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id),
'ecotaxTaxRate' => Tax::getProductEcotaxRate(),
'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),
diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php
index 63772700d..51bfa8896 100644
--- a/controllers/admin/AdminTaxRulesGroupController.php
+++ b/controllers/admin/AdminTaxRulesGroupController.php
@@ -179,6 +179,15 @@ class AdminTaxRulesGroupControllerCore extends AdminController
'stay' => true
)
);
+
+ if (Shop::isFeatureActive())
+ {
+ $this->fields_form['input'][] = array(
+ 'type' => 'shop',
+ 'label' => $this->l('Shop association:'),
+ 'name' => 'checkBoxShopAsso',
+ );
+ }
if (!($obj = $this->loadObject(true)))
return;
diff --git a/install-dev/classes/controllerHttp.php b/install-dev/classes/controllerHttp.php
index 33c6f9d97..7cef69f5f 100644
--- a/install-dev/classes/controllerHttp.php
+++ b/install-dev/classes/controllerHttp.php
@@ -30,7 +30,7 @@ abstract class InstallControllerHttp
* @var array List of installer steps
*/
protected static $steps = array('welcome', 'license', 'system', 'configure', 'database', 'process');
-
+ protected $phone;
protected static $instances = array();
/**
@@ -318,7 +318,14 @@ abstract class InstallControllerHttp
*/
public function getPhone()
{
- return $this->language->getInformation('phone', false);
+ if ($this->phone === null)
+ {
+ $this->phone = $this->language->getInformation('phone', false);
+ if ($iframe = Tools::file_get_contents('http://api.prestashop.com/iframe/install.php?lang='.$this->language->getLanguageIso()))
+ if (preg_match('//Ui', $iframe, $matches) && isset($matches[1]))
+ $this->phone = $matches[1];
+ }
+ return $this->phone;
}
/**
diff --git a/install-dev/langs/es/install.php b/install-dev/langs/es/install.php
index 32f9ca37e..69acae9e4 100644
--- a/install-dev/langs/es/install.php
+++ b/install-dev/langs/es/install.php
@@ -1,7 +1,7 @@
array(
- 'phone' => '+1 (888) 947-6543',
+ 'phone' => '+34 917.872.909',
'support' => 'https://www.prestashop.com/es/support',
),
'translations' => array(
diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js
index cbc704a15..1bb403720 100644
--- a/js/admin_carrier_wizard.js
+++ b/js/admin_carrier_wizard.js
@@ -105,8 +105,8 @@ function onLeaveStepCallback(obj, context)
{
if (context.toStep == nbr_steps)
displaySummary();
-
- return validateSteps(context.fromStep); // return false to stay on step and true to continue navigation
+
+ return validateSteps(context.fromStep, context.toStep); // return false to stay on step and true to continue navigation
}
function displaySummary()
@@ -192,25 +192,25 @@ function displaySummary()
});
}
-function validateSteps(step_number)
+function validateSteps(fromStep, toStep)
{
var is_ok = true;
- if ((multistore_enable && step_number == 3) || (!multistore_enable && step_number == 2))
+ if ((multistore_enable && fromStep == 3) || (!multistore_enable && fromStep == 2))
{
- if (!$('#is_free_on').attr('checked') && !validateRange(2))
+ if (toStep > fromStep && !$('#is_free_on').attr('checked') && !validateRange(2))
is_ok = false;
}
$('.wizard_error').remove();
if (is_ok)
{
- form = $('#carrier_wizard #step-'+step_number+' form');
+ form = $('#carrier_wizard #step-'+fromStep+' form');
$.ajax({
type:"POST",
url : validate_url,
async: false,
dataType: 'json',
- data : form.serialize()+'&step_number='+step_number+'&action=validate_step&ajax=1',
+ data : form.serialize()+'&step_number='+fromStep+'&action=validate_step&ajax=1',
success : function(datas)
{
if (datas.has_error)
@@ -220,7 +220,7 @@ function validateSteps(step_number)
$('input').focus( function () {
$(this).removeClass('field_error');
});
- displayError(datas.errors, step_number);
+ displayError(datas.errors, fromStep);
resizeWizard();
}
},
diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php
index 48d1a70c1..0d8ffbb8a 100644
--- a/modules/blocksearch/blocksearch.php
+++ b/modules/blocksearch/blocksearch.php
@@ -80,23 +80,24 @@ public function hookDisplayMobileHeader($params)
public function hookRightColumn($params)
{
- if (!$this->isCached('blocksearch.tpl', $this->getCacheId()))
+
+ if (Tools::getValue('search_query') || !$this->isCached('blocksearch.tpl', $this->getCacheId()))
{
$this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'block');
}
- return $this->display(__FILE__, 'blocksearch.tpl', $this->getCacheId());
+ return $this->display(__FILE__, 'blocksearch.tpl', Tools::getValue('search_query') ? null : $this->getCacheId());
}
public function hookTop($params)
{
- if (!$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
+ if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
{
$this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'top');
}
- return $this->display(__FILE__, 'blocksearch-top.tpl', $this->getCacheId('blocksearch-top'));
+ return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $this->getCacheId('blocksearch-top'));
}
/**