784 Commits

Author SHA1 Message Date
Francois Gaillard
6c0867f314 // Release branch merged 2013-08-29 18:47:19 +02:00
Rémi Gaillard
ffdc7b51b7 // php 5.2 2013-08-29 16:41:15 +02:00
Rémi Gaillard
fb397d3163 Merge pull request #662 from djfm/localization
// updated Czech localization pack
2013-08-29 01:43:33 -07:00
Damien Metzger
5dee3ca245 // Fixed hook::getidbyname case 2013-08-29 09:33:28 +02:00
Rémi Gaillard
c72fd867fe // git checkout controllers/ 2013-08-28 12:24:10 +02:00
Rémi Gaillard
63d9005a10 // liveedit 2013-08-28 12:21:01 +02:00
Damien Metzger
7a429cd3ea // Version number 2013-08-28 10:00:29 +02:00
Damien Metzger
330aed3f7a // Translations 2013-08-28 09:51:02 +02:00
Vincent Augagneur
efc44392b6 //small fix 2013-08-28 09:48:01 +02:00
Rémi Gaillard
6a4680b4f0 [-] WS: Bad xlink for tax_rules_group in product 2013-08-27 18:58:21 +02:00
Vincent Augagneur
5c367cd6e7 //small fix 2013-08-27 18:52:34 +02:00
Vincent Augagneur
41a5eb8411 //small fix 2013-08-27 18:50:14 +02:00
Vincent Augagneur
9b7f32cbac [-] CORE : fixed bug #PSCFV-10175 - No virtuel download email send after accepted payment 2013-08-27 18:13:44 +02:00
Vincent Augagneur
901c08cac8 [-] FO : fixed bug when is virtual cart on OPC carriers is no longer displayed 2013-08-27 18:13:22 +02:00
Rémi Gaillard
30a914b148 // typo 2013-08-27 15:41:00 +02:00
Damien Metzger
17618efb8b // Fixed details 2013-08-27 15:27:51 +02:00
Rémi Gaillard
a964162a01 // Fix cms_block creation loop on shop addition 2013-08-26 18:31:45 +02:00
Rémi Gaillard
2435edc98c // small fix 2013-08-26 17:17:26 +02:00
Rémi Gaillard
1033c61ced Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-26 17:13:51 +02:00
Rémi Gaillard
1b26cfffd9 // small fix 2013-08-26 17:13:29 +02:00
djfm
4c5c38fe61 // updated Czech localization pack 2013-08-26 14:47:54 +00:00
Rémi Gaillard
b7a03bdffa // sometimes image was not the cover one for blocklayered 2013-08-26 10:37:59 +02:00
Damien Metzger
08dadb7fd3 Merge pull request #660 from djfm/rel
// Small fixes in installer links
2013-08-26 01:37:15 -07:00
Rémi Gaillard
a23772dfb7 // small change in blockstore logo name 2013-08-26 10:33:25 +02:00
djfm
1e1aff517f // fixed link in russian installer 2013-08-23 14:37:01 +00:00
djfm
fad94047ff // small fixes in installer translations 2013-08-23 14:33:51 +00:00
Damien Metzger
9e9eb37978 // Updated translations with remote packages 2013-08-23 10:23:50 +02:00
Damien Metzger
03dc07de2f // And readme ! 2013-08-22 17:36:23 +02:00
Rémi Gaillard
8ff8ea416d // fix weird bug 2013-08-22 17:37:46 +02:00
Damien Metzger
5c1e8e2d79 // CHANGELOG 1.5.5.0 2013-08-22 17:26:53 +02:00
Jerome Nadaud
94133bf734 [-] FO : FixBug duplicate fields for delivery address in OPC mode 2013-08-22 16:45:52 +02:00
Damien Metzger
813c32df2f Merge pull request #659 from djfm/release
// Translations
2013-08-22 07:35:38 -07:00
djfm
fb4a9cdb36 // added missing IT installer strings 2013-08-22 14:06:38 +00:00
djfm
73515f6401 // added missing PL installer strings 2013-08-22 13:57:01 +00:00
djfm
e06b01699b // added missing BR installer strings 2013-08-22 13:44:33 +00:00
djfm
2082e2ad19 // added missing ES installer strings 2013-08-22 13:43:53 +00:00
Rémi Gaillard
a21d3fd22e // shipping block was missplaced on order-detail 2013-08-22 15:41:34 +02:00
djfm
29cb603804 // added missing RU installer strings 2013-08-22 13:30:12 +00:00
Vincent Augagneur
b67827772b [-] BO : fixed bug when save carrier without range 2013-08-22 15:17:14 +02:00
djfm
47827a1a1b Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-22 12:31:28 +00:00
Damien Metzger
4de8013b5e // Fixed phone number in installer 2013-08-22 12:19:32 +02:00
Rémi Gaillard
f476b34139 [-] BO: Fix multishop association for tax rules group - #PSCFV-9967 2013-08-22 11:13:11 +02:00
Rémi Gaillard
9d261b8f1f Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-22 10:54:07 +02:00
Rémi Gaillard
907d81c32e // duplication of tax_rules_group on adminproducts with multishop 2013-08-22 10:53:50 +02:00
Vincent Augagneur
6ad274e39d //Small fix 2013-08-22 10:33:03 +02:00
Vincent Augagneur
eea79052e0 [-] BO : fixed bug #PSCFV-10169 - now you can go backward from step 3 to 2 when no ranges are set 2013-08-22 10:15:55 +02:00
Vincent Augagneur
ba95c9a63a [-] BO : fixed bug #PSCFV-10073 - now you can upload carrier logo on windows 2013-08-22 10:09:49 +02:00
Rémi Gaillard
099baaef70 // small change on specific price rules after condition deletion 2013-08-21 19:14:59 +02:00
Rémi Gaillard
3fcf166a9d // small fix 2013-08-21 18:24:10 +02:00
Rémi Gaillard
dd9aa9fdb5 // disable log deletion 2013-08-21 17:43:34 +02:00
djfm
5faaef9f21 // fixed a few untranslatable strings in CarrierWizard 2013-08-21 14:33:22 +00:00
Damien Metzger
4d3fc8c314 [-] MO : fixed smarty cache on blocksearch #PSCFV-8739 2013-08-21 15:13:49 +02:00
Rémi Gaillard
600b027efd // fix root categories addition 2013-08-21 14:37:39 +02:00
Damien Metzger
65c6d86e6e // Fixed simple multistore process 2013-08-21 10:23:53 +02:00
Damien Metzger
3287e1664c // Added target blank in a transverse link 2013-08-21 10:18:46 +02:00
Damien Metzger
65becc8550 // Fixed typo 2013-08-21 10:10:52 +02:00
gRoussac
50d5a71ca6 [-] Classes : fix memcache ext #PSCFV-5225 thanks @up2date 2013-08-20 23:09:12 +02:00
Rémi Gaillard
20e2f07939 [-] BO: Delete from attribute_shop when an attribute group is deleted #PSCFV-9902 2013-08-20 17:56:26 +02:00
Damien Metzger
ad2702e609 // Config files were translated in french 2013-08-20 17:49:05 +02:00
Rémi Gaillard
3fcb65ca0f [-] WS: Fix retrieve of stock_availables when stock is shared on the shop group 2013-08-20 17:18:07 +02:00
Jerome Nadaud
e80e2ac5e3 [-] BO : FixBug #PSCFV-10075 remove product attribute image association on delete product attribute 2013-08-20 17:05:48 +02:00
Damien Metzger
750f374036 // error log only in dev mode for pcre backtrack limit #PSCFV-9012 2013-08-20 16:40:17 +02:00
Jerome Nadaud
57d8d9c232 [-] BO : FixBug Preview product url 2013-08-20 15:34:00 +02:00
Damien Metzger
eeb469dda5 [-] FO : fixed bad search redirection #PSCFV-10158 2013-08-20 14:52:53 +02:00
Damien Metzger
43c544465e // Removed deprecated parameter 2013-08-20 14:48:58 +02:00
Vincent Augagneur
f71d4a63cf //small fix 2013-08-20 11:46:58 +02:00
Vincent Augagneur
258d381083 [-] BO fixed bug #PSCFV-9663 - .live() method is deprecated on 1.7 jquery and it is not present into the 1.9 2013-08-20 11:11:21 +02:00
Damien Metzger
496db1d13e // Added automatic smarty cache clearing after catalog import (csv) 2013-08-20 10:45:55 +02:00
Damien Metzger
c5f635f967 // Updated some meta and translations 2013-08-20 10:31:03 +02:00
Damien Metzger
cf1798d2a1 [-] MO : multilines translations does not work #PNM-1645 2013-08-20 09:55:44 +02:00
Vincent Augagneur
8a0745e8de [-] BO : fixed bug #PSCFV-9782 - live edit bug with multistore 2013-08-19 17:21:03 +02:00
Jerome Nadaud
155fd516ba // Misplaced if 2013-08-19 14:41:08 +02:00
Vincent Augagneur
bad151a66f [-] BO : fixed range deletion when press enter on input 'all' on carrier wizard 2013-08-19 10:20:22 +02:00
Damien Metzger
218ce59de6 [-] Installer : added ob_start() (required with the cookie mode when debug mode is activated) 2013-08-19 10:04:23 +02:00
Damien Metzger
c5097b19cc [-] TR : fixed missing space in RMA PDF 2013-08-19 09:54:05 +02:00
Jerome Nadaud
add997dbba // Traduction error 2013-08-14 18:29:46 +02:00
Jerome Nadaud
8cd3fd0cfe [-] FO : FixBug Missing PS_STOCK_MANAGEMENT smarty variable 2013-08-14 17:40:36 +02:00
Jerome Nadaud
c180a20cf9 [-] BO : FixBug #PSCFV-7571 Error checking available product quantity 2013-08-14 17:16:41 +02:00
Jerome Nadaud
274c90468f // Syntax error 2013-08-14 16:14:56 +02:00
Rémi Gaillard
d40d841cf3 // something is missing in 3d591be8c6 2013-08-14 15:15:41 +02:00
Rémi Gaillard
24ac8582bf [*] BO: Warehouse name is now displayed on each product line orders 2013-08-14 15:02:30 +02:00
Jerome Nadaud
6cff684af1 [-] BO : FixBug update received quantity in suply order 2013-08-14 14:38:10 +02:00
Vincent Augagneur
ec39b9e701 [-] BO : fixed bug #PSCFV-10111 when carrier is free don't display ranges in summary 2013-08-14 14:19:52 +02:00
Rémi Gaillard
3d591be8c6 [-] Core: Fix language link with multishop from another shop #PSCFV-10063 2013-08-14 11:25:46 +02:00
Damien Metzger
cecaee8e68 [-] BO : Added comprehensive error display when prestashop cannot write the .htaccess file 2013-08-14 11:18:19 +02:00
gRoussac
b22c2b28ec Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-14 10:29:24 +02:00
gRoussac
0bd04d9f3e [*] BO : Clear smarty cache when submitting SEO rules 2013-08-14 10:27:39 +02:00
Jerome Nadaud
1a1666c399 // Syntax error 2013-08-13 18:45:18 +02:00
gRoussac
533b28ce32 Merge branch 'prestarocket-duplicate_id' into release 2013-08-13 18:26:51 +02:00
gRoussac
f459af7090 Merge branch 'duplicate_id' of https://github.com/prestarocket/PrestaShop into prestarocket-duplicate_id 2013-08-13 18:26:22 +02:00
Damien Metzger
7d0e0a7f38 // Removed useless Tools::safeOutput before insertion in the database 2013-08-13 18:21:23 +02:00
Vincent Augagneur
26036cf7b2 //fixed min and max rang in carrier summary 2013-08-13 17:41:43 +02:00
Vincent Augagneur
b9808c5b5e //small js fix 2013-08-13 17:26:16 +02:00
Jerome Nadaud
c6d3545b8b [-] BO :FixBug Suppliers and Warehouses accordion 2013-08-13 17:14:57 +02:00
Vincent Augagneur
f8acc2a15e //small typo 2013-08-13 16:46:44 +02:00
Vincent Augagneur
62ab457908 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-13 16:42:36 +02:00
Vincent Augagneur
c11c55e83c //small css fix 2013-08-13 16:42:32 +02:00
gRoussac
1984cb6272 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-13 16:30:39 +02:00
gRoussac
5123d2505e [-] CORE : Do not delete index.php in smarty cache or /img/tmp/ 2013-08-13 16:29:40 +02:00
Damien Metzger
f9fdcb1103 [-] FO : fixed html tags that should not appear in blockcategories 2013-08-13 16:22:38 +02:00
Vincent Augagneur
6e386868a6 [-] BO : fixed bug #PSCFV-10096 2013-08-13 16:14:09 +02:00
gRoussac
e8685b1430 [*] BO : Add clear smarty cache button 2013-08-13 15:11:00 +02:00
Damien Metzger
b1b636a911 // Added helpbox and fixed translation 2013-08-13 14:16:40 +02:00
Damien Metzger
86fba93f63 [-] Installer : fixed clear smarty cache 2013-08-13 13:37:04 +02:00
Vincent Augagneur
a2d005701e Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-13 11:36:57 +02:00
Vincent Augagneur
b9b03d8259 //small css fix 2013-08-13 11:36:52 +02:00
Damien Metzger
4a6d1e8ff6 [-] Installer : changed syntax from $class:func to call_user_func because it seems to be more compliant with old PHP versions 2013-08-13 11:02:32 +02:00
Rémi Gaillard
9c523cf7eb // Log for product deletion was missing 2013-08-13 10:21:01 +02:00
Vincent Augagneur
da02895432 //fix carrier wizard with multistore part2 2013-08-13 10:10:27 +02:00
Vincent Augagneur
6cfde246a2 //fix carrier wizard with multistore 2013-08-13 10:09:19 +02:00
Vincent Augagneur
3aff1341f6 //small fix 2013-08-13 10:01:18 +02:00
Rémi Gaillard
284f758cb4 [-] FO: Fix quantity discount table display for non default attribute #PSCFV-9942 2013-08-12 18:40:52 +02:00
Vincent Augagneur
0cd6c5b200 //new tab name for carrier option 2013-08-12 17:32:55 +02:00
Jerome Nadaud
a06dfafb9a // Avoid some filters errors 2013-08-12 15:44:13 +02:00
Vincent Augagneur
e2e5fbe33a //now you can delete all carriers 2013-08-12 15:25:26 +02:00
Vincent Augagneur
7cc59b2f49 //fixed bug #PSCFV-10091 part2 2013-08-12 15:23:52 +02:00
Vincent Augagneur
7a06dca942 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-12 15:18:02 +02:00
Vincent Augagneur
a1be985067 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-12 15:17:35 +02:00
Vincent Augagneur
7ff8e44386 [-] BO : fixed bug when carrier is free and change shipping method 2013-08-12 15:17:28 +02:00
Jerome Nadaud
06cdeb45a5 [-] FO : FixBug #PSCFV-10058 - Missing required form fields in address format 2013-08-12 15:17:21 +02:00
Rémi Gaillard
de41faff80 [-] Core: Fix #PSCFV-8887 - improve performance of search indexation 2013-08-12 15:16:45 +02:00
Vincent Augagneur
bae9df61dc //revert reorganization of shipping menus & options 2013-08-12 15:15:17 +02:00
Vincent Augagneur
136586830d //small fix 2013-08-12 15:09:40 +02:00
Vincent Augagneur
30c9156a41 [-] BO : fixed bug #PSCFV-10091 - you can now enable all zone in one clic 2013-08-12 14:56:49 +02:00
Vincent Augagneur
52806c0056 [-] BO : fixed bug #PSCFV-10033 - disable next step if no range has been added on carrier wizard 2013-08-12 14:41:44 +02:00
Jerome Nadaud
1359f46bae [-] FO : FixBug #PSCFV-10090 urlencode syntax error - Thanks Duarte 2013-08-12 14:37:32 +02:00
Jerome Nadaud
4c47c980f8 // Javascript error if address does not exist 2013-08-12 11:57:40 +02:00
Vincent Augagneur
627e3d8a77 [-] BO : fixed multistore thumbnail on product list 2013-08-12 11:27:25 +02:00
Vincent Augagneur
6befd831c9 //small install fix 2013-08-12 11:10:12 +02:00
Vincent Augagneur
3664f4c394 //reorganization of shipping menus & options 2013-08-12 11:02:28 +02:00
gRoussac
7b92675778 [-] CORE : Fix bug #PSCFV-8542 could not have rewrited link for modules in blocklanguage 2013-08-12 10:26:40 +02:00
Jerome Nadaud
54189a5d97 [-] MO : sendtofriend FixBug Form error 2013-08-09 19:03:43 +02:00
Jérôme Nadaud
f119b8e64f [-] FO : FixBug #PSCFV-10058 Invalid id country after allow to select no country 2013-08-09 19:00:18 +02:00
Jérôme Nadaud
7b41098a5d [-] FO : FixBug CGV does not pop-up in Fancy Box 2013-08-09 18:59:00 +02:00
Jerome Nadaud
8be3344e41 // W3C validation error 2013-08-09 18:49:47 +02:00
Jerome Nadaud
bc7d16ede6 [-] FO : FixBug generated_date error 2013-08-09 18:48:26 +02:00
Jerome Nadaud
501cbea5aa [-] BO : FixBug root category listed after list reset 2013-08-09 18:45:40 +02:00
gRoussac
67a0c96ea2 [-] CORE : getModuleLink not working on module custom route, merge from https://github.com/PrestaShop/PrestaShop/pull/487 thanks @zimmi1 2013-08-09 18:36:23 +02:00
gRoussac
41d29b5445 [-] CORE : Addslashes on not translated strings for javascript js=1 2013-08-09 18:26:26 +02:00
gRoussac
92840f85fe [-] BO : Fix additional quote in live edit template 2013-08-09 18:04:08 +02:00
Damien Metzger
eb0d2d47e4 // The blunder wasn't mine :) 2013-08-09 17:31:00 +02:00
Damien Metzger
971b45e630 // fixed variable that does not exists 2013-08-09 17:21:24 +02:00
Vincent Augagneur
431aa78b6f //small fix 2013-08-09 16:36:26 +02:00
gRoussac
8733b968f5 [-] FO : input token missplaced in address.tpl 2013-08-09 14:31:59 +02:00
Damien Metzger
2820314586 [-] MO : fixed potential warning in pscleaner #PSCFV-10070 2013-08-09 11:40:59 +02:00
Rémi Gaillard
1183b14ea9 [-] MO: no more 1.4 support for blocklayered 2013-08-09 11:24:21 +02:00
Kevin Granger
328c6a5439 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-09 11:19:39 +02:00
Kevin Granger
2549924cef Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-09 11:10:58 +02:00
Vincent Augagneur
f41bf1dcca [-] MO : fixed bug #PNM-792 : remove unused js file in blocklayered 2013-08-09 11:07:49 +02:00
Kevin Granger
617c1e01d2 //fix steps of Carriers Wizard with multishop activated 2013-08-09 11:06:54 +02:00
Vincent Augagneur
a5be1f147f //small fix when multi-store is enable on carrier wizard 2013-08-09 10:58:07 +02:00
Vincent Augagneur
1571dd60c8 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-09 10:44:24 +02:00
Vincent Augagneur
13be8db639 //added checkbox for all zones 2013-08-09 10:44:20 +02:00
Damien Metzger
cac7b267e6 [-] MO : fixed category link on blocklayered #PNM-1427 2013-08-09 10:37:23 +02:00
Damien Metzger
eed7ceb37a [-] MO : blocklayered also try to find the translations in the translations directory 2013-08-09 10:21:37 +02:00
Damien Metzger
0fc1c9184c [-] MO : added visibility IN ("both", "catalog") in blocklayered 2013-08-09 10:11:01 +02:00
gRoussac
9ccd9b7cad [-] FO : Do not redirect on 301 when POST request 2013-08-08 19:19:34 +02:00
gRoussac
e923455f6d // revert from 589052325b 2013-08-08 18:58:04 +02:00
Damien Metzger
50cba2b12b // Added link to Addons in the footer 2013-08-08 17:49:17 +02:00
Damien Metzger
95680e0158 [*] FO : added chinese/japanese search 2013-08-08 16:58:07 +02:00
Rémi Gaillard
d2f41d7467 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-08 15:52:42 +02:00
Rémi Gaillard
589052325b // Fix cart with ssl 2013-08-08 15:52:16 +02:00
gRoussac
16fec55c6f // report of 0023950c72 2013-08-08 12:16:19 +02:00
Rémi Gaillard
cbdea59753 // revert 1c80b5fdfe 2013-08-08 11:50:35 +02:00
Rémi Gaillard
5832ab3eb5 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-08 11:40:58 +02:00
Rémi Gaillard
567321dd3d // clean cookie after logout 2013-08-08 11:39:36 +02:00
Damien Metzger
169c3fbc6b // Removed useless line 2013-08-08 11:24:20 +02:00
gRoussac
5b3dda1cfb Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-08 11:05:37 +02:00
gRoussac
1c80b5fdfe [-] BO : list of carriers should only contain the active one in AdminProducts 2013-08-08 11:05:09 +02:00
Damien Metzger
4709f4a3c0 [-] MO : fixed module upgrade with common version number 2013-08-08 11:03:22 +02:00
Damien Metzger
a9b44884f1 // Fixed upgrade of homeslider module 2013-08-08 10:47:03 +02:00
gRoussac
c31c2ca0e9 [-] MO: cover image issue with layered block on multishop, thanks @theginie 2013-08-08 10:46:22 +02:00
gRoussac
1bfa43fa8b [-] MO : My account column block should not display module icon in list 2013-08-08 10:38:39 +02:00
gRoussac
0f4562eb44 [*] MO : added manufactureres order by name, thanks@Jacky75 2013-08-08 10:24:05 +02:00
gRoussac
4abff03244 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-08 10:17:00 +02:00
gRoussac
d6ab0696e6 [-] BO : OrderSlip now correctly displays the order slip date, thanks @Jacky75 2013-08-08 10:16:41 +02:00
Damien Metzger
ff69638595 // removed kay navigation in carrier wizard 2013-08-08 09:38:52 +02:00
Damien Metzger
05946f2932 [-] MO : blocktopmenu should clear cache when adding a new subcategory 2013-08-08 09:35:19 +02:00
Damien Metzger
0550ad5135 // Fixed smarty parse error on live edit 2013-08-08 09:29:13 +02:00
gRoussac
f89e42a5c5 Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-07 18:12:41 +02:00
gRoussac
601bfa628b [-] FO :ProductSale::getBestSales() by modified date renders SQL error, thanks @SebSept 2013-08-07 18:10:39 +02:00
Vincent Augagneur
73f40a6cc6 //fixed carrier wizard typewatch 2013-08-07 17:29:44 +02:00
gRoussac
a1786b97b3 [-] FO : expiration date not displayed in email for downloadable product 2013-08-07 17:08:50 +02:00
gRoussac
5df213f5ae Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-07 15:06:50 +02:00
Rémi Gaillard
d916e65a14 // missing return 2013-08-07 13:56:12 +02:00
Rémi Gaillard
6ccf3e839d // change passwd in cookie after changed it 2013-08-07 13:51:18 +02:00
gRoussac
e43f0619ca Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release 2013-08-07 11:53:23 +02:00
gRoussac
82621c08ec [-] BO : Do not display root category bool if addrootcategory not in url 2013-08-07 11:51:48 +02:00
Gregory Roussac
d99a5a740e Merge pull request #638 from vinvin27/patch-1
// parse error
2013-08-07 02:51:21 -07:00
vinvin27
843989489d Update AdminPPreferencesController.php
Parse error: syntax error, unexpected T_ARRAY, expecting ')' in /controllers/admin/AdminPPreferencesController.php on line 120
2013-08-07 11:47:56 +02:00
Rémi Gaillard
e6a819e5dd // Fix double quote translations 2013-08-07 11:29:34 +02:00
gRoussac
ac21fa9808 [-] MO : Missing image in my account for MODULE WishList 2013-08-07 10:56:09 +02:00
Gregory Roussac
3213b5dffb Merge pull request #635 from cippest/development
[-] BO : missing order lang in Mail::l for in_transit email
2013-08-06 11:23:19 -07:00
cippest
f8efd7a329 [-] BO : Fix send e-mails updating tracking number
Hi,
We've fixed some bugs parameters about the Send function of Mail class in the AdminOrdersController.php.

