From fd4006bcd43b20c08043ec6d9faa4e2d9355e220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 5 Apr 2013 10:54:04 +0200 Subject: [PATCH 01/23] [-] MO: Fix product cover image on blockviewed with multishop --- modules/blockviewed/blockviewed.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/blockviewed/blockviewed.php b/modules/blockviewed/blockviewed.php index d7cd1aed0..0ea240300 100644 --- a/modules/blockviewed/blockviewed.php +++ b/modules/blockviewed/blockviewed.php @@ -103,16 +103,16 @@ class BlockViewed extends Module $productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT image_shop.id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite FROM '._DB_PREFIX_.'product p - LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').') - LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'. - Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' - LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image) '.Shop::addSqlAssociation('product', 'p').' + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').') + LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'. + Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' + LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image) LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').') WHERE p.id_product IN ('.$productIds.') - AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$this->context->shop->id.') AND pl.id_lang = '.(int)($params['cookie']->id_lang).' - AND cl.id_lang = '.(int)($params['cookie']->id_lang) + AND cl.id_lang = '.(int)($params['cookie']->id_lang).' + GROUP BY product_shop.id_product' ); $productsImagesArray = array(); From d19cfc33bc575ee4bd93c85ea1e0193e8141ec89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 5 Apr 2013 11:29:30 +0200 Subject: [PATCH 02/23] [-] FO: Don't display vat_number field if not required for the country on address.tpl --- themes/default/address.tpl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/themes/default/address.tpl b/themes/default/address.tpl index bdc915c3d..f193fec91 100644 --- a/themes/default/address.tpl +++ b/themes/default/address.tpl @@ -102,14 +102,16 @@ $(function(){ldelim}

-
-
-

- - -

+ {/if} + {if $field_name eq 'vat_number'} +
+
+

+ + +

+
-
{/if} {if $field_name eq 'firstname'}

From 3bbb9aa68579d3b62218a0d409b80f49dbc1a758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 5 Apr 2013 11:44:16 +0200 Subject: [PATCH 03/23] [*] FO: use subdirectory per template for smarty cache --- config/smarty.config.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/smarty.config.inc.php b/config/smarty.config.inc.php index f45ce627d..128900a6d 100644 --- a/config/smarty.config.inc.php +++ b/config/smarty.config.inc.php @@ -32,6 +32,8 @@ global $smarty; $smarty = new Smarty(); $smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile'); $smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache'); +if (!Tools::getSafeModeStatus()) + $smarty->use_sub_dirs = true; $smarty->setConfigDir(_PS_SMARTY_DIR_.'configs'); $smarty->caching = false; $smarty->force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false; From 26bdf77308282952b951f1138785dbd9431302d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 5 Apr 2013 11:57:52 +0200 Subject: [PATCH 04/23] // And now use smarty cache groups for cache ids to be more efficient --- classes/module/Module.php | 2 +- modules/blockcategories/blockcategories.php | 2 +- modules/blocksearch/blocksearch.php | 2 +- modules/blocktopmenu/blocktopmenu.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/module/Module.php b/classes/module/Module.php index 3037a56a8..e42b12fdb 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -1595,7 +1595,7 @@ abstract class ModuleCore { if ($name === null) $name = $this->name; - return $name.'|'.(int)$this->context->shop->id.'_'.(int)Group::getCurrent()->id.'_'.(int)$this->context->language->id; + return $name.'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id; } public function display($file, $template, $cacheId = null, $compileId = null) diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php index 60df5c858..767ad74f0 100644 --- a/modules/blockcategories/blockcategories.php +++ b/modules/blockcategories/blockcategories.php @@ -227,7 +227,7 @@ class BlockCategories extends Module $id_product = (int)Tools::getValue('id_product', 0); $id_category = (int)Tools::getValue('id_category', 0); $id_lang = (int)$this->context->language->id; - return 'blockcategories|'.$this->context->shop->id.'_'.$groups.'_'.$id_lang.'_'.$id_product.'_'.$id_category; + return 'blockcategories|'.$this->context->shop->id.'|'.$groups.'|'.$id_lang.'|'.$id_product.'|'.$id_category; } public function hookFooter($params) diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php index 496c93753..1df62a660 100644 --- a/modules/blocksearch/blocksearch.php +++ b/modules/blocksearch/blocksearch.php @@ -121,7 +121,7 @@ public function hookDisplayMobileHeader($params) protected function getCacheId($name = null) { $cache_id = parent::getCacheId($name); - return $cache_id.'_'.(int)Tools::usingSecureMode(); + return $cache_id.'|'.(int)Tools::usingSecureMode(); } } diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index eff8627f3..25f34e570 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -717,7 +717,7 @@ class Blocktopmenu extends Module { parent::getCacheId($name); $page_name = in_array($this->page_name, array('category', 'supplier', 'manufacturer', 'cms', 'product')) ? $this->page_name : 'index'; - return 'blocktopmenu|'.$page_name.'-'.(int)$this->context->shop->id.'-'.implode(', ',$this->user_groups).'-'.(int)$this->context->language->id.'-'.(int)Tools::getValue('id_category').'-'.(int)Tools::getValue('id_manufacturer').'-'.(int)Tools::getValue('id_supplier').'-'.(int)Tools::getValue('id_cms').'-'.(int)Tools::getValue('id_product'); + return 'blocktopmenu|'.$page_name.'|'.(int)$this->context->shop->id.'|'.implode(', ',$this->user_groups).'|'.(int)$this->context->language->id.'|'.(int)Tools::getValue('id_category').'|'.(int)Tools::getValue('id_manufacturer').'|'.(int)Tools::getValue('id_supplier').'|'.(int)Tools::getValue('id_cms').'|'.(int)Tools::getValue('id_product'); } public function hookDisplayTop($param) From d7b78e6f436a44e0986af9d97ed03b3b75446315 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 5 Apr 2013 14:32:49 +0200 Subject: [PATCH 05/23] // Fixed commit a53163feee5e0235b8f260c4b241cdce7b7e00f9 (shipping discount in the invoice) --- pdf/invoice.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdf/invoice.tpl b/pdf/invoice.tpl index b2950c86a..13a68ac67 100755 --- a/pdf/invoice.tpl +++ b/pdf/invoice.tpl @@ -190,7 +190,10 @@ {assign var="shipping_discount_tax_incl" value="0"} {foreach $cart_rules as $cart_rule} - {cycle values='#FFF,#DDD' assign=bgcolor} + {if $cart_rule.free_shipping} + {assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl} + {/if} + {cycle values='#FFF,#DDD' assign=bgcolor} {$cart_rule.name} From 6edc6c37f7d92efcf0768ecc08546c0ca1124f5b Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Fri, 5 Apr 2013 17:14:38 +0200 Subject: [PATCH 06/23] //small fix --- install-dev/theme/views/process.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-dev/theme/views/process.phtml b/install-dev/theme/views/process.phtml index 67b1e4320..3383edae2 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 3f1bcb4d1873ad275e3a11d893f835689b803d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 5 Apr 2013 17:50:21 +0200 Subject: [PATCH 07/23] // Fix #PSCFV-8599 remove non existant image from css --- css/admin.css | 1 - 1 file changed, 1 deletion(-) diff --git a/css/admin.css b/css/admin.css index ee34a6094..4ee837e91 100644 --- a/css/admin.css +++ b/css/admin.css @@ -763,7 +763,6 @@ tr.deleted td { } .row { - background: #F4E6C9 url(../img/admin/news-bg.gif) repeat-x top left; } .uppercase { From 5b6dc1e9e9d3309d806bf9b090d77f29f7248ac6 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 5 Apr 2013 17:59:46 +0200 Subject: [PATCH 08/23] [-] BO : Fix bug #PSCFV-8540 setting cookie key in cache key --- classes/cache/Cache.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/classes/cache/Cache.php b/classes/cache/Cache.php index b4ee3de1d..9343f04e7 100755 --- a/classes/cache/Cache.php +++ b/classes/cache/Cache.php @@ -205,7 +205,6 @@ abstract class CacheCore foreach ($this->keys as $k => $ttl) if (preg_match('#^'.$pattern.'$#', $k)) $keys[] = $k; - } // Delete keys @@ -235,13 +234,13 @@ abstract class CacheCore if (is_null($this->sql_tables_cached)) { - $this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME); + $this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME); if (!is_array($this->sql_tables_cached)) $this->sql_tables_cached = array(); } // Store query results in cache if this query is not already cached - $key = md5($query); + $key = md5(_COOKIE_IV_.$query); if ($this->exists($key)) return true; $this->set($key, $result); @@ -251,7 +250,7 @@ abstract class CacheCore foreach ($tables as $table) if (!isset($this->sql_tables_cached[$table][$key])) $this->sql_tables_cached[$table][$key] = true; - $this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached); + $this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached); } protected function getTables($string) @@ -271,7 +270,7 @@ abstract class CacheCore { if (is_null($this->sql_tables_cached)) { - $this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME); + $this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME); if (!is_array($this->sql_tables_cached)) $this->sql_tables_cached = array(); } @@ -287,7 +286,7 @@ abstract class CacheCore } unset($this->sql_tables_cached[$table]); } - $this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached); + $this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached); } /** From d6ee2acc90985be46a9becbb60ffe0a9dd417193 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 8 Apr 2013 10:50:03 +0200 Subject: [PATCH 09/23] [-] BO : Fix bug : #PSCFV-8631 no download-product.tpl in languages packs --- classes/order/OrderHistory.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index 0af2e1535..9601af2f3 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -117,20 +117,30 @@ class OrderHistoryCore extends ObjectModel { $assign[$key]['name'] = $product_download->display_filename; $dl_link = $product_download->getTextLink(false, $virtual_product['download_hash']) - .'&id_order='.$order->id + .'&id_order='.(int)$order->id .'&secure_key='.$order->secure_key; $assign[$key]['link'] = $dl_link; - if ($virtual_product['download_deadline'] != '0000-00-00 00:00:00') - $assign[$key]['deadline'] = Tools::displayDate($virtual_product['download_deadline'], $order->id_lang); + if ($virtual_product['date_expiration'] != '0000-00-00 00:00:00') + $assign[$key]['deadline'] = Tools::displayDate($virtual_product['date_expiration '], $order->id_lang); if ($product_download->nb_downloadable != 0) - $assign[$key]['downloadable'] = $product_download->nb_downloadable; + $assign[$key]['downloadable'] = (int)$product_download->nb_downloadable; } } + $customer = new Customer((int)$order->id_customer); - $context->smarty->assign('virtualProducts', $assign); - $context->smarty->assign('id_order', $order->id); - $iso = Language::getIsoById((int)($order->id_lang)); - $links = $context->smarty->fetch(_PS_MAIL_DIR_.$iso.'/download-product.tpl'); + + $links = '
    '; + foreach($assign as $product) + { + $links .= '
  • '; + $links .= ''.Tools::htmlentitiesUTF8($product['name']).''; + if (isset($product['deadline'])) + $links .= ' '.Tools::htmlentitiesUTF8(Tools::displayError('expires on')).' '.$product['deadline']; + if (isset($product['downloadable'])) + $links .= ' '.Tools::htmlentitiesUTF8(sprintf(Tools::displayError('downloadable %d time(s)'), (int)$product['downloadable'])); + $links .= '
  • '; + } + $links .= '
      '; $data = array( '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, From 90878d8a8008080c6e55b8dbc4dd8df581db3afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 8 Apr 2013 11:35:08 +0200 Subject: [PATCH 10/23] [-] FO: Fix htaccess generation when disable mod_security is selected #PSCFV-8675 --- classes/Tools.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index be7bff80b..ca10a4785 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1562,6 +1562,9 @@ class ToolsCore fwrite($write_fd, "# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution\n"); fwrite($write_fd, "# http://www.prestashop.com - http://www.prestashop.com/forums\n\n"); + if ($disable_modsec) + fwrite($write_fd, "\nSecFilterEngine Off\nSecFilterScanPOST Off\n\n"); + // RewriteEngine fwrite($write_fd, "\n"); @@ -1569,9 +1572,6 @@ class ToolsCore if ($disable_multiviews) fwrite($write_fd, "\n# Disable Multiviews\nOptions -Multiviews\n\n"); - if ($disable_modsec) - fwrite($write_fd, "\nSecFilterEngine Off\nSecFilterScanPOST Off\n"); - fwrite($write_fd, "RewriteEngine on\n"); if (!$medias) From a720b1985487e7d64743cae83d60da3d26b42ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 8 Apr 2013 14:58:29 +0200 Subject: [PATCH 11/23] [-] BO: Fix #PSCFV-8683 order_way collusion on listing between 2 tabs --- classes/controller/AdminController.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 93e11818c..d8b39b224 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -443,7 +443,8 @@ class AdminControllerCore extends Controller if (isset($_GET) && !empty($_GET) && isset($this->table)) foreach ($_GET as $key => $value) if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0) - $this->context->cookie->$key = $value; + $this->context->cookie->{$prefix.$key} = $value; + $filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_'); foreach ($filters as $key => $value) { @@ -885,11 +886,11 @@ class AdminControllerCore extends Controller if (isset($this->context->cookie->{'submitFilter'.$this->table})) unset($this->context->cookie->{'submitFilter'.$this->table}); - if (isset($this->context->cookie->{$this->table.'Orderby'})) - unset($this->context->cookie->{$this->table.'Orderby'}); + if (isset($this->context->cookie->{$prefix.$this->table.'Orderby'})) + unset($this->context->cookie->{$prefix.$this->table.'Orderby'}); - if (isset($this->context->cookie->{$this->table.'Orderway'})) - unset($this->context->cookie->{$this->table.'Orderway'}); + if (isset($this->context->cookie->{$prefix.$this->table.'Orderway'})) + unset($this->context->cookie->{$prefix.$this->table.'Orderway'}); unset($_POST); $this->_filter = false; @@ -2045,11 +2046,11 @@ class AdminControllerCore extends Controller if (!Validate::isTableOrIdentifier($this->table)) throw new PrestaShopException(sprintf('Table name %s is invalid:', $this->table)); - + $prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this))); if (empty($order_by)) { - if ($this->context->cookie->{$this->table.'Orderby'}) - $order_by = $this->context->cookie->{$this->table.'Orderby'}; + if ($this->context->cookie->{$prefix.$this->table.'Orderby'}) + $order_by = $this->context->cookie->{$prefix.$this->table.'Orderby'}; elseif ($this->_orderBy) $order_by = $this->_orderBy; else @@ -2058,8 +2059,8 @@ class AdminControllerCore extends Controller if (empty($order_way)) { - if ($this->context->cookie->{$this->table.'Orderway'}) - $order_way = $this->context->cookie->{$this->table.'Orderway'}; + if ($this->context->cookie->{$prefix.$this->table.'Orderway'}) + $order_way = $this->context->cookie->{$prefix.$this->table.'Orderway'}; elseif ($this->_orderWay) $order_way = $this->_orderWay; else From 3ffe339a76b327cfe021301cc46f058a54e38a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 8 Apr 2013 17:50:43 +0200 Subject: [PATCH 12/23] [*] BO: The translation of modules are now made in the theme if modules are overrided or directly in the module folder --- .../admin/AdminTranslationsController.php | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 5c8645a3d..3b4c7e9ad 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -586,7 +586,6 @@ class AdminTranslationsControllerCore extends AdminController { // Get instance of this tab by class name $tab = Tab::getInstanceFromClassName($class_name); - //Check if class name exists if (isset($tab->class_name) && !empty($tab->class_name)) { @@ -1331,17 +1330,11 @@ class AdminTranslationsControllerCore extends AdminController { if ($this->tabAccess['edit'] === '1') { - // Get a good path for module directory - if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_) - $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; - else - $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; - // Get list of modules if ($modules = $this->getListModules()) { // Get files of all modules - $arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true); + $arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true); // Find and write all translation modules files foreach ($arr_files as $value) @@ -1890,11 +1883,13 @@ class AdminTranslationsControllerCore extends AdminController foreach ($modules as &$module) $module = $module['name']; } - else if ($this->theme_selected == self::DEFAULT_THEME_NAME) + elseif ($this->theme_selected == self::DEFAULT_THEME_NAME) + { if (Tools::file_exists_cache($this->translations_informations['modules']['dir'])) $modules = scandir($this->translations_informations['modules']['dir']); else $this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.')); + } else if (Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'])) $modules = scandir($this->translations_informations['modules']['override']['dir']); @@ -2539,12 +2534,30 @@ class AdminTranslationsControllerCore extends AdminController * @param boolean $is_default set it if modules are located in root/prestashop/modules folder * This allow to distinguish overrided prestashop theme and original module */ - protected function getAllModuleFiles($modules, $root_dir, $lang, $is_default = false) + protected function getAllModuleFiles($modules, $root_dir = null, $lang, $is_default = false) { $array_files = array(); + $initial_root_dir = $root_dir; foreach ($modules as $module) { - if ($module{0} != '.' && is_dir($root_dir.$module)) + $root_dir = $initial_root_dir; + if ($module{0} == '.') + continue; + // Get path of directory for find a good path of translation file + if ($root_dir == null) + { + $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; + if (is_dir($i18n_dir.$module)) + $root_dir = $i18n_dir; + } + if ($root_dir == null) + { + $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; + if (is_dir($i18n_dir.$module)) + $root_dir = $i18n_dir; + } + + if (is_dir($root_dir.$module)) { if (Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php')) $lang_file = $root_dir.$module.'/translations/'.$lang.'.php'; @@ -2564,20 +2577,13 @@ class AdminTranslationsControllerCore extends AdminController */ public function initFormModules() { - // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_) - $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; - else - $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; - // Get list of modules $modules = $this->getListModules(); if (!empty($modules)) { // Get all modules files and include all translation files - $arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true); - + $arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true); foreach ($arr_files as $value) $this->findAndFillTranslations($value['files'], $value['theme'], $value['module'], $value['dir']); From 881b6e7a8be199f51397a08efcfa955fbb520a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 8 Apr 2013 17:53:56 +0200 Subject: [PATCH 13/23] // something was missing in last commit --- .../admin/AdminTranslationsController.php | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 3b4c7e9ad..a02e767dd 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -1875,26 +1875,10 @@ class AdminTranslationsControllerCore extends AdminController throw new PrestaShopException(Tools::displayError('The module directory must be writable.')); $modules = array(); - if (!_PS_MODE_DEV_ && $this->theme_selected == self::DEFAULT_THEME_NAME) - { - // Get all module which are installed for to have a minimum of POST - $modules = Module::getModulesInstalled(); - - foreach ($modules as &$module) - $module = $module['name']; - } - elseif ($this->theme_selected == self::DEFAULT_THEME_NAME) - { - if (Tools::file_exists_cache($this->translations_informations['modules']['dir'])) - $modules = scandir($this->translations_informations['modules']['dir']); - else - $this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.')); - } - else - if (Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'])) - $modules = scandir($this->translations_informations['modules']['override']['dir']); - else - $this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.')); + // Get all module which are installed for to have a minimum of POST + $modules = Module::getModulesInstalled(); + foreach ($modules as &$module) + $module = $module['name']; return $modules; } From 66b321ae55883f727b45d0b64971595a1a5520dd Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Mon, 8 Apr 2013 18:00:59 +0200 Subject: [PATCH 14/23] [-] FO: fixed bug DOCTYPE line - #PSCFV-8602 --- themes/default/css/global.css | 2 +- themes/default/header.tpl | 5 ++--- themes/default/layout.tpl | 17 ++++------------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/themes/default/css/global.css b/themes/default/css/global.css index a85048f2e..7a5115d58 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -103,7 +103,7 @@ p em {font-style:italic} padding:10px; border:1px solid #5cff74; font-size:13px; - background: #d3ffab + background: #d3ffab; } .error { margin:0 0 10px 0; diff --git a/themes/default/header.tpl b/themes/default/header.tpl index 138ca81b5..eb374968c 100644 --- a/themes/default/header.tpl +++ b/themes/default/header.tpl @@ -22,11 +22,10 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - - - + + diff --git a/themes/default/layout.tpl b/themes/default/layout.tpl index 8bf5c9bb5..a6f2e3e9b 100644 --- a/themes/default/layout.tpl +++ b/themes/default/layout.tpl @@ -23,16 +23,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - -{if !empty($display_header)} - {include file='./header.tpl' HOOK_HEADER=$HOOK_HEADER} -{/if} -{if !empty($template)} - {$template} -{/if} -{if !empty($display_footer)} - {include file='./footer.tpl'} -{/if} -{if !empty($live_edit)} - {$live_edit} -{/if} \ No newline at end of file +{if !empty($display_header)}{include file='./header.tpl' HOOK_HEADER=$HOOK_HEADER}{/if} +{if !empty($template)}{$template}{/if} +{if !empty($display_footer)}{include file='./footer.tpl'}{/if} +{if !empty($live_edit)}{$live_edit}{/if} \ No newline at end of file From 403b9b760f0d83cd6c6b6007d03f0f959e3f92ab Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 9 Apr 2013 10:16:49 +0200 Subject: [PATCH 15/23] // miss logo --- modules/cashondelivery/logo.png | Bin 0 -> 1365 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/cashondelivery/logo.png diff --git a/modules/cashondelivery/logo.png b/modules/cashondelivery/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2b7b2685acb61580c7647ffe3700b39c2f5f910a GIT binary patch literal 1365 zcmV-b1*-aqP);m^48W;w1q!n)sqokQWjKL;6c;`OR7LLVlvzk6uF70 z5CT{_cG@YWm+9Qj**?sfX{SIfP|}sG$xhB>|KC|_?X}Jptu>Qrib*yZ4+NZ3J?+17QEQWqxM*%=z?QIZfBKJayFu_0=X? zj}0IKiJm-NJsx#cCQ}}q&DFEVcw)sd2gr^Gz&^gYDKn#aITGIsN+F`?N@n@DGfjQ1 zL$tvi24Pq@-kB!RondN&OI?kP);{g79ko9qqWBOgOq6>bRL=U7Js&`p=s60G6*Rb ze>^k$jh*=CJ_Srr21A2clHL9E_hm?@vs8p#s%k2zua8hXKq8Px^m8qlA~l%Cb!{T| zIn>lf2!(C%Js^*IbTy~9Eu(4GsS-pHz&^31DKqE&gY@iQPH%69WLH0_RE|*Cp<#Lr zwY8OmDjc-dfm4iz4vBo&nctAkVC_^~2dtD0< zG66?>9%ke7bbZwfhBKTQJ<;7pgO{Q1rGsd1Er4Sdx}k>bb;JrGhD)*WOt@(utrTRh z7vD~qMMRzL!?0{H?0X7;^3mD8QdrDVvT}VW(<(4c5P$#@2x)YoF^L7azG8s{0D$&V zD9Zt5|IdgRzqqLkY%u`HY7fuP7aEk88Xh>sze}zkWdsqJ004#H8aA^JZD&@*=8IWN zu}y=Vr;*%1Nkf%*bqX;o#4vBm4a34PZOqYb*^5&^;uVnlwpPFUex&2s91ku^j$To||U3sZO z5u(PG0wsc}EIvNd%AWRiM2~8Q66~ZwluOIpm)Ub-7oYsTm$lOtVv1Q_12BYPSm<$n zBpIT>v}ygPoz{0gqc7KnFuHy;T6-v6%^&eyES|TF){{F~e|RfPrE(ZRL_lXzwvE;@ z&Nf>BP{2^GnzctcCuvN>$IKT&bEB*C;-z#-0=A8UlbS)N?_3I z0BfvyPyo}wg`O{YX68&b|8=$mppygM;S=BPdD_2?sbiq16bsXU6df4Ott&_S#kv7) zX885OS^Pd?fHr~ja~~al8>k)Gn8s;V^9J_ij5tpCCIA|I4f)`6)HL8yI~@3#SZo9D z0%-|ELx6h+9q9gN*RVZQ$-?4Wmg#HA=i#+i3hT?4;in&o#Wt`4xB~RvZOe-Q4~`K% zYtef4EnfzIpN9kA6N_yuiC+Ue^DY5~g3S`Qh+dUpz@;m2 Date: Tue, 9 Apr 2013 10:37:15 +0200 Subject: [PATCH 16/23] [-] BO : Fix bug #PSCFV-8620 returns with customized product --- .../controllers/orders/_customized_data.tpl | 70 +++++++++++-------- controllers/admin/AdminOrdersController.php | 7 +- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl b/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl index d6ca1cf6f..7e5b10b7e 100755 --- a/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl @@ -22,22 +22,23 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -{if $product.customizedDatas} - - - {if isset($product.image) && $product.image->id}{$product.image_tag}{else}--{/if} +{if $product['customizedDatas']} + + + + {if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if} - + {$product['product_name']} - {l s='Customized'}
      {if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']}
      {/if} {if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if}
      - {displayPrice price=$product['product_price_wt'] currency=$currency->id} + {displayPrice price=$product['product_price_wt'] currency=$currency->id|intval} {if $can_edit} @@ -49,32 +50,37 @@ {if $stock_management} - {/if} {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} - {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval} {else} - {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval} {/if} + +   +   - - {l s='Edit'} - - - {l s='Delete'} - + {if ($can_edit && !$order->hasBeenDelivered())} + + {l s='Edit'} + + + {l s='Delete'} + + {/if} - {foreach $product.customizedDatas as $customizationPerAddress} + {foreach $product['customizedDatas'] as $customizationPerAddress} {foreach $customizationPerAddress as $customizationId => $customization} - - + + {foreach $customization.datas as $type => $datas} {if ($type == Product::CUSTOMIZE_FILE)}
        {foreach from=$datas item=data}
      • {if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}{l s=':'}  - +
      • {/foreach}
      @@ -93,7 +99,7 @@ {$customization['quantity']} {if $can_edit} {/if} @@ -104,36 +110,38 @@ {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} - {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id|intval} {else} - {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval} {/if} - - + + {if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))} - = $product['product_quantity'])}disabled="disabled" {/if}/> + = $product['product_quantity'])}disabled="disabled" {/if}/> {else} -- {/if} {if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])} - + {elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))} - 0/{$customization['quantity']-$customization['quantity_refunded']} + 0/{$customization['quantity']-$customization['quantity_refunded']} {/if} -
      {l s='Quantity:'}
      +
      {l s='Quantity:'}
      0/{$customization['quantity']-$customization['quantity_refunded']}
      -
      {l s='Amount:'}
      {$currency->prefix}{$currency->suffix}
      - - +
      {l s='Amount:'}
      {$currency->prefix}{$currency->suffix}
      + {if ($can_edit && !$order->hasBeenDelivered())} + + + {/if} {/foreach} {/foreach} diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 9bc9be699..67e8fd9a1 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -568,9 +568,9 @@ class AdminOrdersControllerCore extends AdminController { if ($this->tabAccess['delete'] === '1') { - if (!Tools::isSubmit('id_order_detail')) + if (!Tools::isSubmit('id_order_detail') && !Tools::isSubmit('id_customization')) $this->errors[] = Tools::displayError('You must select a product.'); - elseif (!Tools::isSubmit('cancelQuantity')) + elseif (!Tools::isSubmit('cancelQuantity') && !Tools::isSubmit('cancelCustomizationQuantity')) $this->errors[] = Tools::displayError('You must enter a quantity.'); else { @@ -597,7 +597,8 @@ class AdminOrdersControllerCore extends AdminController foreach ($customizationList as $key => $id_order_detail) { $full_product_list[(int)$id_order_detail] = $id_order_detail; - $full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key]; + if (isset($customizationQtyList[$key])) + $full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key]; } if ($productList || $customizationList) From c26fa09667f53fee76404b005fd62317ebc32eeb Mon Sep 17 00:00:00 2001 From: sLorenzini Date: Tue, 9 Apr 2013 11:22:19 +0200 Subject: [PATCH 17/23] [-] BO: fixed bug Cart rules - Javascript error - #PSCFV-5045 --- .../themes/default/template/controllers/cart_rules/form.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/admin-dev/themes/default/template/controllers/cart_rules/form.js b/admin-dev/themes/default/template/controllers/cart_rules/form.js index bad35e93d..ff7c38d9a 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/form.js +++ b/admin-dev/themes/default/template/controllers/cart_rules/form.js @@ -84,6 +84,13 @@ function addCartRuleOption(item) function updateProductRuleShortDescription(item) { + /******* For IE: put a product in condition on cart rules *******/ + if(typeof String.prototype.trim !== 'function') { + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + } + } + var id1 = $(item).attr('id').replace('_add', '').replace('_remove', ''); var id2 = id1.replace('_select', ''); var length = $('#' + id1 + '_2 option').length; From 3ba776a9d1d597b05af9dc1d22ff19d3184c19c6 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Tue, 9 Apr 2013 14:59:15 +0200 Subject: [PATCH 18/23] [-] FO - fixed bug #PSCFV-8612 - Payment module: Bug in country restriction in multi store --- classes/Hook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Hook.php b/classes/Hook.php index a5fbbd35d..994c452f5 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -276,7 +276,7 @@ class HookCore extends ObjectModel { $sql->where(Module::getPaypalIgnore()); if (Validate::isLoadedObject($context->country)) - $sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')'); + $sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' AND id_shop = '.(int)$context->shop->id.' LIMIT 1) = '.(int)$context->country->id.')'); if (Validate::isLoadedObject($context->currency)) $sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -2) LIMIT 1) IN ('.(int)$context->currency->id.', -2))'); } From 1b01c7a6024866834ecc951fedcd97b805f0bcca Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 9 Apr 2013 17:43:15 +0200 Subject: [PATCH 19/23] [-] BO : Fix bug #PSCFV-8626 rename actual admin folder --- .../template/controllers/login/content.tpl | 164 ++++++++---------- admin-dev/themes/default/template/footer.tpl | 50 +++--- admin-dev/themes/default/template/header.tpl | 80 ++++----- admin-dev/themes/default/template/layout.tpl | 6 +- controllers/admin/AdminLoginController.php | 15 +- 5 files changed, 145 insertions(+), 170 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/login/content.tpl b/admin-dev/themes/default/template/controllers/login/content.tpl index b1cfff216..528e064e7 100755 --- a/admin-dev/themes/default/template/controllers/login/content.tpl +++ b/admin-dev/themes/default/template/controllers/login/content.tpl @@ -22,91 +22,79 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - - -
      -
      - {if isset($errors)} -

      {if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}

      -
        - {foreach from=$errors item="error"} -
      1. {$error}
      2. - {/foreach} -
      - {/if} -
      -
      - {if isset($warningSslMessage)} -
      - {$warningSslMessage} -
      - {/if} -
      -

      {$shop_name}

      - {if !isset($wrong_folder_name) && !isset($wrong_install_name)} -
      -
      - - -
      - -
      - - -
      - -
      - - -

      - -

      - -

      - {l s='Lost password?'} -

      -
      -
      - -
      - -
      -

      {l s='Forgot your password?'}

      -

      {l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}

      - -
      - - -
      - -
      - - -

      - -

      - -

      - -

      -
      -
      -
      - {else} -
      -

      {l s='For security reasons, you cannot connect to the Back Office until after you have:'}

      -
        - {if isset($wrong_install_name) && $wrong_install_name == true}
      • {l s='deleted the /install folder'}
      • {/if} - {if isset($wrong_folder_name) && $wrong_folder_name == true}
      • {l s='renamed the /admin folder (e.g. /admin%d)' sprintf=$randomNb}
      • {/if} -
      - {if isset($wrong_folder_name) && $wrong_folder_name == true}

      {l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin%d)' sprintf=$randomNb}

      {/if} -
      - {/if} -
      -

      © 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.

      -
      + +
      +
      +{if isset($errors)} +

      {if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}

      +
        + {foreach from=$errors item="error"} +
      1. {$error}
      2. + {/foreach} +
      +{/if} +
      +
      +{if isset($warningSslMessage)} +
      {$warningSslMessage}
      +{/if} +
      +

      {$shop_name}

      +{if !isset($wrong_folder_name) && !isset($wrong_install_name)} +
      +
      + + +
      +
      + + +
      +
      + +

      + +

      +

      + {l s='Lost password?'} +

      +
      +
      + +
      +
      +

      {l s='Forgot your password?'}

      +

      {l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}

      +
      + + +
      +
      + +

      + +

      +

      + +

      +
      +
      +
      +{else} +
      +

      {l s='For security reasons, you cannot connect to the Back Office until after you have:'}

      +
        + {if isset($wrong_install_name) && $wrong_install_name == true}
      • {l s='deleted the /install folder'}
      • {/if} + {if isset($wrong_folder_name) && $wrong_folder_name == true}
      • {l s='renamed the /admin folder (e.g. /%s)' sprintf=$randomNb}
      • {/if} +
      +

      {l s='Please then access this page by the new URL (e.g. %s)' sprintf=$adminUrl}

      +
      +{/if} +
      +

      © 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.

      +
      \ No newline at end of file diff --git a/admin-dev/themes/default/template/footer.tpl b/admin-dev/themes/default/template/footer.tpl index 425e970fe..8caf2c64a 100644 --- a/admin-dev/themes/default/template/footer.tpl +++ b/admin-dev/themes/default/template/footer.tpl @@ -22,33 +22,31 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - -
       
      -
      -
       
      +
       
      + +
       
      + +{if $display_footer} +{hook h="displayBackOfficeFooter"} + - - {* ajaxBox allows*} - - {/if} -
      - - + + +{* ajaxBox allows*} +{/if} +
      + + \ No newline at end of file diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index 9a3eb0b07..dc80e8831 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -82,7 +82,6 @@ {/foreach} {/if} - {if isset($displayBackOfficeHeader)} @@ -91,16 +90,15 @@ - {if isset($brightness)} +{if isset($brightness)} - {/if} +{/if} {if $display_header}
      {l s='Loading...'}
      -
      0}style="margin:auto;width:{$bo_width}px"{/if}>
      {* begin HEADER *} @@ -108,7 +106,7 @@
      {$shop_name}
      - {if {$show_new_orders} == 1} +{if {$show_new_orders} == 1}
      0 @@ -120,8 +118,8 @@

      {l s='Show all orders'}

      - {/if} - {if ($show_new_customers == 1)} +{/if} +{if ($show_new_customers == 1)}
      0 @@ -133,8 +131,8 @@

      {l s='Show all customers'}

      - {/if} - {if {$show_new_messages} == 1} +{/if} +{if {$show_new_messages} == 1}
      0 @@ -146,9 +144,8 @@

      {l s='Show all messages'}

      - {/if} +{/if}
      -
      {l s='Welcome,'} {$first_name} {$last_name}
      @@ -157,14 +154,13 @@
    • {l s='My preferences'}
    •  
    • {l s='logout'}
    • - {if {$base_url}} -
    •  
    • - {l s='View my shop'} - {/if} +{if {$base_url}} +
    •  
    • + {l s='View my shop'} +{/if}
    - - - {if count($quick_access) > 0} +{if count($quick_access) > 0}
    - {/if} - {if isset($displayBackOfficeTop)} - {$displayBackOfficeTop} - {/if} +{/if} +{if isset($displayBackOfficeTop)}{$displayBackOfficeTop}{/if} {* end header_infos*} - - {/if} - {/foreach} +{/if} +{/foreach}
