diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php index 581553cb3..e62ed3622 100644 --- a/admin-dev/header.inc.php +++ b/admin-dev/header.inc.php @@ -84,6 +84,7 @@ echo ' + diff --git a/admin-dev/tabs/AdminCategories.php b/admin-dev/tabs/AdminCategories.php index 195b43a3a..4f5e8d55d 100644 --- a/admin-dev/tabs/AdminCategories.php +++ b/admin-dev/tabs/AdminCategories.php @@ -214,13 +214,16 @@ class AdminCategories extends AdminTab -
- -
+
'; + // Translations are not automatic for the moment ;) + $trads = array( + 'Home' => $this->l('Home'), + 'selected' => $this->l('selected'), + 'Collapse All' => $this->l('Collapse All'), + 'Expand All' => $this->l('Expand All') + ); + echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : 1), 'id_parent', true); + echo '
'; foreach ($this->_languages AS $language) diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index 476d61197..5812d7938 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -2830,7 +2830,7 @@ class AdminProducts extends AdminTab
- '.$this->l('Short description:').'

('.$this->l('appears in search results').') + '.$this->l('Short description:').'

('.$this->l('appears in the product lists and on the top of the product page').') '; foreach ($this->_languages as $language) echo '
@@ -2840,7 +2840,7 @@ class AdminProducts extends AdminTab - '.$this->l('Description:').' + '.$this->l('Description:').'