Regards,
Massimo.
2013-08-06 19:51:16 +02:00
gRoussac
7089ce10ef // remove warnings in blockwishlist 2013-08-06 19:05:08 +02:00
Gregory Roussac
b1ea66d510 Merge pull request #528 from ldecoker/patch-7
[-] FO : missing $tpl_dir shopping-cart.tpl pathes
2013-08-06 09:57:36 -07:00
Gregory Roussac
bf355e934e Merge pull request #634 from PhpMadman/RefSort
[*] FO : Sort by Product reference
2013-08-06 09:13:06 -07:00
Vincent Augagneur
67b44b5f17 //fixed carrier bug and added typewatch plugin on range validation 2013-08-06 18:04:12 +02:00
Damien Metzger
bfa5bae702 // Fixed display of root category 2013-08-06 17:45:24 +02:00
Damien Metzger
5be8e169f5 // Fixed totally unexplicable behavior 2013-08-06 17:40:49 +02:00
Vincent Augagneur
ea5f4476a6 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 16:56:05 +02:00
Vincent Augagneur
5ed75901fb //typo 2013-08-06 16:55:51 +02:00
Damien Metzger
2303677ebf // Rollback a modification in object model 2013-08-06 16:52:13 +02:00
Damien Metzger
a1cf8d462f // Keep remote file retrieval in the right order 2013-08-06 16:42:10 +02:00
Damien Metzger
b701acc8cf // Clean language pack retrieval 2013-08-06 16:15:30 +02:00
PhpMadman
e4a42ab2b1 Update AdminPPreferencesController.php 2013-08-06 16:08:09 +02:00
PhpMadman
d4270289c1 Update category-product-sort.tpl 2013-08-06 16:06:03 +02:00
Vincent Augagneur
bcaa625f4c //default language fix in carrier wizard 2013-08-06 16:05:36 +02:00
Damien Metzger
c8564fa6b2 // Quick CSS fix 2013-08-06 16:02:22 +02:00
Damien Metzger
d783160af0 // Updated installer 2013-08-06 15:53:59 +02:00
Jerome Nadaud
375fa451d8 [-] FO : FixBug No warning message when no carriers available from advanced stock management 2013-08-06 15:53:25 +02:00
Damien Metzger
38753716e2 // Hide "is root category" option outside multistore 2013-08-06 15:42:31 +02:00
PhpMadman
598a5b3188 [*] FO : Add reference sort to theme 2013-08-06 15:38:25 +02:00
PhpMadman
cd254f8795 [*] FO : Add reference sort to theme 2013-08-06 15:37:10 +02:00
PhpMadman
5e73f0cb07 [*] BO: Add reference to Options 2013-08-06 15:34:58 +02:00
PhpMadman
6a54f6efd5 [*] BO: Add reference to FrontController 2013-08-06 15:32:30 +02:00
gRoussac
4bd59c14cc [*] FO : Blur for tab navigation, followup a0ee3d3, thanks @Seynaeve 2013-08-06 15:21:46 +02:00
gRoussac
a739117f0d Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 15:20:07 +02:00
gRoussac
8103e89874 [*] FO : Blur for tab navigation, followup a0ee3d3c34, thanks @Seynaeve 2013-08-06 15:19:47 +02:00
Gregory Roussac
a0ee3d3c34 Merge pull request #633 from Seynaeve/patch-1
[*] FO : Allow B2B to navigate through the form with Tab betwwen company and VAT field
2013-08-06 06:17:06 -07:00
gRoussac
dbb2b50555 [-] MO : mod='blockmyaccount' missing in blockmyaccountfooter.tpl 2013-08-06 15:15:03 +02:00
gRoussac
c966eea140 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 15:11:46 +02:00
Damien Metzger
9caf97ff30 // Add check in object model 2013-08-06 15:11:23 +02:00
Gregory Roussac
4bf773af65 Update .gitignore 2013-08-06 15:10:39 +02:00
gRoussac
c9bf17f400 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 15:09:38 +02:00
Gregory Roussac
12a3ef3a12 Merge pull request #486 from PhpMadman/patch-1
[-] FO : In stock sort is now removed when Stock managment is disabled
2013-08-06 15:08:55 +02:00
Damien Metzger
3839dbee9a / Add check in object model 2013-08-06 15:06:46 +02:00
Damien Metzger
85e15c00f1 // Added missing french translation in the installer 2013-08-06 14:30:43 +02:00
Seynaeve
4d29142907 Allow B2B to navigate through the form with Tab
With
$('#company').blur(function(){
VAT only appears when we leave the input and therefore does not allow to navigate through the form with Tab

With
$('#company').on('input',function(){
that work
2013-08-06 14:15:45 +02:00
Gregory Roussac
ba69e48f72 Merge pull request #488 from camlafit/pr-countriesbrowser
[*] FO : Better regexp to get country browser from HTTP_ACCEPT_LANGUAGE
2013-08-06 03:07:13 -07:00
Gregory Roussac
818e82c09c Merge pull request #486 from PhpMadman/patch-1
[-] FO : In stock sort is now removed when Stock managment is disabled
2013-08-06 02:49:48 -07:00
Vincent Augagneur
3f6ee7cfdd Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 11:46:15 +02:00
Vincent Augagneur
7b600ad07f //small css fix 2013-08-06 11:45:59 +02:00
gRoussac
fe0afeadc9 [-] MO : mod='blockmyaccount' missing in blockmyaccountfooter.tpl (translation doesnt work), thanks @mypresta-eu 2013-08-06 11:45:29 +02:00
Vincent Augagneur
478e338df0 //added active field on carrier wizard 2013-08-06 11:40:03 +02:00
gRoussac
6449437f58 // norms 2013-08-06 11:38:34 +02:00
gRoussac
084880abda Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 11:38:24 +02:00
gRoussac
16d942b7b6 [*] BO : Do not insert duplicates in product_carrier, thanks @edamart 2013-08-06 11:22:40 +02:00
gRoussac
81e4a5f635 [*] BO : Do not insert duplicates in poruct_carrier, thanks @edamart 2013-08-06 11:19:34 +02:00
Francois Gaillard
c0bc3bda29 // Bug fix template override & admin templates 2013-08-06 11:13:49 +02:00
Vincent Augagneur
33bdfa9c96 //added some help 2013-08-06 11:06:36 +02:00
Gregory Roussac
1b93d251aa Merge pull request #630 from rimas-kudelis/development
[*] CORE :ProductCore::addSupplierReference() if a reference already exists  update it
2013-08-06 01:51:34 -07:00
gRoussac
edfe77b74f Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-06 10:43:14 +02:00
gRoussac
a69d1c6d05 Merge branch 'smarty_debug' of https://github.com/PrestaEdit/PrestaShop into PrestaEdit-smarty_debug
Conflicts:
	controllers/admin/AdminPerformanceController.php
	install-dev/data/xml/configuration.xml
2013-08-06 10:42:44 +02:00
Damien Metzger
f557f24df4 // Fixed module cache key (with the country) 2013-08-06 10:41:58 +02:00
Gregory Roussac
77ba55b090 Merge pull request #629 from ChristopheBoucaut/patch-4
[-] WS : setFieldsToDisplay() calls $this->resourceConfiguration, never initialized
2013-08-06 01:30:46 -07:00
Vincent Augagneur
5bcfc7d4e9 //carrier wizard step validation part 2 2013-08-06 10:30:10 +02:00
Rimas Kudelis
83740496de Update more properties of supplier reference in ProductCore::addSupplierReference() if a reference already exists. 2013-08-06 11:28:42 +03:00
Vincent Augagneur
fe58053439 //carrier wizard step validation 2013-08-06 10:27:32 +02:00
ChristopheBoucaut
0139e3f877 Update WebserviceRequest.php
The deleted method calls $this->resourceConfiguration, which is never initialized in specific web services, so if we use the "display" parameter, the webservice returns an error
2013-08-06 10:22:45 +02:00
Gregory Roussac
23b9c3b8f9 Merge pull request #627 from davyrolink/upstream
[*] CORE : add $smarty to params in smartyHook function
2013-08-06 01:10:41 -07:00
Vincent Augagneur
88d4f57894 //carrier range validation fix 2013-08-06 10:04:54 +02:00
Francois Gaillard
29bbe81ae6 // CloudCache removed from AdminPerformanceController 2013-08-06 09:25:47 +02:00
Davy Rolink
0b99a7b331 added the smarty var to the hook_params, this makes it possible to create modules that can assign variables to the smarty local scope 2013-08-05 23:20:19 +02:00
Gregory Roussac
5f0ef76731 Merge pull request #626 from davyrolink/upstream
[-] CORE : id_address_invoice was not updated, updateAddressId method
2013-08-05 14:13:54 -07:00
Davy Rolink
f3361fbedf Bug fix: id_address_invoice was not updated, updateAddressId method of the Cart class 2013-08-05 22:53:54 +02:00
Rémi Gaillard
faec5a9226 // small change on fixtures installation 2013-08-05 20:33:39 +02:00
gRoussac
adceb5ccf5 [-] Fo : Bad date format in order-detail, merge from https://github.com/PrestaShop/PrestaShop/pull/476 thanks @gbelorgey 2013-08-05 19:16:44 +02:00
Gregory Roussac
9f13b9f7b1 Merge pull request #474 from madef/master
[*] Project : Add paging to Collections
2013-08-05 09:52:16 -07:00
jeromenadaud
8be06bba2d [-] BO : FixBug Multiple list pagination error. 2013-08-05 18:22:30 +02:00
gRoussac
d585b015c1 // move toolbar delete button on AdminProducts 2013-08-05 18:18:35 +02:00
Gregory Roussac
931cfee258 Merge pull request #625 from axometeam/patch-18
[-] MO : All fields available in the RSS
2013-08-05 09:06:02 -07:00
Vincent Augagneur
ea10b94ef2 //onkeypress enter to validate range 2013-08-05 18:02:08 +02:00
Axome
9dfeb1d528 All fields available in the RSS
Not just link & title but all available fields
2013-08-05 17:58:49 +02:00
Vincent Augagneur
cf9d20f83b //range overlapping bug fix 2013-08-05 17:43:31 +02:00
gRoussac
9ca9928c58 [-] CORE : Fix for field validation in ObjectModel::validateFieldsLang() when default lang value not set, thanks @rimas-kudelis 2013-08-05 17:17:22 +02:00
gRoussac
5cd75f23ff [-] CORE : Cast product price to float instead of int when adding supplier reference, thanks @rimas-kudelis 2013-08-05 17:05:07 +02:00
Vincent Augagneur
3a75a783f6 //added label on carrier zones && improve range validation 2013-08-05 16:54:36 +02:00
gRoussac
a98740d25c // small change, switch two buttons in list_header 2013-08-05 16:39:29 +02:00
jeromenadaud
fc54ddb86f Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-05 16:32:55 +02:00
jeromenadaud
114eb3b78b [-] BO : FixBug Manufacturer multilist pagination, filter, order problems and manufacturer address filter exception 2013-08-05 16:32:39 +02:00
Francois Gaillard
58b5028147 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-05 16:25:57 +02:00
Francois Gaillard
176c6a8767 [-] Classes : ModuleFrontController updated. Thank you @codeurWeb 2013-08-05 16:25:52 +02:00
jeromenadaud
48f041f035 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-05 16:12:04 +02:00
jeromenadaud
b81c021144 [-] BO : FixBug #PSCFV-8311 pagination, filter and order with multilist 2013-08-05 16:11:48 +02:00
Rémi Gaillard
3317ab878d [-] WS: add id_address_delivery on cart products association 2013-08-05 15:53:40 +02:00
Gregory Roussac
07181a37f5 Merge pull request #413 from ccauw/patch-9
[-] BO : bug color parameter in List
2013-08-05 06:37:46 -07:00
Francois Gaillard
db951f5b76 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-05 15:37:20 +02:00
Francois Gaillard
f217061e27 [-] Classes : ModuleFrontController & templates overrides fixed 2013-08-05 15:37:16 +02:00
Damien Metzger
f3b87f126a // Feeder not installed by default 2013-08-05 15:32:52 +02:00
gRoussac
ed887fd5c3 [*] BO : Add filter choices in title of List, thankx to @ccauw 2013-08-05 15:18:42 +02:00
gRoussac
2ea0dc7749 [*] CORE : Allow external css loading, manual merge of https://github.com/PrestaShop/PrestaShop/pull/406 thanks @m-hume 2013-08-05 14:26:07 +02:00
Gregory Roussac
d1631e6920 Merge pull request #405 from ottonascarella/patch-1
[*] CORE : Enable Progressive JPG
2013-08-05 05:08:10 -07:00
Vincent Augagneur
5a88dc0f8b //fixed bug on carrier wizard when edit carrier 2013-08-05 14:06:50 +02:00
Gregory Roussac
b8e5ad0e44 Merge pull request #624 from iNem0o/development
[-] FO : getBestSales() $order_way doesnt  work in DESC mode
2013-08-05 04:58:39 -07:00
inem0o
2de866eff3 Correct assignation of $order_way parameter 2013-08-05 12:21:19 +02:00
gRoussac
13b3adb8c0 [-] INSTALLER : Force update of PS_LEGACY_IMAGES to 0 2013-08-05 12:17:21 +02:00
gRoussac
8c2af798a4 // small change on pack css 2013-08-05 12:01:40 +02:00
Damien Metzger
144c85ed4f // Removed useless param 2013-08-05 11:40:03 +02:00
Damien Metzger
581dcec718 // [-] IN : Fixed language detection and help in the installer 2013-08-05 11:23:09 +02:00
Damien Metzger
7f4e4efbd8 [*] TR : Added 10 new localization packs 2013-08-05 11:23:09 +02:00
gRoussac
19918dea8e [-] BO : Fix bug #PSCFV-8139 bad renderform on errors in AdminStatuses 2013-08-05 10:47:04 +02:00
Sarah Lorenzini
166d8a69fa [-] FO: fixed bug shopping cart price misplaced - #9971 2013-08-05 10:21:46 +02:00
Rémi Gaillard
003c05a729 [-] BO: Fix #PSCFV-9885 catalog price rules edition 2013-08-05 09:55:29 +02:00
jeromenadaud
9ff0d60158 [-] BO : FixBug #PSCFV-7839 No invoice file attached to payment email confirmation 2013-08-05 09:41:46 +02:00
gRoussac
055134719d [-] BO : Fix warning in AdminAttributesGroups after https://github.com/PrestaShop/PrestaShop/pull/392 2013-08-02 18:33:53 +02:00
Gregory Roussac
47b7e6aab5 Merge pull request #392 from ldecoker/patch-4
[-] [BO] : The div for colorAttributeProperties is not closed
2013-08-02 09:15:51 -07:00
gRoussac
33116dfa47 [-] FO : Fix bug #PSCFV-9856 could not add Uncombinable cart rules and Minimum amount check badly calculated 2013-08-02 18:00:10 +02:00
Vincent Augagneur
be93a00277 //new place for validate and add new range && global range validation part 1 on carrier wizard 2013-08-02 17:29:15 +02:00
Vincent Augagneur
f55a8c2dd5 //remove debug 2013-08-02 11:38:38 +02:00
Vincent Augagneur
02fdc5fe24 //fixed float validation on carrier wizard 2013-08-02 11:25:08 +02:00
Vincent Augagneur
f2146ac2ae //fixed somes bug on carriers wizard 2013-08-02 10:54:07 +02:00
Vincent Augagneur
46d0663b2f //remove debug 2013-08-02 10:29:30 +02:00
Vincent Augagneur
9e720da3d6 //carrier wizard free shipping fix & added currency sign on new range 2013-08-02 10:22:06 +02:00
Damien Metzger
fc63b8ad7f // Improved configuration checklist 2013-08-02 09:11:55 +02:00
Kevin Granger
32b50b4dad // small fix on carriers wizard ( remove original css, and change js add/remove class .error to .errorStep) 2013-08-01 20:25:36 +02:00
Francois Gaillard
268b3c6bda // Variables name fixed 2013-08-01 19:14:04 +02:00
Francois Gaillard
b51d4f4c7d Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 19:11:27 +02:00
Francois Gaillard
28de7890d2 [*] MO : Templates overrides works with the new structure (/views/templates/admin|front|hook) 2013-08-01 19:10:25 +02:00
jeromenadaud
d8f5caee7b [-] BO : FixBug #PSCFV-7824 No total tax not show in order email confirmation 2013-08-01 19:09:34 +02:00
Vincent Augagneur
ac48c1b786 //remove inline css 2013-08-01 18:26:39 +02:00
jeromenadaud
3f2da1095f [-] BO: FixBug #PSCFV-10005 Filter on COUNT field 2013-08-01 18:06:14 +02:00
Francois Gaillard
07ce127723 [-] Classes : Bug fix Validate.php - Error with $mail_name 2013-08-01 17:31:45 +02:00
Francois Gaillard
7e7b5af26e // Profiler fixed 2013-08-01 17:21:38 +02:00
Vincent Augagneur
1447be6f3c //fixed bug when changing range type 2013-08-01 17:16:52 +02:00
Vincent Augagneur
fa958c9a5e //carrier wizard currency sign bug 2013-08-01 17:13:08 +02:00
gRoussac
6a073143f2 [-] BO : Fix bug #PSCFV-9990 bad count on list header helper 2013-08-01 16:15:41 +02:00
gRoussac
ccc2312053 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 16:12:19 +02:00
gRoussac
1028c8671c [-] CORE : Merge from PrestaEdit last pull request again 2013-08-01 16:12:05 +02:00
Vincent Augagneur
adede4f7ea //small fix 2013-08-01 16:11:50 +02:00
Vincent Augagneur
9c86943e2a Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 16:03:19 +02:00
Vincent Augagneur
c0db0bfca9 //Added currency sign and weigh unit on carrier wizard 2013-08-01 16:03:14 +02:00
Damien Metzger
b27d030fd2 // Added units to package dimensions 2013-08-01 15:52:07 +02:00
Vincent Augagneur
79a4a84163 //small fix on carrier wizard oups 2013-08-01 15:41:42 +02:00
Vincent Augagneur
f5454748b2 //small fix on carrier wizard 2013-08-01 15:41:01 +02:00
Vincent Augagneur
9df90cc575 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 15:23:30 +02:00
Vincent Augagneur
c9b1546a2e //disabled all fess when carrier is free 2013-08-01 15:23:26 +02:00
jeromenadaud
550aa01faf [-] BO : FixBug #PSCFV-9859 Carriers free shipping inline edit 2013-08-01 15:14:14 +02:00
jeromenadaud
48067e1a3d Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 15:12:37 +02:00
gRoussac
7fb483eaa2 // harmonisation within Tools:: instead self:: 2013-08-01 15:07:38 +02:00
gRoussac
c9bb88cac7 // harmonisation within Tools:: instead self:: 2013-08-01 14:52:29 +02:00
Gregory Roussac
99ebde1e8e Merge pull request #622 from PrestaEdit/patch-48
[*] CORE : toCamelCase should use utf8 Tools functions
2013-08-01 05:48:49 -07:00
PrestaEdit
37cd2a3ab3 [*] Class: Tools / toCamelCase
Change the name of the var to a correct name.

Use the Tools method like strtolower, ucfirst and strtoupper.
2013-08-01 14:42:51 +02:00
gRoussac
fd7facc9b1 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 14:28:41 +02:00
gRoussac
8a9376ae22 [-] FO : Fix bug #PSCFV-9993 could not see product quantity in pack content 2013-08-01 14:28:36 +02:00
gRoussac
2b6b65a303 // norms 2013-08-01 14:27:50 +02:00
jeromenadaud
409bc533cd [-] BO : FixBug #PSCFV-9748 Missing confirmation and update button problem 2013-08-01 14:21:48 +02:00
Vincent Augagneur
c6c4fd03e8 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 14:12:39 +02:00
Vincent Augagneur
0898a63060 //fixed bug when carrier is free 2013-08-01 14:12:32 +02:00
Damien Metzger
82a912e3f1 // Fixed iframe height in the installer 2013-08-01 12:30:38 +02:00
Damien Metzger
3cfa17b837 // Improved help iframe in the installer 2013-08-01 12:30:38 +02:00
Vincent Augagneur
afd41af8c5 //carrier wizard fix logo duplication when edit carrier 2013-08-01 12:20:55 +02:00
Vincent Augagneur
5f9d83dd37 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 12:10:06 +02:00
Vincent Augagneur
59fca8eb85 //carrier wizard fix when range as no fees 2013-08-01 12:09:58 +02:00
gRoussac
3e75881bdc Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-08-01 11:48:50 +02:00
Vincent Augagneur
dfb1924884 //carrier wizard fix when edit a carrier 2013-08-01 11:47:39 +02:00
gRoussac
184a1c561c [-] FO : Fix bug #PSCFV-9847 Cart Rule not updated when address is updated on Checkout Page 2013-08-01 11:44:00 +02:00
Vincent Augagneur
c432c44987 //carrier wizard fix 2013-08-01 11:42:58 +02:00
Vincent Augagneur
bf7c38ef49 //carrier wizard fix 2013-08-01 11:28:53 +02:00
Damien Metzger
af9397a11b [-] BO : fixed domain warning 2013-08-01 10:50:21 +02:00
Damien Metzger
ebe8d6294d // CSS fix for carrier wizard 2013-08-01 09:34:07 +02:00
Damien Metzger
0d7ca1d8cf // Install version ready for 1.5.5 2013-08-01 09:21:51 +02:00
Damien Metzger
168759a383 // Stock performance optimization 2013-07-31 18:46:45 +02:00
Damien Metzger
e930d40482 // Added debug function Tools::debug_backtrace() 2013-07-31 18:46:45 +02:00
Vincent Augagneur
33951c1834 //fixed carrier wizard summary range limit 2013-07-31 18:14:13 +02:00
Vincent Augagneur
d3b000e72f //fixed bug on carrier wizard when is_free 2013-07-31 18:09:00 +02:00
Vincent Augagneur
e1fa26d002 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-31 17:33:19 +02:00
Vincent Augagneur
32f23a79a4 //carrier wizard added validation fields 2013-07-31 17:33:09 +02:00
Vincent Augagneur
60ecfaafd2 //fixed bug on carrier wizard tabindex 2013-07-31 17:16:52 +02:00
gRoussac
c41537f4e4 [-] INSTALLER : missing parenthesis in SQL in set_product_suppliers, thanks to @EvaldasUzkuras 2013-07-31 16:08:54 +02:00
gRoussac
e85ffae69d [-] INSTALLER : Fix bug while updateing supplier reference, back from https://github.com/PrestaShop/PrestaShop/pull/618 thanks @EvaldasUzkuras 2013-07-31 15:55:06 +02:00
gRoussac
5e0b5db23b [*] BO : refact for modules exeptions regarding https://github.com/PrestaShop/PrestaShop/pull/614 2013-07-31 15:16:42 +02:00
Vincent Augagneur
69944e1618 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-31 14:31:27 +02:00
Vincent Augagneur
175427cb2e //fixed input text not disabled when change range behavior 2013-07-31 14:31:23 +02:00
Gregory Roussac
304e479ca5 Merge pull request #617 from axometeam/patch-16
[*] BO : Fix statistics redirection when change date
2013-07-31 05:17:13 -07:00
Axome
1187e7cb09 [*] BO : Fix statistics redirection when change date
When going into a special stats module (for exemple "statsproduct") if you change the date, Prestashop redirect to the "home" of statistics.
2013-07-31 14:15:33 +02:00
Gregory Roussac
b0ac617e9f Merge pull request #615 from nilsga/development
[-] BO : Fixed fieldset issue when customer is a guest
2013-07-31 05:15:13 -07:00
Gregory Roussac
6f27508972 Merge pull request #616 from sebastienhouzet/development
[*] CORE : htaccess in override folder
2013-07-31 05:11:41 -07:00
Yoozio
fd339d96b2 [*] Security : deny access to this folder as already done for classes 2013-07-31 12:29:05 +02:00
Nils-Helge Garli Hegvik
b362c808dc Fixed fieldset issue when customer is a guest 2013-07-31 12:25:35 +02:00
Vincent Augagneur
e3265dcb1b //carrier wizard range validation 404 when change range type 2013-07-31 11:12:01 +02:00
Vincent Augagneur
be7e4b4128 //carrier wizard Shipping and handling are set to no by default 2013-07-31 11:00:31 +02:00
Vincent Augagneur
80c2e3ea60 //small fix on carrier wizard 2013-07-31 10:34:52 +02:00
jeromenadaud
d68363fdda [-] FO : FixBug #PSCFV-9846 Bookmark title escape problem on special language 2013-07-31 10:24:14 +02:00
jeromenadaud
e1b7470845 [-] BO : FixBug Install currency on Localization Pack 2013-07-31 09:38:10 +02:00
jeromenadaud
0e3f2d6a82 [-] BO : FixBug Invalid offset when only one error in layout 2013-07-31 09:18:13 +02:00
gRoussac
f28a480bf9 // remove console.log 2013-07-30 20:36:38 +02:00
gRoussac
f606cb4efb Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-30 20:28:12 +02:00
gRoussac
6600112ab1 [-] BO : Fix onchange event on Adminmodules list execption 2013-07-30 20:28:06 +02:00
gRoussac
9ae8667783 [-] BO : Fix onchange event on adminmoudlue list execption 2013-07-30 20:26:45 +02:00
gRoussac
024800d4f9 // w3c multiple 2013-07-30 20:04:45 +02:00
gRoussac
edb8cce49f //norms 2013-07-30 19:57:23 +02:00
gRoussac
5677826b2f // wrong commit 2013-07-30 19:21:02 +02:00
gRoussac
0821194f94 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-30 19:19:32 +02:00
gRoussac
d6856a5c62 //norms 2013-07-30 19:18:29 +02:00
Damien Metzger
e0f1041070 // Performance improvements for the cart page 2013-07-30 19:16:05 +02:00
gRoussac
d68d844303 // norms 2013-07-30 19:02:05 +02:00
Gregory Roussac
800c63036e Merge pull request #605 from Captain-FLAM/patch-10
[*] BO : Proposition : IMPROVEMENT Admin Modules Positions
2013-07-30 09:48:11 -07:00
Captain-FLAM
be613fa008 fixup! [*] BO : Proposition : IMPROVEMENT Admin Modules Positions 2013-07-30 17:42:50 +01:00
Vincent Augagneur
d50b8c679f Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-30 18:02:46 +02:00
Vincent Augagneur
fcc1867a94 //merge 2013-07-30 18:02:30 +02:00
jeromenadaud
9bf6871e8d [-] FO : FixBug #PSCFV-9766 All products in products list for email confirmation with multi-shipping 2013-07-30 17:50:36 +02:00
Vincent Augagneur
cf694be5a1 //fixs carrier wizard 2013-07-30 17:46:44 +02:00
jeromenadaud
a93667a58b [-] FO : FixBug Wrong offset in more than one shipping address 2013-07-30 17:03:15 +02:00
Kevin Granger
062a4250cc //fixed unclosed div 2013-07-30 15:26:00 +02:00
jeromenadaud
6ddf2ee1ab [-] BO : FixBug allow_url_fopen on BackOffice home page 2013-07-30 15:19:54 +02:00
Damien Metzger
d9ce51f38c Merge pull request #613 from djfm/nl_installer
[*] LO : Added Dutch Installer
2013-07-30 06:14:40 -07:00
Damien Metzger
f59bd2f55f Merge pull request #612 from djfm/development
// Reviewed CarrierWizard strings, and corrected a few glitches with smarty translation functions and quotes
2013-07-30 06:13:10 -07:00
djfm
28c0ef2b7d // added a few translations to NL installer 2013-07-30 13:07:14 +00:00
djfm
cba79bdcd6 // corrected quote problems in the translation files 2013-07-30 09:47:02 +00:00
Vincent Augagneur
3d40814739 //added name in errors array in validateRules 2013-07-30 11:33:30 +02:00
djfm
9ba17d642a // CarrierWizard: English Strings reviewed and corrected 2013-07-30 09:30:41 +00:00
Vincent Augagneur
5929727be1 Merge pull request #601 from PrestaEdit/carrier_wizard2
[-] Carrier Wizard: fix
2013-07-30 02:22:45 -07:00
Vincent Augagneur
3814a8c735 [-] BO : fixed bug #PSCFV-9809 - carrier wizard tab access fix 2013-07-30 10:40:13 +02:00
gRoussac
4185026880 [-] CORE : Fix warning #PSCFV-9678 when sending message to customer 2013-07-30 10:37:07 +02:00
gRoussac
a36ac7784d // trailing space 2013-07-30 10:35:23 +02:00
Jérôme Nadaud
7d57255b70 [-] BO : FixBug #PSCFV-9959 file_get_contents error 2013-07-30 10:27:55 +02:00
Damien Metzger
192940946d // Fixed pscleaner method 2013-07-30 09:21:41 +02:00
Gregory Roussac
b004151695 Merge pull request #599 from PrestaShop/master
[*] CORE : Update gitignore
2013-07-29 10:19:55 -07:00
gRoussac
918ceb3ed5 // norms 2013-07-29 19:15:47 +02:00
Gregory Roussac
a23a576d47 Merge pull request #611 from 202-ecommerce/fix_translation
[-] BO : Fix while of translation, to find in folder if translation exists
2013-07-29 10:07:50 -07:00
Guillaume DELOINCE
8ddd592da1 [-] BO : Fix while of translation, to find in folder if translation exists 2013-07-29 19:00:57 +02:00
Gregory Roussac
53c195e9d9 Merge pull request #610 from indesign47/patch-8
[*] BO : shipping enlarge listbox carriers
2013-07-29 09:38:59 -07:00
Jérôme Nadaud
39a6d0a42d Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-29 18:37:18 +02:00
Vincent Augagneur
db98509443 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-29 18:37:01 +02:00
Jérôme Nadaud
0ecc2fb0a0 [-] BO : FixBug #PSCFV-9965 currency not active by default in Localization pack 2013-07-29 18:36:55 +02:00
Vincent Augagneur
0e6f1598f7 [-] BO : fixed some bug on carrier wizard - added tabindex on input - new default carrier img 2013-07-29 18:36:50 +02:00
Gregory Roussac
5f791dc839 Merge pull request #541 from indesign47/patch-4
[-] MO : products comments impossible if quantity > 0
2013-07-29 09:36:32 -07:00
indesign47
b8dc750547 [*] BO : shipping enlarge listbox carriers
enlarge listbox carriers to see all the name of the carrier
2013-07-29 18:25:05 +02:00
Jérôme Nadaud
72dc8b943f [-] FO : FixBug #PSCFV-9961 Remove wishlists icon 2013-07-29 17:58:31 +02:00
Jérôme Nadaud
aa9a6e66b8 [-] FO : FixBug #PSCFV-9951 Syntax error - Thanks to Oleacorner-Olivier B 2013-07-29 17:44:14 +02:00
Gregory Roussac
d356fe684a Merge pull request #608 from indesign47/patch-7
[*] BO : skip the first line by default
2013-07-29 08:23:32 -07:00
indesign47
d76059ff23 [*] BO : skip the first line by default
All sample csv file use a first line of information
2013-07-29 17:19:46 +02:00
Gregory Roussac
44b9909d4f Merge pull request #607 from indesign47/patch-6
[-] BO : doesn't match available_fields of AdminImportController
2013-07-29 08:12:26 -07:00
indesign47
65287d71c3 [-] BO : doesn't match available_fields of AdminImportController
- Correct wrong position of available_fields
- Add some of available_fields
2013-07-29 17:10:57 +02:00
Sarah Lorenzini
101d9283ae // update wizard 2013-07-29 15:12:50 +02:00
gRoussac
ab0189a726 [-] CORE : Fix bug #PSCFV-9572 when seizing in 0 in forms input fields for objects 2013-07-29 14:39:35 +02:00
PrestaEdit
c1b0d32d32 [-] Carrier Wizard: fix 2013-07-29 13:57:31 +02:00
Captain-FLAM
0de4642d09 [*] BO : Proposition : IMPROVEMENT Admin Modules Positions
You can see in action over there :
http://www.youtube.com/watch?v=e7KXuCU3RIM
2013-07-29 12:35:02 +01:00
Damien Metzger
ad9d3af3ad // Class index for Carrier Wizard 2013-07-29 11:54:08 +02:00
Gregory Roussac
155102da4b Merge pull request #603 from xBorderie/patch-1
// Removed "502" from the notice of license.
2013-07-29 02:49:48 -07:00
Xavier
4291b23e23 Update CartRule.php
Removed "502" from the notice of license.
2013-07-29 11:41:35 +02:00
Vincent Augagneur
e1b408f1f3 //added missing carrier wizard step img 2013-07-29 11:36:44 +02:00
Vincent Augagneur
210d24343c [-] BO : fixed input action when set fees for all zones in carrier wizard 2013-07-29 10:47:20 +02:00
gRoussac
1c37fdbc23 // foloww up 2e6e5a2604 2013-07-29 10:24:36 +02:00
Vincent Augagneur
60d67a7798 Merge pull request #600 from PrestaEdit/carrier_wizard
[-] Carrier Wizard: Remove fatal error "Call-time pass-by-reference"
2013-07-29 01:04:17 -07:00
Jérôme Nadaud
95ca638ec9 [-] BO : FixBug #PSCFV-9895 Mal function in products suppliers accordion 2013-07-29 09:33:50 +02:00
PrestaEdit
c089b1e69e [-] Carrier Wizard: Remove fatal error "Call-time pass-by-reference" 2013-07-27 15:23:48 +02:00
PrestaEdit
85553525e9 Merge pull request #2 from PrestaShop/development
// Merge PrestaShop
2013-07-27 04:39:15 -07:00
Rémi Gaillard
a786606c9a // small fix on carrierwizard 2013-07-26 20:27:25 +02:00
Rémi Gaillard
77f4eec64f // Fix group association on carrierwizard 2013-07-26 19:38:06 +02:00
Rémi Gaillard
159d0b3904 // improve exception 2013-07-26 19:15:37 +02:00
Rémi Gaillard
0d76af7f41 // debug deletion 2013-07-26 18:29:01 +02:00
Rémi Gaillard
c0cf92cbdf [+] BO: Add a wizard to create and edit your carriers 2013-07-26 18:27:21 +02:00
gRoussac
42c5335f27 [*] WS : order history add(POST) send customer email if sendemail=1 url parameter, thanks @gerdus 2013-07-26 17:55:53 +02:00
gRoussac
2704f52fe4 [-] Installer: update leftcolumn alias to enable live_edit on blockmyaccount 2013-07-26 17:20:52 +02:00
gRoussac
076b6d11a2 [-] CORE: Copy live_edit bool when register alias hook 2013-07-26 17:15:36 +02:00
Jérôme Nadaud
5d2e19fe3b [-] BO : FixBug Impossible to remove available date from product attribute 2013-07-26 12:14:00 +02:00
Jérôme Nadaud
23e0467993 [-] MO dateofdelivery : FixBug #PNM-1478 Now take care of product available date 2013-07-26 11:48:18 +02:00
Damien Metzger
e80364984a // Fixed manufacturers addresses export 2013-07-26 10:36:41 +02:00
Gregory Roussac
30c689df22 Merge pull request #584 from Captain-FLAM/patch-3
[-] FO : product with declinaisons without reductions, reduction price is showed anyway
2013-07-26 00:58:00 -07:00
Gregory Roussac
5015f88a46 Merge pull request #595 from codl/fix/too-many-packs
[-] WS: Sanity check before creating packs
2013-07-26 00:51:08 -07:00
Gregory Roussac
7d06d50d40 Merge pull request #597 from Captain-FLAM/patch-9
[-] CORE : Exception Text filled on Positions Page is not working (Hook Modules Exceptions)
2013-07-26 00:38:22 -07:00
Captain FLAM
a35011e9a5 Update Module.php 2013-07-25 19:16:46 +01:00
Gregory Roussac
c9e87d99da Merge pull request #551 from cinscaen/development
[-] BO: Fix Bug Progress Bar Upload Image Product
2013-07-25 09:23:07 -07:00
Gregory Roussac
ceee011d5c Merge pull request #555 from piotrmocko/patch-1
[- ] BO : Do not limit feature values on a  getList
2013-07-25 09:20:53 -07:00
gRoussac
d2acb9dedb [-] MO : Fix sort order for combinations, report of pull request https://github.com/PrestaShop/PrestaShop/pull/364 2013-07-25 18:15:06 +02:00
gRoussac
9848468f3e [-] MO : blockviewed Fix bug adding last product to list, thanks @kluevandrew 2013-07-25 17:58:22 +02:00
Damien Metzger
e6ecf0c177 // Added a more efficient index 2013-07-25 17:07:28 +02:00
Damien Metzger
eff81dfe05 // Moved a condition/function from SQL to PHP. 2013-07-25 17:07:28 +02:00
Gregory Roussac
6531572c15 Merge pull request #596 from ChristopheBoucaut/patch-3
[-) FO : addtextfield if magic_quotes_gpc is enabled, there is no need to escape the characters from $ _POST
2013-07-25 07:36:31 -07:00
ChristopheBoucaut
a9e233b209 Update Cart.php
If magic_quotes_gpc is enabled, there is no need to escape the characters from $ _POST as they already are.
2013-07-25 15:46:08 +02:00
Gregory Roussac
a54ac39632 Merge pull request #356 from arnolem/dev-wsSetProductTags
[*] WS : Allow to set the tags list of product
2013-07-25 06:17:15 -07:00
Gregory Roussac
3896453c7c Merge pull request #352 from sdevilcry/development
[-] CORE : Fix issue after a payment redirection error, delivery_option is not sent
2013-07-25 06:11:51 -07:00
gRoussac
bff2844adf [*] MO : Added customer and product object to hook sending email 2013-07-25 14:50:35 +02:00
Corentin Delcourt
53526304a5 [-] WS: Sanity check before creating packs
As it is before this commit, every product that is created from the
schema without removing the empty bundle item in the schema will become
a pack containing one broken item.

Sorry, this bug was introduced by my previous pull request.
2013-07-25 14:45:17 +02:00
Gregory Roussac
b4d3b631ad Merge pull request #594 from Shagshag/patch-6
[*] BO: twice class attribute in color input
2013-07-25 05:18:41 -07:00
gRoussac
ae7ee01028 [*] FO : Fix bug #PSCFV-9611, autocomplete to off on opc page and other pages 2013-07-25 12:26:57 +02:00
Gregory Roussac
56aa91a3fa Merge pull request #296 from samy-r/dev-address-update
[*] CORE : Add mobile phone in default adress layout update
2013-07-25 03:05:36 -07:00
gRoussac
2e7f3c296b [-] FO : Force browser language detection in Tools::setCookieLanguage 2013-07-25 11:44:45 +02:00
Shagshag
21cf113c44 twice class attribute in color input 2013-07-25 10:26:53 +02:00
Gregory Roussac
5ee247ad23 Merge pull request #592 from Captain-FLAM/patch-8
[*] MO : blocklayered : Supress unsuseful # at the end of URLs
2013-07-25 01:23:46 -07:00
Jérôme Nadaud
cfeaf0fa36 // norm 2013-07-25 08:51:22 +02:00
Jérôme Nadaud
7b980217b5 // norm 2013-07-25 08:49:40 +02:00
Jérôme Nadaud
541a4525b5 [-] FO : FixBug #PSCFV-9879 Email confirmation message not present 2013-07-24 19:24:22 +02:00
Gregory Roussac
ef22b9d5d4 Merge pull request #162 from bumbu/patch-2
[-] CORE : updateMultishopTable() where argument is not mandatory anymore
2013-07-24 10:07:56 -07:00
Jérôme Nadaud
ae7f47a275 [-] BO : FixBug #PSCFV-9042 Supply orders now accept 0 value to automatically load products 2013-07-24 18:52:47 +02:00
gRoussac
aaaa5cb086 [-] WS: Enable feature request #PSCFV-5581, thanks @codl for pull request #593 2013-07-24 18:22:04 +02:00
gRoussac
a406778e17 // norm 2013-07-24 17:32:58 +02:00
Jérôme Nadaud
08aa1f90c6 [-] BO : FixBug #PSCFV-9839 Update product warehouse on suply order - thanks @O'Donnell 2013-07-24 16:40:59 +02:00
Damien Metzger
71c0a483e1 // Small fix 2013-07-24 16:16:40 +02:00
Damien Metzger
056ced75b5 // Fixed double module call 2013-07-24 15:55:40 +02:00
Captain FLAM
daec59d13d Update blocklayered.js 2013-07-24 11:55:05 +01:00
Gregory Roussac
063fd9941c Merge pull request #189 from PrestaEdit/patch-12
[*] BO: use lang for input file
2013-07-24 03:10:00 -07:00
Gregory Roussac
cfa6e61acb Merge pull request #351 from PrestaEdit/patch-23
[*] WS: POST for php://input and XML ressource
2013-07-24 03:08:23 -07:00
Gregory Roussac
6ac3f1133a Merge pull request #591 from djfm/locpacks
[*] LO: Improved Argentina Localization Pack
2013-07-24 02:08:42 -07:00
djfm
2af3afcc13 [*] LO: Improved Argentina Localization Pack 2013-07-24 08:06:52 +00:00
Gregory Roussac
26247a18c3 Merge pull request #564 from sylwit/patch-1
[*] CORE : Translations shouldn't be cached if they contain dynamic vars (sprintf) in Translate.php
2013-07-23 10:22:54 -07:00
Gregory Roussac
1c71dc54dc Merge pull request #556 from piotrmocko/patch-2
[-] Bo : Payment currency restriction incorret type of input for radio
2013-07-23 10:21:20 -07:00
Gregory Roussac
c025b8cb2b Merge pull request #568 from urecheatu007/development
[-] CORE : setMedia() proper order for typewatch and cart-summary.js
2013-07-23 10:15:43 -07:00
Gregory Roussac
166a133080 Merge pull request #577 from PhpMadman/patch-2
[-] MO : If no homefeatured nb, get default 8 not 10
2013-07-23 10:14:24 -07:00
Gregory Roussac
f8bff15894 Merge pull request #581 from Captain-FLAM/patch-1
[-] Installer : Missing default value for id_employee in log table
2013-07-23 10:12:50 -07:00
Gregory Roussac
9b9e5a122a Merge pull request #586 from Captain-FLAM/patch-7
[-] BO : Hook.php : Missing _DB_PREFIX_, thanks @Captain-FLAM
2013-07-23 09:52:15 -07:00
Francois Gaillard
2e3f13db95 [-] Controller : AdminTranslationsController - Fixed bug with simple & double quotes 2013-07-23 18:47:35 +02:00
Jérôme Nadaud
71271ded7f Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-23 18:38:33 +02:00
Jérôme Nadaud
d241013692 [-] BO : FixBug #PSCFV-9894 undefined quantity_all_version variable in product.tpl 2013-07-23 18:36:51 +02:00
gRoussac
4aab4f88cd [-] BO : Fix SQL query when $join_category == false, pull request d5f75c63b6 thanks @Captain-FLAM 2013-07-23 18:25:32 +02:00
Gregory Roussac
abf6f0d626 Merge pull request #587 from ChristopheBoucaut/patch-2
[-] CORE : Search terms can now have dashes in Search.php
2013-07-23 09:18:16 -07:00
Gregory Roussac
a5e7f7fdac Merge pull request #588 from joseantgv/patch-1
[-] BO : Update AdminCustomerThreadsController.php
2013-07-23 09:16:39 -07:00
Damien Metzger
2e6e5a2604 // Removed useless check in the installer 2013-07-23 15:29:09 +02:00
Damien Metzger
c829ac5b7d // Fixed fix 2013-07-23 14:19:13 +02:00
Damien Metzger
87a4b75df4 [*] FO : updated Fancybox plug-in 2013-07-23 12:53:20 +02:00
Rémi Gaillard
6ed713e847 [-] Fix #PSCFV-9038 carrier warehouse association after carrier edition 2013-07-23 11:57:44 +02:00
gRoussac
dbe26e0a1d [-] BO : Could not find cover when image table corrupted 2013-07-23 11:47:16 +02:00
Damien Metzger
0ddf5d1025 // Fixed getMainShopDomain 2013-07-23 11:33:07 +02:00
gRoussac
a805941c1f // typo in EN string 2013-07-23 10:34:05 +02:00
Gregory Roussac
3b213a505c Merge pull request #583 from djfm/development
[*] TR : Small localization fixes & correction in templates so that translation regexes work OK
2013-07-23 00:59:31 -07:00
joseantgv
63b2f63058 Update AdminCustomerThreadsController.php
If language is not defined returns an array instead of a string which makes function Mail::Send to throw a warning.
2013-07-23 09:58:53 +02:00
Damien Metzger
209615d4f4 // Missing } 2013-07-23 09:52:41 +02:00
Damien Metzger
07e3354d0e // Code cleaning 2013-07-23 09:50:26 +02:00
Damien Metzger
9169995adc // Small fixes and code cleaning 2013-07-23 09:50:26 +02:00
Damien Metzger
91c5d184b6 // Small backend optimization 2013-07-23 09:50:26 +02:00
Damien Metzger
4b6642d76c // Small optimization 2013-07-23 09:50:25 +02:00
ChristopheBoucaut
3503670478 Update Search.php
$string = preg_replace('/[._-]+/', '', $string);

Ex :
Product's name : Saint-leon
Search : leon => 0 result

------------------------------------------------------

$string = preg_replace('/[._-]+/', ' ', $string);
Ex :
Product's name : Saint-leon
Search : leon => 1 result

-------------------------------------------------------

I think that thus the search is more relevant
2013-07-23 09:36:08 +02:00
Captain FLAM
928181bd1f Update Hook.php 2013-07-22 21:35:20 +01:00
Captain FLAM
2e860d6750 Update product.js
if product with declinaison without reduction : reduction price is showed !!

because of this comparison after (line ~400):

if (productPriceWithoutReductionDisplay > productPriceDisplay)

and :

var tmp = productPriceDisplay * group_reduction;

is unused
2013-07-22 18:58:59 +01:00
djfm
939f7d7770 //most of the translation of the NL installer is done 2013-07-22 17:09:26 +00:00
Jérôme Nadaud
3ecf929ff0 [-] BO : FixBug #PSCFV-9881 Remove updateCarriersList on zip code blur 2013-07-22 18:05:37 +02:00
Jérôme Nadaud
0f7d59ad26 [-] BO : FixBug #PSCFV-9878 Wrong login tab order 2013-07-22 17:07:57 +02:00
Jérôme Nadaud
b88ddf4483 [-] Classes : SwiftMailer - Fix deprecated preg_replace (PHP 5. 5.0) 2013-07-22 15:39:50 +02:00
Jérôme Nadaud
b87e934a66 [-] BO : FixBug #PSCFV-8060 Error getting last quantity and price in stock mouvement 2013-07-22 14:58:55 +02:00
Jérôme Nadaud
794475a9cc [-] BO : FixBug #PSCFV-8237 Javascript Error setting default supplier 2013-07-22 14:33:16 +02:00
Rémi Gaillard
d79365fe4d // small fix 2013-07-22 11:54:35 +02:00
Rémi Gaillard
32c02bba5f Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-22 11:39:44 +02:00
Rémi Gaillard
b8d272a459 // fix entities 2013-07-22 11:39:15 +02:00
Damien Metzger
f76fe635ff // Added queries table to the profiling mode, you can easily copy/paste it into excel or anything 2013-07-22 11:37:29 +02:00
djfm
3c59c5e779 //replaced all js='1' with js=1 so that the translation regexes don't fail 2013-07-22 09:34:18 +00:00
Jérôme Nadaud
ca9f2c9459 [-] BO : FixBug #PSCFV-9138 Error duplicate product group reduction 2013-07-22 11:25:13 +02:00
Captain FLAM
287cf0c955 Update 1.5.5.0.sql
Missing DEFAULT
2013-07-22 09:55:06 +01:00
Damien Metzger
3556e75ce3 // Moved useless code into the block where it is useful 2013-07-22 10:49:41 +02:00
djfm
838a4e8bc9 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-22 08:25:26 +00:00
gRoussac
3483706951 [-] FO : Prevent unsassigned category id, thans @PrestaCaptainFLAM 2013-07-20 19:07:10 +02:00
Jérôme Nadaud
1581a371c5 [-] BO : FixBug #PSCFV-9251 Meta Tag delete previous 2013-07-19 18:41:46 +02:00
Fabio Chelly
aa276aeee6 Merge remote-tracking branch 'origin/development' into development 2013-07-19 17:51:00 +02:00
Fabio Chelly
5825dda836 [-] MO mailalerts : infinite coverage (-1) is taken into account when sending coverage e-mails
#PNM-1563
#PNM-1597
2013-07-19 17:36:51 +02:00
djfm
2f6a53f971 [+] TR: Created file structure for Dutch installer 2013-07-19 15:34:10 +00:00
Damien Metzger
b1f380c120 // Fixed statsforecast category distribution 2013-07-19 16:59:54 +02:00
Jérôme Nadaud
19fb1da4f2 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-19 16:30:21 +02:00
Jérôme Nadaud
abf874d576 [-] BO : FixBug #PSCFV-9049 Bad actionOrderSlipAdd hook description 2013-07-19 16:30:04 +02:00
Damien Metzger
84d9caca81 // Blind fix 2013-07-19 16:29:17 +02:00
Jérôme Nadaud
5646e682bc [-] BO : FIxBug Correct image language in product 2013-07-19 15:21:06 +02:00
Damien Metzger
3389cf8acb [-] FO : fixed pagination for p = 0 #PSCFV-9746 2013-07-19 14:08:24 +02:00
Damien Metzger
8d034a7ebf // up 2013-07-19 13:33:56 +02:00
Fabio Chelly
95122e8849 Merge remote-tracking branch 'origin/development' into development 2013-07-19 12:04:39 +02:00
Damien Metzger
8c47ca3edf [-] BO : fixed sort by currency exchange rate #PSCFV-9840 2013-07-19 11:40:52 +02:00
Damien Metzger
989dafce21 [*] FO : a few more SQL improvements 2013-07-19 11:29:18 +02:00
Fabio Chelly
7570c9eb87 [-] MO loyalty : minimum amount is now taken into account when creating discount vouchers
#PNM-1561
2013-07-19 11:15:14 +02:00
Damien Metzger
bd4ece095b [*] FO : lots of performance improvements (removed or merged useless SQL queries) 2013-07-19 10:58:51 +02:00
PhpMadman
eb6b233e31 [-] BO : If no nb, get default 8, not 10. 2013-07-19 10:33:28 +02:00
Damien Metzger
219ec6e8be [-] FO : Removed useless live edit query #PSCFV-9845 2013-07-19 09:50:30 +02:00
Damien Metzger
78ddec3ac7 [-] BO : translation copy is now easier #PSCFV-8886 2013-07-18 18:51:37 +02:00
gRoussac
a6a700c9d8 // parse error 2013-07-18 18:40:19 +02:00
gRoussac
236aaa9354 [*] MAILS : add {order_name} & {attached_file} , manaul merge from e9f9631744 2013-07-18 18:38:12 +02:00
Jérôme Nadaud
54fe5dfe96 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-18 18:34:18 +02:00
Rémi Gaillard
ac02e5191a // ups 2013-07-18 18:34:10 +02:00
Jérôme Nadaud
c90ba4c406 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-18 18:33:51 +02:00
Jérôme Nadaud
066b791cf7 [-] FO : FixBug of total products from supliers and manufacturer 2013-07-18 18:33:35 +02:00
Rémi Gaillard
354622857f Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-18 18:31:35 +02:00
Rémi Gaillard
958d92c9fa [*] BO: Add an option to allow iframes on descriptions 2013-07-18 18:31:31 +02:00
Damien Metzger
c70fe92dac // Validate::isGenericName now allow "#" #PSCFV-6530 2013-07-18 18:22:50 +02:00
gRoussac
a71a5d7c18 [-] MO : Fix bug discount display in mail, manual merge from 1d5df338c4 2013-07-18 18:18:57 +02:00
gRoussac
e3d9dd89e9 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-18 18:18:12 +02:00
Jérôme Nadaud
caf321e691 [-] FO : FixBug #PSCFV-8018 All products was counted in manufacturer lsit even if products was set as hidden 2013-07-18 18:16:57 +02:00
Jérôme Nadaud
d879fb15a9 [-] FO : FixBug #PSCFV-8018 All products was counted in manufacturer list even hidden products 2013-07-18 18:10:29 +02:00
Jérôme Nadaud
dd78e97b4a [-] FO : FixBug #PSCFV-7723 Bad manufacturers list pagination 2013-07-18 17:09:44 +02:00
Jérôme Nadaud
3693349643 [-] BO : FixBug #PSCFV-5316 Translation problem in delete button link 2013-07-18 15:49:53 +02:00
Jérôme Nadaud
2c6978e97c [-] BO : FixBug #PSCFV-6140 Pagination link error 2013-07-18 14:55:28 +02:00
Damien Metzger
6ae0717e32 // PS Cleaner now clean the img/tmp dir 2013-07-18 14:48:47 +02:00
gRoussac
a6b2299ed1 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-18 14:08:36 +02:00
Jérôme Nadaud
a6da3e94f0 [-] BO : FixBug #PSCFV-9723 Exporting quantity in instant stock was not returning all rows 2013-07-18 14:02:22 +02:00
Damien Metzger
6293631ac4 [-] FO : fixed group query for cart rules #PSCFV-8992 2013-07-18 13:47:43 +02:00
Jérôme Nadaud
69066361a6 [-] BO : FixBug #PSCFV-8234 Products tags not correctly indexed in search 2013-07-18 12:15:42 +02:00
gRoussac
d99a1eba24 [-] BO : Bad return value for AdminCountries::processStatus() 2013-07-18 12:12:05 +02:00
Damien Metzger
108bd92c3b [-] FO : Fixed partial use of cart rules which does not offer free shipping #PSCFV-9216 2013-07-18 12:09:48 +02:00
Damien Metzger
c1a4dd6b66 // Added readme in the override directory 2013-07-18 11:31:08 +02:00
Damien Metzger
3be36f9897 [*] MO : added configuration cleaning to pscleaner 2013-07-18 09:36:01 +02:00
Jérôme Nadaud
2e3ec0f038 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-18 08:52:56 +02:00
Jérôme Nadaud
40389822c3 [-] BO : FixBug Directory Separator on URL 2013-07-18 08:52:39 +02:00
gRoussac
5939f65fac //norms 2013-07-17 19:05:01 +02:00
Jérôme Nadaud
eecfdae0b6 [-] BO : FixBug #PSCFV-8217 Shop logo image not refresh after change 2013-07-17 18:23:59 +02:00
Gregory Roussac
1537f0e9eb Merge pull request #566 from PrestaEdit/patch-45
[*] FO: display Error500 if no database access
2013-07-17 09:02:28 -07:00
Gregory Roussac
312e066751 Merge pull request #550 from PrestaEdit/patch-44
[-] Class: PaymentModule / Be sure to have the right "TaxCalculationMeth...
2013-07-17 09:01:32 -07:00
Gregory Roussac
cf04c18ce6 Merge pull request #537 from PrestaEdit/patch-43
[-] FO: OrderHistory - Unclosed tag
2013-07-17 08:53:31 -07:00
Gregory Roussac
8d5027a89b Merge pull request #530 from PrestaEdit/patch-42
[-] BO: remove old icon into New Version block
2013-07-17 08:44:49 -07:00
Jérôme Nadaud
5c6640c258 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-17 17:34:44 +02:00
Jérôme Nadaud
458838e598 [-] BO : FixBug #PSCFV-9613 Fix product tax to be shop dependent 2013-07-17 17:33:53 +02:00
Gregory Roussac
ffb62426d8 Merge pull request #516 from PrestaEdit/patch-41
[*] BO: more than one image in HelperForm
2013-07-17 07:44:26 -07:00
gRoussac
8d5a632c92 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-17 16:34:50 +02:00
gRoussac
014758d1d8 Merge branch 'PrestaEdit-translate' into development 2013-07-17 16:34:26 +02:00
gRoussac
3f7bf5c6b0 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-17 16:34:03 +02:00
gRoussac
c9d2cf8ed2 Merge branch 'translate' of https://github.com/PrestaEdit/PrestaShop into PrestaEdit-translate
Conflicts:
	admin-dev/header.inc.php
2013-07-17 16:31:49 +02:00
Jérôme Nadaud
6884d7c5de [-] BO : FixBug #PSCFV-8287 Breadcrumbs label was wrong 2013-07-17 16:19:15 +02:00
gRoussac
24b2e1ec8c Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-17 15:36:03 +02:00
gRoussac
d55f31d3b5 Merge branch 'tools-fileAttachment' of https://github.com/PrestaEdit/PrestaShop into PrestaEdit-tools-fileAttachment
Conflicts:
	classes/Tools.php
	controllers/front/ContactController.php
2013-07-17 15:35:18 +02:00
Jérôme Nadaud
2d1ec5f642 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-17 15:14:05 +02:00
Jérôme Nadaud
421c199e1f [-] 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
2013-07-17 15:13:34 +02:00
Damien Metzger
1b9892b944 // removed deprecated message 2013-07-17 13:42:45 +02:00
François Gaillard
899dc30097 [-] Class : AdminController - Object id fixed 2013-07-17 11:33:33 +02:00
Jérôme Nadaud
1199ad8cf2 [-] BO : FixBug #PSCFV-6365 Missing message confirmation for Images modification in Preferences > Images 2013-07-17 10:51:34 +02:00
gRoussac
ea89c2235d [-] BO : Fix bug #PSCFV-9722, do not propose adding root categories in categories when there is only one shop 2013-07-16 19:01:05 +02:00
Jérôme Nadaud
d66f407fcb [-] BO : Use only 0% reduction from category in group 2013-07-16 18:28:11 +02:00
Jérôme Nadaud
ae5b6b79ee [*] BO : #PSCFV-8498 You can now use 0% in groups category rules in order to not apply discount on this category 2013-07-16 17:42:38 +02:00
Gregory Roussac
e7eae03508 Merge pull request #575 from dreammeup/development
[-] BO : Correcting errors in order graph at admin home
2013-07-16 07:17:03 -07:00
dreammeup
82c7e3eeff 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.
2013-07-16 15:34:52 +02:00
djfm
145df5a26e Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-16 13:08:36 +00:00
Rémi Gaillard
8d39f32506 [-] BO: Fix tax rule edition - unique tax rule can't be edited 2013-07-16 11:52:05 +02:00
gRoussac
d2ff50ddb7 [*] CORE : Fix bug #PSCFV-9811 doc on display404Error 2013-07-16 10:50:27 +02:00
Damien Metzger
3d283000a0 // Fixed misplaced comma 2013-07-16 10:27:52 +02:00
Jérôme Nadaud
672f2d9dd1 [-] BO : Fix bug #PSCFV-9395 Missing vertical separation between flags 2013-07-16 10:18:54 +02:00
Jérôme Nadaud
97b16d2726 [-] BO : Fix Bug #PSCFV-9550 Bad URL redirection 2013-07-16 09:59:47 +02:00
gRoussac
e48b2a411e [-] INSTALLER : Errors in upgrader 2013-07-15 22:01:41 +02:00
Fabio Chelly
a6d0ef744e Merge remote-tracking branch 'origin/development' into development 2013-07-15 19:37:19 +02:00
Fabio Chelly
b67ffb1a50 [-] MO loyalty : categories are now taken into account when creating discount vouchers
#PNM-1492
#PNM-1191
#PNM-1223
2013-07-15 19:36:32 +02:00
Gregory Roussac
272f2ec8f7 Merge pull request #573 from soware/patch-2
[*] BO : Update AdminStockManagementController.php
2013-07-15 09:49:17 -07:00
Damien Metzger
d9c2ec37d4 // Code cleaning 2013-07-15 18:13:07 +02:00
Damien Metzger
a3039024e7 // Code cleaning 2013-07-15 18:07:53 +02:00
soware
c253a8edf4 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.
2013-07-15 12:45:00 -03:00
gRoussac
7a27b11309 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-15 17:31:17 +02:00
gRoussac
f9c5bf0bf2 [-] Fix bug #PSCFV-9633 again could not see delete href in block cart 2013-07-15 17:29:08 +02:00
Gregory Roussac
f6ef6f5d0e Merge pull request #572 from PrestaEdit/patch-47
[-] Class : Media / Correct jquery_ui_dependencies fileName
2013-07-15 07:41:07 -07:00
gRoussac
01bad90b29 // Welcome 2013 2013-07-15 16:36:54 +02:00
PrestaEdit
4b8a756add [-] Class: Media / Correct jquery_ui_dependencies fileName
Even if not used...
2013-07-15 16:34:51 +02:00
gRoussac
ca4a73ddf4 // avoid copy paste mistake with trailing space 2013-07-15 15:34:34 +02:00
gRoussac
1a056d5e33 [-] BO : Fix bug #PSCFV-9310 bad type for input in helper thankx @Piotr Moćko 2013-07-15 14:47:38 +02:00
gRoussac
f1dcf02caf //fix warnings #PSCFV-9786 2013-07-15 14:25:58 +02:00
gRoussac
e30e15d76d [-] INSTALER: Fix bug #PSCFV-9762 marketing tab disapear after upgrade 2013-07-15 12:29:51 +02:00
Rémi Gaillard
ee1187d821 [-] BO: Delete specific price after combination deletion && fix SpecificPrice::getByProductId() sql query 2013-07-15 11:00:35 +02:00
Damien Metzger
db7f0da746 // Improved display in pscleaner 2013-07-15 10:48:48 +02:00
Damien Metzger
cf7f72fc30 // Fixed AdminMarketing position in upgrade 2013-07-15 10:11:40 +02:00
gRoussac
6ea4a2c553 [-] FO : Fix bug #PSCFV-9662 udpate payments means after delete thanks @maofree 2013-07-15 10:08:16 +02:00
Cosmin Hutanu
324dff0595 ParentOrderController->setMedia() proper order for typewatch and cart-summary
In the original class, typewatch is inserted after cart-summary, but it is used for the quantity input in cart-summary.js, so we need to have typewatch first.
2013-07-15 00:56:56 +03:00
PrestaEdit
795976cadb [*] 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.
2013-07-14 14:59:25 +02:00
Rémi Gaillard
e34289b0b7 // fix product warehouses 2013-07-12 18:53:22 +02:00
Gregory Roussac
c89281166b Merge pull request #467 from PrestaEdit/patch-40
[-] BO : Controller: AdminTranslationsController / Back translations
2013-07-12 09:23:29 -07:00
Gregory Roussac
5083cd6b5e Merge pull request #466 from PrestaEdit/patch-39
[*] BO: hook displayAdminForm / add param fieldset
2013-07-12 08:56:42 -07:00
Rémi Gaillard
e23854d143 // Add currency ID on default modules cache id 2013-07-12 17:49:38 +02:00
Gregory Roussac
5b6c6a3ce9 Merge pull request #561 from BigZ/patch-5
[-] PDF : Get correct prefix for invoices
2013-07-12 08:44:24 -07:00
Gregory Roussac
39a23e1494 Merge pull request #560 from BigZ/patch-4
[-] PDF : Develivery slip should use prefix
2013-07-12 08:42:16 -07:00
Gregory Roussac
b25b88cf33 Merge pull request #559 from BigZ/patch-3
[-] PDF : Invoice prefix wasn't used in filename
2013-07-12 08:41:37 -07:00
Gregory Roussac
0453698f50 Merge pull request #557 from BigZ/patch-1
[-] BO : Update documents listing to display proper prefix
2013-07-12 08:37:21 -07:00
gRoussac
9c44faf295 [-] FO : Fix bug #PSCFV-9754 do not use back url on cart summary link in steps 2013-07-12 16:59:11 +02:00
Damien Metzger
4e0723b3cc [-] BO : fixed charts and grids in multishop #PSCFV-8978 2013-07-12 16:29:31 +02:00
Gregory Roussac
105b1422a3 Merge pull request #562 from axometeam/patch-14
[*] BO : Do not increment stock if statut change fom Error to Canceled
2013-07-12 07:22:50 -07:00
Damien Metzger
38b32f7e1a [-] MO : fixed disappearing form in sekeyword #PSCFV-9743 2013-07-12 15:56:54 +02:00
Damien Metzger
f82e748fc8 [*] MO : you can now exclude IP addresses from the online visitors module #PSCFV-9056 2013-07-12 15:38:36 +02:00
Sylvain WITMEYER
9fec968488 Update Translate.php
Translations shouldn't be cached if they contain dynamic vars (sprintf)

On productcomments, 
<li>{l s='%1$d out of %2$d people found this review useful.' sprintf=[$comment.total_useful, $comment.total_advice] mod='productcomments'}</li>
was always printing the same sentence
2013-07-12 15:17:09 +02:00
gRoussac
8588978e03 [*] FO : getCatImageLink doesn't work without type thanks @axometeam 2013-07-12 15:03:52 +02:00
gRoussac
24d124f190 [*] MODULE : Multi-shop compatibility in newsletter module tanks @axometeam 2013-07-12 14:17:49 +02:00
gRoussac
b880bc3a18 [*] PDF : Free shipping in invoice PDF display X2 thanks @axometeam 2013-07-12 12:09:34 +02:00
gRoussac
6f9e415ca7 // missing image 2013-07-12 12:03:32 +02:00
djfm
e4173fbc98 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-12 09:50:04 +00:00
Axome
1c960da57a [*] BO : Not increment stock if statut change fom Error to Canceled
Not increment stock if statut change fom Error => Canceled or Canceled => Error (stock should stay the same).
Add a code simplification too
2013-07-12 11:22:42 +02:00
Rémi Gaillard
0928efb112 // small fix 2013-07-12 11:17:30 +02:00
Gregory Roussac
c3b7e1dad9 Merge pull request #519 from axometeam/patch-5
[*] BO : Correct Request Sql Manager validate options
2013-07-12 02:08:45 -07:00
Gregory Roussac
44debd682f Merge pull request #517 from axometeam/patch-4
[*] BO : AdminControllers Keep "active" filter on pagination
2013-07-12 02:07:51 -07:00
Rémi Gaillard
4b492046c0 // add another logs information 2013-07-12 10:55:37 +02:00
Gregory Roussac
8fcca7999d Merge pull request #502 from axometeam/patch-2
[-] BO : Prevent false error for product duplication
2013-07-12 01:29:39 -07:00
Damien Metzger
994d43d3e4 // Oops 2013-07-12 09:40:14 +02:00
BigZ
f1049c021a get correct prefix for invoices
One must use the shop id when getting invoices prefix
2013-07-12 03:43:03 +02:00
BigZ
25b5d2857b develivery slip should use prefix
as develivery_prefix uses lang and shop id, those variables has to be passed as parameters
2013-07-12 03:03:21 +02:00
BigZ
e28a1e793a Invoice prefix wasn't used in filename
As invoice_prefix uses lang and shop ids they have to be passed has parameters
2013-07-12 03:01:33 +02:00
BigZ
bd432641a0 update documents listing to display proper prefix
In order details, generic prefix was displayed in right column instead of shop specific prefix
2013-07-12 02:32:52 +02:00
gRoussac
5d8d7c0383 [-] MO : Followup : don't send emails for empty carts thanks @axometeam 2013-07-11 18:57:37 +02:00
Piotr Moćko
68d135b4cf 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
2013-07-11 18:56:50 +02:00
Piotr Moćko
291cec36ab 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.
2013-07-11 18:49:44 +02:00
Damien Metzger
9af2d3946f // Fixed potential error when deleting a module 2013-07-11 18:46:06 +02:00
gRoussac
a5ee2c2f4f [-] Classes : fixed cachefs and memcache classes #PSCFV-5225 thanks @prestalab 2013-07-11 18:27:54 +02:00
Gregory Roussac
293d1afbc7 Merge pull request #484 from axome/module_followup_guests
[-] MO : Followup : Don't send followup vouchers to guest accounts
2013-07-11 09:13:39 -07:00
Gregory Roussac
27a72f9b2c Merge pull request #482 from axome/module_followup_cron
[-] MO : Followup : Don't execute crontasks if the module is disabled
2013-07-11 09:08:51 -07:00
Damien Metzger
184515a27c [-] MO : fixed bad redirection in trackingfront #PSCFV-8378 2013-07-11 18:03:39 +02:00
Rémi Gaillard
d8a444335f Merge pull request #524 from ChristopheBoucaut/development
Update OrderDetailController.php
2013-07-11 08:26:13 -07:00
Rémi Gaillard
d0cf8fce18 // small fix 2013-07-11 17:04:29 +02:00
Rémi Gaillard
20b5449231 [*] Core: that is now easier to get links for another shop 2013-07-11 16:40:40 +02:00
Rémi Gaillard
17ee071bdf Merge pull request #540 from axometeam/patch-7
[*] BO : Correct the getList() request for quantity and id_product
2013-07-11 06:40:17 -07:00
Rémi Gaillard
004e833b24 [+] BO: Addition, deletion and edition are now logged 2013-07-11 14:50:23 +02:00
Damien Metzger
d772d97bfa [-] BO : you can now have different mail topic for one mail template #PSCFV-9617 2013-07-11 14:27:40 +02:00
Francois Gaillard
d0e4e956c4 [-] Classes : Mail - check instance of link in the context 2013-07-11 14:01:24 +02:00
Damien Metzger
7cc5196fec [-] FO : fixed useless error when the product id in the URL is not an int #PSCFV-9726 2013-07-11 11:38:57 +02:00
Rémi Gaillard
c0cdd0a0e1 Merge pull request #547 from PiotrKaczor/patch-1
[*] MO : pscleaner reset employees notyfications
2013-07-11 00:46:30 -07:00
Rémi Gaillard
2578ffb6e1 Merge pull request #552 from codl/development
[-] WS: do not escape shop name overzealously
2013-07-11 00:44:52 -07:00
gRoussac
105ae7e59f [*] FO : Retrieve invoice address in OPC + guest checkout, thanks @Piotr Moćko 2013-07-10 18:16:09 +02:00
gRoussac
9f2dad0c6c Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-10 17:44:48 +02:00
gRoussac
8b16bd44aa [*] FO : Fix bug #PSCFV-9440 add another address in guest checkout in OPC 2013-07-10 17:43:36 +02:00
Vincent Augagneur
53ec2aab7e //remove unused configuration 2013-07-10 17:33:02 +02:00
Corentin Delcourt
02faf9d18e [-] WS: do not escape shop name overzealously 2013-07-10 10:21:33 +02:00
gRoussac
e8b8fa0527 [-] CORE: No category in url preview on BO product page 2013-07-09 18:06:02 +02:00
Agence CINS
32a83e20c4 [+] BO: Fix Bug Progress Bar Upload Image Product
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.
2013-07-09 17:09:19 +02:00
gRoussac
5e0893979b [-] FO : Fix bug #PSCFV-9021 : bad category id for breadcrumb on product when url rewrite is on 2013-07-09 16:06:21 +02:00
gRoussac
4f5661572e [-] PDF : Fix columns error 2013-07-09 11:58:56 +02:00
Damien Metzger
bad15211a8 [-] BO : added checks on product attributes properties #PSCFV-9703 2013-07-09 11:30:59 +02:00
Rémi Gaillard
7b62144220 [-] Core: ObjectModel::toggleStatus should change only active field on multishop with global context #PSCFV-9707 2013-07-09 11:19:58 +02:00
Damien Metzger
bfa82c9648 [-] FO : you cannot access the front office with a disabled language anymore #PSCFV-9714 2013-07-09 10:59:25 +02:00
Damien Metzger
00425a4c1a [-] FO : fixed bad condition in the dispatcher rules 2013-07-09 10:52:50 +02:00
Damien Metzger
c0c6c10bba [-] IN : fixed local install without connection #PSCFV-9286 #PSCFV-9709 2013-07-09 10:21:22 +02:00
Rémi Gaillard
18b247be94 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-08 16:07:43 +02:00
Rémi Gaillard
f413d9e6e6 [-] Core: Fix #PSCFV-9652 too much payments for multishipping orders 2013-07-08 16:07:20 +02:00
Damien Metzger
1bdc07be20 [*] FO : removed code specific to multishipping from the no-multishipping process 2013-07-08 11:21:50 +02:00
Rémi Gaillard
4b88e8cc06 // John Doe is really a big scammer ! #PSCFV-9434 2013-07-08 11:17:12 +02:00
Gregory Roussac
1a6518689c Merge pull request #415 from ccauw/patch-11
[-] BO : Fix bug #PSCFV-8987 in BO translations when Windows OS
2013-07-08 01:34:48 -07:00
PrestaEdit
3166573aa9 [-] Class: PaymentModule / Be sure to have the right "TaxCalculationMethod" 2013-07-06 13:50:38 +02:00
gRoussac
19c9ae0a5c [-] FO : Fix bug #PSCFV-9653 could not return a custom product 2013-07-05 18:15:27 +02:00
gRoussac
cf849077ed // small css fix on history 2013-07-05 17:43:10 +02:00
Fabio Chelly
391c7301da Merge remote-tracking branch 'origin/development' into development 2013-07-05 17:18:50 +02:00
Fabio Chelly
a70d3145cd [-] MO Blockwishlist : images are displayed in wishlist page loaded through a permalink. Add to cart is restored and quantity is correctly calculated for each product with or without combinations
#PNM-573
#PNM-663
#PNM-1268
#PNM-1302
#PNM-1303
#PNM-1313
#PNM-1512
#PNM-1541
2013-07-05 17:18:28 +02:00
gRoussac
9f0867b700 [-] FO : could not see old_price_display when specific price on one combination 2013-07-05 14:42:39 +02:00
Damien Metzger
62ff976d69 // Removed redundant function calls 2013-07-05 14:25:22 +02:00
gRoussac
91cd196cf6 // remove console.log sorry bad commit 2013-07-05 12:29:29 +02:00
gRoussac
128ceffcc0 [-] FO : Bad specific price for a combination // sorry 2013-07-05 12:28:10 +02:00
gRoussac
268f1fd030 [-] FO : Bad specific price for a combination 2013-07-05 12:11:02 +02:00
Fabio Chelly
2489778b3c [-] MO Blocknewsletter : deletes e-mail from newsletter table only if newsletter checkbox has been checked on subscription page
#PNM-1419
2013-07-05 11:53:04 +02:00
Piotr Kaczor
54b882e936 [*] MO : pscleaner reset employees notyfications
pscleaner afetr truncating orders, messages and customers reset also employees notyfications
2013-07-05 08:05:51 +02:00
gRoussac
8a7edf3668 [-] FO : Fix bug #PSCFV-9355 dleete button missing for custo in blockcart 2013-07-04 17:42:35 +02:00
gRoussac
58091a3b0e Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-04 17:25:41 +02:00
gRoussac
df7b5c9861 [-] FO : Fix bug #PSCFV-9669, update total price on order-payment 2013-07-04 17:25:00 +02:00
Rémi Gaillard
12e7e3a44a [-] BO: display vat number field should not depends of the vatnumber module #PSCFV-9672 2013-07-04 17:00:27 +02:00
gRoussac
c335115f68 // remove console.log 2013-07-04 16:48:56 +02:00
gRoussac
c360e841b3 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-04 16:48:14 +02:00
gRoussac
0bddd17889 // remove console.log 2013-07-04 16:43:17 +02:00
gRoussac
fd14268da3 // remove .gitattributes 2013-07-04 15:23:39 +02:00
Damien Metzger
47d343df90 // Fixed module positions in tabs 2013-07-04 09:33:43 +02:00
Damien Metzger
ae03669541 // Added the possibility to sort the modules in the tabs 2013-07-03 17:50:24 +02:00
Damien Metzger
ec981b7f86 [*] WS : improved performances 2013-07-03 17:03:33 +02:00
Damien Metzger
d2440df8ca [*] FO : added smarty cache on productscategory 2013-07-03 15:49:32 +02:00
Damien Metzger
f78f3dc3a8 [*] FO : added smarty cache on crossselling module 2013-07-03 15:30:31 +02:00
gRoussac
36e3956267 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-03 15:06:05 +02:00
Damien Metzger
afda9cdd94 // Small fix 2013-07-03 15:05:22 +02:00
gRoussac
ae0299a6eb [-] FO :Fix bug #PSCFV-9650 could not see delete href in block cart 2013-07-03 15:04:11 +02:00
Sébastien
16e90488c4 [-] MO : Bug fix - PS Cleaner, check if module favoriteproducts is installed.
Fix Bug when favoriteproducts is not install.
2013-07-03 14:55:32 +02:00
indesign47
1208e45958 [-] 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!
2013-07-03 14:09:44 +02:00
Francois Gaillard
8d3f330b2d [-] IN : Fixed bug with database creation 2013-07-03 12:19:34 +02:00
Damien Metzger
5789e6eb51 [*] IN : only display the button to create the database if you can actually create the database 2013-07-03 11:28:55 +02:00
Axome
fe660c097c [*] BO : Correct the getList() request for quantity and id_product
Quantity and Id_product should be fixe as Int, else the Mysql request do something like : quantity LIKE "%0%"

When an admin key-in quantity as 0, he want product with quantity as 0, not as 0 / 10 /20 / 30... ect (The same for id_product)
2013-07-03 11:18:04 +02:00
Damien Metzger
bfa2f33c65 [*] IN : the installer can now attempt to create the database for you 2013-07-03 11:04:34 +02:00
Damien Metzger
92959311d9 [*] Core : Smarty updated from 3.1.13 to 3.1.14 (cache issues fixed) 2013-07-02 18:45:07 +02:00
Damien Metzger
c60c3da6a1 [*] WS : improved web service performances 2013-07-02 17:46:11 +02:00
PrestaEdit
86bdcd99e9 [-] FO: OrderHistory - Unclosed tag 2013-07-02 17:08:49 +02:00
Rémi Gaillard
6b71ec8b09 [-] BO: product supplier price should not be converted on product page #PSCFV-9420 2013-07-02 15:45:12 +02:00
Damien Metzger
854c16997c [*] FO : improved entity links retrieval (no need to instanciate an object when there is no need... to instanciate un object) 2013-07-02 15:08:56 +02:00
gRoussac
84c88dab65 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-02 14:55:28 +02:00
Francois Gaillard
b8bfdcd3f5 // .gitattributes files added 2013-07-02 14:53:58 +02:00
gRoussac
75942074d2 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development 2013-07-02 14:53:18 +02:00
gRoussac
9dfe65cb17 [-] BO : Fix bug #PSCFV-8666 COD module association no more deleted when restrition on other currency 2013-07-02 14:51:25 +02:00
Damien Metzger
25dc4e25ac // Code cleaning 2013-07-02 11:48:48 +02:00
Damien Metzger
f204f80c99 // Improved profiling tool 2013-07-02 11:08:24 +02:00
Damien Metzger
d05968823e // Try to fix warning 2013-07-02 10:46:46 +02:00
Vincent Augagneur
cab425e819 //remove useless css 2013-07-02 08:41:51 +02:00
Vincent Augagneur
0ff23eee9f //miss to delete some files 2013-07-02 08:02:05 +02:00
Gregory Roussac
0d7af59657 Update .gitignore 2013-07-01 10:58:54 +02:00
Gregory Roussac
7c2323f1cc Update .gitignore 2013-07-01 10:56:31 +02:00
PrestaEdit
679ee351df [-] BO: remove old icon into New Version block 2013-06-29 16:28:03 +02:00
ldecoker
a617bec39b Update shopping-cart.tpl
To access template "shopping-cart-product-line.tpl", it should use the $tpl_dir variable.
2013-06-28 16:46:12 +02:00
ChristopheBoucaut
0de8c2dbc6 Update OrderDetailController.php
Fixed link between thread and an order's product
2013-06-27 15:49:40 +02:00
djfm
f2e08c9c94 Merge branch 'development' of https://github.com/djfm/PrestaShop into development 2013-06-25 08:41:35 +00:00
djfm
9b16761a68 [*] LO : corrected Israel standard tax rate 2013-06-25 08:37:54 +00:00
Axome
7f7cd3bdaa [*] BO : Correct Request Sql Manager validate options
Correct Request Sql Manager validate options :
- No size limit for the request
- cutJoin() doesn't work for multiple Join (exemple : LEFT JOIN `XXX ON XXX AND XXX) => Then you can't save the request, even if it work
2013-06-25 11:01:01 +03:00
Axome
f4fc1d3cab [*] BO : AdminControllers : Keep active filter on pagination 2013-06-24 10:57:05 +02:00
PrestaEdit
f4a5dd1409 [*] BO: more than one image in HelperForm 2013-06-21 23:02:51 +03:00
fram
dc133e3e41 [*] LO : Fixed units in Belgium localization pack 2013-06-20 18:33:27 +02:00
Axome
6e383a2d38 Prevent false error for product duplication 2013-06-17 10:16:13 +02:00
cam.lafit
663ec76bb9 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.
2013-06-10 11:00:49 +02:00
PhpMadman
77864b88ae [-] FO : In stock sort is now removed when Stock managment is disabled on default theme.
Not to be confused for my pull #465, which was for default mobile theme.
This is for the default regular theme.
2013-06-07 10:41:02 +02:00
Nicolas Sorosac
e65f68107f [-] MO : Followup : Don't send followup vouchers to guest accounts 2013-06-07 08:42:24 +02:00
Nicolas Sorosac
12ab790579 [-] MO : Followup : Don't execute crontasks if the module is disabled 2013-06-06 16:30:16 +02:00
PrestaEdit
66522c4a2c // Add translate() as deprecated 2013-06-03 22:46:52 +02:00
Maxence
371edf9edb Keep retro-compatibility 2013-06-03 13:28:51 +02:00
Maxence
879aa9f98a Use PrestaShop norme 2013-06-02 20:18:59 +02:00
Maxence
10e3fec8a2 Add page limit to Collection
I do not see any way to limit the number of object in a Collection. Collection::setPageSize() and Collection::setPageNumber() add a limit clause to the query.
2013-06-02 21:04:48 +03:00
PrestaEdit
6ae0dbb4ca [*] BO: use Translate::getAdminTranslation instead of translate() 2013-06-01 00:21:28 +02:00
PrestaEdit
58e5ea606c [~] Controller: AdminTranslationsController / Back translations
Files login.php and password.php are now redirect to an AdminController. No need to check it anymore.
2013-06-01 00:46:24 +03:00
PrestaEdit
f7f6175191 [*] BO: hook displayAdminForm / add param fieldset 2013-05-31 14:58:19 +02:00
PrestaEdit
b6fbbe6187 [*] FO: use Tools::fileAttachment() in ContactController 2013-04-30 20:46:34 +02:00
ccauw
051adc7b36 [-] BO : bug in BO translations when Windows OS
[-] BO : bug in BO translations when Windows OS

Impossible to translate the strings of the back office in the directory override/controllers/admin/...
under windows environment.

The statement " $parent_class = explode(DIRECTORY_SEPARATOR,..) " returns wrong result under windows environment. because the path name has '/' and '\' chars.

$parent_class contains bad values and the string "override" is not found.
2013-04-29 16:00:55 +03:00
ccauw
8331ab0c1a [-]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])}
					<span class="color_field" style="background-color:{$tr.color};...
				{/if}

must be:
			{block name="td_content"}
				...
				{if isset($params.color) && isset($tr[$params.color])}
					<span class="color_field" style="background-color:{$tr[$params.color])};...
				{/if}

In the fields list, for display list, there is :
'osname' => array(
	'title' => $this->l('Status'),
	'color' => 'color',
	...
),
'color parameter gives the name of column in _List to be used as color background.
Currently, it is the same 'color' parameter which is used for one field and the row: (ex:osname)
		<span class="color_field" style="background-color:{$tr.color};...

But if there is another field with 'color' => 'color_field', (and color_field in the select), the background color is always 'color', never 'color_field'
That can be fixed with :
		<span class="color_field" style="background-color:{$tr[$params.color])};...

So the background color of the row (if colorOnBackground = true) and one row's field will be the value of the column given by 'color'=>'color', and The background color of others fields will be the value of the column given by their parameter 'color'=>'<color_field>'

$this->_select = '..color ..., ... color_field2 ...';

$this->fields_list = array(
		'field1' => array(
			'title' => $this->l('Status'),
			'color' => 'color',			// will also be the bg color of the row
			...
		),
		'field2' => array(
			'title' => $this->l('Status'),
			'color' => 'color_field2',
			...
		),
		'field2' => array(
			'title' => $this->l('Status'),
			'color' => 'color_field3',
			...
		),
2013-04-28 16:01:55 +03:00
Otto Nascarella
a994c93dee Progressive JPEG
https://plus.google.com/+PaulIrish/posts/5KzxfS9nNEZ
2013-04-25 12:18:50 -03:00
ldecoker
34644ee6eb Update AdminAttributesGroupsController.php 2013-04-16 19:17:51 +03:00
ldecoker
624fed3710 Update form.tpl 2013-04-16 19:15:45 +03:00
Arnaud Lemercier
07979774f6 Delete products tags entries without delete tags for webservice usage 2013-04-02 18:44:12 +02:00
PrestaEdit
18edd9bf75 [*] Class: Tools::fileAttachment() 2013-03-29 10:40:07 +01:00
Arnaud Lemercier
5b058e6723 Allow webservice to set the tags list of product when creating or updating a product 2013-03-29 10:26:44 +01:00
Vincent Schoener
312e16a926 [-] 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)
2013-03-28 12:45:03 +01:00
PrestaEdit
47d3085a4a [*]WS: POST and XML ressource 2013-03-18 01:03:43 +01:00
Samy Rabih
f9f673d78f Default adresse layout update
As many countries use mobile phones in an extensive way, it should be
useful to update the default address layout
2013-03-02 17:40:54 +01:00
PrestaEdit
d59ea3e6dd [*] BO: use lang for input file 2013-01-17 23:29:11 +01:00
bumbu
0036768ae5 ObjectModel::updateMultishopTable() where argument is not mandatory 2013-01-07 19:24:12 +02:00
505 changed files with 15592 additions and 9128 deletions

2
.gitignore vendored
View File

@@ -104,4 +104,4 @@ modules/upscarrier
modules/uspscarrier
modules/wexpay
modules/yotpo
modules/zingaya
modules/zingaya

View File

@@ -1,80 +1,140 @@
- (d)oekia
- Alexander Otchenashev
- Benjamin PONGY
- Burhan
- Caleydon Media
- Damien Metzger
- DamienMetzger
- Damon Skelhorn
- Daniel
- David Gasperoni
- DrySs
- DrÿSs'
- François Gaillard
- Gabriel Schwardy
- Gregory Roussac
- Ha!*!*y
- Jonathan Danse
- Krystian Podemski
- Marco Cervellin
- Michel Courtade
- Milow
- Patanock
- Pierre
- PrestaEdit
- Raphaël Malié
- Rémi Gaillard
- Samy Rabih
- Sarah Lorenzini
- Shagshag
- Vincent Augagneur
- Xavier POITAU
- aFolletete
- aKorczak
- aNiassy
- adonis karavokyros
- anat
- bLeveque
- bMancone
- bumbu
- cmouleyre
- dMetzger
- dSevere
- djfm
- fBrignoli
- fSerny
- fram
- gBrunier
- gCharmes
- gPoulain
- gRoussac
- hAitmansour
- ivancasasempere
- jBreux
- jObregon
- jessylenne
- jmCollin
- kpodemski
- lBrieu
- lCherifi
- lLefevre
- mBertholino
- mDeflotte
- mMarinetti
- marcinsz101
- montes
- nPellicari
- nezenmoins
- oleacorner
- rGaillard
- rMalie
- rMontagne
- root
- sLorenzini
- sThiebaut
- tDidierjean
- vAugagneur
- vChabot
- vKham
- vSchoener
- adonis karavokyros
- aFolletete
- Agence CINS
- aKorczak
- Alexander Otchenashev
- anat
- Andrew
- aNiassy
- antoniofr
- AntonLejon
- Arnaud Lemercier
- Axome
- Benjamin PONGY
- BigZ
- bLeveque
- bMancone
- bumbu
- Burhan
- Cédric Mouleyre
- Caleydon Media
- cam.lafit
- Captain FLAM
- Captain-FLAM
- ccauw
- ChristopheBoucaut
- cippest
- cmouleyre
- Corentin Delcourt
- Cosmin Hutanu
- Damien Metzger
- DamienMetzger
- Damon Skelhorn
- Daniel
- David Gasperoni
- Davy Rolink
- djfm
- dMetzger
- (d)oekia
- Dragan Skrbic
- DrÿSs'
- dreammeup
- DrySs
- dSevere
- Edouard Gaulué
- emily-d
- Fabio Chelly
- fBrignoli
- fram
- François Gaillard
- fSerny
- Gabriel Schwardy
- gBrunier
- gCharmes
- gPoulain
- Grégoire Bélorgey
- Gregory Roussac
- gRoussac
- Guillaume DELOINCE
- hAitmansour
- Ha!*!*y
- indesign47
- inem0o
- ivancasasempere
- Jérôme Nadaud
- jBreux
- jeromenadaud
- Jerome Nadaud
- jessylenne
- jmCollin
- jObregon
- Jonathan Danse
- joseantgv
- Kevin Granger
- kpodemski
- Krystian Podemski
- lBrieu
- lCherifi
- ldecoker
- lLefevre
- marcinsz101
- Marco Cervellin
- Mats Rynge
- MatthieuB
- Maxence
- mBertholino
- mDeflotte
- Michel Courtade
- Milow
- minic studio
- misthero
- mMarinetti
- montes
- nezenmoins
- Nicolas Sorosac
- Nils-Helge Garli Hegvik
- nPellicari
- nturato
- oleacorner
- Otto Nascarella
- Patanock
- PhpMadman
- Pierre
- Piotr Kaczor
- Piotr Moćko
- PrestaEdit
- prestarocket
- pxls
- Rémi Gaillard
- Raphaël Malié
- raulgundin
- rGaillard
- Rimas Kudelis
- rMalie
- rMontagne
- root
- runningz
- Sébastien
- Sébastien Bocahu
- Samy Rabih
- Sarah Lorenzini
- Seb
- Seynaeve
- Shagshag
- sLorenzini
- soware
- Staging
- sThiebaut
- Sylvain WITMEYER
- tDidierjean
- vAugagneur
- vChabot
- Vincent Augagneur
- Vincent Schoener
- Vincent Terenti
- vinvin27
- vKham
- vSchoener
- Xavier
- Xavier POITAU
- Yoozio

View File

@@ -37,7 +37,6 @@ $height = Tools::getValue('height');
$id_employee = Tools::getValue('id_employee');
$id_lang = Tools::getValue('id_lang');
if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee)
die(Tools::displayError());
@@ -47,6 +46,51 @@ if (!Validate::isModuleName($module))
if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
die(Tools::displayError());
$shop_id = '';
Shop::setContext(Shop::CONTEXT_ALL);
if (Context::getContext()->cookie->shopContext)
{
$split = explode('-', Context::getContext()->cookie->shopContext);
if (count($split) == 2)
{
if ($split[0] == 'g')
{
if (Context::getContext()->employee->hasAuthOnShopGroup($split[1]))
Shop::setContext(Shop::CONTEXT_GROUP, $split[1]);
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1]))
{
$shop_id = $split[1];
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
}
// Check multishop context and set right context if need
if (Shop::getContext())
{
if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP)
Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID());
if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP)
Shop::setContext(Shop::CONTEXT_ALL);
}
// Replace existing shop if necessary
if (!$shop_id)
Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
elseif (Context::getContext()->shop->id != $shop_id)
Context::getContext()->shop = new Shop($shop_id);
require_once($module_path);
$graph = new $module();
@@ -57,4 +101,3 @@ if ($option)
$graph->create($render, $type, $width, $height, $layers);
$graph->draw();

