From 87567ed1a05ad5a348b432d9a01ad04f627074ad Mon Sep 17 00:00:00 2001 From: djfm Date: Wed, 4 Sep 2013 07:44:52 +0000 Subject: [PATCH 01/85] // fixed translation of modules descriptions containing quotes --- classes/module/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/module/Module.php b/classes/module/Module.php index f6b2fd8fd..2e911e26d 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -935,7 +935,7 @@ abstract class ModuleCore public static function configXmlStringFormat($string) { - return str_replace('\'', '\\\'', Tools::htmlentitiesDecodeUTF8($string)); + return Tools::htmlentitiesDecodeUTF8($string); } From 641cf225f2cfbf2eecea6d74db1327017b322efd Mon Sep 17 00:00:00 2001 From: djfm Date: Mon, 9 Sep 2013 09:47:44 +0000 Subject: [PATCH 02/85] // fix small translation bug PSCFV-10329 --- .../template/controllers/referrers/helpers/form/form.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/referrers/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/referrers/helpers/form/form.tpl index fa1244e65..01c588730 100644 --- a/admin-dev/themes/default/template/controllers/referrers/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/referrers/helpers/form/form.tpl @@ -45,7 +45,7 @@ {l s='The field `request_uri` is the URL from which the customers come to your website.'}
{l s='For example, if the visitor accesses a product page, the URL will be'} "{$uri}music-ipods/1-ipod-nano.html".
{l s='This is helpful because you can add tags or tokens in the links pointing to your website.'} - {l s='For example, you can post a link "%dindex.php?prestashop" in the forum and get statistics by entering "%prestashop" in the field `request_uri`. '} + {l s='For example, you can post a link "%1$sindex.php?prestashop" in the forum and get statistics by entering "%%prestashop" in the field `request_uri`. ' sprintf=[$uri]} {l s='This method is more reliable than the `http_referer`, but there is one disadvantage. If a search engine references a page with your link, then it will be displayed in the search results and you will not only have visitors from the forum, but also those from the search engine.'}
From 452f41df8da32c87e0170ae033168a694b5032f0 Mon Sep 17 00:00:00 2001 From: zimmi1 Date: Fri, 13 Sep 2013 10:05:30 +0200 Subject: [PATCH 03/85] Speeding up sql queries Searching for "DATE_ADD(date_add, INTERVAL 30 MINUTE) > now" needs for every line to add 30 minutes to the date. but it is the same operation as comparing "date_add > (now - 30 minutes). It is faster because there is no DATE_ADD calculation. The problem: By profiling speed of my shop, this query appeared after about 3 months always as the absolute slowest query of the shop, needing about 15 to 30 ms to perform, because I have now nearly 700 connections to my shop (and it then browses the 700 lines) A solution: Removing DATE_ADD MySql function and using date() and time() functions of php for calculating only once the 30 min. difference. Using this solution takes it down again to 0.8 to 1.3 ms. I guess it is the same in case of bots (could be even worse as they can make thousands of connections). --- classes/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Connection.php b/classes/Connection.php index 23514695b..206bd307b 100644 --- a/classes/Connection.php +++ b/classes/Connection.php @@ -114,7 +114,7 @@ class ConnectionCore extends ObjectModel // This is a bot and we have to retrieve its connection ID $sql = 'SELECT `id_connections` FROM `'._DB_PREFIX_.'connections` WHERE ip_address = '.ip2long(Tools::getRemoteAddr()).' - AND DATE_ADD(`date_add`, INTERVAL 30 MINUTE) > \''.pSQL(date('Y-m-d H:i:00')).'\' + AND `date_add` > \''.pSQL(date('Y-m-d H:i:00'), time() - 1800).'\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `date_add` DESC'; if ($id_connections = Db::getInstance()->getValue($sql)) @@ -128,7 +128,7 @@ class ConnectionCore extends ObjectModel $sql = 'SELECT `id_guest` FROM `'._DB_PREFIX_.'connections` WHERE `id_guest` = '.(int)$cookie->id_guest.' - AND DATE_ADD(`date_add`, INTERVAL 30 MINUTE) > \''.pSQL(date('Y-m-d H:i:00')).'\' + AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `date_add` DESC'; $result = Db::getInstance()->getRow($sql); From 3eb4d65fc923daccf7173c088a6a9d6c024877e3 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 13 Sep 2013 10:26:08 +0200 Subject: [PATCH 04/85] [-] BO : Fix Bug #PSCFV-10331 check all from list --- controllers/admin/AdminTaxRulesGroupController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index c36597348..21045acfb 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -78,6 +78,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController public function initRulesList($id_group) { $this->table = 'tax_rule'; + $this->list_id = 'tax_rule'; $this->identifier = 'id_tax_rule'; $this->className = 'TaxRule'; $this->lang = false; From d9bc07d03053916f1ff4a74815bc0f58480ef0fc Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 13 Sep 2013 10:45:07 +0200 Subject: [PATCH 05/85] [-] BO : quote badly decoded in customerThreads --- controllers/admin/AdminCustomerThreadsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCustomerThreadsController.php b/controllers/admin/AdminCustomerThreadsController.php index 4e7c97c25..c53945a5b 100644 --- a/controllers/admin/AdminCustomerThreadsController.php +++ b/controllers/admin/AdminCustomerThreadsController.php @@ -597,11 +597,12 @@ class AdminCustomerThreadsControllerCore extends AdminController } $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', '\1\2', html_entity_decode($message['message'], - ENT_NOQUOTES, 'UTF-8') + ENT_QUOTES, 'UTF-8') ); $tpl->assign(array( From 4f06b74a29e6bc49a700d59803399f4f18dccab0 Mon Sep 17 00:00:00 2001 From: zimmi1 Date: Fri, 13 Sep 2013 11:56:50 +0200 Subject: [PATCH 06/85] Update Connection.php correction from 717 I'm very very sorry, I produced an error with the last commit on this file: there was an error in parenthesis position on line 117. Line 117 should be as line 131. (But how did I manage to make this wrong ???) --- classes/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Connection.php b/classes/Connection.php index 206bd307b..7375841c9 100644 --- a/classes/Connection.php +++ b/classes/Connection.php @@ -114,7 +114,7 @@ class ConnectionCore extends ObjectModel // This is a bot and we have to retrieve its connection ID $sql = 'SELECT `id_connections` FROM `'._DB_PREFIX_.'connections` WHERE ip_address = '.ip2long(Tools::getRemoteAddr()).' - AND `date_add` > \''.pSQL(date('Y-m-d H:i:00'), time() - 1800).'\' + AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `date_add` DESC'; if ($id_connections = Db::getInstance()->getValue($sql)) From 5363e75238f955005a76c68ae98045e6cf3a5548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 13 Sep 2013 12:13:12 +0200 Subject: [PATCH 07/85] // small fix --- classes/Autoload.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/Autoload.php b/classes/Autoload.php index 7f20b0cf9..bd1a6715c 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -54,6 +54,8 @@ class Autoload $this->root_dir = dirname(dirname(__FILE__)).'/'; if (file_exists($this->root_dir.Autoload::INDEX_FILE)) $this->index = include($this->root_dir.Autoload::INDEX_FILE); + else + $this->generateIndex(); } /** From 97ec6341e858d7b3b5d3938aa59ac9dfdd558ab3 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 13 Sep 2013 15:39:30 +0200 Subject: [PATCH 08/85] [-] BO ; Fix bug #PSCFV-10393 manufacturer filter --- controllers/admin/AdminManufacturersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index ebdb2ad1d..4d26c7627 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -140,7 +140,7 @@ class AdminManufacturersControllerCore extends AdminController 'lastname' => array( 'title' => $this->l('Last name'), 'width' => 100, - 'filter_key' => 'a!name' + 'filter_key' => 'a!lastname' ), 'postcode' => array( 'title' => $this->l('Zip Code/Postal Code'), From d0ef8cca8f66a8a1e57a5eda89ce146c6b75ce52 Mon Sep 17 00:00:00 2001 From: makk1ntosh Date: Fri, 13 Sep 2013 08:02:47 -0700 Subject: [PATCH 09/85] Added ui.button as dependency of ui.dialog While developing my own module, i've upgraded installation to latest version of PS and impacted a bug: $('#something').dialog({...}); caused an error: t().button is not a function. In my php code i had this: $this->context->controller->addJqueryUI('ui.dialog'); i found that it doesn't load ui.button dependency. Added 'ui.button' to classes/Media.php at the end of ui.dialog dependencies and all worked fine. --- classes/Media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Media.php b/classes/Media.php index 86b51e5ff..7ce172f56 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -39,7 +39,7 @@ class MediaCore 'ui.accordion' => array('fileName' => 'jquery.ui.accordion.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), 'ui.autocomplete' => array('fileName' => 'jquery.ui.autocomplete.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), 'ui.button' => array('fileName' => 'jquery.ui.button.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position','ui.button'), 'theme' => true), 'ui.slider' => array('fileName' => 'jquery.ui.slider.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), 'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), 'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true), From 6da1228359a52291bdc31ce428566c7380ff0310 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 13 Sep 2013 17:56:45 +0200 Subject: [PATCH 10/85] [-] BO : Fix bug #PSCFV-8407 can not customize feature column name if needed --- js/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/admin.js b/js/admin.js index e4bee41e9..f3d81d410 100644 --- a/js/admin.js +++ b/js/admin.js @@ -481,7 +481,7 @@ function askFeatureName(selected, selector) { var elem; - if (selected.value == 'feature') + if (selected.value == 'features') { $('#features_' + selector).show(); $('#feature_name_' + selector).attr('name', selected.name); From 73dd524de8e0f7a78ae2690f2ada894809404c70 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Sat, 14 Sep 2013 00:05:45 +0200 Subject: [PATCH 11/85] [-] BO : Could not order in AdminStatuses by ID or template --- controllers/admin/AdminStatusesController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/admin/AdminStatusesController.php b/controllers/admin/AdminStatusesController.php index b046fe3ea..fe4e129e0 100644 --- a/controllers/admin/AdminStatusesController.php +++ b/controllers/admin/AdminStatusesController.php @@ -136,6 +136,7 @@ class AdminStatusesControllerCore extends AdminController { $this->table = 'order_return_state'; $this->_defaultOrderBy = $this->identifier = 'id_order_return_state'; + $this->list_id = 'order_return_state'; $this->deleted = false; $this->_orderBy = null; From 08373c05419a1c2cbd35421223266be4fc4a38e8 Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 14 Sep 2013 14:57:00 +0200 Subject: [PATCH 12/85] [+] Modules : add hookHome --- modules/blocknewproducts/blocknewproducts.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php index ae04a77ee..f6b23a22d 100644 --- a/modules/blocknewproducts/blocknewproducts.php +++ b/modules/blocknewproducts/blocknewproducts.php @@ -134,6 +134,11 @@ class BlockNewProducts extends Module { return $this->hookRightColumn($params); } + + public function hookHome($params) + { + return $this->hookRightColumn($params); + } public function hookHeader($params) { From c0afb55d11d2f47d50bb9fc409c354be501923dd Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Mon, 16 Sep 2013 09:25:10 +0200 Subject: [PATCH 13/85] [-] BO : FixBug #PSCFV-9900 Double quote escape problem in delete button link --- classes/helper/HelperList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 69a6127c2..0e979f28c 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -456,7 +456,7 @@ class HelperListCore extends Helper ); if ($this->specificConfirmDelete !== false) - $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : addcslashes(Tools::htmlentitiesDecodeUTF8(self::$cache_lang['DeleteItem'].$name), '\''); + $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : Tools::safeOutput(addcslashes(self::$cache_lang['DeleteItem'].$name, '\'')); $tpl->assign(array_merge($this->tpl_delete_link_vars, $data)); From 0e3d53321aff6cc16ea9c49e541a31c9fde6713f Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 16 Sep 2013 09:37:39 +0200 Subject: [PATCH 14/85] [-] BO : limited the number of customers displayed in the group view to 100 in order to avoid memory usage error --- .../default/template/controllers/groups/helpers/view/view.tpl | 1 + controllers/admin/AdminGroupsController.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl index eceafdb0c..e2503c9a6 100755 --- a/admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl @@ -58,6 +58,7 @@

