Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release
This commit is contained in:
+8
-1
@@ -161,6 +161,13 @@ function add_condition(id_condition_group, type, value)
|
|||||||
function delete_condition(condition)
|
function delete_condition(condition)
|
||||||
{
|
{
|
||||||
delete conditions[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();
|
$('#'+condition).remove();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -178,7 +185,7 @@ function new_condition_group()
|
|||||||
function appendConditionToGroup(html)
|
function appendConditionToGroup(html)
|
||||||
{
|
{
|
||||||
if ($('#condition_group_'+current_id_condition_group+' table tbody tr').length > 0)
|
if ($('#condition_group_'+current_id_condition_group+' table tbody tr').length > 0)
|
||||||
$('#condition_group_'+current_id_condition_group+' table tbody').append('<tr><td align="center" colspan="3"><b>{l s='AND' js=1}</b></td></tr>');
|
$('#condition_group_'+current_id_condition_group+' table tbody').append('<tr><td align="center" class="btn_delete_condition" colspan="3"><b>{l s='AND' js=1}</b></td></tr>');
|
||||||
$('#condition_group_'+current_id_condition_group+' table tbody').append(html);
|
$('#condition_group_'+current_id_condition_group+' table tbody').append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,14 +142,15 @@ class AttributeGroupCore extends ObjectModel
|
|||||||
if (!AttributeGroup::cleanDeadCombinations())
|
if (!AttributeGroup::cleanDeadCombinations())
|
||||||
return false;
|
return false;
|
||||||
/* Also delete related attributes */
|
/* Also delete related attributes */
|
||||||
if (Db::getInstance()->execute('
|
if (count($to_remove))
|
||||||
|
if (!Db::getInstance()->execute('
|
||||||
DELETE FROM `'._DB_PREFIX_.'attribute_lang`
|
DELETE FROM `'._DB_PREFIX_.'attribute_lang`
|
||||||
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') === false ||
|
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
|
||||||
Db::getInstance()->execute('
|
!Db::getInstance()->execute('
|
||||||
DELETE FROM `'._DB_PREFIX_.'attribute_shop`
|
DELETE FROM `'._DB_PREFIX_.'attribute_shop`
|
||||||
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') === false ||
|
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
|
||||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false)
|
!Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id))
|
||||||
return false;
|
return false;
|
||||||
$this->cleanPositions();
|
$this->cleanPositions();
|
||||||
}
|
}
|
||||||
$return = parent::delete();
|
$return = parent::delete();
|
||||||
|
|||||||
@@ -53,22 +53,15 @@ class TaxRulesGroupCore extends ObjectModel
|
|||||||
|
|
||||||
protected static $_taxes = array();
|
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('
|
||||||
return Db::getInstance()->executeS('
|
SELECT DISTINCT g.id_tax_rules_group, g.name, g.active
|
||||||
SELECT *
|
|
||||||
FROM `'._DB_PREFIX_.'tax_rules_group` g'
|
FROM `'._DB_PREFIX_.'tax_rules_group` g'
|
||||||
.Shop::addSqlAssociation('tax_rules_group', 'g')
|
.Shop::addSqlAssociation('tax_rules_group', 'g')
|
||||||
.($only_active ? ' WHERE g.`active` = 1' : '').'
|
.($only_active ? ' WHERE g.`active` = 1' : '').'
|
||||||
ORDER BY name ASC');
|
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');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -718,7 +718,7 @@ class AdminCarrierWizardControllerCore extends AdminController
|
|||||||
&& (!isset($logo['error']) || !$logo['error'])
|
&& (!isset($logo['error']) || !$logo['error'])
|
||||||
&& preg_match('/\.(jpe?g|gif|png)$/', $logo['name'])
|
&& preg_match('/\.(jpe?g|gif|png)$/', $logo['name'])
|
||||||
&& is_uploaded_file($logo['tmp_name'])
|
&& is_uploaded_file($logo['tmp_name'])
|
||||||
&& ImageManager::isRealImage($logo['tmp_name']))
|
&& ImageManager::isRealImage($logo['tmp_name'], $logo['type']))
|
||||||
{
|
{
|
||||||
$file = $logo['tmp_name'];
|
$file = $logo['tmp_name'];
|
||||||
do $tmp_name = uniqid().'.jpg';
|
do $tmp_name = uniqid().'.jpg';
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ class AdminCategoriesControllerCore extends AdminController
|
|||||||
$id_parent = (int)Tools::getValue('id_parent');
|
$id_parent = (int)Tools::getValue('id_parent');
|
||||||
|
|
||||||
// if true, we are in a root category creation
|
// 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['is_root_category'] = $_POST['level_depth'] = 1;
|
||||||
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
|
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ class AdminLogsControllerCore extends AdminController
|
|||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
$this->noLink = true;
|
$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(
|
$this->fields_list = array(
|
||||||
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||||
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100),
|
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100),
|
||||||
|
|||||||
@@ -2993,7 +2993,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$data->assign(array(
|
$data->assign(array(
|
||||||
'link' => $this->context->link,
|
'link' => $this->context->link,
|
||||||
'currency' => $currency = $this->context->currency,
|
'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),
|
'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id),
|
||||||
'ecotaxTaxRate' => Tax::getProductEcotaxRate(),
|
'ecotaxTaxRate' => Tax::getProductEcotaxRate(),
|
||||||
'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),
|
'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),
|
||||||
|
|||||||
@@ -179,6 +179,15 @@ class AdminTaxRulesGroupControllerCore extends AdminController
|
|||||||
'stay' => true
|
'stay' => true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (Shop::isFeatureActive())
|
||||||
|
{
|
||||||
|
$this->fields_form['input'][] = array(
|
||||||
|
'type' => 'shop',
|
||||||
|
'label' => $this->l('Shop association:'),
|
||||||
|
'name' => 'checkBoxShopAsso',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!($obj = $this->loadObject(true)))
|
if (!($obj = $this->loadObject(true)))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ abstract class InstallControllerHttp
|
|||||||
* @var array List of installer steps
|
* @var array List of installer steps
|
||||||
*/
|
*/
|
||||||
protected static $steps = array('welcome', 'license', 'system', 'configure', 'database', 'process');
|
protected static $steps = array('welcome', 'license', 'system', 'configure', 'database', 'process');
|
||||||
|
protected $phone;
|
||||||
protected static $instances = array();
|
protected static $instances = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -318,7 +318,14 @@ abstract class InstallControllerHttp
|
|||||||
*/
|
*/
|
||||||
public function getPhone()
|
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('/<img.+alt="([^"]+)".*>/Ui', $iframe, $matches) && isset($matches[1]))
|
||||||
|
$this->phone = $matches[1];
|
||||||
|
}
|
||||||
|
return $this->phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
return array(
|
return array(
|
||||||
'informations' => array(
|
'informations' => array(
|
||||||
'phone' => '+1 (888) 947-6543',
|
'phone' => '+34 917.872.909',
|
||||||
'support' => 'https://www.prestashop.com/es/support',
|
'support' => 'https://www.prestashop.com/es/support',
|
||||||
),
|
),
|
||||||
'translations' => array(
|
'translations' => array(
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ function onLeaveStepCallback(obj, context)
|
|||||||
{
|
{
|
||||||
if (context.toStep == nbr_steps)
|
if (context.toStep == nbr_steps)
|
||||||
displaySummary();
|
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()
|
function displaySummary()
|
||||||
@@ -192,25 +192,25 @@ function displaySummary()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateSteps(step_number)
|
function validateSteps(fromStep, toStep)
|
||||||
{
|
{
|
||||||
var is_ok = true;
|
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;
|
is_ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.wizard_error').remove();
|
$('.wizard_error').remove();
|
||||||
if (is_ok)
|
if (is_ok)
|
||||||
{
|
{
|
||||||
form = $('#carrier_wizard #step-'+step_number+' form');
|
form = $('#carrier_wizard #step-'+fromStep+' form');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"POST",
|
type:"POST",
|
||||||
url : validate_url,
|
url : validate_url,
|
||||||
async: false,
|
async: false,
|
||||||
dataType: 'json',
|
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)
|
success : function(datas)
|
||||||
{
|
{
|
||||||
if (datas.has_error)
|
if (datas.has_error)
|
||||||
@@ -220,7 +220,7 @@ function validateSteps(step_number)
|
|||||||
$('input').focus( function () {
|
$('input').focus( function () {
|
||||||
$(this).removeClass('field_error');
|
$(this).removeClass('field_error');
|
||||||
});
|
});
|
||||||
displayError(datas.errors, step_number);
|
displayError(datas.errors, fromStep);
|
||||||
resizeWizard();
|
resizeWizard();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -80,23 +80,24 @@ public function hookDisplayMobileHeader($params)
|
|||||||
|
|
||||||
public function hookRightColumn($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->calculHookCommon($params);
|
||||||
$this->smarty->assign('blocksearch_type', 'block');
|
$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)
|
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->calculHookCommon($params);
|
||||||
$this->smarty->assign('blocksearch_type', 'top');
|
$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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user