View File

@@ -30,14 +30,14 @@ echo ' </div>
<div id="footer">
<div style="float:left;margin-left:10px;padding-top:6px">
<a href="http://www.prestashop.com/" target="_blank" style="font-weight:700;color:#666666">PrestaShop&trade; '._PS_VERSION_.'</a><br />
<span style="font-size:10px">'.translate('Load time:').' '.number_format(microtime(true) - $timerStart, 3, '.', '').'s</span>
<span style="font-size:10px">'.Translate::getAdminTranslation('Load time:').' '.number_format(microtime(true) - $timerStart, 3, '.', '').'s</span>
</div>
<div style="float:right;height:40px;margin-right:10px;line-height:38px;vertical-align:middle">';
if (strtoupper(Context::getContext()->language->iso_code) == 'FR') echo '<span style="color: #812143; font-weight: bold;">Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h ';
echo ' | <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">'.translate('Contact').'</a>
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">'.translate('Bug Tracker').'</a>
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">'.translate('Forum').'</a>
echo ' | <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Contact').'</a>
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Bug Tracker').'</a>
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Forum').'</a>
</div>
</div>
</div>

View File

@@ -223,8 +223,16 @@ function checkPSVersion()
return $upgrader->checkPSVersion();
}
/**
* Deprecated since > 1.5.4.1
* Use Translate::getAdminTranslation($string) instead
*
* @param string $string
*/
function translate($string)
{
Tools::displayAsDeprecated();
global $_LANGADM;
if (!is_array($_LANGADM))
return str_replace('"', '&quot;', $string);
@@ -233,7 +241,6 @@ function translate($string)
return str_replace('"', '&quot;', stripslashes($str));
}
/**
* Returns a new Tab object
*
@@ -461,7 +468,7 @@ function runAdminTab($tab, $ajaxMode = false)
echo '<div class="path_bar">
<div id="help-button" class="floatr" style="display: none; font-family: Verdana; font-size: 10px; margin-right: 4px; margin-top: 4px;">
</div>
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.translate('Back Office').'</a>
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.Translate::getAdminTranslation('Back Office').'</a>
'.$bread.'</div>';
if (!$ajaxMode && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL)
@@ -470,10 +477,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'), '<b>'.$shop_group->name.'</b>');
printf(Translate::getAdminTranslation('You are configuring your store for group shop %s'), '<b>'.$shop_group->name.'</b>');
}
elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
printf(translate('You are configuring your store for shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
printf(Translate::getAdminTranslation('You are configuring your store for shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
echo '</div>';
}
if (Validate::isLoadedObject($adminObj))
@@ -546,8 +553,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 +566,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 '<html><head><title>'.$message.'</title></head><body style="font-family:Arial,Verdana,Helvetica,sans-serif;background-color:#EC8686">
<div style="background-color:#FAE2E3;border:1px solid #000000;color:#383838;font-weight:700;line-height:20px;margin:0 0 10px;padding:10px 15px;width:500px">
<img src="../img/admin/error2.png" style="margin:-4px 5px 0 0;vertical-align:middle">
'.$message.'
</div>';
echo '<a href="'.htmlentities($url).'" method="get" style="float:left;margin:10px">
<input type="button" value="'.Tools::htmlentitiesUTF8(translate('I understand the risks and I really want to display this page')).'" style="height:30px;margin-top:5px" />
<input type="button" value="'.Tools::htmlentitiesUTF8(Translate::getAdminTranslation('I understand the risks and I really want to display this page')).'" style="height:30px;margin-top:5px" />
</a>
<a href="index.php" method="get" style="float:left;margin:10px">
<input type="button" value="'.Tools::htmlentitiesUTF8(translate('Take me out of here!')).'" style="height:40px" />
<input type="button" value="'.Tools::htmlentitiesUTF8(Translate::getAdminTranslation('Take me out of here!')).'" style="height:40px" />
</a>
</body></html>';
die;

View File

@@ -50,6 +50,53 @@ if (!Validate::isModuleName($module))
if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
die(Tools::displayError());
$shop_id = '';
Shop::setContext(Shop::CONTEXT_ALL);
if (Context::getContext()->cookie->shopContext)
{
$split = explode('-', Context::getContext()->cookie->shopContext);
if (count($split) == 2)
{
if ($split[0] == 'g')
{
if (Context::getContext()->employee->hasAuthOnShopGroup($split[1]))
Shop::setContext(Shop::CONTEXT_GROUP, $split[1]);
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1]))
{
$shop_id = $split[1];
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
}
// Check multishop context and set right context if need
if (Shop::getContext())
{
if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP)
Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID());
if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP)
Shop::setContext(Shop::CONTEXT_ALL);
}
// Replace existing shop if necessary
if (!$shop_id)
Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
elseif (Context::getContext()->shop->id != $shop_id)
Context::getContext()->shop = new Shop($shop_id);
require_once($module_path);
$grid = new $module();

View File

@@ -41,7 +41,7 @@ echo '
<link type="text/css" rel="stylesheet" href="'._PS_JS_DIR_.'jquery/plugins/cluetip/jquery.cluetip.css" />
<link type="text/css" rel="stylesheet" href="themes/'.Context::getContext()->employee->bo_theme.'/css/admin.css" />
<link type="text/css" rel="stylesheet" href="'._PS_JS_DIR_.'jquery/plugins/chosen/jquery.chosen.css" />
<title>PrestaShop&trade; - '.translate('Administration panel').'</title>
<title>PrestaShop&trade; - '.Translate::getAdminTranslation('Administration panel').'</title>
<script type="text/javascript">
var helpboxes = '.Configuration::get('PS_HELPBOX').';
var roundMode = '.Configuration::get('PS_PRICE_ROUND_MODE').';
@@ -78,7 +78,7 @@ echo '
html = "";
nb_notifs = 0;
$.each(json.order, function(property, value) {
html += "<li>'.translate('A new order has been made on your shop.').'<br />'.translate('Order number : ').'<strong>#" + parseInt(value.id_order) + "</strong><br />'.translate('Total : ').'<strong>" + value.total_paid_real + "</strong><br />'.translate('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'&vieworder&id_order=" + parseInt(value.id_order) + "\">'.translate('Click here to see that order').'</a></li>";
html += "<li>'.Translate::getAdminTranslation('A new order has been made on your shop.').'<br />'.Translate::getAdminTranslation('Order number : ').'<strong>#" + parseInt(value.id_order) + "</strong><br />'.Translate::getAdminTranslation('Total : ').'<strong>" + value.total_paid_real + "</strong><br />'.Translate::getAdminTranslation('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'&vieworder&id_order=" + parseInt(value.id_order) + "\">'.Translate::getAdminTranslation('Click here to see that order').'</a></li>";
});
if (html != "")
@@ -99,7 +99,7 @@ echo '
html = "";
nb_notifs = 0;
$.each(json.customer, function(property, value) {
html += "<li>'.translate('A new customer registered on your shop.').'<br />'.translate('Customer name : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'&viewcustomer&id_customer=" + parseInt(value.id_customer) + "\">'.translate('Click here to see that customer').'</a></li>";
html += "<li>'.Translate::getAdminTranslation('A new customer registered on your shop.').'<br />'.Translate::getAdminTranslation('Customer name : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'&viewcustomer&id_customer=" + parseInt(value.id_customer) + "\">'.Translate::getAdminTranslation('Click here to see that customer').'</a></li>";
});
if (html != "")
{
@@ -121,7 +121,7 @@ echo '
html = "";
nb_notifs = 0;
$.each(json.customer_message, function(property, value) {
html += "<li>'.translate('A new message posted on your shop.').'<br />'.translate('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'&viewcustomer_thread&id_customer_thread=" + parseInt(value.id_customer_thread) + "\">'.translate('Click here to see that message').'</a></li>";
html += "<li>'.Translate::getAdminTranslation('A new message posted on your shop.').'<br />'.Translate::getAdminTranslation('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'&viewcustomer_thread&id_customer_thread=" + parseInt(value.id_customer_thread) + "\">'.Translate::getAdminTranslation('Click here to see that message').'</a></li>";
});
if (html != "")
@@ -149,14 +149,14 @@ echo '
if (Shop::isFeatureActive())
{
if (Shop::getContext() == Shop::CONTEXT_ALL)
$youEditFieldFor = translate('A modification of this field will be applied for all shops');
$youEditFieldFor = Translate::getAdminTranslation('A modification of this field will be applied for all shops');
elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
{
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for all shops of group %s'), '<b>'.$shop_group->name.'</b>');
$youEditFieldFor = sprintf(Translate::getAdminTranslation('A modification of this field will be applied for all shops of group %s'), '<b>'.$shop_group->name.'</b>');
}
else
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for the shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
$youEditFieldFor = sprintf(Translate::getAdminTranslation('A modification of this field will be applied for the shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
echo 'hints.html(hints.html()+\'<br /><span class="red">'.addslashes($youEditFieldFor).'</span>\');';
}
@@ -202,10 +202,10 @@ echo ' var html = "";
{
echo '<div id="orders_notif" class="notifs"><span id="orders_notif_number_wrapper" class="number_wrapper"><span id="orders_notif_value">0</span></span>
<div id="orders_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last orders').'</h3>
<p class="no_notifs">'.translate('No new orders has been made on your shop').'</p>
<h3>'.Translate::getAdminTranslation('Last orders').'</h3>
<p class="no_notifs">'.Translate::getAdminTranslation('No new orders has been made on your shop').'</p>
<ul id="list_orders_notif"></ul>
<p><a href="index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'">'.translate('Show all orders').'</a></p>
<p><a href="index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'">'.Translate::getAdminTranslation('Show all orders').'</a></p>
</div>
</div>';
}
@@ -213,10 +213,10 @@ echo ' var html = "";
{
echo '<div id="customers_notif" class="notifs notifs_alternate"><span id="customers_notif_number_wrapper" class="number_wrapper"><span id="customers_notif_value">0</span></span>
<div id="customers_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last customers').'</h3>
<p class="no_notifs">'.translate('No new customers registered on your shop').'</p>
<h3>'.Translate::getAdminTranslation('Last customers').'</h3>
<p class="no_notifs">'.Translate::getAdminTranslation('No new customers registered on your shop').'</p>
<ul id="list_customers_notif"></ul>
<p><a href="index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'">'.translate('Show all customers').'</a></p>
<p><a href="index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'">'.Translate::getAdminTranslation('Show all customers').'</a></p>
</div>
</div>';
}
@@ -224,26 +224,26 @@ echo ' var html = "";
{
echo '<div id="customer_messages_notif" class="notifs"><span id="customer_messages_notif_number_wrapper" class="number_wrapper"><span id="customer_messages_notif_value">0</span></span>
<div id="customer_messages_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last messages').'</h3>
<p class="no_notifs">'.translate('No new messages posted on your shop').'</p>
<h3>'.Translate::getAdminTranslation('Last messages').'</h3>
<p class="no_notifs">'.Translate::getAdminTranslation('No new messages posted on your shop').'</p>
<ul id="list_customer_messages_notif"></ul>
<p><a href="index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'">'.translate('Show all messages').'</a></p>
<p><a href="index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'">'.Translate::getAdminTranslation('Show all messages').'</a></p>
</div>
</div>';
}
echo '</div>
echo '</div>
<div id="employee_box">
<div id="employee_infos">
<div class="employee_name">'.translate('Welcome,').' <strong>'.Context::getContext()->employee->firstname.'&nbsp'.Context::getContext()->employee->lastname.'</strong></div>
<div class="employee_name">'.Translate::getAdminTranslation('Welcome,').' <strong>'.Context::getContext()->employee->firstname.'&nbsp'.Context::getContext()->employee->lastname.'</strong></div>
<div class="clear"></div>
<ul id="employee_links">
<li><a href="'.htmlentities(Context::getContext()->link->getAdminLink('AdminEmployees'), ENT_COMPAT, 'UTF-8').'&id_employee={$employee->id}&amp;updateemployee">'.translate('My preferences').'</a></li>
<li><a href="'.htmlentities(Context::getContext()->link->getAdminLink('AdminEmployees'), ENT_COMPAT, 'UTF-8').'&id_employee={$employee->id}&amp;updateemployee">'.Translate::getAdminTranslation('My preferences').'</a></li>
<li class="separator">&nbsp;</li>
<li><a id="header_logout" href="index.php?logout">'.translate('logout').'</a></li>
<li><a id="header_logout" href="index.php?logout">'.Translate::getAdminTranslation('logout').'</a></li>
</ul>';
if (defined(_PS_BASE_URL_))
echo '<a href="'._PS_BASE_URL_.'" id="header_foaccess" target="_blank" title="'.translate('View my shop').'">'.translate('View my shop').'</a>';
echo '<a href="'._PS_BASE_URL_.'" id="header_foaccess" target="_blank" title="'.Translate::getAdminTranslation('View my shop').'">'.Translate::getAdminTranslation('View my shop').'</a>';
echo '</div>
</div>
@@ -252,18 +252,18 @@ echo ' var html = "";
<form method="post" action="index.php?controller=AdminSearch&amp;token='.Tools::getAdminTokenLite('AdminSearch').'">
<input type="text" name="bo_query" id="bo_query" value="'.Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))).'" />
<select name="bo_search_type" id="bo_search_type" class="chosen no-search">
<option value="0">'.translate('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.translate('catalog').'</option>
<optgroup label="'.translate('customers').':">
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.translate('by name').'</option>
<option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.translate('by ip address').'</option>
<option value="0">'.Translate::getAdminTranslation('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('catalog').'</option>
<optgroup label="'.Translate::getAdminTranslation('customers').':">
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('by name').'</option>
<option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('by ip address').'</option>
</optgroup>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.translate('orders').'</option>
<option value="4" '.(Tools::getValue('bo_search_type') == 4 ? 'selected="selected"' : '').'>'.translate('invoices').'</option>
<option value="5" '.(Tools::getValue('bo_search_type') == 5 ? 'selected="selected"' : '').'>'.translate('carts').'</option>
<option value="7" '.(Tools::getValue('bo_search_type') == 7 ? 'selected="selected"' : '').'>'.translate('modules').'</option>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('orders').'</option>
<option value="4" '.(Tools::getValue('bo_search_type') == 4 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('invoices').'</option>
<option value="5" '.(Tools::getValue('bo_search_type') == 5 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('carts').'</option>
<option value="7" '.(Tools::getValue('bo_search_type') == 7 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('modules').'</option>
</select>
<input type="submit" id="bo_search_submit" class="button" value="'.translate('Search').'"/>
<input type="submit" id="bo_search_submit" class="button" value="'.Translate::getAdminTranslation('Search').'"/>
</form>
</div>
<div id="header_quick">
@@ -277,7 +277,7 @@ echo ' var html = "";
}
</script>
<select onchange="quickSelect(this);" id="quick_select">
<option value="0">'.translate('Quick Access').'</option>';
<option value="0">'.Translate::getAdminTranslation('Quick Access').'</option>';
foreach (QuickAccess::getQuickAccesses(Context::getContext()->language->id) AS $quick)
{
preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $adminTab);
@@ -342,8 +342,8 @@ echo '
<div id="main">
<div id="content">'
.(file_exists(_PS_ADMIN_DIR_.'/../install') ? '<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">'
.translate('For security reasons, you must also:').' '.
translate('delete the /install folder').
.Translate::getAdminTranslation('For security reasons, you must also:').' '.
Translate::getAdminTranslation('delete the /install folder').
'</div>' : '').'
';
if(defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
@@ -352,7 +352,7 @@ echo '
if (Shop::isFeatureActive() && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL)
{
echo '<div class="multishop_toolbar">
<span class="text_multishop">'.translate('Multistore configuration for').'</span>'.
<span class="text_multishop">'.Translate::getAdminTranslation('Multistore configuration for').'</span>'.
Helper::renderShopList();
echo '</div>';
}

View File

@@ -27,13 +27,7 @@
{block name="label"}
{if $input.name == 'vat_number'}
{if $vat == 'is_applicable'}
<div id="vat_area" style="display: visible">
{else if $vat == 'management'}
<div id="vat_area" style="display: hidden">
{else}
<div style="display: none;">
{/if}
<div id="vat_area" style="display: visible">
{/if}
{if $input.type == 'text_customer' && !isset($customer)}

View File

@@ -29,6 +29,9 @@
{if $input.type == 'color'}
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if};">
{/if}
{if $input.type == 'closediv'}
</div>
{/if}
{$smarty.block.parent}
{/block}

View File

@@ -0,0 +1,58 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/form/form.tpl"}
{block name="script"}
var string_price = '{l s='Will be applied when the price is' js=1}';
var string_weight = '{l s='Will be applied when the weight is' js=1}';
{/block}
{block name="field"}
{if $input.name == 'zones'}
<div class="ranges_not_follow warn" style="display:none">
<label>{l s="Ranges are not correctly ordered:"}</label>
<a href="#" onclick="checkRangeContinuity(true); return false;" class="button" style="text-decoration:none">{l s="Reordering"}</a>
</div>
{include file='controllers/carrier_wizard/helpers/form/form_ranges.tpl'}
<!--
<div class="validate_range" style="display:none">
<a href="#" class="button" id="validate_range_button">{l s="Validate"}</a>
</div>
-->
<div class="new_range">
<a href="#" onclick="add_new_range();return false;" class="button" id="add_new_range">{l s='Add new range'}</a>
</div>
{/if}
{if $input.name == 'logo'}
<div class="margin-form">
<input id="carrier_logo_input" type="file" onchange="uploadCarrierLogo();" name="carrier_logo_input" />
<input type="hidden" id="logo" name="logo" value="" />
<p class="preference_description">
{l s='Format:'} JPG, GIF, PNG. {l s='Filesize:'} {$max_image_size|string_format:"%.2f"} {l s='MB max.'}
<br />{l s='Current size:'} <span id="carrier_logo_size">{l s='undefined'}</span>.
</p>
</div>
{/if}
{$smarty.block.parent}
{/block}

View File

@@ -0,0 +1,61 @@
<script>var zones_nbr = {$zones|count +3} ; /*corresponds to the third input text (max, min and all)*/</script>
<div style="float:left" id="zone_ranges">
<table cellpadding="5" cellspacing="0" id="zones_table">
<tr class="range_inf">
<td class="range_type"></td>
<td class="border_left border_bottom range_sign">>=</td>
{foreach from=$ranges key=r item=range}
<td class="border_bottom center"><input name="range_inf[{$range.id_range|intval}]" type="text" value="{$range.delimiter1|string_format:"%.6f"}" /><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{foreachelse}
<td class="border_bottom center"><input name="range_inf[{$range.id_range|intval}]" type="text" /><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{/foreach}
</tr>
<tr class="range_sup">
<td class="center range_type"></td>
<td class="border_left range_sign"><</td>
{foreach from=$ranges key=r item=range}
<td class="center"><input name="range_sup[{$range.id_range|intval}]" type="text" {if isset($form_id) && !$form_id} value="" {else} value="{if isset($change_ranges) && $range.id_range == 0} {else}{$range.delimiter2|string_format:"%.6f"}{/if}" {/if}/><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{foreachelse}
<td class="center"><input name="range_sup[{$range.id_range|intval}]" type="text" /><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{/foreach}
</tr>
<tr class="fees_all">
<td class="border_top border_bottom border_bold"><span class="fees_all" {if $ranges|count == 0}style="display:none" {/if}>All</span></td>
<td><input type="checkbox" onclick="checkAllZones(this);" ></td>
{foreach from=$ranges key=r item=range}
<td class="center border_top border_bottom {if $range.id_range != 0} validated {/if}" >
<input type="text" {if isset($form_id) && !$form_id} disabled="disabled"{/if} {if $range.id_range == 0} style="display:none"{/if} /><span class="currency_sign" {if $range.id_range == 0} style="display:none" {/if}>&nbsp; {$currency_sign}</span>
</td>
{foreachelse}
<td class="center border_top border_bottom">
<input style="display:none" type="text" /><span class="currency_sign" style="display:none">&nbsp; {$currency_sign}</span>
</td>
{/foreach}
</tr>
{foreach from=$zones key=i item=zone}
<tr class="fees {if $i is odd}alt_row{/if}" data-zoneid="{$zone.id_zone}">
<td><label for="zone_{$zone.id_zone}">{$zone.name}</label></td>
<td class="zone">
<input class="input_zone" id="zone_{$zone.id_zone}" name="zone_{$zone.id_zone}" value="1" type="checkbox" {if isset($fields_value['zones'][$zone.id_zone]) && $fields_value['zones'][$zone.id_zone]} checked="checked"{/if}/>
</td>
{foreach from=$ranges key=r item=range}
<td class="center">
<input name="fees[{$zone.id_zone|intval}][{$range.id_range|intval}]" type="text"
{if !isset($fields_value['zones'][$zone.id_zone]) || (isset($fields_value['zones'][$zone.id_zone]) && !$fields_value['zones'][$zone.id_zone])} disabled="disabled"{/if} {if isset($price_by_range[$range.id_range][$zone.id_zone]) && $price_by_range[$range.id_range][$zone.id_zone] && isset($fields_value['zones'][$zone.id_zone]) && $fields_value['zones'][$zone.id_zone]} value="{$price_by_range[$range.id_range][$zone.id_zone]|string_format:'%.6f'}" {else} value="" {/if} /> &nbsp; {$currency_sign}
</td>
{/foreach}
</tr>
{/foreach}
<tr class="delete_range">
<td>&nbsp;</td>
<td>&nbsp;</td>
{foreach from=$ranges name=ranges key=r item=range}
{if $smarty.foreach.ranges.first}
<td class="center">&nbsp;</td>
{else}
<td class="center"><button class="button">{l s='Delete'}</button</td>
{/if}
{/foreach}
</tr>
</table>
</div>

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @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;

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @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;

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @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;