{l s='Members of this customer group'}

+

{l s='Limited to the 100th first customers.'} {l s='Please use filters to narrow your search.'}

{$customerList} {/block} \ No newline at end of file diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index 3c8f26a79..007bd38b0 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -193,7 +193,7 @@ class AdminGroupsControllerCore extends AdminController 'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool') )); - $customer_list = $group->getCustomers(false, 0, 0, true); + $customer_list = $group->getCustomers(false, 0, 100, true); $helper = new HelperList(); $helper->currentIndex = Context::getContext()->link->getAdminLink('AdminCustomers', false); From 08efa4e3139aa8afa6a854dcfba1d8def2fdc534 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 16 Sep 2013 11:12:55 +0200 Subject: [PATCH 15/85] [-] IN : Fix bug #PSCFV-10382 add_module_to_hook retunrning false when hook not exists --- install-dev/upgrade/php/add_module_to_hook.php | 15 +++++++++------ install-dev/upgrade/sql/1.5.6.0.sql | 14 +++++++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/install-dev/upgrade/php/add_module_to_hook.php b/install-dev/upgrade/php/add_module_to_hook.php index c44e4eabd..fabd39cfa 100644 --- a/install-dev/upgrade/php/add_module_to_hook.php +++ b/install-dev/upgrade/php/add_module_to_hook.php @@ -35,9 +35,14 @@ function add_module_to_hook($module_name, $hook_name) if ((int)$id_module > 0) { - $id_hook = Db::getInstance()->getValue(' - SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = "'.$hook_name.'" - '); + $id_hook = Db::getInstance()->getValue('SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = "'.$hook_name.'"'); + if(!$id_hook) + { + $res &= Db::getInstance()->execute(' + INSERT IGNORE INTO `'._DB_PREFIX_.'hook` (`name`, `title`) + VALUES ("'.pSQL($hook_name).'", "'.pSQL($hook_name).'")'); + $id_hook = Db::getInstance()->Insert_ID(); + } if ((int)$id_hook > 0) { @@ -51,7 +56,5 @@ function add_module_to_hook($module_name, $hook_name) )'); } } - return $res; -} - +} \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.6.0.sql b/install-dev/upgrade/sql/1.5.6.0.sql index 5f5521cff..08f15d8c4 100644 --- a/install-dev/upgrade/sql/1.5.6.0.sql +++ b/install-dev/upgrade/sql/1.5.6.0.sql @@ -1 +1,13 @@ -ALTER TABLE `PREFIX_manufacturer_lang` CHANGE `short_description` `short_description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; \ No newline at end of file +ALTER TABLE `PREFIX_manufacturer_lang` CHANGE `short_description` `short_description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; + +/* PHP:add_module_to_hook(blockcart, actionCartListOverride); */; +/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerDeleteAfter); */; +/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerAddAfter); */; +/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerUpdateAfter); */; +/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierDeleteAfter); */; +/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierAddAfter); */; +/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierUpdateAfter); */; +/* PHP:add_module_to_hook(blockmyaccount, actionModuleRegisterHookAfter); */; +/* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleRegisterHookAfter); */; +/* PHP:add_module_to_hook(blockmyaccount, actionModuleUnRegisterHookAfter); */; +/* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleUnRegisterHookAfter); */; \ No newline at end of file From e68c124218863034db1dbdb93d58ffbf5de46a17 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 16 Sep 2013 11:40:29 +0200 Subject: [PATCH 16/85] [-] FO : replace ucfirst by ucwords for the customer firstname #PSCFV-10396 --- classes/Tools.php | 7 +++++++ controllers/front/AuthController.php | 1 + controllers/front/IdentityController.php | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/Tools.php b/classes/Tools.php index 31adb3bbf..bc0721a84 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1260,6 +1260,13 @@ class ToolsCore return Tools::strtoupper(Tools::substr($str, 0, 1)).Tools::substr($str, 1); } + public static function ucwords($str) + { + if (function_exists('mb_convert_case')) + return mb_convert_case($str, MB_CASE_TITLE); + return ucwords(strtolower($str)); + } + public static function orderbyPrice(&$array, $order_way) { foreach ($array as &$row) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 79b09cce6..505630aaa 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -425,6 +425,7 @@ class AuthControllerCore extends FrontController if (Tools::isSubmit('newsletter')) $this->processCustomerNewsletter($customer); + $customer->firstname = Tools::ucwords($customer->firstname); $customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); if (!Validate::isBirthDate($customer->birthday)) $this->errors[] = Tools::displayError('Invalid date of birth.'); diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index 7f0eb50b4..109cf3bc8 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -79,7 +79,7 @@ class IdentityControllerCore extends FrontController if (!count($this->errors)) { $this->customer->id_default_group = (int)$prev_id_default_group; - $this->customer->firstname = Tools::ucfirst(Tools::strtolower($this->customer->firstname)); + $this->customer->firstname = Tools::ucwords($this->customer->firstname); if (!isset($_POST['newsletter'])) $this->customer->newsletter = 0; From 8504574ae12b5ac75e79a662173a5297e81faa85 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 16 Sep 2013 15:02:12 +0200 Subject: [PATCH 17/85] [-] IN : Could not remove some tabs --- install-dev/upgrade/php/remove_tab.php | 2 +- install-dev/upgrade/sql/1.5.6.0.sql | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/install-dev/upgrade/php/remove_tab.php b/install-dev/upgrade/php/remove_tab.php index 2a0c53902..9ade12ee5 100644 --- a/install-dev/upgrade/php/remove_tab.php +++ b/install-dev/upgrade/php/remove_tab.php @@ -29,6 +29,6 @@ function remove_tab($tabname) Db::getInstance()->execute(' DELETE t, l FROM `'._DB_PREFIX_.'tab` t LEFT JOIN `'._DB_PREFIX_.'tab_lang` l ON (t.id_tab = l.id_tab) - WHERE t.`class_name` = '.pSQL($tabname)); + WHERE t.`class_name` = "'.pSQL($tabname).'"'); } diff --git a/install-dev/upgrade/sql/1.5.6.0.sql b/install-dev/upgrade/sql/1.5.6.0.sql index 08f15d8c4..3b03e96ed 100644 --- a/install-dev/upgrade/sql/1.5.6.0.sql +++ b/install-dev/upgrade/sql/1.5.6.0.sql @@ -10,4 +10,6 @@ ALTER TABLE `PREFIX_manufacturer_lang` CHANGE `short_description` `short_descrip /* PHP:add_module_to_hook(blockmyaccount, actionModuleRegisterHookAfter); */; /* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleRegisterHookAfter); */; /* PHP:add_module_to_hook(blockmyaccount, actionModuleUnRegisterHookAfter); */; -/* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleUnRegisterHookAfter); */; \ No newline at end of file +/* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleUnRegisterHookAfter); */; +/* PHP:remove_tab(AdminRangePrice); */; +/* PHP:remove_tab(AdminRangeWeight); */; \ No newline at end of file From 852faeab7a5b60369dbddf3038d93cb43172dc25 Mon Sep 17 00:00:00 2001 From: CINS Date: Mon, 16 Sep 2013 15:57:44 +0200 Subject: [PATCH 18/85] Update admin.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lorsqu'un produit possède trop d'images, il est impossible de réordonner celle-ci car la valeur JSON fourni en URL (GET) est beaucoup trop longue. Il faut envoyer les données JSON en POST pour solutionner le problème de longueur. --------- When a product has many pictures, we can't reorder them. The JSON value is too long in URL (GET). We need to send data with POST to avoid problem. --- js/admin.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/admin.js b/js/admin.js index f3d81d410..f0d210359 100644 --- a/js/admin.js +++ b/js/admin.js @@ -751,6 +751,7 @@ function doAdminAjax(data, success_func, error_func) { url : 'index.php', data : data, + type : 'POST', success : function(data){ if (success_func) return success_func(data); From 15dd1cf96f0874a28347175e3d3a23fc0f284435 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 16 Sep 2013 17:16:11 +0200 Subject: [PATCH 19/85] [-] BO : Fix bugPSCFV-10249 images copy when unix path --- classes/Tools.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/Tools.php b/classes/Tools.php index bc0721a84..6e2a4030a 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1412,7 +1412,12 @@ class ToolsCore $stream_context = @stream_context_create(array('http' => array('timeout' => 10))); if (in_array(@ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $source)) - return @copy($source, $destination, $stream_context); + { + if (!is_null($stream_context)) + return @copy($source, $destination, $stream_context); + else + return @copy($source, $destination); + } elseif (function_exists('curl_init')) { $curl = curl_init(); From 2d5bd901f4ef47b34795dce6fafb08a7c821bd27 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 16 Sep 2013 18:51:06 +0200 Subject: [PATCH 20/85] [*] CORE : Refactoring Tools::copy() as copy with context > PHP 5.3 --- classes/Tools.php | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 6e2a4030a..38aee11b6 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1408,31 +1408,9 @@ class ToolsCore public static function copy($source, $destination, $stream_context = null) { - if ($stream_context == null && preg_match('/^https?:\/\//', $source)) - $stream_context = @stream_context_create(array('http' => array('timeout' => 10))); - - if (in_array(@ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $source)) - { - if (!is_null($stream_context)) - return @copy($source, $destination, $stream_context); - else - return @copy($source, $destination); - } - elseif (function_exists('curl_init')) - { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl, CURLOPT_URL, $source); - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); - curl_setopt($curl, CURLOPT_TIMEOUT, 10); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); - $opts = stream_context_get_options($stream_context); - $content = curl_exec($curl); - curl_close($curl); - return file_put_contents($destination, $content); - } - else - return false; + if (is_null($stream_context) && !preg_match('/^https?:\/\//', $source)) + return @copy($source, $destination); + return @file_put_contents($destination, Tools::file_get_contents($source, false, $stream_context)); } /** From 6ee6317feef9cf8f2c7689149b8d9666e823b126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 17 Sep 2013 11:07:29 +0200 Subject: [PATCH 21/85] // orderby position --- classes/helper/HelperList.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 0e979f28c..eeb161535 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -136,6 +136,9 @@ class HelperListCore extends Helper $this->_list = $list; $this->fields_list = $fields_display; + $this->orderBy = preg_replace('/^([a-z _]*!)/Ui', '', $this->orderBy); + $this->orderWay = preg_replace('/^([a-z _]*!)/Ui', '', $this->orderWay); + // Display list header (filtering, pagination and column names) $tpl_vars['header'] = $this->displayListHeader(); @@ -522,9 +525,6 @@ class HelperListCore extends Helper isset($this->context->cookie->{$this->list_id.'_pagination'}) ? $this->context->cookie->{$this->list_id.'_pagination'} : null ); - // Cleaning links - if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway')) - $this->currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', $this->currentIndex); if ($this->position_identifier && (int)Tools::getValue($this->position_identifier, 1)) $table_id = substr($this->identifier, 3, strlen($this->identifier)); From e6e8efc19ab354147c7bf33db25a23a53e4ddacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 17 Sep 2013 11:58:12 +0200 Subject: [PATCH 22/85] [-] FO: Fix Product::getAttributesGroups() minimal_quantity/weight/available_date should be multishop --- classes/Product.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index 188ce4a05..19e5917af 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -3055,18 +3055,18 @@ class ProductCore extends ObjectModel if (!Combination::isFeatureActive()) return array(); $sql = 'SELECT ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name, - a.`id_attribute`, al.`name` AS attribute_name, a.`color` AS attribute_color, pa.`id_product_attribute`, - IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`price`, product_attribute_shop.`ecotax`, pa.`weight`, + a.`id_attribute`, al.`name` AS attribute_name, a.`color` AS attribute_color, product_attribute_shop.`id_product_attribute`, + IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`price`, product_attribute_shop.`ecotax`, product_attribute_shop.`weight`, product_attribute_shop.`default_on`, pa.`reference`, product_attribute_shop.`unit_price_impact`, - pa.`minimal_quantity`, pa.`available_date`, ag.`group_type` + product_attribute_shop.`minimal_quantity`, product_attribute_shop.`available_date`, ag.`group_type` FROM `'._DB_PREFIX_.'product_attribute` pa '.Shop::addSqlAssociation('product_attribute', 'pa').' '.Product::sqlStock('pa', 'pa').' - LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` - LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` - LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` - LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON a.`id_attribute` = al.`id_attribute` - LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON ag.`id_attribute_group` = agl.`id_attribute_group` + LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`) + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON (a.`id_attribute` = pac.`id_attribute`) + LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON (ag.`id_attribute_group` = a.`id_attribute_group`) + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute`) + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group`) '.Shop::addSqlAssociation('attribute', 'a').' WHERE pa.`id_product` = '.(int)$this->id.' AND al.`id_lang` = '.(int)$id_lang.' From 3151064daf2980bb70cf6d3c934ff2f3bc73b18f Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Tue, 17 Sep 2013 12:18:37 +0200 Subject: [PATCH 23/85] //small fix on helper form && option --- admin-dev/themes/default/template/helpers/form/form.tpl | 2 +- admin-dev/themes/default/template/helpers/options/options.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index ee9ee638a..ed77b5c40 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -30,7 +30,7 @@ {if isset($fields.title)}

