From 4c92e8f4c51f7ab9db7234cc2ce047e7a62e23e4 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 19:06:50 +0100 Subject: [PATCH 01/11] [*] PDF : Merge of https://github.com/PrestaShop/PrestaShop/pull/873 --- pdf/invoice-b2b.tpl | 2 +- pdf/invoice.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf/invoice-b2b.tpl b/pdf/invoice-b2b.tpl index 6f7ba9462..5a2ad8da4 100755 --- a/pdf/invoice-b2b.tpl +++ b/pdf/invoice-b2b.tpl @@ -134,7 +134,7 @@ {foreach $order_details as $order_detail} {cycle values='#FFF,#DDD' assign=bgcolor} - {$order_detail.product_name} + {$order_detail.product_name}{if isset($order_detail.product_reference) && !empty($order_detail.product_reference)} ({l s='Reference :' pdf='true'} {$order_detail.product_reference}){/if} {if !$tax_excluded_display} diff --git a/pdf/invoice.tpl b/pdf/invoice.tpl index 3fd3f0773..80c03716c 100755 --- a/pdf/invoice.tpl +++ b/pdf/invoice.tpl @@ -130,7 +130,7 @@ {foreach $order_details as $order_detail} {cycle values='#FFF,#DDD' assign=bgcolor} - {$order_detail.product_name} + {$order_detail.product_name}{if isset($order_detail.product_reference) && !empty($order_detail.product_reference)} ({l s='Reference :' pdf='true'} {$order_detail.product_reference}){/if} {if !$tax_excluded_display} From b8012952f7dc685f65ea3e9d6446d8f40681ab8e Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 22:32:57 +0100 Subject: [PATCH 02/11] [*] BO : Merge of https://github.com/PrestaShop/PrestaShop/pull/852 --- .../themes/default/template/controllers/modules/list.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/modules/list.tpl b/admin-dev/themes/default/template/controllers/modules/list.tpl index 4b25301ab..f19882529 100644 --- a/admin-dev/themes/default/template/controllers/modules/list.tpl +++ b/admin-dev/themes/default/template/controllers/modules/list.tpl @@ -55,14 +55,14 @@ {if (isset($module->id) && $module->id > 0) || !isset($module->type) || $module->type != 'addonsMustHave'} confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if} - class="noborder"> + class="noborder" title="{l s='Module %1s '|sprintf:$module->name}" /> {/if} - + {$module->displayName} -
+
{$module->categoryName}
From 9ccd4504f4266646b66f4ecfa664324076607bb3 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 22:49:10 +0100 Subject: [PATCH 03/11] [*] FO : Merge of https://github.com/PrestaShop/PrestaShop/pull/820 + https://github.com/PrestaShop/PrestaShop/commit/5e407db21e3e30a1a5fa94b9558314ffa21af407 --- themes/default-bootstrap/js/tools.js | 20 ++++++++++---------- themes/default/js/tools.js | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/themes/default-bootstrap/js/tools.js b/themes/default-bootstrap/js/tools.js index ae11f36be..04a7d5ee9 100644 --- a/themes/default-bootstrap/js/tools.js +++ b/themes/default-bootstrap/js/tools.js @@ -30,12 +30,12 @@ function ps_round(value, precision) if (typeof(precision) === 'undefined') precision = 2; - method = roundMode; + var method = roundMode; if (method === 0) return ceilf(value, precision); else if (method === 1) return floorf(value, precision); - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); return Math.round(value * precisionFactor) / precisionFactor; } @@ -43,9 +43,9 @@ function ceilf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.ceil(value * precisionFactor) / precisionFactor; @@ -55,9 +55,9 @@ function floorf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.floor(value * precisionFactor) / precisionFactor; @@ -81,7 +81,7 @@ function formatedNumberToFloat(price, currencyFormat, currencySign) function formatCurrency(price, currencyFormat, currencySign, currencyBlank) { // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) - blank = ''; + var blank = ''; price = parseFloat(price.toFixed(6)); price = ps_round(price, priceDisplayPrecision); if (currencyBlank > 0) @@ -95,7 +95,7 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank) if (currencyFormat == 4) return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign); if (currencyFormat == 5) - return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign); + return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '\'', '.')); return price; } diff --git a/themes/default/js/tools.js b/themes/default/js/tools.js index 7b670168c..3399f8a2d 100644 --- a/themes/default/js/tools.js +++ b/themes/default/js/tools.js @@ -30,12 +30,12 @@ function ps_round(value, precision) if (typeof(precision) === 'undefined') precision = 2; - method = roundMode; + var method = roundMode; if (method === 0) return ceilf(value, precision); else if (method === 1) return floorf(value, precision); - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); return Math.round(value * precisionFactor) / precisionFactor; } @@ -43,9 +43,9 @@ function ceilf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.ceil(value * precisionFactor) / precisionFactor; @@ -55,9 +55,9 @@ function floorf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.floor(value * precisionFactor) / precisionFactor; @@ -81,7 +81,7 @@ function formatedNumberToFloat(price, currencyFormat, currencySign) function formatCurrency(price, currencyFormat, currencySign, currencyBlank) { // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) - blank = ''; + var blank = ''; price = parseFloat(price.toFixed(6)); price = ps_round(price, priceDisplayPrecision); if (currencyBlank > 0) @@ -212,7 +212,7 @@ function in_array(value, array) function resizeAddressesBox(nameBox) { - maxHeight = 0; + var maxHeight = 0; if (typeof(nameBox) === 'undefined') nameBox = '.address'; From 5485433df68d67614f08d7cd0215268916bc3ba8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 22:57:57 +0100 Subject: [PATCH 04/11] [-] BO : Merge of https://github.com/PrestaShop/PrestaShop/pull/819 --- controllers/admin/AdminModulesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 94c66caa4..fe73d44b9 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -394,7 +394,7 @@ class AdminModulesControllerCore extends AdminController foreach($zip_folders as $folder) if (!in_array($folder, array('.', '..', '.svn', '.git', '__MACOSX')) && !Module::getInstanceByName($folder)) { - $this->errors[] = Tools::displayError('The \'.$folder.\' you uploaded is not a module'); + $this->errors[] = sprintf(Tools::displayError('The folder %1$s you uploaded is not a module.'), $folder); $this->recursiveDeleteOnDisk(_PS_MODULE_DIR_.$folder); } From 8d15f5d3e637d7f60e719bd7ba6d8b7991991abf Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 23:08:03 +0100 Subject: [PATCH 05/11] [-] CORE : Merge of https://github.com/PrestaShop/PrestaShop/pull/814 --- classes/Store.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Store.php b/classes/Store.php index 22a43ed66..3df3ec905 100644 --- a/classes/Store.php +++ b/classes/Store.php @@ -114,7 +114,7 @@ class StoreCore extends ObjectModel public function __construct($id_store = null, $id_lang = null) { - parent::__construct($id_store, $id_lang); + parent::__construct($id_store); $this->id_image = ($this->id && file_exists(_PS_STORE_IMG_DIR_.(int)$this->id.'.jpg')) ? (int)$this->id : false; $this->image_dir = _PS_STORE_IMG_DIR_; } From 1855ffa58444b6ad241ee24fbe080e637f3bd313 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 23:18:00 +0100 Subject: [PATCH 06/11] [-] CORE : Merge of https://github.com/PrestaShop/PrestaShop/pull/813 --- classes/controller/AdminController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 9a3b8db6f..98f64cc6d 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1993,7 +1993,7 @@ class AdminControllerCore extends Controller } // Execute Hook AdminController SetMedia - Hook::exec('actionAdminControllerSetMedia', array()); + Hook::exec('actionAdminControllerSetMedia'); } /** From ef466ac47c16b280847ac10d0217c07fde7c2e29 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 23:33:24 +0100 Subject: [PATCH 07/11] [+] CORE : Merg of https://github.com/PrestaShop/PrestaShop/pull/775 --- classes/Media.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/Media.php b/classes/Media.php index f58889220..4b3ae32e1 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -45,6 +45,7 @@ class MediaCore '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), 'ui.progressbar' => array('fileName' => 'jquery.ui.progressbar.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.tooltip' => array('fileName' => 'jquery.ui.tooltip.min.js', 'dependencies' => array('ui.core', 'ui.widget','ui.position','effects.core'), 'theme' => true), 'effects.core' => array('fileName' => 'jquery.effects.core.min.js', 'dependencies' => array(), 'theme' => false), 'effects.blind' => array('fileName' => 'jquery.effects.blind.min.js', 'dependencies' => array('effects.core'), 'theme' => false), 'effects.bounce' => array('fileName' => 'jquery.effects.bounce.min.js', 'dependencies' => array('effects.core'), 'theme' => false), From 5d511c1ac732b865d8ae36513a181b89ed5316c8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 23:39:28 +0100 Subject: [PATCH 08/11] // remove notice in ModuleGraph.php --- classes/module/ModuleGraph.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/module/ModuleGraph.php b/classes/module/ModuleGraph.php index f8937fcd2..5790a92e5 100644 --- a/classes/module/ModuleGraph.php +++ b/classes/module/ModuleGraph.php @@ -222,7 +222,8 @@ abstract class ModuleGraphCore extends Module protected function _displayCsv() { - ob_end_clean(); + if (ob_get_length()) + ob_end_clean(); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$this->displayName.' - '.time().'.csv"'); echo $this->_csv; From 5f5b9bd1de52fd2b65b4322efcc96439b9cd649e Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 23:43:49 +0100 Subject: [PATCH 09/11] [-] FO : Merge of https://github.com/PrestaShop/PrestaShop/pull/718 --- classes/controller/FrontController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index eea4a1bf1..fee2d0924 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -330,7 +330,7 @@ class FrontControllerCore extends Controller 'cart_qties' => (int)$cart->nbProducts(), 'currencies' => Currency::getCurrencies(), 'languages' => $languages, - 'meta_language' => implode('-', $meta_language), + 'meta_language' => implode(',', $meta_language), 'priceDisplay' => Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer), 'add_prod_display' => (int)Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'shop_name' => Configuration::get('PS_SHOP_NAME'), From 10dac5a45bff77c17589abe466e0f49b45d92bc8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 27 Nov 2013 00:06:44 +0100 Subject: [PATCH 10/11] [-] CORE : Merge of https://github.com/PrestaShop/PrestaShop/pull/816 --- classes/Cart.php | 6 +++++- classes/Employee.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 4c678c978..cc170a81d 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -152,7 +152,11 @@ class CartCore extends ObjectModel public function __construct($id = null, $id_lang = null) { - parent::__construct($id, $id_lang); + parent::__construct($id); + + if (!is_null($id_lang)) + $this->id_lang = (int)(Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT'); + if ($this->id_customer) { if (isset(Context::getContext()->customer) && Context::getContext()->customer->id == $this->id_customer) diff --git a/classes/Employee.php b/classes/Employee.php index 3ee83a2dd..48b990dc7 100644 --- a/classes/Employee.php +++ b/classes/Employee.php @@ -122,7 +122,10 @@ class EmployeeCore extends ObjectModel public function __construct($id = null, $id_lang = null, $id_shop = null) { - parent::__construct($id, $id_lang, $id_shop); + parent::__construct($id, null, $id_shop); + + if (!is_null($id_lang)) + $this->id_lang = (int)(Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT'); if ($this->id) $this->associated_shops = $this->getAssociatedShops(); From 6959e71bec10f177e16055582bd2f381f32d2786 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 27 Nov 2013 00:09:41 +0100 Subject: [PATCH 11/11] [*] CORE : Merge of https://github.com/PrestaShop/PrestaShop/pull/729 --- controllers/front/AttachmentController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/front/AttachmentController.php b/controllers/front/AttachmentController.php index 3c5daedda..8461be1f5 100644 --- a/controllers/front/AttachmentController.php +++ b/controllers/front/AttachmentController.php @@ -32,6 +32,8 @@ class AttachmentControllerCore extends FrontController if (!$a->id) Tools::redirect('index.php'); + Hook::exec('actionDownloadAttachment', array('attachment' => &$a); + if (ob_get_level()) ob_end_clean();