View File

@@ -0,0 +1,66 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
<script>
var labelNext = '{$labels.next|addslashes}';
var labelPrevious = '{$labels.previous|addslashes}';
var labelFinish = '{$labels.finish|addslashes}';
var labelDelete = '{l s='Delete' js=1}';
var labelValidate = '{l s='Validate' js=1}';
var validate_url = '{$validate_url|addslashes}';
var carrierlist_url = '{$carrierlist_url|addslashes}';
var nbr_steps = {$wizard_steps.steps|count};
var enableAllSteps = {if $enableAllSteps|intval == 1}true{else}false{/if};
var need_to_validate = '{l s='Please validate the last range before create a new one.' js=1}';
var delete_range_confirm = '{l s='Are you sure to delete this range ?' js=1}';
var currency_sign = '{$currency_sign}';
var PS_WEIGHT_UNIT = '{$PS_WEIGHT_UNIT}';
var invalid_range = '{l s='This range is not valid' js=1}';
var range_is_overlapping = '{l s='Ranges are overlapping' js=1}';
var multistore_enable = '{$multistore_enable}';
</script>
<div id="carrier_wizard" class="swMain">
<ul class="nbr_steps_{$wizard_steps.steps|count}">
{foreach from=$wizard_steps.steps key=step_nbr item=step}
<li>
<a href="#step-{$step_nbr + 1}">
<label class="stepNumber">{$step_nbr + 1}</label>
<span class="stepDesc">
{$step.title}<br />
{if isset($step.desc)}<small>{$step.desc}</small>{/if}
</span>
</a>
</li>
{/foreach}
</ul>
{foreach from=$wizard_contents.contents key=step_nbr item=content}
<div id="step-{$step_nbr + 1}" class="step_container">
{$content}
</div>
{/foreach}
</div>
{/block}

View File

@@ -0,0 +1,91 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div id="carrier_logo_block">
<img id="carrier_logo_img" src="{if $carrier_logo}{$carrier_logo}{else}../img/admin/carrier-default.jpg{/if}" />
<br/>
<a id="carrier_logo_remove" {if !$carrier_logo}style="display:none"{/if} href="javascript:removeCarrierLogo();"><img src="../img/admin/disabled.gif" /> {l s='Remove the logo'}</a>
</div>
<script type="text/javascript">
var carrier_translation_undefined = '{l s='undefined' js=1}';
function removeCarrierLogo()
{
$('#carrier_logo_img').attr('src', '../img/admin/carrier-default.jpg');
$('#logo').val('null');
fixCarrierLogoDisplay();
$('#carrier_logo_remove').hide();
}
function uploadCarrierLogo()
{
$.ajaxFileUpload({
url: 'ajax-tab.php?tab=AdminCarrierWizard&token={$token|addslashes}&action=uploadLogo',
secureuri: false,
fileElementId: 'carrier_logo_input',
dataType: 'xml',
success: function (data, status) {
data = data.getElementsByTagName('return')[0];
var message = data.getAttribute("message");
if (data.getAttribute("result") == "success")
{
$('#carrier_logo_img').attr('src', message);
$('#logo').val(message);
$('#carrier_logo_remove').show();
fixCarrierLogoDisplay();
}
else
alert(message);
}
});
}
function fixCarrierLogoDisplay()
{
$('<img/>').attr('src', $('#carrier_logo_img').attr('src')).load(function(){
var maxHeight = 200;
var maxWidth = 200;
var res = this.width / this.height;
$('#carrier_logo_size').text(this.width + 'x' + this.height + ' px');
$('#carrier_logo_img').width(this.width);
$('#carrier_logo_img').height(this.height);
if ($('#carrier_logo_img').width() > maxWidth)
{
$('#carrier_logo_img').width(maxWidth);
$('#carrier_logo_img').height(maxWidth / res);
}
if ($('#carrier_logo_img').height() > maxHeight)
{
$('#carrier_logo_img').height(maxHeight);
$('#carrier_logo_img').width(maxHeight * res);
}
if ($('#logo').val() == 'null')
$('#carrier_logo_size').text(carrier_translation_undefined);
});
}
fixCarrierLogoDisplay();
</script>

View File

@@ -0,0 +1,68 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
var summary_translation_undefined = '{l s='[undefined]' js=1}';
var summary_translation_meta_informations = '{l s='This carrier is @s1 and the delivery announced is: @s2.' js=1}';
var summary_translation_free = '<strong>{l s='free' js=1}</strong>';
var summary_translation_paid = '<strong>{l s='not free' js=1}</strong>';
var summary_translation_range = '<span class="is_free">{l s='This carrier can deliver orders from @s1 to @s2.' js=1}</span>';
var summary_translation_range_limit = '{l s='If the order is out of range, the behavior is to @s3.' js=1}';
var summary_translation_shipping_cost = '{l s='The shipping cost is calculated @s1 and the tax rule @s2 will be applied.' js=1}';
var summary_translation_price = '<strong>{l s='according to the price' js=1}</strong>';
var summary_translation_weight = '<strong>{l s='according to the weight' js=1}</strong>';
</script>
<div class="defaultForm">
<fieldset>
{l s='Carrier name:'} <strong id="summary_name"></strong>
<div class="clear">&nbsp;</div>
<div id="summary_meta_informations"></div>
<div class="clear">&nbsp;</div>
<div id="summary_shipping_cost"></div>
<div class="clear">&nbsp;</div>
<div id="summary_range"></div>
<div class="clear">&nbsp;</div>
<div>
{l s='This carrier will be proposed for those delivery zones:'}
<ul id="summary_zones"></ul>
</div>
<div class="clear">&nbsp;</div>
<div>
{l s='And it will be proposed for those client groups:'}
<ul id="summary_groups"></ul>
</div>
{if $is_multishop}
<div class="clear">&nbsp;</div>
<div>
{l s='Finally, this carrier will be proposed in those shops:'}
<ul id="summary_shops"></ul>
</div>
{/if}
<div class="clear">&nbsp;</div>
{$active_form}
</fieldset>
</div>
<div class="clear">&nbsp;</div>

View File

@@ -0,0 +1,40 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/list/list_content.tpl"}
{block name="open_td"}
<td
{if isset($params.position)}
id="td_{if !empty($id_category)}{$id_category}{else}0{/if}_{$tr.$identifier}"
{/if}
class="{if !$no_link}pointer{/if}
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
{if isset($params.align)} {$params.align}{/if}"
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
onclick="document.location = '{$link->getAdminLink('AdminCarrierWizard', true)}&{$identifier}={$tr.$identifier}'">
{else}
>
{/if}
{/block}

View File

@@ -34,7 +34,7 @@
{if $shared_category}
<p class="warn">{l s='If you delete this picture, it will be deleted in all of your shared shops!'}</p>
{/if}
<br>
<br />
<a href="{$current}&{$identifier}={$form_id}&token={$token}&{if $shared_category}forcedeleteImage=1{else}deleteImage=1{/if}">
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a>
@@ -71,4 +71,4 @@
<span>{$input.customer}</span><br />
</p>
{/if}
{/block}
{/block}

View File