('.$this->l('appears in the body of the product page').') '; foreach ($this->_languages as $language) echo '
diff --git a/admin-dev/tabs/AdminSearch.php b/admin-dev/tabs/AdminSearch.php index 8ebe48dc9..ea856e342 100644 --- a/admin-dev/tabs/AdminSearch.php +++ b/admin-dev/tabs/AdminSearch.php @@ -28,6 +28,19 @@ class AdminSearch extends AdminTab { + public function searchIP($query) + { + if (!ip2long(trim($query))) + return; + + $this->_list['customers'] = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT c.* + FROM `'._DB_PREFIX_.'customer` c + LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.id_customer = c.id_customer + LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.id_guest = co.id_guest + WHERE co.`ip_address` = \''.ip2long(trim($query)).'\''); + } + /** * Search a specific string in the products and categories * @@ -120,9 +133,7 @@ class AdminSearch extends AdminTab 'reference' => array('title' => $this->l('Reference')), 'name' => array('title' => $this->l('Name')), 'price' => array('title' => $this->l('Price')), - 'tax' => array('title' => $this->l('Tax')), 'stock' => array('title' => $this->l('Stock')), - 'weight' => array('title' => $this->l('Weight')), 'status' => array('title' => $this->l('Status')), 'action' => array('title' => $this->l('Actions')) )); @@ -137,7 +148,7 @@ class AdminSearch extends AdminTab } /* Customer */ - if (!$searchType OR $searchType == 2) + if (!$searchType OR $searchType == 2 OR $searchType == 6) { $this->fieldsDisplay['customers'] = (array( 'ID' => array('title' => $this->l('ID')), @@ -151,6 +162,8 @@ class AdminSearch extends AdminTab 'actions' => array('title' => $this->l('Actions')) )); + if (!$searchType OR $searchType == 2) + { /* Handle customer ID */ if ($searchType AND (int)$query AND Validate::isUnsignedInt((int)$query)) if ($customer = new Customer((int)$query) AND Validate::isLoadedObject($customer)) @@ -160,6 +173,10 @@ class AdminSearch extends AdminTab $this->searchCustomer($query); } + if ($searchType == 6) + $this->searchIP($query); + } + /* Order */ if ($searchType == 3) { @@ -183,6 +200,9 @@ class AdminSearch extends AdminTab Tools::redirectAdmin('index.php?tab=AdminCarts&id_cart='.(int)($cart->id).'&viewcart'.'&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)$this->context->employee->id)); $this->_errors[] = Tools::displayError('No cart found with this ID:').' '.Tools::htmlentitiesUTF8($query); } + + /* IP */ + // 6 - but it is included in the customer block } } @@ -222,9 +242,7 @@ class AdminSearch extends AdminTab '.$product['reference'].' '.stripslashes($product['nameh']).' '.Tools::displayPrice($product['price'], $this->context->currency).' - '.stripslashes($product['tax_name']).' '.$product['quantity'].' - '.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').' diff --git a/admin-dev/tabs/AdminTranslations.php b/admin-dev/tabs/AdminTranslations.php index ee2c9a900..ffa13b03f 100644 --- a/admin-dev/tabs/AdminTranslations.php +++ b/admin-dev/tabs/AdminTranslations.php @@ -50,7 +50,8 @@ class AdminTranslations extends AdminTab { parent::__construct(); self::$tpl_regexp = '/\{l s=\''._PS_TRANS_PATTERN_.'\'( mod=\'.+\')?( js=1)?\}/U'; - self::$php_regexp = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, \'(.+)\')?(, (.+))?\)/U'; + // added ? after spaces because some peoples forget them. see PSCFI-2501 + self::$php_regexp = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U'; } /** diff --git a/classes/GroupReduction.php b/classes/GroupReduction.php index 406611f7a..08a386038 100644 --- a/classes/GroupReduction.php +++ b/classes/GroupReduction.php @@ -199,7 +199,7 @@ class GroupReductionCore extends ObjectModel WHERE pgr.`id_product` = '.(int)$id_product_old ); if (!$row) - return false; + return true; $query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES '; $query .= '('.(int)($id_product).', '.(int)($row['id_group']).', '.(float)($row['reduction']).')'; diff --git a/classes/Helper.php b/classes/Helper.php index 85ab54aec..3c52ab550 100755 --- a/classes/Helper.php +++ b/classes/Helper.php @@ -59,8 +59,11 @@ class HelperCore * @param type $input_name name of input * @return string */ - public static function renderAdminCategorieTree($trads, $selected_cat = array(), $input_name = 'categoryBox') + public static function renderAdminCategorieTree($trads, $selected_cat = array(), $input_name = 'categoryBox', $use_radio = false) { + if (!$use_radio) + $input_name = $input_name.'[]'; + $html = ' @@ -68,11 +71,18 @@ class HelperCore - '; @@ -81,8 +91,10 @@ class HelperCore
'.$trads['Collapse All'].' - '.$trads['Expand All'].' + '.(!$use_radio ? ' - '.$trads['Check All'].' - '.$trads['Uncheck All'].' + ' : '').'
'; @@ -92,14 +104,14 @@ class HelperCore if (is_array($cat)) { if ($cat['id_category'] != 1) - $html .= ''; + $html .= ''; else $home_is_selected = true; } else { if ($cat != 1) - $html .= ''; + $html .= ''; else $home_is_selected = true; } @@ -107,7 +119,7 @@ class HelperCore $html .= '
  • - '.$trads['Home'].' + '.$trads['Home'].'
    •  
    diff --git a/classes/Language.php b/classes/Language.php index 231e2d69a..e34986235 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -117,13 +117,43 @@ class LanguageCore extends ObjectModel if (file_exists(_PS_MAIL_DIR_.$this->iso_code)) rename(_PS_MAIL_DIR_.$this->iso_code, _PS_MAIL_DIR_.$newIso); - foreach (Module::getModulesDirOnDisk() as $moduleDir) { + $modulesList = Module::getModulesDirOnDisk(); + foreach ($modulesList as $moduleDir) + { if (file_exists(_PS_MODULE_DIR_.$moduleDir.'/mails/'.$this->iso_code)) rename(_PS_MODULE_DIR_.$moduleDir.'/mails/'.$this->iso_code, _PS_MODULE_DIR_.$moduleDir.'/mails/'.$newIso); if (file_exists(_PS_MODULE_DIR_.$moduleDir.'/'.$this->iso_code.'.php')) rename(_PS_MODULE_DIR_.$moduleDir.'/'.$this->iso_code.'.php', _PS_MODULE_DIR_.$moduleDir.'/'.$newIso.'.php'); } + + foreach ($this->_getThemesList() as $theme => $data) + { + if (file_exists(_PS_ALL_THEMES_DIR_.$theme.'/lang/'.$this->iso_code.'.php')) + rename(_PS_ALL_THEMES_DIR_.$theme.'/lang/'.$this->iso_code.'.php', _PS_ALL_THEMES_DIR_.$theme.'/lang/'.$newIso.'.php'); + + if (file_exists(_PS_ALL_THEMES_DIR_.$theme.'/mails/'.$this->iso_code)) + rename(_PS_ALL_THEMES_DIR_.$theme.'/mails/'.$this->iso_code, _PS_ALL_THEMES_DIR_.$theme.'/mails/'.$newIso); + + foreach ($modulesList as $module) + if (file_exists(_PS_ALL_THEMES_DIR_.$theme.'/modules/'.$module.'/'.$this->iso_code.'.php')) + rename(_PS_ALL_THEMES_DIR_.$theme.'/modules/'.$module.'/'.$this->iso_code.'.php', _PS_ALL_THEMES_DIR_.$theme.'/modules/'.$module.'/'.$newIso.'.php'); + } + } + + /** + * Return an array with themes and thumbnails + * + * @return array + */ + private function _getThemesList() + { + $dir = opendir(_PS_ALL_THEMES_DIR_); + while ($folder = readdir($dir)) + if ($folder != '.' AND $folder != '..' AND file_exists(_PS_ALL_THEMES_DIR_.'/'.$folder.'/preview.jpg')) + $themes[$folder]['name'] = $folder; + closedir($dir); + return isset($themes) ? $themes : array(); } public function add($autodate = true, $nullValues = false) diff --git a/classes/Product.php b/classes/Product.php index dcf34d7bd..ee4b4d109 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -549,7 +549,7 @@ class ProductCore extends ObjectModel if ($die) die (Tools::displayError().' ('.get_class($this).'->description: length > '.$limit.' for language '.$k.')'); return $errorReturn ? get_class($this).'->'.Tools::displayError('description: length >').' '.$limit.' '.Tools::displayError('for language').' '.$k : false; } - return $this->validateFieldsLang($die, $errorReturn); + return parent::validateFieldsLang($die, $errorReturn); } public function delete() @@ -880,13 +880,14 @@ class ProductCore extends ObjectModel $price = str_replace(',', '.', $price); $weight = str_replace(',', '.', $weight); + Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', array( - 'id_product' => $this->id, + 'id_product' => (int)$this->id, 'price' => (float)$price, 'ecotax' => (float)$ecotax, - 'quantity' => (int)$quantity, - 'weight' => $weight ? (float)$weight : 0, - 'unit_price_impact' => $unit_impact ? (float)$unit_impact : 0, + 'quantity' => 0, + 'weight' => ($weight ? (float)$weight : 0), + 'unit_price_impact' => ($unit_impact ? (float)$unit_impact : 0), 'reference' => pSQL($reference), 'supplier_reference' => pSQL($supplier_reference), 'location' => pSQL($location), @@ -894,12 +895,16 @@ class ProductCore extends ObjectModel 'upc' => pSQL($upc), 'default_on' => (int)$default ), 'INSERT'); + $id_product_attribute = Db::getInstance()->Insert_ID(); $this->setStock($quantity, $id_product_attribute); Product::updateDefaultAttribute($this->id); if (!$id_product_attribute) return false; + + $this->addStockMvt((int)$quantity, 1, $id_product_attribute); + if (empty($id_images)) return (int)($id_product_attribute); $query = 'INSERT INTO `'._DB_PREFIX_.'product_attribute_image` (`id_product_attribute`, `id_image`) VALUES '; @@ -2432,23 +2437,18 @@ class ProductCore extends ObjectModel if (!$context) $context = Context::getContext(); - $sql = 'SELECT p.`id_product`, pl.`name`, pl.`link_rewrite`, p.`weight`, p.`active`, p.`ecotax`, i.`id_image`, p.`reference`, p.`cache_is_pack`, - il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name + $sql = 'SELECT p.`id_product`, pl.`name`, p.`active`, p.`reference`, m.`name` AS manufacturer_name, stock.quantity FROM `'._DB_PREFIX_.'category_product` cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` '.$context->shop->sqlAsso('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.$context->shop->sqlLang('pl').') - LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` - AND tr.`id_country` = '.(int)Context::getContext()->country->id.' - AND tr.`id_state` = 0) - LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) - LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` - LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`) AND i.`cover` = 1 - LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.`id_product` = p.`id_product` + '.Product::sqlStock('p', 'pa', false, $context->shop).' WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' + OR pa.`reference` LIKE \'%'.pSQL($query).'%\' GROUP BY `id_product` ORDER BY pl.`name` ASC'; $result = Db::getInstance()->ExecuteS($sql); @@ -2460,7 +2460,6 @@ class ProductCore extends ObjectModel foreach ($result AS $row) { $row['price'] = Product::getPriceStatic($row['id_product'], true, NULL, 2); - $row['quantity'] = Product::getQuantity($row['id_product'], NULL, $row['cache_is_pack']); $resultsArray[] = $row; } return $resultsArray; diff --git a/classes/Tools.php b/classes/Tools.php index 61e62e56a..6f1c3b158 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -646,6 +646,7 @@ class ToolsCore /* Categories specifics meta tags */ elseif ($id_category = self::getValue('id_category')) { + $page_number = self::getValue('p'); $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description` FROM `'._DB_PREFIX_.'category_lang` @@ -654,13 +655,16 @@ class ToolsCore { if (empty($row['meta_description'])) $row['meta_description'] = strip_tags($row['description']); - return self::completeMetaTags($row, $row['name']); + $row['meta_title'] .= $row['name'] . (!empty($page_number) ? ' ('.$page_number.')' : ''); + $row['meta_title'] .= ' - '.Configuration::get('PS_SHOP_NAME'); + return self::completeMetaTags($row, $row['meta_title']); } } /* Manufacturers specifics meta tags */ elseif ($id_manufacturer = self::getValue('id_manufacturer')) { + $page_number = self::getValue('p'); $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT `name`, `meta_title`, `meta_description`, `meta_keywords` FROM `'._DB_PREFIX_.'manufacturer_lang` ml @@ -670,9 +674,9 @@ class ToolsCore { if (empty($row['meta_description'])) $row['meta_description'] = strip_tags($row['meta_description']); - if (!empty($row['meta_title'])) - $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME'); - return self::completeMetaTags($row, $row['name']); + $row['meta_title'] .= $row['name'] . (!empty($page_number) ? ' ('.$page_number.')' : ''); + $row['meta_title'] .= ' - '.Configuration::get('PS_SHOP_NAME'); + return self::completeMetaTags($row, $row['meta_title']); } } diff --git a/js/admin-categories-tree.js b/js/admin-categories-tree.js index 53a1dbdb4..3137cc982 100755 --- a/js/admin-categories-tree.js +++ b/js/admin-categories-tree.js @@ -228,6 +228,12 @@ function updateNbSubCategorySelected(category, add) var currentSpan = category.parent().parent().parent().children('.nb_sub_cat_selected'); var parentNbSubCategorySelected = currentSpan.children('.nb_sub_cat_selected_value').html(); + if (use_radio) + { + $('.nb_sub_cat_selected').hide(); + return false; + } + if (add) var newValue = parseInt(parentNbSubCategorySelected)+1; else diff --git a/js/jquery/treeview/jquery.treeview.async.js b/js/jquery/treeview/jquery.treeview.async.js index 541bbe134..1c9580599 100755 --- a/js/jquery/treeview/jquery.treeview.async.js +++ b/js/jquery/treeview/jquery.treeview.async.js @@ -19,14 +19,14 @@ function load(settings, root, child, container) { function createNode(parent) { var id_category = this.id_category; var checked = false; - $('input[name="'+inputName+'[]"][type=hidden]').each( function () { + $('input[name="'+inputName+'"][type=hidden]').each( function () { if ($(this).attr('value') == id_category) { checked = true; $(this).remove(); } }); - var current = $("
  • ").attr("id", this.id_category || "").html(" " + this.name +" " + this.level_depth +" ("+this.nbSelectedSubCat+" "+selectedLabel+")").appendTo(parent); + var current = $("
  • ").attr("id", this.id_category || "").html(" " + this.name +" " + this.level_depth +" ("+this.nbSelectedSubCat+" "+selectedLabel+")").appendTo(parent); if (this.classes) { current.children("span").addClass(this.classes); } diff --git a/mails/fr/reply_msg.txt b/mails/fr/reply_msg.txt index e69de29bb..ca174c3db 100644 --- a/mails/fr/reply_msg.txt +++ b/mails/fr/reply_msg.txt @@ -0,0 +1,4 @@ +{reply} + +Attention, vous ne devez pas répondre à ce message en utilisant votre logiciel de messagerie, nous ne recevrons pas votre message. +Pour répondre, merci d'utiliser exclusivement le lien suivant : {link} diff --git a/modules/authorizeaim/authorizeaim.php b/modules/authorizeaim/authorizeaim.php index d042fc378..d61930fca 100755 --- a/modules/authorizeaim/authorizeaim.php +++ b/modules/authorizeaim/authorizeaim.php @@ -34,7 +34,7 @@ class authorizeAIM extends PaymentModule { $this->name = 'authorizeaim'; $this->tab = 'payments_gateways'; - $this->version = '1.0'; + $this->version = '1.1'; $this->author = 'PrestaShop'; $this->limited_countries = array('us'); $this->need_instance = 0; diff --git a/modules/authorizeaim/config.xml b/modules/authorizeaim/config.xml index 1f41ced64..39d2b2bbc 100755 --- a/modules/authorizeaim/config.xml +++ b/modules/authorizeaim/config.xml @@ -2,7 +2,7 @@ authorizeaim - + diff --git a/modules/authorizeaim/validation.php b/modules/authorizeaim/validation.php index 1bb4716fa..f8bdadd8e 100755 --- a/modules/authorizeaim/validation.php +++ b/modules/authorizeaim/validation.php @@ -42,9 +42,11 @@ foreach ($_POST AS $key => $value) $postString .= $key.'='.urlencode($value).'&'; $postString .= 'x_exp_date='.str_pad($_POST["x_exp_date_m"], 2, "0",STR_PAD_LEFT).$_POST["x_exp_date_y"]; +if (Tools::getValue('x_test_request')) + $postString .= 'Test_Mode=1'; + /* Do the CURL request ro Authorize.net */ -$request = curl_init( -Tools::getValue('x_test_request') ? 'https://test.authorize.net/gateway/transact.dll' : 'https://secure.authorize.net/gateway/transact.dll'); +$request = curl_init('https://secure.authorize.net/gateway/transact.dll'); curl_setopt($request, CURLOPT_HEADER, 0); curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); curl_setopt($request, CURLOPT_POSTFIELDS, $postString); diff --git a/modules/canadapost/canadapost.php b/modules/canadapost/canadapost.php index ecc3a9522..81fada0ca 100755 --- a/modules/canadapost/canadapost.php +++ b/modules/canadapost/canadapost.php @@ -1363,7 +1363,7 @@ class CanadaPost extends CarrierModule 'width' => ($product['width'] ? $product['width'] : 1), 'height' => ($product['height'] ? $product['height'] : 1), 'depth' => ($product['depth'] ? $product['depth'] : 1), - 'weight' => ($product['weight'] ? $product['weight'] : 1), + 'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1), 'quantity' => $product['quantity'], 'id_product' => $product['id_product'], ); diff --git a/modules/fedexcarrier/fedexcarrier.php b/modules/fedexcarrier/fedexcarrier.php index 87f686911..3cb722eb5 100644 --- a/modules/fedexcarrier/fedexcarrier.php +++ b/modules/fedexcarrier/fedexcarrier.php @@ -1536,7 +1536,7 @@ class FedexCarrier extends CarrierModule 'width' => ($product['width'] ? $product['width'] : 1), 'height' => ($product['height'] ? $product['height'] : 1), 'depth' => ($product['depth'] ? $product['depth'] : 1), - 'weight' => ($product['weight'] ? $product['weight'] : 1), + 'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1), 'pickup_type' => (isset($config['pickup_type_code']) ? $config['pickup_type_code'] : Configuration::get('FEDEX_CARRIER_PICKUP_TYPE')), ); diff --git a/modules/followup/followup.php b/modules/followup/followup.php index cd6b94802..0ac26f976 100644 --- a/modules/followup/followup.php +++ b/modules/followup/followup.php @@ -376,7 +376,7 @@ class Followup extends Module /* For all customers with more than x euros in 90 days */ private function bestCustomer($count = false) { - $emailLogs = $this->getLogsEmail(2); + $emailLogs = $this->getLogsEmail(3); $sql = ' SELECT SUM(o.total_paid) total, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email diff --git a/modules/moneybookers/config.xml b/modules/moneybookers/config.xml index e743d3acb..c4d826531 100755 --- a/modules/moneybookers/config.xml +++ b/modules/moneybookers/config.xml @@ -2,7 +2,7 @@ moneybookers - + diff --git a/modules/moneybookers/moneybookers.php b/modules/moneybookers/moneybookers.php index 6dde13c06..436e1f499 100644 --- a/modules/moneybookers/moneybookers.php +++ b/modules/moneybookers/moneybookers.php @@ -38,7 +38,7 @@ class MoneyBookers extends PaymentModule { $this->name = 'moneybookers'; $this->tab = 'payments_gateways'; - $this->version = '1.5'; + $this->version = '1.6'; parent::__construct(); @@ -49,6 +49,13 @@ class MoneyBookers extends PaymentModule if (Configuration::get('MB_PAY_TO_EMAIL') == 'testmerchant@moneybookers.com') $this->warning = $this->l('You are currently using the default Moneybookers e-mail address, please use your own e-mail address.'); + /* For 1.4.3 and less compatibility */ + $updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT'); + if (!Configuration::get('PS_OS_PAYMENT')) + foreach ($updateConfig as $u) + if (!Configuration::get($u) && defined('_'.$u.'_')) + Configuration::updateValue($u, constant('_'.$u.'_')); + /* MoneyBookers payment methods */ $this->_internationalPaymentMethods = array( 0 => array('file' => 'amex', 'name' => 'American Express', 'code' => 'AMX'), diff --git a/modules/paysafecard/payment.php b/modules/paysafecard/payment.php index d5da39aff..3b1849d13 100644 --- a/modules/paysafecard/payment.php +++ b/modules/paysafecard/payment.php @@ -44,7 +44,7 @@ if (Tools::getValue('hash') != md5(Configuration::get($module->prefix.'SALT') + $result = $module->getDispositionState((int)($cart->id)); $state = Configuration::get('PS_OS_ERROR'); -$disposition = Disposition::getByCartId((int)($cart->id)); +$disposition = PSCDisposition::getByCartId((int)($cart->id)); $message = 'Transaction ID #'.$disposition['mtid'].': '.$disposition['amount'].$disposition['currency'].'
    '. date('Y-m-d').' '; if ($result[0] == 0) diff --git a/modules/shopimporter/shopimporter.php b/modules/shopimporter/shopimporter.php index 314eead39..517d89587 100644 --- a/modules/shopimporter/shopimporter.php +++ b/modules/shopimporter/shopimporter.php @@ -578,10 +578,7 @@ class shopimporter extends ImportModule foreach($item as $key => $val) { if ($key == 'passwd') - { - $password = $val; - $val = substr($val,0,29); - } + $val = '------'; if (is_array($val) AND $key != 'images') { diff --git a/modules/treepodia/config.xml b/modules/treepodia/config.xml index 0c1548148..9e682c1af 100755 --- a/modules/treepodia/config.xml +++ b/modules/treepodia/config.xml @@ -2,7 +2,7 @@ treepodia - + diff --git a/modules/treepodia/treepodia.php b/modules/treepodia/treepodia.php index 34b7e6b9d..61367f8bd 100644 --- a/modules/treepodia/treepodia.php +++ b/modules/treepodia/treepodia.php @@ -47,7 +47,7 @@ class Treepodia extends Module { $this->name = 'treepodia'; $this->tab = 'front_office_features'; - $this->version = '1.5'; + $this->version = '1.6'; $this->displayName = 'Treepodia'; parent::__construct(); @@ -199,9 +199,18 @@ XML; $price->addChild('retail-price-with-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], true, NULL, 6, NULL, false, false)); $price->addChild('retail-price-without-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], false, NULL, 6, NULL, false, false)); $price->addChild('final-retail-price-with-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], true)); + if (version_compare(_PS_VERSION_, '1.4') < 0) + { + $price->addChild('final-retail-price-without-tax', Product::getPriceStatic(intval($sqlProduct['id_product']), false)); + $price->addChild('reduction_percent', floatval($sqlProduct['reduction_percent'])); + $price->addChild('reduction_price', floatval($sqlProduct['reduction_price'])); + } + else + { $price->addChild('final-retail-price-without-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], false, NULL, 6, NULL, false, true, 1, false, NULL, NULL, NULL, $specificPrice)); $price->addChild('reduction_percent', ($specificPrice AND $specificPrice['reduction_type'] == 'percentage') ? $specificPrice['reduction'] * 100 : 0.00); $price->addChild('reduction_price', ($specificPrice AND $specificPrice['reduction_type'] == 'amount') ? (float)$specificPrice['reduction'] : 0.00); + } $price->addChild('display-on-sale', (int)$sqlProduct['on_sale']); $product->addChild('downloadable', $sqlProduct['id_product_download'] >= 1 ? 1 : 0); @@ -264,14 +273,30 @@ XML; } } - $quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)$sqlProduct['id_product'], $this->context->shop->getGroupID(), 0, 0, 0); - - foreach ($quantityDiscounts AS $quantityDiscount) + if (version_compare(_PS_VERSION_, '1.4') < 0) { - $discount = $product->addChild('discount'); - $discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity'])); - $discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100); - $discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%')); + $quantityDiscounts = Db::getInstance()->ExecuteS(' + SELECT dq.quantity, dq.value, dq.id_discount_type + FROM '._DB_PREFIX_.'discount_quantity dq + WHERE dq.id_product = '.intval($sqlProduct['id_product'])); + foreach ($quantityDiscounts AS $quantityDiscount) + { + $discount = $product->addChild('discount'); + $discount->addChild('discount-quantity', intval($quantityDiscount['quantity'])); + $discount->addChild('discount-value', floatval($quantityDiscount['value'])); + $discount->addChild('discount-type', ($quantityDiscount['id_discount_type'] == 1 ? $defaultCurrencyIsoCode : '%')); + } + } + else + { + $quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)$sqlProduct['id_product'], $this->context->shop->getGroupID(), 0, 0, 0); + foreach ($quantityDiscounts AS $quantityDiscount) + { + $discount = $product->addChild('discount'); + $discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity'])); + $discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100); + $discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%')); + } } $categories = Db::getInstance()->ExecuteS(' diff --git a/modules/upscarrier/upscarrier.php b/modules/upscarrier/upscarrier.php index e353684df..2b49cf711 100644 --- a/modules/upscarrier/upscarrier.php +++ b/modules/upscarrier/upscarrier.php @@ -1489,7 +1489,7 @@ class UpsCarrier extends CarrierModule 'width' => ($width > 0 ? $width : 7), 'height' => ($height > 0 ? $height : 3), 'depth' => ($depth > 0 ? $depth : 5), - 'weight' => ($weight > 0 ? $weight : 0.5), + 'weight' => ($weight > 0.1 ? $weight : 0.1), 'packaging_type' => Configuration::get('UPS_CARRIER_PACKAGING_TYPE'), ); } @@ -1513,7 +1513,7 @@ class UpsCarrier extends CarrierModule 'width' => ($product['width'] ? $product['width'] : 7), 'height' => ($product['height'] ? $product['height'] : 3), 'depth' => ($product['depth'] ? $product['depth'] : 5), - 'weight' => ($product['weight'] ? $product['weight'] : 0.5), + 'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1), 'packaging_type' => ($config['packaging_type_code'] ? $config['packaging_type_code'] : Configuration::get('UPS_CARRIER_PACKAGING_TYPE')), ); diff --git a/modules/uspscarrier/uspscarrier.php b/modules/uspscarrier/uspscarrier.php index f15e33486..24690e571 100644 --- a/modules/uspscarrier/uspscarrier.php +++ b/modules/uspscarrier/uspscarrier.php @@ -1515,7 +1515,7 @@ class UspsCarrier extends CarrierModule 'width' => ($width > 0 ? $width : 1), 'height' => ($height > 0 ? $height : 1), 'depth' => ($depth > 0 ? $depth : 1), - 'weight' => ($weight > 0 ? $weight : 0.5), + 'weight' => ($weight > 0.1 ? $weight : 0.1), 'packaging_type' => Configuration::get('USPS_CARRIER_PACKAGING_TYPE'), 'packaging_size' => Configuration::get('USPS_CARRIER_PACKAGING_SIZE'), 'machinable' => Configuration::get('USPS_CARRIER_MACHINABLE'), @@ -1541,7 +1541,7 @@ class UspsCarrier extends CarrierModule 'width' => ($product['width'] ? $product['width'] : 1), 'height' => ($product['height'] ? $product['height'] : 1), 'depth' => ($product['depth'] ? $product['depth'] : 1), - 'weight' => ($product['weight'] ? $product['weight'] : 1), + 'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1), 'packaging_type' => (isset($config['packaging_type_code']) ? $config['packaging_type_code'] : Configuration::get('USPS_CARRIER_PACKAGING_TYPE')), 'packaging_size' => (isset($config['packaging_size_code']) ? $config['packaging_size_code'] : Configuration::get('USPS_CARRIER_PACKAGING_SIZE')), 'machinable' => (isset($config['machinable_code']) ? $config['machinable_code'] : Configuration::get('USPS_CARRIER_MACHINABLE')), diff --git a/modules/vatnumber/ajax.php b/modules/vatnumber/ajax.php index add24b615..3ef30ac22 100644 --- a/modules/vatnumber/ajax.php +++ b/modules/vatnumber/ajax.php @@ -28,4 +28,4 @@ include(dirname(__FILE__). '/../../config/config.inc.php'); include(dirname(__FILE__). '/../../init.php'); include(dirname(__FILE__). '/vatnumber.php'); -echo VatNumber::isApplicable($_GET['id_country']); +echo VatNumber::isApplicable(Tools::getValue('id_country')); diff --git a/modules/vatnumber/vatnumber.php b/modules/vatnumber/vatnumber.php index 2fcca79c5..260aa586b 100755 --- a/modules/vatnumber/vatnumber.php +++ b/modules/vatnumber/vatnumber.php @@ -103,13 +103,8 @@ class VatNumber extends Module public static function isApplicable($id_country) { - $isApplicable = in_array(Country::getIsoById((int)$id_country), VatNumber::getPrefixIntracomVAT()); - if ($isApplicable == "") - { - return 0; + return (((int)$id_country AND in_array(Country::getIsoById($id_country), self::getPrefixIntracomVAT())) ? 1 : 0); } - return 1; - } public static function WebServiceCheck($vatNumber) { @@ -142,7 +137,7 @@ class VatNumber extends Module else sleep(1); } - ini_restore('default_socket_timeout'); + @ini_restore('default_socket_timeout'); return array(Tools::displayError('VAT number validation service unavailable')); } diff --git a/themes/prestashop/errors.tpl b/themes/prestashop/errors.tpl index 6b98fcb4a..3ed72fc65 100644 --- a/themes/prestashop/errors.tpl +++ b/themes/prestashop/errors.tpl @@ -32,7 +32,7 @@
  • {$error}
  • {/foreach} - {if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication')} + {if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication') && preg_replace('#^http://[^/]+/#', '/', $smarty.server.HTTP_REFERER) != $request_uri}

    « {l s='Back'}

    {/if}
diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 0482b5410..0a9957f85 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -2185,7 +2185,8 @@ $_LANGADM['AdminProducts32b919d18cfaca89383f6000dcc9c031'] = 'Générer'; $_LANGADM['AdminProductsb06f68603b4cf2f867480c4d1eb6a611'] = 'URL simplifié basée sur le nom du produit'; $_LANGADM['AdminProducts92ab5edf4194cb5a84d6808cb8d8b696'] = 'Le lien vers la fiche produit sera :'; $_LANGADM['AdminProducts234078adec0a64008b6ae77653776cfa'] = 'Résumé :'; -$_LANGADM['AdminProducts83d4043f36afbc6c2549ec9309d9aee8'] = 'apparaîtra dans les moteurs de recherche'; +$_LANGADM['AdminProducts38d301f7ef549a79620e99fd8b51fa34'] = 'apparaît dans les listings produits et au haut des fiches produits'; +$_LANGADM['AdminProducts9be976b8052c984a95997e4a4f8eef96'] = 'apparaît sur les pages produits'; $_LANGADM['AdminProducts32b502f33a535f75dcbf63f6753c631e'] = 'Tags :'; $_LANGADM['AdminProducts8fca858b27c5837dcb22c398aca5e0fc'] = 'Tags séparés par des virgules (ex : dvd, lecteur dvd, hifi)'; $_LANGADM['AdminProductsbe26ade2055790d0e8d19eed69309574'] = 'Accessoires :'; @@ -2491,9 +2492,7 @@ $_LANGADM['AdminSearchc0bd7654d5b278e65f21cf4e9153fdb4'] = 'Fabriquant'; $_LANGADM['AdminSearch63d5049791d9d79d86e9a108b0a999ca'] = 'Référence'; $_LANGADM['AdminSearch49ee3087348e8d44e1feda1917443987'] = 'Nom'; $_LANGADM['AdminSearch3601146c4e948c32b6424d2c0a7f0118'] = 'Prix'; -$_LANGADM['AdminSearch4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Taxe'; $_LANGADM['AdminSearch27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; -$_LANGADM['AdminSearch8c489d0946f66d17d73f26366a4bf620'] = 'Poids'; $_LANGADM['AdminSearchec53a8c4f07baed5d8825072c89799be'] = 'Statut'; $_LANGADM['AdminSearch06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions'; $_LANGADM['AdminSearchdaab80c5dadc81fa2d019c562f805994'] = 'Genre'; @@ -3324,6 +3323,7 @@ $_LANGADM['indexf84b4e2770ec98e3db2926cd49864d2f'] = 'Mes préférences'; $_LANGADM['indexcbebc850f5f849e8956b5f8075f48f69'] = 'tout'; $_LANGADM['index46f22f2a56ddd091f4b2b2c35c5ca989'] = 'catalogue'; $_LANGADM['index4b6f7d34a58ba399f077685951d06738'] = 'clients'; +$_LANGADM['index50d7eaecd64b277cdaac58e0cd48ad83'] = 'adresse IP'; $_LANGADM['index12c500ed0b7879105fb46af0f246be87'] = 'commandes'; $_LANGADM['index56deca22a707214865f7ea3ae6391d67'] = 'factures'; $_LANGADM['index8642a2f37a5d42b54ce53b1fbdd1583f'] = 'paniers';