From 0036768ae5bbdc39fcfbc339d8898d90fe5b5af1 Mon Sep 17 00:00:00 2001 From: bumbu Date: Mon, 7 Jan 2013 19:24:12 +0200 Subject: [PATCH 001/644] ObjectModel::updateMultishopTable() where argument is not mandatory --- classes/ObjectModel.php | 6 +++--- classes/Product.php | 2 +- classes/Search.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index 105c7cdff..4032cc318 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -1284,7 +1284,7 @@ abstract class ObjectModelCore * @param string $specific_where Only executed for common table * @return bool */ - public static function updateMultishopTable($classname, $data, $where, $specific_where = '') + public static function updateMultishopTable($classname, $data, $where = '', $specific_where = '') { $def = ObjectModel::getDefinition($classname); $update_data = array(); @@ -1304,8 +1304,8 @@ abstract class ObjectModelCore $sql = 'UPDATE '._DB_PREFIX_.$def['table'].' a '.Shop::addSqlAssociation($def['table'], 'a', true, null, true).' - SET '.implode(', ', $update_data).' - WHERE '.$where; + SET '.implode(', ', $update_data). + (!empty($where) ? ' WHERE '.$where : ''); return Db::getInstance()->execute($sql); } diff --git a/classes/Product.php b/classes/Product.php index e22850083..ba07b5794 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -4609,7 +4609,7 @@ class ProductCore extends ObjectModel { return ObjectModel::updateMultishopTable('product', array( 'ecotax' => 0, - ), ''); + )); } /** diff --git a/classes/Search.php b/classes/Search.php index 20bbdce47..b549a1df5 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -413,7 +413,7 @@ class SearchCore { $db->execute('TRUNCATE '._DB_PREFIX_.'search_index'); $db->execute('TRUNCATE '._DB_PREFIX_.'search_word'); - ObjectModel::updateMultishopTable('Product', array('indexed' => 0), '1'); + ObjectModel::updateMultishopTable('Product', array('indexed' => 0)); } else { From d59ea3e6ddab8ca4868eb1ceea47ff01d4a32794 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Thu, 17 Jan 2013 23:29:11 +0100 Subject: [PATCH 002/644] [*] BO: use lang for input file --- .../themes/default/template/helpers/form/form.tpl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 02538c893..77d417ac6 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -244,7 +244,19 @@
{/if} {/if} - + + {if isset($input.lang) AND $input.lang} +
+ {foreach $languages as $language} +
+ + +
+ {/foreach} +
+ {else} + + {/if} {if !empty($input.hint)}{$input.hint} {/if} {elseif $input.type == 'password'} Date: Wed, 27 Feb 2013 16:53:32 +0100 Subject: [PATCH 003/644] Default adresse layout update As many countries use mobile phones in an extensive way, it should be useful to update the default address layout --- controllers/admin/AdminCountriesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCountriesController.php b/controllers/admin/AdminCountriesController.php index e71874924..9e711e6d9 100644 --- a/controllers/admin/AdminCountriesController.php +++ b/controllers/admin/AdminCountriesController.php @@ -145,7 +145,8 @@ class AdminCountriesControllerCore extends AdminController array('address2'), array('postcode', 'city'), array('Country:name'), - array('phone')); + array('phone'), + array('phone_mobile')); foreach ($default_layout_tab as $line) $default_layout .= implode(' ', $line)."\r\n"; From 47d3085a4af102a05a5e7c035180360ed9db973d Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Mon, 18 Mar 2013 01:03:43 +0100 Subject: [PATCH 004/644] [*]WS: POST and XML ressource --- webservice/dispatcher.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webservice/dispatcher.php b/webservice/dispatcher.php index 519121013..7ed118db4 100644 --- a/webservice/dispatcher.php +++ b/webservice/dispatcher.php @@ -66,8 +66,8 @@ else // if no XML $input_xml = NULL; - // if a XML is in PUT - if ($_SERVER['REQUEST_METHOD'] == 'PUT') + // if a XML is in PUT or in POST + if (($_SERVER['REQUEST_METHOD'] == 'PUT') || ($_SERVER['REQUEST_METHOD'] == 'POST')) { $putresource = fopen("php://input", "r"); while ($putData = fread($putresource, 1024)) @@ -113,4 +113,4 @@ if (isset($result['type'])) } } -ob_end_flush(); \ No newline at end of file +ob_end_flush(); From 312e16a9266b63c497ff8321133fe57e3b979d93 Mon Sep 17 00:00:00 2001 From: Vincent Schoener Date: Thu, 28 Mar 2013 12:45:03 +0100 Subject: [PATCH 005/644] [-] CORE : Fix issue with delivery option Happens after a payment redirection error, delivery_option is not sent (but should be set in the cart context) --- controllers/front/OrderController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php index 190bdd1de..cc406e733 100644 --- a/controllers/front/OrderController.php +++ b/controllers/front/OrderController.php @@ -155,14 +155,18 @@ class OrderControllerCore extends ParentOrderController Tools::redirect('index.php?controller=order&step=2'); Context::getContext()->cookie->check_cgv = true; - // Check the delivery option is setted + // Check the delivery option is set if (!$this->context->cart->isVirtualCart()) { if (!Tools::getValue('delivery_option') && !Tools::getValue('id_carrier') && !$this->context->cart->delivery_option && !$this->context->cart->id_carrier) Tools::redirect('index.php?controller=order&step=2'); elseif (!Tools::getValue('id_carrier') && !$this->context->cart->id_carrier) { - foreach (Tools::getValue('delivery_option') as $delivery_option) + $deliveries_options = Tools::getValue('delivery_option'); + if (!$deliveries_options) { + $deliveries_options = $this->context->cart->delivery_option; + } + foreach ($deliveries_options as $delivery_option) if (empty($delivery_option)) Tools::redirect('index.php?controller=order&step=2'); } From 5b058e672369874d5fc7a89209d5a2da911c0898 Mon Sep 17 00:00:00 2001 From: Arnaud Lemercier Date: Fri, 29 Mar 2013 10:26:44 +0100 Subject: [PATCH 006/644] Allow webservice to set the tags list of product when creating or updating a product --- classes/Product.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/classes/Product.php b/classes/Product.php index bbe6fd920..b1669b31a 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -4663,6 +4663,34 @@ class ProductCore extends ObjectModel FROM `'._DB_PREFIX_.'product_tag` WHERE `id_product` = '.(int)$this->id); } + + /** + * Webservice setter : set tag ids of current product for association + * + * @param $tag_ids tag ids + */ + public function setWsTags($tag_ids) + { + $ids = array(); + foreach ($tag_ids as $value) + $ids[] = $value['id']; + if ($this->deleteTags()) + { + if ($ids) + { + $sql_values = ''; + $ids = array_map('intval', $ids); + foreach ($ids as $position => $id) + $sql_values[] = '('.(int)$this->id.', '.(int)$id.')'; + $result = Db::getInstance()->execute(' + INSERT INTO `'._DB_PREFIX_.'product_tag` (`id_product`, `id_tag`) + VALUES '.implode(',', $sql_values) + ); + return $result; + } + } + return true; + } public function getWsManufacturerName() From 18edd9bf75698c4eae0f5a4107e7e9f75c146c01 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Fri, 29 Mar 2013 10:40:07 +0100 Subject: [PATCH 007/644] [*] Class: Tools::fileAttachment() --- classes/Tools.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/classes/Tools.php b/classes/Tools.php index c6022516b..5dc9fa518 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -2259,6 +2259,21 @@ FileETag INode MTime Size return $pattern; return preg_replace('/\\\[px]\{[a-z]\}{1,2}|(\/[a-z]*)u([a-z]*)$/i', "$1$2", $pattern); } + + public static function fileAttachment($input = 'fileUpload') + { + $fileAttachment = null; + if (isset($_FILES[$input]['name']) && !empty($_FILES[$input]['name']) && !empty($_FILES[$input]['tmp_name'])) + { + $filename = uniqid().substr($_FILES[$input]['name'], -5); + $fileAttachment['content'] = file_get_contents($_FILES[$input]['tmp_name']); + $fileAttachment['name'] = $_FILES[$input]['name']; + $fileAttachment['mime'] = $_FILES[$input]['type']; + $fileAttachment['error'] = $_FILES[$input]['error']; + } + + return $fileAttachment; + } } /** From 07979774f69630a42e5058f11044097755cc6fd4 Mon Sep 17 00:00:00 2001 From: Arnaud Lemercier Date: Tue, 2 Apr 2013 18:44:12 +0200 Subject: [PATCH 008/644] Delete products tags entries without delete tags for webservice usage --- classes/Product.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index b1669b31a..c027d691d 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -4674,7 +4674,7 @@ class ProductCore extends ObjectModel $ids = array(); foreach ($tag_ids as $value) $ids[] = $value['id']; - if ($this->deleteTags()) + if ($this->deleteWsTags()) { if ($ids) { @@ -4690,7 +4690,17 @@ class ProductCore extends ObjectModel } } return true; - } + } + + /** + * Delete products tags entries without delete tags for webservice usage + * + * @return array Deletion result + */ + public function deleteWsTags() + { + return Db::getInstance()->delete('product_tag', 'id_product = '.(int)$this->id); + } public function getWsManufacturerName() From 624fed3710d4c1bd5bf38c6b66c4676982fbfbd8 Mon Sep 17 00:00:00 2001 From: ldecoker Date: Tue, 16 Apr 2013 19:15:45 +0300 Subject: [PATCH 009/644] Update form.tpl --- .../template/controllers/attributes/helpers/form/form.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin-dev/themes/default/template/controllers/attributes/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/attributes/helpers/form/form.tpl index 365736bbd..fbe5a1ced 100644 --- a/admin-dev/themes/default/template/controllers/attributes/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/attributes/helpers/form/form.tpl @@ -29,6 +29,9 @@ {if $input.type == 'color'}
{/if} + {if $input.type == 'closediv'} +
+ {/if} {$smarty.block.parent} {/block} From 34644ee6ebc6fd8400a0be47a379a5d8afe8c584 Mon Sep 17 00:00:00 2001 From: ldecoker Date: Tue, 16 Apr 2013 19:17:51 +0300 Subject: [PATCH 010/644] Update AdminAttributesGroupsController.php --- controllers/admin/AdminAttributesGroupsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index 26c53cc83..e4e66d4aa 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -328,6 +328,10 @@ class AdminAttributesGroupsControllerCore extends AdminController 'label' => $this->l('Current texture:'), 'name' => 'current_texture' ); + + $this->fields_form['input'][] = array( + 'type' => 'closediv' + ); $this->fields_form['submit'] = array( 'title' => $this->l('Save '), From a994c93dee987d294016e8592c2bd161e06cfcd3 Mon Sep 17 00:00:00 2001 From: Otto Nascarella Date: Thu, 25 Apr 2013 12:18:50 -0300 Subject: [PATCH 011/644] Progressive JPEG https://plus.google.com/+PaulIrish/posts/5KzxfS9nNEZ --- classes/ImageManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/ImageManager.php b/classes/ImageManager.php index c7500c8fd..c647b6ea3 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -407,6 +407,7 @@ class ImageManagerCore case 'jpeg': default: $quality = (Configuration::get('PS_JPEG_QUALITY') === false ? 90 : Configuration::get('PS_JPEG_QUALITY')); + imageinterlace($resource,1); /// make it PROGRESSIVE $success = imagejpeg($resource, $filename, (int)$quality); break; } From 8331ab0c1aa61c8e0c1f1eaf2aea3b4e5b3f21ef Mon Sep 17 00:00:00 2001 From: ccauw Date: Sun, 28 Apr 2013 16:01:55 +0300 Subject: [PATCH 012/644] [-]BO : bug color parameter in List [-]BO : bug color parameter in List In field list, if there is another field with 'color' => 'color_field', (and color_field column in the select), the background color is always the value of field list column 'color', never 'color_field' the lines: {block name="td_content"} ... {if isset($params.color) && isset($tr[$params.color])} + {/if} {if isset($tr.$key)} {if isset($params.active)} From b6fbbe6187f58f373a07c03dabf43967270fcb11 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Tue, 30 Apr 2013 20:46:34 +0200 Subject: [PATCH 013/644] [*] FO: use Tools::fileAttachment() in ContactController --- controllers/front/ContactController.php | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/controllers/front/ContactController.php b/controllers/front/ContactController.php index dd133b8fc..7a32b96ba 100644 --- a/controllers/front/ContactController.php +++ b/controllers/front/ContactController.php @@ -38,15 +38,10 @@ class ContactControllerCore extends FrontController { if (Tools::isSubmit('submitMessage')) { - $fileAttachment = null; - if (isset($_FILES['fileUpload']['name']) && !empty($_FILES['fileUpload']['name']) && !empty($_FILES['fileUpload']['tmp_name'])) - { - $extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); - $filename = uniqid().substr($_FILES['fileUpload']['name'], -5); - $fileAttachment['content'] = file_get_contents($_FILES['fileUpload']['tmp_name']); - $fileAttachment['name'] = $_FILES['fileUpload']['name']; - $fileAttachment['mime'] = $_FILES['fileUpload']['type']; - } + $extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); + + $fileAttachment = Tools::fileAttachment('fileUpload'); + $message = Tools::getValue('message'); // Html entities is not usefull, iscleanHtml check there is no bad html tags. if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) $this->errors[] = Tools::displayError('Invalid e-mail address'); @@ -56,9 +51,9 @@ class ContactControllerCore extends FrontController $this->errors[] = Tools::displayError('Invalid message'); else if (!($id_contact = (int)(Tools::getValue('id_contact'))) || !(Validate::isLoadedObject($contact = new Contact($id_contact, $this->context->language->id)))) $this->errors[] = Tools::displayError('Please select a subject from the list.'); - else if (!empty($_FILES['fileUpload']['name']) && $_FILES['fileUpload']['error'] != 0) + else if (!empty($fileAttachment['name']) && $fileAttachment['error'] != 0) $this->errors[] = Tools::displayError('An error occurred during the file upload'); - else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) && !in_array(substr($_FILES['fileUpload']['name'], -5), $extension)) + else if (!empty($fileAttachment['name']) && !in_array(substr($fileAttachment['name'], -4), $extension) && !in_array(substr($fileAttachment['name'], -5), $extension)) $this->errors[] = Tools::displayError('Bad file extension'); else { @@ -125,7 +120,7 @@ class ContactControllerCore extends FrontController '{message}' => Tools::nl2br(stripslashes($message)), '{id_order}' => $id_order, '{order_name}' => $order->getUniqReference(), - '{attached_file}' => isset($_FILES['fileUpload'], $_FILES['fileUpload']['name']) ? $_FILES['fileUpload']['name'] : '' + '{attached_file}' => isset($fileAttachment, $fileAttachment['name']) ? $fileAttachment['name'] : '' ); if (Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form'), @@ -174,7 +169,7 @@ class ContactControllerCore extends FrontController $cm = new CustomerMessage(); $cm->id_customer_thread = $ct->id; $cm->message = Tools::htmlentitiesUTF8($message); - if (isset($filename) && rename($_FILES['fileUpload']['tmp_name'], _PS_MODULE_DIR_.'../upload/'.$filename)) + if (isset($filename) && rename($fileAttachment['tmp_name'], _PS_MODULE_DIR_.'../upload/'.$filename)) $cm->file_name = $filename; $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); $cm->user_agent = $_SERVER['HTTP_USER_AGENT']; @@ -193,7 +188,7 @@ class ContactControllerCore extends FrontController $var_list['{order_name}'] = $order->reference; } if (isset($filename)) - $var_list['{attached_file}'] = $_FILES['fileUpload']['name']; + $var_list['{attached_file}'] = $fileAttachment['name']; Mail::Send($this->context->language->id, 'contact_form', Mail::l('Your message has been correctly sent'), $var_list, $from); } $this->context->smarty->assign('confirmation', 1); From 6ae0dbb4cafdfb5ec9f3a05f0726e065e127dd9f Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Sat, 1 Jun 2013 00:21:28 +0200 Subject: [PATCH 014/644] [*] BO: use Translate::getAdminTranslation instead of translate() --- admin-dev/footer.inc.php | 8 +-- admin-dev/functions.php | 27 +++----- admin-dev/header.inc.php | 62 +++++++++---------- admin-dev/password.php | 1 + .../admin/AdminTranslationsController.php | 2 +- 5 files changed, 45 insertions(+), 55 deletions(-) diff --git a/admin-dev/footer.inc.php b/admin-dev/footer.inc.php index e41c93db3..e375ecb2f 100644 --- a/admin-dev/footer.inc.php +++ b/admin-dev/footer.inc.php @@ -30,14 +30,14 @@ echo ' diff --git a/admin-dev/functions.php b/admin-dev/functions.php index a79749b62..dd5dea623 100644 --- a/admin-dev/functions.php +++ b/admin-dev/functions.php @@ -223,17 +223,6 @@ function checkPSVersion() return $upgrader->checkPSVersion(); } -function translate($string) -{ - global $_LANGADM; - if (!is_array($_LANGADM)) - return str_replace('"', '"', $string); - $key = md5(str_replace('\'', '\\\'', $string)); - $str = (key_exists('index'.$key, $_LANGADM)) ? $_LANGADM['index'.$key] : ((key_exists('index'.$key, $_LANGADM)) ? $_LANGADM['index'.$key] : $string); - return str_replace('"', '"', stripslashes($str)); -} - - /** * Returns a new Tab object * @@ -461,7 +450,7 @@ function runAdminTab($tab, $ajaxMode = false) echo ''; if (!$ajaxMode && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL) @@ -470,10 +459,10 @@ function runAdminTab($tab, $ajaxMode = false) if (Shop::getContext() == Shop::CONTEXT_GROUP) { $shop_group = new ShopGroup((int)Shop::getContextShopGroupID()); - printf(translate('You are configuring your store for group shop %s'), ''.$shop_group->name.''); + printf(Translate::getAdminTranslation('You are configuring your store for group shop %s'), ''.$shop_group->name.''); } elseif (Shop::getContext() == Shop::CONTEXT_SHOP) - printf(translate('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.''); + printf(Translate::getAdminTranslation('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.''); echo ''; } if (Validate::isLoadedObject($adminObj)) @@ -546,8 +535,8 @@ function runAdminTab($tab, $ajaxMode = false) // we can display the correct url - // die(Tools::jsonEncode(array(translate('Invalid security token'),$url))); - die(Tools::jsonEncode(translate('Invalid security token'))); + // die(Tools::jsonEncode(array(Translate::getAdminTranslation('Invalid security token'),$url))); + die(Tools::jsonEncode(Translate::getAdminTranslation('Invalid security token'))); } else { @@ -559,17 +548,17 @@ function runAdminTab($tab, $ajaxMode = false) if (false === strpos($url, '?token=') AND false === strpos($url, '&token=')) $url .= '&token='.$adminObj->token; - $message = translate('Invalid security token'); + $message = Translate::getAdminTranslation('Invalid security token'); echo ''.$message.'
'.$message.'
'; echo ' - + - + '; die; diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php index 0f92567d4..44d2ca1f8 100644 --- a/admin-dev/header.inc.php +++ b/admin-dev/header.inc.php @@ -41,7 +41,7 @@ echo ' - PrestaShop™ - '.translate('Administration panel').' + PrestaShop™ - '.Translate::getAdminTranslation('Administration panel').' From 663ec76bb99f898eeea6eb85edf2e0b004b763e3 Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Mon, 10 Jun 2013 10:43:01 +0200 Subject: [PATCH 020/644] Better regexp to get country browser from HTTP_ACCEPT_LANGUAGE With HTTP_ACCEPT_LANGUAGE we have two choices : * Country == language (displayed with two letter as fr,de,en,...) * Country with multi language (displayes as fr-CH, de-CH, it-CH) Previous regexp find only first case. --- controllers/front/AddressController.php | 4 +++- controllers/front/AuthController.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/front/AddressController.php b/controllers/front/AddressController.php index 699a37287..eb17888ce 100644 --- a/controllers/front/AddressController.php +++ b/controllers/front/AddressController.php @@ -303,7 +303,9 @@ class AddressControllerCore extends FrontController $selected_country = (int)$this->_address->id_country; else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + // get all countries as language (xy) or language-country (wz-XY) + $array = array(); + preg_match("#(?<=-)\w\w|\w\w(?!-)#",$_SERVER['HTTP_ACCEPT_LANGUAGE'],$array); if (!Validate::isLanguageIsoCode($array[0]) || !($selected_country = Country::getByIso($array[0]))) $selected_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'); } diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 745cca405..f348b2c50 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -107,7 +107,9 @@ class AuthControllerCore extends FrontController if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + // get all countries as language (xy) or language-country (wz-XY) + $array = array(); + preg_match("#(?<=-)\w\w|\w\w(?!-)#",$_SERVER['HTTP_ACCEPT_LANGUAGE'],$array); if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0]))) $sl_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'); } From c94dbb36ce863c6a7a331ee165384f66fd4806df Mon Sep 17 00:00:00 2001 From: romainberger Date: Fri, 14 Jun 2013 11:04:20 +0200 Subject: [PATCH 021/644] [*] MO: Referral program: display currency in account page next to the voucher value --- .../controllers/front/program.php | 27 ++++++++++--------- .../views/templates/front/program.tpl | 6 ++--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/modules/referralprogram/controllers/front/program.php b/modules/referralprogram/controllers/front/program.php index 4f72049a7..2b4d04dcd 100755 --- a/modules/referralprogram/controllers/front/program.php +++ b/modules/referralprogram/controllers/front/program.php @@ -29,31 +29,31 @@ */ include_once(dirname(__FILE__).'../../../ReferralProgramModule.php'); include_once(dirname(__FILE__).'../../../referralprogram.php'); - + class ReferralprogramProgramModuleFrontController extends ModuleFrontController { - + public function init() { if (!$this->context->customer->isLogged()) Tools::redirect('index.php?controller=authentication&back=modules/referralprogram/referralprogram-program.php'); parent::init(); } - + public function setMedia() { parent::setMedia(); $this->addJqueryPlugin(array('thickbox', 'idTabs')); } - + /** * @see FrontController::initContent() */ public function initContent() { parent::initContent(); - + // get discount value (ready to display) $discount_type = (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE')); if ($discount_type == 1) @@ -63,7 +63,7 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController $activeTab = 'sponsor'; $error = false; - + // Mailing invitation to friend sponsor $invitation_sent = false; $nbInvitation = 0; @@ -82,7 +82,7 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController $friendEmail = strval($friendEmail); $friendLastName = strval($friendsLastName[$key]); $friendFirstName = strval($friendsFirstName[$key]); - + if (empty($friendEmail) AND empty($friendLastName) AND empty($friendFirstName)) continue; elseif (empty($friendEmail) OR !Validate::isEmail($friendEmail)) @@ -136,7 +136,7 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController $error = 'email exists'; } } - + // Mailing revive $revive_sent = false; $nbRevive = 0; @@ -174,16 +174,16 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController else $error = 'no revive checked'; } - + $customer = new Customer((int)($this->context->customer->id)); $stats = $customer->getStats(); - + $orderQuantity = (int)(Configuration::get('REFERRAL_ORDER_QUANTITY')); $canSendInvitations = false; if ((int)($stats['nb_orders']) >= $orderQuantity) $canSendInvitations = true; - + // Smarty display $this->context->smarty->assign(array( 'activeTab' => $activeTab, @@ -198,8 +198,9 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController 'revive_sent' => $revive_sent, 'nbRevive' => $nbRevive, 'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($this->context->customer->id), 'subscribed'), - 'mails_exists' => (isset($mails_exists) ? $mails_exists : array()) + 'mails_exists' => (isset($mails_exists) ? $mails_exists : array()), + 'currencySign' => $this->context->currency->sign )); $this->setTemplate('program.tpl'); } -} \ No newline at end of file +} diff --git a/modules/referralprogram/views/templates/front/program.tpl b/modules/referralprogram/views/templates/front/program.tpl index b2ca271e7..425deb9c1 100644 --- a/modules/referralprogram/views/templates/front/program.tpl +++ b/modules/referralprogram/views/templates/front/program.tpl @@ -83,7 +83,7 @@

- {l s='Get a discount of %d for you and your friends by recommending this Website.' sprintf=$discount mod='referralprogram'} + {l s='Get a discount of %1$d %2$s for you and your friends by recommending this Website.' sprintf=[$discount,$currencySign] mod='referralprogram'}

{if $canSendInvitations}

@@ -93,7 +93,7 @@ {else} {l s='When one of them makes at least %d order' sprintf=$orderQuantity mod='referralprogram'} {/if}, - {l s='he or she will receive a %1$d voucher and you will receive your own voucher worth %2$d.' sprintf=[$discount,$discount] mod='referralprogram'} + {l s='he or she will receive a %1$d %2$s voucher and you will receive your own voucher worth %3$d %4$s.' sprintf=[$discount,$currencySign,$discount,$currencySign] mod='referralprogram'}

@@ -125,7 +125,7 @@ {l s='Read conditions.' mod='referralprogram'}

- {l s='Preview' mod='referralprogram'} + {l s='Preview' mod='referralprogram'} {assign var="file" value="{$lang_iso}/referralprogram-invitation.html"} {l s='the default e-mail' mod='referralprogram'} {l s='that will be sent to your friend(s).' mod='referralprogram'}

From 783b02b34fb465c0de5ac27e6ddc7ad8e53b5052 Mon Sep 17 00:00:00 2001 From: jeckyl Date: Tue, 18 Jun 2013 14:56:55 +0200 Subject: [PATCH 022/644] Update admin.css force size for module logo to keep a good design structure --- css/admin.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/css/admin.css b/css/admin.css index f5201ec60..ee879bc8d 100644 --- a/css/admin.css +++ b/css/admin.css @@ -332,6 +332,8 @@ select optgroup option { .lab_modules_positions img { float:left; + width:32px; + height:32px; } From dc133e3e410665eba19027b318405be62ba6e8e1 Mon Sep 17 00:00:00 2001 From: fram Date: Thu, 20 Jun 2013 18:33:27 +0200 Subject: [PATCH 023/644] [*] LO : Fixed units in Belgium localization pack --- localization/be.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/be.xml b/localization/be.xml index bbdd774de..90aa1a072 100644 --- a/localization/be.xml +++ b/localization/be.xml @@ -166,8 +166,8 @@ - - - + + + From f4a5dd1409f49ca7a8e0aa6f74fc888cfaf27a3a Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Fri, 21 Jun 2013 23:02:51 +0300 Subject: [PATCH 024/644] [*] BO: more than one image in HelperForm --- admin-dev/themes/default/template/helpers/form/form.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 96d43a781..90b2622b0 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -234,10 +234,10 @@ {/foreach} {elseif $input.type == 'file'} {if isset($input.display_image) && $input.display_image} - {if isset($fields_value.image) && $fields_value.image} + {if isset($fields_value[$input.name].image) && $fields_value[$input.name].image}
- {$fields_value.image} -

{l s='File size'} {$fields_value.size}kb

+ {$fields_value[$input.name].image} +

{l s='File size'} {$fields_value[$input.name].size}kb

{l s='Delete'} {l s='Delete'} From 9b16761a6876a17247b706f1a021f827b7877278 Mon Sep 17 00:00:00 2001 From: djfm Date: Tue, 25 Jun 2013 08:37:54 +0000 Subject: [PATCH 025/644] [*] LO : corrected Israel standard tax rate --- localization/il.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localization/il.xml b/localization/il.xml index 37965a4f6..bb9c5473c 100644 --- a/localization/il.xml +++ b/localization/il.xml @@ -8,9 +8,9 @@ - + - + From a617bec39bc8e30166a7bafa00fdd94ef9091806 Mon Sep 17 00:00:00 2001 From: ldecoker Date: Fri, 28 Jun 2013 16:46:12 +0200 Subject: [PATCH 026/644] Update shopping-cart.tpl To access template "shopping-cart-product-line.tpl", it should use the $tpl_dir variable. --- themes/default/shopping-cart.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/default/shopping-cart.tpl b/themes/default/shopping-cart.tpl index 8b486c2de..c1c2f6675 100644 --- a/themes/default/shopping-cart.tpl +++ b/themes/default/shopping-cart.tpl @@ -226,7 +226,7 @@ {assign var='odd' value=$product@iteration%2} {assign var='ignoreProductLast' value=isset($customizedDatas.$productId.$productAttributeId) || count($gift_products)} {* Display the product line *} - {include file="./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} + {include file="$tpl_dir./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} {* Then the customized datas ones*} {if isset($customizedDatas.$productId.$productAttributeId)} {foreach $customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] as $id_customization=>$customization} @@ -292,7 +292,7 @@ {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.quantity} {/foreach} {* If it exists also some uncustomized products *} - {if $product.quantity-$quantityDisplayed > 0}{include file="./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first}{/if} + {if $product.quantity-$quantityDisplayed > 0}{include file="$tpl_dir./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first}{/if} {/if} {/foreach} {assign var='last_was_odd' value=$product@iteration%2} @@ -304,7 +304,7 @@ {assign var='ignoreProductLast' value=isset($customizedDatas.$productId.$productAttributeId)} {assign var='cannotModify' value=1} {* Display the gift product line *} - {include file="./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} + {include file="$tpl_dir./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} {/foreach} {if sizeof($discounts)} From 679ee351dfd7dd2fd594188519afcadece71d66e Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Sat, 29 Jun 2013 16:28:03 +0200 Subject: [PATCH 027/644] [-] BO: remove old icon into New Version block --- css/admin.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/css/admin.css b/css/admin.css index f5201ec60..69431a489 100644 --- a/css/admin.css +++ b/css/admin.css @@ -567,6 +567,12 @@ select optgroup option { background: url(../img/admin/warning.gif) no-repeat 0 0; } +#blockNewVersionCheck .warn h3 { + padding: 0 0 0 5px; + margin: 0px; + background: none; +} + #content .error h3 { padding: 0 0 0 20px; background: url(../img/admin/warning.gif) no-repeat 0 0; From 7c2323f1cc1d51a2f22a4d6a1156f942bfa82367 Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 1 Jul 2013 10:56:31 +0200 Subject: [PATCH 028/644] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index beb165d67..3aad8f041 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ .DS_Store robots.txt sitemap.xml +cache/cachefs/* +!cache/cachefs/index.php cache/smarty/cache/* !cache/smarty/cache/index.php cache/smarty/compile/* From 0d7af596572bf0c595a8ecb71a69056f5f422f0a Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 1 Jul 2013 10:58:54 +0200 Subject: [PATCH 029/644] Update .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3aad8f041..beb165d67 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,6 @@ .DS_Store robots.txt sitemap.xml -cache/cachefs/* -!cache/cachefs/index.php cache/smarty/cache/* !cache/smarty/cache/index.php cache/smarty/compile/* From 86bdcd99e9ba441618bb7b11e46c3ba800a38e72 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Tue, 2 Jul 2013 17:08:49 +0200 Subject: [PATCH 030/644] [-] FO: OrderHistory - Unclosed tag --- 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 b12bcd91a..ba1ba9bd7 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -142,7 +142,7 @@ class OrderHistoryCore extends ObjectModel $links .= ' '.Tools::htmlentitiesUTF8(sprintf(Tools::displayError('downloadable %d time(s)'), (int)$product['downloadable'])); $links .= ''; } - $links .= '
    '; + $links .= '
'; $data = array( '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, From 1208e45958b8b80617dc6f06045b24561845dde4 Mon Sep 17 00:00:00 2001 From: indesign47 Date: Wed, 3 Jul 2013 14:09:44 +0200 Subject: [PATCH 031/644] [-] BO : products comments impossible if quantity > 0 The pull request https://github.com/PrestaShop/PrestaShop/pull/219 makes the module not working properly in v1.5.4.1. Indeed, after this change, the OosHook works as expected but now, as the product comments module is attached to the OosHook, comments information is only shown when the product is out of stock! --- modules/productcomments/productcomments-extra.tpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/productcomments/productcomments-extra.tpl b/modules/productcomments/productcomments-extra.tpl index 930a806b6..d9547f8bf 100644 --- a/modules/productcomments/productcomments-extra.tpl +++ b/modules/productcomments/productcomments-extra.tpl @@ -35,6 +35,8 @@ $(function(){ }); +{if $logged == 1 || $nbComments != 0} +
{if $nbComments != 0}
@@ -60,4 +62,6 @@ $(function(){ {/if}
+
+{/if} From 3166573aa958afce1151e0988535e5fff3a97f2e Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Sat, 6 Jul 2013 13:50:38 +0200 Subject: [PATCH 032/644] [-] Class: PaymentModule / Be sure to have the right "TaxCalculationMethod" --- classes/PaymentModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 561881c55..acd3c1936 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -386,7 +386,7 @@ abstract class PaymentModuleCore extends Module '
- + '; From 32a83e20c4e05b0a0498eb862d0fd82606d2b4a9 Mon Sep 17 00:00:00 2001 From: Agence CINS Date: Tue, 9 Jul 2013 17:09:19 +0200 Subject: [PATCH 033/644] [+] BO: Fix Bug Progress Bar Upload Image Product MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lorsque l'on ajoute des images a des produits, la barre de progression s'affiche en dehors de son cadre. "position:relative" n'est pas présent pour "div.progressBarImage" dans le fichier admin.css . ---- When we add pictures to products, the progress bar is out of his wrapper. "position:relative" is missing for "div.progressBarImage" in admin.css file. --- css/admin.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/admin.css b/css/admin.css index f5201ec60..d3fdd3bc3 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1872,6 +1872,7 @@ div.progressBarImage height: 15px; margin-left: 3px; width: 233px; + position:relative; } #showCounter { From 291cec36abfda5141f92653619ed8eec4234bf7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mo=C4=87ko?= Date: Thu, 11 Jul 2013 18:49:44 +0200 Subject: [PATCH 034/644] Do not limit features value on a list Controller use default method getList with pagination of 50 items. Argument $limit should be set to FALSE to disable limit, because if you have more than 50 values of one feature, then you can not access them in back office. --- controllers/admin/AdminFeaturesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index 8045e2c56..f63ceb83a 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -455,7 +455,7 @@ class AdminFeaturesControllerCore extends AdminController * AdminController::getList() override * @see AdminController::getList() */ - public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) + public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = false, $id_lang_shop = false) { if ($this->table == 'feature_value') $this->_where .= ' AND a.custom = 0'; From 68d135b4cf51d76f2c98c10f104f8d2e3148c701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mo=C4=87ko?= Date: Thu, 11 Jul 2013 18:56:50 +0200 Subject: [PATCH 035/644] Payment currency restriction incorret type of input for radio When payment module has currencies restrictions set to radio it still displays as checkbox because in TPL file type of input is not being changed --- .../default/template/controllers/payment/restrictions.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/payment/restrictions.tpl b/admin-dev/themes/default/template/controllers/payment/restrictions.tpl index 9cfb18625..9b7f1fb49 100644 --- a/admin-dev/themes/default/template/controllers/payment/restrictions.tpl +++ b/admin-dev/themes/default/template/controllers/payment/restrictions.tpl @@ -64,7 +64,7 @@ {$type = 'checkbox'} {/if} {if $type != 'null'} - + {else} -- {/if} @@ -94,4 +94,4 @@
'.$product['reference'].' '.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').''.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).''.Tools::displayPrice(Product::getTaxCalculationMethod((int)$this->context->customer->id) == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).' '.((int)$product['cart_quantity'] - $customization_quantity).' '.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'
-
\ No newline at end of file + From 876c49b6906afc611002a42516ed58e65c022751 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 12 Jul 2013 18:24:18 +0800 Subject: [PATCH 036/644] PNM-1241 Issue with backbutton This will solve the issue with url indexing not working for all languages. --- modules/blocklayered/blocklayered.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index 47ed3bb19..ffdade6d6 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -445,7 +445,10 @@ class BlockLayered extends Module static $_MODULES = array(); global $_MODULE; - $file = _PS_MODULE_DIR_.$this->name.'/'.Language::getIsoById($id_lang).'.php'; + if (version_compare(_PS_VERSION_,'1.5','>')) + $file = _PS_MODULE_DIR_.$this->name.'/translations/'.Language::getIsoById($id_lang).'.php'; + else + $file = _PS_MODULE_DIR_.$this->name.'/'.Language::getIsoById($id_lang).'.php'; if (!array_key_exists($id_lang, $_MODULES)) { From 9fec968488ca4ab08082af3cb340415dcf9add0f Mon Sep 17 00:00:00 2001 From: Sylvain WITMEYER Date: Fri, 12 Jul 2013 15:17:09 +0200 Subject: [PATCH 037/644] Update Translate.php Translations shouldn't be cached if they contain dynamic vars (sprintf) On productcomments,
  • {l s='%1$d out of %2$d people found this review useful.' sprintf=[$comment.total_useful, $comment.total_advice] mod='productcomments'}
  • was always printing the same sentence --- classes/Translate.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/classes/Translate.php b/classes/Translate.php index 549158861..bbf4a5bdd 100644 --- a/classes/Translate.php +++ b/classes/Translate.php @@ -180,7 +180,13 @@ class TranslateCore if ($js) $ret = addslashes($ret); - $lang_cache[$cache_key] = str_replace('"', '"', $ret); + $ret = str_replace('"', '"', $ret); + + if ($sprintf === null) + $lang_cache[$cache_key] = $ret; + else + return $ret; + } return $lang_cache[$cache_key]; } From 795976cadb7a20fbbde8725bbf84a74f98ae75da Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Sun, 14 Jul 2013 14:59:25 +0200 Subject: [PATCH 038/644] [*] FO: display Error500 if no database access Sometimes, we have some problems with the MySQL Database and a Fatal Error is done. With this, we show the error500 template. --- config/config.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/config.inc.php b/config/config.inc.php index 637089c22..21fb9b780 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -90,7 +90,21 @@ if (!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST'])) $context = Context::getContext(); /* Initialize the current Shop */ -$context->shop = Shop::initialize(); +try +{ + $context->shop = Shop::initialize(); +} +catch(Exception $e) +{ + header('HTTP/1.1 503 temporarily overloaded'); + + define('_PS_SMARTY_DIR_', _PS_TOOL_DIR_.'smarty/'); + require_once(_PS_SMARTY_DIR_.'Smarty.class.php'); + $context->smarty = new Smarty(); + $context->smarty->display('error500.html'); + + exit; +} define('_THEME_NAME_', $context->shop->getTheme()); define('__PS_BASE_URI__', $context->shop->getBaseURI()); From 6ea4a2c5531f8c42b0feb93be4f6fbf026ea54ec Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 10:08:16 +0200 Subject: [PATCH 039/644] [-] FO : Fix bug #PSCFV-9662 udpate payments means after delete thanks @maofree --- themes/default/js/cart-summary.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/default/js/cart-summary.js b/themes/default/js/cart-summary.js index 8c43483c9..218faf25a 100644 --- a/themes/default/js/cart-summary.js +++ b/themes/default/js/cart-summary.js @@ -377,6 +377,8 @@ function deleteProductFromSummary(id) updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); if (typeof(getCarrierListAndUpdate) !== 'undefined' && jsonData.summary.products.length > 0) getCarrierListAndUpdate(); + if (typeof(updatePaymentMethodsDisplay) !== 'undefined') + updatePaymentMethodsDisplay(); } }, error: function(XMLHttpRequest, textStatus, errorThrown) { From cf7f72fc30704197292df29f5385b4a22e1d7f74 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 10:11:27 +0200 Subject: [PATCH 040/644] // Fixed AdminMarketing position in upgrade --- install-dev/upgrade/sql/1.5.5.0.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install-dev/upgrade/sql/1.5.5.0.sql b/install-dev/upgrade/sql/1.5.5.0.sql index d901a9386..fe1c1da49 100644 --- a/install-dev/upgrade/sql/1.5.5.0.sql +++ b/install-dev/upgrade/sql/1.5.5.0.sql @@ -20,4 +20,8 @@ CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL; /* PHP:add_module_to_hook(blockmyaccount, actionModuleUnRegisterHookAfter); */; /* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleUnRegisterHookAfter); */; -ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_id`; \ No newline at end of file +ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_id`; + +@id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); +UPDATE `PREFIX_tab` SET id_parent = @id_parent WHERE `id_parent` = 1 AND `class_name` = 'AdminMarketing' LIMIT 1; + From db7f0da74615718e754141ba2d323902200c4c5d Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 10:48:48 +0200 Subject: [PATCH 041/644] // Improved display in pscleaner --- modules/pscleaner/pscleaner.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index 35e6f62de..67ea6595c 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -49,7 +49,19 @@ class PSCleaner extends Module { $html = '

    '.$this->l('Be really careful with this tool - There is no possible rollback!').'

    '; if (Tools::isSubmit('submitCheckAndFix')) - $html .= $this->displayConfirmation((count($logs = self::checkAndFix()) ? '
    '.print_r($logs, true).'
    ' : $this->l('Nothing that need to be cleaned')).'

    '); + { + $logs = self::checkAndFix(); + if (count($logs)) + { + $conf = $this->l('The following queries successfuly fixed broken data:').'
      '; + foreach ($logs as $query => $entries) + $conf .= '
    • '.Tools::htmlentitiesUTF8($query).'
      '.sprintf($this->l('%d line(s)'), $entries).'
    • '; + $conf .= '
    '; + } + else + $conf = $this->l('Nothing that need to be cleaned'); + $html .= $this->displayConfirmation($conf); + } if (Tools::isSubmit('submitTruncateCatalog')) { self::truncate('catalog'); @@ -330,7 +342,7 @@ class PSCleaner extends Module if ($affected_rows = $db->Affected_Rows()) $logs[$query] = $affected_rows; } - + Category::regenerateEntireNtree(); // @Todo: Remove attachment files, images... @@ -522,8 +534,6 @@ class PSCleaner extends Module protected function clearAllCaches() { - $this->_clearCache('blockcategories.tpl'); - $this->_clearCache('blockcategories_footer.tpl'); - $this->_clearCache('blocktopmenu.tpl'); + Context::getContext()->smarty->clearAllCache(); } } From ee1187d8215188dd25e365613088113b7e2a455f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 15 Jul 2013 11:00:35 +0200 Subject: [PATCH 042/644] [-] BO: Delete specific price after combination deletion && fix SpecificPrice::getByProductId() sql query --- classes/Combination.php | 9 ++++++++- classes/SpecificPrice.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/classes/Combination.php b/classes/Combination.php index 27148b7b3..47b8e2eca 100644 --- a/classes/Combination.php +++ b/classes/Combination.php @@ -102,7 +102,14 @@ class CombinationCore extends ObjectModel // Removes the product from StockAvailable, for the current shop StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id); - + + if ($specific_prices = SpecificPrice::getByProductId((int)$this->id_product, (int)$this->id)) + foreach ($specific_prices as $specific_price) + { + $price = new SpecificPrice((int)$specific_price['id_specific_price']); + $price->delete(); + } + if (!$this->hasMultishopEntries() && !$this->deleteAssociations()) return false; return true; diff --git a/classes/SpecificPrice.php b/classes/SpecificPrice.php index f47f1a5c4..27475c771 100644 --- a/classes/SpecificPrice.php +++ b/classes/SpecificPrice.php @@ -135,7 +135,7 @@ class SpecificPriceCore extends ObjectModel SELECT * FROM `'._DB_PREFIX_.'specific_price` WHERE `id_product` = '.(int)$id_product. - ($id_product_attribute ? 'AND id_product_attribute = '.(int)$id_product_attribute : '').' + ($id_product_attribute ? ' AND id_product_attribute = '.(int)$id_product_attribute : '').' AND id_cart = '.(int)$id_cart); } From e30e15d76d405be7d87069be2cd16e35eb006a05 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 12:29:51 +0200 Subject: [PATCH 043/644] [-] INSTALER: Fix bug #PSCFV-9762 marketing tab disapear after upgrade --- install-dev/upgrade/php/add_new_tab.php | 7 ++++++- install-dev/upgrade/sql/1.5.4.0.sql | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/install-dev/upgrade/php/add_new_tab.php b/install-dev/upgrade/php/add_new_tab.php index 009244a3e..246bb0ac7 100644 --- a/install-dev/upgrade/php/add_new_tab.php +++ b/install-dev/upgrade/php/add_new_tab.php @@ -24,8 +24,13 @@ * International Registered Trademark & Property of PrestaShop SA */ -function add_new_tab($className, $name, $id_parent, $returnId = false) +function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab) { + if (isset($parentTab) && !empty($parentTab) && (is_null($id_parent) || empty($id_parent))) + $id_parent = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($parentTab).'\''); + if (!$id_parent) + return false; + $array = array(); foreach (explode('|', $name) AS $item) { diff --git a/install-dev/upgrade/sql/1.5.4.0.sql b/install-dev/upgrade/sql/1.5.4.0.sql index 75da0cf64..9f486c66c 100644 --- a/install-dev/upgrade/sql/1.5.4.0.sql +++ b/install-dev/upgrade/sql/1.5.4.0.sql @@ -31,7 +31,7 @@ CREATE TABLE `PREFIX_tab_module_preference` ( UNIQUE KEY `employee_module` (`id_employee`, `id_tab`, `module`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; -/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 1); */; +/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 0, false, AdminPriceRule); */; /* PHP:p1540_add_missing_columns(); */; From f1dcf02caf601fe4be4a98bc5cf4043fae05ddb5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 14:25:58 +0200 Subject: [PATCH 044/644] //fix warnings #PSCFV-9786 --- controllers/front/IdentityController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index 048a1d07a..7f0eb50b4 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -57,13 +57,14 @@ class IdentityControllerCore extends FrontController { $email = trim(Tools::getValue('email')); $this->customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); - $_POST['old_passwd'] = trim($_POST['old_passwd']); + if (isset($_POST['old_passwd'])) + $_POST['old_passwd'] = trim($_POST['old_passwd']); if (!Validate::isEmail($email)) $this->errors[] = Tools::displayError('This email address is not valid'); elseif ($this->customer->email != $email && Customer::customerExists($email, true)) $this->errors[] = Tools::displayError('An account using this email address has already been registered.'); - elseif (empty($_POST['old_passwd']) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd)) + elseif ((!isset($_POST['old_passwd']) || empty($_POST['old_passwd'])) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd)) $this->errors[] = Tools::displayError('The password you entered is incorrect.'); elseif ($_POST['passwd'] != $_POST['confirmation']) $this->errors[] = Tools::displayError('The password and confirmation do not match.'); From 1a056d5e339c1b228f23022da0f07ff29cfa3703 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 14:47:38 +0200 Subject: [PATCH 045/644] =?UTF-8?q?[-]=20BO=20:=20Fix=20bug=20#PSCFV-9310?= =?UTF-8?q?=20bad=20type=20for=20input=20in=20helper=20thankx=20@Piotr=20M?= =?UTF-8?q?o=C4=87ko?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/template/controllers/payment/restrictions.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/payment/restrictions.tpl b/admin-dev/themes/default/template/controllers/payment/restrictions.tpl index 9cfb18625..80e705eb4 100644 --- a/admin-dev/themes/default/template/controllers/payment/restrictions.tpl +++ b/admin-dev/themes/default/template/controllers/payment/restrictions.tpl @@ -64,7 +64,7 @@ {$type = 'checkbox'} {/if} {if $type != 'null'} - + {else} -- {/if} From ca4a73ddf47bd75b2e05b8464b681e0f80f4ec1c Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 15:34:34 +0200 Subject: [PATCH 046/644] // avoid copy paste mistake with trailing space --- controllers/front/PasswordController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/PasswordController.php b/controllers/front/PasswordController.php index 1a7959887..e36d84a9a 100644 --- a/controllers/front/PasswordController.php +++ b/controllers/front/PasswordController.php @@ -36,7 +36,7 @@ class PasswordControllerCore extends FrontController { if (Tools::isSubmit('email')) { - if (!($email = Tools::getValue('email')) || !Validate::isEmail($email)) + if (!($email = trim(Tools::getValue('email'))) || !Validate::isEmail($email)) $this->errors[] = Tools::displayError('Invalid email address.'); else { From 4b8a756add8307feed966ba2d63dbb7596ce7a7b Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Mon, 15 Jul 2013 16:34:51 +0200 Subject: [PATCH 047/644] [-] Class: Media / Correct jquery_ui_dependencies fileName Even if not used... --- classes/Media.php | 57 ++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/classes/Media.php b/classes/Media.php index a769218e2..baab74b52 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -30,36 +30,37 @@ class MediaCore 'ui.core' => array('fileName' => 'jquery.ui.core.min.js', 'dependencies' => array(), 'theme' => true), 'ui.widget' => array('fileName' => 'jquery.ui.widget.min.js', 'dependencies' => array(), 'theme' => false), 'ui.mouse' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => false), - 'ui.position' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), - 'ui.draggable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => false), - 'ui.droppable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse', 'ui.draggable'), 'theme' => false), - 'ui.resizable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.selectable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.sortable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.accordion' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.autocomplete' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), - 'ui.button' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.dialog' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), - 'ui.slider' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.tabs' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.datepicker' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core'), 'theme' => true), - 'ui.progressbar' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'effects.core' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), - 'effects.blind' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.bounce' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.clip' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.drop' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.explode' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.fade' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.fold' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.highlight' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.pulsate' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.scale' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.shake' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.slide' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.transfer' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false) + 'ui.position' => array('fileName' => 'jquery.ui.position.min.js', 'dependencies' => array(), 'theme' => false), + 'ui.draggable' => array('fileName' => 'jquery.ui.draggable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => false), + 'ui.droppable' => array('fileName' => 'jquery.ui.droppable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse', 'ui.draggable'), 'theme' => false), + 'ui.resizable' => array('fileName' => 'jquery.ui.resizable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.selectable' => array('fileName' => 'jquery.ui.selectable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.sortable' => array('fileName' => 'jquery.ui.sortable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.accordion' => array('fileName' => 'jquery.ui.accordion.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.autocomplete' => array('fileName' => 'jquery.ui.autocomplete.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.button' => array('fileName' => 'jquery.ui.button.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.slider' => array('fileName' => 'jquery.ui.slider.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true), + 'ui.progressbar' => array('fileName' => 'jquery.ui.progressbar.min.js', 'dependencies' => array('ui.core', 'ui.widget'), '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), + 'effects.clip' => array('fileName' => 'jquery.effects.clip.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.drop' => array('fileName' => 'jquery.effects.drop.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.explode' => array('fileName' => 'jquery.effects.explode.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.fade' => array('fileName' => 'jquery.effects.fade.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.fold' => array('fileName' => 'jquery.effects.fold.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.highlight' => array('fileName' => 'jquery.effects.highlight.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.pulsate' => array('fileName' => 'jquery.effects.pulsate.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.scale' => array('fileName' => 'jquery.effects.scale.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.shake' => array('fileName' => 'jquery.effects.shake.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.slide' => array('fileName' => 'jquery.effects.slide.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.transfer' => array('fileName' => 'jquery.effects.transfer.min.js', 'dependencies' => array('effects.core'), 'theme' => false) ); + public static function minifyHTML($html_content) { if (strlen($html_content) > 0) From 01bad90b29a87039c618ae9ba704c41dfb58d36f Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 16:36:54 +0200 Subject: [PATCH 048/644] // Welcome 2013 --- classes/Media.php | 4 ++-- docs/CHANGELOG.txt | 6 +++--- install-dev/langs/pl/img/index.php | 4 ++-- install-dev/langs/pl/index.php | 4 ++-- install-dev/langs/ru/img/index.php | 4 ++-- install-dev/langs/ru/index.php | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/classes/Media.php b/classes/Media.php index a769218e2..317f3872c 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -1,6 +1,6 @@ -@copyright 2007-2012 PrestaShop SA +@copyright 2007-2013 PrestaShop SA @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) International Registred Trademark & Property of PrestaShop SA @@ -7578,4 +7578,4 @@ Release Notes for PrestaShop 1.5 [+] SQL : add the replication SQL -Release Notes for PrestaShop 1.3 +Release Notes for PrestaShop 1.3 \ No newline at end of file diff --git a/install-dev/langs/pl/img/index.php b/install-dev/langs/pl/img/index.php index f9382edba..5ddf5bce0 100644 --- a/install-dev/langs/pl/img/index.php +++ b/install-dev/langs/pl/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/install-dev/langs/pl/index.php b/install-dev/langs/pl/index.php index 04675e9e1..8fdf0d3e3 100644 --- a/install-dev/langs/pl/index.php +++ b/install-dev/langs/pl/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/install-dev/langs/ru/img/index.php b/install-dev/langs/ru/img/index.php index f9382edba..5ddf5bce0 100644 --- a/install-dev/langs/ru/img/index.php +++ b/install-dev/langs/ru/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/install-dev/langs/ru/index.php b/install-dev/langs/ru/index.php index 04675e9e1..8fdf0d3e3 100644 --- a/install-dev/langs/ru/index.php +++ b/install-dev/langs/ru/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ From f9c5bf0bf278b30c4564fa495fb5c6f1131f66e5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 17:29:08 +0200 Subject: [PATCH 049/644] [-] Fix bug #PSCFV-9633 again could not see delete href in block cart --- modules/blockcart/ajax-cart.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index ba49d6c75..3c2658756 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -348,13 +348,12 @@ var ajaxCart = { }); }); } - var removeLinks = $('#cart_block_product_' + domIdProduct).find('.ajax_cart_block_remove_link'); + + var removeLinks = $('#' + domIdProduct).find('.ajax_cart_block_remove_link'); if (!product.hasCustomizedDatas && !removeLinks.length) - { - $('#cart_block_product_' + domIdProduct + ' span.remove_link').html(' '); - } + $('#' + domIdProduct + ' span.remove_link').html(' '); if (product.is_gift) - $('#cart_block_product_' + domIdProduct + ' span.remove_link').html(''); + $('#' + domIdProduct + ' span.remove_link').html(''); }, doesCustomizationStillExist : function (product, customizationId) @@ -448,7 +447,7 @@ var ajaxCart = { var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name); content += '' + name + ''; - if (this.is_gift != undefined && this.is_gift == 1) + if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0) content += ' '; else content += ''; From c253a8edf4216ba56708c3370bc361b7a9c27a96 Mon Sep 17 00:00:00 2001 From: soware Date: Mon, 15 Jul 2013 12:45:00 -0300 Subject: [PATCH 050/644] Update AdminStockManagementController.php Hi, I altered these values to make default on the radio button. I think is better because is a value more frequent in stock management form. --- controllers/admin/AdminStockManagementController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index cb14e032d..22319e557 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -1060,8 +1060,8 @@ class AdminStockManagementControllerCore extends AdminController { $helper->fields_value['id_warehouse_from'] = Tools::getValue('id_warehouse_from', ''); $helper->fields_value['id_warehouse_to'] = Tools::getValue('id_warehouse_to', ''); - $helper->fields_value['usable_from'] = Tools::getValue('usable_from', ''); - $helper->fields_value['usable_to'] = Tools::getValue('usable_to', ''); + $helper->fields_value['usable_from'] = Tools::getValue('usable_from', '1'); + $helper->fields_value['usable_to'] = Tools::getValue('usable_to', '1'); } $this->content .= $helper->generateForm($this->fields_form); From a3039024e7d30ea5196c9450470ff526ae3b7d75 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 18:07:33 +0200 Subject: [PATCH 051/644] // Code cleaning --- controllers/admin/AdminProductsController.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index f9d9a803a..9958f4234 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -160,7 +160,11 @@ class AdminProductsControllerCore extends AdminController if (Validate::isLoadedObject($this->_category) && empty($this->_filter)) $join_category = true; - $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').')'; + $this->_join .= ' + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').') + LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0 + '.StockAvailable::addSqlShopRestriction(null, null, 'sav').') '; + if (Shop::isFeatureActive()) { $alias = 'sa'; @@ -188,12 +192,13 @@ class AdminProductsControllerCore extends AdminController $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)'; } - $this->_select .= 'MAX('.$alias_image.'.id_image) id_image,'; + $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; - $this->_join .= ($join_category ? 'INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.')' : '').' - LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0 - '.StockAvailable::addSqlShopRestriction(null, null, 'sav').') '; - $this->_select .= 'cl.name `name_category` '.($join_category ? ', cp.`position`' : '').', '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; + if ($join_category) + { + $this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') '; + $this->_select .= ' cp.`position`, '; + } $this->_group = 'GROUP BY '.$alias.'.id_product'; From d9c2ec37d43f28aab2ff9a31a6f85e153532dbf5 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 18:13:07 +0200 Subject: [PATCH 052/644] // Code cleaning --- controllers/admin/AdminProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9958f4234..a221df3fb 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -275,7 +275,7 @@ class AdminProductsControllerCore extends AdminController 'orderby' => false ); - if ((int)$this->id_current_category) + if ($join_category && (int)$this->id_current_category) $this->fields_list['position'] = array( 'title' => $this->l('Position'), 'width' => 70, From b67ffb1a50138336f57fd5987df4feb29360bade Mon Sep 17 00:00:00 2001 From: Fabio Chelly Date: Mon, 15 Jul 2013 19:36:32 +0200 Subject: [PATCH 053/644] [-] MO loyalty : categories are now taken into account when creating discount vouchers #PNM-1492 #PNM-1191 #PNM-1223 --- modules/loyalty/controllers/front/default.php | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/modules/loyalty/controllers/front/default.php b/modules/loyalty/controllers/front/default.php index 9195706c4..64e152db0 100644 --- a/modules/loyalty/controllers/front/default.php +++ b/modules/loyalty/controllers/front/default.php @@ -106,10 +106,39 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController $cart_rule->name[(int)$language['id_lang']] = $text ? strval($text) : strval($default_text); } - if (is_array($categories) && count($categories)) - $cart_rule->add(true, false, $categories); - else - $cart_rule->add(); + + $contains_categories = is_array($categories) && count($categories); + if ($contains_categories) + $cart_rule->product_restriction = 1; + $cart_rule->add(); + + //Restrict cartRules with categories + if ($contains_categories) + { + + //Creating rule group + $id_cart_rule = (int)$cart_rule->id; + $sql = "INSERT INTO "._DB_PREFIX_."cart_rule_product_rule_group (id_cart_rule, quantity) VALUES ('$id_cart_rule', 1)"; + Db::getInstance()->execute($sql); + $id_group = (int)Db::getInstance()->Insert_ID(); + + //Creating product rule + $sql = "INSERT INTO "._DB_PREFIX_."cart_rule_product_rule (id_product_rule_group, type) VALUES ('$id_group', 'categories')"; + Db::getInstance()->execute($sql); + $id_product_rule = (int)Db::getInstance()->Insert_ID(); + + //Creating restrictions + $values = array(); + foreach ($categories as $category) { + $category = (int)$category; + $values[] = "('$id_product_rule', '$category')"; + } + $values = implode(',', $values); + $sql = "INSERT INTO "._DB_PREFIX_."cart_rule_product_rule_value (id_product_rule, id_item) VALUES $values"; + Db::getInstance()->execute($sql); + } + + // Register order(s) which contributed to create this voucher if (!LoyaltyModule::registerDiscount($cart_rule)) From e48b2a411ea882eefcbbd4e871862b82e669eecf Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 22:01:41 +0200 Subject: [PATCH 054/644] [-] INSTALLER : Errors in upgrader --- install-dev/upgrade/php/add_new_tab.php | 6 ++---- install-dev/upgrade/sql/1.5.5.0.sql | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/install-dev/upgrade/php/add_new_tab.php b/install-dev/upgrade/php/add_new_tab.php index 246bb0ac7..602b2477a 100644 --- a/install-dev/upgrade/php/add_new_tab.php +++ b/install-dev/upgrade/php/add_new_tab.php @@ -24,12 +24,10 @@ * International Registered Trademark & Property of PrestaShop SA */ -function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab) +function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab = null) { - if (isset($parentTab) && !empty($parentTab) && (is_null($id_parent) || empty($id_parent))) + if (!is_null($parentTab) && !empty($parentTab)) $id_parent = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($parentTab).'\''); - if (!$id_parent) - return false; $array = array(); foreach (explode('|', $name) AS $item) diff --git a/install-dev/upgrade/sql/1.5.5.0.sql b/install-dev/upgrade/sql/1.5.5.0.sql index fe1c1da49..934492867 100644 --- a/install-dev/upgrade/sql/1.5.5.0.sql +++ b/install-dev/upgrade/sql/1.5.5.0.sql @@ -22,6 +22,5 @@ CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL; ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_id`; -@id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); +SET @id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); UPDATE `PREFIX_tab` SET id_parent = @id_parent WHERE `id_parent` = 1 AND `class_name` = 'AdminMarketing' LIMIT 1; - From 97b16d272614a59150f630a7ed6d34d3bfee162e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Tue, 16 Jul 2013 09:59:47 +0200 Subject: [PATCH 055/644] [-] BO : Fix Bug #PSCFV-9550 Bad URL redirection --- controllers/admin/AdminShopUrlController.php | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/controllers/admin/AdminShopUrlController.php b/controllers/admin/AdminShopUrlController.php index f7fd28c78..05d3ca9d1 100644 --- a/controllers/admin/AdminShopUrlController.php +++ b/controllers/admin/AdminShopUrlController.php @@ -394,6 +394,42 @@ class AdminShopUrlControllerCore extends AdminController if ($this->redirect_shop_url) $this->redirect_after = $object->getBaseURI().basename(_PS_ADMIN_DIR_).'/'.$this->context->link->getAdminLink('AdminShopUrl'); } + + /** + * @param string $token + * @param integer $id + * @param string $name + * @return mixed + */ + public function displayDeleteLink($token = null, $id, $name = null) + { + $tpl = $this->createTemplate('helpers/list/list_action_delete.tpl'); + + if (!array_key_exists('Delete', self::$cache_lang)) + self::$cache_lang['Delete'] = $this->l('Delete', 'Helper'); + + if (!array_key_exists('DeleteItem', self::$cache_lang)) + self::$cache_lang['DeleteItem'] = $this->l('Delete selected item?', 'Helper'); + + if (!array_key_exists('Name', self::$cache_lang)) + self::$cache_lang['Name'] = $this->l('Name:', 'Helper'); + + if (!is_null($name)) + $name = '\n\n'.self::$cache_lang['Name'].' '.$name; + + $data = array( + $this->identifier => $id, + 'href' => Tools::safeOutput(self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&id_shop='.$this->id_shop.'&token='.($token != null ? $token : $this->token)), + 'action' => self::$cache_lang['Delete'], + ); + + if ($this->specificConfirmDelete !== false) + $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name; + + $tpl->assign(array_merge($this->tpl_delete_link_vars, $data)); + + return $tpl->fetch(); + } } From 672f2d9dd1a1f2899ebd0c1e0c63e8954dfc827b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Tue, 16 Jul 2013 10:18:54 +0200 Subject: [PATCH 056/644] [-] BO : Fix bug #PSCFV-9395 Missing vertical separation between flags --- js/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/admin.js b/js/admin.js index d5ef76b71..eeb866364 100644 --- a/js/admin.js +++ b/js/admin.js @@ -211,7 +211,7 @@ function displayFlags(languages, defaultLanguageID, employee_cookie) $.each(languages, function(key, language) { var img = $('') .addClass('pointer') - .css('margin', '0 2px') + .css('margin', '2px 2px') .attr('src', '../img/l/' + language['id_lang'] + '.jpg') .attr('alt', language['name']) .click(function() { From 3d283000a05abcd2e16c05e1c21c079c3ba994b9 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Tue, 16 Jul 2013 10:27:39 +0200 Subject: [PATCH 057/644] // Fixed misplaced comma --- classes/controller/AdminController.php | 4 ++-- controllers/admin/AdminProductsController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index db328b8de..48366d2c4 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2204,9 +2204,9 @@ class AdminControllerCore extends Controller } else $this->_listsql .= ($this->lang ? 'b.*,' : '').' a.*'; - + $this->_listsql .= ' - '.(isset($this->_select) ? ', '.$this->_select : '').$select_shop.' + '.(isset($this->_select) ? ', '.rtrim($this->_select, ', ') : '').$select_shop.' FROM `'._DB_PREFIX_.$sql_table.'` a '.$lang_join.' '.(isset($this->_join) ? $this->_join.' ' : '').' diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index a221df3fb..9ca3c4fba 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -76,7 +76,7 @@ class AdminProductsControllerCore extends AdminController $this->allow_export = true; // @since 1.5 : translations for tabs - $this->available_tabs_lang = array ( + $this->available_tabs_lang = array( 'Informations' => $this->l('Information'), 'Pack' => $this->l('Pack'), 'VirtualProduct' => $this->l('Virtual Product'), @@ -192,7 +192,7 @@ class AdminProductsControllerCore extends AdminController $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)'; } - $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; + $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`, '; if ($join_category) { From d2ff50ddb7c98b831ec646ce90c0c15d2e3f23d2 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 16 Jul 2013 10:50:27 +0200 Subject: [PATCH 058/644] [*] CORE : Fix bug #PSCFV-9811 doc on display404Error --- classes/Tools.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/Tools.php b/classes/Tools.php index fab8c7385..558f13c52 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -2127,6 +2127,9 @@ exit; } } + /** + * @deprecated as of 1.5 use Controller::getController('PageNotFoundController')->run(); + */ public static function display404Error() { header('HTTP/1.1 404 Not Found'); From 8d39f3250650ca08e189572c404da7c19267e81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 16 Jul 2013 11:52:05 +0200 Subject: [PATCH 059/644] [-] BO: Fix tax rule edition - unique tax rule can't be edited --- classes/tax/TaxRulesGroup.php | 4 ++-- controllers/admin/AdminTaxRulesGroupController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index 02391e134..1ef0dac0f 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -113,11 +113,11 @@ class TaxRulesGroupCore extends ObjectModel ); } - public function hasUniqueTaxRuleForCountry($id_country, $id_state) + public function hasUniqueTaxRuleForCountry($id_country, $id_state, $id_tax_rule = false) { $rules = TaxRule::getTaxRulesByGroupId((int)Context::getContext()->language->id, (int)$this->id); foreach ($rules as $rule) - if ($rule['id_country'] == $id_country && $id_state == $rule['id_state'] && !$rule['behavior']) + if ($rule['id_country'] == $id_country && $id_state == $rule['id_state'] && !$rule['behavior'] && (int)$id_tax_rule != $rule['id_tax_rule']) return true; return false; diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index ac37c2d72..63772700d 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -404,7 +404,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController { foreach ($this->selected_states as $id_state) { - if ($tax_rules_group->hasUniqueTaxRuleForCountry($id_country, $id_state)) + if ($tax_rules_group->hasUniqueTaxRuleForCountry($id_country, $id_state, $id_rule)) { $this->errors[] = Tools::displayError('A tax rule already exists for this country/state with tax only behavior'); continue; From 82c7e3eeff78f01f05d897029730f045c7a943ae Mon Sep 17 00:00:00 2001 From: dreammeup Date: Tue, 16 Jul 2013 15:34:52 +0200 Subject: [PATCH 060/644] Correcting errors in order graph at admin home The SQL request was returning multiple lines for every days. This modification change the request to have one line for the 7 days of the week. So it corrects the number who was totally wrong. --- controllers/admin/AdminHomeController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminHomeController.php b/controllers/admin/AdminHomeController.php index 2e9059150..a85cb1cda 100644 --- a/controllers/admin/AdminHomeController.php +++ b/controllers/admin/AdminHomeController.php @@ -377,12 +377,13 @@ class AdminHomeControllerCore extends AdminController $chart = new Chart(); $chart->getCurve(1)->setType('bars'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT total_paid / conversion_rate as total_converted, left(invoice_date, 10) as invoice_date + SELECT SUM(total_paid / conversion_rate) as total_converted, left(invoice_date, 10) as invoice_date FROM '._DB_PREFIX_.'orders o WHERE valid = 1 AND total_paid > 0 AND invoice_date BETWEEN \''.date('Y-m-d', strtotime('-7 DAYS', time())).' 00:00:00\' AND \''.date('Y-m-d H:i:s').'\' - '.Shop::addSqlRestriction(Shop::SHARE_ORDER).' + '.Shop::addSqlRestriction(Shop::SHARE_ORDER).' + GROUP BY DATE(invoice_date) '); foreach ($result as $row) $chart->getCurve(1)->setPoint(strtotime($row['invoice_date'].' 02:00:00'), $row['total_converted']); From ae5b6b79ee14fd7043f8f2a38addf83cb139d753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Tue, 16 Jul 2013 17:42:38 +0200 Subject: [PATCH 061/644] [*] BO : #PSCFV-8498 You can now use 0% in groups category rules in order to not apply discount on this category --- classes/Product.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index 28189ded4..fbfc0d323 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2699,8 +2699,10 @@ class ProductCore extends ObjectModel // Group reduction if ($use_group_reduction) { - if ($reduction_from_category = (float)GroupReduction::getValueForProduct($id_product, $id_group)) - $price -= $price * $reduction_from_category; + $reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group); + + if (!empty($reduction_from_category)) + $price -= $price * (float)$reduction_from_category; else // apply group reduction if there is no group reduction for this category $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100); } From d66f407fcb6aaa3028e62cbfeb7d370ceee046fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Tue, 16 Jul 2013 18:28:11 +0200 Subject: [PATCH 062/644] [-] BO : Use only 0% reduction from category in group --- classes/Product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index fbfc0d323..d14d49294 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2700,8 +2700,8 @@ class ProductCore extends ObjectModel if ($use_group_reduction) { $reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group); - - if (!empty($reduction_from_category)) + + if (!empty($reduction_from_category) && (float)$reduction_from_category == 0) $price -= $price * (float)$reduction_from_category; else // apply group reduction if there is no group reduction for this category $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100); From ea89c2235dc0869c3b5d44e56ef0e806d02640ed Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 16 Jul 2013 19:01:05 +0200 Subject: [PATCH 063/644] [-] BO : Fix bug #PSCFV-9722, do not propose adding root categories in categories when there is only one shop --- controllers/admin/AdminCategoriesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 4d48eb608..46e80f515 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -231,7 +231,7 @@ class AdminCategoriesControllerCore extends AdminController { if (empty($this->display)) { - if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')) + if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops()) > 1) $this->toolbar_btn['new-url'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'root&token='.$this->token, 'desc' => $this->l('Add new root category') From 1199ad8cf2f4c5074a45d640e50d5f837b7408d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Wed, 17 Jul 2013 10:51:34 +0200 Subject: [PATCH 064/644] [-] BO : FixBug #PSCFV-6365 Missing message confirmation for Images modification in Preferences > Images --- controllers/admin/AdminImagesController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index 22694773d..8791cd27f 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -375,6 +375,7 @@ class AdminImagesControllerCore extends AdminController || !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY'))) $this->errors[] = Tools::displayError('Unknown error.'); else + $this->confirmations[] = $this->_conf[6]; return parent::postProcess(); } else From 899dc30097ef9bb6797b210de3d01e2d150c15c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gaillard?= Date: Wed, 17 Jul 2013 11:33:33 +0200 Subject: [PATCH 065/644] [-] Class : AdminController - Object id fixed --- classes/controller/AdminController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 48366d2c4..967e5a8bf 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -803,7 +803,7 @@ class AdminControllerCore extends Controller if (empty($this->redirect_after)) $this->redirect_after = self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$this->token; } - Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); + Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id); } else $this->errors[] = Tools::displayError('An error occurred while updating an object.'). @@ -3013,4 +3013,4 @@ class AdminControllerCore extends Controller return $return; } -} \ No newline at end of file +} From 1b9892b9444284c4c2ee3f67205631f74e4f73e9 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 17 Jul 2013 13:42:45 +0200 Subject: [PATCH 066/644] // removed deprecated message --- classes/db/DbPDO.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/classes/db/DbPDO.php b/classes/db/DbPDO.php index 2e267e0a4..ab5d1ede8 100644 --- a/classes/db/DbPDO.php +++ b/classes/db/DbPDO.php @@ -25,8 +25,6 @@ */ /** - * This class is currently only here for tests - * * @since 1.5.0 */ class DbPDOCore extends Db From 421c199e1f3d8eb41c77d17b387d0129730c1403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Wed, 17 Jul 2013 15:13:34 +0200 Subject: [PATCH 067/644] [-] BO : FixBug #PSCFV-8229 Default country value set to manufacturer country Default country value set to manufacturer country Click on manufacturer address line now redirect to manufacturer address edition --- controllers/admin/AdminManufacturersController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index b1e630bc1..0f23f90d3 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -511,7 +511,7 @@ class AdminManufacturersControllerCore extends AdminController $this->fields_value = array( 'name' => Manufacturer::getNameById($address->id_manufacturer), 'alias' => 'manufacturer', - 'id_country' => Configuration::get('PS_COUNTRY_DEFAULT') + 'id_country' => $address->id_country ); $this->initToolbar(); @@ -671,6 +671,8 @@ class AdminManufacturersControllerCore extends AdminController if (Tools::isSubmit('editaddresses')) $this->display = 'editaddresses'; + else if (Tools::isSubmit('updateaddress')) + $this->display = 'editaddresses'; else if (Tools::isSubmit('addaddress')) $this->display = 'addaddress'; else if (Tools::isSubmit('submitAddaddress')) From 6884d7c5de79e06d10c3ebb92014f01f112c402e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Wed, 17 Jul 2013 16:19:15 +0200 Subject: [PATCH 068/644] [-] BO : FixBug #PSCFV-8287 Breadcrumbs label was wrong --- controllers/admin/AdminProductsController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9ca3c4fba..7438eda6f 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2543,7 +2543,7 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['currentIndex'] = self::$currentIndex; $this->tpl_form_vars['display_multishop_checkboxes'] = (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP && $this->display == 'edit'); $this->fields_form = array(''); - $this->display = 'edit'; + $this->tpl_form_vars['token'] = $this->token; $this->tpl_form_vars['combinationImagesJs'] = $this->getCombinationImagesJs(); $this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'); @@ -2573,8 +2573,8 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['upload_max_filesize'] = $upload_max_filesize; $this->tpl_form_vars['country_display_tax_label'] = $this->context->country->display_tax_label; $this->tpl_form_vars['has_combinations'] = $this->object->hasAttributes(); - $this->product_exists_in_shop = true; + if ($this->display == 'edit' && Validate::isLoadedObject($product) && Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP && !$product->isAssociatedToShop($this->context->shop->id)) { $this->product_exists_in_shop = false; @@ -2602,12 +2602,14 @@ class AdminProductsControllerCore extends AdminController $this->initPack($this->object); $this->{'initForm'.$this->tab_display}($this->object); $this->tpl_form_vars['product'] = $this->object; + if ($this->ajax) if (!isset($this->tpl_form_vars['custom_form'])) throw new PrestaShopException('custom_form empty for action '.$this->tab_display); else return $this->tpl_form_vars['custom_form']; } + $parent = parent::renderForm(); $this->addJqueryPlugin(array('autocomplete', 'fancybox', 'typewatch')); return $parent; @@ -3490,7 +3492,7 @@ class AdminProductsControllerCore extends AdminController $data->assign('languages', $this->_languages); $data->assign('currency', $currency); $this->object = $product; - $this->display = 'edit'; + //$this->display = 'edit'; $data->assign('product_name_redirected', Product::getProductName((int)$product->id_product_redirected, null, (int)$this->context->language->id)); /* * Form for adding a virtual product like software, mp3, etc... From 458838e598927b585bb953273783c1c06c98d31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Wed, 17 Jul 2013 17:33:53 +0200 Subject: [PATCH 069/644] [-] BO : FixBug #PSCFV-9613 Fix product tax to be shop dependent --- classes/tax/TaxRulesGroup.php | 21 +++++++++++++------ controllers/admin/AdminProductsController.php | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index 1ef0dac0f..ea597bab7 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -53,13 +53,22 @@ class TaxRulesGroupCore extends ObjectModel protected static $_taxes = array(); - public static function getTaxRulesGroups($only_active = true) + public static function getTaxRulesGroups($only_active = true, $multiShop = false) { - return Db::getInstance()->executeS(' - SELECT * - FROM `'._DB_PREFIX_.'tax_rules_group` g' - .($only_active ? ' WHERE g.`active` = 1' : '').' - ORDER BY name ASC'); + if ((bool)$multiShop) { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .Shop::addSqlAssociation('tax_rules_group', 'g') + .($only_active ? ' WHERE g.`active` = 1' : '').' + ORDER BY name ASC'); + } else { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .($only_active ? ' WHERE g.`active` = 1' : '').' + ORDER BY name ASC'); + } } /** diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 7438eda6f..003226a23 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3001,7 +3001,7 @@ class AdminProductsControllerCore extends AdminController $data->assign(array( 'link' => $this->context->link, 'currency' => $currency = $this->context->currency, - 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true), + 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true), 'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id), 'ecotaxTaxRate' => Tax::getProductEcotaxRate(), 'tax_exclude_taxe_option' => Tax::excludeTaxeOption(), From eecfdae0b639a1b33e77bbfe03be7360e6d46487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Wed, 17 Jul 2013 18:23:59 +0200 Subject: [PATCH 070/644] [-] BO : FixBug #PSCFV-8217 Shop logo image not refresh after change --- classes/ImageManager.php | 2 +- controllers/admin/AdminStoresController.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/classes/ImageManager.php b/classes/ImageManager.php index c7500c8fd..b29bab40c 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -76,7 +76,7 @@ class ImageManagerCore } // Relative link will always work, whatever the base uri set in the admin if (Context::getContext()->controller->controller_type == 'admin') - return ''; + return ''; else return ''; } diff --git a/controllers/admin/AdminStoresController.php b/controllers/admin/AdminStoresController.php index 03a001d34..ec9175901 100644 --- a/controllers/admin/AdminStoresController.php +++ b/controllers/admin/AdminStoresController.php @@ -296,8 +296,12 @@ class AdminStoresControllerCore extends AdminController if (!($obj = $this->loadObject(true))) return; + + if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_'.(int)$obj->id.'.'.$this->imageType)) { + @unlink(_PS_TMP_IMG_DIR_.$this->table.'_'.(int)$obj->id.'.'.$this->imageType); + } - $image = ImageManager::thumbnail(_PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg', $this->table.'_'.(int)$obj->id.'.'.$this->imageType, 350, $this->imageType, true); + $image = ImageManager::thumbnail(_PS_STORE_IMG_DIR_.DIRECTORY_SEPARATOR.$obj->id.'.jpg', $this->table.'_'.(int)$obj->id.'.'.$this->imageType, 350, $this->imageType, true, true); $days = array(); $days[1] = $this->l('Monday'); @@ -316,7 +320,7 @@ class AdminStoresControllerCore extends AdminController 'latitude' => $this->getFieldValue($obj, 'latitude') ? $this->getFieldValue($obj, 'latitude') : Configuration::get('PS_STORES_CENTER_LAT'), 'longitude' => $this->getFieldValue($obj, 'longitude') ? $this->getFieldValue($obj, 'longitude') : Configuration::get('PS_STORES_CENTER_LONG'), 'image' => $image ? $image : false, - 'size' => $image ? filesize(_PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg') / 1000 : false, + 'size' => $image ? filesize(_PS_STORE_IMG_DIR_.DIRECTORY_SEPARATOR.$obj->id.'.jpg') / 1000 : false, 'days' => $days, 'hours' => isset($hours_unserialized) ? $hours_unserialized : false ); From 5939f65fac26d3fee257dcef372b4e190c79c2c8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 17 Jul 2013 19:05:01 +0200 Subject: [PATCH 071/644] //norms --- controllers/admin/AdminThemesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index dcf849a53..2d0c63706 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -614,7 +614,7 @@ class AdminThemesControllerCore extends AdminController $ext = ($field_name == 'PS_STORES_ICON') ? '.gif' : '.jpg'; $logo_name = $logo_prefix.'-'.(int)$id_shop.$ext; - if (Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL || $id_shop == 0 || Shop::isFeatureActive()==false) + if (Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL || $id_shop == 0 || Shop::isFeatureActive() == false) $logo_name = $logo_prefix.$ext; if ($field_name == 'PS_STORES_ICON') From 40389822c334af81f77ebae4177dfc64aa40d7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 08:52:39 +0200 Subject: [PATCH 072/644] [-] BO : FixBug Directory Separator on URL --- classes/ImageManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/ImageManager.php b/classes/ImageManager.php index b29bab40c..c7500c8fd 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -76,7 +76,7 @@ class ImageManagerCore } // Relative link will always work, whatever the base uri set in the admin if (Context::getContext()->controller->controller_type == 'admin') - return ''; + return ''; else return ''; } From 3be36f9897bf8df4a4240b410d452dc8faf98d01 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 09:35:40 +0200 Subject: [PATCH 073/644] [*] MO : added configuration cleaning to pscleaner --- modules/pscleaner/pscleaner.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index 67ea6595c..5b00d4831 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -131,6 +131,31 @@ class PSCleaner extends Module $db = Db::getInstance(); $logs = array(); + // Remove doubles in the configuration + $filtered_configuration = array(); + $result = $db->ExecuteS('SELECT * FROM '._DB_PREFIX_.'configuration'); + foreach ($result as $row) + { + $key = $row['id_shop_group'].'-|-'.$row['id_shop'].'-|-'.$row['name']; + if (in_array($key, $filtered_configuration)) + { + $query = 'DELETE FROM '._DB_PREFIX_.'configuration WHERE id_configuration = '.(int)$row['id_configuration']; + $db->Execute($query); + $logs[$query] = 1; + } + else + $filtered_configuration[] = $key; + } + unset($filtered_configuration); + + // Remove inexisting or monolanguage configuration value from configuration_lang + $query = 'DELETE FROM `'._DB_PREFIX_.'configuration_lang` + WHERE `id_configuration` NOT IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration`) + OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NOT NULL AND name != "")'; + if ($db->Execute($query)) + if ($affected_rows = $db->Affected_Rows()) + $logs[$query] = $affected_rows; + // Simple Cascade Delete $queries = array( // 0 => DELETE FROM __table__, 1 => WHERE __id__ NOT IN, 2 => NOT IN __table__, 3 => __id__ used in the "NOT IN" table, 4 => module_name From c1a4dd6b66d1bf50b2735f1c24d73c1f19e6ded4 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 11:31:08 +0200 Subject: [PATCH 074/644] // Added readme in the override directory --- override/readme_override.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 override/readme_override.txt diff --git a/override/readme_override.txt b/override/readme_override.txt new file mode 100644 index 000000000..9a39204fb --- /dev/null +++ b/override/readme_override.txt @@ -0,0 +1,9 @@ +Hello, + +Please read the documentation before trying to override something here. +http://doc.prestashop.com/display/PS15/Overriding+default+behaviors + +Frequently Asked Questions + +Q: I added an override file but it seems to be ignored by PrestaShop +A: You need to trigger the regeneration of the /cache/class_index.php file. This is done simply by deleting the file. It is the same when manually removing an override: in order to reinstate the default behavior, you must delete the /cache/class_index.php file. From 108bd92c3b85197bb0af2e38527273a0c604cf84 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 12:09:48 +0200 Subject: [PATCH 075/644] [-] FO : Fixed partial use of cart rules which does not offer free shipping #PSCFV-9216 --- classes/PaymentModule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index acd3c1936..9b4994ee6 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -431,9 +431,9 @@ abstract class PaymentModuleCore extends Module // Set the new voucher value if ($voucher->reduction_tax) - $voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - $order->total_shipping_tax_incl; + $voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_incl : 0); else - $voucher->reduction_amount = $values['tax_excl'] - $order->total_products - $order->total_shipping_tax_excl; + $voucher->reduction_amount = $values['tax_excl'] - $order->total_products - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_excl : 0); $voucher->id_customer = $order->id_customer; $voucher->quantity = 1; From d99a1eba24ddea86b702395dd06dab334f4275ba Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Jul 2013 12:12:05 +0200 Subject: [PATCH 076/644] [-] BO : Bad return value for AdminCountries::processStatus() --- controllers/admin/AdminCountriesController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminCountriesController.php b/controllers/admin/AdminCountriesController.php index 6d5638b31..dcd4f7c0a 100644 --- a/controllers/admin/AdminCountriesController.php +++ b/controllers/admin/AdminCountriesController.php @@ -433,10 +433,10 @@ class AdminCountriesControllerCore extends AdminController public function processStatus() { - $return = parent::processStatus(); + parent::processStatus(); if (Validate::isLoadedObject($object = $this->loadObject()) && $object->active == 1) - $return &= Country::addModuleRestrictions(array(), array(array('id_country' => $object->id)), array()); - return $return; + return Country::addModuleRestrictions(array(), array(array('id_country' => $object->id)), array()); + return false; } public function processBulkStatusSelection($way) From 69066361a6aab400495e3e0ac2f329d2b14734e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 12:15:42 +0200 Subject: [PATCH 077/644] [-] BO : FixBug #PSCFV-8234 Products tags not correctly indexed in search --- classes/Search.php | 8 ++++++++ controllers/admin/AdminTagsController.php | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/classes/Search.php b/classes/Search.php index 3241c3476..1ab992005 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -571,6 +571,14 @@ class SearchCore return true; } + public static function removeProductsSearchIndex($products) + { + if (count($products)) { + Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'search_index WHERE id_product IN ('.implode(',', $products).')'); + ObjectModel::updateMultishopTable('Product', array('indexed' => 0), 'a.id_product IN ('.implode(',', $products).')'); + } + } + protected static function setProductsAsIndexed(&$products) { if (count($products)) diff --git a/controllers/admin/AdminTagsController.php b/controllers/admin/AdminTagsController.php index 7e7ffcf41..57a158d37 100644 --- a/controllers/admin/AdminTagsController.php +++ b/controllers/admin/AdminTagsController.php @@ -77,8 +77,23 @@ class AdminTagsControllerCore extends AdminController public function postProcess() { if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd'.$this->table)) + { if (($id = (int)Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj)) + { + $previousProducts = $obj->getProducts(); + $removedProducts = array(); + + foreach ($previousProducts as $product) + if (!in_array($product['id_product'], $_POST['products'])) + $removedProducts[] = $product['id_product']; + + if (Configuration::get('PS_SEARCH_INDEXATION')) + Search::removeProductsSearchIndex($removedProducts); + $obj->setProducts($_POST['products']); + } + } + return parent::postProcess(); } From 6293631ac45d8682c5600568383bb3dddeca5dda Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 13:47:23 +0200 Subject: [PATCH 078/644] [-] FO : fixed group query for cart rules #PSCFV-8992 --- classes/CartRule.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/classes/CartRule.php b/classes/CartRule.php index ab5cef179..001e8cd22 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -1104,29 +1104,30 @@ class CartRuleCore extends ObjectModel '.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').' ) AND ( - cr.carrier_restriction = 0 + cr.`carrier_restriction` = 0 '.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').' ) AND ( - cr.shop_restriction = 0 + cr.`shop_restriction` = 0 '.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').' ) AND ( - cr.group_restriction = 0 + cr.`group_restriction` = 0 '.($context->customer->id ? 'OR 0 < ( - SELECT cg.id_group - FROM '._DB_PREFIX_.'customer_group cg - LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON (cg.id_group = crg.id_group AND cg.id_group = '.(int)$context->customer->id_default_group.') - WHERE cr.id_cart_rule = crg.id_cart_rule - AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1 + SELECT cg.`id_group` + FROM `'._DB_PREFIX_.'customer_group` cg + INNER JOIN `'._DB_PREFIX_.'cart_rule_group` crg ON cg.id_group = crg.id_group + WHERE cr.`id_cart_rule` = crg.`id_cart_rule` + AND cg.`id_customer` = '.(int)$context->customer->id.' + LIMIT 1 )' : '').' ) AND ( - cr.reduction_product <= 0 - OR cr.reduction_product IN ( - SELECT id_product - FROM '._DB_PREFIX_.'cart_product - WHERE id_cart = '.(int)$context->cart->id.' + cr.`reduction_product` <= 0 + OR cr.`reduction_product` IN ( + SELECT `id_product` + FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_cart` = '.(int)$context->cart->id.' ) ) AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.') From a6da3e94f0b3500bb0fd6dc8028710cf5ed37b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 14:02:22 +0200 Subject: [PATCH 079/644] [-] BO : FixBug #PSCFV-9723 Exporting quantity in instant stock was not returning all rows --- controllers/admin/AdminStockInstantStateController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminStockInstantStateController.php b/controllers/admin/AdminStockInstantStateController.php index 04079c882..a3db14452 100644 --- a/controllers/admin/AdminStockInstantStateController.php +++ b/controllers/admin/AdminStockInstantStateController.php @@ -181,11 +181,13 @@ class AdminStockInstantStateControllerCore extends AdminController */ public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) { - if (Tools::isSubmit('csv') && (int)Tools::getValue('id_warehouse') != -1) + if ((Tools::isSubmit('csv_quantities') || Tools::isSubmit('csv_prices')) && + (int)Tools::getValue('id_warehouse') != -1) $limit = false; $order_by_valuation = false; $order_by_real_quantity = false; + if ($this->context->cookie->{$this->table.'Orderby'} == 'valuation') { unset($this->context->cookie->{$this->table.'Orderby'}); @@ -200,6 +202,7 @@ class AdminStockInstantStateControllerCore extends AdminController parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop); $nb_items = count($this->_list); + for ($i = 0; $i < $nb_items; ++$i) { $item = &$this->_list[$i]; From 6ae0717e32bd8c5a4ec8135a26a400939feecb28 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 14:48:32 +0200 Subject: [PATCH 080/644] // PS Cleaner now clean the img/tmp dir --- modules/pscleaner/pscleaner.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index 5b00d4831..9f7215a5f 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -372,6 +372,7 @@ class PSCleaner extends Module // @Todo: Remove attachment files, images... Image::clearTmpDir(); + $this->clearAllCaches(); return $logs; } @@ -559,6 +560,9 @@ class PSCleaner extends Module protected function clearAllCaches() { + $index = file_get_contents(_PS_TMP_IMG_DIR_.'index.php'); + Tools::deleteDirectory(_PS_TMP_IMG_DIR_, false); + file_put_contents(_PS_TMP_IMG_DIR_.'index.php', $index); Context::getContext()->smarty->clearAllCache(); } } From 2c6978e97cd52c99da5d7eb27cdfa1feaf4d0db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 14:55:28 +0200 Subject: [PATCH 081/644] [-] BO : FixBug #PSCFV-6140 Pagination link error --- themes/default/pagination.tpl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/themes/default/pagination.tpl b/themes/default/pagination.tpl index 070ab7e9b..fa806db11 100644 --- a/themes/default/pagination.tpl +++ b/themes/default/pagination.tpl @@ -53,42 +53,42 @@
      {if $p != 1} {assign var='p_previous' value=$p-1} -
    • « {l s='Previous'}
    • +
    • « {l s='Previous'}
    • {else}
    • « {l s='Previous'}
    • {/if} {if $start==3} -
    • 1
    • -
    • 2
    • +
    • 1
    • +
    • 2
    • {/if} {if $start==2} -
    • 1
    • +
    • 1
    • {/if} {if $start>3} -
    • 1
    • +
    • 1
    • ...
    • {/if} {section name=pagination start=$start loop=$stop+1 step=1} {if $p == $smarty.section.pagination.index}
    • {$p|escape:'htmlall':'UTF-8'}
    • {else} -
    • {$smarty.section.pagination.index|escape:'htmlall':'UTF-8'}
    • +
    • {$smarty.section.pagination.index|escape:'htmlall':'UTF-8'}
    • {/if} {/section} {if $pages_nb>$stop+2}
    • ...
    • -
    • {$pages_nb|intval}
    • +
    • {$pages_nb|intval}
    • {/if} {if $pages_nb==$stop+1} -
    • {$pages_nb|intval}
    • +
    • {$pages_nb|intval}
    • {/if} {if $pages_nb==$stop+2} -
    • {$pages_nb-1|intval}
    • -
    • {$pages_nb|intval}
    • +
    • {$pages_nb-1|intval}
    • +
    • {$pages_nb|intval}
    • {/if} {if $pages_nb > 1 AND $p != $pages_nb} {assign var='p_next' value=$p+1} -
    • {l s='Next'} »
    • +
    • {l s='Next'} »
    • {else}
    • {l s='Next'} »
    • {/if} From 3693349643ef6fa6a1752bb218ec7378a60c6331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 15:49:53 +0200 Subject: [PATCH 082/644] [-] BO : FixBug #PSCFV-5316 Translation problem in delete button link --- classes/helper/HelperList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 6d4c3a023..bfc0077dd 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -456,7 +456,7 @@ class HelperListCore extends Helper ); if ($this->specificConfirmDelete !== false) - $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name; + $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : addcslashes(Tools::htmlentitiesDecodeUTF8(self::$cache_lang['DeleteItem'].$name), '\''); $tpl->assign(array_merge($this->tpl_delete_link_vars, $data)); From dd78e97b4ab8e6b22315f1ab13accc3e5c957e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 17:09:44 +0200 Subject: [PATCH 083/644] [-] FO : FixBug #PSCFV-7723 Bad manufacturers list pagination --- controllers/front/ManufacturerController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/front/ManufacturerController.php b/controllers/front/ManufacturerController.php index 1aa4ae22e..096b2e4c9 100644 --- a/controllers/front/ManufacturerController.php +++ b/controllers/front/ManufacturerController.php @@ -113,6 +113,9 @@ class ManufacturerControllerCore extends FrontController { $data = Manufacturer::getManufacturers(true, $this->context->language->id, true, false, false, false); $nbProducts = count($data); + $this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE')))); + $this->p = abs((int)(Tools::getValue('p', 1))); + $data = Manufacturer::getManufacturers(true, $this->context->language->id, true, $this->p, $this->n, false); $this->pagination($nbProducts); foreach ($data as &$item) @@ -129,4 +132,4 @@ class ManufacturerControllerCore extends FrontController else $this->context->smarty->assign('nbManufacturers', 0); } -} +} \ No newline at end of file From d879fb15a99fd540d7bf77acd0524b33a27837a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 18:10:29 +0200 Subject: [PATCH 084/644] [-] FO : FixBug #PSCFV-8018 All products was counted in manufacturer list even hidden products --- classes/Manufacturer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index 285f802e1..bcf465787 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -198,6 +198,7 @@ class ManufacturerCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) WHERE m.`id_manufacturer` = '.(int)$manufacturer['id_manufacturer']. ($active ? ' AND product_shop.`active` = 1 ' : ''). + ' AND p.visibility IN (\'none\')'. ($all_group ? '' : ' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg From caf321e691d79dac2d5d1ce126960c82be02d26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 18:16:57 +0200 Subject: [PATCH 085/644] [-] FO : FixBug #PSCFV-8018 All products was counted in manufacturer lsit even if products was set as hidden --- classes/Manufacturer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index bcf465787..763b37b52 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -198,7 +198,7 @@ class ManufacturerCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) WHERE m.`id_manufacturer` = '.(int)$manufacturer['id_manufacturer']. ($active ? ' AND product_shop.`active` = 1 ' : ''). - ' AND p.visibility IN (\'none\')'. + ' AND p.visibility NOT IN (\'none\')'. ($all_group ? '' : ' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg From a71a5d7c18215ef5b4524b05759e2f02f5042ed7 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Jul 2013 18:18:57 +0200 Subject: [PATCH 086/644] [-] MO : Fix bug discount display in mail, manual merge from https://github.com/202-ecommerce/PrestaShop/commit/1d5df338c46aef723d13aef3e213792df6ea92e2 --- modules/referralprogram/referralprogram.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/referralprogram/referralprogram.php b/modules/referralprogram/referralprogram.php index 697824fa7..0d497e619 100644 --- a/modules/referralprogram/referralprogram.php +++ b/modules/referralprogram/referralprogram.php @@ -649,8 +649,7 @@ class ReferralProgram extends Module { $cartRule = new CartRule((int)$referralprogram->id_cart_rule_sponsor); $currency = new Currency((int)$order->id_currency); - $discount_display = ReferralProgram::displayDiscount($cartRule->reduction_percent ? $cartRule->reduction_percent : $cartRule->reduction_amount, $cartRule->reduction_percent ? 1 : 2, $currency); - $data = array('{sponsored_firstname}' => $customer->firstname, '{sponsored_lastname}' => $customer->lastname, '{discount_display}' => $discount_display, '{discount_name}' => $cartRule->code); + $discount_display = ReferralProgram::displayDiscount( (float) $cartRule->reduction_percent ? (float) $cartRule->reduction_percent : (int) $cartRule->reduction_amount, (float) $cartRule->reduction_percent ? 1 : 2, $currency); $data = array('{sponsored_firstname}' => $customer->firstname, '{sponsored_lastname}' => $customer->lastname, '{discount_display}' => $discount_display, '{discount_name}' => $cartRule->code); Mail::Send((int)$order->id_lang, 'referralprogram-congratulations', Mail::l('Congratulations!', (int)$order->id_lang), $data, $sponsor->email, $sponsor->firstname.' '.$sponsor->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); return true; } From c70fe92daceccac18bf247b84dc37c469f89cc71 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 18:22:36 +0200 Subject: [PATCH 087/644] // Validate::isGenericName now allow "#" #PSCFV-6530 --- classes/Validate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Validate.php b/classes/Validate.php index cee80bd01..04b53c7fa 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -380,7 +380,7 @@ class ValidateCore */ public static function isGenericName($name) { - return empty($name) || preg_match('/^[^<>=#{}]*$/u', $name); + return empty($name) || preg_match('/^[^<>={}]*$/u', $name); } /** From 958d92c9fa5076ab77a7839efe62e0b631198ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 18 Jul 2013 18:31:31 +0200 Subject: [PATCH 088/644] [*] BO: Add an option to allow iframes on descriptions --- classes/CMS.php | 2 +- classes/Category.php | 2 +- classes/Hook.php | 8 ++++---- classes/Manufacturer.php | 4 ++-- classes/ObjectModel.php | 19 +++++++++++++++++-- classes/Product.php | 4 ++-- classes/Validate.php | 11 +++++++++-- .../admin/AdminPreferencesController.php | 8 ++++++++ controllers/admin/AdminProductsController.php | 17 ++++++++++++++--- 9 files changed, 58 insertions(+), 17 deletions(-) diff --git a/classes/CMS.php b/classes/CMS.php index 176d3d61b..db9d69d52 100644 --- a/classes/CMS.php +++ b/classes/CMS.php @@ -53,7 +53,7 @@ class CMSCore extends ObjectModel 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), - 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), + 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 3999999999999), ), ); diff --git a/classes/Category.php b/classes/Category.php index 55982d2a2..35cbdb0f4 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -109,7 +109,7 @@ class CategoryCore extends ObjectModel // Lang fields 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 64), - 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'), + 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128), 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), diff --git a/classes/Hook.php b/classes/Hook.php index 74d95142c..420d5b798 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -64,10 +64,10 @@ class HookCore extends ObjectModel 'primary' => 'id_hook', 'fields' => array( 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isHookName', 'required' => true, 'size' => 64), - 'title' => array('type' => self::TYPE_STRING), - 'description' => array('type' => self::TYPE_HTML), - 'position' => array('type' => self::TYPE_BOOL), - 'live_edit' => array('type' => self::TYPE_BOOL), + 'title' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), + 'description' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'), + 'position' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'live_edit' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), ), ); diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index 285f802e1..df79245a8 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -78,8 +78,8 @@ class ManufacturerCore extends ObjectModel 'date_upd' => array('type' => self::TYPE_DATE), // Lang fields - 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'), - 'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 254), + 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), + 'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 254), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128), 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'), diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index 27e1560db..ca2d1c608 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -939,8 +939,23 @@ abstract class ObjectModelCore if (!method_exists('Validate', $data['validate'])) throw new PrestaShopException('Validation function not found. '.$data['validate']); - if (!empty($value) && !call_user_func(array('Validate', $data['validate']), $value)) - return 'Property '.get_class($this).'->'.$field.' is not valid'; + if (!empty($value)) + { + $res = true; + if (Tools::strtolower($data['validate']) == 'isCleanHtml') + { + d('in'); + if (!call_user_func(array('Validate', $data['validate']), $value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) + $res = false; + } + else + { + if (!call_user_func(array('Validate', $data['validate']), $value)) + $res = false; + } + if (!$res) + return 'Property '.get_class($this).'->'.$field.' is not valid'; + } } return true; diff --git a/classes/Product.php b/classes/Product.php index d14d49294..eefa229e1 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -297,8 +297,8 @@ class ProductCore extends ObjectModel 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 128), - 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'), - 'description_short' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'), + 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), + 'description_short' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), 'available_now' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'available_later' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'IsGenericName', 'size' => 255), ), diff --git a/classes/Validate.php b/classes/Validate.php index cee80bd01..dc308b857 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -389,7 +389,7 @@ class ValidateCore * @param string $html HTML field to validate * @return boolean Validity is ok or not */ - public static function isCleanHtml($html) + public static function isCleanHtml($html, $allow_iframe = false) { $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; @@ -398,7 +398,14 @@ class ValidateCore $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; $events .= '|onselectstart|onstart|onstop'; - return (!preg_match('/<[ \t\n]*script/ims', $html) && !preg_match('/('.$events.')[ \t\n]*=/ims', $html) && !preg_match('/.*script\:/ims', $html) && !preg_match('/<[ \t\n]*i?frame/ims', $html)); + + if (preg_match('/<[ \t\n]*script/ims', $html) || preg_match('/('.$events.')[ \t\n]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) + return false; + + if (!$allow_iframe && preg_match('/<[ \t\n]*(i?frame|form|input|embed|object)/ims', $html)) + return false; + + return true; } /** diff --git a/controllers/admin/AdminPreferencesController.php b/controllers/admin/AdminPreferencesController.php index 5df23eae9..f878f69fc 100644 --- a/controllers/admin/AdminPreferencesController.php +++ b/controllers/admin/AdminPreferencesController.php @@ -95,6 +95,14 @@ class AdminPreferencesControllerCore extends AdminController 'default' => '0', 'visibility' => Shop::CONTEXT_ALL ), + 'PS_ALLOW_HTML_IFRAME' => array( + 'title' => $this->l('Allow iframes on html fields'), + 'desc' => $this->l('Allow iframes on fields like product description. We recommend that you leave this option disabled'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool', + 'default' => '0' + ), 'PS_PRICE_ROUND_MODE' => array( 'title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: Always round superior, always round inferior or classic rounding.'), diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 003226a23..50d141c3a 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2058,17 +2058,28 @@ class AdminProductsControllerCore extends AdminController // Check fields validity foreach ($rules['validate'] as $field => $function) if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field))) - if (!Validate::$function($value)) + { + $res = true; + if (Tools::strtolower($function) == 'isCleanHtml') + { + if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) + $res = false; + } + else + if (!Validate::$function($value)) + $res = false; + + if (!$res) $this->errors[] = sprintf( Tools::displayError('The %s field is invalid.'), call_user_func(array($className, 'displayFieldName'), $field, $className) ); - + } // Check multilingual fields validity foreach ($rules['validateLang'] as $fieldLang => $function) foreach ($languages as $language) if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']))) - if (!Validate::$function($value)) + if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) $this->errors[] = sprintf( Tools::displayError('The %1$s field (%2$s) is invalid.'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), From 066b791cf783fcb262aa3bbdcf9f74ac1bb8f65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 18 Jul 2013 18:33:35 +0200 Subject: [PATCH 089/644] [-] FO : FixBug of total products from supliers and manufacturer --- classes/Manufacturer.php | 2 +- classes/Supplier.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index 763b37b52..fc717ecc5 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -198,7 +198,7 @@ class ManufacturerCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) WHERE m.`id_manufacturer` = '.(int)$manufacturer['id_manufacturer']. ($active ? ' AND product_shop.`active` = 1 ' : ''). - ' AND p.visibility NOT IN (\'none\')'. + ' AND product_shop.`visibility` NOT IN ("none")'. ($all_group ? '' : ' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg diff --git a/classes/Supplier.php b/classes/Supplier.php index c878257f0..7749fb6de 100644 --- a/classes/Supplier.php +++ b/classes/Supplier.php @@ -140,6 +140,7 @@ class SupplierCore extends ObjectModel WHERE ps.`id_supplier` = '.(int)$supplier['id_supplier'].' AND ps.id_product_attribute = 0'. ($active ? ' AND product_shop.`active` = 1' : ''). + ' AND product_shop.`visibility` NOT IN ("none")'. ($all_groups ? '' :' AND ps.`id_product` IN ( SELECT cp.`id_product` From ac02e5191ade491dd24f0206fb1bc2ed436f2516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 18 Jul 2013 18:34:10 +0200 Subject: [PATCH 090/644] // ups --- classes/ObjectModel.php | 3 +-- controllers/admin/AdminProductsController.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index ca2d1c608..a9aadd82d 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -942,9 +942,8 @@ abstract class ObjectModelCore if (!empty($value)) { $res = true; - if (Tools::strtolower($data['validate']) == 'isCleanHtml') + if (Tools::strtolower($data['validate']) == 'iscleanhtml') { - d('in'); if (!call_user_func(array('Validate', $data['validate']), $value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) $res = false; } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 50d141c3a..614f386c2 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2060,7 +2060,7 @@ class AdminProductsControllerCore extends AdminController if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field))) { $res = true; - if (Tools::strtolower($function) == 'isCleanHtml') + if (Tools::strtolower($function) == 'iscleanhtml') { if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) $res = false; From 236aaa9354da836021cef8bbd78cd20df0e33680 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Jul 2013 18:38:12 +0200 Subject: [PATCH 091/644] [*] MAILS : add {order_name} & {attached_file} , manaul merge from https://github.com/PrestaEdit/PrestaShop/commit/e9f963174486362a0ba471c18e113f6b83e5efc8 --- mails/en/contact.html | 6 +++++- mails/en/contact.txt | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mails/en/contact.html b/mails/en/contact.html index 62ab2c9ab..a122cab61 100644 --- a/mails/en/contact.html +++ b/mails/en/contact.html @@ -20,7 +20,11 @@   -Customer e-mail address: {email}

      Customer message: {message} +Customer e-mail address: {email} +

      Customer message: {message} +

      Order ID : {order_name} +

      Attached file : {attached_file} +   diff --git a/mails/en/contact.txt b/mails/en/contact.txt index 2e1bc5eb7..d97039345 100644 --- a/mails/en/contact.txt +++ b/mails/en/contact.txt @@ -8,4 +8,8 @@ Customer message: {message} +Order reference : {order_name} + +Attached file : {attached_file} + {shop_url} powered by PrestaShopâ„¢ \ No newline at end of file From a6a700c9d89ea0932e4bb5c05e09de2f45b9f6ea Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Jul 2013 18:40:19 +0200 Subject: [PATCH 092/644] // parse error --- themes/default/contact-form.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/contact-form.tpl b/themes/default/contact-form.tpl index bc6bef2f4..ad1185cd0 100644 --- a/themes/default/contact-form.tpl +++ b/themes/default/contact-form.tpl @@ -89,7 +89,7 @@ {/foreach} {elseif !isset($customerThread.id_order) && !isset($isLogged)} - + {elseif $customerThread.id_order|intval > 0} {/if} From 78ddec3ac724d78907a20ba74cccb526721f664b Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 18 Jul 2013 18:51:23 +0200 Subject: [PATCH 093/644] [-] BO : translation copy is now easier #PSCFV-8886 --- classes/Language.php | 4 ++-- controllers/admin/AdminTranslationsController.php | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/classes/Language.php b/classes/Language.php index 5b4659f70..0228a63ac 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -262,7 +262,7 @@ class LanguageCore extends ObjectModel $mPath_to = _PS_MAIL_DIR_.(string)$iso_to.'/'; } - $lFiles = array('admin.php', 'errors.php', 'fields.php', 'pdf.php', 'tabs.php', 'index.php'); + $lFiles = array('admin.php', 'errors.php', 'fields.php', 'pdf.php', 'tabs.php'); // Added natives mails files $mFiles = array( @@ -297,7 +297,7 @@ class LanguageCore extends ObjectModel 'test.html', 'test.txt', 'voucher.html', 'voucher.txt', 'voucher_new.html', 'voucher_new.txt', - 'order_changed.html', 'order_changed.txt', 'index.php' + 'order_changed.html', 'order_changed.txt' ); $number = -1; diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 2d34a74d1..784f15c59 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -353,13 +353,15 @@ class AdminTranslationsControllerCore extends AdminController $items = Language::getFilesList($from_lang, $from_theme, $to_lang, $to_theme, false, false, true); foreach ($items as $source => $dest) { - $bool &= $this->checkDirAndCreate($dest); - $bool &= @copy($source, $dest); - - if (strpos($dest, 'modules') && basename($source) === $from_lang.'.php' && $bool !== false) - $bool &= $this->changeModulesKeyTranslation($dest, $from_theme, $to_theme); + if (!$this->checkDirAndCreate($dest)) + $this->errors[] = sprintf($this->l('Impossible to create the directory "%s".'), $dest); + elseif (!copy($source, $dest)) + $this->errors[] = sprintf($this->l('Impossible to copy "%s" to "%s".'), $source, $dest); + elseif (strpos($dest, 'modules') && basename($source) === $from_lang.'.php' && $bool !== false) + if (!$this->changeModulesKeyTranslation($dest, $from_theme, $to_theme)) + $this->errors[] = sprintf($this->l('Impossible to translate "$dest".'), $dest); } - if ($bool) + if (!count($this->errors)) $this->redirect(false, 14); $this->errors[] = $this->l('A part of the data has been copied but some of the language files could not be found.'); } From 219ec6e8bef8b2166541a619afe3f4443e75b757 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 09:50:30 +0200 Subject: [PATCH 094/644] [-] FO : Removed useless live edit query #PSCFV-9845 --- classes/controller/FrontController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 798446e34..88ebd4b4f 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -775,9 +775,11 @@ class FrontControllerCore extends Controller public function checkLiveEditAccess() { - $live_token = Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')); - $ad = Tools::getValue('ad'); - return Tools::isSubmit('live_edit') && $ad && Tools::getValue('liveToken') == $live_token && is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad); + if (!Tools::isSubmit('live_edit') || !Tools::getValue('ad') || !Tools::getValue('liveToken')) + return false; + if (Tools::getValue('liveToken') != Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) + return false; + return is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.Tools::getValue('ad')); } public function getLiveEditFooter() From eb6b233e311077523e57d02db73e91f7042e9849 Mon Sep 17 00:00:00 2001 From: PhpMadman Date: Fri, 19 Jul 2013 10:33:28 +0200 Subject: [PATCH 095/644] [-] BO : If no nb, get default 8, not 10. --- modules/homefeatured/homefeatured.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/homefeatured/homefeatured.php b/modules/homefeatured/homefeatured.php index d3d821913..5d7ec5b57 100644 --- a/modules/homefeatured/homefeatured.php +++ b/modules/homefeatured/homefeatured.php @@ -120,7 +120,7 @@ class HomeFeatured extends Module { $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id); $nb = (int)Configuration::get('HOME_FEATURED_NBR'); - $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10)); + $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8)); $this->smarty->assign(array( 'products' => $products, @@ -145,4 +145,4 @@ class HomeFeatured extends Module { $this->_clearCache('homefeatured.tpl'); } -} \ No newline at end of file +} From bd4ece095b002ba3cced051a92a3aed5145cb1a4 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 10:58:51 +0200 Subject: [PATCH 096/644] [*] FO : lots of performance improvements (removed or merged useless SQL queries) --- classes/Group.php | 7 +++++ classes/Hook.php | 25 ++++++++++------ classes/ObjectModel.php | 27 ++++++++++------- classes/module/Module.php | 63 +++++++++++++++++++++------------------ 4 files changed, 74 insertions(+), 48 deletions(-) diff --git a/classes/Group.php b/classes/Group.php index aa7f6cccd..eb8b95e3d 100644 --- a/classes/Group.php +++ b/classes/Group.php @@ -70,6 +70,13 @@ class GroupCore extends ObjectModel protected $webserviceParameters = array(); + public function __construct($id = null, $id_lang = null, $id_shop = null) + { + parent::__construct($id, $id_lang, $id_shop); + if ($this->id && !isset(Group::$group_price_display_method[$this->id])) + self::$group_price_display_method[$this->id] = $this->price_display_method; + } + public static function getGroups($id_lang, $id_shop = false) { $shop_criteria = ''; diff --git a/classes/Hook.php b/classes/Hook.php index 420d5b798..407a8a83c 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -113,19 +113,26 @@ class HookCore extends ObjectModel if (!Validate::isHookName($hook_name)) return false; - $cache_id = 'hook_idbyname_'.$hook_name; + $cache_id = 'hook_idsbyname'; if (!Cache::isStored($cache_id)) { - $retro_hook_name = Hook::getRetroHookName($hook_name); - Cache::store($cache_id, Db::getInstance()->getValue(' - SELECT `id_hook` - FROM `'._DB_PREFIX_.'hook` - WHERE `name` = \''.pSQL($hook_name).'\' - OR `name` = \''.pSQL($retro_hook_name).'\' - ')); + // Get all hook ID by name and alias + $hook_ids = array(); + $result = Db::getInstance()->ExecuteS(' + SELECT `id_hook`, `name` + FROM `'._DB_PREFIX_.'hook` + UNION + SELECT `id_hook`, ha.`alias` as name + FROM `ps_hook_alias` ha + INNER JOIN `ps_hook` h ON ha.name = h.name'); + foreach ($result as $row) + $hook_ids[$row['name']] = $row['id_hook']; + Cache::store($cache_id, $hook_ids); } + else + $hook_ids = Cache::retrieve($cache_id); - return Cache::retrieve($cache_id); + return (isset($hook_ids[$hook_name]) ? $hook_ids[$hook_name] : false); } /** diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php index a9aadd82d..d1cd8f5ad 100644 --- a/classes/ObjectModel.php +++ b/classes/ObjectModel.php @@ -242,16 +242,6 @@ abstract class ObjectModelCore $this->{$key} = $value; } } - - if (!is_array(self::$fieldsRequiredDatabase)) - { - $fields = $this->getfieldsRequiredDatabase(true); - if ($fields) - foreach ($fields as $row) - self::$fieldsRequiredDatabase[$row['object_name']][(int)$row['id_required_field']] = pSQL($row['field_name']); - else - self::$fieldsRequiredDatabase = array(); - } } /** @@ -901,6 +891,7 @@ abstract class ObjectModelCore */ public function validateField($field, $value, $id_lang = null) { + $this->cacheFieldsRequiredDatabase(); $data = $this->def['fields'][$field]; // Check if field is required @@ -983,6 +974,7 @@ abstract class ObjectModelCore public function validateController($htmlentities = true) { + $this->cacheFieldsRequiredDatabase(); $errors = array(); $required_fields_database = (isset(self::$fieldsRequiredDatabase[get_class($this)])) ? self::$fieldsRequiredDatabase[get_class($this)] : array(); foreach ($this->def['fields'] as $field => $data) @@ -1029,6 +1021,7 @@ abstract class ObjectModelCore public function getWebserviceParameters($ws_params_attribute_name = null) { + $this->cacheFieldsRequiredDatabase(); $default_resource_parameters = array( 'objectSqlId' => $this->def['primary'], 'retrieveData' => array( @@ -1139,6 +1132,7 @@ abstract class ObjectModelCore public function validateFieldsRequiredDatabase($htmlentities = true) { + $this->cacheFieldsRequiredDatabase(); $errors = array(); $required_fields = (isset(self::$fieldsRequiredDatabase[get_class($this)])) ? self::$fieldsRequiredDatabase[get_class($this)] : array(); @@ -1166,6 +1160,19 @@ abstract class ObjectModelCore FROM '._DB_PREFIX_.'required_field '.(!$all ? 'WHERE object_name = \''.pSQL(get_class($this)).'\'' : '')); } + + public function cacheFieldsRequiredDatabase() + { + if (!is_array(self::$fieldsRequiredDatabase)) + { + $fields = $this->getfieldsRequiredDatabase(true); + if ($fields) + foreach ($fields as $row) + self::$fieldsRequiredDatabase[$row['object_name']][(int)$row['id_required_field']] = pSQL($row['field_name']); + else + self::$fieldsRequiredDatabase = array(); + } + } public function addFieldsRequiredDatabase($fields) { diff --git a/classes/module/Module.php b/classes/module/Module.php index 6067612b6..b521e0fe4 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -153,18 +153,22 @@ 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` = '.((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 + $id_shop = (Validate::isLoadedObject($this->context->shop) ? $this->context->shop->id : 1); self::$modules_cache = array(); - $result = Db::getInstance()->executeS($sql); + // Join clause is done to check if the module is activated in current shop context + $result = Db::getInstance()->executeS(' + SELECT m.`id_module`, m.`name`, ( + SELECT id_module + FROM `'._DB_PREFIX_.'module_shop` ms + WHERE m.`id_module` = ms.`id_module` + AND ms.`id_shop` = '.(int)$id_shop.' + LIMIT 1 + ) as mshop + FROM `'._DB_PREFIX_.'module` m'); foreach ($result as $row) { self::$modules_cache[$row['name']] = $row; - self::$modules_cache[$row['name']]['active'] = ($row['total'] > 0) ? 1 : 0; + self::$modules_cache[$row['name']]['active'] = ($row['mshop'] > 0) ? 1 : 0; } } @@ -1511,12 +1515,12 @@ abstract class ModuleCore * @param int $id_hook Hook ID * @return array Exceptions */ - protected static $exceptionsCache = null; - public function getExceptions($hookID, $dispatch = false) + public function getExceptions($id_hook, $dispatch = false) { - if (self::$exceptionsCache === null) + $cache_id = 'exceptionsCache'; + if (!Cache::isStored($cache_id)) { - self::$exceptionsCache = array(); + $exceptionsCache = array(); $sql = 'SELECT * FROM `'._DB_PREFIX_.'hook_module_exceptions` WHERE `id_shop` IN ('.implode(', ', Shop::getContextListShopID()).')'; $result = Db::getInstance()->executeS($sql); @@ -1525,33 +1529,34 @@ abstract class ModuleCore if (!$row['file_name']) continue; $key = $row['id_hook'].'-'.$row['id_module']; - if (!isset(self::$exceptionsCache[$key])) - self::$exceptionsCache[$key] = array(); - if (!isset(self::$exceptionsCache[$key][$row['id_shop']])) - self::$exceptionsCache[$key][$row['id_shop']] = array(); - self::$exceptionsCache[$key][$row['id_shop']][] = $row['file_name']; + if (!isset($exceptionsCache[$key])) + $exceptionsCache[$key] = array(); + if (!isset($exceptionsCache[$key][$row['id_shop']])) + $exceptionsCache[$key][$row['id_shop']] = array(); + $exceptionsCache[$key][$row['id_shop']][] = $row['file_name']; } + Cache::store($cache_id, $exceptionsCache); } + else + $exceptionsCache = !Cache::retrieve($cache_id); - $key = $hookID.'-'.$this->id; - if (!$dispatch) + $key = $id_hook.'-'.$this->id; + $array_return = array(); + if ($dispatch) { - $files = array(); foreach (Shop::getContextListShopID() as $shop_id) - if (isset(self::$exceptionsCache[$key], self::$exceptionsCache[$key][$shop_id])) - foreach (self::$exceptionsCache[$key][$shop_id] as $file) - if (!in_array($file, $files)) - $files[] = $file; - return $files; + if (isset($exceptionsCache[$key], $exceptionsCache[$key][$shop_id])) + $array_return[$shop_id] = $exceptionsCache[$key][$shop_id]; } else { - $list = array(); foreach (Shop::getContextListShopID() as $shop_id) - if (isset(self::$exceptionsCache[$key], self::$exceptionsCache[$key][$shop_id])) - $list[$shop_id] = self::$exceptionsCache[$key][$shop_id]; - return $list; + if (isset($exceptionsCache[$key], $exceptionsCache[$key][$shop_id])) + foreach ($exceptionsCache[$key][$shop_id] as $file) + if (!in_array($file, $array_return)) + $array_return[] = $file; } + return $array_return; } public static function isInstalled($module_name) From 7570c9eb87dd7d31700759050cc6f582beb8b83b Mon Sep 17 00:00:00 2001 From: Fabio Chelly Date: Fri, 19 Jul 2013 11:15:14 +0200 Subject: [PATCH 097/644] [-] MO loyalty : minimum amount is now taken into account when creating discount vouchers #PNM-1561 --- modules/loyalty/controllers/front/default.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/loyalty/controllers/front/default.php b/modules/loyalty/controllers/front/default.php index 64e152db0..e28f5b7a6 100644 --- a/modules/loyalty/controllers/front/default.php +++ b/modules/loyalty/controllers/front/default.php @@ -89,6 +89,7 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController $cart_rule->date_to = date('Y-m-d H:i:s', strtotime($cart_rule->date_from.' +1 year')); $cart_rule->minimum_amount = (float)Configuration::get('PS_LOYALTY_MINIMAL'); + $cart_rule->minimum_amount_currency = (int)$this->context->currency->id; $cart_rule->active = 1; $categories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'); From 989dafce21688d6997df621ebffe11ec25bea76c Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 11:29:18 +0200 Subject: [PATCH 098/644] [*] FO : a few more SQL improvements --- classes/Connection.php | 4 ++++ classes/Hook.php | 2 +- classes/shop/ShopUrl.php | 35 ++++++++++++++++------------------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/classes/Connection.php b/classes/Connection.php index b250e4ea5..4b171b1f0 100644 --- a/classes/Connection.php +++ b/classes/Connection.php @@ -82,8 +82,12 @@ class ConnectionCore extends ObjectModel // The connection is created if it does not exist yet and we get the current page id if (!isset($cookie->id_connections) || !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false))) $id_page = Connection::setNewConnection($cookie); + // If we do not track the pages, no need to get the page id + if (!Configuration::get('PS_STATSDATA_PAGESVIEWS') && !Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + return array(); if (!isset($id_page) || !$id_page) $id_page = Page::getCurrentId(); + // If we do not track the page views by customer, the id_page is the only information needed if (!Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) return array('id_page' => $id_page); diff --git a/classes/Hook.php b/classes/Hook.php index 407a8a83c..d9ba5f57e 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -83,7 +83,7 @@ class HookCore extends ObjectModel public function add($autodate = true, $null_values = false) { - Cache::clean('hook_idbyname_'.$this->name); + Cache::clean('hook_idsbyname'); return parent::add($autodate, $null_values); } diff --git a/classes/shop/ShopUrl.php b/classes/shop/ShopUrl.php index c8e4b6074..e1594c86b 100644 --- a/classes/shop/ShopUrl.php +++ b/classes/shop/ShopUrl.php @@ -143,22 +143,21 @@ class ShopUrlCore extends ObjectModel return Db::getInstance()->getValue($sql); } - public static function getMainShopDomain($id_shop = null) - { - if (!self::$main_domain || $id_shop !== null) - self::$main_domain = Db::getInstance()->getValue('SELECT domain - FROM '._DB_PREFIX_.'shop_url - WHERE main=1 AND id_shop = '.($id_shop !== null ? (int)$id_shop : Context::getContext()->shop->id)); - return self::$main_domain; - } - public static function cacheMainDomainForShop($id_shop) { if (!Validate::isUnsignedId($id_shop)) return false; - ShopUrl::getMainShopDomain($id_shop); - ShopUrl::getMainShopDomainSSL($id_shop); + if (!self::$main_domain_ssl || !self::$main_domain || $id_shop !== null) + { + $row = Db::getInstance()->getRow(' + SELECT domain, domain_ssl + FROM '._DB_PREFIX_.'shop_url + WHERE main = 1 + AND id_shop = '.($id_shop !== null ? (int)$id_shop : Context::getContext()->shop->id)); + self::$main_domain = $row['domain']; + self::$main_domain_ssl = $row['domain_ssl']; + } } public static function resetMainDomainCache() @@ -167,17 +166,15 @@ class ShopUrlCore extends ObjectModel self::$main_domain_ssl = null; } + public static function getMainShopDomain($id_shop = null) + { + ShopUrl::cacheMainDomainForShop($id_shop); + return self::$main_domain; + } public static function getMainShopDomainSSL($id_shop = null) { - if (!self::$main_domain_ssl || $id_shop !== null) - { - $sql = 'SELECT domain_ssl - FROM '._DB_PREFIX_.'shop_url - WHERE main = 1 - AND id_shop = '.($id_shop !== null ? (int)$id_shop : Context::getContext()->shop->id); - self::$main_domain_ssl = Db::getInstance()->getValue($sql); - } + ShopUrl::cacheMainDomainForShop($id_shop); return self::$main_domain_ssl; } } \ No newline at end of file From 8c47ca3edf9ccbf23569eb61bcc6aba5d0ef19e3 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 11:40:52 +0200 Subject: [PATCH 099/644] [-] BO : fixed sort by currency exchange rate #PSCFV-9840 --- controllers/admin/AdminCurrenciesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php index c5d719483..bf8690b64 100644 --- a/controllers/admin/AdminCurrenciesController.php +++ b/controllers/admin/AdminCurrenciesController.php @@ -38,7 +38,7 @@ class AdminCurrenciesControllerCore extends AdminController 'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'width' => 80), 'iso_code_num' => array('title' => $this->l('ISO code number'), 'align' => 'center', 'width' => 120), 'sign' => array('title' => $this->l('Symbol'), 'width' => 20, 'align' => 'center', 'orderby' => false, 'search' => false), - 'conversion_rate' => array('title' => $this->l('Exchange rate'), 'type' => 'float', 'align' => 'center', 'width' => 130, 'search' => false), + 'conversion_rate' => array('title' => $this->l('Exchange rate'), 'type' => 'float', 'align' => 'center', 'width' => 130, 'search' => false, 'filter_key' => 'currency_shop!conversion_rate'), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false), ); From 8d034a7ebf644fc1bffbcf48aee25e525a485ad3 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 13:33:41 +0200 Subject: [PATCH 100/644] // up --- modules/blockmyaccountfooter/config.xml | 2 +- modules/cheque/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/blockmyaccountfooter/config.xml b/modules/blockmyaccountfooter/config.xml index 0266fa7ae..aa3e350ae 100644 --- a/modules/blockmyaccountfooter/config.xml +++ b/modules/blockmyaccountfooter/config.xml @@ -2,7 +2,7 @@ blockmyaccountfooter - + diff --git a/modules/cheque/config.xml b/modules/cheque/config.xml index dd5655265..e49cd3934 100755 --- a/modules/cheque/config.xml +++ b/modules/cheque/config.xml @@ -1,7 +1,7 @@ cheque - + From 3389cf8acb77caa951456cf4d4e5b9bee5238746 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 14:08:24 +0200 Subject: [PATCH 101/644] [-] FO : fixed pagination for p = 0 #PSCFV-9746 --- classes/controller/FrontController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 88ebd4b4f..52c090097 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -849,8 +849,8 @@ class FrontControllerCore extends Controller $range = 2; /* how many pages around page selected */ - if ($this->p < 0) - $this->p = 0; + if ($this->p < 1) + $this->p = 1; if (isset($this->context->cookie->nb_item_per_page) && $this->n != $this->context->cookie->nb_item_per_page && in_array($this->n, $nArray)) $this->context->cookie->nb_item_per_page = $this->n; From 5646e682bc41386ab2f471b1ae6a2ef54852b5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Fri, 19 Jul 2013 15:21:06 +0200 Subject: [PATCH 102/644] [-] BO : FIxBug Correct image language in product --- .../default/template/controllers/products/images.tpl | 9 ++++++--- controllers/admin/AdminProductsController.php | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/products/images.tpl b/admin-dev/themes/default/template/controllers/products/images.tpl index a686c8ec8..6c5cc4368 100644 --- a/admin-dev/themes/default/template/controllers/products/images.tpl +++ b/admin-dev/themes/default/template/controllers/products/images.tpl @@ -78,7 +78,7 @@ - image_id + image_id @@ -313,12 +313,13 @@ { line = $("#lineType").html(); line = line.replace(/image_id/g, id); - line = line.replace(/en-default/g, path); - line = line.replace(/image_path/g, path); + line = line.replace(/[a-z]{2}-default/g, path); + line = line.replace(/image_path/g, path); line = line.replace(/image_position/g, position); line = line.replace(/blank/g, cover); line = line.replace(//gi, ""); line = line.replace(/<\/tbody>/gi, ""); + if (shops != false) { $.each(shops, function(key, value){ @@ -326,8 +327,10 @@ line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked'); }); } + $("#imageList").append(line); } + $('.fancybox').fancybox(); }); {/literal} diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 614f386c2..91aac1d37 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3659,12 +3659,15 @@ class AdminProductsControllerCore extends AdminController $current_shop_id = (int)$this->context->shop->id; else $current_shop_id = 0; + + $languages = Language::getLanguages(true); $data->assign(array( 'countImages' => $count_images, 'id_product' => (int)Tools::getValue('id_product'), 'id_category_default' => (int)$this->_category->id, 'images' => $images, + 'iso_lang' => $languages[0]['iso_code'], 'token' => $this->token, 'table' => $this->table, 'max_image_size' => $this->max_image_size / 1024 / 1024, From 84d9caca81227abea564ba8f31e0cd2255779b48 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 16:29:02 +0200 Subject: [PATCH 103/644] // Blind fix --- classes/module/Module.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/module/Module.php b/classes/module/Module.php index b521e0fe4..225f492bf 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -1354,7 +1354,7 @@ abstract class ModuleCore elseif (isset($context->customer)) { $groups = $context->customer->getGroups(); - if (empty($groups)) + if (!count($groups)) $groups = array(Configuration::get('PS_UNIDENTIFIED_GROUP')); } @@ -1377,7 +1377,7 @@ abstract class ModuleCore '.(isset($billing) && $frontend ? 'AND mc.id_country = '.(int)$billing->id_country : '').' AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).' AND hm.id_shop IN('.implode(', ', $list).') - '.(count($groups) && $frontend ? 'AND (mg.`id_group` IN('.implode(', ', $groups).'))' : '').$paypal_condition.' + '.((count($groups) && $frontend) ? 'AND (mg.`id_group` IN ('.implode(', ', $groups).'))' : '').$paypal_condition.' GROUP BY hm.id_hook, hm.id_module ORDER BY hm.`position`, m.`name` DESC'); } From abf874d5760b17b5171ed8b0943ea45639c72cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Fri, 19 Jul 2013 16:30:04 +0200 Subject: [PATCH 104/644] [-] BO : FixBug #PSCFV-9049 Bad actionOrderSlipAdd hook description --- install-dev/data/xml/hook.xml | 2 +- install-dev/upgrade/sql/1.5.5.0.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml index 1139431f2..005284227 100644 --- a/install-dev/data/xml/hook.xml +++ b/install-dev/data/xml/hook.xml @@ -86,7 +86,7 @@ displayCustomerAccountCustomer account displayed in Front OfficeThis hook displays new elements on the customer account page - actionOrderSlipAddOrder slip creationThis hook is called when a product's quantity is modified + actionOrderSlipAddOrder slip creationThis hook is called when a new credit slip is added regarding client order displayProductTabTabs on product pageThis hook is called on the product page's tab diff --git a/install-dev/upgrade/sql/1.5.5.0.sql b/install-dev/upgrade/sql/1.5.5.0.sql index 934492867..152e75ea9 100644 --- a/install-dev/upgrade/sql/1.5.5.0.sql +++ b/install-dev/upgrade/sql/1.5.5.0.sql @@ -24,3 +24,5 @@ ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_i SET @id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); UPDATE `PREFIX_tab` SET id_parent = @id_parent WHERE `id_parent` = 1 AND `class_name` = 'AdminMarketing' LIMIT 1; + +UPDATE `PREFIX_hook` SET `description` = 'This hook is called when a new credit slip is added regarding client order' WHERE `name` = 'actionOrderSlipAdd'; \ No newline at end of file From b1f380c120951c2a5e2619102b53f8ad9c020748 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 19 Jul 2013 16:59:39 +0200 Subject: [PATCH 105/644] // Fixed statsforecast category distribution --- modules/statsforecast/statsforecast.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/statsforecast/statsforecast.php b/modules/statsforecast/statsforecast.php index 23b3f4c52..ddd93c921 100644 --- a/modules/statsforecast/statsforecast.php +++ b/modules/statsforecast/statsforecast.php @@ -470,7 +470,7 @@ class StatsForecast extends Module $where = ' AND co.id_zone = '.(int)$this->context->cookie->stats_id_zone.' '; } - $sql = 'SELECT SUM(od.`product_price` * od.`product_quantity` / o.conversion_rate) as orderSum, COUNT(*) AS orderQty, cl.name, AVG(od.`product_price` / o.conversion_rate) as priveAvg + $sql = 'SELECT SUM(od.`product_price` * od.`product_quantity` / o.conversion_rate) as orderSum, SUM(od.product_quantity) as orderQty, cl.name, AVG(od.`product_price` / o.conversion_rate) as priveAvg FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = od.product_id From 2f6a53f9713d1fd4725a85330740ec161b0deecf Mon Sep 17 00:00:00 2001 From: djfm Date: Fri, 19 Jul 2013 15:34:10 +0000 Subject: [PATCH 106/644] [+] TR: Created file structure for Dutch installer --- .../apple/langs/nl/data/attribute.xml | 63 ++ .../apple/langs/nl/data/attribute_group.xml | 15 + .../apple/langs/nl/data/attributegroup.xml | 21 + .../fixtures/apple/langs/nl/data/carrier.xml | 6 + .../fixtures/apple/langs/nl/data/category.xml | 27 + .../fixtures/apple/langs/nl/data/feature.xml | 18 + .../apple/langs/nl/data/feature_value.xml | 45 ++ .../apple/langs/nl/data/featurevalue.xml | 45 ++ .../fixtures/apple/langs/nl/data/image.xml | 81 ++ .../fixtures/apple/langs/nl/data/index.php | 35 + .../apple/langs/nl/data/manufacturer.xml | 17 + .../apple/langs/nl/data/order_message.xml | 12 + .../apple/langs/nl/data/ordermessage.xml | 7 + .../fixtures/apple/langs/nl/data/product.xml | 135 ++++ .../fixtures/apple/langs/nl/data/profile.xml | 15 + .../fixtures/apple/langs/nl/data/scene.xml | 12 + .../fixtures/apple/langs/nl/data/supplier.xml | 15 + .../fixtures/apple/langs/nl/data/tag.xml | 9 + install-dev/fixtures/apple/langs/nl/index.php | 35 + install-dev/langs/nl/data/carrier.xml | 6 + install-dev/langs/nl/data/category.xml | 19 + install-dev/langs/nl/data/cms.xml | 45 ++ install-dev/langs/nl/data/cms_category.xml | 11 + install-dev/langs/nl/data/configuration.xml | 21 + install-dev/langs/nl/data/contact.xml | 9 + install-dev/langs/nl/data/country.xml | 735 ++++++++++++++++++ install-dev/langs/nl/data/gender.xml | 6 + install-dev/langs/nl/data/group.xml | 6 + install-dev/langs/nl/data/index.php | 35 + install-dev/langs/nl/data/meta.xml | 159 ++++ .../langs/nl/data/order_return_state.xml | 18 + install-dev/langs/nl/data/order_state.xml | 51 ++ install-dev/langs/nl/data/profile.xml | 6 + install-dev/langs/nl/data/quick_access.xml | 8 + install-dev/langs/nl/data/risk.xml | 7 + .../langs/nl/data/stock_mvt_reason.xml | 27 + .../langs/nl/data/supplier_order_state.xml | 21 + .../langs/nl/data/supply_order_state.xml | 21 + install-dev/langs/nl/data/tab.xml | 105 +++ install-dev/langs/nl/flag.jpg | Bin 0 -> 348 bytes install-dev/langs/nl/img/index.php | 35 + .../langs/nl/img/nl-default-category.jpg | Bin 0 -> 3928 bytes install-dev/langs/nl/img/nl-default-home.jpg | Bin 0 -> 3026 bytes install-dev/langs/nl/img/nl-default-large.jpg | Bin 0 -> 5919 bytes .../langs/nl/img/nl-default-large_scene.jpg | Bin 0 -> 4298 bytes .../langs/nl/img/nl-default-medium.jpg | Bin 0 -> 1845 bytes install-dev/langs/nl/img/nl-default-small.jpg | Bin 0 -> 968 bytes .../langs/nl/img/nl-default-thickbox.jpg | Bin 0 -> 8219 bytes .../langs/nl/img/nl-default-thumb_scene.jpg | Bin 0 -> 1119 bytes install-dev/langs/nl/img/nl.jpg | Bin 0 -> 10859 bytes install-dev/langs/nl/index.php | 35 + install-dev/langs/nl/install.php | 19 + install-dev/langs/nl/language.xml | 8 + install-dev/langs/nl/mail_identifiers.txt | 10 + 54 files changed, 2036 insertions(+) create mode 100644 install-dev/fixtures/apple/langs/nl/data/attribute.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/attribute_group.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/attributegroup.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/carrier.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/category.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/feature.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/feature_value.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/featurevalue.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/image.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/index.php create mode 100644 install-dev/fixtures/apple/langs/nl/data/manufacturer.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/order_message.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/ordermessage.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/product.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/profile.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/scene.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/supplier.xml create mode 100644 install-dev/fixtures/apple/langs/nl/data/tag.xml create mode 100644 install-dev/fixtures/apple/langs/nl/index.php create mode 100644 install-dev/langs/nl/data/carrier.xml create mode 100644 install-dev/langs/nl/data/category.xml create mode 100644 install-dev/langs/nl/data/cms.xml create mode 100644 install-dev/langs/nl/data/cms_category.xml create mode 100644 install-dev/langs/nl/data/configuration.xml create mode 100644 install-dev/langs/nl/data/contact.xml create mode 100644 install-dev/langs/nl/data/country.xml create mode 100644 install-dev/langs/nl/data/gender.xml create mode 100644 install-dev/langs/nl/data/group.xml create mode 100644 install-dev/langs/nl/data/index.php create mode 100644 install-dev/langs/nl/data/meta.xml create mode 100644 install-dev/langs/nl/data/order_return_state.xml create mode 100644 install-dev/langs/nl/data/order_state.xml create mode 100644 install-dev/langs/nl/data/profile.xml create mode 100644 install-dev/langs/nl/data/quick_access.xml create mode 100644 install-dev/langs/nl/data/risk.xml create mode 100644 install-dev/langs/nl/data/stock_mvt_reason.xml create mode 100644 install-dev/langs/nl/data/supplier_order_state.xml create mode 100644 install-dev/langs/nl/data/supply_order_state.xml create mode 100644 install-dev/langs/nl/data/tab.xml create mode 100644 install-dev/langs/nl/flag.jpg create mode 100644 install-dev/langs/nl/img/index.php create mode 100644 install-dev/langs/nl/img/nl-default-category.jpg create mode 100644 install-dev/langs/nl/img/nl-default-home.jpg create mode 100644 install-dev/langs/nl/img/nl-default-large.jpg create mode 100644 install-dev/langs/nl/img/nl-default-large_scene.jpg create mode 100644 install-dev/langs/nl/img/nl-default-medium.jpg create mode 100644 install-dev/langs/nl/img/nl-default-small.jpg create mode 100644 install-dev/langs/nl/img/nl-default-thickbox.jpg create mode 100644 install-dev/langs/nl/img/nl-default-thumb_scene.jpg create mode 100644 install-dev/langs/nl/img/nl.jpg create mode 100644 install-dev/langs/nl/index.php create mode 100644 install-dev/langs/nl/install.php create mode 100644 install-dev/langs/nl/language.xml create mode 100644 install-dev/langs/nl/mail_identifiers.txt diff --git a/install-dev/fixtures/apple/langs/nl/data/attribute.xml b/install-dev/fixtures/apple/langs/nl/data/attribute.xml new file mode 100644 index 000000000..f27df851c --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/attribute.xml @@ -0,0 +1,63 @@ + + + + 2GB + + + 4GB + + + Metal + + + Blue + + + Pink + + + Green + + + Orange + + + Optional 64GB solid-state drive + + + 80GB Parallel ATA Drive @ 4200 rpm + + + 1.60GHz Intel Core 2 Duo + + + 1.80GHz Intel Core 2 Duo + + + 80GB: 20,000 Songs + + + 160GB: 40,000 Songs + + + Black + + + 8GB + + + 16GB + + + 32GB + + + Purple + + + Yellow + + + Red + + diff --git a/install-dev/fixtures/apple/langs/nl/data/attribute_group.xml b/install-dev/fixtures/apple/langs/nl/data/attribute_group.xml new file mode 100644 index 000000000..221a81bc7 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/attribute_group.xml @@ -0,0 +1,15 @@ + + + + Disk space + Disk space + + + Color + Color + + + ICU + Processor + + diff --git a/install-dev/fixtures/apple/langs/nl/data/attributegroup.xml b/install-dev/fixtures/apple/langs/nl/data/attributegroup.xml new file mode 100644 index 000000000..977fceeb7 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/attributegroup.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/install-dev/fixtures/apple/langs/nl/data/carrier.xml b/install-dev/fixtures/apple/langs/nl/data/carrier.xml new file mode 100644 index 000000000..c59766e73 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/carrier.xml @@ -0,0 +1,6 @@ + + + + Delivery next day! + + diff --git a/install-dev/fixtures/apple/langs/nl/data/category.xml b/install-dev/fixtures/apple/langs/nl/data/category.xml new file mode 100644 index 000000000..eeae63831 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/category.xml @@ -0,0 +1,27 @@ + + + + iPods + Now that you can buy movies from the iTunes Store and sync them to your iPod, the whole world is your theater. + music-ipods + + + + + + Accessories + Wonderful accessories for your iPod + accessories-ipod + + + + + + Laptops + The latest Intel processor, a bigger hard drive, plenty of memory, and even more new features all fit inside just one liberating inch. The new Mac laptops have the performance, power, and connectivity of a desktop computer. Without the desk part. + laptops + Apple laptops + Apple laptops MacBook Air + Powerful and chic Apple laptops + + diff --git a/install-dev/fixtures/apple/langs/nl/data/feature.xml b/install-dev/fixtures/apple/langs/nl/data/feature.xml new file mode 100644 index 000000000..7682c6495 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/feature.xml @@ -0,0 +1,18 @@ + + + + Height + + + Width + + + Depth + + + Weight + + + Headphone + + diff --git a/install-dev/fixtures/apple/langs/nl/data/feature_value.xml b/install-dev/fixtures/apple/langs/nl/data/feature_value.xml new file mode 100644 index 000000000..d3a824d22 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/feature_value.xml @@ -0,0 +1,45 @@ + + + + Jack stereo + + + Mini-jack stereo + + + 2.75 in + + + 2.06 in + + + 49.2 g + + + 0.26 in + + + 1.07 in + + + 1.62 in + + + 15.5 g + + + 0.41 in (clip included) + + + 4.33 in + + + 2.76 in + + + 120g + + + 0.31 in + + diff --git a/install-dev/fixtures/apple/langs/nl/data/featurevalue.xml b/install-dev/fixtures/apple/langs/nl/data/featurevalue.xml new file mode 100644 index 000000000..d101bed96 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/featurevalue.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/install-dev/fixtures/apple/langs/nl/data/image.xml b/install-dev/fixtures/apple/langs/nl/data/image.xml new file mode 100644 index 000000000..49a836dc3 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/image.xml @@ -0,0 +1,81 @@ + + + + MacBook Air + + + MacBook Air + + + MacBook Air + + + MacBook Air + + + MacBook Air + + + MacBook Air SuperDrive + + + iPod touch + + + iPod touch + + + iPod touch + + + iPod touch + + + iPod touch + + + iPod touch + + + housse-portefeuille-en-cuir + + + Shure SE210 Sound-Isolating Earphones for iPod and iPhone + + + iPod Nano + + + iPod Nano + + + iPod Nano + + + iPod Nano + + + iPod Nano + + + iPod Nano + + + iPod Nano + + + iPod Nano + + + iPod shuffle + + + iPod shuffle + + + iPod shuffle + + + iPod shuffle + + diff --git a/install-dev/fixtures/apple/langs/nl/data/index.php b/install-dev/fixtures/apple/langs/nl/data/index.php new file mode 100644 index 000000000..fcb7f5c2b --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../../../../'); +exit; \ No newline at end of file diff --git a/install-dev/fixtures/apple/langs/nl/data/manufacturer.xml b/install-dev/fixtures/apple/langs/nl/data/manufacturer.xml new file mode 100644 index 000000000..f06ff9661 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/manufacturer.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/install-dev/fixtures/apple/langs/nl/data/order_message.xml b/install-dev/fixtures/apple/langs/nl/data/order_message.xml new file mode 100644 index 000000000..93ad3b501 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/order_message.xml @@ -0,0 +1,12 @@ + + + + Delay + Hi, + +Unfortunately, an item on your order is currently out of stock. This may cause a slight delay in delivery. +Please accept our apologies and rest assured that we are working hard to rectify this. + +Best regards, + + diff --git a/install-dev/fixtures/apple/langs/nl/data/ordermessage.xml b/install-dev/fixtures/apple/langs/nl/data/ordermessage.xml new file mode 100644 index 000000000..e743f5d97 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/ordermessage.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/install-dev/fixtures/apple/langs/nl/data/product.xml b/install-dev/fixtures/apple/langs/nl/data/product.xml new file mode 100644 index 000000000..0c405b001 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/product.xml @@ -0,0 +1,135 @@ + + + + <p><strong><span style="font-size: small;">Curved ahead of the curve.</span></strong></p> +<p>For those about to rock, we give you nine amazing colors. But that's only part of the story. Feel the curved, all-aluminum and glass design and you won't want to put iPod nano down.</p> +<p><strong><span style="font-size: small;">Great looks. And brains, too.</span></strong></p> +<p>The new Genius feature turns iPod nano into your own highly intelligent, personal DJ. It creates playlists by finding songs in your library that go great together.</p> +<p><strong><span style="font-size: small;">Made to move with your moves.</span></strong></p> +<p>The accelerometer comes to iPod nano. Give it a shake to shuffle your music. Turn it sideways to view Cover Flow. And play games designed with your moves in mind.</p> + <p>New design. New features. Now in 8GB and 16GB. iPod nano rocks like never before.</p> + ipod-nano + + + + iPod Nano + In stock + + + + <p><span style="font-size: small;"><strong>Instant attachment.</strong></span></p> +<p>Wear up to 500 songs on your sleeve. Or your belt. Or your gym shorts. iPod shuffle is a badge of musical devotion. Now in new, more brilliant colors.</p> +<p><span style="font-size: small;"><strong>Feed your iPod shuffle.</strong></span></p> +<p>iTunes is your entertainment superstore. It’s your ultra-organized music collection and jukebox. And it’s how you load up your iPod shuffle in one click.</p> +<p><span style="font-size: small;"><strong>Beauty and the beat.</strong></span></p> +<p>Intensely colorful anodized aluminum complements the simple design of iPod shuffle. Now in blue, green, pink, red, and original silver.</p> + <p>iPod shuffle, the world’s most wearable music player, now clips on in more vibrant blue, green, pink, and red.</p> + ipod-shuffle + + + + iPod shuffle + In stock + + + + <p>MacBook Air is nearly as thin as your index finger. Practically every detail that could be streamlined has been. Yet it still has a 13.3-inch widescreen LED display, full-size keyboard, and large multi-touch trackpad. It’s incomparably portable without the usual ultraportable screen and keyboard compromises.</p><p>The incredible thinness of MacBook Air is the result of numerous size- and weight-shaving innovations. From a slimmer hard drive to strategically hidden I/O ports to a lower-profile battery, everything has been considered and reconsidered with thinness in mind.</p><p>MacBook Air is designed and engineered to take full advantage of the wireless world. A world in which 802.11n Wi-Fi is now so fast and so available, people are truly living untethered — buying and renting movies online, downloading software, and sharing and storing files on the web. </p> + MacBook Air is ultrathin, ultraportable, and ultra unlike anything else. But you don’t lose inches and pounds overnight. It’s the result of rethinking conventions. Of multiple wireless innovations. And of breakthrough design. With MacBook Air, mobile computing suddenly has a new standard. + macbook-air + + + + MacBook Air + + + + + Every MacBook has a larger hard drive, up to 250GB, to store growing media collections and valuable data.<br /><br />The 2.4GHz MacBook models now include 2GB of memory standard — perfect for running more of your favorite applications smoothly. + MacBook makes it easy to hit the road thanks to its tough polycarbonate case, built-in wireless technologies, and innovative MagSafe Power Adapter that releases automatically if someone accidentally trips on the cord. + macbook + + + + MacBook + + + + + <h3>Five new hands-on applications</h3> +<p>View rich HTML email with photos as well as PDF, Word, and Excel attachments. Get maps, directions, and real-time traffic information. Take notes and read stock and weather reports.</p> +<h3>Touch your music, movies, and more</h3> +<p>The revolutionary Multi-Touch technology built into the gorgeous 3.5-inch display lets you pinch, zoom, scroll, and flick with your fingers.</p> +<h3>Internet in your pocket</h3> +<p>With the Safari web browser, see websites the way they were designed to be seen and zoom in and out with a tap.<sup>2</sup> And add Web Clips to your Home screen for quick access to favorite sites.</p> +<h3>What's in the box</h3> +<ul> +<li><span></span>iPod touch</li> +<li><span></span>Earphones</li> +<li><span></span>USB 2.0 cable</li> +<li><span></span>Dock adapter</li> +<li><span></span>Polishing cloth</li> +<li><span></span>Stand</li> +<li><span></span>Quick Start guide</li> +</ul> + <ul> +<li>Revolutionary Multi-Touch interface</li> +<li>3.5-inch widescreen color display</li> +<li>Wi-Fi (802.11b/g)</li> +<li>8 mm thin</li> +<li>Safari, YouTube, Mail, Stocks, Weather, Notes, iTunes Wi-Fi Music Store, Maps</li> +</ul> + ipod-touch + + + + iPod touch + + + + + <p>Lorem ipsum</p> + <p>Lorem ipsum</p> + belkin-leather-folio-for-ipod-nano-black-chocolate + + + + Belkin Leather Folio for iPod nano - Black / Chocolate + + + + + <div class="product-overview-full">Using Hi-Definition MicroSpeakers to deliver full-range audio, the ergonomic and lightweight design of the SE210 earphones is ideal for premium on-the-go listening on your iPod or iPhone. They offer the most accurate audio reproduction from both portable and home stereo audio sources--for the ultimate in precision highs and rich low end. In addition, the flexible design allows you to choose the most comfortable fit from a variety of wearing positions. <br /> <br /> <strong>Features </strong> <br /> +<ul> +<li>Sound-isolating design </li> +<li> Hi-Definition MicroSpeaker with a single balanced armature driver </li> +<li> Detachable, modular cable so you can make the cable longer or shorter depending on your activity </li> +<li> Connector compatible with earphone ports on both iPod and iPhone </li> +</ul> +<strong>Specifications </strong><br /> +<ul> +<li>Speaker type: Hi-Definition MicroSpeaker </li> +<li> Frequency range: 25Hz-18.5kHz </li> +<li> Impedance (1kHz): 26 Ohms </li> +<li> Sensitivity (1mW): 114 dB SPL/mW </li> +<li> Cable length (with extension): 18.0 in./45.0 cm (54.0 in./137.1 cm) </li> +</ul> +<strong>In the box</strong><br /> +<ul> +<li>Shure SE210 earphones </li> +<li> Extension cable (36.0 in./91.4 cm) </li> +<li> Three pairs foam earpiece sleeves (small, medium, large) </li> +<li> Three pairs soft flex earpiece sleeves (small, medium, large) </li> +<li> One pair triple-flange earpiece sleeves </li> +<li> Carrying case </li> +</ul> +Warranty<br /> Two-year limited <br />(For details, please visit <br />www.shure.com/PersonalAudio/CustomerSupport/ProductReturnsAndWarranty/index.htm.) <br /><br /> Mfr. Part No.: SE210-A-EFS <br /><br />Note: Products sold through this website that do not bear the Apple Brand name are serviced and supported exclusively by their manufacturers in accordance with terms and conditions packaged with the products. Apple's Limited Warranty does not apply to products that are not Apple-branded, even if packaged or sold with Apple products. Please contact the manufacturer directly for technical support and customer service.</div> + <p>Evolved from personal monitor technology road-tested by pro musicians and perfected by Shure engineers, the lightweight and stylish SE210 delivers full-range audio that's free from outside noise.</p> + ecouteurs-a-isolation-sonore-shure-se210-blanc + + + + Shure SE210 Sound-Isolating Earphones for iPod and iPhone + + + + diff --git a/install-dev/fixtures/apple/langs/nl/data/profile.xml b/install-dev/fixtures/apple/langs/nl/data/profile.xml new file mode 100644 index 000000000..02aa4d76c --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/profile.xml @@ -0,0 +1,15 @@ + + + + Administrator + + + Logistician + + + Translator + + + Salesman + + diff --git a/install-dev/fixtures/apple/langs/nl/data/scene.xml b/install-dev/fixtures/apple/langs/nl/data/scene.xml new file mode 100644 index 000000000..f7270d3ff --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/scene.xml @@ -0,0 +1,12 @@ + + + + The iPods Nano + + + The iPods + + + The MacBooks + + diff --git a/install-dev/fixtures/apple/langs/nl/data/supplier.xml b/install-dev/fixtures/apple/langs/nl/data/supplier.xml new file mode 100644 index 000000000..e9db64034 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/supplier.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/install-dev/fixtures/apple/langs/nl/data/tag.xml b/install-dev/fixtures/apple/langs/nl/data/tag.xml new file mode 100644 index 000000000..b781c0ed2 --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/data/tag.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/install-dev/fixtures/apple/langs/nl/index.php b/install-dev/fixtures/apple/langs/nl/index.php new file mode 100644 index 000000000..67d9932bf --- /dev/null +++ b/install-dev/fixtures/apple/langs/nl/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../../../'); +exit; \ No newline at end of file diff --git a/install-dev/langs/nl/data/carrier.xml b/install-dev/langs/nl/data/carrier.xml new file mode 100644 index 000000000..343fa6f51 --- /dev/null +++ b/install-dev/langs/nl/data/carrier.xml @@ -0,0 +1,6 @@ + + + + Pick up in-store + + diff --git a/install-dev/langs/nl/data/category.xml b/install-dev/langs/nl/data/category.xml new file mode 100644 index 000000000..87b90b95e --- /dev/null +++ b/install-dev/langs/nl/data/category.xml @@ -0,0 +1,19 @@ + + + + Root + + root + + + + + + Home + + home + + + + + diff --git a/install-dev/langs/nl/data/cms.xml b/install-dev/langs/nl/data/cms.xml new file mode 100644 index 000000000..37edee2c4 --- /dev/null +++ b/install-dev/langs/nl/data/cms.xml @@ -0,0 +1,45 @@ + + + + Delivery + Our terms and conditions of delivery + conditions, delivery, delay, shipment, pack + <h2>Shipments and returns</h2><h3>Your pack shipment</h3><p>Packages are generally dispatched within 2 days after receipt of payment and are shipped via UPS with tracking and drop-off without signature. If you prefer delivery by UPS Extra with required signature, an additional cost will be applied, so please contact us before choosing this method. Whichever shipment choice you make, we will provide you with a link to track your package online.</p><p>Shipping fees include handling and packing fees as well as postage costs. Handling fees are fixed, whereas transport fees vary according to total weight of the shipment. We advise you to group your items in one order. We cannot group two distinct orders placed separately, and shipping fees will apply to each of them. Your package will be dispatched at your own risk, but special care is taken to protect fragile objects.<br /><br />Boxes are amply sized and your items are well-protected.</p> + delivery + + + Legal Notice + Legal notice + notice, legal, credits + <h2>Legal</h2><h3>Credits</h3><p>Concept and production:</p><p>This Web site was created using <a href="http://www.prestashop.com">PrestaShop</a>&trade; open-source software.</p> + legal-notice + + + Terms and conditions of use + Our terms and conditions of use + conditions, terms, use, sell + <h2>Your terms and conditions of use</h2><h3>Rule 1</h3><p>Here is the rule 1 content</p> +<h3>Rule 2</h3><p>Here is the rule 2 content</p> +<h3>Rule 3</h3><p>Here is the rule 3 content</p> + terms-and-conditions-of-use + + + About us + Learn more about us + about us, informations + <h2>About us</h2> +<h3>Our company</h3><p>Our company</p> +<h3>Our team</h3><p>Our team</p> +<h3>Informations</h3><p>Informations</p> + about-us + + + Secure payment + Our secure payment mean + secure payment, ssl, visa, mastercard, paypal + <h2>Secure payment</h2> +<h3>Our secure payment</h3><p>With SSL</p> +<h3>Using Visa/Mastercard/Paypal</h3><p>About this services</p> + secure-payment + + diff --git a/install-dev/langs/nl/data/cms_category.xml b/install-dev/langs/nl/data/cms_category.xml new file mode 100644 index 000000000..ceb8cf491 --- /dev/null +++ b/install-dev/langs/nl/data/cms_category.xml @@ -0,0 +1,11 @@ + + + + Home + + home + + + + + diff --git a/install-dev/langs/nl/data/configuration.xml b/install-dev/langs/nl/data/configuration.xml new file mode 100644 index 000000000..ef31b5d07 --- /dev/null +++ b/install-dev/langs/nl/data/configuration.xml @@ -0,0 +1,21 @@ + + + + IN + + + DE + + + a|the|of|on|in|and|to + + + 0 + + + Dear Customer, + +Regards, +Customer service + + diff --git a/install-dev/langs/nl/data/contact.xml b/install-dev/langs/nl/data/contact.xml new file mode 100644 index 000000000..bdc0b24d9 --- /dev/null +++ b/install-dev/langs/nl/data/contact.xml @@ -0,0 +1,9 @@ + + + + If a technical problem occurs on this website + + + For any question about a product, an order + + diff --git a/install-dev/langs/nl/data/country.xml b/install-dev/langs/nl/data/country.xml new file mode 100644 index 000000000..d57ea1e36 --- /dev/null +++ b/install-dev/langs/nl/data/country.xml @@ -0,0 +1,735 @@ + + + + Germany + + + Austria + + + Belgium + + + Canada + + + China + + + Spain + + + Finland + + + France + + + Greece + + + Italy + + + Japan + + + Luxemburg + + + Netherlands + + + Poland + + + Portugal + + + Czech Republic + + + United Kingdom + + + Sweden + + + Switzerland + + + Denmark + + + United States + + + HongKong + + + Norway + + + Australia + + + Singapore + + + Ireland + + + New Zealand + + + South Korea + + + Israel + + + South Africa + + + Nigeria + + + Ivory Coast + + + Togo + + + Bolivia + + + Mauritius + + + Romania + + + Slovakia + + + Algeria + + + American Samoa + + + + Angola + + + Anguilla + + + Antigua and Barbuda + + + Argentina + + + Armenia + + + Aruba + + + Azerbaijan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belize + + + Benin + + + Bermuda + + + Bhutan + + + Botswana + + + Brazil + + + Brunei + + + Burkina Faso + + + Burma (Myanmar) + + + Burundi + + + Cambodia + + + Cameroon + + + Cape Verde + + + Central African Republic + + + Chad + + + Chile + + + Colombia + + + Comoros + + + Congo, Dem. Republic + + + Congo, Republic + + + Costa Rica + + + Croatia + + + Cuba + + + Cyprus + + + Djibouti + + + Dominica + + + Dominican Republic + + + East Timor + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Ethiopia + + + Falkland Islands + + + Faroe Islands + + + Fiji + + + Gabon + + + Gambia + + + Georgia + + + Ghana + + + Grenada + + + Greenland + + + Gibraltar + + + Guadeloupe + + + Guam + + + Guatemala + + + Guernsey + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Heard Island and McDonald Islands + + + Vatican City State + + + Honduras + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Man Island + + + Jamaica + + + Jersey + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + Korea, Dem. Republic of + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Macau + + + Macedonia + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + Marshall Islands + + + Martinique + + + Mauritania + + + Hungary + + + Mayotte + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Montserrat + + + Morocco + + + Mozambique + + + Namibia + + + Nauru + + + Nepal + + + Netherlands Antilles + + + New Caledonia + + + Nicaragua + + + Niger + + + Niue + + + Norfolk Island + + + Northern Mariana Islands + + + Oman + + + Pakistan + + + Palau + + + Palestinian Territories + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + Philippines + + + Pitcairn + + + Puerto Rico + + + Qatar + + + Reunion Island + + + Russian Federation + + + Rwanda + + + Saint Barthelemy + + + Saint Kitts and Nevis + + + Saint Lucia + + + Saint Martin + + + Saint Pierre and Miquelon + + + Saint Vincent and the Grenadines + + + Samoa + + + San Marino + + + São Tomé and Príncipe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Slovenia + + + Solomon Islands + + + Somalia + + + South Georgia and the South Sandwich Islands + + + Sri Lanka + + + Sudan + + + Suriname + + + Svalbard and Jan Mayen + + + Swaziland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Tokelau + + + Tonga + + + Trinidad and Tobago + + + Tunisia + + + Turkey + + + Turkmenistan + + + Turks and Caicos Islands + + + Tuvalu + + + Uganda + + + Ukraine + + + United Arab Emirates + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Venezuela + + + Vietnam + + + Virgin Islands (British) + + + Virgin Islands (U.S.) + + + Wallis and Futuna + + + Western Sahara + + + Yemen + + + Zambia + + + Zimbabwe + + + Albania + + + Afghanistan + + + Antarctica + + + Bosnia and Herzegovina + + + Bouvet Island + + + British Indian Ocean Territory + + + Bulgaria + + + Cayman Islands + + + Christmas Island + + + Cocos (Keeling) Islands + + + Cook Islands + + + French Guiana + + + French Polynesia + + + French Southern Territories + + + Åland Islands + + diff --git a/install-dev/langs/nl/data/gender.xml b/install-dev/langs/nl/data/gender.xml new file mode 100644 index 000000000..75fc2ed2a --- /dev/null +++ b/install-dev/langs/nl/data/gender.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/install-dev/langs/nl/data/group.xml b/install-dev/langs/nl/data/group.xml new file mode 100644 index 000000000..2d1b70934 --- /dev/null +++ b/install-dev/langs/nl/data/group.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/install-dev/langs/nl/data/index.php b/install-dev/langs/nl/data/index.php new file mode 100644 index 000000000..10edbfe91 --- /dev/null +++ b/install-dev/langs/nl/data/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../../'); +exit; \ No newline at end of file diff --git a/install-dev/langs/nl/data/meta.xml b/install-dev/langs/nl/data/meta.xml new file mode 100644 index 000000000..bae593782 --- /dev/null +++ b/install-dev/langs/nl/data/meta.xml @@ -0,0 +1,159 @@ + + + + 404 error + This page cannot be found + error, 404, not found + page-not-found + + + Best sales + Our best sales + best sales + best-sales + + + Contact us + Use our form to contact us + contact, form, e-mail + contact-us + + + + <description>Shop powered by PrestaShop</description> + <keywords>shop, prestashop</keywords> + <url_rewrite/> + </meta> + <meta id="manufacturer" id_shop="1"> + <title>Manufacturers + Manufacturers list + manufacturer + manufacturers + + + New products + Our new products + new, products + new-products + + + Forgot your password + Enter your e-mail address used to register in goal to get e-mail with your new password + forgot, password, e-mail, new, reset + password-recovery + + + Prices drop + Our special products + special, prices drop + prices-drop + + + Sitemap + Lost ? Find what your are looking for + sitemap + sitemap + + + Suppliers + Suppliers list + supplier + supplier + + + Address + + + address + + + Addresses + + + addresses + + + Authentication + + + authentication + + + Cart + + + cart + + + Discount + + + discount + + + Order history + + + order-history + + + Identity + + + identity + + + My account + + + my-account + + + Order follow + + + order-follow + + + Order slip + + + order-slip + + + Order + + + order + + + Search + + + search + + + Stores + + + stores + + + Order + + + quick-order + + + Guest tracking + + + guest-tracking + + + Order confirmation + + + order-confirmation + + diff --git a/install-dev/langs/nl/data/order_return_state.xml b/install-dev/langs/nl/data/order_return_state.xml new file mode 100644 index 000000000..37ad31de9 --- /dev/null +++ b/install-dev/langs/nl/data/order_return_state.xml @@ -0,0 +1,18 @@ + + + + Waiting for confirmation + + + Waiting for package + + + Package received + + + Return denied + + + Return completed + + diff --git a/install-dev/langs/nl/data/order_state.xml b/install-dev/langs/nl/data/order_state.xml new file mode 100644 index 000000000..c44dc3358 --- /dev/null +++ b/install-dev/langs/nl/data/order_state.xml @@ -0,0 +1,51 @@ + + + + Awaiting cheque payment + + + + Payment accepted + + + + Preparation in progress + + + + Shipped + + + + Delivered +