@@ -33,7 +33,7 @@
&nbsp;<img src="../img/admin/home.gif" alt="" />
{assign var=params_url value=""}
{else}
{assign var=params_url value="&id_category={$category.id_category}&viewcategory"}
{assign var=params_url value="&id_category={$category.id_category|intval}&viewcategory"}
{/if}
{if $category.id_category == $categories_tree_current_id}
{$category.name}
@@ -43,7 +43,7 @@
{/foreach}
</div>
{if isset($delete_category) && $delete_category}
<form action="{$REQUEST_URI}" method="post">
<form action="{$REQUEST_URI|escape:'htmlall':'UTF-8'}" method="post">
<div class="warn">
<h2>
{if $need_delete_mode}
@@ -74,10 +74,10 @@
{if $key != 'deleteMode'}
{if is_array($value)}
{foreach $value as $val}
<input type="hidden" name="{$key}[]" value="{$val}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}[]" value="{$val|escape:'htmlall':'UTF-8'}" />
{/foreach}
{else}
<input type="hidden" name="{$key}" value="{$value}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
{/if}
{/if}
{/foreach}

View File

@@ -35,7 +35,7 @@
{/block}
{block name=leadin}
{if isset($delete_customer) && $delete_customer}
<form action="{$REQUEST_URI}" method="post">
<form action="{$REQUEST_URI|escape:'htmlall':'UTF-8'}" method="post">
<div class="warn">
<h2>{l s='How do you want to delete these customer(s)?'}</h2>
<p>{l s='There are two ways of deleting a customer. Please choose your preferred method.'}</p>
@@ -52,10 +52,10 @@
{foreach $POST as $key => $value}
{if is_array($value)}
{foreach $value as $val}
<input type="hidden" name="{$key}[]" value="{$val}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}[]" value="{$val|escape:'htmlall':'UTF-8'}" />
{/foreach}
{else}
<input type="hidden" name="{$key}" value="{$value}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
{/if}
{/foreach}
<br /><input type="submit" class="button" value="{l s='Delete'}" />

View File

@@ -149,7 +149,7 @@
</div>
<div style="width:50%;float:left;">
<div style="margin-left:15px;"
<div style="margin-left:15px;">
<h2>{l s='Vouchers'} ({count($discounts)})</h2>
{if count($discounts)}
<table cellspacing="0" cellpadding="0" class="table">
@@ -488,4 +488,4 @@
</div>
{/block}
</div>
<div class="clear">&nbsp;</div>
<div class="clear">&nbsp;</div>

View File

@@ -106,7 +106,7 @@
if ($(this).attr('name') == 'category_reduction['+$('[name="id_category"]:checked').val()+']')
{
exist = true;
jAlert('{l s='This category already exists for this group.' js='1'}');
jAlert('{l s='This category already exists for this group.' js=1}');
return false;
}
});
@@ -268,4 +268,4 @@
{else}
{$smarty.block.parent}
{/if}
{/block}
{/block}

View File

@@ -223,7 +223,7 @@ $(document).ready(function() {
$.fancybox(
this.href,
{
'width' : 660,
'width' : 920,
'height' : 384,
'transitionIn' : 'none',
'transitionOut' : 'none',

View File

@@ -57,7 +57,7 @@
}
else
{
jAlert('{l s='You do not have permission to delete here. When the multistore is enabled, only a SuperAdmin can delete all items before an import.' js='1'}');
jAlert('{l s='You do not have permission to delete here. When the multistore is enabled, only a SuperAdmin can delete all items before an import.' js=1}');
return false;
}
}

View File

@@ -58,7 +58,7 @@
</div>
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form">
{l s='Skip'} <input type="text" size="2" name="skip" value="0" /> {l s='lines'}
{l s='Skip'} <input type="text" size="2" name="skip" value="1" /> {l s='lines'}
<input type="hidden" name="csv" value="{$fields_value.csv}" />
<input type="hidden" name="convert" value="{$fields_value.convert}" />
<input type="hidden" name="entity" value="{$fields_value.entity}" />

View File

@@ -49,14 +49,14 @@
<form action="#" id="login_form" method="post">
<div class="field">
<label for="email">{l s='Email address:'}</label>
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
<input type="text" id="email" name="email" class="input email_field" tabindex="1" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
</div>
<div class="field">
<label for="passwd">{l s='Password:'}</label>
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
<input id="passwd" type="password" name="passwd" class="input password_field" tabindex="2" value="{if isset($password)}{$password}{/if}"/>
</div>
<div class="field">
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
<input type="submit" name="submitLogin" value="{l s='Log in'}" tabindex="3" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" />
</p>

View File

@@ -77,7 +77,7 @@
</dl>
</div>
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else}&nbsp;{/if}</p>
{if isset($module->message) && $module->type !== 'addonsNative' && $module->type != 'addonsMustHave'}<div class="conf">{$module->message}</div>{/if}
{if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="conf">{$module->message}</div>{/if}
<div class="row-actions-module">
{if !isset($module->not_on_disk)}
{$module->optionsHtml}

View File

@@ -26,7 +26,7 @@
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
<div class="leadin">{block name="leadin"}{/block}</div>
<form action="{$url_submit}" id={$table}_form method="post">
<form action="{$url_submit}" id="{$table}_form" method="post">
{if $display_key}
<input type="hidden" name="show_modules" value="{$display_key}" />
{/if}
@@ -49,38 +49,10 @@
</select><sup> *</sup>
</div>
<script type="text/javascript">
//<![CDATA
function position_exception_add(shopID)
{
var listValue = $('#em_list_'+shopID).val();
var inputValue = $('#em_text_'+shopID).val();
var r = new RegExp('(^|,) *'+listValue+' *(,|$)');
if (!r.test(inputValue))
$('#em_text_'+shopID).val(inputValue + ((inputValue.trim()) ? ', ' : '') + listValue);
}
function position_exception_remove(shopID)
{
var listValue = $('#em_list_'+shopID).val();
var inputValue = $('#em_text_'+shopID).val();
var r = new RegExp('(^|,) *'+listValue+' *(,|$)');
if (r.test(inputValue))
{
var rep = '';
if (new RegExp(', *'+listValue+' *,').test(inputValue))
$('#em_text_'+shopID).val(inputValue.replace(r, ','));
else if (new RegExp(listValue+' *,').test(inputValue))
$('#em_text_'+shopID).val(inputValue.replace(r, ''));
else
$('#em_text_'+shopID).val(inputValue.replace(r, ''));
}
}
//]]>
</script>
<label>{l s='Exceptions'} :</label>
<div class="margin-form">
{l s='Please specify the files for which you do not want the module to be displayed.'}<br />
{l s='Please input each filename, separated by a comma.'}<br />
{if !$except_diff}
{$exception_list}
{else}
@@ -88,9 +60,6 @@
{$value}
{/foreach}
{/if}
{l s='Please specify the files for which you do not want the module to be displayed.'}.<br />
{l s='Please input each filename, separated by a comma.'}.
<br /><br />
</div>
<div class="margin-form">
@@ -102,4 +71,40 @@
</div>
<div class="small"><sup>*</sup> {l s='Required field'}</div>
</fieldset>
</form>
</form>
<script type="text/javascript">
//<![CDATA
function position_exception_textchange()
{
// TODO : Add & Remove automatically the "custom pages" in the "em_list_x"
var obj = $(this);
var shopID = obj.attr('id').replace(/\D/g, '');
var list = obj.parent().find('#em_list_' + shopID);
var values = obj.val().split(',');
var len = values.length;
list.find('option').prop('selected', false);
for (var i = 0; i < len; i++)
list.find('option[value="' + $.trim(values[i]) + '"]').prop('selected', true);
}
function position_exception_listchange()
{
var obj = $(this);
var shopID = obj.attr('id').replace(/\D/g, '');
var str = obj.val().join(', ');
obj.parent().find('#em_text_' + shopID).val(str);
}
$(document).ready(function(){
$('form[id="hook_module_form"] input[id^="em_text_"]').each(function(){
$(this).change(position_exception_textchange).change();
});
$('form[id="hook_module_form"] select[id^="em_list_"]').each(function(){
$(this).change(position_exception_listchange);
});
});
//]]>
</script>

View File

@@ -45,6 +45,7 @@
{/if}
</td>
<td align="center" class="productQuantity">{$product['customizationQuantityTotal']}</td>
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenPaid())}<td align="center" class="productQuantity">{$product['customizationQuantityRefunded']}</td>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<td align="center" class="productQuantity">{$product['customizationQuantityReturned']}</td>{/if}
{if $stock_management}<td align="center" class=""> - </td>{/if}
@@ -103,6 +104,7 @@
</span>
{/if}
</td>
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenPaid())}<td align="center">{$customization['quantity_refunded']}</td>{/if}
{if ($order->hasBeenDelivered())}<td align="center">{$customization['quantity_returned']}</td>{/if}
<td align="center">

View File

@@ -68,9 +68,9 @@
{/if}
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
#{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->delivery_number}
#{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number}
{else}
{$document->getInvoiceNumberFormatted($current_id_lang)}
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{/if}
{elseif get_class($document) eq 'OrderSlip'}
#{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}

View File

@@ -40,6 +40,7 @@
</td>
<td style="display:none;" align="center" class="productQuantity"><input type="text" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" size="3" disabled="disabled" /></td>
{if ($order->hasBeenPaid())}<td style="display:none;" align="center" class="productQuantity">&nbsp;</td>{/if}
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenDelivered())}<td style="display:none;" align="center" class="productQuantity">&nbsp;</td>{/if}
<td style="display:none;" align="center" class="productQuantity" id="add_product_product_stock">0</td>
<td style="display:none;" align="center" id="add_product_product_total">{displayPrice price=0 currency=$currency->id}</td>

View File

@@ -56,6 +56,7 @@
</span>
{/if}
</td>
{if $display_warehouse}<td>{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if}
{if ($order->hasBeenPaid())}
<td align="center" class="productQuantity">
{$product['product_quantity_refunded']}

View File

@@ -33,8 +33,8 @@
var currencies = new Array();
var id_currency = '';
var id_lang = '';
var txt_show_carts = '{l s='Show carts and orders for this customer.' js='1'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.' js='1'}';
var txt_show_carts = '{l s='Show carts and orders for this customer.' js=1}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.' js=1}';
var defaults_order_state = new Array();
var customization_errors = false;
var pic_dir = '{$pic_dir}';

View File

@@ -170,9 +170,9 @@
{l s='Account registered:'} <b>{dateFormat date=$customer->date_add full=true}</b><br />
{l s='Valid orders placed:'} <b>{$customerStats['nb_orders']}</b><br />
{l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br />
</fieldset>
{/if}
{/if}
</fieldset>
<!-- Sources block -->
{if (sizeof($sources))}
@@ -325,7 +325,7 @@
<td>{displayPrice price=$payment->amount currency=$payment->id_currency}</td>
<td>
{if $invoice = $payment->getOrderInvoice($order->id)}
{$invoice->getInvoiceNumberFormatted($current_id_lang)}
{$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{else}
{l s='No invoice'}
{/if}
@@ -404,7 +404,7 @@
<td>
<select name="payment_invoice" id="payment_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang)}</option>
<option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}</option>
{/foreach}
</select>
</td>
@@ -592,6 +592,7 @@
<th>{l s='Product'}</th>
<th style="width: 15%; text-align: center">{l s='Unit Price'} <sup>*</sup></th>
<th style="width: 4%; text-align: center">{l s='Qty'}</th>
{if $display_warehouse}<th style="text-align: center">{l s='Warehouse'}</th>{/if}
{if ($order->hasBeenPaid())}<th style="width: 3%; text-align: center">{l s='Refunded'}</th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<th style="width: 3%; text-align: center">{l s='Returned'}</th>{/if}
{if $stock_management}<th style="width: 10%; text-align: center">{l s='Available quantity'}</th>{/if}

View File

@@ -31,6 +31,14 @@
{if isset($modules_list)}
{$modules_list}
{/if}
<div class="space info">
{l s='This is where you decide what payment modules are available for different variations like your customers\' currency, group, and country.'}
<br />
{l s='A check mark indicates you want the payment module available.'}
{l s='If it is not checked then this means that the Payment module is disabled.'}
<br />
{l s='Please make sure to click Save for each section.'}
</div>
{if $display_restrictions}
<br /><h2 class="space">{l s='Payment module restrictions'}</h2>
{foreach $lists as $list}

View File

@@ -34,10 +34,10 @@
{if $module->active}
<th>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
<input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked">
<input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked"/>
<a href="javascript:checkPaymentBoxes('{$list['name_id']}', '{$module->name}')" style="text-decoration:none;">
{/if}
&nbsp;<img src="{$ps_base_uri}modules/{$module->name}/logo.gif" alt="{$module->name}" title="{$module->displayName}" />
&nbsp;<img src="{$ps_base_uri}modules/{$module->name}/logo.gif" alt="{$module->name}" title="{$module->displayName}"/>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
</a>
{/if}
@@ -64,11 +64,9 @@
{$type = 'checkbox'}
{/if}
{if $type != 'null'}
<input type="checkbox" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"
{if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}
/>
<input type="{$type}" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}" {if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}/>
{else}
--
<input type="hidden" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"/>--
{/if}
</td>
{/if}
@@ -96,4 +94,4 @@
</table>
<div><input type="submit" class="button space" name="submitModule{$list['name_id']}" value="{l s='Save restrictions'}" /></div>
</fieldset>
</form>
</form>

View File

@@ -40,6 +40,9 @@
</div>
{/if}
{$smarty.block.parent}
{if $input.type == 'radio' && $input.name == 'smarty_cache'}
<a href="{$current}&token={$token}&empty_smarty_cache=1" class="clear button" href="">{l s='Clear Smarty cache'}</a>
{/if}
{/block}
{block name="description"}
@@ -186,7 +189,7 @@
return false;
});
$('input[name="smarty_force_compile"], input[name="smarty_cache"], input[name="smarty_console"]').change(function(){
$('input[name="smarty_force_compile"], input[name="smarty_cache"], input[name="smarty_console"], input[name="smarty_console_key"]').change(function(){
$('#smarty_up').val(1);
});

View File

@@ -78,7 +78,7 @@
<tr id="image_id">
<td style="padding: 4px;">
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small_default.jpg" alt="image_id" title="image_id" />
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-small_default.jpg" alt="image_id" title="image_id" />
</a>
</td>
<td id="td_image_id" class="pointer dragHandle center positionImage">
@@ -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(/<tbody>/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}

View File

@@ -24,8 +24,8 @@
*}
<script type="text/javascript">
var msg_select_one = "{l s="Please select at least one product." js=1}";
var msg_set_quantity = "{l s="Please set a quantity to add a product." js=1}";
var msg_select_one = "{l s='Please select at least one product.' js=1}";
var msg_set_quantity = "{l s='Please set a quantity to add a product.' js=1}";
</script>
<input type="hidden" name="submitted_tabs[]" value="Pack" />
<h4>{l s='Pack'}</h4>

View File

@@ -71,7 +71,7 @@
<label>{l s='Carriers:'}</label>
</td>
<td class="padding-bottom:5px;">
<select name="carriers[]" id="carriers_restriction" multiple="multiple" size="4" style="height:100px;width:200px;">
<select name="carriers[]" id="carriers_restriction" multiple="multiple" size="4" style="height:100px;width:300px;">
{foreach $carrier_list as $carrier}
<option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option>
{/foreach}
@@ -88,4 +88,4 @@
$('#carriers_restriction option').each(function () { $(this).removeAttr('selected')});
return false;
}
</script>
</script>

View File

@@ -90,7 +90,7 @@
var table = $('#selectTables select').val();
if (!table)
jAlert("{l s='Please choose a table.' js='1'}");
jAlert("{l s='Please choose a table.' js=1}");
else
AddRequestSql(table);
});

View File

@@ -1,105 +0,0 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$content}
<br /><br />
<h2>{l s='Fees by carrier, geographical zone and ranges'}</h2>
<form action="{$action_fees}" id="fees" name="fees" method="post">
<fieldset>
<legend><img src="../img/admin/delivery.gif" />{l s='Fees'}</legend>
{if empty($carriers)}
{l s='If you only have free carriers, there\'s no need to configure delivery prices.'}
{else}
<b>{l s='Carrier:'} </b>
<select name="id_carrier2" onchange="$('#fees').attr('action', $('#fees').attr('action')+'&id_carrier='+$(this).attr('value')+'#fees'); $('#fees').submit();">
{foreach $carriers AS $carrier}
<option value="{$carrier['id_carrier']|intval}" {if $carrier['id_carrier'] == $id_carrier} selected="selected"{/if}>{$carrier['name']}</option>
{/foreach}
</select><br />
<table class="table space" cellpadding="0" cellspacing="0">
<tr>
<th>{l s='Zone / Range'}</th>
{if !$carrierSelected->is_free}
{foreach $ranges AS $range}
<th style="font-size: 11px;">{$range['delimiter1']|floatval}{$suffix} {l s='to'} {$range['delimiter2']|floatval}{$suffix}</th>
{/foreach}
{/if}
</tr>
{if sizeof($ranges) && !$carrierSelected->is_free}
{if sizeof($zones) > 1}
<tr>
<th style="height: 30px;">{l s='All'}</th>
{foreach $ranges AS $range}
<td class="center">
{$currency->getSign('left')}
<input type="text" id="fees_all_{$range[$rangeIdentifier]}" onchange="this.value = this.value.replace(/,/g, '.');" onkeyup="if ((event.keyCode||event.which) != 9){ spreadFees({$range[$rangeIdentifier]})}" style="width: 45px;" />
{$currency->getSign('right')} {l s='(tax excl.)'}
</td>
{/foreach}
</tr>
{/if}
{foreach $zones AS $zone}
<tr>
<th style="height: 30px;">{$zone['name']}</th>
{foreach $ranges AS $range}
{if isset($deliveryArray[$zone['id_zone']][$id_carrier][$range[$rangeIdentifier]])}
{$price = $deliveryArray[$zone['id_zone']][$id_carrier][$range[$rangeIdentifier]]}
{else}
{$price = '0.00'}
{/if}
<td class="center">
{$currency->getSign('left')}
<input
type="text"
class="fees_{$range[$rangeIdentifier]}"
onchange="this.value = this.value.replace(/,/g, '.');" name="fees_{$zone['id_zone']}_{$range[$rangeIdentifier]}" onkeyup="clearAllFees({$range[$rangeIdentifier]})"
value="{$price|string_format:"%.6f"}"
style="width: 45px;"
/>
{$currency->getSign('right')} {l s='(tax excl.)'}
</td>
{/foreach}
</tr>
{/foreach}
{/if}
<tr>
<td colspan="{$ranges|sizeof + 1}" class="center" style="border-bottom: none; height: 40px;">
<input type="hidden" name="submitFees{$table}" value="1" />
{if sizeof($ranges) && !$carrierSelected->is_free}
<input type="submit" value="{l s=' Save '}" class="button" />
{else if $carrierSelected->is_free}
{l s='This is a free carrier'}
{else}
{l s='No ranges is set for this carrier'}
{/if}
</td>
</tr>
</table>
{/if}
<input type="hidden" name="id_carrier" value="{$id_carrier}" />
</fieldset>
</form>

View File

@@ -24,7 +24,7 @@
*}
<a href="{$href}" class="delete"
{if in_array($id_shop, $shops_having_dependencies)}
onclick="jAlert('{l s='You cannot delete this shop\'s (customer and/or order dependency)' js='1'}'); return false;"
onclick="jAlert('{l s='You cannot delete this shop\'s (customer and/or order dependency)' js=1}'); return false;"
{elseif isset($confirm)}
onclick="if (confirm('{$confirm}')){ return true; } else { event.stopPropagation(); event.preventDefault();};"
{/if} title="{$action}">

View File

@@ -161,6 +161,13 @@ function add_condition(id_condition_group, type, value)
function delete_condition(condition)
{
delete conditions[condition];
to_delete = $('#'+condition).prev();
if ($(to_delete).children().hasClass('btn_delete_condition'))
$(to_delete).remove();
else
$('#'+condition).next().remove();
$('#'+condition).remove();
return false;
}
@@ -178,7 +185,7 @@ function new_condition_group()
function appendConditionToGroup(html)
{
if ($('#condition_group_'+current_id_condition_group+' table tbody tr').length > 0)
$('#condition_group_'+current_id_condition_group+' table tbody').append('<tr><td align="center" colspan="3"><b>{l s='AND' js=1}</b></td></tr>');
$('#condition_group_'+current_id_condition_group+' table tbody').append('<tr><td align="center" class="btn_delete_condition" colspan="3"><b>{l s='AND' js=1}</b></td></tr>');
$('#condition_group_'+current_id_condition_group+' table tbody').append(html);
}
@@ -284,7 +291,7 @@ $(document).ready(function() {
$('#id_attribute_group option[value="{$condition.id_attribute_group}"]').attr('selected', true);
$('#id_attribute_{$condition.id_attribute_group} option[value="{$condition.value}"]').attr('selected', true);
{elseif $condition.type == 'feature'}
$('#id_feature[value="{$condition.id_feature}"]').attr('selected', true);
$('#id_feature option[value="{$condition.id_feature}"]').attr('selected', true);
$('#id_feature_{$condition.id_feature} option[value="{$condition.value}"]').attr('selected', true);
{else}
$('#id_{$condition.type} option[value="{$condition.value}"]').attr('selected', true);

View File

@@ -25,7 +25,7 @@
<div id="statsContainer">
<div id="calendar">
<form action="{$current}&token={$token}{if $action && $table}&{$action|escape}{$table|escape}{/if}{if $identifier && $id}&{$identifier|escape}={$id|escape}{/if}" method="post" id="calendar_form" name="calendar_form">
<form action="{$current}&token={$token}{if $action && $table}&{$action|escape}{$table|escape}{/if}{if $identifier && $id}&{$identifier|escape}={$id|escape}{/if}{if isset($smarty.get.module)}&module={$smarty.get.module|escape}{/if}{if isset($smarty.get.id_product)}&id_product={$smarty.get.id_product|escape}{/if}" method="post" id="calendar_form" name="calendar_form">
<input type="submit" name="submitDateDay" class="button submitDateDay" value="{$translations.Day}">
<input type="submit" name="submitDateMonth" class="button submitDateMonth" value="{$translations.Month}">
<input type="submit" name="submitDateYear" class="button submitDateYear" value="{$translations.Year}">
@@ -51,4 +51,4 @@
});
});
</script>
</div>
</div>

View File

@@ -138,7 +138,7 @@
// check if it's possible to add the product
if (product_infos == null || $('#cur_product_name').val() == '')
{
jAlert('{l s='Please select at least one product.' js='1'}');
jAlert('{l s='Please select at least one product.' js=1}');
return false;
}

View File

@@ -35,11 +35,12 @@
</div>
<div class="footerRight">
{if $iso_is_fr}
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong>
{/if}
|&nbsp;<a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
|&nbsp;<a href="http://www.prestashop.com/en/contact-us?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Forum'}</a>
|&nbsp;<a href="http://addons.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Addons'}</a>
</div>
</div>
</div>

View File

@@ -30,7 +30,7 @@
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
{block name="defaultForm"}
<form id="{$table}_form" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
<form id="{if isset($fields.form.form.id_form)}{$fields.form.form.id_form|escape:'htmlall':'UTF-8'}{else}{$table}_form{/if}" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
{if $form_id}
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
{/if}
@@ -234,17 +234,29 @@
{/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}
<div id="image">
{$fields_value.image}
<p align="center">{l s='File size'} {$fields_value.size}kb</p>
{$fields_value[$input.name].image}
<p align="center">{l s='File size'} {$fields_value[$input.name].size}kb</p>
<a href="{$current}&{$identifier}={$form_id}&token={$token}&deleteImage=1">
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a>
</div><br />
{/if}
{/if}
<input type="file" name="{$input.name}" {if isset($input.id)}id="{$input.id}"{/if} />
{if isset($input.lang) AND $input.lang}
<div class="translatable">
{foreach $languages as $language}
<div class="lang_{$language.id_lang}" id="{$input.name}_{$language.id_lang}" style="display:{if $language.id_lang == $defaultFormLanguage}block{else}none{/if}; float: left;">
<input type="file" name="{$input.name}_{$language.id_lang}" {if isset($input.id)}id="{$input.id}_{$language.id_lang}"{/if} />
</div>
{/foreach}
</div>
{else}
<input type="file" name="{$input.name}" {if isset($input.id)}id="{$input.id}"{/if} />
{/if}
{if !empty($input.hint)}<span class="hint" name="help_box">{$input.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
{elseif $input.type == 'password'}
<input type="password"
@@ -302,7 +314,6 @@
{if isset($input.class)}class="{$input.class}"
{else}class="color mColorPickerInput"{/if}
name="{$input.name}"
class="{if isset($input.class)}{$input.class}{/if}"
value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" />
{elseif $input.type == 'date'}
<input type="text"
@@ -343,13 +354,13 @@
{/if}
{/if}
{/foreach}
{hook h='displayAdminForm'}
{hook h='displayAdminForm' fieldset=$f}
{if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}Form{/capture}
{hook h=$hookName}
{hook h=$hookName fieldset=$f}
{elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Form{/capture}
{hook h=$hookName}
{hook h=$hookName fieldset=$f}
{/if}
{elseif $key == 'submit'}
<div class="margin-form">

View File

@@ -59,7 +59,7 @@
{block name="td_content"}
{if isset($params.prefix)}{$params.prefix}{/if}
{if isset($params.color) && isset($tr[$params.color])}
<span class="color_field" style="background-color:{$tr.color};color:{if Tools::getBrightness($tr.color) < 128}white{else}#383838{/if}">
<span class="color_field" style="background-color:{$tr[$params.color]};color:{if Tools::getBrightness($tr[$params.color]) < 128}white{else}#383838{/if}">
{/if}
{if isset($tr.$key)}
{if isset($params.active)}

View File

@@ -27,8 +27,8 @@
<script type="text/javascript">
$(document).ready(function() {
$('table.{$table} .filter').keypress(function(event){
formSubmit(event, 'submitFilterButton{$table}')
$('table.{$list_id} .filter').keypress(function(event){
formSubmit(event, 'submitFilterButton{$list_id}')
})
});
</script>
@@ -37,7 +37,7 @@
<script type="text/javascript" src="../js/jquery/plugins/jquery.tablednd.js"></script>
<script type="text/javascript">
var token = '{$token}';
var come_from = '{$table}';
var come_from = '{$list_id}';
var alternate = {if $order_way == 'DESC'}'1'{else}'0'{/if};
</script>
<script type="text/javascript" src="../js/admin-dnd.js"></script>
@@ -45,8 +45,8 @@
<script type="text/javascript">
$(function() {
if ($("table.{$table} .datepicker").length > 0)
$("table.{$table} .datepicker").datepicker({
if ($("table.{$list_id} .datepicker").length > 0)
$("table.{$list_id} .datepicker").datepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd'
@@ -83,7 +83,7 @@
{block name="override_form_extra"}{/block}
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
<input type="hidden" id="submitFilter{$list_id}" name="submitFilter{$list_id}" value="0"/>
{/if}
<table class="table_grid" name="list_table">
{if !$simple_header}
@@ -91,16 +91,16 @@
<td style="vertical-align: bottom;">
<span style="float: left;">
{if $page > 1}
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$table}').value=1"/>&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$table}').value={$page - 1}"/>
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$list_id}').value=1"/>&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$list_id}').value={$page - 1}"/>
{/if}
{l s='Page'} <b>{$page}</b> / {$total_pages}
{if $page < $total_pages}
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$table}').value={$page + 1}"/>&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$table}').value={$total_pages}"/>
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$list_id}').value={$page + 1}"/>&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$list_id}').value={$total_pages}"/>
{/if}
| {l s='Display'}
<select name="pagination" onchange="submit()">
<select name="{$list_id}_pagination" onchange="submit()">
{* Choose number of results per page *}
{foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
@@ -109,8 +109,8 @@
/ {$list_total} {l s='result(s)'}
</span>
<span style="float: right;">
<input type="submit" name="submitReset{$table}" value="{l s='Reset'}" class="button" />
<input type="submit" id="submitFilterButton{$table}" name="submitFilter" value="{l s='Filter'}" class="button" />
<input type="submit" id="submitFilterButton{$list_id}" name="submitFilter" value="{l s='Filter'}" class="button" />
<input type="submit" name="submitReset{$list_id}" value="{l s='Reset'}" class="button" />
</span>
<span class="clear"></span>
</td>
@@ -120,7 +120,7 @@
<td{if $simple_header} style="border:none;"{/if}>
<table
{if $table_id} id={$table_id}{/if}
class="table {if $table_dnd}tableDnD{/if} {$table}"
class="table {if $table_dnd}tableDnD{/if} {$list_id}"
cellpadding="0" cellspacing="0"
style="width: 100%; margin-bottom:10px;">
<col width="10px" />
@@ -137,7 +137,7 @@
<tr class="nodrag nodrop" style="height: 40px">
<th class="center">
{if $has_bulk_actions}
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$table}Box[]', this.checked)" />
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$list_id}Box[]', this.checked)" />
{/if}
</th>
{foreach $fields_display AS $key => $params}
@@ -148,9 +148,9 @@
</span>
{if (!isset($params.orderby) || $params.orderby) && !$simple_header}
<br />
<a href="{$currentIndex}&{$table}Orderby={$key|urlencode}&{$table}Orderway=desc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<a href="{$currentIndex}&{$list_id}Orderby={$key|urlencode}&{$list_id}Orderway=desc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<img border="0" src="../img/admin/down{if isset($order_by) && ($key == $order_by) && ($order_way == 'DESC')}_d{/if}.gif" /></a>
<a href="{$currentIndex}&{$table}Orderby={$key|urlencode}&{$table}Orderway=asc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<a href="{$currentIndex}&{$list_id}Orderby={$key|urlencode}&{$list_id}Orderway=asc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<img border="0" src="../img/admin/up{if isset($order_by) && ($key == $order_by) && ($order_way == 'ASC')}_d{/if}.gif" /></a>
{elseif !$simple_header}
<br />&nbsp;
@@ -186,7 +186,7 @@
--
{else}
{if $params.type == 'bool'}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$key}">
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$key}">
<option value="">--</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
@@ -196,7 +196,7 @@
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}"{if isset($params.width)} style="width:70px"{/if}/>
{elseif $params.type == 'select'}
{if isset($params.filter_key)}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>--</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
@@ -206,7 +206,7 @@
</select>
{/if}
{else}
<input type="text" class="filter" name="{$table}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'htmlall':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{else}style="width:95%"{/if} />
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'htmlall':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{else}style="width:95%"{/if} />
{/if}
{/if}
</td>

View File

@@ -35,7 +35,7 @@
</span>
{if count($errors) == 1}
{$errors[0]}
{reset($errors)}
{else}
{l s='%d errors' sprintf=$errors|count}
<br/>

View File

@@ -38,7 +38,7 @@
<div style="float:right;margin:5px">
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
</div>
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0"></div>
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0" /></div>
<div id="modules_list_container_tab" style="display:none;"></div>
</div>
{/if}

View File

@@ -25,6 +25,8 @@
'AdminAttributesGroupsControllerCore' => 'controllers/admin/AdminAttributesGroupsController.php',
'AdminBackupController' => '',
'AdminBackupControllerCore' => 'controllers/admin/AdminBackupController.php',
'AdminCarrierWizardController' => '',
'AdminCarrierWizardControllerCore' => 'controllers/admin/AdminCarrierWizardController.php',
'AdminCarriersController' => '',
'AdminCarriersControllerCore' => 'controllers/admin/AdminCarriersController.php',
'AdminCartRulesController' => '',

View File