- {/if} - {* end header*} - + {* end header*} +{/if}
- {if $display_header && $install_dir_exists} -
- {l s='For security reasons, you must also:'} {l s='delete the /install folder'} -
- {/if} - - {if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)} -
- {l s='Multistore configuration for'} - {$shop_list} -
- {/if} +{if $display_header && $install_dir_exists} +
+ {l s='For security reasons, you must also:'} {l s='delete the /install folder'} +
+{/if} +{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)} +
+ {l s='Multistore configuration for'} {$shop_list} +
+{/if} \ No newline at end of file diff --git a/admin-dev/themes/default/template/layout.tpl b/admin-dev/themes/default/template/layout.tpl index 3481179da..10ca2fd13 100644 --- a/admin-dev/themes/default/template/layout.tpl +++ b/admin-dev/themes/default/template/layout.tpl @@ -47,7 +47,6 @@ {/if}
{/if} - {if isset($informations) && count($informations) && $informations}
@@ -60,7 +59,6 @@

{/if} - {if isset($confirmations) && count($confirmations) && $confirmations}
{foreach $confirmations as $conf} @@ -68,7 +66,6 @@ {/foreach}

{/if} - {if count($warnings)}
@@ -94,6 +91,5 @@ {/if}
{/if} - {$page} -{include file='footer.tpl'} +{include file='footer.tpl'} \ No newline at end of file diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php index 3329fb75a..5ce949c00 100755 --- a/controllers/admin/AdminLoginController.php +++ b/controllers/admin/AdminLoginController.php @@ -70,18 +70,23 @@ class AdminLoginControllerCore extends AdminController if (file_exists(_PS_ADMIN_DIR_.'/../install')) $this->context->smarty->assign('wrong_install_name', true); - if (file_exists(_PS_ADMIN_DIR_.'/../admin')) + + if (basename(_PS_ADMIN_DIR_) == 'admin' && file_exists(_PS_ADMIN_DIR_.'/../admin/')) { - $rand = sprintf('%04d', rand(0, 9999)); - if (@rename(_PS_ADMIN_DIR_.'/../admin', _PS_ADMIN_DIR_.'/../admin'.$rand)) - Tools::redirectAdmin('../admin'.$rand); + $rand = 'admin'.sprintf('%04d', rand(0, 9999)).'/'; + if (@rename(_PS_ADMIN_DIR_.'/../admin/', _PS_ADMIN_DIR_.'/../'.$rand)) + Tools::redirectAdmin('../'.$rand); else $this->context->smarty->assign(array( 'wrong_folder_name' => true )); } + else + $rand = basename(_PS_ADMIN_DIR_).'/'; + $this->context->smarty->assign(array( - 'randomNb' => rand(0, 9999) + 'randomNb' => $rand, + 'adminUrl' => Tools::getCurrentUrlProtocolPrefix().Tools::getShopDomain().__PS_BASE_URI__.$rand )); // Redirect to admin panel From a0db01db58340d4c51ba1e0576edd8b1d7aa017d Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 9 Apr 2013 17:47:34 +0200 Subject: [PATCH 20/23] // removed slash --- admin-dev/themes/default/template/controllers/login/content.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/login/content.tpl b/admin-dev/themes/default/template/controllers/login/content.tpl index 528e064e7..784fdec19 100755 --- a/admin-dev/themes/default/template/controllers/login/content.tpl +++ b/admin-dev/themes/default/template/controllers/login/content.tpl @@ -90,7 +90,7 @@