{$fields.title}

{/if} {block name="defaultForm"} -
+ {if $form_id} {/if} diff --git a/admin-dev/themes/default/template/helpers/options/options.tpl b/admin-dev/themes/default/template/helpers/options/options.tpl index ea9bb26c2..3c1309690 100644 --- a/admin-dev/themes/default/template/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/helpers/options/options.tpl @@ -34,7 +34,7 @@ {block name="defaultOptions"} Date: Tue, 17 Sep 2013 14:54:38 +0200 Subject: [PATCH 24/85] //small fix with mode catalog and cart button --- themes/default/product.tpl | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/themes/default/product.tpl b/themes/default/product.tpl index 97f5bbb08..dfd32a4ae 100644 --- a/themes/default/product.tpl +++ b/themes/default/product.tpl @@ -433,17 +433,10 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving {/if} {*close if for show price*} {/if} - {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} - - - {l s='Add to cart'} - - {else} -

- - -

- {/if} +

quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}style="display:none"{/if} class="buttons_bottom_block"> + + +

{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
From 47c5f400eecb12c9828a4ae619ec246c5e9dcedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 17 Sep 2013 16:30:47 +0200 Subject: [PATCH 25/85] // Add gender on order view --- .../default/template/controllers/orders/helpers/view/view.tpl | 2 +- controllers/admin/AdminOrdersController.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl index ef8cc81c5..af01d0657 100755 --- a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -153,7 +153,7 @@
{l s='Customer information'} - {$customer->firstname} {$customer->lastname} ({l s='#'}{$customer->id})
+ {$gender->name|escape:'htmlall':'UTF-8'} {$customer->firstname} {$customer->lastname} ({l s='#'}{$customer->id})
({$customer->email})

{if ($customer->isGuest())} {l s='This order has been placed by a guest.'} diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 23bd95520..66f3ad249 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1342,11 +1342,14 @@ class AdminOrdersControllerCore extends AdminController $product['warehouse_name'] = '--'; } + $gender = new Gender((int)$customer->id_gender, $this->context->language->id); + // Smarty assign $this->tpl_view_vars = array( 'order' => $order, 'cart' => new Cart($order->id_cart), 'customer' => $customer, + 'gender' => $gender, 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'addresses' => array( 'delivery' => $addressDelivery, From 965b8a1bf3eaff0146e00c013542aa1edbaeb9aa Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Wed, 18 Sep 2013 11:18:26 +0200 Subject: [PATCH 26/85] [-] BO - fixed bug #PSCFV-10286 - End range in summary of shipping wizard not correct when range number is a float --- js/admin_carrier_wizard.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js index 1bb403720..d62dc9e82 100644 --- a/js/admin_carrier_wizard.js +++ b/js/admin_carrier_wizard.js @@ -153,12 +153,13 @@ function displaySummary() $('tr.range_inf td input').each( function() { - if (!isNaN(parseFloat($(this).val())) && (range_inf == summary_translation_undefined || range_inf > $(this).val())) + if (!isNaN(parseFloat($(this).val())) && (range_inf == summary_translation_undefined || parseFloat(range_inf) > parseFloat($(this).val()))) range_inf = $(this).val(); }); $('tr.range_sup td input').each( function(){ - if (!isNaN(parseFloat($(this).val())) && (range_sup == summary_translation_undefined || range_sup < $(this).val())) + + if (!isNaN(parseFloat($(this).val())) && (range_sup == summary_translation_undefined || parseFloat(range_sup) < parseFloat($(this).val()))) range_sup = $(this).val(); }); From 672da852c55c5f4bf4982b8cef03bc3ef67e4239 Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Wed, 18 Sep 2013 11:40:58 +0200 Subject: [PATCH 27/85] [-] BO - fixed bug #PSCFV-10178 --- js/admin_carrier_wizard.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js index d62dc9e82..d2bb9f401 100644 --- a/js/admin_carrier_wizard.js +++ b/js/admin_carrier_wizard.js @@ -273,7 +273,6 @@ function bind_inputs() }); $('tr.fees td input:checkbox').off('change').on('change', function () { - if($(this).is(':checked')) { $(this).closest('tr').children('td').each( function () { @@ -390,7 +389,7 @@ function hideFees() function showFees() { $('tr.range_inf td, tr.range_sup td, tr.fees_all td, tr.fees td').each( function () { - if ($(this).index() >= 2) + if ($(this).index() > 2) { //enable only if zone is active tr = $(this).parent('tr'); From 66f46eee032247274297ee5c57df1e55ffd450e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 18 Sep 2013 14:29:01 +0200 Subject: [PATCH 28/85] // Avoid exception if amount is null on addind an orderpayment --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 66f3ad249..d15fd1323 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -805,7 +805,7 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($order)) $this->errors[] = Tools::displayError('The order cannot be found'); - elseif (!Validate::isNegativePrice($amount)) + elseif (!Validate::isNegativePrice($amount) || !(float)$amount) $this->errors[] = Tools::displayError('The amount is invalid.'); elseif (!Validate::isString(Tools::getValue('payment_method'))) $this->errors[] = Tools::displayError('The selected payment method is invalid.'); From f293562ea4c878edec40d66786e79fc9e8b36aeb Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 18 Sep 2013 15:03:16 +0200 Subject: [PATCH 29/85] [-] BO : Fix bug #PSCFV-8214 import entity pre selected --- .../controllers/import/helpers/form/form.tpl | 3 +-- admin-dev/themes/default/template/toolbar.tpl | 2 +- controllers/admin/AdminAddressesController.php | 2 +- .../admin/AdminCategoriesController.php | 2 +- controllers/admin/AdminCustomersController.php | 2 +- controllers/admin/AdminImportController.php | 7 +++++-- .../admin/AdminManufacturersController.php | 2 +- controllers/admin/AdminProductsController.php | 2 +- controllers/admin/AdminSuppliersController.php | 18 ++++++++++++++++++ 9 files changed, 30 insertions(+), 10 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl index 059ccfdd2..c1949da21 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl @@ -112,7 +112,6 @@
{l s='Import '} -
{if count($files_to_import)} @@ -146,7 +145,7 @@
{foreach $files_to_import AS $filename} - + {/foreach} {/if} @@ -151,7 +94,6 @@ {/foreach}
-
- +
- +
{l s='If you don\'t use this option, all ID\'s will be auto-incremented.'}
+ +
+ +
{if empty($files_to_import)}{l s='You must upload a file in order to proceed to the next step'}{/if} @@ -209,13 +155,10 @@ {/if}
-
- {l s='Available fields'} -
{$available_fields}
@@ -223,74 +166,88 @@