@@ -313,11 +313,10 @@ class AddressCore extends ObjectModel
{
$key = 'address_exists_'.(int)$id_address;
if (!Cache::isStored($key))
Cache::store(
$key, Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `id_address`
FROM '._DB_PREFIX_.'address a
WHERE a.`id_address` = '.(int)$id_address));
{
$id_address = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_address` FROM '._DB_PREFIX_.'address a WHERE a.`id_address` = '.(int)$id_address);
Cache::store($key, (bool)$id_address);
}
return Cache::retrieve($key);
}

View File

@@ -142,12 +142,15 @@ class AttributeGroupCore extends ObjectModel
if (!AttributeGroup::cleanDeadCombinations())
return false;
/* Also delete related attributes */
if (Db::getInstance()->execute('
if (count($to_remove))
if (!Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_lang`
WHERE `id_attribute`
IN (SELECT id_attribute FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id.')') === false ||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false)
return false;
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
!Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_shop`
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
!Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id))
return false;
$this->cleanPositions();
}
$return = parent::delete();

View File

@@ -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),
),
);

View File

@@ -165,6 +165,14 @@ class CarrierCore extends ObjectModel
public function __construct($id = null, $id_lang = null)
{
parent::__construct($id, $id_lang);
/**
* keep retrocompatibility SHIPPING_METHOD_DEFAULT
* @deprecated 1.5.5
*/
if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT)
$this->shipping_method = ((int)Configuration::get('PS_SHIPPING_METHOD') ? Carrier::SHIPPING_METHOD_WEIGHT : Carrier::SHIPPING_METHOD_PRICE);
/**
* keep retrocompatibility id_tax_rules_group
* @deprecated 1.5.0
@@ -370,13 +378,12 @@ class CarrierCore extends ObjectModel
*/
public static function getDeliveryPriceByRanges($range_table, $id_carrier)
{
$range_table = pSQL($range_table);
$sql = 'SELECT d.id_'.$range_table.', d.id_carrier, d.id_zone, d.price
$sql = 'SELECT d.`id_'.bqSQL($range_table).'`, d.id_carrier, d.id_zone, d.price
FROM '._DB_PREFIX_.'delivery d
LEFT JOIN '._DB_PREFIX_.$range_table.' r ON r.id_'.$range_table.' = d.id_'.$range_table.'
LEFT JOIN `'._DB_PREFIX_.bqSQL($range_table).'` r ON r.`id_'.bqSQL($range_table).'` = d.`id_'.bqSQL($range_table).'`
WHERE d.id_carrier = '.(int)$id_carrier.'
AND d.id_'.$range_table.' IS NOT NULL
AND d.id_'.$range_table.' != 0
AND d.`id_'.bqSQL($range_table).'` IS NOT NULL
AND d.`id_'.bqSQL($range_table).'` != 0
'.Carrier::sqlDeliveryRangeShop($range_table).'
ORDER BY r.delimiter1';
return Db::getInstance()->executeS($sql);
@@ -456,6 +463,22 @@ class CarrierCore extends ObjectModel
return $carriers;
}
public static function getIdTaxRulesGroupMostUsed()
{
return Db::getInstance()->getValue('
SELECT id_tax_rules_group
FROM (
SELECT COUNT(*) n, c.id_tax_rules_group
FROM '._DB_PREFIX_.'carrier c
JOIN '._DB_PREFIX_.'tax_rules_group trg ON (c.id_tax_rules_group = trg.id_tax_rules_group)
WHERE trg.active = 1
GROUP BY c.id_tax_rules_group
ORDER BY n DESC
LIMIT 1
) most_used'
);
}
public static function getDeliveredCountries($id_lang, $active_countries = false, $active_carriers = false, $contain_states = null)
{
if (!Validate::isBool($active_countries) || !Validate::isBool($active_carriers))
@@ -712,7 +735,7 @@ class CarrierCore extends ObjectModel
*/
public function deleteDeliveryPrice($range_table)
{
$where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.$range_table.'` IS NOT NULL OR `id_'.$range_table.'` = 0) ';
$where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.bqSQL($range_table).'` IS NOT NULL OR `id_'.bqSQL($range_table).'` = 0) ';
if (Shop::getContext() == Shop::CONTEXT_ALL)
$where .= 'AND id_shop IS NULL AND id_shop_group IS NULL';
@@ -730,7 +753,7 @@ class CarrierCore extends ObjectModel
* @param array $priceList Prices list in multiple arrays (changed to array since 1.5.0)
* @return boolean Insertion result
*/
public function addDeliveryPrice($price_list)
public function addDeliveryPrice($price_list, $delete = false)
{
if (!$price_list)
return false;
@@ -749,6 +772,17 @@ class CarrierCore extends ObjectModel
if (!isset($values['id_shop_group']))
$values['id_shop_group'] = (Shop::getContext() != Shop::CONTEXT_ALL) ? Shop::getContextShopGroupID() : null;
if ($delete)
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'delivery`
WHERE id_shop = '.(int)$values['id_shop'].'
AND id_shop_group='.(int)$values['id_shop_group'].'
AND id_carrier='.(int)$values['id_carrier'].
($values['id_range_price'] !== null ? ' AND id_range_price='.(int)$values['id_range_price'] : '').
($values['id_range_weight'] !== null ? ' AND id_range_weight='.(int)$values['id_range_weight'] : '').'
AND id_zone='.(int)$values['id_zone']
);
$sql .= '(';
foreach ($values as $v)
{
@@ -852,8 +886,7 @@ class CarrierCore extends ObjectModel
(SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop`
FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop`
WHERE `id_carrier`='.(int)$old_id.')');
// Update warehouse_carriers
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'warehouse_carrier SET id_carrier='.(int)$this->id.' WHERE id_carrier='.(int)$old_id);
}
/**
@@ -913,9 +946,11 @@ class CarrierCore extends ObjectModel
return false;
}
public function getRangeObject()
public function getRangeObject($shipping_method = false)
{
$shipping_method = $this->getShippingMethod();
if (!$shipping_method)
$shipping_method = $this->getShippingMethod();
if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT)
return new RangeWeight();
elseif ($shipping_method == Carrier::SHIPPING_METHOD_PRICE)
@@ -1033,9 +1068,9 @@ class CarrierCore extends ObjectModel
$sql = 'AND '.$alias.'.id_delivery = (
SELECT d2.id_delivery
FROM '._DB_PREFIX_.'delivery d2
WHERE d2.id_carrier = '.$alias.'.id_carrier
AND d2.id_zone = '.$alias.'.id_zone
AND d2.id_'.$range_table.' = '.$alias.'.id_'.$range_table.'
WHERE d2.id_carrier = `'.bqSQL($alias).'`.id_carrier
AND d2.id_zone = `'.bqSQL($alias).'`.id_zone
AND d2.`id_'.bqSQL($range_table).'` = `'.bqSQL($alias).'`.`id_'.bqSQL($range_table).'`
'.$where.'
ORDER BY d2.id_shop DESC, d2.id_shop_group DESC
LIMIT 1
@@ -1251,5 +1286,17 @@ class CarrierCore extends ObjectModel
return true;
}
}
public function setGroups($groups, $delete = true)
{
if ($delete)
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$this->id);
if (!is_array($groups) || !count($groups))
return true;
$sql = 'INSERT INTO '._DB_PREFIX_.'carrier_group (id_carrier, id_group) VALUES ';
foreach ($groups as $id_group)
$sql .= '('.(int)$this->id.', '.(int)$id_group.'),';
return Db::getInstance()->execute(rtrim($sql, ','));
}
}

View File

@@ -134,6 +134,7 @@ class CartCore extends ObjectModel
'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array(
'id_product' => array('required' => true, 'xlink_resource' => 'products'),
'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'),
'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'),
'quantity' => array('required' => true),
)
),
@@ -209,7 +210,7 @@ class CartCore extends ObjectModel
if (!isset($this->id_address_invoice) || $this->id_address_invoice == $id_address)
{
$to_update = true;
$this->context->cart->id_address_invoice = $id_address_new;
$this->id_address_invoice = $id_address_new;
}
if (!isset($this->id_address_delivery) || $this->id_address_delivery == $id_address)
{
@@ -764,6 +765,9 @@ class CartCore extends ObjectModel
if (!Validate::isLoadedObject($cartRule))
return false;
if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id))
return false;
// Add the cart rule to the cart
if (!Db::getInstance()->insert('cart_cart_rule', array(
'id_cart_rule' => (int)$id_cart_rule,
@@ -2543,6 +2547,7 @@ class CartCore extends ObjectModel
if (empty($id_carrier) && $this->isCarrierInRange((int)Configuration::get('PS_CARRIER_DEFAULT'), (int)$id_zone))
$id_carrier = (int)Configuration::get('PS_CARRIER_DEFAULT');
$total_package_without_shipping_tax_inc = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
if (empty($id_carrier))
{
if ((int)$this->id_customer)
@@ -2577,7 +2582,7 @@ class CartCore extends ObjectModel
{
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->getTotalWeight(), (int)$id_zone);
$total_order = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
$total_order = $total_package_without_shipping_tax_inc;
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $total_order, (int)$id_zone, (int)$this->id_currency);
// Get only carriers that have a range compatible with cart
@@ -2680,26 +2685,8 @@ class CartCore extends ObjectModel
$id_zone = (int)$default_country->id_zone;
}
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight((int)$carrier->id, $this->getTotalWeight(), (int)$id_zone);
// Code Review V&V TO FINISH
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice(
$carrier->id,
$this->getOrderTotal(
true,
Cart::BOTH_WITHOUT_SHIPPING,
$product_list
),
$id_zone,
(int)$this->id_currency
);
if ((
$carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT
&& !$check_delivery_price_by_weight
) || (
$carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE
&& !$check_delivery_price_by_price
if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && !Carrier::checkDeliveryPriceByWeight($carrier->id, $this->getTotalWeight(), (int)$id_zone))
|| ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && !Carrier::checkDeliveryPriceByPrice($carrier->id, $total_package_without_shipping_tax_inc, $id_zone, (int)$this->id_currency)
))
$shipping_cost += 0;
else
@@ -2846,7 +2833,10 @@ class CartCore extends ObjectModel
$formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
$formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice);
$total_tax = $this->getOrderTotal() - $this->getOrderTotal(false);
$base_total_tax_inc = $this->getOrderTotal(true);
$base_total_tax_exc = $this->getOrderTotal(false);
$total_tax = $base_total_tax_inc - $base_total_tax_exc;
if ($total_tax < 0)
$total_tax = 0;
@@ -2944,9 +2934,9 @@ class CartCore extends ObjectModel
'total_shipping_tax_exc' => $total_shipping_tax_exc,
'total_products_wt' => $total_products_wt,
'total_products' => $total_products,
'total_price' => $this->getOrderTotal(),
'total_price' => $base_total_tax_inc,
'total_tax' => $total_tax,
'total_price_without_tax' => $this->getOrderTotal(false),
'total_price_without_tax' => $base_total_tax_exc,
'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
'free_ship' => $total_shipping ? 0 : 1,
'carrier' => new Carrier($this->id_carrier, $id_lang),
@@ -3044,8 +3034,10 @@ class CartCore extends ObjectModel
public function addTextFieldToProduct($id_product, $index, $type, $text_value)
{
$text_value = str_replace(array("\n", "\r"), '', nl2br($text_value));
$text_value = str_replace('\\', '\\\\', $text_value);
$text_value = str_replace('\'', '\\\'', $text_value);
if (!_PS_MAGIC_QUOTES_GPC_){
$text_value = str_replace('\\', '\\\\', $text_value);
$text_value = str_replace('\'', '\\\'', $text_value);
}
return $this->_addCustomization($id_product, 0, $index, $type, $text_value, 0);
}
@@ -3221,25 +3213,24 @@ class CartCore extends ObjectModel
public function getWsCartRows()
{
$query = '
return Db::getInstance()->executeS('
SELECT id_product, id_product_attribute, quantity
FROM `'._DB_PREFIX_.'cart_product`
WHERE id_cart = '.(int)$this->id.'
AND id_shop = '.(int)Context::getContext()->shop->id;
$result = Db::getInstance()->executeS($query);
return $result;
WHERE id_cart = '.(int)$this->id.' AND id_shop = '.(int)Context::getContext()->shop->id
);
}
public function setWsCartRows($values)
{
if ($this->deleteAssociations())
{
$query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `quantity`, `date_add`, `id_shop`) VALUES ';
$query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `id_address_delivery`, `quantity`, `date_add`, `id_shop`) VALUES ';
foreach ($values as $value)
$query .= '('.(int)$this->id.', '.(int)$value['id_product'].', '.
(isset($value['id_product_attribute']) ? (int)$value['id_product_attribute'] : 'NULL').', '.(int)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),';
(isset($value['id_product_attribute']) ? (int)$value['id_product_attribute'] : 'NULL').', '.
(isset($value['id_address_delivery']) ? (int)$value['id_address_delivery'] : 0).', '.
(int)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),';
Db::getInstance()->execute(rtrim($query, ','));
}
@@ -3424,62 +3415,59 @@ class CartCore extends ObjectModel
*/
public function setNoMultishipping()
{
// Upgrading quantities
$sql = 'SELECT sum(`quantity`) as quantity, id_product, id_product_attribute, count(*) as count
FROM `'._DB_PREFIX_.'cart_product`
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
GROUP BY id_product, id_product_attribute
HAVING count > 1';
foreach (Db::getInstance()->executeS($sql) as $product)
if (Configuration::get('PS_ALLOW_MULTISHIPPING'))
{
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
SET `quantity` = '.$product['quantity'].'
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
AND id_product = '.$product['id_product'].'
AND id_product_attribute = '.$product['id_product_attribute'];
Db::getInstance()->execute($sql);
// Upgrading quantities
$sql = 'SELECT sum(`quantity`) as quantity, id_product, id_product_attribute, count(*) as count
FROM `'._DB_PREFIX_.'cart_product`
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
GROUP BY id_product, id_product_attribute
HAVING count > 1';
foreach (Db::getInstance()->executeS($sql) as $product)
{
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
SET `quantity` = '.$product['quantity'].'
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
AND id_product = '.$product['id_product'].'
AND id_product_attribute = '.$product['id_product_attribute'];
Db::getInstance()->execute($sql);
}
// Merging multiple lines
$sql = 'DELETE cp1
FROM `'._DB_PREFIX_.'cart_product` cp1
INNER JOIN `'._DB_PREFIX_.'cart_product` cp2
ON (
(cp1.id_cart = cp2.id_cart)
AND (cp1.id_product = cp2.id_product)
AND (cp1.id_product_attribute = cp2.id_product_attribute)
AND (cp1.id_address_delivery <> cp2.id_address_delivery)
AND (cp1.date_add > cp2.date_add)
)';
Db::getInstance()->execute($sql);
}
// Merging multiple lines
$sql = 'DELETE cp1
FROM `'._DB_PREFIX_.'cart_product` cp1
INNER JOIN `'._DB_PREFIX_.'cart_product` cp2
ON (
(cp1.id_cart = cp2.id_cart)
AND (cp1.id_product = cp2.id_product)
AND (cp1.id_product_attribute = cp2.id_product_attribute)
AND (cp1.id_address_delivery <> cp2.id_address_delivery)
AND (cp1.date_add > cp2.date_add)
)';
Db::getInstance()->execute($sql);
// Upgrading address delivery
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
SET `id_address_delivery` =
(
SELECT `id_address_delivery`
FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
)
WHERE `id_cart` = '.(int)$this->id.'
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
Db::getInstance()->execute($sql);
$sql = 'UPDATE `'._DB_PREFIX_.'customization`
SET `id_address_delivery` =
(
SELECT `id_address_delivery`
FROM `'._DB_PREFIX_.'cart`
// Update delivery address for each product line
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'cart_product`
SET `id_address_delivery` = (
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
)
WHERE `id_cart` = '.(int)$this->id.'
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : ''));
if (Customization::isFeatureActive())
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'customization`
SET `id_address_delivery` = (
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.'
)
WHERE `id_cart` = '.(int)$this->id;
Db::getInstance()->execute($sql);
WHERE `id_cart` = '.(int)$this->id);
}
/**

View File

@@ -10,7 +10,7 @@
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy 502immediately.
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
@@ -495,36 +495,14 @@ class CartRuleCore extends ObjectModel
$cartTotal = $context->cart->getOrderTotal($this->minimum_amount_tax, Cart::ONLY_PRODUCTS);
if ($this->minimum_amount_shipping)
$cartTotal += $context->cart->getOrderTotal($this->minimum_amount_tax, Cart::ONLY_SHIPPING);
$products = $context->cart->getProducts();
$cart_rules = $context->cart->getCartRules();
// If a product is given for free in this rule and already in the cart, the price is subtracted
if ($this->gift_product && $alreadyInCart)
{
$query = new DbQuery();
$query->select('id_product');
$query->from('cart_product');
$query->where('id_product = '.(int)$this->gift_product);
$query->where('id_cart = '.(int)$context->cart->id);
if ((int)$this->gift_product_attribute)
$query->where('id_product_attribute = '.(int)$this->gift_product_attribute);
if (Db::getInstance()->getValue($query))
{
$ref = false;
$product_price = Product::getPriceStatic(
$this->gift_product,
$this->minimum_amount_tax,
$this->gift_product_attribute,
null, null, false, true, 1, null,
$context->cart->id_customer ? $context->cart->id_customer : null,
$context->cart->id,
(int)$context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')} ? (int)$context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')} : null,
$ref, true, true, $context, true
);
$cartTotal -= $product_price;
}
}
foreach ($cart_rules as &$cart_rule)
if ($cart_rule['gift_product'])
foreach ($products as $key => &$product)
if (empty($product['gift']) && $product['id_product'] == $cart_rule['gift_product'] && $product['id_product_attribute'] == $cart_rule['gift_product_attribute'])
$cartTotal = Tools::ps_round($cartTotal - $product[$this->minimum_amount_tax ? 'price_wt' : 'price'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
if ($cartTotal < $minimum_amount)
return (!$display_error) ? false : Tools::displayError('You have not reached the minimum amount required to use this voucher');
@@ -1104,32 +1082,33 @@ 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.')
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
ORDER BY priority';
$result = Db::getInstance()->executeS($sql);
if ($result)

View File

@@ -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),
@@ -796,7 +796,7 @@ class CategoryCore extends ObjectModel
)).')';
$flag = Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`)
INSERT IGNORE INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`)
VALUES '.implode(',', $row)
);
return $flag;
@@ -831,20 +831,15 @@ class CategoryCore extends ObjectModel
if (!Validate::isUnsignedId($id_category) || !Validate::isUnsignedId($id_lang))
return false;
if (isset(self::$_links[$id_category.'-'.$id_lang]))
return self::$_links[$id_category.'-'.$id_lang];
$result = Db::getInstance()->getRow('
SELECT cl.`link_rewrite`
FROM `'._DB_PREFIX_.'category_lang` cl
WHERE `id_lang` = '.(int)$id_lang.'
'.Shop::addSqlRestrictionOnLang('cl').'
AND cl.`id_category` = '.(int)$id_category
);
self::$_links[$id_category.'-'.$id_lang] = $result['link_rewrite'];
return $result['link_rewrite'];
if (!isset(self::$_links[$id_category.'-'.$id_lang]))
self::$_links[$id_category.'-'.$id_lang] = Db::getInstance()->getValue('
SELECT cl.`link_rewrite`
FROM `'._DB_PREFIX_.'category_lang` cl
WHERE `id_lang` = '.(int)$id_lang.'
'.Shop::addSqlRestrictionOnLang('cl').'
AND cl.`id_category` = '.(int)$id_category
);
return self::$_links[$id_category.'-'.$id_lang];
}
public function getLink(Link $link = null)
@@ -1395,8 +1390,7 @@ class CategoryCore extends ObjectModel
SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
WHERE `level_depth` = 1
');
WHERE `level_depth` = 1');
}
public function isRootCategoryForAShop()

View File

@@ -74,6 +74,16 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
* @var int Total of elements for iteration
*/
protected $total;
/**
* @var int Page number
*/
protected $page_number = 0;
/**
* @var int Size of a page
*/
protected $page_size = 0;
protected $fields = array();
protected $alias = array();
@@ -334,6 +344,11 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
break;
}
}
// All limit clause
if ($this->page_size)
$this->query->limit($this->page_size, $this->page_number * $this->page_size);
// Shall we display query for debug ?
if ($display_query)
@@ -659,6 +674,34 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
}
return $this->fields[$field];
}
/**
* Set the page number
*
* @param int $page_number
* @return Collection
*/
public function setPageNumber($page_number)
{
$page_number = (int)$page_number;
if ($page_number > 0)
$page_number--;
$this->page_number = $page_number;
return $this;
}
/**
* Set the nuber of item per page
*
* @param int $page_size
* @return Collection
*/
public function setPageSize($page_size)
{
$this->page_size = (int)$page_size;
return $this;
}
/**
* Generate uniq alias from association name

View File

@@ -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;
@@ -128,6 +135,7 @@ class CombinationCore extends ObjectModel
{
$result = Db::getInstance()->delete('product_attribute_combination', '`id_product_attribute` = '.(int)$this->id);
$result &= Db::getInstance()->delete('cart_product', '`id_product_attribute` = '.(int)$this->id);
$result &= Db::getInstance()->delete('product_attribute_image', '`id_product_attribute` = '.(int)$this->id);
return $result;
}

View File

@@ -49,7 +49,6 @@ class ConfigurationTestCore
'mysql_support' => false,
'config_dir' => 'config',
'cache_dir' => 'cache',
'sitemap' => 'sitemap.xml',
'log_dir' => 'log',
'img_dir' => 'img',
'mails_dir' => 'mails',

View File

@@ -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);

View File

@@ -298,7 +298,11 @@ class CookieCore
//checks if the language exists, if not choose the default language
if (!$this->_standalone && !Language::getLanguage((int)$this->id_lang))
{
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
// set detect_language to force going through Tools::setCookieLanguage to figure out browser lang
$this->detect_language = true;
}
}

View File

@@ -121,20 +121,23 @@ class CountryCore extends ObjectModel
public static function getCountries($id_lang, $active = false, $contain_states = false, $list_states = true)
{
$countries = array();
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT cl.*,c.*, cl.`name` country, z.`name` zone
FROM `'._DB_PREFIX_.'country` c '.Shop::addSqlAssociation('country', 'c').'
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)$id_lang.')
LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = c.`id_zone`)
WHERE 1'.($active ? ' AND c.active = 1' : '').($contain_states ? ' AND c.`contains_states` = '.(int)$contain_states : '').'
ORDER BY cl.name ASC') as $country)
$countries[$country['id_country']] = $country;
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT cl.*,c.*, cl.`name` country, z.`name` zone
FROM `'._DB_PREFIX_.'country` c '.Shop::addSqlAssociation('country', 'c').'
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)$id_lang.')
LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = c.`id_zone`)
WHERE 1'.($active ? ' AND c.active = 1' : '').($contain_states ? ' AND c.`contains_states` = '.(int)$contain_states : '').'
ORDER BY cl.name ASC');
foreach ($result as $row)
$countries[$row['id_country']] = $row;
if ($list_states)
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'state` ORDER BY `name` ASC') as $state)
if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */
if ($state['active'] == 1)
$countries[$state['id_country']]['states'][] = $state;
{
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'state` ORDER BY `name` ASC');
foreach ($result as $row)
if (isset($countries[$row['id_country']]) && $row['active'] == 1) /* Does not keep the state if its country has been disabled and not selected */
$countries[$row['id_country']]['states'][] = $row;
}
return $countries;
}

View File

@@ -379,12 +379,12 @@ class DispatcherCore
/**
* Load default routes group by languages
*/
protected function loadRoutes()
protected function loadRoutes($id_shop = null)
{
$context = Context::getContext();
// Load custom routes from modules
$modules_routes = Hook::exec('moduleRoutes', array(), null, true, false);
$modules_routes = Hook::exec('moduleRoutes', array('id_shop' => $id_shop), null, true, false);
if (is_array($modules_routes) && count($modules_routes))
foreach($modules_routes as $module_route)
foreach($module_route as $route => $route_details)
@@ -405,7 +405,8 @@ class DispatcherCore
$route['controller'],
$lang['id_lang'],
$route['keywords'],
isset($route['params']) ? $route['params'] : array()
isset($route['params']) ? $route['params'] : array(),
$id_shop
);
// Load the custom routes prior the defaults to avoid infinite loops
@@ -420,13 +421,13 @@ class DispatcherCore
// Load routes from meta table
$sql = 'SELECT m.page, ml.url_rewrite, ml.id_lang
FROM `'._DB_PREFIX_.'meta` m
LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta'.Shop::addSqlRestrictionOnLang('ml').')
LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta'.Shop::addSqlRestrictionOnLang('ml', $id_shop).')
ORDER BY LENGTH(ml.url_rewrite) DESC';
if ($results = Db::getInstance()->executeS($sql))
foreach ($results as $row)
{
if ($row['url_rewrite'])
$this->addRoute($row['page'], $row['url_rewrite'], $row['page'], $row['id_lang']);
$this->addRoute($row['page'], $row['url_rewrite'], $row['page'], $row['id_lang'], array(), array(), $id_shop);
}
// Set default empty route if no empty route (that's weird I know)
@@ -439,7 +440,7 @@ class DispatcherCore
// Load custom routes
foreach ($this->default_routes as $route_id => $route_data)
if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id))
if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id, null, null, $id_shop))
foreach (Language::getLanguages() as $lang)
$this->addRoute(
$route_id,
@@ -447,7 +448,8 @@ class DispatcherCore
$route_data['controller'],
$lang['id_lang'],
$route_data['keywords'],
isset($route_data['params']) ? $route_data['params'] : array()
isset($route_data['params']) ? $route_data['params'] : array(),
$id_shop
);
}
}
@@ -458,11 +460,15 @@ class DispatcherCore
* @param string $rule Url rule
* @param string $controller Controller to call if request uri match the rule
* @param int $id_lang
* @param int $id_shop
*/
public function addRoute($route_id, $rule, $controller, $id_lang = null, array $keywords = array(), array $params = array())
public function addRoute($route_id, $rule, $controller, $id_lang = null, array $keywords = array(), array $params = array(), $id_shop = null)
{
if (is_null($id_lang))
$id_lang = Context::getContext()->language->id;
if ($id_lang === null)
$id_lang = (int)Context::getContext()->language->id;
if ($id_shop === null)
$id_shop = (int)Context::getContext()->shop->id;
$regexp = preg_quote($rule, '#');
if ($keywords)
@@ -497,10 +503,12 @@ class DispatcherCore
}
$regexp = '#^/'.$regexp.'(\?.*)?$#u';
if (!isset($this->routes[$id_lang]))
$this->routes[$id_lang] = array();
if (!isset($this->routes[$id_shop]))
$this->routes[$id_shop] = array();
if (!isset($this->routes[$id_shop][$id_lang]))
$this->routes[$id_shop][$id_lang] = array();
$this->routes[$id_lang][$route_id] = array(
$this->routes[$id_shop][$id_lang][$route_id] = array(
'rule' => $rule,
'regexp' => $regexp,
'controller' => $controller,
@@ -514,14 +522,17 @@ class DispatcherCore
*
* @param string $route_id
* @param int $id_lang
* @param int $id_shop
* @return bool
*/
public function hasRoute($route_id, $id_lang = null)
public function hasRoute($route_id, $id_lang = null, $id_shop = null)
{
if (is_null($id_lang))
$id_lang = Context::getContext()->language->id;
if ($id_lang === null)
$id_lang = (int)Context::getContext()->language->id;
if ($id_shop === null)
$id_shop = (int)Context::getContext()->shop->id;
return isset($this->routes[$id_lang]) && isset($this->routes[$id_lang][$route_id]);
return isset($this->routes[$id_shop]) && isset($this->routes[$id_shop][$id_lang]) && isset($this->routes[$id_shop][$id_lang][$route_id]);
}
/**
@@ -530,14 +541,21 @@ class DispatcherCore
* @param string $route_id
* @param int $id_lang
* @param string $keyword
* @param int $id_shop
* @return bool
*/
public function hasKeyword($route_id, $id_lang, $keyword)
public function hasKeyword($route_id, $id_lang, $keyword, $id_shop = null)
{
if (!isset($this->routes[$id_lang]) && !isset($this->routes[$id_lang][$route_id]))
if ($id_shop === null)
$id_shop = (int)Context::getContext()->shop->id;
if ($this->use_routes && !isset($this->routes[$id_shop]))
$this->loadRoutes($id_shop);
if (!isset($this->routes[$id_shop]) || !isset($this->routes[$id_shop][$id_lang]) || !isset($this->routes[$id_shop][$id_lang][$route_id]))
return false;
return preg_match('#\{([^{}]*:)?'.preg_quote($keyword, '#').'(:[^{}]*)?\}#', $this->routes[$id_lang][$route_id]['rule']);
return preg_match('#\{([^{}]*:)?'.preg_quote($keyword, '#').'(:[^{}]*)?\}#', $this->routes[$id_shop][$id_lang][$route_id]['rule']);
}
/**
@@ -569,18 +587,23 @@ class DispatcherCore
* @param bool $use_routes If false, don't use to create this url
* @param string $anchor Optional anchor to add at the end of this url
*/
public function createUrl($route_id, $id_lang = null, array $params = array(), $force_routes = false, $anchor = '')
public function createUrl($route_id, $id_lang = null, array $params = array(), $force_routes = false, $anchor = '', $id_shop = null)
{
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
if ($id_lang === null)
$id_lang = (int)Context::getContext()->language->id;
if ($id_shop === null)
$id_shop = (int)Context::getContext()->shop->id;
if (!isset($this->routes[$id_lang][$route_id]))
if ($this->use_routes && !isset($this->routes[$id_shop]))
$this->loadRoutes($id_shop);
if (!isset($this->routes[$id_shop][$id_lang][$route_id]))
{
$query = http_build_query($params, '', '&');
$index_link = $this->use_routes ? '' : 'index.php';
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '').$anchor;
}
$route = $this->routes[$id_lang][$route_id];
$route = $this->routes[$id_shop][$id_lang][$route_id];
// Check required fields
$query_params = isset($route['params']) ? $route['params'] : array();
foreach ($route['keywords'] as $key => $data)
@@ -646,7 +669,7 @@ class DispatcherCore
*
* @return string
*/
public function getController()
public function getController($id_shop = null)
{
if (defined('_PS_ADMIN_DIR_'))
$_GET['controllerUri'] = Tools::getvalue('controller');
@@ -655,7 +678,10 @@ class DispatcherCore
$_GET['controller'] = $this->controller;
return $this->controller;
}
if ($id_shop === null)
$id_shop = (int)Context::getContext()->shop->id;
$controller = Tools::getValue('controller');
if (isset($controller) && is_string($controller) && preg_match('/^([0-9a-z_-]+)\?(.*)=(.*)$/Ui', $controller, $m))
@@ -682,10 +708,10 @@ class DispatcherCore
{
// Add empty route as last route to prevent this greedy regexp to match request uri before right time
if ($this->empty_route)
$this->addRoute($this->empty_route['routeID'], $this->empty_route['rule'], $this->empty_route['controller'], Context::getContext()->language->id);
$this->addRoute($this->empty_route['routeID'], $this->empty_route['rule'], $this->empty_route['controller'], Context::getContext()->language->id, array(), array(), $id_shop);
if (isset($this->routes[Context::getContext()->language->id]))
foreach ($this->routes[Context::getContext()->language->id] as $route)
if (isset($this->routes[$id_shop][Context::getContext()->language->id]))
foreach ($this->routes[$id_shop][Context::getContext()->language->id] as $route)
if (preg_match($route['regexp'], $this->request_uri, $m))
{
// Route found ! Now fill $_GET with parameters of uri
@@ -771,4 +797,4 @@ class DispatcherCore
return $controllers;
}
}
}

View File

@@ -244,12 +244,15 @@ class EmployeeCore extends ObjectModel
*/
public function isLoggedBack()
{
/* Employee is valid only if it can be load and if cookie password is the same as database one */
return ($this->id
&& Validate::isUnsignedId($this->id)
&& Employee::checkPassword($this->id, $this->passwd)
&& (!isset($this->remote_addr) || $this->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP'))
);
if (!Cache::isStored('isLoggedBack'.$this->id))
{
/* Employee is valid only if it can be load and if cookie password is the same as database one */
Cache::store('isLoggedBack'.$this->id, (
$this->id && Validate::isUnsignedId($this->id) && Employee::checkPassword($this->id, Context::getContext()->cookie->passwd)
&& (!isset(Context::getContext()->cookie->remote_addr) || Context::getContext()->cookie->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP'))
));
}
return Cache::retrieve('isLoggedBack'.$this->id);
}
/**
@@ -258,7 +261,10 @@ class EmployeeCore extends ObjectModel
public function logout()
{
if (isset(Context::getContext()->cookie))
{
Context::getContext()->cookie->logout();
Context::getContext()->cookie->write();
}
$this->id = null;
}

View File

@@ -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 = '';

View File

@@ -216,13 +216,18 @@ class GroupReductionCore extends ObjectModel
FROM `'._DB_PREFIX_.'product_group_reduction_cache` pgr
WHERE pgr.`id_product` = '.(int)$id_product_old
);
if (!$res)
return true;
$query = '';
foreach ($res as $row)
{
$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'].')';
$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'].') ON DUPLICATE KEY UPDATE `reduction` = '.(float)$row['reduction'].';';
}
return Db::getInstance()->execute($query);
}

View File

@@ -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'),
),
);
@@ -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);
}
@@ -110,22 +110,30 @@ class HookCore extends ObjectModel
*/
public static function getIdByName($hook_name)
{
$hook_name = strtolower($hook_name);
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 `'._DB_PREFIX_.'hook_alias` ha
INNER JOIN `'._DB_PREFIX_.'hook` h ON ha.name = h.name');
foreach ($result as $row)
$hook_ids[strtolower($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);
}
/**
@@ -140,9 +148,23 @@ class HookCore extends ObjectModel
FROM `'._DB_PREFIX_.'hook`
WHERE `id_hook` = '.(int)$hook_id)
);
return Cache::retrieve($cache_id);
}
/**
* Return hook live edit bool from ID
*/
public static function getLiveEditById($hook_id)
{
$cache_id = 'hook_live_editbyid_'.$hook_id;
if (!Cache::isStored($cache_id))
Cache::store($cache_id, Db::getInstance()->getValue('
SELECT `live_edit`
FROM `'._DB_PREFIX_.'hook`
WHERE `id_hook` = '.(int)$hook_id)
);
return Cache::retrieve($cache_id);
}
/**
* Get list of hook alias
@@ -308,15 +330,9 @@ class HookCore extends ObjectModel
$sql->orderBy('hm.`position`');
// Store results per hook name
$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
$list = array();
// Get all available payment module
$payment_modules = array();
if ($results)
foreach ($results as $row)
if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql))
foreach ($result as $row)
{
$row['hook'] = strtolower($row['hook']);
if (!isset($list[$row['hook']]))
@@ -346,14 +362,17 @@ class HookCore extends ObjectModel
$hook_name = strtolower($hook_name);
$return = array();
$inserted_modules = array();
if (isset($list[$hook_name]))
$return = $list[$hook_name];
foreach ($return as $module)
$inserted_modules[] = $module['id_module'];
if (isset($list[$retro_hook_name]))
$return = array_merge($return, $list[$retro_hook_name]);
foreach ($list[$retro_hook_name] as $retro_module_call)
if (!in_array($retro_module_call['id_module'], $inserted_modules))
$return[] = $retro_module_call;
if (count($return) > 0)
return $return;
return false;
return (count($return) > 0 ? $return : false);
}
else
return $list;
@@ -397,6 +416,7 @@ class HookCore extends ObjectModel
// Look on modules list
$altern = 0;
$output = '';
foreach ($module_list as $array)
{
// Check errors
@@ -410,7 +430,7 @@ class HookCore extends ObjectModel
{
$exceptions = $moduleInstance->getExceptions($array['id_hook']);
$controller = Dispatcher::getInstance()->getController();
if (in_array($controller, $exceptions))
continue;
@@ -418,7 +438,7 @@ class HookCore extends ObjectModel
$matching_name = array(
'authentication' => 'auth',
'compare' => 'products-comparison',
);
);
if (isset($matching_name[$controller]) && in_array($matching_name[$controller], $exceptions))
continue;
if (Validate::isLoadedObject($context->employee) && !$moduleInstance->getPermission('view', $context->employee))
@@ -452,7 +472,7 @@ class HookCore extends ObjectModel
if ($array_return)
return $output;
else
return ($live_edit ? '<script type="text/javascript">hooks_list.push(\''.$hook_name.'\'); </script>
return ($live_edit ? '<script type="text/javascript">hooks_list.push(\''.$hook_name.'\');</script>
<div id="'.$hook_name.'" class="dndHook" style="min-height:50px">' : '').$output.($live_edit ? '</div>' : '');// Return html string
}
@@ -461,13 +481,13 @@ class HookCore extends ObjectModel
return '<script type="text/javascript"> modules_list.push(\''.Tools::safeOutput($moduleInstance->name).'\');</script>
<div id="hook_'.(int)$id_hook.'_module_'.(int)$moduleInstance->id.'_moduleName_'.str_replace('_', '-', Tools::safeOutput($moduleInstance->name)).'"
class="dndModule" style="border: 1px dotted red;'.(!strlen($display) ? 'height:50px;' : '').'">
<span style="font-family: Georgia;font-size:13px;font-style:italic;">
<img style="padding-right:5px;" src="'._MODULE_DIR_.Tools::safeOutput($moduleInstance->name).'/logo.gif">'
<span style="font-family: Georgia;font-size:13px;font-style:italic;">
<img style="padding-right:5px;" src="'._MODULE_DIR_.Tools::safeOutput($moduleInstance->name).'/logo.gif">'
.Tools::safeOutput($moduleInstance->displayName).'<span style="float:right">
<a href="#" id="'.(int)$id_hook.'_'.(int)$moduleInstance->id.'" class="moveModule">
<img src="'._PS_ADMIN_IMG_.'arrow_out.png"></a>
<a href="#" id="'.(int)$id_hook.'_'.(int)$moduleInstance->id.'" class="unregisterHook">
<img src="'._PS_ADMIN_IMG_.'delete.gif"></span></a>
<img src="'._PS_ADMIN_IMG_.'delete.gif"></a></span>
</span>'.$display.'</div>';
}

View File

@@ -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;
}

View File

@@ -70,7 +70,7 @@ class LanguageCore extends ObjectModel
/** @var array Languages cache */
protected static $_checkedLangs;
protected static $_LANGUAGES;
protected static $countActiveLanguages;
protected static $countActiveLanguages = array();
protected $webserviceParameters = array(
'objectNodeName' => 'language',
@@ -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;
@@ -704,10 +704,8 @@ class LanguageCore extends ObjectModel
$lang->name = $lang_pack->name;
}
elseif ($params_lang !== null && is_array($params_lang))
{
foreach ($params_lang as $key => $value)
$lang->$key = $value;
}
else
return false;
@@ -764,15 +762,18 @@ class LanguageCore extends ObjectModel
return (isset(self::$_cache_language_installation[$iso_code]) ? self::$_cache_language_installation[$iso_code] : false);
}
public static function countActiveLanguages()
public static function countActiveLanguages($id_shop = null)
{
if (!self::$countActiveLanguages)
self::$countActiveLanguages = Db::getInstance()->getValue('
if ($id_shop === null)
$id_shop = (int)Context::getContext()->shop->id;
if (!isset(self::$countActiveLanguages[$id_shop]))
self::$countActiveLanguages[$id_shop] = Db::getInstance()->getValue('
SELECT COUNT(DISTINCT l.id_lang) FROM `'._DB_PREFIX_.'lang` l
'.Shop::addSqlAssociation('lang', 'l').'
JOIN '._DB_PREFIX_.'lang_shop lang_shop ON (lang_shop.id_lang = l.id_lang AND lang_shop.id_shop = '.(int)$id_shop.')
WHERE l.`active` = 1
');
return self::$countActiveLanguages;
return self::$countActiveLanguages[$id_shop];
}
public static function downloadAndInstallLanguagePack($iso, $version = null, $params = null)
@@ -827,8 +828,8 @@ class LanguageCore extends ObjectModel
* @since 1.5.0
* @return bool
*/
public static function isMultiLanguageActivated()
public static function isMultiLanguageActivated($id_shop = null)
{
return (Language::countActiveLanguages() > 1);
return (Language::countActiveLanguages($id_shop) > 1);
}
}

View File

@@ -91,19 +91,19 @@ class LinkCore
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
if (!$id_shop)
$shop = Context::getContext()->shop;
else
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null)
$shop = new Shop($id_shop);
else
$shop = Context::getContext()->shop;
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang);
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
if (!is_object($product))
{
if (is_array($product) && isset($product['id_product']))
$product = new Product($product['id_product'], false, $id_lang);
else if (is_numeric($product) || !$product)
$product = new Product($product, false, $id_lang);
$product = new Product($product['id_product'], false, $id_lang, $id_shop);
elseif ((int)$product)
$product = new Product((int)$product, false, $id_lang, $id_shop);
else
throw new PrestaShopException('Invalid product vars');
}
@@ -112,29 +112,30 @@ class LinkCore
$params = array();
$params['id'] = $product->id;
$params['rewrite'] = (!$alias) ? $product->getFieldByLang('link_rewrite') : $alias;
$params['ean13'] = (!$ean13) ? $product->ean13 : $ean13;
$params['meta_keywords'] = Tools::str2url($product->getFieldByLang('meta_keywords'));
$params['meta_title'] = Tools::str2url($product->getFieldByLang('meta_title'));
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'manufacturer'))
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'manufacturer', $id_shop))
$params['manufacturer'] = Tools::str2url($product->isFullyLoaded ? $product->manufacturer_name : Manufacturer::getNameById($product->id_manufacturer));
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'supplier'))
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'supplier', $id_shop))
$params['supplier'] = Tools::str2url($product->isFullyLoaded ? $product->supplier_name : Supplier::getNameById($product->id_supplier));
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'price'))
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'price', $id_shop))
$params['price'] = $product->isFullyLoaded ? $product->price : Product::getPriceStatic($product->id, false, null, 6, null, false, true, 1, false, null, null, null, $product->specificPrice);
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags'))
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags', $id_shop))
$params['tags'] = Tools::str2url($product->getTags($id_lang));
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'category'))
$params['category'] = !is_null($product->category) ? Tools::str2url($product->category) : Tools::str2url($category);
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'category', $id_shop))
$params['category'] = (!is_null($product->category) && !empty($product->category)) ? Tools::str2url($product->category) : Tools::str2url($category);
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference'))
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference', $id_shop))
$params['reference'] = Tools::str2url($product->reference);
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories'))
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories', $id_shop))
{
$params['category'] = (!$category) ? $product->category : $category;
$cats = array();
@@ -145,7 +146,7 @@ class LinkCore
}
$anchor = $ipa ? $product->getAnchor($ipa) : '';
return $url.$dispatcher->createUrl('product_rule', $id_lang, $params, $force_routes, $anchor);
return $url.$dispatcher->createUrl('product_rule', $id_lang, $params, $force_routes, $anchor, $id_shop);
}
/**
@@ -157,11 +158,16 @@ class LinkCore
* @param string $selected_filters Url parameter to autocheck filters of the module blocklayered
* @return string
*/
public function getCategoryLink($category, $alias = null, $id_lang = null, $selected_filters = null)
public function getCategoryLink($category, $alias = null, $id_lang = null, $selected_filters = null, $id_shop = null)
{
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang);
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
if (!is_object($category))
$category = new Category($category, $id_lang);
@@ -184,7 +190,7 @@ class LinkCore
$params['selected_filters'] = $selected_filters;
}
return $url.Dispatcher::getInstance()->createUrl($rule, $id_lang, $params, $this->allow);
return $url.Dispatcher::getInstance()->createUrl($rule, $id_lang, $params, $this->allow, '', $id_shop);
}
/**
@@ -195,24 +201,33 @@ class LinkCore
* @param int $id_lang
* @return string
*/
public function getCMSCategoryLink($category, $alias = null, $id_lang = null)
public function getCMSCategoryLink($cms_category, $alias = null, $id_lang = null, $id_shop = null)
{
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang);
if (!is_object($category))
$category = new CMSCategory($category, $id_lang);
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
$dispatcher = Dispatcher::getInstance();
if (!is_object($cms_category))
{
if ($alias !== null && !$dispatcher->hasKeyword('cms_category_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('cms_category_rule', $id_lang, 'meta_title', $id_shop))
return $url.$dispatcher->createUrl('cms_category_rule', $id_lang, array('id' => (int)$cms_category, 'rewrite' => (string)$alias), $this->allow, '', $id_shop);
$cms_category = new CMSCategory($cms_category, $id_lang);
}
// Set available keywords
$params = array();
$params['id'] = $category->id;
$params['rewrite'] = (!$alias) ? $category->link_rewrite : $alias;
$params['meta_keywords'] = Tools::str2url($category->meta_keywords);
$params['meta_title'] = Tools::str2url($category->meta_title);
$params['id'] = $cms_category->id;
$params['rewrite'] = (!$alias) ? $cms_category->link_rewrite : $alias;
$params['meta_keywords'] = Tools::str2url($cms_category->meta_keywords);
$params['meta_title'] = Tools::str2url($cms_category->meta_title);
return $url.Dispatcher::getInstance()->createUrl('cms_category_rule', $id_lang, $params, $this->allow);
return $url.$dispatcher->createUrl('cms_category_rule', $id_lang, $params, $this->allow, '', $id_shop);
}
/**
@@ -224,33 +239,42 @@ class LinkCore
* @param int $id_lang
* @return string
*/
public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = null)
public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = null, $id_shop = null)
{
$base = (($ssl && $this->ssl_enable) ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_);
$base = (($ssl && $this->ssl_enable) ? 'https://' : 'http://');
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$url = $base.__PS_BASE_URI__.$this->getLangLink($id_lang);
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$url = $base.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
$dispatcher = Dispatcher::getInstance();
if (!is_object($cms))
{
if ($alias !== null && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_title', $id_shop))
return $url.$dispatcher->createUrl('cms_rule', $id_lang, array('id' => (int)$cms, 'rewrite' => (string)$alias), $this->allow, '', $id_shop);
$cms = new CMS($cms, $id_lang);
}
// Set available keywords
$params = array();
$params['id'] = $cms->id;
$params['rewrite'] = (!$alias) ? (is_array($cms->link_rewrite) ? $cms->link_rewrite[(int)$id_lang] : $cms->link_rewrite) : $alias;
$params['meta_keywords'] = '';
if (isset($cms->meta_keywords) && !empty($cms->meta_keywords))
$params['meta_keywords'] = is_array($cms->meta_keywords) ? Tools::str2url($cms->meta_keywords[(int)$id_lang]) : Tools::str2url($cms->meta_keywords);
else
$params['meta_keywords'] = '';
$params['meta_title'] = '';
if (isset($cms->meta_title) && !empty($cms->meta_title))
$params['meta_title'] = is_array($cms->meta_title) ? Tools::str2url($cms->meta_title[(int)$id_lang]) : Tools::str2url($cms->meta_title);
else
$params['meta_title'] = '';
return $url.Dispatcher::getInstance()->createUrl('cms_rule', $id_lang, $params, $this->allow);
return $url.$dispatcher->createUrl('cms_rule', $id_lang, $params, $this->allow, '', $id_shop);
}
/**
@@ -261,14 +285,24 @@ class LinkCore
* @param int $id_lang
* @return string
*/
public function getSupplierLink($supplier, $alias = null, $id_lang = null)
public function getSupplierLink($supplier, $alias = null, $id_lang = null, $id_shop = null)
{
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang);
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
$dispatcher = Dispatcher::getInstance();
if (!is_object($supplier))
{
if ($alias !== null && !$dispatcher->hasKeyword('supplier_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('supplier_rule', $id_lang, 'meta_title', $id_shop))
return $url.$dispatcher->createUrl('supplier_rule', $id_lang, array('id' => (int)$supplier, 'rewrite' => (string)$alias), $this->allow, '', $id_shop);
$supplier = new Supplier($supplier, $id_lang);
}
// Set available keywords
$params = array();
@@ -277,7 +311,7 @@ class LinkCore
$params['meta_keywords'] = Tools::str2url($supplier->meta_keywords);
$params['meta_title'] = Tools::str2url($supplier->meta_title);
return $url.Dispatcher::getInstance()->createUrl('supplier_rule', $id_lang, $params, $this->allow);
return $url.$dispatcher->createUrl('supplier_rule', $id_lang, $params, $this->allow, '', $id_shop);
}
/**
@@ -288,14 +322,24 @@ class LinkCore
* @param int $id_lang
* @return string
*/
public function getManufacturerLink($manufacturer, $alias = null, $id_lang = null)
public function getManufacturerLink($manufacturer, $alias = null, $id_lang = null, $id_shop = null)
{
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang);
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
$dispatcher = Dispatcher::getInstance();
if (!is_object($manufacturer))
{
if ($alias !== null && !$dispatcher->hasKeyword('manufacturer_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('manufacturer_rule', $id_lang, 'meta_title', $id_shop))
return $url.$dispatcher->createUrl('manufacturer_rule', $id_lang, array('id' => (int)$manufacturer, 'rewrite' => (string)$alias), $this->allow, '', $id_shop);
$manufacturer = new Manufacturer($manufacturer, $id_lang);
}
// Set available keywords
$params = array();
@@ -304,7 +348,7 @@ class LinkCore
$params['meta_keywords'] = Tools::str2url($manufacturer->meta_keywords);
$params['meta_title'] = Tools::str2url($manufacturer->meta_title);
return $url.Dispatcher::getInstance()->createUrl('manufacturer_rule', $id_lang, $params, $this->allow);
return $url.$dispatcher->createUrl('manufacturer_rule', $id_lang, $params, $this->allow, '', $id_shop);
}
/**
@@ -316,23 +360,29 @@ class LinkCore
* @param int $id_lang
* @return string
*/
public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = false, $id_lang = null)
public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = false, $id_lang = null, $id_shop = null)
{
$base = (($ssl && $this->ssl_enable) ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_);
$base = (($ssl && $this->ssl_enable) ? 'https://' : 'http://');
if (!$id_lang)
$id_lang = Context::getContext()->language->id;
$url = $base.__PS_BASE_URI__.$this->getLangLink($id_lang);
// Set available keywords
$params['module'] = $module;
$params['controller'] = $controller ? $controller : 'default';
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$url = $base.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
// If the module has its own route ... just use it !
if (Dispatcher::getInstance()->hasRoute('module-'.$module.'-'.$controller, $id_lang))
if (Dispatcher::getInstance()->hasRoute('module-'.$module.'-'.$controller, $id_lang, $id_shop))
return $this->getPageLink('module-'.$module.'-'.$controller, $ssl, $id_lang, $params);
else
return $url.Dispatcher::getInstance()->createUrl('module', $id_lang, $params, $this->allow);
{
// Set available keywords
$params['module'] = $module;
$params['controller'] = $controller ? $controller : 'default';
return $url.Dispatcher::getInstance()->createUrl('module', $id_lang, $params, $this->allow, '', $id_shop);
}
}
/**
@@ -403,7 +453,7 @@ class LinkCore
*
* @return string Page link
*/
public function getPageLink($controller, $ssl = false, $id_lang = null, $request = null, $request_url_encode = false)
public function getPageLink($controller, $ssl = false, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null)
{
$controller = Tools::strReplaceFirst('.php', '', $controller);
@@ -419,16 +469,24 @@ class LinkCore
parse_str($request, $request);
}
$uri_path = Dispatcher::getInstance()->createUrl($controller, $id_lang, $request);
$url = ($ssl && $this->ssl_enable) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true);
$url .= __PS_BASE_URI__.$this->getLangLink($id_lang).ltrim($uri_path, '/');
if ($id_shop === null)
$shop = Context::getContext()->shop;
else
$shop = new Shop($id_shop);
$uri_path = Dispatcher::getInstance()->createUrl($controller, $id_lang, $request, false, '', $id_shop);
$url = ($ssl && $this->ssl_enable) ? 'https://' : 'http://';
$url .= $shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop).ltrim($uri_path, '/');
return $url;
}
public function getCatImageLink($name, $id_category, $type = null)
{
$uri_path = ($this->allow == 1) ? (__PS_BASE_URI__.'c/'.$id_category.($type ? '-'.$type : '').'/'.$name.'.jpg') : (_THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg');
if($this->allow == 1 && $type)
$uri_path = __PS_BASE_URI__.'c/'.$id_category.'-'.$type.'/'.$name.'.jpg';
else
$uri_path = _THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg';
return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path;
}
@@ -452,6 +510,7 @@ class LinkCore
unset($params['id_lang']);
$controller = Dispatcher::getInstance()->getController();
if (!empty(Context::getContext()->controller->php_self))
$controller = Context::getContext()->controller->php_self;
@@ -467,6 +526,15 @@ class LinkCore
return $this->getCMSLink((int)$params['id_cms'], null, false, (int)$id_lang);
elseif ($controller == 'cms' && isset($params['id_cms_category']))
return $this->getCMSCategoryLink((int)$params['id_cms_category'], null, (int)$id_lang);
elseif (isset($params['fc']) && $params['fc'] == 'module')
{
$module = Validate::isModuleName(Tools::getValue('module')) ? Tools::getValue('module') : '';
if (!empty($module))
{
unset($params['fc'], $params['module']);
return $this->getModuleLink($module, $controller, $params, false, (int)$id_lang);
}
}
return $this->getPageLink($controller, false, $id_lang, $params);
}
@@ -561,12 +629,12 @@ class LinkCore
return $url.(!strstr($url, '?') ? '?' : '&').'orderby='.urlencode($orderby).'&orderway='.urlencode($orderway);
}
protected function getLangLink($id_lang = null, Context $context = null)
protected function getLangLink($id_lang = null, Context $context = null, $id_shop = null)
{
if (!$context)
$context = Context::getContext();
if (!$this->allow || !Language::isMultiLanguageActivated())
if ((!$this->allow && in_array($id_shop, array($context->shop->id, null))) || !Language::isMultiLanguageActivated($id_shop) || !(int)Configuration::get('PS_REWRITING_SETTINGS', null, null, $id_shop))
return '';
if (!$id_lang)

View File

@@ -70,8 +70,16 @@ class LocalizationPackCore
return $res;
}
foreach ($selection as $selected)
if (!Validate::isLocalizationPackSelection($selected) || !$this->{'_install'.ucfirst($selected)}($xml))
return false;
if (strtolower((string)$selected) == 'currencies')
{
if (!Validate::isLocalizationPackSelection($selected) || !$this->{'_install'.ucfirst($selected)}($xml, true))
return false;
}
else
{
if (!Validate::isLocalizationPackSelection($selected) || !$this->{'_install'.ucfirst($selected)}($xml))
return false;
}
return true;
}
@@ -239,8 +247,6 @@ class LocalizationPackCore
{
if (isset($xml->currencies->currency))
{
foreach ($xml->currencies->currency as $data)
{
$attributes = $data->attributes();

View File

@@ -43,6 +43,9 @@ class LoggerCore extends ObjectModel
/** @var integer Object ID */
public $object_id;
/** @var integer Object ID */
public $id_employee;
/** @var string Object creation date */
public $date_add;
@@ -61,6 +64,7 @@ class LoggerCore extends ObjectModel
'error_code' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'required' => true),
'object_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'object_type' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
@@ -98,7 +102,7 @@ class LoggerCore extends ObjectModel
* @param boolean $allow_duplicate if set to true, can log several time the same information (not recommended)
* @return boolean true if succeed
*/
public static function addLog($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false)
public static function addLog($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false, $id_employee = null)
{
$log = new Logger();
$log->severity = intval($severity);
@@ -106,6 +110,13 @@ class LoggerCore extends ObjectModel
$log->message = pSQL($message);
$log->date_add = date('Y-m-d H:i:s');
$log->date_upd = date('Y-m-d H:i:s');
if ($id_employee === null && isset(Context::getContext()->employee) && Validate::isLoadedObject(Context::getContext()->employee))
$id_employee = Context::getContext()->employee->id;
if ($id_employee !== null)
$log->id_employee = (int)$id_employee;
if (!empty($object_type) && !empty($object_id))
{
$log->object_type = pSQL($object_type);

View File

@@ -249,6 +249,9 @@ class MailCore
if (isset($logo))
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));
if ((Context::getContext()->link instanceof Link) === false)
Context::getContext()->link = new Link();
$template_vars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop));
$template_vars['{shop_url}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id);
$template_vars['{my_account_url}'] = Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id);

