From f2dbf94973a52b9d09f77147fd1c8ef544750777 Mon Sep 17 00:00:00 2001 From: Mats Rynge Date: Sun, 30 Dec 2012 00:24:03 -0800 Subject: [PATCH 01/21] [-] BO : Fixed a problem with the breadcrumbs in the admin category editing controller. The previous code used asort() which put the category breadcrumbs in the wrong order. --- .../controllers/categories/helpers/list/list_header.tpl | 2 +- controllers/admin/AdminCategoriesController.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl index c2cc39d0f..388888d4b 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl @@ -35,7 +35,7 @@ {else} {assign var=params_url value="&id_category={$category.id_category}&viewcategory"} {/if} - {if $key == 0} + {if $category.id_category == $categories_tree_current_id} {$category.name} {else} {$category.name} >  diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 1c6395ed2..f160c5d37 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -181,8 +181,9 @@ class AdminCategoriesControllerCore extends AdminController && (Shop::getContext() == Shop::CONTEXT_SHOP && !$is_multishop && $count_categories_without_parent > 1)) $categories_tree = array(array('name' => $this->_category->name[$this->context->language->id])); - asort($categories_tree); + $categories_tree = array_reverse($categories_tree); $this->tpl_list_vars['categories_tree'] = $categories_tree; + $this->tpl_list_vars['categories_tree_current_id'] = $this->_category->id; if (Tools::isSubmit('submitBulkdelete'.$this->table) || Tools::isSubmit('delete'.$this->table)) { From e2905ca845c954ba013b01bc1b9fa7fc21153a64 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Apr 2013 19:12:07 +0200 Subject: [PATCH 02/21] [-] FO : fix bug #PSCFV-8684, phone not required in guest checkout when not set in BO --- themes/default/authentication.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl index d35447f6b..0ac64cf07 100644 --- a/themes/default/authentication.tpl +++ b/themes/default/authentication.tpl @@ -315,8 +315,8 @@ $(document).ready(function() {

{elseif $field_name eq "phone"} -

- +

+

{/if} From 62836d65ab6285c1d7949088cb6aa670ab51d22a Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Apr 2013 19:43:04 +0200 Subject: [PATCH 03/21] [-] Fo : Remove additionnal space in phone field value --- themes/default/authentication.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl index 0ac64cf07..a87537d8a 100644 --- a/themes/default/authentication.tpl +++ b/themes/default/authentication.tpl @@ -317,7 +317,7 @@ $(document).ready(function() { {elseif $field_name eq "phone"}

- +

{/if} {/foreach} From b1000d63b9f2833ac30a6031cbf85005d6988840 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Apr 2013 16:39:33 -0300 Subject: [PATCH 04/21] // Fixed truncate / escape order --- themes/default/product-list.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/product-list.tpl b/themes/default/product-list.tpl index 344c743cc..0e4185b3d 100644 --- a/themes/default/product-list.tpl +++ b/themes/default/product-list.tpl @@ -41,7 +41,7 @@ {$product.legend|escape:'htmlall':'UTF-8'} {if isset($product.new) && $product.new == 1}{l s='New'}{/if} -

{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}

+

{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}

{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}

From 29c076164562ec1039732b55d5134dd2c87b2644 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Apr 2013 16:53:27 -0300 Subject: [PATCH 05/21] // Removed useless message --- controllers/admin/AdminSuppliersController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index 465911ab3..22e30efb4 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -146,7 +146,6 @@ class AdminSuppliersControllerCore extends AdminController 'id' => 'id_country', 'name' => 'name', ), - 'desc' => $this->l('Country where the state, region or city is located') ), array( 'type' => 'select', From 65c11984801d43fc514b01e2a29aff938766305f Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Apr 2013 16:57:05 -0300 Subject: [PATCH 06/21] // Changed link to documentation in the installer --- install-dev/langs/fr/install.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-dev/langs/fr/install.php b/install-dev/langs/fr/install.php index 6e0e44bcf..37f01522c 100644 --- a/install-dev/langs/fr/install.php +++ b/install-dev/langs/fr/install.php @@ -102,7 +102,7 @@ return array( 'Receive this information by e-mail' => 'Recevez ces informations par e-mail', 'Warning: You will receive this information only if your e-mail configuration is correct.' => 'Attention : vous ne recevrez ces informations que si votre configuration des e-mails est correcte', 'Configure your database by filling out the following fields:' => 'Configurez la connexion à votre base de données en remplissant les champs suivants.', - 'You have to create a database, help available in our online documentation.' => 'Vous devez créer une base de données, de l\'aide est disponible sur notre documentation en ligne.', + 'You have to create a database, help available in our online documentation.' => 'Vous devez créer une base de données, de l\'aide est disponible sur notre documentation en ligne.', 'Database server address:' => 'Adresse du serveur de la base :', 'If you want to use a different port, add :XX after your server address where XX is your port number.' => 'Si vous souhaitez utiliser un port différent, ajoutez :XX à l\'adresse de votre serveur, XX étant le numéro de votre port.', 'Database name:' => 'Nom de la base :', @@ -241,4 +241,4 @@ return array( 'PrestaShop can provide you with guidance on a regular basis by sending you tips on how to optimize the management of your store which will help you grow your business. If you do not wish to receive these tips, please uncheck this box.' => 'PrestaShop peut vous guider de façon régulière en vous faisant parvenir des conseils afin d\'optimiser la gestion de votre boutique et développer votre activité. Si vous ne souhaitez pas recevoir ces conseils, nous vous invitons à décocher cette case.', 'Your PHP sessions path is not writable - check with your hosting provider:' => 'Le dossier de stockage n\'est pas accessible en écriture - consultez votre hébergeur', ), -); \ No newline at end of file +); From 54b75b98183efe96aa6287cf836cc2fc9aecad1f Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Apr 2013 17:12:59 -0300 Subject: [PATCH 07/21] // Fixed potential warning --- modules/pscleaner/pscleaner.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index d091230fd..cbdd8ac7f 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -285,9 +285,9 @@ class PSCleaner extends Module continue; $query = 'DELETE FROM `'._DB_PREFIX_.$query_array[0].'` WHERE `'.$query_array[1].'` NOT IN (SELECT `'.$query_array[3].'` FROM `'._DB_PREFIX_.$query_array[2].'`)'; - $db->Execute($query); - if ($affected_rows = $db->Affected_Rows()) - $logs[$query] = $affected_rows; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; } // _lang table cleaning @@ -299,14 +299,14 @@ class PSCleaner extends Module $id_table = 'id_'.preg_replace('/^'._DB_PREFIX_.'/', '', $table); $query = 'DELETE FROM `'.bqSQL($table_lang).'` WHERE `'.bqSQL($id_table).'` NOT IN (SELECT `'.bqSQL($id_table).'` FROM `'.bqSQL($table).'`)'; - $db->Execute($query); - if ($affected_rows = $db->Affected_Rows()) - $logs[$query] = $affected_rows; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; $query = 'DELETE FROM `'.bqSQL($table_lang).'` WHERE `id_lang` NOT IN (SELECT `id_lang` FROM `'._DB_PREFIX_.'lang`)'; - $db->Execute($query); - if ($affected_rows = $db->Affected_Rows()) - $logs[$query] = $affected_rows; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; } // _shop table cleaning @@ -321,14 +321,14 @@ class PSCleaner extends Module continue; $query = 'DELETE FROM `'.bqSQL($table_shop).'` WHERE `'.bqSQL($id_table).'` NOT IN (SELECT `'.bqSQL($id_table).'` FROM `'.bqSQL($table).'`)'; - $db->Execute($query); - if ($affected_rows = $db->Affected_Rows()) - $logs[$query] = $affected_rows; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; $query = 'DELETE FROM `'.bqSQL($table_shop).'` WHERE `id_shop` NOT IN (SELECT `id_shop` FROM `'._DB_PREFIX_.'shop`)'; - $db->Execute($query); - if ($affected_rows = $db->Affected_Rows()) - $logs[$query] = $affected_rows; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; } Category::regenerateEntireNtree(); From f93c7ec8c746e30de329a7bb0dc5fbc8eae84bd1 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 19 Apr 2013 10:34:20 +0200 Subject: [PATCH 08/21] [-] BO : Fix bug #PSCFV-8843, no closing span in category-filter helper --- .../template/helpers/form/form_category.tpl | 30 ++++++++----------- classes/helper/Helper.php | 17 +++++------ 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/admin-dev/themes/default/template/helpers/form/form_category.tpl b/admin-dev/themes/default/template/helpers/form/form_category.tpl index b2a7f6af6..55452b132 100644 --- a/admin-dev/themes/default/template/helpers/form/form_category.tpl +++ b/admin-dev/themes/default/template/helpers/form/form_category.tpl @@ -35,39 +35,33 @@ buildTreeView(use_context); }); -
- {$categories.trads['Collapse All']} - | - {$categories.trads['Expand All']} + {$categories.trads['Collapse All']} + {$categories.trads['Expand All']} {if !$categories.use_radio} - | - {$categories.trads['Check All']} - | - {$categories.trads['Uncheck All']} - {/if} + {$categories.trads['Check All']} + {$categories.trads['Uncheck All']} + {/if} {if $categories.use_search} - {$categories.trads.search} : + {$categories.trads.search}: 
- +
{/if}
- {assign var=home_is_selected value=false} - {foreach $categories.selected_cat AS $cat} {if is_array($cat)} {if $cat.id_category != $categories.trads.Root.id_category} - + {else} {assign var=home_is_selected value=true} {/if} {else} {if $cat != $categories.trads.Root.id_category} - + {else} {assign var=home_is_selected value=true} {/if} @@ -80,8 +74,8 @@ + {if $home_is_selected}checked="checked"{/if} + onclick="clickOnCategoryBox($(this));"/> {$categories.trads.Root.name} {else}   @@ -97,4 +91,4 @@ searchCategory(); {/if} -{/if} +{/if} \ No newline at end of file diff --git a/classes/helper/Helper.php b/classes/helper/Helper.php index 83c998f81..d5516c3e6 100755 --- a/classes/helper/Helper.php +++ b/classes/helper/Helper.php @@ -239,17 +239,14 @@ class HelperCore $html .= ' - '; + '.$translations['Check All'].' + '.$translations['Uncheck All'].'' : '') + .($use_search ? ' + '.$translations['search'].': ' : '') + .'
'; $home_is_selected = false; foreach ($selected_cat as $cat) From da4c87d9ba04e06aa2891ea0cfa95a3b22d3802c Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Fri, 19 Apr 2013 11:07:59 +0200 Subject: [PATCH 09/21] [-] CORE : fixed bug #PSCFV-8787 - URL Rewriting remove accent --- classes/Tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Tools.php b/classes/Tools.php index e0e91e3a1..22734207a 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -982,7 +982,7 @@ class ToolsCore if (function_exists('mb_strtolower')) $str = mb_strtolower($str, 'utf-8'); - elseif (!$allow_accented_chars) + if (!$allow_accented_chars) $str = Tools::replaceAccentedChars($str); // Remove all non-whitelist chars. From 22135487ab8d0a7ff8797acc08ec0719bb3769e7 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Fri, 19 Apr 2013 11:44:29 +0200 Subject: [PATCH 10/21] //new addons url in install process --- install-dev/theme/view.css | 2 +- install-dev/theme/views/process.phtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install-dev/theme/view.css b/install-dev/theme/view.css index 7bf852018..98fafdf2e 100644 --- a/install-dev/theme/view.css +++ b/install-dev/theme/view.css @@ -627,7 +627,7 @@ ul#optional { #prestastore, #prestastore_update { - height:210px; + height:590px; width:645px; border:none; /*-moz-border-radius: 5px; diff --git a/install-dev/theme/views/process.phtml b/install-dev/theme/views/process.phtml index 3383edae2..2406cdbc7 100644 --- a/install-dev/theme/views/process.phtml +++ b/install-dev/theme/views/process.phtml @@ -75,7 +75,7 @@ var process_steps = process_steps) ?>; - From 5f6d0614df4bf7d354988dd7320d012238488401 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 22 Apr 2013 09:40:48 +0200 Subject: [PATCH 11/21] [*] FO : Wait for the image to be loaded before displaying the big image on product page - thanks to @romainberger --- themes/default/js/product.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 7bae47cc0..9ff798a8f 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -422,9 +422,11 @@ function displayImage(domAAroundImgThumb, no_animation) var newSrc = domAAroundImgThumb.attr('href').replace('thickbox', 'large'); if ($('#bigpic').attr('src') != newSrc) { - $('#bigpic').attr('src', newSrc); - if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) - $('#bigpic').attr('rel', domAAroundImgThumb.attr('href')); + $(this).attr('src', newSrc).load(function() { + $(this).show(); + if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) + $(this).attr('alt', domAAroundImgThumb.attr('href')); + }); } $('#views_block li a').removeClass('shown'); $(domAAroundImgThumb).addClass('shown'); From b1a839263df193e5ea9c357a3e662b8b82af6bef Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 22 Apr 2013 09:48:30 +0200 Subject: [PATCH 12/21] [*] Modules : use jQuery in blocknewsletter to remove @todo comment - thanks @romainberger --- .../views/templates/hook/blocknewsletter.tpl | 33 ++++++++++++------- .../blocknewsletter/blocknewsletter.tpl | 30 +++++++++++++---- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/modules/blocknewsletter/views/templates/hook/blocknewsletter.tpl b/modules/blocknewsletter/views/templates/hook/blocknewsletter.tpl index ff25df34b..db017dadf 100644 --- a/modules/blocknewsletter/views/templates/hook/blocknewsletter.tpl +++ b/modules/blocknewsletter/views/templates/hook/blocknewsletter.tpl @@ -33,20 +33,31 @@ {/if}

- {* @todo use jquery (focusin, focusout) instead of onblur and onfocus *} - - - + +

+ + \ No newline at end of file diff --git a/themes/default/modules/blocknewsletter/blocknewsletter.tpl b/themes/default/modules/blocknewsletter/blocknewsletter.tpl index b1fc6ca97..24d94f59f 100644 --- a/themes/default/modules/blocknewsletter/blocknewsletter.tpl +++ b/themes/default/modules/blocknewsletter/blocknewsletter.tpl @@ -24,6 +24,7 @@ *} +

{l s='Newsletter' mod='blocknewsletter'}

@@ -32,16 +33,31 @@ {/if}

- {* @todo use jquery (focusin, focusout) instead of onblur and onfocus *} - - + +

+ + From 7c4a188ae8284b605190333fb01d269a75d5a9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 22 Apr 2013 10:50:41 +0200 Subject: [PATCH 13/21] [-] BO: Fix #PSCFV-8872 HelperList::displayWarning() don't exists --- 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 c7d6ca626..34db27bdf 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -124,7 +124,7 @@ class HelperListCore extends Helper // Append when we get a syntax error in SQL query if ($list === false) { - $this->displayWarning($this->l('Bad SQL query', 'Helper')); + $this->context->controller->warnings[] = $this->l('Bad SQL query', 'Helper'); return false; } From 34a2c0191c642ef2456885dfe21da2a1d9442fe5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 22 Apr 2013 11:33:13 +0200 Subject: [PATCH 14/21] [-] CORE :Fix #PSCFV-8631 when order directly in payment state does not update stocks --- classes/order/OrderHistory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index 9601af2f3..ce87b8138 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -100,7 +100,7 @@ class OrderHistoryCore extends ObjectModel 'id_order' => (int)$order->id )); - if (Validate::isLoadedObject($order) && ($old_os instanceof OrderState) && ($new_os instanceof OrderState)) + if (Validate::isLoadedObject($order) && ($new_os instanceof OrderState)) { // An email is sent the first time a virtual item is validated $virtual_products = $order->getVirtualProducts(); From 141772725b85c410c20abe494879aa7b29278ff4 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 22 Apr 2013 11:57:36 +0200 Subject: [PATCH 15/21] // Fixed a few UI bugs in the stats --- .../template/controllers/stats/calendar.tpl | 2 +- .../template/controllers/stats/engines.tpl | 2 +- controllers/admin/AdminStatsTabController.php | 6 ++++ modules/gridhtml/gridhtml.php | 8 ++--- .../statsbestcustomers/statsbestcustomers.php | 29 ++++++++++++++----- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/stats/calendar.tpl b/admin-dev/themes/default/template/controllers/stats/calendar.tpl index 1601b52c3..31e607224 100644 --- a/admin-dev/themes/default/template/controllers/stats/calendar.tpl +++ b/admin-dev/themes/default/template/controllers/stats/calendar.tpl @@ -25,7 +25,7 @@
-
+ diff --git a/admin-dev/themes/default/template/controllers/stats/engines.tpl b/admin-dev/themes/default/template/controllers/stats/engines.tpl index cb8370774..64e13c434 100644 --- a/admin-dev/themes/default/template/controllers/stats/engines.tpl +++ b/admin-dev/themes/default/template/controllers/stats/engines.tpl @@ -25,7 +25,7 @@
- +

{l s='Settings'}

diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index bbe657c9c..8f6895ba7 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -79,6 +79,12 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $context->controller->addJqueryUI('ui.datepicker'); + if ($identifier === null && Tools::getValue('module')) + { + $identifier = 'module'; + $id = Tools::getValue('module'); + } + $tpl->assign(array( 'current' => self::$currentIndex, 'token' => $token, diff --git a/modules/gridhtml/gridhtml.php b/modules/gridhtml/gridhtml.php index f4d4e734d..af2709bc9 100644 --- a/modules/gridhtml/gridhtml.php +++ b/modules/gridhtml/gridhtml.php @@ -67,12 +67,8 @@ class GridHtml extends ModuleGridEngine foreach ($params['columns'] as $column) $html .= ' '.$column['header'].'
- - - - - - + + '; $html .= ' diff --git a/modules/statsbestcustomers/statsbestcustomers.php b/modules/statsbestcustomers/statsbestcustomers.php index 1464481b9..294a885a3 100644 --- a/modules/statsbestcustomers/statsbestcustomers.php +++ b/modules/statsbestcustomers/statsbestcustomers.php @@ -52,24 +52,26 @@ class StatsBestCustomers extends ModuleGrid $this->_emptyMessage = $this->l('Empty recordset returned'); $this->_pagingMessage = sprintf($this->l('Displaying %1$s of %2$s'), '{0} - {1}', '{2}'); + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + $this->_columns = array( array( 'id' => 'lastname', 'header' => $this->l('Last Name'), 'dataIndex' => 'lastname', - 'width' => 50 + 'width' => 80 ), array( 'id' => 'firstname', 'header' => $this->l('First Name'), 'dataIndex' => 'firstname', - 'width' => 50 + 'width' => 80 ), array( 'id' => 'email', 'header' => $this->l('Email'), 'dataIndex' => 'email', - 'width' => 120 + 'width' => 140 ), array( 'id' => 'totalVisits', @@ -78,10 +80,16 @@ class StatsBestCustomers extends ModuleGrid 'width' => 80, 'align' => 'right'), array( - 'id' => 'totalMoneySpent', - 'header' => $this->l('Money spent'), - 'dataIndex' => 'totalMoneySpent', + 'id' => 'totalValidOrders', + 'header' => $this->l('Valid orders'), + 'dataIndex' => 'totalValidOrders', 'width' => 80, + 'align' => 'right'), + array( + 'id' => 'totalMoneySpent', + 'header' => $this->l('Money spent').' ('.Tools::safeOutput($currency->iso_code).')', + 'dataIndex' => 'totalMoneySpent', + 'width' => 140, 'align' => 'right') ); @@ -142,7 +150,14 @@ class StatsBestCustomers extends ModuleGrid WHERE o.id_customer = c.id_customer AND o.invoice_date BETWEEN '.$this->getDate().' AND o.valid - ), 0) as totalMoneySpent + ), 0) as totalMoneySpent, + IFNULL(( + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'orders` o + WHERE o.id_customer = c.id_customer + AND o.invoice_date BETWEEN '.$this->getDate().' + AND o.valid + ), 0) as totalValidOrders FROM `'._DB_PREFIX_.'customer` c LEFT JOIN `'._DB_PREFIX_.'guest` g ON c.`id_customer` = g.`id_customer` LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.`id_guest` = co.`id_guest` From 31e7c6a08e8d10fe391bf12b8276d1955cd21608 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 22 Apr 2013 12:06:19 +0200 Subject: [PATCH 16/21] Merged Pull request #355 - thanks to @bibendi --- classes/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index 80944c55d..5eb9a0017 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -1451,7 +1451,7 @@ class ProductCore extends ObjectModel } if (count($id_shop_list)) - $combination->id_shop_list = $id_shop_list; + $combination->id_shop_list = array_unique($id_shop_list); $combination->add(); From 4bf41c590b43f3aa1c1ffd5c05614af0bef6c30c Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 22 Apr 2013 12:09:35 +0200 Subject: [PATCH 17/21] [-] CORE : Fix bug #PSCFV-8705 stocks update for when no current state --- classes/order/OrderHistory.php | 185 +++++++++++++++++---------------- 1 file changed, 93 insertions(+), 92 deletions(-) diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index ce87b8138..3e2cb1574 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -160,108 +160,109 @@ class OrderHistoryCore extends ObjectModel if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) $manager = StockManagerFactory::getManager(); // foreach products of the order - foreach ($order->getProductsDetail() as $product) - { - // if becoming logable => adds sale - if ($new_os->logable && !$old_os->logable) + if (Validate::isLoadedObject($old_os)) + foreach ($order->getProductsDetail() as $product) { - ProductSale::addProductSale($product['product_id'], $product['product_quantity']); - // @since 1.5.0 - Stock Management - if (!Pack::isPack($product['product_id']) && - ($old_os->id == Configuration::get('PS_OS_ERROR') || $old_os->id == Configuration::get('PS_OS_CANCELED')) && - !StockAvailable::dependsOnStock($product['id_product'], (int)$order->id_shop)) - StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop); - } - // if becoming unlogable => removes sale - elseif (!$new_os->logable && $old_os->logable) - { - ProductSale::removeProductSale($product['product_id'], $product['product_quantity']); - - // @since 1.5.0 - Stock Management - if (!Pack::isPack($product['product_id']) && - ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && - !StockAvailable::dependsOnStock($product['id_product'])) - StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); - } - // if waiting for payment => payment error/canceled - elseif (!$new_os->logable && !$old_os->logable && - ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && - !StockAvailable::dependsOnStock($product['id_product'])) - StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); - // @since 1.5.0 : if the order is being shipped and this products uses the advanced stock management : - // decrements the physical stock using $id_warehouse - if ($new_os->shipped == 1 && $old_os->shipped == 0 && - Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && - Warehouse::exists($product['id_warehouse']) && - $manager != null && - ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) - { - // gets the warehouse - $warehouse = new Warehouse($product['id_warehouse']); - - // decrements the stock (if it's a pack, the StockManager does what is needed) - $manager->removeProduct( - $product['product_id'], - $product['product_attribute_id'], - $warehouse, - $product['product_quantity'], - Configuration::get('PS_STOCK_CUSTOMER_ORDER_REASON'), - true, - (int)$order->id - ); - } - // @since.1.5.0 : if the order was shipped, and is not anymore, we need to restock products - elseif ($new_os->shipped == 0 && $old_os->shipped == 1 && - Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && - Warehouse::exists($product['id_warehouse']) && - $manager != null && - ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) - { - // if the product is a pack, we restock every products in the pack using the last negative stock mvts - if (Pack::isPack($product['product_id'])) + // if becoming logable => adds sale + if ($new_os->logable && !$old_os->logable) { - $pack_products = Pack::getItems($product['product_id'], Configuration::get('PS_LANG_DEFAULT', null, null, $order->id_shop)); - foreach ($pack_products as $pack_product) + ProductSale::addProductSale($product['product_id'], $product['product_quantity']); + // @since 1.5.0 - Stock Management + if (!Pack::isPack($product['product_id']) && + ($old_os->id == Configuration::get('PS_OS_ERROR') || $old_os->id == Configuration::get('PS_OS_CANCELED')) && + !StockAvailable::dependsOnStock($product['id_product'], (int)$order->id_shop)) + StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop); + } + // if becoming unlogable => removes sale + elseif (!$new_os->logable && $old_os->logable) + { + ProductSale::removeProductSale($product['product_id'], $product['product_quantity']); + + // @since 1.5.0 - Stock Management + if (!Pack::isPack($product['product_id']) && + ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && + !StockAvailable::dependsOnStock($product['id_product'])) + StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); + } + // if waiting for payment => payment error/canceled + elseif (!$new_os->logable && !$old_os->logable && + ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && + !StockAvailable::dependsOnStock($product['id_product'])) + StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); + // @since 1.5.0 : if the order is being shipped and this products uses the advanced stock management : + // decrements the physical stock using $id_warehouse + if ($new_os->shipped == 1 && $old_os->shipped == 0 && + Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && + Warehouse::exists($product['id_warehouse']) && + $manager != null && + ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) + { + // gets the warehouse + $warehouse = new Warehouse($product['id_warehouse']); + + // decrements the stock (if it's a pack, the StockManager does what is needed) + $manager->removeProduct( + $product['product_id'], + $product['product_attribute_id'], + $warehouse, + $product['product_quantity'], + Configuration::get('PS_STOCK_CUSTOMER_ORDER_REASON'), + true, + (int)$order->id + ); + } + // @since.1.5.0 : if the order was shipped, and is not anymore, we need to restock products + elseif ($new_os->shipped == 0 && $old_os->shipped == 1 && + Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && + Warehouse::exists($product['id_warehouse']) && + $manager != null && + ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) + { + // if the product is a pack, we restock every products in the pack using the last negative stock mvts + if (Pack::isPack($product['product_id'])) { - if ($pack_product->advanced_stock_management == 1) + $pack_products = Pack::getItems($product['product_id'], Configuration::get('PS_LANG_DEFAULT', null, null, $order->id_shop)); + foreach ($pack_products as $pack_product) { - $mvts = StockMvt::getNegativeStockMvts($order->id, $pack_product->id, 0, $pack_product->pack_quantity * $product['product_quantity']); - foreach ($mvts as $mvt) + if ($pack_product->advanced_stock_management == 1) { - $manager->addProduct( - $pack_product->id, - 0, - new Warehouse($mvt['id_warehouse']), - $mvt['physical_quantity'], - null, - $mvt['price_te'], - true - ); + $mvts = StockMvt::getNegativeStockMvts($order->id, $pack_product->id, 0, $pack_product->pack_quantity * $product['product_quantity']); + foreach ($mvts as $mvt) + { + $manager->addProduct( + $pack_product->id, + 0, + new Warehouse($mvt['id_warehouse']), + $mvt['physical_quantity'], + null, + $mvt['price_te'], + true + ); + } + if (!StockAvailable::dependsOnStock($product['id_product'])) + StockAvailable::updateQuantity($pack_product->id, 0, (int)$pack_product->pack_quantity * $product['product_quantity'], $order->id_shop); } - if (!StockAvailable::dependsOnStock($product['id_product'])) - StockAvailable::updateQuantity($pack_product->id, 0, (int)$pack_product->pack_quantity * $product['product_quantity'], $order->id_shop); + } + } + // else, it's not a pack, re-stock using the last negative stock mvts + else + { + $mvts = StockMvt::getNegativeStockMvts($order->id, $product['product_id'], $product['product_attribute_id'], $product['product_quantity']); + foreach ($mvts as $mvt) + { + $manager->addProduct( + $product['product_id'], + $product['product_attribute_id'], + new Warehouse($mvt['id_warehouse']), + $mvt['physical_quantity'], + null, + $mvt['price_te'], + true + ); } } } - // else, it's not a pack, re-stock using the last negative stock mvts - else - { - $mvts = StockMvt::getNegativeStockMvts($order->id, $product['product_id'], $product['product_attribute_id'], $product['product_quantity']); - foreach ($mvts as $mvt) - { - $manager->addProduct( - $product['product_id'], - $product['product_attribute_id'], - new Warehouse($mvt['id_warehouse']), - $mvt['physical_quantity'], - null, - $mvt['price_te'], - true - ); - } - } } - } } $this->id_order_state = (int)$new_order_state; From 34688d6933ca27b790e512ea1ef169bf51d50456 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 22 Apr 2013 12:18:26 +0200 Subject: [PATCH 18/21] [*] FO : one_phone_at_least should be set --- themes/default/address.tpl | 6 +++--- themes/default/authentication.tpl | 10 +++++----- themes/default/order-address.tpl | 2 +- themes/default/order-opc-new-account.tpl | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/themes/default/address.tpl b/themes/default/address.tpl index 689440edd..f2d071ebe 100644 --- a/themes/default/address.tpl +++ b/themes/default/address.tpl @@ -207,15 +207,15 @@ $(function(){ldelim}

