From 600b027efd9a6a406dc9aa857b1b7f81eba35576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 21 Aug 2013 14:37:39 +0200 Subject: [PATCH 01/11] // fix root categories addition --- controllers/admin/AdminCategoriesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); From 4d3fc8c314f8fa117ee8c017c1ef57ab2e23cd13 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 21 Aug 2013 15:13:35 +0200 Subject: [PATCH 02/11] [-] MO : fixed smarty cache on blocksearch #PSCFV-8739 --- modules/blocksearch/blocksearch.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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')); } /** From dd9aa9fdb52e17fd494ccc60ba56a998354317d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 21 Aug 2013 17:43:34 +0200 Subject: [PATCH 03/11] // disable log deletion --- controllers/admin/AdminLogsController.php | 3 --- 1 file changed, 3 deletions(-) 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), From 3fcf166a9da7f893aaeceaa3fc888f5ef845895c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 21 Aug 2013 18:24:10 +0200 Subject: [PATCH 04/11] // small fix --- classes/AttributeGroup.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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(); From 099baaef7050bed6bb5e32806c6ae6db23b1d460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 21 Aug 2013 19:14:59 +0200 Subject: [PATCH 05/11] // small change on specific price rules after condition deletion --- .../specific_price_rule/helpers/form/form.tpl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); } From ba95c9a63a85b02e62bfdbed805bd6cd3df8667b Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Thu, 22 Aug 2013 10:09:49 +0200 Subject: [PATCH 06/11] [-] BO : fixed bug #PSCFV-10073 - now you can upload carrier logo on windows --- controllers/admin/AdminCarrierWizardController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminCarrierWizardController.php b/controllers/admin/AdminCarrierWizardController.php index 02c81e2e0..6852ce058 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'; From eea79052e06581519869ff93a9a2d6c40ce1c05d Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Thu, 22 Aug 2013 10:15:55 +0200 Subject: [PATCH 07/11] [-] BO : fixed bug #PSCFV-10169 - now you can go backward from step 3 to 2 when no ranges are set --- js/admin_carrier_wizard.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js index cbc704a15..8592ecdb9 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,10 +192,10 @@ 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) && toStep > fromStep) { if (!$('#is_free_on').attr('checked') && !validateRange(2)) is_ok = false; @@ -204,13 +204,13 @@ function validateSteps(step_number) $('.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(); } }, From 6ad274e39dbb5bf608c36072a08d728424687db8 Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Thu, 22 Aug 2013 10:33:03 +0200 Subject: [PATCH 08/11] //Small fix --- js/admin_carrier_wizard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js index 8592ecdb9..1bb403720 100644 --- a/js/admin_carrier_wizard.js +++ b/js/admin_carrier_wizard.js @@ -195,9 +195,9 @@ function displaySummary() function validateSteps(fromStep, toStep) { var is_ok = true; - if ((multistore_enable && fromStep == 3) || (!multistore_enable && fromStep == 2) && toStep > fromStep) + 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; } From 907d81c32ed3409e997131d6c5042fc5ea16ce2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 22 Aug 2013 10:53:50 +0200 Subject: [PATCH 09/11] // duplication of tax_rules_group on adminproducts with multishop --- classes/tax/TaxRulesGroup.php | 15 ++++----------- controllers/admin/AdminProductsController.php | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) 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/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(), From f476b3413990c75e572d416365a9316853cbb7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 22 Aug 2013 11:13:11 +0200 Subject: [PATCH 10/11] [-] BO: Fix multishop association for tax rules group - #PSCFV-9967 --- controllers/admin/AdminTaxRulesGroupController.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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; From 4de8013b5ee7ff846e3cd0b69522d13433c5060b Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 22 Aug 2013 12:19:32 +0200 Subject: [PATCH 11/11] // Fixed phone number in installer --- install-dev/classes/controllerHttp.php | 11 +++++++++-- install-dev/langs/es/install.php | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) 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(