View File

@@ -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'),
@@ -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 product_shop.`visibility` NOT IN ("none")'.
($all_group ? '' : ' AND p.`id_product` IN (
SELECT cp.`id_product`
FROM `'._DB_PREFIX_.'category_group` cg

View File

@@ -1,6 +1,6 @@
<?php
/*
* 2007-2012 PrestaShop
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
@@ -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)
@@ -110,7 +111,8 @@ class MediaCore
// In this case, we don't compress the content
if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR)
{
error_log('ERROR: PREG_BACKTRACK_LIMIT_ERROR in function packJSinHTML');
if (_PS_MODE_DEV_)
error_log('ERROR: PREG_BACKTRACK_LIMIT_ERROR in function packJSinHTML');
return $html_content_copy;
}
return $html_content;
@@ -223,7 +225,7 @@ class MediaCore
$url_data = parse_url($css_uri);
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
// check if css files exists
if (!@filemtime($file_uri))
if (!@filemtime($file_uri) && !array_key_exists('host', $url_data))
return false;
if (Context::getContext()->controller->controller_type == 'admin')
@@ -269,7 +271,10 @@ class MediaCore
if ($add_no_conflict)
$return[] = Media::getJSPath(_PS_JS_DIR_.'jquery/jquery.noConflict.php?version='.$version);
//added query migrate for compatibility with new version of jquery will be removed in ps 1.6
$return[] = Media::getJSPath(_PS_JS_DIR_.'jquery/jquery-migrate-1.2.1.js');
return $return;
}
@@ -385,6 +390,7 @@ class MediaCore
{
//inits
$css_files_by_media = array();
$external_css_files = array();
$compressed_css_files = array();
$compressed_css_files_not_found = array();
$compressed_css_files_infos = array();
@@ -399,6 +405,13 @@ class MediaCore
$infos = array();
$infos['uri'] = $filename;
$url_data = parse_url($filename);
if(array_key_exists('host', $url_data))
{
$external_css_files[$filename] = $media;
continue;
}
$infos['path'] = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, '/', $url_data['path']);
$css_files_by_media[$media]['files'][] = $infos;
if (!array_key_exists('date', $css_files_by_media[$media]))
@@ -460,7 +473,7 @@ class MediaCore
$url = str_replace(_PS_THEME_DIR_, _THEMES_DIR_._THEME_NAME_.'/', $filename);
$css_files[$protocol_link.Tools::getMediaServer($url).$url] = $media;
}
return $css_files;
return array_merge($external_css_files, $css_files);
}
public static function getBackTrackLimit()

View File

@@ -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();
}
}
/**
@@ -545,28 +535,28 @@ abstract class ObjectModelCore
return false;
$object_id = Db::getInstance()->Insert_ID();
if (isset($definition['multilang']) && $definition['multilang'])
{
$res = Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.bqSQL($definition['table']).'_lang`
WHERE `'.bqSQL($definition['primary']).'` = '.(int)$this->id
);
if (!$res)
$result = Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.bqSQL($definition['table']).'_lang`
WHERE `'.bqSQL($definition['primary']).'` = '.(int)$this->id);
if (!$result)
return false;
foreach ($res as $field => &$value)
if (isset($definition['fields'][$field]))
$value = ObjectModel::formatValue($value, $definition['fields'][$field]['type']);
foreach ($res as $row)
foreach ($result as &$row)
foreach ($row as $field => &$value)
if (isset($definition['fields'][$field]))
$value = ObjectModel::formatValue($value, $definition['fields'][$field]['type']);
// Keep $row2, you cannot use $row because there is an unexplicated conflict with the previous usage of this variable
foreach ($result as $row2)
{
$row[$definition['primary']] = (int)$object_id;
if (!Db::getInstance()->insert($definition['table'].'_lang', $row))
$row2[$definition['primary']] = (int)$object_id;
if (!Db::getInstance()->insert($definition['table'].'_lang', $row2))
return false;
}
}
}
$object_duplicated = new $definition['classname']((int)$object_id);
@@ -763,6 +753,9 @@ abstract class ObjectModelCore
if (!array_key_exists('active', $this))
throw new PrestaShopException('property "active" is missing in object '.get_class($this));
// Update only active field
$this->setFieldsToUpdate(array('active' => true));
// Update active status on object
$this->active = !(int)$this->active;
@@ -864,8 +857,12 @@ abstract class ObjectModelCore
continue;
$values = $this->$field;
// If the object has not been loaded in multilanguage, then the value is the one for the current language of the object
if (!is_array($values))
$values = array($this->id_lang => $values);
// The value for the default must always be set, so we put an empty string if it does not exists
if (!isset($values[Configuration::get('PS_LANG_DEFAULT')]))
$values[Configuration::get('PS_LANG_DEFAULT')] = '';
@@ -898,6 +895,7 @@ abstract class ObjectModelCore
*/
public function validateField($field, $value, $id_lang = null)
{
$this->cacheFieldsRequiredDatabase();
$data = $this->def['fields'][$field];
// Check if field is required
@@ -936,8 +934,22 @@ 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')
{
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;
@@ -966,21 +978,23 @@ 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)
{
$value = Tools::getValue($field, $this->{$field});
// Check if field is required by user
if (in_array($field, $required_fields_database))
$data['required'] = true;
// Checking for required fields
if (isset($data['required']) && $data['required'] && ($value = Tools::getValue($field, $this->{$field})) == false && (string)$value != '0')
if (isset($data['required']) && $data['required'] && empty($value) && $value !== '0')
if (!$this->id || $field != 'passwd')
$errors[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is required.');
// Checking for maximum fields sizes
if (isset($data['size']) && ($value = Tools::getValue($field, $this->{$field})) && Tools::strlen($value) > $data['size'])
if (isset($data['size']) && !empty($value) && Tools::strlen($value) > $data['size'])
$errors[$field] = sprintf(
Tools::displayError('%1$s is too long. Maximum length: %2$d'),
self::displayFieldName($field, get_class($this), $htmlentities),
@@ -989,7 +1003,7 @@ abstract class ObjectModelCore
// Checking for fields validity
// Hack for postcode required for country which does not have postcodes
if (($value = Tools::getValue($field, $this->{$field})) || ($field == 'postcode' && $value == '0'))
if (!empty($value) || $value === '0' || ($field == 'postcode' && $value == '0'))
{
if (isset($data['validate']) && !Validate::$data['validate']($value) && (!empty($value) || $data['required']))
$errors[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
@@ -1012,6 +1026,7 @@ abstract class ObjectModelCore
public function getWebserviceParameters($ws_params_attribute_name = null)
{
$this->cacheFieldsRequiredDatabase();
$default_resource_parameters = array(
'objectSqlId' => $this->def['primary'],
'retrieveData' => array(
@@ -1122,6 +1137,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();
@@ -1149,6 +1165,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)
{
@@ -1298,7 +1327,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();
@@ -1318,8 +1347,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);
}

View File

@@ -348,7 +348,8 @@ abstract class PaymentModuleCore extends Module
// Construct order detail table for the email
$products_list = '';
$virtual_product = true;
foreach ($products as $key => $product)
foreach ($order->product_list as $key => $product)
{
$price = Product::getPriceStatic((int)$product['id_product'], false, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
$price_wt = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
@@ -386,7 +387,7 @@ abstract class PaymentModuleCore extends Module
'<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';">
<td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td>
<td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td>
<td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td>
<td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod((int)$this->context->customer->id) == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td>
<td style="padding: 0.6em 0.4em; width: 15%;">'.((int)$product['cart_quantity'] - $customization_quantity).'</td>
<td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td>
</tr>';
@@ -431,9 +432,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;
@@ -604,7 +605,8 @@ abstract class PaymentModuleCore extends Module
'{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $this->context->currency, false),
'{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false));
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false),
'{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $this->context->currency, false));
if (is_array($extra_vars))
$data = array_merge($data, $extra_vars);

View File

@@ -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),
),
@@ -347,7 +347,7 @@ class ProductCore extends ObjectModel
),
'id_tax_rules_group' => array(
'xlink_resource' => array(
'resourceName' => 'tax_rules_group'
'resourceName' => 'tax_rule_groups'
)
),
'position_in_category' => array(
@@ -364,7 +364,7 @@ class ProductCore extends ObjectModel
),
'type' => array(
'getter' => 'getWsType',
'setter' => false,
'setter' => 'setWsType',
),
),
'associations' => array(
@@ -668,6 +668,45 @@ class ProductCore extends ObjectModel
return false;
}
/**
* For a given id_product and id_product_attribute, return available date
*
* @param int $id_product
* @param int $id_product_attribute Optional
* @return string/null
*/
public static function getAvailableDate($id_product, $id_product_attribute = null)
{
$sql = 'SELECT';
if ($id_product_attribute === null)
$sql .= ' p.`available_date`';
else
$sql .= ' IF(pa.`available_date` = "0000-00-00", p.`available_date`, pa.`available_date`) AS available_date';
$sql .= ' FROM `'._DB_PREFIX_.'product` p';
if ($id_product_attribute !== null)
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.`id_product` = p.`id_product`)';
$sql .= Shop::addSqlAssociation('product', 'p');
if ($id_product_attribute !== null)
$sql .= Shop::addSqlAssociation('product_attribute', 'pa');
$sql .= ' WHERE p.`id_product` = '.(int)$id_product;
if ($id_product_attribute !== null)
$sql .= ' AND pa.`id_product` = '.(int)$id_product.' AND pa.`id_product_attribute` = '.(int)$id_product_attribute;
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
if ($result == '0000-00-00')
$result = null;
return $result;
}
public static function updateIsVirtual($id_product)
{
Db::getInstance()->update('product', array(
@@ -868,12 +907,13 @@ class ProductCore extends ObjectModel
AND cp.id_product = '.$this->id
);
foreach ($result as $categ_to_delete)
$this->deleteCategory($categ_to_delete['id_category']);
// if none are found, it's an error
if (!is_array($result))
return false;
foreach ($result as $categ_to_delete)
$this->deleteCategory($categ_to_delete['id_category']);
if (!$this->addToCategories($categories))
return false;
@@ -1299,7 +1339,7 @@ class ProductCore extends ObjectModel
}
/**
* Sets Supplier Reference
* Sets or updates Supplier Reference
*
* @param int $id_supplier
* @param int $id_product_attribute
@@ -1312,30 +1352,25 @@ class ProductCore extends ObjectModel
//in some case we need to add price without supplier reference
if ($supplier_reference === null)
$supplier_reference = '';
//Try to set the default supplier reference
if ($id_supplier > 0)
if (($id_supplier > 0) && ($this->id > 0))
{
$id_product_supplier = (int)ProductSupplier::getIdByProductAndSupplier($this->id, $id_product_attribute, $id_supplier);
$product_supplier = new ProductSupplier($id_product_supplier);
if (!$id_product_supplier)
{
//create new record
$product_supplier_entity = new ProductSupplier();
$product_supplier_entity->id_product = (int)$this->id;
$product_supplier_entity->id_product_attribute = (int)$id_product_attribute;
$product_supplier_entity->id_supplier = (int)$id_supplier;
$product_supplier_entity->product_supplier_reference = pSQL($supplier_reference);
$product_supplier_entity->product_supplier_price_te = (int)$price;
$product_supplier_entity->id_currency = (int)$id_currency;
$product_supplier_entity->save();
}
else
{
$product_supplier = new ProductSupplier((int)$id_product_supplier);
$product_supplier->product_supplier_reference = pSQL($supplier_reference);
$product_supplier->update();
$product_supplier->id_product = (int)$this->id;
$product_supplier->id_product_attribute = (int)$id_product_attribute;
$product_supplier->id_supplier = (int)$id_supplier;
}
$product_supplier->product_supplier_reference = pSQL($supplier_reference);
$product_supplier->product_supplier_price_te = (float)$price;
$product_supplier->id_currency = (int)$id_currency;
$product_supplier->save();
}
}
@@ -1977,13 +2012,7 @@ class ProductCore extends ObjectModel
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
WHERE product_shop.`active` = 1
AND DATEDIFF(
product_shop.`date_add`,
DATE_SUB(
NOW(),
INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY
)
) > 0
AND product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'"
'.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '').'
AND p.`id_product` IN (
SELECT cp.`id_product`
@@ -1998,13 +2027,7 @@ class ProductCore extends ObjectModel
$sql->select(
'p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`,
pl.`meta_keywords`, pl.`meta_title`, pl.`name`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` AS manufacturer_name,
DATEDIFF(
product_shop.`date_add`,
DATE_SUB(
NOW(),
INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY
)
) > 0 AS new'
product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'" as new'
);
$sql->from('product', 'p');
@@ -2019,25 +2042,15 @@ class ProductCore extends ObjectModel
$sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`');
$sql->where('product_shop.`active` = 1');
if ($front)
$sql->where('product_shop.`visibility` IN ("both", "catalog")');
$sql->where('
DATEDIFF(
product_shop.`date_add`,
DATE_SUB(
NOW(),
INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY
)
) > 0'
);
$sql->where('product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'"');
$sql->where('p.`id_product` IN (
SELECT cp.`id_product`
FROM `'._DB_PREFIX_.'category_group` cg
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
WHERE cg.`id_group` '.$sql_groups.')'
);
WHERE cg.`id_group` '.$sql_groups.'
)');
$sql->groupBy('product_shop.id_product');
$sql->orderBy((isset($order_by_prefix) ? pSQL($order_by_prefix).'.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way));
@@ -2371,8 +2384,14 @@ class ProductCore extends ObjectModel
WHERE id_product = '.(int)$this->id.'
AND id_shop = '.(int)$this->id_shop
);
if (count($data))
Db::getInstance()->insert('product_carrier', $data);
$uniqueArray = array();
foreach($data as $subArray)
if(!in_array($subArray, $uniqueArray))
$uniqueArray[] = $subArray;
if (count($uniqueArray))
Db::getInstance()->insert('product_carrier', $uniqueArray, false, true, Db::INSERT_IGNORE);
}
/**
@@ -2699,8 +2718,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) && (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);
}
@@ -3794,15 +3815,14 @@ class ProductCore extends ObjectModel
isset($row['cache_is_pack']) ? $row['cache_is_pack'] : null
);
$row['quantity_all_versions'] = $row['quantity'];
if ($row['id_product_attribute'])
{
$row['quantity_all_versions'] = $row['quantity'];
$row['quantity'] = Product::getQuantity(
(int)$row['id_product'],
$row['id_product_attribute'],
isset($row['cache_is_pack']) ? $row['cache_is_pack'] : null
);
}
$row['id_image'] = Product::defineProductImage($row, $id_lang);
$row['features'] = Product::getFrontFeaturesStatic((int)$id_lang, $row['id_product']);
@@ -4473,7 +4493,7 @@ class ProductCore extends ObjectModel
return true;
}
/*
/**
* Webservice getter : get virtual field default combination
*
@@ -4738,6 +4758,44 @@ 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->deleteWsTags())
{
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;
}
/**
* 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()
@@ -4749,7 +4807,7 @@ class ProductCore extends ObjectModel
{
return ObjectModel::updateMultishopTable('product', array(
'ecotax' => 0,
), '');
));
}
/**
@@ -5342,6 +5400,41 @@ class ProductCore extends ObjectModel
public function getWsProductBundle()
{
return Db::getInstance()->executeS('SELECT id_product_item as id, quantity FROM '._DB_PREFIX_.'pack where id_product_pack = '.(int)$this->id);
return Db::getInstance()->executeS('SELECT id_product_item as id, quantity FROM '._DB_PREFIX_.'pack WHERE id_product_pack = '.(int)$this->id);
}
}
public function setWsType($type_str)
{
$reverse_type_information = array(
'simple' => Product::PTYPE_SIMPLE,
'pack' => Product::PTYPE_PACK,
'virtual' => Product::PTYPE_VIRTUAL,
);
if (!isset($reverse_type_information[$type_str]))
return false;
$type = $reverse_type_information[$type_str];
if (Pack::isPack((int)$this->id) && $type != Product::PTYPE_PACK)
Pack::deleteItems($this->id);
$this->cache_is_pack = ($type == Product::PTYPE_PACK);
$this->is_virtual = ($type == Product::PTYPE_VIRTUAL);
return true;
}
public function setWsProductBundle($items)
{
if($this->is_virtual)
return false;
Pack::deleteItems($this->id);
foreach ($items as $item)
if((int)$item['id'] > 0)
Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']);
return true;
}
}

View File

@@ -66,8 +66,11 @@ class ProductSaleCore
if ($page_number < 0) $page_number = 0;
if ($nb_products < 1) $nb_products = 10;
$final_order_by = $order_by;
$order_table = '';
if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales';
if (is_null($order_way) || $order_by == 'sales') $order_way == 'DESC';
if ($order_by == 'date_add' || $order_by == 'date_upd')
$order_table = 'product_shop';
if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC';
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
@@ -108,7 +111,7 @@ class ProductSaleCore
WHERE cg.`id_group` '.$sql_groups.'
)
GROUP BY product_shop.id_product
ORDER BY '.$prefix.'`'.pSQL($order_by).'` '.pSQL($order_way).'
ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).'
LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products;
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);

View File

@@ -208,9 +208,10 @@ class ProductSupplierCore extends ObjectModel
*
* @param int $id_product
* @param int $id_product_attribute Optional
* @param bool $converted_price Optional
* @return Array keys: price_te, id_currency
*/
public static function getProductPrice($id_supplier, $id_product, $id_product_attribute = 0)
public static function getProductPrice($id_supplier, $id_product, $id_product_attribute = 0, $converted_price = false)
{
if (is_null($id_supplier) || is_null($id_product))
return;
@@ -222,6 +223,9 @@ class ProductSupplierCore extends ObjectModel
$query->where('id_supplier = '.(int)$id_supplier);
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
if ($converted_price)
return Tools::convertPrice($row['price_te'], $row['id_currency']);
return $row['price_te'];
}
}
}

View File

@@ -37,7 +37,7 @@ class RequestSqlCore extends ObjectModel
'primary' => 'id_request_sql',
'fields' => array(
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'size' => 200),
'sql' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'size' => 1000),
'sql' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true),
),
);
@@ -232,8 +232,6 @@ class RequestSqlCore extends ObjectModel
{
if ($attribut = $this->cutAttribute(trim($attr), $from))
$tab[] = $attribut;
else
return false;
}
return $tab;
}

View File

@@ -93,8 +93,12 @@ define('PREG_CLASS_CJK', '\x{3041}-\x{30ff}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{
class SearchCore
{
public static function sanitize($string, $id_lang, $indexation = false)
public static function sanitize($string, $id_lang, $indexation = false, $iso_code = false)
{
$string = trim($string);
if (empty($string))
return '';
$string = Tools::strtolower(strip_tags($string));
$string = html_entity_decode($string, ENT_NOQUOTES, 'utf-8');
@@ -102,11 +106,11 @@ class SearchCore
$string = preg_replace('/['.PREG_CLASS_SEARCH_EXCLUDE.']+/u', ' ', $string);
if ($indexation)
$string = preg_replace('/[._-]+/', '', $string);
$string = preg_replace('/[._-]+/', ' ', $string);
else
{
$string = preg_replace('/[._]+/', '', $string);
$string = ltrim(preg_replace('/([^ ])-/', '$1', ' '.$string));
$string = ltrim(preg_replace('/([^ ])-/', '$1 ', ' '.$string));
$string = preg_replace('/[._]+/', '', $string);
$string = preg_replace('/[^\s]-+/', '', $string);
}
@@ -138,14 +142,34 @@ class SearchCore
if ($indexation)
{
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
if ($minWordLen > 1)
// If the language is constituted with symbol and there is no "words", then split every chars
if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen'))
{
$minWordLen -= 1;
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string);
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string);
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
// Cut symbols from letters
$symbols = '';
$letters = '';
foreach (explode(' ', $string) as $mb_word)
if (strlen(Tools::replaceAccentedChars($mb_word)) == mb_strlen(Tools::replaceAccentedChars($mb_word)))
$letters .= $mb_word.' ';
else
$symbols .= $mb_word.' ';
if (preg_match_all('/./u', $symbols, $matches))
$symbols = implode(' ', $matches[0]);
$string = $letters.$symbols;
}
else
{
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
if ($minWordLen > 1)
{
$minWordLen -= 1;
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string);
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string);
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
}
}
}
@@ -175,7 +199,7 @@ class SearchCore
$intersect_array = array();
$score_array = array();
$words = explode(' ', Search::sanitize($expr, $id_lang));
$words = explode(' ', Search::sanitize($expr, $id_lang, false, $context->language->iso_code));
foreach ($words as $key => $word)
if (!empty($word) && strlen($word) >= (int)Configuration::get('PS_SEARCH_MINWORDLEN'))
@@ -383,7 +407,7 @@ class SearchCore
return Db::getInstance()->executeS('
SELECT p.id_product, pl.id_lang, pl.id_shop, pl.name pname, p.reference, p.ean13, p.upc,
pl.description_short, pl.description, cl.name cname, m.name mname
pl.description_short, pl.description, cl.name cname, m.name mname, l.iso_code
FROM '._DB_PREFIX_.'product p
LEFT JOIN '._DB_PREFIX_.'product_lang pl
ON p.id_product = pl.id_product
@@ -392,6 +416,8 @@ class SearchCore
ON (cl.id_category = product_shop.id_category_default AND pl.id_lang = cl.id_lang AND cl.id_shop = product_shop.id_shop)
LEFT JOIN '._DB_PREFIX_.'manufacturer m
ON m.id_manufacturer = p.id_manufacturer
LEFT JOIN '._DB_PREFIX_.'lang l
ON l.id_lang = pl.id_lang
WHERE product_shop.indexed = 0
AND product_shop.visibility IN ("both", "search")
'.($id_product ? 'AND p.id_product = '.(int)$id_product : '').'
@@ -410,7 +436,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
{
@@ -452,7 +478,6 @@ class SearchCore
// Those are kind of global variables required to save the processed data in the database every X occurrences, in order to avoid overloading MySQL
$count_words = 0;
$query_array3 = array();
$products_array = array();
// Every indexed words are cached into a PHP array
$word_ids = $db->executeS('
@@ -472,6 +497,7 @@ class SearchCore
// Products are processed 50 by 50 in order to avoid overloading MySQL
while (($products = Search::getProductsToIndex($total_languages, $id_product, 50)) && (count($products) > 0))
{
$products_array = array();
// Now each non-indexed product is processed one by one, langage by langage
foreach ($products as $product)
{
@@ -482,9 +508,9 @@ class SearchCore
// Data must be cleaned of html, bad characters, spaces and anything, then if the resulting words are long enough, they're added to the array
$product_array = array();
foreach ($product as $key => $value)
if (strncmp($key, 'id_', 3))
if (strncmp($key, 'id_', 3) && isset($weight_array[$key]))
{
$words = explode(' ', Search::sanitize($value, (int)$product['id_lang'], true));
$words = explode(' ', Search::sanitize($value, (int)$product['id_lang'], true, $product['iso_code']));
foreach ($words as $word)
if (!empty($word))
{
@@ -571,6 +597,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))
@@ -668,4 +702,4 @@ class SearchCore
return Product::getProductsProperties((int)$id_lang, $result);
}
}
}

View File

@@ -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);
}