{l s='* Required field'}
-
-
 
- + \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl index 618d1a819..b35bd5e1f 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl @@ -22,20 +22,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - {extends file="helpers/view/view.tpl"} - {block name="override_tpl"} -

{l s='View your data'}

- {l s='Save and load your configuration for importing files'} :

- - {l s='Save'}

+ {l s='Save and load your configuration for importing files'} :

+ + {l s='Save'}

{l s='lines'} + {if $fields_value.truncate} @@ -72,49 +63,8 @@ {if $fields_value.match_ref} {/if} - - - - + +
@@ -136,8 +86,45 @@
-
-{/block} + +{/block} \ No newline at end of file diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 5a1136499..7f28c0a6d 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -471,14 +471,19 @@ class AdminImportControllerCore extends AdminController $entity_selected = $this->entities[$this->l(Tools::ucfirst(Tools::getValue('import_type')))]; $this->context->cookie->entity_selected = $entity_selected; } - elseif(isset($this->context->cookie->entity_selected)) + elseif (isset($this->context->cookie->entity_selected)) $entity_selected = (int)$this->context->cookie->entity_selected; + + $csv_selected = ''; + if (isset($this->context->cookie->csv_selected)) + $csv_selected = pSQL($this->context->cookie->csv_selected); $this->tpl_form_vars = array( 'module_confirmation' => (Tools::getValue('import')) && (isset($this->warnings) && !count($this->warnings)), 'path_import' => _PS_ADMIN_DIR_.'/import/', 'entities' => $this->entities, 'entity_selected' => $entity_selected, + 'csv_selected' => $csv_selected, 'files_to_import' => $files_to_import, 'languages' => Language::getLanguages(false), 'id_language' => $this->context->language->id, @@ -508,6 +513,8 @@ class AdminImportControllerCore extends AdminController if ($entity_selected = (int)Tools::getValue('entity')) $this->context->cookie->entity_selected = $entity_selected; + if ($csv_selected = Tools::getValue('csv')) + $this->context->cookie->csv_selected = $csv_selected; $this->tpl_view_vars = array( 'import_matchs' => Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'import_match'), @@ -518,6 +525,7 @@ class AdminImportControllerCore extends AdminController 'iso_lang' => Tools::getValue('iso_lang'), 'truncate' => Tools::getValue('truncate'), 'forceIDs' => Tools::getValue('forceIDs'), + 'regenerate' => Tools::getValue('regenerate'), 'match_ref' => Tools::getValue('match_ref'), 'separator' => $this->separator, 'multiple_value_separator' => $this->multiple_value_separator @@ -807,7 +815,7 @@ class AdminImportControllerCore extends AdminController * @param string entity 'products' or 'categories' * @return void */ - protected static function copyImg($id_entity, $id_image = null, $url, $entity = 'products') + protected static function copyImg($id_entity, $id_image = null, $url, $entity = 'products', $regenerate = true) { $tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'ps_import'); $watermark_types = explode(',', Configuration::get('WATERMARK_TYPES')); @@ -835,11 +843,14 @@ class AdminImportControllerCore extends AdminController { ImageManager::resize($tmpfile, $path.'.jpg'); $images_types = ImageType::getImagesTypes($entity); - foreach ($images_types as $image_type) - ImageManager::resize($tmpfile, $path.'-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']); - if (in_array($image_type['id_image_type'], $watermark_types)) - Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity)); + if ($regenerate) + foreach ($images_types as $image_type) + { + ImageManager::resize($tmpfile, $path.'-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']); + if (in_array($image_type['id_image_type'], $watermark_types)) + Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity)); + } } else { @@ -988,7 +999,7 @@ class AdminImportControllerCore extends AdminController } //copying images of categories if (isset($category->image) && !empty($category->image)) - if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories'))) + if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories', !Tools::getValue('regenerate')))) $this->warnings[] = $category->image.' '.Tools::displayError('cannot be copied.'); // If both failed, mysql error if (!$res) @@ -1450,7 +1461,7 @@ class AdminImportControllerCore extends AdminController { // associate image to selected shops $image->associateTo($shops); - if (!AdminImportController::copyImg($product->id, $image->id, $url)) + if (!AdminImportController::copyImg($product->id, $image->id, $url, 'products', !Tools::getValue('regenerate'))) { $image->delete(); $this->warnings[] = sprintf(Tools::displayError('Error copying image: %s'), $url); @@ -1576,7 +1587,7 @@ class AdminImportControllerCore extends AdminController if ($field_error === true && $lang_field_error === true && $image->add()) { $image->associateTo($id_shop_list); - if (!AdminImportController::copyImg($product->id, $image->id, $url)) + if (!AdminImportController::copyImg($product->id, $image->id, $url, 'products', !Tools::getValue('regenerate'))) { $this->warnings[] = sprintf(Tools::displayError('Error copying image: %s'), $url); $image->delete(); From ea6ea955bbd62b8dccb886b567dd3ef27a0b6b98 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 19 Sep 2013 16:39:21 +0200 Subject: [PATCH 42/85] // licence --- .../template/controllers/import/helpers/form/form.tpl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl index 58a183cb8..c867b6c6d 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl @@ -3,10 +3,10 @@ ** * NOTICE OF LICENSE ** -* This source file is subject to the Open Software License (OSL 3.0) +* This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/osl-3.0.php +* http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. @@ -19,9 +19,8 @@ ** * @author PrestaShop SA * @copyright 2007-2013 PrestaShop SA -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA -** *} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
{block name="leadin"}{/block}
From 0361d5db8d00b7e7239ae032ac4bf429a9bed573 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 19 Sep 2013 16:59:04 +0200 Subject: [PATCH 43/85] [-] BO : do not reaffect import_type for categories --- controllers/admin/AdminImportController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index e5c634a51..0a69a5bb4 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -2743,7 +2743,6 @@ class AdminImportControllerCore extends AdminController $this->clearSmartyCache(); break; case $this->entities[$import_type = $this->l('Products')]: - $import_type = $this->l('Categories'); $this->productImport(); $this->clearSmartyCache(); break; From e0b59082f9c5ef734002331ba0ef2fdcea17cfc6 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 19 Sep 2013 17:19:51 +0200 Subject: [PATCH 44/85] [-] BO : Issue with domready on adminImport --- .../controllers/import/helpers/view/view.tpl | 81 +++++++++---------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl index b35bd5e1f..a7c20b5d8 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl @@ -24,6 +24,44 @@ *} {extends file="helpers/view/view.tpl"} {block name="override_tpl"} +

{l s='View your data'}

@@ -73,7 +111,7 @@ - + {section name=nb_i start=0 loop=$nb_table step=1} @@ -82,49 +120,10 @@ {/section} - +
- {/block} \ No newline at end of file From 63f4743134368bbde14c08a956fad36a9cf1753d Mon Sep 17 00:00:00 2001 From: Francois Gaillard Date: Thu, 19 Sep 2013 17:31:35 +0200 Subject: [PATCH 45/85] [-] MO : PNM-1715 - Bug fix accented chars & ajax-cart --- modules/blockcart/ajax-cart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index 97448ffef..6f1da33a4 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -464,7 +464,8 @@ var ajaxCart = { var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0); var content = '