diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index a09d55488..8387b2a06 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -621,7 +621,7 @@ if (Tools::isSubmit('getAdminHomeElement')) else { $content = explode('|', $content); - if ($content[0] == 'OK') + if ($content[0] == 'OK' && Validate::isCleanHtml($content[2]) && Validate::isCleanHtml($content[1])) { $result['partner_preactivation'] = $content[2]; $content[1] = explode('#%#', $content[1]); @@ -643,7 +643,7 @@ if (Tools::isSubmit('getAdminHomeElement')) // PREACTIVATION PAYPAL WARNING $content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Context::getContext()->country->iso_code).'&iso_lang='.Tools::strtolower(Context::getContext()->language->iso_code).'&id_lang='.(int)Context::getContext().'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context); $content = explode('|', $content); - if ($content[0] == 'OK') + if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', $content[1]); else Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', ''); @@ -655,7 +655,7 @@ if (Tools::isSubmit('getAdminHomeElement')) else { $content = explode('|', $content); - if ($content[0] == 'OK') + if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) $result['discover_prestashop'] = $content[1]; else $result['discover_prestashop'] = 'NOK'; @@ -665,7 +665,7 @@ if (Tools::isSubmit('getAdminHomeElement')) $content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context); $content = explode('|', $content); - if ($content[0] == 'OK') + if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) $result['discover_prestashop'] .= $content[1]; } diff --git a/admin-dev/tabs/AdminAccess.php b/admin-dev/tabs/AdminAccess.php index 4682490f9..3f669d13d 100644 --- a/admin-dev/tabs/AdminAccess.php +++ b/admin-dev/tabs/AdminAccess.php @@ -130,6 +130,7 @@ class AdminAccess extends AdminTab $this->printTabAccess((int)($currentProfile), $tab, $accesses[$tab['id_tab']], false, $tabsize, sizeof($tabs)); foreach ($tabs AS $child) if ($child['id_parent'] === $tab['id_tab']) + if (isset($accesses[$child['id_tab']])) $this->printTabAccess($currentProfile, $child, $accesses[$child['id_tab']], true, $tabsize, sizeof($tabs)); } echo ''; diff --git a/admin-dev/themes/flashyturtle/admin.css b/admin-dev/themes/flashyturtle/admin.css index 246862e17..f9c91aa4b 100644 --- a/admin-dev/themes/flashyturtle/admin.css +++ b/admin-dev/themes/flashyturtle/admin.css @@ -54,6 +54,7 @@ hr {height: 1px;color:#DEDEDE;background-color:#DEDEDE} #content {background-color:#FFF;border-left:1px solid #383838;border-right:1px solid #383838} input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #416110} select {border: 1px solid #416110} +select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disabled"] {border: 1px solid #CCCCCC;color: #AAAAAA} .header_module{background:url(header_module.png);padding-left: 0.5em;padding-top: 0.8em;height:20px;color: #812143;border:solid 1px #CCC;} a.action_module{color: #488C40;text-decoration: underline;} a.header_module_toggle{font-weight: bold;color: #812143;display:block;} diff --git a/admin-dev/themes/oldschool/admin.css b/admin-dev/themes/oldschool/admin.css index 8643c5f74..4d2fa6722 100644 --- a/admin-dev/themes/oldschool/admin.css +++ b/admin-dev/themes/oldschool/admin.css @@ -49,6 +49,7 @@ hr {height: 1px;color:#E0D0B1;background-color:#E0D0B1} #content {background-color:#FFF;border-left:1px solid #999999;border-right:1px solid #999999} input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #E0D0B1} select {border: 1px solid #E0D0B1} +select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disabled"] {border: 1px solid #CCCCCC;color: #AAAAAA} .header_module{background:url(header_module.png);padding-left: 0.5em;padding-top: 0.8em;height:20px;color: #812143;border:solid 1px #CCC;} a.action_module{color: #268CCD;text-decoration: underline;} a.header_module_toggle{font-weight: bold;color: #268CCD;display:block;} diff --git a/admin-dev/themes/origins/admin.css b/admin-dev/themes/origins/admin.css index 0d023778e..83fb4fab5 100644 --- a/admin-dev/themes/origins/admin.css +++ b/admin-dev/themes/origins/admin.css @@ -51,6 +51,7 @@ hr {height: 1px;color:#E0D0B1;background-color:#E0D0B1} #content {background-color:#FFF;border-left:1px solid #999999;border-right:1px solid #999999} input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #E0D0B1} select {border: 1px solid #E0D0B1} +select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disabled"] {border: 1px solid #CCCCCC;color: #AAAAAA} .header_module{background:url(header_module.png);padding-left: 0.5em;padding-top: 0.8em;height:20px;color: #812143;border:solid 1px #CCC;} a.action_module{color: #268CCD;text-decoration: underline;} a.header_module_toggle{font-weight: bold;color: #268CCD;display:block;} diff --git a/classes/Product.php b/classes/Product.php index 6442a03a9..9f2ae429a 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -1673,6 +1673,7 @@ class ProductCore extends ObjectModel $cur_cart = new Cart($id_cart); } + $cart_quantity = 0; if ((int)($id_cart)) { if (!isset(self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)]) OR self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] != (int)($quantity)) diff --git a/classes/Search.php b/classes/Search.php index 36c873982..7ef2b8897 100644 --- a/classes/Search.php +++ b/classes/Search.php @@ -461,13 +461,21 @@ class SearchCore $wordIdsByWord[$product['id_shop']][$product['id_lang']]['_'.$word] = 0; } + $existingWords = $db->ExecuteS('SELECT word FROM '._DB_PREFIX_.'search_word WHERE word IN ('.implode(',', $queryArray2).') GROUP BY word'); + if($existingWords) + foreach($existingWords as $data) + unset($queryArray[$data['word']]); + if (count($queryArray)) { // The words are inserted... $db->Execute(' INSERT IGNORE INTO '._DB_PREFIX_.'search_word (id_lang, id_shop, word) VALUES '.implode(',',$queryArray)); + } + if (count($queryArray2)) + { // ...then their IDs are retrieved and added to the cache $addedWords = $db->ExecuteS(' SELECT sw.id_word, sw.word diff --git a/controllers/OrderOpcController.php b/controllers/OrderOpcController.php index a3d433e01..be009afb3 100644 --- a/controllers/OrderOpcController.php +++ b/controllers/OrderOpcController.php @@ -246,6 +246,11 @@ class OrderOpcControllerCore extends ParentOrderController 'errorTOS' => Tools::displayError('You must accept terms of service before', false), 'isPaymentStep' => (bool)(isset($_GET['isPaymentStep']) AND $_GET['isPaymentStep']) )); + /* Call a hook to display more information on form */ + self::$smarty->assign(array( + 'HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'), + 'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop') + )); $years = Tools::dateYears(); $months = Tools::dateMonths(); $days = Tools::dateDays(); diff --git a/modules/ebay/config.xml b/modules/ebay/config.xml index 1cbb985b9..6ed22463d 100755 --- a/modules/ebay/config.xml +++ b/modules/ebay/config.xml @@ -2,11 +2,11 @@ ebay - + 1 1 - \ No newline at end of file + diff --git a/modules/ebay/ebay.php b/modules/ebay/ebay.php index a872034be..e452e0cd5 100755 --- a/modules/ebay/ebay.php +++ b/modules/ebay/ebay.php @@ -59,7 +59,7 @@ class Ebay extends Module { $this->name = 'ebay'; $this->tab = 'market_place'; - $this->version = '1.2'; + $this->version = '1.2.1'; $this->author = 'PrestaShop'; parent::__construct (); $this->displayName = $this->l('eBay'); @@ -324,6 +324,10 @@ class Ebay extends Module $dateNew = date('Y-m-d').'T'.date('H:i:s').'.000Z'; if (Configuration::get('EBAY_ORDER_LAST_UPDATE') < date('Y-m-d', strtotime('-45 minutes')).'T'.date('H:i:s', strtotime('-45 minutes')).'.000Z') { + // Lock + Configuration::updateValue('EBAY_ORDER_LAST_UPDATE', $dateNew); + + // eBay Request $ebay = new eBayRequest(); $page = 1; @@ -345,8 +349,7 @@ class Ebay extends Module { if (!Db::getInstance()->getValue('SELECT `id_ebay_order` FROM `'._DB_PREFIX_.'ebay_order` WHERE `id_order_ref` = \''.pSQL($order['id_order_ref']).'\'')) { - $result = Db::getInstance()->getRow('SELECT `id_customer` FROM `'._DB_PREFIX_.'customer` WHERE `active` = 1 AND `email` = \''.pSQL($order['email']).'\' AND `deleted` = 0'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '' : ' AND `is_guest` = 0')); - $id_customer = (isset($result['id_customer']) ? $result['id_customer'] : 0); + $id_customer = (int)Db::getInstance()->getValue('SELECT `id_customer` FROM `'._DB_PREFIX_.'customer` WHERE `active` = 1 AND `email` = \''.pSQL($order['email']).'\' AND `deleted` = 0'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '' : ' AND `is_guest` = 0')); // Check for empty name $order['firstname'] = str_replace('_', '', trim($order['firstname'])); @@ -355,6 +358,8 @@ class Ebay extends Module $order['familyname'] = $order['firstname']; if (empty($order['firstname'])) $order['firstname'] = $order['familyname']; + if (empty($order['phone']) || !Validate::isPhoneNumber($order['phone'])) + $order['phone'] = '0100000000'; if (Validate::isEmail($order['email']) && !empty($order['firstname']) && !empty($order['familyname'])) { @@ -376,10 +381,17 @@ class Ebay extends Module $id_customer = $customer->id; } + // Search if address exists + $id_address = (int)Db::getInstance()->getValue('SELECT `id_address` FROM `'._DB_PREFIX_.'address` WHERE `id_customer` = '.(int)$id_customer.' AND `alias` = \'eBay\''); + if ($id_address > 0) + $address = new Address((int)$id_address); + else + { $address = new Address(); $address->id_customer = (int)$id_customer; + } $address->id_country = (int)Country::getByIso($order['country_iso_code']); - $address->alias = 'eBay '.date('Y-m-d H:i:s'); + $address->alias = 'eBay'; $address->lastname = pSQL($order['familyname']); $address->firstname = pSQL($order['firstname']); $address->address1 = pSQL($order['address1']); @@ -388,6 +400,9 @@ class Ebay extends Module $address->city = pSQL($order['city']); $address->phone = pSQL($order['phone']); $address->active = 1; + if ($id_address > 0 && Validate::isLoadedObject($address)) + $address->update(); + else $address->add(); $id_address = $address->id; @@ -455,8 +470,6 @@ class Ebay extends Module } } } - - Configuration::updateValue('EBAY_ORDER_LAST_UPDATE', $dateNew); } } diff --git a/modules/gsitemap/config.xml b/modules/gsitemap/config.xml index 1d6d86a64..4e9c57055 100755 --- a/modules/gsitemap/config.xml +++ b/modules/gsitemap/config.xml @@ -2,7 +2,7 @@ gsitemap - + diff --git a/modules/mailalerts/fr.php b/modules/mailalerts/fr.php index bf6bf677e..59fef5615 100644 --- a/modules/mailalerts/fr.php +++ b/modules/mailalerts/fr.php @@ -38,4 +38,5 @@ $_MODULE['<{mailalerts}prestashop>myalerts_0b3db27bc15f682e92ff250ebb167d4b'] = $_MODULE['<{mailalerts}prestashop>myalerts_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; $_MODULE['<{mailalerts}prestashop>product_61172eb93737ebf095d3fa02119ce1df'] = 'Demande de notification enregistrée'; $_MODULE['<{mailalerts}prestashop>product_900f8551b29793ecb604a545b2059cc1'] = 'Votre adresse e-mail est invalide'; +$_MODULE['<{mailalerts}prestashop>product_67135a14d3ac4f1369633dd006d6efec'] = 'votre@email.com'; $_MODULE['<{mailalerts}prestashop>product_546e02eaa9a986c83cc347e273269f2c'] = 'Prévenez-moi lorsque le produit est disponible'; diff --git a/modules/mailalerts/product.tpl b/modules/mailalerts/product.tpl index 1d2012976..a816403d4 100644 --- a/modules/mailalerts/product.tpl +++ b/modules/mailalerts/product.tpl @@ -28,7 +28,7 @@ oosHookJsCodeFunctions.push('oosHookJsCodeMailAlert'); function clearText() { - if ($('#oos_customer_email').val() == 'your@email.com') + if ($('#oos_customer_email').val() == '{l s='your@email.com' mod='mailalerts'}') $('#oos_customer_email').val(''); } @@ -86,7 +86,7 @@ $(document).ready(function() { {if isset($email) AND $email} -
+
{/if} {l s='Notify me when available' mod='mailalerts'} diff --git a/modules/moneybookers/fr.php b/modules/moneybookers/fr.php index 47126465a..437ff16d3 100644 --- a/modules/moneybookers/fr.php +++ b/modules/moneybookers/fr.php @@ -47,6 +47,7 @@ $_MODULE['<{moneybookers}prestashop>moneybookers_d5086eeb1bc1994c5abf945fd79d424 $_MODULE['<{moneybookers}prestashop>moneybookers_68db2cda800ddb2ae307c60b0a96252f'] = 'Solution de Paiement en ligne Moneybookers'; $_MODULE['<{moneybookers}prestashop>moneybookers_b9c758264b134743b13a85ca4055c629'] = 'Estimation du volume mensuel passant par Moneybookers'; $_MODULE['<{moneybookers}prestashop>moneybookers_7d294d4900ff1a38f5b0a89612916eac'] = 'Pour les marchands au-dessus de €100,000 des tarifs sur mesure peuvent être mis en place.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_936ccdb97115e9f35a11d35e3d5b5cad'] = 'Cliquez ici'; $_MODULE['<{moneybookers}prestashop>moneybookers_11c8ff1cde03aa19406dfe5971b92553'] = 'Porte-monnaie électronique Moneybookers'; $_MODULE['<{moneybookers}prestashop>moneybookers_223b661f7b13d33498a9274bb10e3538'] = 'Portail de Paiements Directs Moneybookers '; $_MODULE['<{moneybookers}prestashop>moneybookers_f284fe53995a4cc2e1e099cb1e511ec8'] = 'Validation de votre compte'; diff --git a/modules/moneybookers/moneybookers.php b/modules/moneybookers/moneybookers.php index 8845313af..73f01501f 100644 --- a/modules/moneybookers/moneybookers.php +++ b/modules/moneybookers/moneybookers.php @@ -391,7 +391,7 @@ class MoneyBookers extends PaymentModule $output .= ' -

'.$this->l('Change youpr logo position in the Front Office. Works with').' +

'.$this->l('Change your logo position in the Front Office. Works with').' '.$this->l(' Live edit.').'

diff --git a/modules/ogone/ogone.php b/modules/ogone/ogone.php index d000ecef0..5e575057b 100644 --- a/modules/ogone/ogone.php +++ b/modules/ogone/ogone.php @@ -208,7 +208,7 @@ class Ogone extends PaymentModule public function validate($id_cart, $id_order_state, $amount, $message = '', $secure_key) { $this->validateOrder((int)$id_cart, $id_order_state, $amount, $this->displayName, $message, NULL, NULL, true, pSQL($secure_key)); - if ($amount > 0 AND class_exists('PaymentCC')) + if ($amount > 0 AND file_exists('../../classes/PaymentCC.php')) { $pcc = new PaymentCC(); $order = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'orders WHERE id_cart = '.(int)$id_cart); diff --git a/modules/referralprogram/fr.php b/modules/referralprogram/fr.php index e9cd44619..ef3db0535 100644 --- a/modules/referralprogram/fr.php +++ b/modules/referralprogram/fr.php @@ -88,7 +88,7 @@ $_MODULE['<{referralprogram}prestashop>referralprogram_edf7f0a17b8a8f1732f12856f $_MODULE['<{referralprogram}prestashop>referralprogram_8465d83b5c1b569299af284c14d957bb'] = 'Description du bon :'; $_MODULE['<{referralprogram}prestashop>referralprogram_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour les paramètres'; $_MODULE['<{referralprogram}prestashop>referralprogram_562ad64cf21ac2da656134355115133d'] = 'Vous devez spécifier un texte.'; -$_MODULE['<{referralprogram}prestashop>referralprogram_01705c0177ebf5fbcbf4e882bc454405'] = 'Conditions du programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6b719c160f9b08dad4760bcc4b52ed48'] = 'Conditions du programme de parrainage'; $_MODULE['<{referralprogram}prestashop>referralprogram_c5afb9c76a7880978cba32872d01f068'] = 'Mise à jour du texte'; $_MODULE['<{referralprogram}prestashop>referralprogram_6b31baf25848e7a6563ecc3946626c80'] = 'Programme de parrainage'; $_MODULE['<{referralprogram}prestashop>referralprogram_7790d51a3d62c85aae65464dee12ee8b'] = 'Parrain du client :'; diff --git a/modules/referralprogram/referralprogram.php b/modules/referralprogram/referralprogram.php index 044c7dfcf..b368cc85c 100644 --- a/modules/referralprogram/referralprogram.php +++ b/modules/referralprogram/referralprogram.php @@ -311,7 +311,7 @@ class ReferralProgram extends Module // TinyMCE $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); $ad = dirname($_SERVER["PHP_SELF"]); - echo ' + $this->_html .= '
- '.$this->l('Referral program rules').''; + '.$this->l('Conditions of the referral program').''; foreach ($languages AS $language) { $this->_html .= ' diff --git a/modules/reverso/js/reverso.js b/modules/reverso/js/reverso.js index f0152b428..96ecec124 100644 --- a/modules/reverso/js/reverso.js +++ b/modules/reverso/js/reverso.js @@ -46,6 +46,9 @@ function updateAddress(phone) var fields = data.split(','); $(fields).each(function(){ var field = this.split(':'); + if (orderProcess == 'order-opc') + $('form#opc_account_form input[name=\''+ field[0] +'\']').val(field[1]); + else $('form#account-creation_form input[name=\''+ field[0] +'\']').val(field[1]); }); } diff --git a/themes/prestashop/order-opc-new-account.tpl b/themes/prestashop/order-opc-new-account.tpl index f3922006b..d4c2fadeb 100644 --- a/themes/prestashop/order-opc-new-account.tpl +++ b/themes/prestashop/order-opc-new-account.tpl @@ -68,6 +68,7 @@
+ {$HOOK_CREATE_ACCOUNT_TOP}