- {if $one_phone_at_least} + {if isset($one_phone_at_least) && $one_phone_at_least}

{l s='You must register at least one phone number.'}

{/if}

-

- +

+

diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl index a87537d8a..6658fef36 100644 --- a/themes/default/authentication.tpl +++ b/themes/default/authentication.tpl @@ -315,8 +315,8 @@ $(document).ready(function() {

{elseif $field_name eq "phone"} -

- +

+

{/if} @@ -544,15 +544,15 @@ $(document).ready(function() {

- {if $one_phone_at_least} + {if isset($one_phone_at_least) && $one_phone_at_least}

{l s='You must register at least one phone number.'}

{/if}

-

- +

+

diff --git a/themes/default/order-address.tpl b/themes/default/order-address.tpl index 02bb62c81..538402174 100644 --- a/themes/default/order-address.tpl +++ b/themes/default/order-address.tpl @@ -219,7 +219,7 @@

isVirtualCart()}style="display:none;"{/if}> - id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1}checked="checked"{/if} /> + id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1} checked="checked"{/if}/>

diff --git a/themes/default/order-opc-new-account.tpl b/themes/default/order-opc-new-account.tpl index c9ce1e96d..04c2c6f70 100644 --- a/themes/default/order-opc-new-account.tpl +++ b/themes/default/order-opc-new-account.tpl @@ -259,15 +259,15 @@

- {if $one_phone_at_least} + {if isset($one_phone_at_least) && $one_phone_at_least}

{l s='You must register at least one phone number.'}

{/if}

-

- +

+

@@ -360,15 +360,15 @@

- {if $one_phone_at_least} + {if isset($one_phone_at_least) && $one_phone_at_least}

{l s='You must register at least one phone number.'}

{/if}

-

- +

+

From 5fb2bb9ee28af42ca442ccfc7c547798719bd56a Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 22 Apr 2013 14:56:59 +0200 Subject: [PATCH 19/21] [*] BO : added new button on manufacturers view --- .../controllers/manufacturers/helpers/view/view.tpl | 2 +- controllers/admin/AdminManufacturersController.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl index 7fe5e96b3..5c57c58ad 100644 --- a/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl @@ -38,7 +38,7 @@ {foreach $addresses AS $addresse} - +
{$addresse.firstname} {$addresse.lastname}{$addresse.firstname} {$addresse.lastname}
diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index 083b0bed5..80d6fc516 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -569,7 +569,12 @@ class AdminManufacturersControllerCore extends AdminController { if (!($manufacturer = $this->loadObject())) return; - + + $this->toolbar_btn['new'] = array( + 'href' => $this->context->link->getAdminLink('AdminManufacturers').'&addaddress=1&id_manufacturer='.(int)$manufacturer->id, + 'desc' => $this->l('Add address') + ); + $addresses = $manufacturer->getAddresses($this->context->language->id); $products = $manufacturer->getProductsLite($this->context->language->id); From 5b7da618b56e02355e9e90eafac896ca521a4b9c Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Tue, 23 Apr 2013 09:34:24 +0200 Subject: [PATCH 20/21] Merge Pull Request #21 - thanks @Caleydon --- themes/default/authentication.tpl | 15 ++++++++++----- themes/default/mobile/authentication.tpl | 2 +- themes/default/mobile/header.tpl | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl index 6658fef36..033c2cd72 100644 --- a/themes/default/authentication.tpl +++ b/themes/default/authentication.tpl @@ -23,8 +23,13 @@ * International Registered Trademark & Property of PrestaShop SA *} -{capture name=path}{l s='Login'}{/capture} -{include file="$tpl_dir./breadcrumb.tpl"} +{capture name=path} + {if !isset($email_create)}{l s='Authentication'}{else} + {l s='Authentication'} + {$navigationPipe}{l s='Create your account'} + {/if} +{/capture} + {include file="$tpl_dir./breadcrumb.tpl"} -

{if !isset($email_create)}{l s='Log in'}{else}{l s='Create an account'}{/if}

+

{if !isset($email_create)}{l s='Authentication'}{else}{l s='Create an account'}{/if}

{if !isset($back) || $back != 'my-account'}{assign var='current_step' value='login'}{include file="$tpl_dir./order-steps.tpl"}{/if} {include file="$tpl_dir./errors.tpl"} {assign var='stateExist' value=false} @@ -181,10 +186,10 @@ $(document).ready(function() {

-

{l s='Forgot your password?'}

+

{l s='Forgot your password?'}

{if isset($back)}{/if} - +

diff --git a/themes/default/mobile/authentication.tpl b/themes/default/mobile/authentication.tpl index ebad48543..5c968928c 100644 --- a/themes/default/mobile/authentication.tpl +++ b/themes/default/mobile/authentication.tpl @@ -23,7 +23,7 @@ * International Registered Trademark & Property of PrestaShop SA *} -{capture assign='page_title'}{if !isset($email_create)}{l s='Log in'}{else}{l s='Create an account'}{/if}{/capture} +{capture assign='page_title'}{if !isset($email_create)}{l s='Authentication'}{else}{l s='Create an account'}{/if}{/capture} {include file='./page-title.tpl'} {include file="./errors.tpl"} diff --git a/themes/default/mobile/header.tpl b/themes/default/mobile/header.tpl index 34752abba..cdc61a16e 100644 --- a/themes/default/mobile/header.tpl +++ b/themes/default/mobile/header.tpl @@ -74,7 +74,7 @@ {if $logged} {else} - + {/if} {hook h="displayMobileTop"} From e466ede051890496b156be77f06237d2754ab7e1 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Tue, 23 Apr 2013 10:02:29 +0200 Subject: [PATCH 21/21] Merge Pull request #67 - Thanks @Ha99y --- modules/carriercompare/template/carriercompare.tpl | 2 +- themes/default/header.tpl | 4 ++-- themes/default/product.tpl | 2 +- themes/default/sitemap.tpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/carriercompare/template/carriercompare.tpl b/modules/carriercompare/template/carriercompare.tpl index f6f211980..0f28d8f18 100755 --- a/modules/carriercompare/template/carriercompare.tpl +++ b/modules/carriercompare/template/carriercompare.tpl @@ -67,7 +67,7 @@ PS_SE_HandleEvent();

    -
    + Loading data