{l s='For security reasons, you cannot connect to the Back Office until after you have:'}

    {if isset($wrong_install_name) && $wrong_install_name == true}
  • {l s='deleted the /install folder'}
  • {/if} - {if isset($wrong_folder_name) && $wrong_folder_name == true}
  • {l s='renamed the /admin folder (e.g. /%s)' sprintf=$randomNb}
  • {/if} + {if isset($wrong_folder_name) && $wrong_folder_name == true}
  • {l s='renamed the /admin folder (e.g. %s)' sprintf=$randomNb}
  • {/if}

{l s='Please then access this page by the new URL (e.g. %s)' sprintf=$adminUrl}

From 8674313eae5502959b8eecf1eddc7ff5f83d587a Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 10 Apr 2013 10:27:25 +0200 Subject: [PATCH 21/23] [-] INSTALLER : fix bug #PSCFV-7688 mailalert_customer_oos not existing in database --- install-dev/upgrade/php/update_mailalerts_add_column_idshop.php | 1 + 1 file changed, 1 insertion(+) diff --git a/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php b/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php index 9920567a1..c79407dec 100644 --- a/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php +++ b/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php @@ -31,6 +31,7 @@ function update_mailalerts_add_column_idshop() { $installed = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = "mailalerts"'); + $installed &= Db::getInstance()->getValue('SHOW TABLES LIKE "'._DB_PREFIX_.'mailalert_customer_oos"'); if ($installed && !Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos` ADD COLUMN `id_shop` int(11) NOT NULL default "0" AFTER `id_customer`')) return array('error' => 1, 'msg' => sprintf('unable to create column id_shop (%s)', Db::getInstance ()->getMsgError())); return true; From 17012ea00d73a4f7ca8c2a0a719e71e83ab50544 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 10 Apr 2013 17:57:33 +0200 Subject: [PATCH 22/23] [*] Installer : Set context in upgrader --- classes/Translate.php | 2 +- classes/module/Module.php | 10 ++++++---- install-dev/install_version.php | 2 +- install-dev/upgrade/upgrade.php | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/classes/Translate.php b/classes/Translate.php index c98be204f..549158861 100644 --- a/classes/Translate.php +++ b/classes/Translate.php @@ -129,7 +129,7 @@ class TranslateCore static $translations_merged = array(); $name = $module instanceof Module ? $module->name : $module; - if (!isset($translations_merged[$name])) + if (!isset($translations_merged[$name]) && isset(Context::getContext()->language)) { $filesByPriority = array( // Translations in theme diff --git a/classes/module/Module.php b/classes/module/Module.php index e42b12fdb..a0d67a78b 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -139,8 +139,9 @@ abstract class ModuleCore public function __construct($name = null, Context $context = null) { // Load context and smarty - $this->context = $context ? $context : Context::getContext(); - $this->smarty = $this->context->smarty->createData($this->context->smarty); + $this->context = $context ? $context : Context::getContext(); + if (is_object($this->context->smarty)) + $this->smarty = $this->context->smarty->createData($this->context->smarty); // If the module has no name we gave him its id as name if ($this->name == null) @@ -152,8 +153,9 @@ abstract class ModuleCore // If cache is not generated, we generate it if (self::$modules_cache == null && !is_array(self::$modules_cache)) { - // Join clause is done to check if the module is activated in current shop context - $sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.(int)Context::getContext()->shop->id; + // Join clause is done to check if the module is activated in current shop context + $sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.((is_object(Context::getContext()->shop) && $id = (int)Context::getContext()->shop->id) ? $id : 1); + $sql = 'SELECT m.`id_module`, m.`name`, ('.$sql_limit_shop.') as total FROM `'._DB_PREFIX_.'module` m'; // Result is cached diff --git a/install-dev/install_version.php b/install-dev/install_version.php index 144b75cf7..5d86dc4df 100644 --- a/install-dev/install_version.php +++ b/install-dev/install_version.php @@ -24,4 +24,4 @@ * International Registered Trademark & Property of PrestaShop SA */ -define('_PS_INSTALL_VERSION_', '1.5.4.0'); +define('_PS_INSTALL_VERSION_', '1.5.4.1'); diff --git a/install-dev/upgrade/upgrade.php b/install-dev/upgrade/upgrade.php index 3aefe2d1e..81b0481a8 100644 --- a/install-dev/upgrade/upgrade.php +++ b/install-dev/upgrade/upgrade.php @@ -246,6 +246,28 @@ if(!defined('_PS_CACHE_ENABLED_')) define('_PS_CACHE_ENABLED_', '0'); if(!defined('_MYSQL_ENGINE_')) define('_MYSQL_ENGINE_', 'MyISAM'); + +global $smarty; +// Clean all cache values +Cache::clean('*'); + +Context::getContext()->shop = new Shop(1); +Shop::setContext(Shop::CONTEXT_SHOP, 1); +Configuration::loadConfiguration(); +if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language)) + if ($id_lang = (int)Configuration::get('PS_LANG_DEFAULT')) + Context::getContext()->language = new Language($id_lang); +if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country)) + if ($id_country = (int)Configuration::get('PS_COUNTRY_DEFAULT')) + Context::getContext()->country = new Country((int)$id_country); + +Context::getContext()->cart = new Cart(); +Context::getContext()->employee = new Employee(1); +if (!defined('_PS_SMARTY_FAST_LOAD_')) + define('_PS_SMARTY_FAST_LOAD_', true); +require_once _PS_ROOT_DIR_.'/config/smarty.config.inc.php'; + +Context::getContext()->smarty = $smarty; if(isset($_GET['customModule']) AND $_GET['customModule'] == 'desactivate') { From f43aee9a254be22846fbb4a568d2a3e76b84aaef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 10 Apr 2013 18:52:59 +0200 Subject: [PATCH 23/23] [-] BO: PSCFV-7685 parent category for root categories after upgrade --- controllers/admin/AdminCategoriesController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 79d5a9960..4acf3a7e5 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -542,9 +542,14 @@ class AdminCategoriesControllerCore extends AdminController { $id_category = (int)Tools::getValue('id_category'); $id_parent = (int)Tools::getValue('id_parent'); + // if true, we are in a root category creation if (!$id_parent && !Tools::isSubmit('is_root_category')) - $_POST['is_root_category'] = $_POST['level_depth'] = $_POST['id_parent'] = $id_parent = 1; + { + $_POST['is_root_category'] = $_POST['level_depth'] = 1; + $_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY'); + } + if ($id_category) { if ($id_category != $id_parent)