From 4b0b5cf4da25a5e7a00d9d031db795ca14dbc359 Mon Sep 17 00:00:00 2001 From: fram Date: Tue, 5 Nov 2013 12:08:14 +0100 Subject: [PATCH 01/11] // added an option not to override the local localization pack when installing a localization pack --- .../admin/AdminLocalizationController.php | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminLocalizationController.php b/controllers/admin/AdminLocalizationController.php index 882ad4e5e..508b7b83c 100644 --- a/controllers/admin/AdminLocalizationController.php +++ b/controllers/admin/AdminLocalizationController.php @@ -145,8 +145,10 @@ class AdminLocalizationControllerCore extends AdminController if (Validate::isFileName(Tools::getValue('iso_localization_pack'))) { - - $pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml'); + if (Tools::getValue('download_updated_pack') == '1') + $pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml'); + else + $pack = false; if (!$pack && !($pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml'))) $this->errors[] = Tools::displayError('Cannot load the localization pack.'); @@ -264,6 +266,26 @@ class AdminLocalizationControllerCore extends AdminController 'id' => 'id', 'name' => 'name' ) + ), + array( + 'type' => 'radio', + 'label' => $this->l('Download pack data'), + 'desc' => $this->l('If set to yes then the localization pack will be downloaded from prestashop.com. Otherwise the local xml file found in the localization folder of your PrestaShop installation will be used.'), + 'name' => 'download_updated_pack', + 'class' => 't', + 'is_bool'=> true, + 'values' => array( + array( + 'id' => 'download_updated_pack_yes', + 'value' => 1, + 'label' => $this->l('Yes') + ), + array( + 'id' => 'download_updated_pack_no', + 'value' => 0, + 'label' => $this->l('No') + ) + ) ) ), 'submit' => array( @@ -278,7 +300,8 @@ class AdminLocalizationControllerCore extends AdminController 'selection[]_taxes' => true, 'selection[]_currencies' => true, 'selection[]_languages' => true, - 'selection[]_units' => true + 'selection[]_units' => true, + 'download_updated_pack' => 1 ); $this->show_toolbar = false; From 99ad6481e690aa44499adae19bb2cfa426303151 Mon Sep 17 00:00:00 2001 From: Javsmile Date: Thu, 7 Nov 2013 17:53:47 +0100 Subject: [PATCH 02/11] Update productcomments.php This little addition fix the problem for enlight the stars in the hookproductTab whe you disable or make an exception of the hookproductOutOfStock with the product file. --- modules/productcomments/productcomments.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php index ec26dfad2..499bde34f 100644 --- a/modules/productcomments/productcomments.php +++ b/modules/productcomments/productcomments.php @@ -680,11 +680,14 @@ class ProductComments extends Module { require_once(dirname(__FILE__).'/ProductComment.php'); require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $average = ProductComment::getAverageGrade((int)Tools::getValue('id_product')); $this->context->smarty->assign(array( 'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), 'comments' => ProductComment::getByProduct((int)(Tools::getValue('id_product'))), 'criterions' => ProductCommentCriterion::getByProduct((int)(Tools::getValue('id_product')), $this->context->language->id), + 'averageTotal' => round($average['grade']), 'nbComments' => (int)(ProductComment::getCommentNumber((int)(Tools::getValue('id_product')))) )); From e5f0bcb916166433e48db293f75084272a148048 Mon Sep 17 00:00:00 2001 From: soware Date: Sat, 16 Nov 2013 00:37:47 -0200 Subject: [PATCH 03/11] Update form.tpl I removed the line 109 because the price tab problem and because this line is redundant. The first show (line 95) always is executed. If the price is saved twice, the second the div #product-tab-content-wait never is hided and show the loading forever. It is because the line 109 show this tab again, in the sequence: show (line 95), hide (line 213), show (line 109). This happening just for price tab. --- .../default/template/controllers/products/helpers/form/form.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/products/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/products/helpers/form/form.tpl index 8f8280821..18cf6556c 100644 --- a/admin-dev/themes/default/template/controllers/products/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/products/helpers/form/form.tpl @@ -106,7 +106,6 @@ $(document).ready(function() { - $('#product-tab-content-wait').show(); //product_type = $("input[name=type_product]:checked").val(); if (product_type == product_type_pack) { From bd241a9c4814627a33e8357b1dc52ad5ffcca5ca Mon Sep 17 00:00:00 2001 From: rGaillard Date: Mon, 18 Nov 2013 12:04:09 +0100 Subject: [PATCH 04/11] [-] BO: product price was changed on changing to advanced stock management #PSCFV-10996 --- classes/Product.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/Product.php b/classes/Product.php index 6bfdc8c53..d2e943965 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -5278,7 +5278,10 @@ class ProductCore extends ObjectModel WHERE id_product='.(int)$this->id.Shop::addSqlRestriction() ); else + { + $this->setFieldsToUpdate(array('advanced_stock_management' => true)); $this->save(); + } } /** From 477174695951538ee8589daaf8c09c56332702f3 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 18 Nov 2013 12:26:08 +0100 Subject: [PATCH 05/11] [-) FO : Fix bug #PSCFV-10926, trailing question mark in pagination url --- classes/Link.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/Link.php b/classes/Link.php index f908e7225..b2e4f0776 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -510,6 +510,7 @@ class LinkCore public function goPage($url, $p) { + $url = rtrim(str_replace('?&', '?', $url), '?'); return $url.($p == 1 ? '' : (!strstr($url, '?') ? '?' : '&').'p='.(int)$p); } From 22a9548f8371caf19793f69243b8241575005e06 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 18 Nov 2013 14:32:34 +0100 Subject: [PATCH 06/11] [-] FO : Fix bug #PSCFV-11043, bad cache id from module template --- 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 0dbd10c32..5fdcb2a38 100644 --- a/modules/blocksearch/blocksearch.php +++ b/modules/blocksearch/blocksearch.php @@ -53,6 +53,7 @@ class BlockSearch extends Module public function hookdisplayMobileTopSiteMap($params) { $this->smarty->assign(array('hook_mobile' => true, 'instantsearch' => false)); + $params['hook_mobile'] = true; return $this->hookTop($params); } @@ -80,7 +81,6 @@ public function hookDisplayMobileHeader($params) public function hookRightColumn($params) { - if (Tools::getValue('search_query') || !$this->isCached('blocksearch.tpl', $this->getCacheId())) { $this->calculHookCommon($params); @@ -95,7 +95,8 @@ public function hookDisplayMobileHeader($params) public function hookTop($params) { - if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top'))) + $key = $this->getCacheId('blocksearch-top'.((!isset($params['hook_mobile']) || !$params['hook_mobile']) ? '' : '-hook_mobile')); + if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $key)) { $this->calculHookCommon($params); $this->smarty->assign(array( @@ -105,8 +106,8 @@ public function hookDisplayMobileHeader($params) ); } - - return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $this->getCacheId('blocksearch-top')); +d($key); + return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $key); } /** From dbc08d779c4c304071b3070aa06ea51d741a4359 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 18 Nov 2013 14:35:39 +0100 Subject: [PATCH 07/11] // typo, sorry about this --- modules/blocksearch/blocksearch.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php index 5fdcb2a38..e703f3dbe 100644 --- a/modules/blocksearch/blocksearch.php +++ b/modules/blocksearch/blocksearch.php @@ -106,7 +106,6 @@ public function hookDisplayMobileHeader($params) ); } -d($key); return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $key); } From bcc851c98cbabb4056fdb925645cb4b9541d1313 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 18 Oct 2013 17:50:36 +0200 Subject: [PATCH 08/11] // Update image fix --- controllers/admin/AdminGendersController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/controllers/admin/AdminGendersController.php b/controllers/admin/AdminGendersController.php index ef4cf1414..4bc4057ce 100644 --- a/controllers/admin/AdminGendersController.php +++ b/controllers/admin/AdminGendersController.php @@ -195,6 +195,22 @@ class AdminGendersControllerCore extends AdminController } return !count($this->errors) ? true : false; } + + protected function afterImageUpload() + { + parent::afterImageUpload(); + + if (($id_gender = (int)Tools::getValue('id_gender')) && + isset($_FILES) && count($_FILES) && file_exists(_PS_GENDERS_DIR_.$id_gender.'.jpg')) + { + $current_file = _PS_TMP_IMG_DIR_.'gender_mini_'.$id_gender.'_'.$this->context->shop->id.'.jpg'; + + if (file_exists($current_file)) + unlink($current_file); + } + + return true; + } } From 8d627aa522b3ff233b7175a02c47c6e36547ceb9 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 18 Nov 2013 14:58:17 +0100 Subject: [PATCH 09/11] [-] MO : Referralprogram Prevent Exception when badly configured --- modules/referralprogram/ReferralProgramModule.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/referralprogram/ReferralProgramModule.php b/modules/referralprogram/ReferralProgramModule.php index af7197d69..47ad866e8 100644 --- a/modules/referralprogram/ReferralProgramModule.php +++ b/modules/referralprogram/ReferralProgramModule.php @@ -93,6 +93,8 @@ class ReferralProgramModule extends ObjectModel $cartRule->date_to = date('Y-m-d H:i:s', time() + 31536000); // + 1 year $cartRule->code = $this->getDiscountPrefix().Tools::passwdGen(6); $cartRule->name = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION'); + if (empty($cartRule->name)) + $cartRule->name = 'Referral reward'; $cartRule->id_customer = (int)$id_customer; $cartRule->reduction_currency = (int)$id_currency; From 6633efd27dde48f418b4f296cfc2cb2e009300a0 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 18 Nov 2013 15:11:49 +0100 Subject: [PATCH 10/11] [-] BO : Fix bug #PNM-1594, selected value error in helper list --- .../default/template/helpers/list/list_header.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin-dev/themes/default/template/helpers/list/list_header.tpl b/admin-dev/themes/default/template/helpers/list/list_header.tpl index f599a5c7a..6fd7d7a7a 100644 --- a/admin-dev/themes/default/template/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_header.tpl @@ -103,7 +103,7 @@ / {$list_total} {l s='result(s)'} @@ -188,8 +188,8 @@ {if $params.type == 'bool'} {elseif $params.type == 'date' || $params.type == 'datetime'} {l s='From'}
@@ -197,10 +197,10 @@ {elseif $params.type == 'select'} {if isset($params.filter_key)} From 0889ab4eec5edb1144c34542487f256ea2860e1d Mon Sep 17 00:00:00 2001 From: fram Date: Mon, 18 Nov 2013 15:30:05 +0100 Subject: [PATCH 11/11] // fixed typo in Russian installer --- install-dev/langs/ru/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-dev/langs/ru/install.php b/install-dev/langs/ru/install.php index 4b27fd2b0..57583ca39 100644 --- a/install-dev/langs/ru/install.php +++ b/install-dev/langs/ru/install.php @@ -212,7 +212,7 @@ return array( 'Contact us' => 'Свяжитесь с нами', 'PrestaShop Installation Assistant' => 'Помощник установки PrestaShop', 'Installation Assistant' => 'Помощник установки', - 'License Agreements' => 'Лицензионное соглшение', + 'License Agreements' => 'Лицензионное соглашение', 'Print my login information' => 'Распечатать информацию о моем аккаунте', 'To use PrestaShop, you must create a database to collect all of your store’s data-related activities.' => 'Для использования PrestaShop, Вам следует создать базу данных , чтобы сгруппировать информацию Вашего магазина.', 'Please complete the fields below in order for PrestaShop to connect to your database. ' => 'Заполните поля ниже, чтобы PrestaShop смог установить соединение с Вашей с базой данных.',