View File

@@ -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`

View File

@@ -169,12 +169,18 @@ class TabCore extends ObjectModel
*/
public static function getCurrentParentId()
{
if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `id_parent`
FROM `'._DB_PREFIX_.'tab`
WHERE LOWER(class_name) = \''.pSQL(Tools::strtolower(Tools::getValue('controller'))).'\''))
return $result['id_parent'];
return -1;
$cache_id = 'getCurrentParentId_'.Tools::strtolower(Tools::getValue('controller'));
if (!Cache::isStored($cache_id))
{
$value = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT `id_parent`
FROM `'._DB_PREFIX_.'tab`
WHERE LOWER(class_name) = \''.pSQL(Tools::strtolower(Tools::getValue('controller'))).'\'');
if (!$value)
$value = -1;
Cache::store($cache_id, $value);
}
return Cache::retrieve($cache_id);
}
/**
@@ -538,11 +544,10 @@ class TabCore extends ObjectModel
foreach($tab->attributes() as $key => $value)
if ($key == 'display_type')
$display_type = (string)$value;
foreach ($tab->children() as $module)
foreach ($module->attributes() as $k => $v)
if ($k == 'name')
$modules_list[$display_type][] = (string)$v;
$modules_list[$display_type][(int)$module['position']] = (string)$module['name'];
ksort($modules_list[$display_type]);
}
}

View File

@@ -338,15 +338,13 @@ class ToolsCore
/* If language does not exist or is disabled, erase it */
if ($cookie->id_lang)
{
//echo $cookie->id_lang;exit;
$lang = new Language((int)$cookie->id_lang);
if (!Validate::isLoadedObject($lang) || !$lang->active || !$lang->isAssociatedToShop())
$cookie->id_lang = null;
}
/* Automatically detect language if not already defined */
if (!$cookie->id_lang && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
/* Automatically detect language if not already defined, detect_language is set in Cookie::update */
if ((!$cookie->id_lang || isset($cookie->detect_language)) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
$array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
if (Tools::strlen($array[0]) > 2)
@@ -360,9 +358,17 @@ class ToolsCore
{
$lang = new Language(Language::getIdByIso($string));
if (Validate::isLoadedObject($lang) && $lang->active)
{
$language = new Language((int)$lang->id);
if (Validate::isLoadedObject($language))
Context::getContext()->language = $language;
$cookie->id_lang = (int)$lang->id;
}
}
}
if (isset($cookie->detect_language))
unset($cookie->detect_language);
/* If language file not present, you must use default language file */
if (!$cookie->id_lang || !Validate::isUnsignedId($cookie->id_lang))
@@ -399,7 +405,7 @@ class ToolsCore
{
$context->cookie->id_lang = $id_lang;
$language = new Language($id_lang);
if (Validate::isLoadedObject($language))
if (Validate::isLoadedObject($language) && $language->active)
$context->language = $language;
$params = $_GET;
@@ -698,6 +704,18 @@ class ToolsCore
}
return false;
}
/**
* Clear smarty cache folders
*/
public static function clearSmartyCache()
{
foreach (array(_PS_CACHE_DIR_.'smarty/cache', _PS_CACHE_DIR_.'smarty/compile') as $dir)
if (file_exists($dir))
foreach (scandir($dir) as $file)
if ($file[0] != '.' && $file != 'index.php')
self::deleteDirectory($dir.DIRECTORY_SEPARATOR.$file);
}
/**
* Display an error according to an error code
@@ -770,6 +788,33 @@ class ToolsCore
{
return (Tools::dieObject($object, $kill));
}
public static function debug_backtrace($start = 0, $limit = null)
{
$backtrace = debug_backtrace();
array_shift($backtrace);
for ($i = 0; $i < $start; ++$i)
array_shift($backtrace);
echo '
<div style="margin:10px;padding:10px;border:1px solid #666666">
<ul>';
$i = 0;
foreach ($backtrace as $id => $trace)
{
if ((int)$limit && (++$i > $limit ))
break;
$relative_file = (isset($trace['file'])) ? 'in /'.ltrim(str_replace(array(_PS_ROOT_DIR_, '\\'), array('', '/'), $trace['file']), '/') : '';
$current_line = (isset($trace['line'])) ? ':'.$trace['line'] : '';
echo '<li>
<b>'.((isset($trace['class'])) ? $trace['class'] : '').((isset($trace['type'])) ? $trace['type'] : '').$trace['function'].'</b>
'.$relative_file.$current_line.'
</li>';
}
echo '</ul>
</div>';
}
/**
* ALIAS OF dieObject() - Display an error with detailed object but don't stop the execution
@@ -1389,13 +1434,13 @@ class ToolsCore
/**
* Translates a string with underscores into camel case (e.g. first_name -> firstName)
* @prototype string public static function toCamelCase(string $str[, bool $catapitalise_first_char = false])
* @prototype string public static function toCamelCase(string $str[, bool $capitalise_first_char = false])
*/
public static function toCamelCase($str, $catapitalise_first_char = false)
{
$str = strtolower($str);
$str = Tools::strtolower($str);
if ($catapitalise_first_char)
$str = ucfirst($str);
$str = Tools::ucfirst($str);
return preg_replace_callback('/_+([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $str);
}
@@ -2129,6 +2174,9 @@ exit;
}
}
/**
* @deprecated as of 1.5 use Controller::getController('PageNotFoundController')->run();
*/
public static function display404Error()
{
header('HTTP/1.1 404 Not Found');
@@ -2429,7 +2477,7 @@ exit;
return $pattern;
return preg_replace('/\\\[px]\{[a-z]\}{1,2}|(\/[a-z]*)u([a-z]*)$/i', "$1$2", $pattern);
}
public static function addonsRequest($request, $params = array())
{
$addons_url = 'api.addons.prestashop.com';
@@ -2515,6 +2563,21 @@ exit;
// No content, return false
return false;
}
public static function fileAttachment($input = 'fileUpload')
{
$fileAttachment = null;
if (isset($_FILES[$input]['name']) && !empty($_FILES[$input]['name']) && !empty($_FILES[$input]['tmp_name']))
{
$fileAttachment['rename'] = uniqid(). Tools::strtolower(substr($_FILES[$input]['name'], -5));
$fileAttachment['content'] = file_get_contents($_FILES[$input]['tmp_name']);
$fileAttachment['tmp_name'] = $_FILES[$input]['tmp_name'];
$fileAttachment['name'] = $_FILES[$input]['name'];
$fileAttachment['mime'] = $_FILES[$input]['type'];
$fileAttachment['error'] = $_FILES[$input]['error'];
}
return $fileAttachment;
}
}
/**

View File

@@ -180,7 +180,13 @@ class TranslateCore
if ($js)
$ret = addslashes($ret);
$lang_cache[$cache_key] = str_replace('"', '&quot;', $ret);
$ret = str_replace('"', '&quot;', $ret);
if ($sprintf === null)
$lang_cache[$cache_key] = $ret;
else
return $ret;
}
return $lang_cache[$cache_key];
}

View File

@@ -174,7 +174,7 @@ class ValidateCore
*/
public static function isMailName($mail_name)
{
return preg_match(Tools::cleanNonUnicodeSupport('/^[^<>;=#{}]*$/u'), $mail_name);
return (is_string($mail_name) && preg_match(Tools::cleanNonUnicodeSupport('/^[^<>;=#{}]*$/u'), $mail_name));
}
/**
@@ -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);
}
/**
@@ -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('/<[\s]*script/ims', $html) || preg_match('/('.$events.')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html))
return false;
if (!$allow_iframe && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html))
return false;
return true;
}
/**

View File

@@ -144,7 +144,7 @@ abstract class CacheCore
*/
public function set($key, $value, $ttl = 0)
{
if ($this->_set($key, $value))
if ($this->_set($key, $value, $ttl))
{
if ($ttl < 0)
$ttl = 0;

View File

@@ -149,6 +149,7 @@ class CacheFsCore extends Cache
*/
protected function getFilename($key)
{
$key = md5($key);
$path = _PS_CACHEFS_DIRECTORY_;
for ($i = 0; $i < $this->depth; $i++)
$path .= $key[$i].'/';

View File

@@ -44,11 +44,19 @@ class CacheMemcacheCore extends Cache
{
$this->connect();
// Get keys (this code comes from Doctrine 2 project)
$this->keys = array();
$servers = self::getMemcachedServers();
if(is_array($servers) && count($servers) > 0 && method_exists('Memcache', 'getStats'))
if(is_array($servers) && count($servers) > 0)
{
$this->keys = $this->memcache->get(_COOKIE_IV_);
if (!is_array($this->keys))
$this->keys = array();
}
/*
// Get keys (this code comes from Doctrine 2 project)
if(is_array($servers) && count($servers) > 0 && method_exists('Memcache', 'getStats'))
$all_slabs = $this->memcache->getStats('slabs');
if(isset($all_slabs) && is_array($all_slabs))
@@ -56,23 +64,24 @@ class CacheMemcacheCore extends Cache
{
if (is_array($slabs))
{
foreach (array_keys($slabs) as $slab_id)
foreach (array_keys($slabs) as $i => $slab_id) // $slab_id is not an int but a string, using the key instead ?
{
if(is_int($slab_id))
{
$dump = $this->memcache->getStats('cachedump', (int)$slab_id);
if(is_int($i))
{
$dump = $this->memcache->getStats('cachedump', (int)$i);
if ($dump)
{
foreach ($dump as $entries)
{
if ($entries)
$this->keys = array_merge($this->keys, array_keys($entries));
if($entries)
foreach ($entries as $key => $data)
$this->keys[$key] = $data[1];
}
}
}
}
}
}
}*/
}
public function __destruct()
@@ -144,6 +153,7 @@ class CacheMemcacheCore extends Cache
*/
protected function _writeKeys()
{
$this->memcache->set(_COOKIE_IV_, $this->keys);
}
/**

View File

@@ -47,6 +47,8 @@ class AdminControllerCore extends Controller
/** @var string Associated table name */
public $table;
public $list_id;
/** @var string Object identifier inside the associated table */
protected $identifier = false;
@@ -313,7 +315,7 @@ class AdminControllerCore extends Controller
19 => $this->l('Duplication was completed successfully.'), 20 => $this->l('The translation was added successfully, but the language has not been created.'),
21 => $this->l('Module reset successfully.'), 22 => $this->l('Module deleted successfully.'),
23 => $this->l('Localization pack imported successfully.'), 24 => $this->l('Localization pack imported successfully.'),
25 => $this->l('The selcted images have successfully been moved.'),
25 => $this->l('The selected images have successfully been moved.'),
26 => $this->l('Your cover selection has been saved.'),
27 => $this->l('The image shop association has been modified.'),
28 => $this->l('A zone has been assigned to the selection successfully.'),
@@ -379,6 +381,39 @@ class AdminControllerCore extends Controller
break;
}
$this->toolbar_title = $bread_extended;
if (Tools::isSubmit('submitFilter'))
{
$filter = '';
foreach ($this->fields_list AS $field => $t)
{
if ($val = htmlspecialchars(Tools::getValue($this->table.'Filter_'.$field), ENT_QUOTES, 'UTF-8'))
{
if(!is_array($val) && !empty($val))
$filter .= ($filter ? ', ' : $this->l(' filter by ')).$t['title'].' : ';
if (isset($t['type']) && $t['type'] == 'bool')
$filter .= ((bool)$val) ? $this->l('yes') : $this->l('no');
elseif(is_string($val))
$filter .= $val;
elseif(is_array($val))
{
$tmp = '';
foreach($val as $v)
if(is_string($v) && !empty($v))
$tmp .= ' - '.$v;
if(Tools::strlen($tmp))
{
$tmp = ltrim($tmp, ' - ');
$filter .= ($filter ? ', ' : $this->l(' filter by ')).$t['title'].' : ';
$filter .= $tmp;
}
}
}
}
if ($filter)
$this->toolbar_title[] = $filter;
}
}
/**
@@ -429,29 +464,33 @@ class AdminControllerCore extends Controller
*/
public function processFilter()
{
if (!isset($this->list_id))
$this->list_id = $this->table;
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
// Filter memorization
if (isset($_POST) && !empty($_POST) && isset($this->table))
if (isset($_POST) && !empty($_POST) && isset($this->list_id))
foreach ($_POST as $key => $value)
{
if (stripos($key, $this->table.'Filter_') === 0)
if (stripos($key, $this->list_id.'Filter_') === 0)
$this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : serialize($value);
elseif(stripos($key, 'submitFilter') === 0)
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
}
if (isset($_GET) && !empty($_GET) && isset($this->table))
if (isset($_GET) && !empty($_GET) && isset($this->list_id))
foreach ($_GET as $key => $value)
if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0)
if (stripos($key, $this->list_id.'OrderBy') === 0 || stripos($key, $this->list_id.'Orderway') === 0)
$this->context->cookie->{$prefix.$key} = $value;
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
$filters = $this->context->cookie->getFamily($prefix.$this->list_id.'Filter_');
foreach ($filters as $key => $value)
{
/* Extracting filters from $_POST on key filter_ */
if ($value != null && !strncmp($key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table)))
if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id)))
{
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->table));
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id));
/* Table alias could be specified using a ! eg. alias!field */
$tmp_tab = explode('!', $key);
$filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0];
@@ -647,12 +686,14 @@ class AdminControllerCore extends Controller
$this->errors[] = Tools::displayError('Unable to delete associated images.');
$object->deleted = 1;
if ($object->update())
if ($res = $object->update())
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token;
}
elseif ($object->delete())
elseif ($res = $object->delete())
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token;
$this->errors[] = Tools::displayError('An error occurred during deletion.');
if ($res)
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
}
}
else
@@ -701,6 +742,7 @@ class AdminControllerCore extends Controller
/* voluntary do affectation here */
elseif (($_POST[$this->identifier] = $this->object->id) && $this->postImage($this->object->id) && !count($this->errors) && $this->_redirect)
{
Logger::addLog(sprintf($this->l('%s addition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
$parent_id = (int)Tools::getValue('id_parent', 1);
$this->afterAdd($this->object);
$this->updateAssoShop($this->object->id);
@@ -735,7 +777,6 @@ class AdminControllerCore extends Controller
{
/* Checking fields validity */
$this->validateRules();
if (empty($this->errors))
{
$id = (int)Tools::getValue($this->identifier);
@@ -801,6 +842,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)$object->id, true, (int)$this->context->employee->id);
}
else
$this->errors[] = Tools::displayError('An error occurred while updating an object.').
@@ -884,30 +926,32 @@ class AdminControllerCore extends Controller
/**
* Cancel all filters for this tab
*/
public function processResetFilters()
public function processResetFilters($list_id = null)
{
if (!isset($list_id))
$list_id = isset($this->list_id) ? $this->list_id : $this->table;
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
$filters = $this->context->cookie->getFamily($prefix.$list_id.'Filter_');
foreach ($filters as $cookie_key => $filter)
if (strncmp($cookie_key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table)) == 0)
if (strncmp($cookie_key, $prefix.$list_id.'Filter_', 7 + Tools::strlen($prefix.$list_id)) == 0)
{
$key = substr($cookie_key, 7 + Tools::strlen($prefix.$this->table));
/* Table alias could be specified using a ! eg. alias!field */
$tmp_tab = explode('!', $key);
$key = (count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]);
$key = substr($cookie_key, 7 + Tools::strlen($prefix.$list_id));
if (is_array($this->fields_list) && array_key_exists($key, $this->fields_list))
$this->context->cookie->$cookie_key = null;
unset($this->context->cookie->$cookie_key);
}
if (isset($this->context->cookie->{'submitFilter'.$this->table}))
unset($this->context->cookie->{'submitFilter'.$this->table});
if (isset($this->context->cookie->{'submitFilter'.$list_id}))
unset($this->context->cookie->{'submitFilter'.$list_id});
if (isset($this->context->cookie->{$prefix.$this->table.'Orderby'}))
unset($this->context->cookie->{$prefix.$this->table.'Orderby'});
if (isset($this->context->cookie->{$prefix.$list_id.'Orderby'}))
unset($this->context->cookie->{$prefix.$list_id.'Orderby'});
if (isset($this->context->cookie->{$prefix.$this->table.'Orderway'}))
unset($this->context->cookie->{$prefix.$this->table.'Orderway'});
if (isset($this->context->cookie->{$prefix.$list_id.'Orderway'}))
unset($this->context->cookie->{$prefix.$list_id.'Orderway'});
unset($_POST);
$this->_filter = false;
@@ -1148,6 +1192,9 @@ class AdminControllerCore extends Controller
protected function filterToField($key, $filter)
{
if (!isset($this->fields_list))
return false;
foreach ($this->fields_list as $field)
if (array_key_exists('filter_key', $field) && $field['filter_key'] == $key)
return $field;
@@ -1194,8 +1241,7 @@ class AdminControllerCore extends Controller
$tpl_action = $this->tpl_folder.$this->display.'.tpl';
// Check if action template has been override
// Check if action template has been overriden
foreach ($this->context->smarty->getTemplateDir() as $template_dir)
if (file_exists($template_dir.DIRECTORY_SEPARATOR.$tpl_action) && $this->display != 'view' && $this->display != 'options')
{
@@ -1214,27 +1260,15 @@ class AdminControllerCore extends Controller
$page = $this->content;
if ($conf = Tools::getValue('conf'))
if ($this->json)
$this->context->smarty->assign('conf', Tools::jsonEncode($this->_conf[(int)$conf]));
else
$this->context->smarty->assign('conf', $this->_conf[(int)$conf]);
$notifications_type = array('errors', 'warnings', 'informations', 'confirmations');
foreach($notifications_type as $type)
if ($this->json)
$this->context->smarty->assign($type, Tools::jsonEncode(array_unique($this->$type)));
else
$this->context->smarty->assign($type, array_unique($this->$type));
$this->context->smarty->assign('conf', $this->json ? Tools::jsonEncode($this->_conf[(int)$conf]) : $this->_conf[(int)$conf]);
if ($this->json)
$this->context->smarty->assign('page', Tools::jsonEncode($page));
else
$this->context->smarty->assign('page', $page);
foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type)
$this->context->smarty->assign($type, $this->json ? Tools::jsonEncode(array_unique($this->$type)) : array_unique($this->$type));
$this->context->smarty->assign('page', $this->json ? Tools::jsonEncode($page) : $page);
$this->smartyOutputContent($this->layout);
}
/**
* add a warning message to display at the top of the page
*
@@ -1296,7 +1330,7 @@ class AdminControllerCore extends Controller
$current_id = Tab::getCurrentParentId();
foreach ($tabs as $index => $tab)
{
if ($tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0)
if (($tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0) || $tab['class_name'] == 'AdminCarrierWizard')
{
unset($tabs[$index]);
continue;
@@ -1336,7 +1370,7 @@ class AdminControllerCore extends Controller
foreach ($sub_tabs as $index2 => $sub_tab)
{
// class_name is the name of the class controller
if (Tab::checkTabRights($sub_tab['id_tab']) === true && (bool)$sub_tab['active'])
if (Tab::checkTabRights($sub_tab['id_tab']) === true && (bool)$sub_tab['active'] && $sub_tab['class_name'] != 'AdminCarrierWizard')
{
$sub_tabs[$index2]['href'] = $this->context->link->getAdminLink($sub_tab['class_name']);
$sub_tabs[$index2]['current'] = ($sub_tab['class_name'].'Controller' == get_class($this));
@@ -1478,6 +1512,8 @@ class AdminControllerCore extends Controller
*/
protected function initTabModuleList()
{
if (!$this->isFresh(Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, 86400))
@file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));
if (!$this->isFresh(Module::CACHE_FILE_TAB_MODULES_LIST, 604800))
$this->refresh(Module::CACHE_FILE_TAB_MODULES_LIST, 'http://'.Tab::TAB_MODULE_LIST_URL);
@@ -1499,6 +1535,16 @@ class AdminControllerCore extends Controller
protected function addToolBarModulesListButton()
{
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400))
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
$country_module_list_xml = simplexml_load_file(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
$country_module_list = array();
foreach ($country_module_list_xml->module as $k => $m)
$country_module_list[] = (string)$m->name;
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list);
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
$this->toolbar_btn['modules-list'] = array(
'href' => '#',
@@ -1534,7 +1580,6 @@ class AdminControllerCore extends Controller
public function renderModulesList()
{
if ($this->getModulesList($this->filter_modules_list))
{
$helper = new Helper();
@@ -1699,6 +1744,7 @@ class AdminControllerCore extends Controller
$helper->row_hover = $this->row_hover;
$helper->position_identifier = $this->position_identifier;
$helper->controller_name = $this->controller_name;
$helper->list_id = isset($this->list_id) ? $this->list_id : $this->table;
// For each action, try to add the corresponding skip elements list
$helper->list_skip_actions = $this->list_skip_actions;
@@ -1780,7 +1826,11 @@ class AdminControllerCore extends Controller
$this->context->employee->logout();
if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack()))
{
if (isset($this->context->employee))
$this->context->employee->logout();
Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').((!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound') ? '&redirect='.$this->controller_name : ''));
}
// Set current index
$current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : '');
@@ -1893,11 +1943,14 @@ class AdminControllerCore extends Controller
*/
public function initProcess()
{
if (!isset($this->list_id))
$this->list_id = $this->table;
// Manage list filtering
if (Tools::isSubmit('submitFilter'.$this->table)
|| $this->context->cookie->{'submitFilter'.$this->table} !== false
|| Tools::getValue($this->table.'Orderby')
|| Tools::getValue($this->table.'Orderway'))
if (Tools::isSubmit('submitFilter'.$this->list_id)
|| $this->context->cookie->{'submitFilter'.$this->list_id} !== false
|| Tools::getValue($this->list_id.'Orderby')
|| Tools::getValue($this->list_id.'Orderway'))
$this->filter = true;
$this->id_object = (int)Tools::getValue($this->identifier);
@@ -1999,7 +2052,7 @@ class AdminControllerCore extends Controller
$this->action = 'export';
}
/* Cancel all filters for this tab */
elseif (isset($_POST['submitReset'.$this->table]))
elseif (isset($_POST['submitReset'.$this->list_id]))
$this->action = 'reset_filters';
/* Submit options list */
elseif (Tools::getValue('submitOptions'.$this->table) || Tools::getValue('submitOptions'))
@@ -2053,14 +2106,17 @@ class AdminControllerCore extends Controller
*/
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
{
if (!isset($this->list_id))
$this->list_id = $this->table;
/* Manage default params values */
$use_limit = true;
if ($limit === false)
$use_limit = false;
elseif (empty($limit))
{
if (isset($this->context->cookie->{$this->table.'_pagination'}) && $this->context->cookie->{$this->table.'_pagination'})
$limit = $this->context->cookie->{$this->table.'_pagination'};
if (isset($this->context->cookie->{$this->list_id.'_pagination'}) && $this->context->cookie->{$this->list_id.'_pagination'})
$limit = $this->context->cookie->{$this->list_id.'_pagination'};
else
$limit = $this->_pagination[1];
}
@@ -2070,8 +2126,8 @@ class AdminControllerCore extends Controller
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
if (empty($order_by))
{
if ($this->context->cookie->{$prefix.$this->table.'Orderby'})
$order_by = $this->context->cookie->{$prefix.$this->table.'Orderby'};
if ($this->context->cookie->{$prefix.$this->list_id.'Orderby'})
$order_by = $this->context->cookie->{$prefix.$this->list_id.'Orderby'};
elseif ($this->_orderBy)
$order_by = $this->_orderBy;
else
@@ -2080,16 +2136,16 @@ class AdminControllerCore extends Controller
if (empty($order_way))
{
if ($this->context->cookie->{$prefix.$this->table.'Orderway'})
$order_way = $this->context->cookie->{$prefix.$this->table.'Orderway'};
if ($this->context->cookie->{$prefix.$this->list_id.'Orderway'})
$order_way = $this->context->cookie->{$prefix.$this->list_id.'Orderway'};
elseif ($this->_orderWay)
$order_way = $this->_orderWay;
else
$order_way = $this->_defaultOrderWay;
}
$limit = (int)Tools::getValue('pagination', $limit);
$this->context->cookie->{$this->table.'_pagination'} = $limit;
$limit = (int)Tools::getValue($this->list_id.'_pagination', $limit);
$this->context->cookie->{$this->list_id.'_pagination'} = $limit;
/* Check params validity */
if (!Validate::isOrderBy($order_by) || !Validate::isOrderWay($order_way)
@@ -2101,12 +2157,12 @@ class AdminControllerCore extends Controller
$order_by = $this->fields_list[$order_by]['filter_key'];
/* Determine offset from current page */
if ((isset($_POST['submitFilter'.$this->table]) ||
isset($_POST['submitFilter'.$this->table.'_x']) ||
isset($_POST['submitFilter'.$this->table.'_y'])) &&
!empty($_POST['submitFilter'.$this->table]) &&
is_numeric($_POST['submitFilter'.$this->table]))
$start = ((int)$_POST['submitFilter'.$this->table] - 1) * $limit;
if ((isset($_POST['submitFilter'.$this->list_id]) ||
isset($_POST['submitFilter'.$this->list_id.'_x']) ||
isset($_POST['submitFilter'.$this->list_id.'_y'])) &&
!empty($_POST['submitFilter'.$this->list_id]) &&
is_numeric($_POST['submitFilter'.$this->list_id]))
$start = ((int)$_POST['submitFilter'.$this->list_id] - 1) * $limit;
/* Cache */
$this->_lang = (int)$id_lang;
@@ -2202,9 +2258,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.' ' : '').'
@@ -2217,6 +2273,7 @@ class AdminControllerCore extends Controller
($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : '').
(($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : '');
$this->_listTotal = 0;
if (!($this->_list = Db::getInstance()->executeS($this->_listsql)))
$this->_list_error = Db::getInstance()->getMsgError();
else
@@ -2233,7 +2290,7 @@ class AdminControllerCore extends Controller
$all_modules = Module::getModulesOnDisk(true);
$this->modules_list = array();
foreach($all_modules as $module)
foreach ($all_modules as $module)
{
$perm = true;
if ($module->id)
@@ -2249,9 +2306,11 @@ class AdminControllerCore extends Controller
if (in_array($module->name, $filter_modules_list) && $perm)
{
$this->fillModuleData($module, 'select');
$this->modules_list[] = $module;
$this->modules_list[array_search($module->name, $filter_modules_list)] = $module;
}
}
ksort($this->modules_list);
if (count($this->modules_list))
return true;
@@ -2377,7 +2436,7 @@ class AdminControllerCore extends Controller
foreach ($rules['required'] as $field)
if (($value = Tools::getValue($field)) == false && (string)$value != '0')
if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture'))
$this->errors[] = sprintf(
$this->errors[$field] = sprintf(
Tools::displayError('The %s field is required.'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
);
@@ -2386,7 +2445,7 @@ class AdminControllerCore extends Controller
if (isset($rules['requiredLang']) && is_array($rules['requiredLang']))
foreach ($rules['requiredLang'] as $field_lang)
if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty))
$this->errors[] = sprintf(
$this->errors[$field_lang.'_'.$default_language->id] = sprintf(
Tools::displayError('The field %1$s is required at least in %2$s.'),
call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
$default_language->name
@@ -2396,7 +2455,7 @@ class AdminControllerCore extends Controller
if (isset($rules['size']) && is_array($rules['size']))
foreach ($rules['size'] as $field => $max_length)
if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length)
$this->errors[] = sprintf(
$this->errors[$field] = sprintf(
Tools::displayError('The %1$s field is too long (%2$d chars max).'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name),
$max_length
@@ -2409,7 +2468,7 @@ class AdminControllerCore extends Controller
{
$field_lang_value = Tools::getValue($field_lang.'_'.$language['id_lang']);
if ($field_lang_value !== false && Tools::strlen($field_lang_value) > $max_length)
$this->errors[] = sprintf(
$this->errors[$field_lang.'_'.$language['id_lang']] = sprintf(
Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'),
call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
$language['name'],
@@ -2424,7 +2483,7 @@ class AdminControllerCore extends Controller
foreach ($rules['validate'] as $field => $function)
if (($value = Tools::getValue($field)) !== false && ($field != 'passwd'))
if (!Validate::$function($value) && !empty($value))
$this->errors[] = sprintf(
$this->errors[$field] = sprintf(
Tools::displayError('The %s field is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
);
@@ -2433,12 +2492,12 @@ class AdminControllerCore extends Controller
if (($value = Tools::getValue('passwd')) != false)
{
if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value))
$this->errors[] = sprintf(
$this->errors['passwd'] = sprintf(
Tools::displayError('The %s field is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name)
);
elseif ($class_name == 'Customer' && !Validate::isPasswd($value))
$this->errors[] = sprintf(
$this->errors['passwd'] = sprintf(
Tools::displayError('The %s field is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name)
);
@@ -2450,7 +2509,7 @@ class AdminControllerCore extends Controller
foreach ($languages as $language)
if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value))
if (!Validate::$function($value))
$this->errors[] = sprintf(
$this->errors[$field_lang.'_'.$language['id_lang']] = sprintf(
Tools::displayError('The %1$s field (%2$s) is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
$language['name']
@@ -2710,18 +2769,31 @@ class AdminControllerCore extends Controller
else
{
$result = true;
if ($this->deleted)
foreach ($this->boxes as $id)
{
foreach ($this->boxes as $id)
$to_delete = new $this->className($id);
$delete_ok = true;
if ($this->deleted)
{
$to_delete = new $this->className($id);
$to_delete->deleted = 1;
$result = $result && $to_delete->update();
if (!$to_delete->update())
{
$result = false;
$delete_ok = false;
}
}
else
if (!$to_delete->delete())
{
$result = false;
$delete_ok = false;
}
if ($delete_ok)
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$to_delete->id, true, (int)$this->context->employee->id);
else
$this->errors[] = sprintf(Tools::displayError('Can\'t delete #%d'), $id);
}
else
$result = $object->deleteSelection(Tools::getValue($this->table.'Box'));
if ($result)
$this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token;
$this->errors[] = Tools::displayError('An error occurred while deleting this selection.');

View File

@@ -114,21 +114,18 @@ class FrontControllerCore extends Controller
$css_files = $this->css_files;
$js_files = $this->js_files;
if ($this->ssl && !Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED'))
{
// If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol
if (Configuration::get('PS_SSL_ENABLED') && ($_SERVER['REQUEST_METHOD'] != 'POST') && $this->ssl != Tools::usingSecureMode())
{
header('HTTP/1.1 301 Moved Permanently');
header('Cache-Control: no-cache');
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
if ($this->ssl)
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
else
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
exit();
}
elseif (Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode() && !($this->ssl))
{
header('HTTP/1.1 301 Moved Permanently');
header('Cache-Control: no-cache');
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
exit();
}
if ($this->ajax)
{
$this->display_header = false;
@@ -336,7 +333,8 @@ class FrontControllerCore extends Controller
'opc' => (bool)Configuration::get('PS_ORDER_PROCESS_TYPE'),
'PS_CATALOG_MODE' => (bool)Configuration::get('PS_CATALOG_MODE') || !(bool)Group::getCurrent()->show_prices,
'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE'),
'request' => $link->getPaginationLink(false, false, false, true)
'request' => $link->getPaginationLink(false, false, false, true),
'PS_STOCK_MANAGEMENT' => Configuration::get('PS_STOCK_MANAGEMENT')
));
// Add the tpl files directory for mobile
@@ -596,7 +594,7 @@ class FrontControllerCore extends Controller
protected function canonicalRedirection($canonical_url = '')
{
if (!$canonical_url || !Configuration::get('PS_CANONICAL_REDIRECT') || strtoupper($_SERVER['REQUEST_METHOD']) != 'GET')
if (!$canonical_url || !Configuration::get('PS_CANONICAL_REDIRECT') || strtoupper($_SERVER['REQUEST_METHOD']) != 'GET' || Tools::getValue('live_edit'))
return;
$match_url = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
@@ -775,9 +773,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()
@@ -806,7 +806,7 @@ class FrontControllerCore extends Controller
// 'orderwaydefault' => Tools::getProductsOrder('way'),
$stock_management = Configuration::get('PS_STOCK_MANAGEMENT') ? true : false; // no display quantity order if stock management disabled
$order_by_values = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity');
$order_by_values = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity', 7 => 'reference');
$order_way_values = array(0 => 'asc', 1 => 'desc');
$this->orderBy = Tools::strtolower(Tools::getValue('orderby', $order_by_values[(int)Configuration::get('PS_PRODUCTS_ORDER_BY')]));
$this->orderWay = Tools::strtolower(Tools::getValue('orderway', $order_way_values[(int)Configuration::get('PS_PRODUCTS_ORDER_WAY')]));
@@ -847,8 +847,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;

View File

@@ -51,9 +51,10 @@ abstract class ModuleAdminControllerCore extends AdminController
public function createTemplate($tpl_name)
{
if (file_exists($this->getTemplatePath().$this->override_folder.$tpl_name) && $this->viewAccess())
if (file_exists(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/admin/'.$tpl_name) && $this->viewAccess())
return $this->context->smarty->createTemplate(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/admin/'.$tpl_name, $this->context->smarty);
elseif (file_exists($this->getTemplatePath().$this->override_folder.$tpl_name) && $this->viewAccess())
return $this->context->smarty->createTemplate($this->getTemplatePath().$this->override_folder.$tpl_name, $this->context->smarty);
return parent::createTemplate($tpl_name);
}

View File

@@ -55,6 +55,8 @@ class ModuleFrontControllerCore extends FrontController
{
if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$this->module->name.'/'.$template))
$this->template = _PS_THEME_DIR_.'modules/'.$this->module->name.'/'.$template;
elseif (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/front/'.$template))
$this->template = _PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/front/'.$template;
elseif (Tools::file_exists_cache($this->getTemplatePath().$template))
$this->template = $this->getTemplatePath().$template;
else

Some files were not shown because too many files have changed in this diff Show More