Compare commits

..
456 Commits
Author SHA1 Message Date
vAugagneur 1baf154332 // CHANGELOG
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17359 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 18:24:37 +00:00
rGaillard c190a832b3 // ENDDDDDDDD
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17358 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 18:23:01 +00:00
rGaillard 613196299c // The END
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17357 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 18:20:47 +00:00
rGaillard c77fddce5d // Fix PDF generation on some hostings
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17356 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 16:22:57 +00:00
dMetzger ba5538a12e // Added security check in stock available
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17355 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 16:11:06 +00:00
lLefevre 688b119176 [-] Installer : fix #PSCFV-4050
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17354 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 16:10:16 +00:00
vAugagneur 8bc6952c47 //fixed bug
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17353 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 15:52:20 +00:00
rGaillard e934791af3 // Another fix with combinations prices
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17352 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 15:42:33 +00:00
dMetzger c0ab78d4ff // And wrapping and recyclable package (too much feature at the install is not good)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17351 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 15:24:54 +00:00
dMetzger 38bf33f873 // Changed default value for guest checkout and one page checkout
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17350 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 15:23:54 +00:00
rGaillard ad7b4f5bf9 // Fix #PSCFV-4052
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17349 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 15:23:15 +00:00
dMetzger 9b66df95e2 // Fixed wrong path (I guess)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17348 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 15:20:47 +00:00
rGaillard a4be207ff6 // Fix #PSCFV-4033
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17346 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 14:25:32 +00:00
vAugagneur df471fbf55 //oups - part 3 :p
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17344 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 14:05:29 +00:00
dMetzger 8a530b309e // Comment
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17342 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 14:02:05 +00:00
vAugagneur 08e8b1e00d //oups - part 2 :p
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17341 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 13:31:53 +00:00
vAugagneur c05e737f69 //oups :p
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17340 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 13:24:08 +00:00
vAugagneur fe7a125a48 //added clean tabs function in upgrade
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17339 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 13:16:44 +00:00
rGaillard 714bb25193 // Fix #PSCFV-4017
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17338 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 13:09:46 +00:00
vAugagneur 09cb96dab6 //remove from upgrade update_module_mailalerts.php
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17337 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 13:05:40 +00:00
rGaillard 184c9d352e // Fix PSCFV-4046
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17336 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 12:48:36 +00:00
rGaillard a69aa9fd3c [-] FO: Fix PSCFV-3996
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17335 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 12:39:17 +00:00
bMancone a6c04366bc [+] BO : Added Mobile tab image
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17334 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 12:32:40 +00:00
dMetzger d2c57a03c3 // Fixed potential bug in module list
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17333 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 12:28:50 +00:00
dMetzger fbb6a871ad // Improved deprecated indexes drop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17332 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 11:34:16 +00:00
dMetzger 5bc2b64eed // Fixed parse error in JS caused by quote in country names
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17331 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 09:48:50 +00:00
lLefevre 31aa435bb7 [*] TR : update French translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17330 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 09:37:39 +00:00
rGaillard cd680b497e // Fix #PSCFV-3927
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17329 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 09:33:53 +00:00
rGaillard a6fbbe852f // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17328 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 09:21:08 +00:00
rGaillard bd4398bff5 // Fix #PSCFV-4035
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17327 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 09:20:27 +00:00
bMancone 6d921b6ea0 [*] BO : Added Mobile category in AdminModulesController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17326 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 09:14:54 +00:00
lLefevre 450768f50b [*] TR : add Italian translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17324 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 08:50:32 +00:00
lLefevre fe741245fe [*] TR : add Spanish translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17323 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 08:38:07 +00:00
lLefevre 4389e58c29 [*] TR : add Deutsch translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17322 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 08:32:36 +00:00
lLefevre 0fc758e481 [*] TR : add French translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17321 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 08:23:53 +00:00
dMetzger d5fc9e6527 // Moved some header() functions #PSCFV-4022
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17318 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-13 07:21:06 +00:00
rGaillard c43b7d7818 // Fix PSCFV-3943
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17315 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 17:42:59 +00:00
dMetzger ed3ef17b00 // Fixed bug in multishop when multishipping is not activated: sometimes the multishipping was "forced" in the cart
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17314 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 17:22:43 +00:00
dMetzger 8111cbb53c [-] BO : fixed #PSCFV-4034
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17313 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 16:18:49 +00:00
lLefevre bb09a64ed6 [-] BO : fix #PSCFV-4025
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17312 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 15:33:53 +00:00
lLefevre 898cd02628 [-] TR : #PSCFV-4032 : fix encoding of tabs.php file for all languages
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17311 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 15:14:36 +00:00
lLefevre 17812bb7d4 // Fix French translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17310 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 15:10:14 +00:00
lLefevre 25c9cbdf6e [-] TR : #PSCFV-4027 : change string "tabs" by "Menus"...
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17309 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 15:06:48 +00:00
rGaillard a0bf4a30b9 // Fix #PSCFV-3971
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17307 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 14:07:14 +00:00
dMetzger 148b210e15 [-] FO : some categories should not appear in some stores #PSCFV-4020
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17306 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 14:04:41 +00:00
dMetzger 30c03547fa // [-] Installer : changed the primary keys of tha language tables of category, product, meta, carrier #PSCFV-3726
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17305 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 14:00:29 +00:00
dMetzger c23a05f132 [-] BO : children categories were not really deleted #PSCFV-4028
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17304 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 13:30:40 +00:00
rGaillard 656f34b0d1 [-] BO: Fix #PSCFV-3963
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17303 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 12:34:44 +00:00
dMetzger 77cfdc5094 [-] BO : function str2url fixed #PSCFV-4017
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17302 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 12:21:49 +00:00
rGaillard 042fd1611d [-] FO: Fix #PSCFV-4011
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17301 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 10:23:46 +00:00
lLefevre 6333b5c0d0 [-] MO : product_comment : fix #PSCFV-3983
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17300 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 10:03:33 +00:00
lLefevre 1abde37668 [-] BO : fix #PSCFV-3945
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17299 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 09:00:23 +00:00
rGaillard 44d49911a9 [-] FO: Fix module restriction with guest and visitors groups #PSCFV-4004
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17298 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 08:50:24 +00:00
vAugagneur ed881352d0 [-] CORE : fixed bug #PSCFV-3982
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17297 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-12 07:43:24 +00:00
rGaillard 6204d24fef // Fix PSCFV-4008
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17295 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 17:18:30 +00:00
rGaillard 5322607a96 // Another fix with category position
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17294 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 16:35:54 +00:00
rGaillard aea7340012 // Fix bugs with category positions
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17293 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 16:33:21 +00:00
dMetzger 40e069c117 [-] Installer : changed the primary keys of tha language tables of category, product, meta, carrier #PSCFV-3726
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17291 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:58:10 +00:00
vAugagneur 4f5785f307 [-] CORE : fixed bug #PSCFV-3889
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17290 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:14:51 +00:00
vAugagneur 5c6f98a696 //fixed sql bad request in Cart::lastNoneOrderedCart() and in Cart::add()
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17289 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:04:38 +00:00
vAugagneur d7613e2e76 //fixed html bug in tpl
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17288 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:03:46 +00:00
vAugagneur 8c27a470c6 //added new hook in mobile theme - part 2
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17287 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:03:25 +00:00
vAugagneur d4d25c5d81 //added new hook in mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17286 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:03:09 +00:00
vAugagneur 5fcb00ed3a [-] FO : fixed bug #PSCFV-3964 - #PSCFV-3527
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17285 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 15:02:22 +00:00
rGaillard 6cf6e1cf60 // Small fixes
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17284 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 14:01:50 +00:00
rGaillard 1609d719ab // Fix PSCFV-4001
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17283 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 13:43:30 +00:00
lLefevre 0ab658eecd [*] TR : #PSCFV-4000 : change string "validity" by "valid" in BO
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17282 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 13:14:21 +00:00
rGaillard 4b43213169 [-] BO: Fix display of filter listings PSCFV-3992
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17281 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 13:12:02 +00:00
lLefevre 5bb54071f9 [-] BO : fix #PSCFV-3979
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17280 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 13:03:02 +00:00
rGaillard af9ac2ff4d // small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17279 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 12:42:16 +00:00
lLefevre 213d720a33 [*] TR : #PSCFV-3999 : change string "multishop" by "multistore" in BO
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17278 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 12:36:15 +00:00
lLefevre 2ed9af044e // #PSCFV-3980 : Theme mobile : Add images
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17277 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 10:26:16 +00:00
sLorenzini dc8164b1d8 [-] FO : fixed bug #PNM-431
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17276 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 09:25:33 +00:00
rGaillard 6f848e87ea // PSCFV-3990
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17275 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 09:20:14 +00:00
lLefevre 4cef2421bd [-] TR : Mail : #PSCFV-3987 : add stripslashes for email object
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17274 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-11 07:31:25 +00:00
rGaillard d9de1869da // Fix PSCFV-3894
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17272 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 17:18:23 +00:00
rGaillard 37a2bc6ebf [-] FO: Fix PSCFV-3954
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17271 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 15:11:47 +00:00
rGaillard 07d2d348dc // Fix PSCFV-3967
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17270 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 14:16:00 +00:00
rGaillard 265afeefca // Fix PSCFV-3976
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17269 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 14:06:51 +00:00
lLefevre 96104ecbf5 [-] BO : fix #PSCFV-3928
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17268 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 13:38:53 +00:00
lLefevre ee08617823 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17267 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 13:06:49 +00:00
dMetzger 60cbdb8f4f [-] BO : set addresses to deleted when customer set to deleted #PSCFV-3975
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17266 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 10:01:01 +00:00
lLefevre 03556e9432 [-] TR : #PSCFV-3977 : fix bug when upgrade of 1.4.x to 1.5.x
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17265 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:47:35 +00:00
rGaillard e55e96950b [-] FO: Fix random bugs with metas
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17264 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:42:27 +00:00
dMetzger 7515e9e6cc [-] BO : original product price was saved without decimals #PSCFV-3968
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17263 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:30:19 +00:00
lLefevre 2d25e03545 [-] TR : #PSCFV-3972 : change "%7Bshop_url%7D" by "{shop_url}" in Deutsch emails
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17262 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:25:41 +00:00
lLefevre 98615296ca [-] MO : followup : #PSCFV-3946
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17261 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:18:34 +00:00
lLefevre 6494b47f05 // When mail object are not translated, now use the default object
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17260 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:11:36 +00:00
dMetzger 972d70011d // Update version number
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17259 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:08:49 +00:00
rGaillard 32e6484105 // Fix PSCFV-3962
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17258 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 09:04:37 +00:00
rGaillard f290c3a25c // Fix PSCFV-3967
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17257 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:59:44 +00:00
dMetzger fd12b63428 // Fixed bug #PSCFV-3857
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17256 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:58:34 +00:00
vAugagneur d23d99ccb8 //added hook shopping cart on mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17255 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:56:18 +00:00
dSevere 2ca41bd6cd [-] WS: Fixed virtual product quantity field
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17254 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:55:39 +00:00
lLefevre 0da2fa8dcd [*] TR : add spanish object for confirmation order email
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17253 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:44:17 +00:00
dMetzger 9a1341ed0d // Fixed copy/paste mistake
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17252 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:38:39 +00:00
sLorenzini a05a619670 [-] FO : fixed bug #PNM-431
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17251 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:27:45 +00:00
dMetzger d425ee9563 // Fixed first part of bug #PSCFV-3857
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17250 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:27:38 +00:00
lLefevre b3c42487b5 // Small fix on mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17249 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-10 08:18:17 +00:00
rGaillard d30e37174b // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17248 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 17:19:06 +00:00
rGaillard 6d3280828f [-] BO: Fix many bug on combination generator
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17247 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 16:24:46 +00:00
dMetzger 2ed0a00ef0 // Opti
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17245 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 15:41:35 +00:00
lLefevre a0203b82b1 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17241 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 14:39:14 +00:00
lLefevre 8bc079d756 [*] TR : add setter for the type selected
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17239 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 13:41:35 +00:00
dMetzger 2948916fc4 [-] MO : fixed #PSCFV-3940
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17238 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 13:18:25 +00:00
lLefevre dddf29ebc2 // Translations for mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17237 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 13:00:48 +00:00
fGaillard b23654f10d // Mobile checkout process updated
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17236 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 12:59:59 +00:00
lLefevre d0b5e395f3 // Small fix for mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17235 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 12:43:44 +00:00
dMetzger eed6ff4b5a [-] MO : fixed #PSCFV-3944
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17234 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 12:26:43 +00:00
rGaillard 3f705d2434 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17233 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 12:13:37 +00:00
rGaillard 7aadfacf10 // Fix PSCFV-3953
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17232 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 10:08:32 +00:00
lLefevre 33e81f46d5 // Add hook product footer in theme mobile
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17231 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:54:06 +00:00
rGaillard 0f6dd838c0 // Fix on htaccess generation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17230 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:50:43 +00:00
sLorenzini 4f35fa4c1a [-] FO : fixed bug #PSCFV-3936
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17229 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:48:55 +00:00
sLorenzini 345a0752aa [-] FO : fixed bug #PSCFV-3936
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17228 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:43:32 +00:00
sLorenzini 9bc69fedb0 [-] FO : fixed bug #PSCFV-3936
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17227 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:43:19 +00:00
sLorenzini af6513bb2a [-] FO : fixed bug #PSCFV-3936
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17226 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:43:08 +00:00
sLorenzini d1a5803e74 [-] FO : fixed bug #PSCFV-3936
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17225 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 09:36:29 +00:00
dMetzger ca6337f31a // Added 1.4.9 update files
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17224 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 08:32:07 +00:00
lLefevre bc39b930b0 // Improvement when detect mobile
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17223 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 08:17:15 +00:00
lLefevre 79aa52f4a2 // Improvement when detect mobile
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17222 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 08:04:01 +00:00
lLefevre 68d9b26721 [-] BO : theme mobile : #PSCFV-3937
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17221 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 07:52:26 +00:00
lLefevre c4442a9eef [-] BO : theme mobile : #PSCFV-3937
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17220 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 07:46:34 +00:00
lLefevre 7abd718eda [-] TR : update French translations strings (fo)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17219 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-07 07:35:34 +00:00
lLefevre 9be7d9b0f9 [-] BO : theme mobile : #PSCFV-3910
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17218 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 16:28:23 +00:00
lLefevre 85f9330df2 [-] BO : theme mobile : #PSCFV-3880 : Now you have 4 options for enable the theme mobile
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17217 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 15:57:20 +00:00
dMetzger 161863abe9 // Merged improvements of 1.4.9 database schema
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17216 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 15:50:28 +00:00
rGaillard b8b794e9ca // Fix PSCFV-3933
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17215 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 15:43:45 +00:00
lLefevre cb844cdaca [-] TR : update French translations strings
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17214 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 14:22:01 +00:00
lLefevre bc4b3dac15 [-] TR : update translations strings
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17213 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 14:00:43 +00:00
vAugagneur 76e5b93a45 //added variable to disable multistore context in module
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17212 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 13:52:13 +00:00
lLefevre 7cd6898585 [-] TR : fix bug when not have a mobile folder in a theme folder
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17211 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 12:36:57 +00:00
lLefevre 2e9ca44e22 [-] TR : fix #PSCFV-3932
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17210 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 09:48:14 +00:00
lLefevre 4c4984f182 [-] FO : mobile theme: fix #PSCFV-3913
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17209 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 09:28:19 +00:00
rGaillard ad38878a8b [-] BO: Fix PSCFV-3918
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17208 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 09:28:07 +00:00
rGaillard fc41a01686 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17207 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 09:21:04 +00:00
rGaillard 765a144478 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17206 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 09:19:31 +00:00
lLefevre c8ec4882c6 [-] FO : mobile theme: fix #PSCFV-3878 : now the cart isn't reload with Jquery Mobile
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17205 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 09:10:14 +00:00
lLefevre f35893a330 [-] BO : fix #PSCFV-3926
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17204 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-06 08:22:06 +00:00
rGaillard e6112c4290 // small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17203 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 17:28:07 +00:00
rGaillard eb89723851 // display order slips amount in order view
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17201 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 17:01:33 +00:00
rGaillard 9b8da8655f // Some fields of order_slip was stored as int against float
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17200 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 16:37:40 +00:00
rGaillard 92366eb6f9 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17199 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 16:29:42 +00:00
rGaillard 9f2aeec5d1 // Tax rate was truncate on order slips
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17198 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 16:14:06 +00:00
vAugagneur ab6e72b359 [-] BO : fixed bug #PSCFV-3922
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17197 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 15:52:14 +00:00
vAugagneur c87916d793 //unlink carrier from product fix bug
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17196 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 15:20:13 +00:00
rGaillard 357368c78c // tax lines must be negative on order_slip as the other parts
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17195 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 15:05:33 +00:00
rGaillard 302f0abe9d // Order slips must be generated when an invoice is available
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17194 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 14:51:42 +00:00
vAugagneur b9dbf36e34 [-] FO : fixed bug #PSCFV-3818
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17193 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 14:43:43 +00:00
rGaillard d4bbdd7207 // Amount of order payment may be negative
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17192 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 14:10:29 +00:00
lLefevre 792f3bb601 [-] FO: mobile theme : fix notice #PSCFV-3875
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17190 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 13:13:45 +00:00
vAugagneur b82e02125b //Added button to unselect all carrier in product form
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17189 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 13:06:42 +00:00
rGaillard f4b42a63a9 [-] BO: Fix PSCFV-3911
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17188 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 12:49:57 +00:00
vAugagneur dbd39f3a5b [-] CORE : fixed bug #PSCFV-3916
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17187 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 12:44:32 +00:00
lLefevre 0bae768129 [-] FO : mobile : fix #PSCFV-3881
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17186 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 12:35:21 +00:00
lLefevre 96a4370bc3 // theme mobile translation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17185 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 12:11:21 +00:00
lLefevre 103a83d6ea // theme mobile translation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17184 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 12:08:04 +00:00
dMetzger d1dc4d6acd // Fixed retro-compatibility issue
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17183 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 10:22:31 +00:00
rGaillard 353580a558 [-] BO: Don't autocomplete with product name already in the shop on product creation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17182 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 09:42:40 +00:00
dMetzger 2da2e00d6f // The video is back
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17181 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 09:31:45 +00:00
rGaillard a6a9ffe39a // Fix PSCFV-3822
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17178 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 09:18:49 +00:00
vAugagneur 078a9767e3 [-] FO : fixed bug #PSCFV-3853
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17177 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 09:18:06 +00:00
rGaillard 48cae79ca0 // Performance fix for rand version of libpcre
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17175 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 09:02:59 +00:00
vAugagneur f24f940e2e [-] MO : fixed bug #PSCFV-3871 - part 2
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17174 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 08:29:43 +00:00
vAugagneur db0f0888cc [-] MO : fixed bug #PSCFV-3871
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17173 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 08:29:34 +00:00
lLefevre 5bccd3fdae [-] FO : mobile : fix #PSCFV-3904
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17172 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 08:12:47 +00:00
dMetzger 42a1b6d5c4 [-] Installer : install failed when you had an exotic (i.e. not by default in the installer) default country/language #PSCFV-3891
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17171 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-05 08:00:49 +00:00
rGaillard 3d7a80671a // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17168 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 17:44:56 +00:00
lLefevre 650c0105b7 [-] BO : fix #PSCFV-3908
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17167 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 14:12:30 +00:00
vAugagneur 3269a37da6 [-] FO : fixed bug #PSCFV-3794
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17166 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:59:58 +00:00
rGaillard f879b2e9b4 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17165 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:53:53 +00:00
dMetzger 9315b2a7ca // fixed #PSCFV-3900
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17164 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:51:57 +00:00
vAugagneur 940fe0857d //oups part 2
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17163 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:39:56 +00:00
vAugagneur 41daac1092 //oups
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17162 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:38:09 +00:00
vAugagneur 5934747ae0 [-] BO : fixed bug #PSCFV-3886
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17161 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:21:32 +00:00
lLefevre 7648ec01aa // small fix : display message for max_input_vars
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17160 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 12:18:14 +00:00
rGaillard 56e60c2964 [-] BO: Fix PSCFV-3884
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17159 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 08:56:27 +00:00
vAugagneur 27014976fa [+] BO : in order tab you have new information of new customer message
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17158 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 08:24:39 +00:00
lLefevre e5b0d70057 [-] BO : fix #PSCFV-3893
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17157 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 07:57:59 +00:00
lLefevre 12a93524bb [-] BO : fix #PSCFV-3893
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17156 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 07:49:53 +00:00
vAugagneur 5a56ca9c8b //added comment
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17155 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-04 07:18:59 +00:00
rGaillard 4e060b9bbd [-] BO: Fix PSCFV-3804
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17154 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 16:45:42 +00:00
lLefevre 3b929f100c [-] BO : fix #PSCFV-3874
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17153 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 15:50:44 +00:00
rGaillard 4559e93222 [-] BO: Fix PSCFV-3865
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17152 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 13:58:18 +00:00
rGaillard d3ae8702a4 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17151 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 13:13:08 +00:00
lLefevre 34f6d4d8db // Translated "CGV" in a theme mobile footer (thx Atch)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17150 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 13:03:33 +00:00
lLefevre ce3e4c4d91 [-] BO : fix #PSCFV-3855
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17149 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 08:49:57 +00:00
dMetzger 69cec80e2d // Missing parenthesis #PSCFV-3868
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17148 b9a71923-0436-4b27-9f14-aed3839534dd
2012-09-03 08:23:52 +00:00
rGaillard 26d31d53c4 // Fix PSCFV-3842
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17141 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 16:09:47 +00:00
aKorczak 2ffab71fc2 [-] WS : Fix 1.5 compatibility
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17140 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 16:04:18 +00:00
dMetzger 8b77d82ca9 // Opti
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17139 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 15:51:56 +00:00
dMetzger 4caf11a1af [-] FO : fixed accessories display
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17138 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 15:25:02 +00:00
dMetzger 1f033138cd // #PSCFV-3859
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17137 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 15:00:20 +00:00
rGaillard 6fbaafca4c // Fix PSCFV-3840
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17136 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 14:52:54 +00:00
rGaillard 146abf31de // small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17135 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 14:09:48 +00:00
rGaillard 178f977814 // Fix PSCFV-3830
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17134 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 13:47:10 +00:00
rGaillard c4afd303f7 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17132 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 12:58:52 +00:00
rGaillard 89d0a35643 [-] BO: carriers are now updated in warehouse after update
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17131 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 12:50:07 +00:00
rGaillard 784865bf4d // Fix guest-tracking links
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17127 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 12:22:47 +00:00
dMetzger 91d66ffb53 // Opti
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17126 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 12:16:15 +00:00
aKorczak 693096d497 [-] WS : Multiple fix on Web Services
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17124 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 09:41:22 +00:00
lLefevre be3801174b [-] BO : #PSCFV-3848 : Add reference order instead of id order for follow an order
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17123 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 09:35:23 +00:00
rGaillard 554e2f240a // don't allow carts without customer to create a new BackOffice orders
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17122 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 09:12:30 +00:00
lLefevre 324c0a556d [-] BO : #PSCFV-3834 : Check if file upload exist when use the contact form
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17121 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 09:05:25 +00:00
lLefevre be85673853 [-] TR : #PSCFV-3849 : fix bug in TranslateCore class
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17120 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 08:58:46 +00:00
rGaillard 875d98bca5 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17119 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 08:56:14 +00:00
dMetzger 82bc3f0916 // Fixed #PSCFV-3845
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17118 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 08:49:15 +00:00
dMetzger db513d6770 // #PSCFV-3843
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17117 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-31 07:29:32 +00:00
rGaillard 196bea5553 // small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17108 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 16:44:28 +00:00
lLefevre 292266ed40 [*] BO : #PSCFV-3831 : check each field which are required in databases
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17107 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 16:06:09 +00:00
rGaillard 8cfd8b0cc6 // default_on for combinations should per shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17106 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 16:02:11 +00:00
rGaillard 9ced871cb5 [-] Core: add default values in stock available on combination creation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17105 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:55:26 +00:00
rGaillard 9cae65593b // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17104 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:43:17 +00:00
aFolletete 1b64465a67 [-] FO : disable ajax transition on mobile theme in order to fix javascript issues
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17103 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:25:23 +00:00
rGaillard ce8517413d // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17102 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:19:45 +00:00
rGaillard cc1e75637d [-] MO: Use the user language instead of the default in homefeatured
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17101 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:18:40 +00:00
vAugagneur a9b20ea99b [-] BO : fixed bug #PSCFV-3724 - fixed bug with "Save and Stay" on product page with DisplayAdminProductsExtra
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17100 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:05:08 +00:00
rGaillard af6cf4ba34 [-] BO: Fix of product combinations edition and duplication of combination per shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17099 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 15:03:21 +00:00
vAugagneur cf51d8372e [-] BO : fixed bug #PSCFV-3806 - fixed bug when unchecked all shop asso you can't access to item any more.
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17098 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 13:44:56 +00:00
dMetzger 53937e3cd0 // Fixed migrate_orders problem #PSCFV-3799
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17097 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 13:33:25 +00:00
lLefevre 9b6642a038 // Fix small bug
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17095 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 12:56:44 +00:00
lLefevre 37c3fc05c7 // translation of a mobile theme 2
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17094 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 12:35:19 +00:00
dMetzger dbf3e5947c // Opti
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17093 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 10:06:45 +00:00
lLefevre 267a408cdf [*] BO : #PSCFV-3710 : select a current theme in AdminTranslations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17088 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 09:13:36 +00:00
dMetzger 996db45b8b // Perf #PSCFI-6421
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17087 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 08:14:53 +00:00
vAugagneur 9ac039d5f5 [-] FO : fixed bug #PSCFV-3811 - Customization field non present while not long description on product page
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17086 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-30 07:40:30 +00:00
rGaillard ec464f577e [-] FO: Fix PSCFV-3812
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17084 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 17:36:48 +00:00
rGaillard 3054f8ead1 // Fix on product association deletion
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17083 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 16:42:45 +00:00
fGaillard 579c75edab [-] Classes : Autoload, bug fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17082 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 16:27:16 +00:00
lLefevre 120dad2619 // translation of a mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17081 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 16:15:37 +00:00
lLefevre 0b69d51315 [-] BO : #PSCFV-3808 : small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17080 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 15:22:42 +00:00
lLefevre bda8d65d95 [-] BO : #PSCFV-3797 : small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17079 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 15:09:04 +00:00
rGaillard 05edba121a // you can now associate a product to a shop which created on another shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17078 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 15:00:38 +00:00
lLefevre 268518b827 [-] BO : #PSCFV-3670 : add a new format of currency in JS files
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17077 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 14:52:47 +00:00
dMetzger 8c883798b5 // Opti
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17076 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 14:22:23 +00:00
lLefevre 82c4d22b71 [-] MO: blockreinsurance : #PSCFV-3813 : add French translation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17074 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 13:40:10 +00:00
vAugagneur d34be78f9f [-] MO : fixed bug #PSCFV-3791- customer privacy module error bug
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17073 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 13:37:41 +00:00
rGaillard fe164465c2 // Display only relevant sub tabs on product tab in shop group context
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17071 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 13:12:07 +00:00
lLefevre 5cbfabb82f [*] BO : now you could translate a mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17070 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 12:35:32 +00:00
rGaillard bf76ea0315 // Don't update some product attributes in group shop context
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17069 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 12:16:26 +00:00
dMetzger c8a3a63d49 // cURL could'nt be used #PSCFV-3814
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17068 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 12:13:48 +00:00
dMetzger da841a720b // Fixed cast problem in upgrade #PSCFV-3799
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17067 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 12:11:08 +00:00
rGaillard 5d71df9a7d // Small fix on product listings in BO
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17066 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 09:56:24 +00:00
dMetzger 6fed7f3683 // Renamed defaultLanguage in id_lang_default in order to avoid conflict with an object #PSCFV-3780
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17065 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 09:55:39 +00:00
vAugagneur 07836fb3a0 [-] BO : fixed bug #PSCFV-3787 - Front displaying blank features
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17064 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 08:02:48 +00:00
vAugagneur cc4b3125a9 [-] MO : fixed bug #PSCFV-3751 - Links Block Formatting //need to re-install the module
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17063 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-29 07:29:15 +00:00
vAugagneur 96855cd5a2 //small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17062 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 16:25:56 +00:00
vAugagneur eda2ae82f8 //small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17061 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 16:14:32 +00:00
dMetzger 85f8e3db2f [+] FO : mobile theme re-included in the trunk
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17060 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 15:47:12 +00:00
dMetzger caccf77b10 // Shop URI case insensitive
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17057 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 14:48:56 +00:00
dMetzger 1329c12383 // Fixed AdminMeta in multishop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17055 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 14:35:15 +00:00
rGaillard c1b0ad7a93 [-] BO: Fix #PSCFV-3618 toolbar title on changing state of supply orders
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17054 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 13:38:33 +00:00
rGaillard 893dd895e9 [-] BO: Fix #PSCFV-3618 toolbar title on changing state of supply orders
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17053 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 13:35:36 +00:00
lLefevre 60323ad2e9 // Add French translations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17052 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 13:30:26 +00:00
rGaillard 95cd7e50e7 [-] FO: Fix default carrier selection in order process
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17051 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 13:14:21 +00:00
rGaillard da15ef9a17 [-] FO: Fix PSCFV-2911
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17048 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 12:43:09 +00:00
fGaillard de9201d30d // Last change removed (carrier key replacement)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17047 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 11:30:53 +00:00
lLefevre 685ddc4eba [-] BO : #PSCFV-3776 : small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17046 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 10:04:06 +00:00
rGaillard 1778c4e75c [-] BO: Fix PSCFV-3782 stock coverage listing
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17045 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 10:02:36 +00:00
rGaillard 2296ab35cd // small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17044 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 09:36:47 +00:00
rGaillard 4a6132d0c4 // Fix PSCFV-3781
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17043 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 09:26:15 +00:00
rGaillard f80cf204ab [*] BO: Improve specific price rules #PSCFV-2852
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17042 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 08:52:10 +00:00
vAugagneur a203e94ce8 [-] FO : fixed bug #PSCFV-3784 - fixed display bug in dateofdelivery and order history
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17041 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 08:48:21 +00:00
vAugagneur 39dbafc042 [-] FO : fixed bug #PSCFV-3758 - now you can display working hour on simplified mode in store locator
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17039 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 08:35:26 +00:00
lLefevre eeeaaa8e08 [-] MO : loyalty : #PSCFV-3764 : display points of default attribute
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17038 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 08:27:46 +00:00
vAugagneur ef8f8582d0 //small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17037 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 08:13:55 +00:00
dMetzger 0920ce9e80 // Fixed filter by position in adminproducts
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17036 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 07:39:57 +00:00
lLefevre bb649ae062 [-] MO : blocktopmenu : #PSCFV-3762 : Add link for CMS categories
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17035 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-28 07:27:23 +00:00
dMetzger 7a0821fc10 [-] FO : fixed mixed cache in different shops #PSCFV-3174
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17033 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 16:48:39 +00:00
fGaillard cb33d75eaa [-] FO : Bug fix on carrier input value (comma)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17032 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 16:39:44 +00:00
vAugagneur 25e6aa0590 [-] MO : fixed bug #PSCFV-3768
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17031 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 16:18:08 +00:00
lLefevre 8b761fa766 [-] MO : mailalert : #PSCFV-3763 : Fix error when i delete an mail alert
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17030 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 16:08:26 +00:00
vAugagneur 88ed4999ba [-] BO : fixed bug #PSCFV-3738 - addCSS() and addJS() methods not working in backOfficeHeader hook
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17029 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 16:00:30 +00:00
lLefevre a8fd55fa4b [-] MO : mailalert : Fix duplicate result
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17028 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 15:49:07 +00:00
vAugagneur 10a644578b [-] MO : fixed bug #PSCFV-3770 - Uncheck "Display the Footer's informations" in CMS Block cause CMS links to hide too.
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17026 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 15:37:22 +00:00
aKorczak 2c504d45bc [-] WS : Fix id_shop behavior when use WS or script
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17025 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 15:27:18 +00:00
lLefevre 5c4e749522 [*] FO : Optimization - don't redirect and allow WS and other script to work
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17021 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 15:06:00 +00:00
dMetzger 5cee198eb5 // 1.5.0.16
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17020 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 15:02:46 +00:00
dMetzger 06c0e7fcef // Fixed problem with rounding on tax excluded price #PSCFV-3778
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17019 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 14:28:50 +00:00
dMetzger 17e71862ac // Fixed 6-decimals price when tex excluded in BO #PSCFV-3778
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17018 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 13:45:18 +00:00
rGaillard 5e8ca44e86 // fixed hover on blocktopmenu on selected shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17017 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 13:36:00 +00:00
rGaillard f85427e8cc [-] FO: Fix weird bugs with customized products in FO #PSCFV-3377
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17016 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 13:18:59 +00:00
lLefevre a57aabec11 [-] MO : loyalty : #PSCFV-3760 : fix warning && update number of loyalties by product && normalize
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17015 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 12:15:57 +00:00
dMetzger bc5a853b3c // Fixed logo in PDF #PSCFV-3759
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17014 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 10:16:22 +00:00
dMetzger 40301f8d6b // Fixed error on category tree with multishop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17013 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 10:06:14 +00:00
rGaillard f5b703e65e [-] BO: Fix product wholesale_price import
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17012 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 09:45:23 +00:00
dMetzger a2b2540b1b [-] MO : fixed deprecated link in statdata #PNM-315
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17011 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 09:43:47 +00:00
dMetzger 15cac106e8 // Perf
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17010 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 09:14:01 +00:00
lLefevre b032f35bae // Update translations keys in module referal program
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17009 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 09:00:49 +00:00
vAugagneur 05b35a13ba //
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17008 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 08:51:41 +00:00
dMetzger 66e42ea71a // Removed a group by from a query
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17007 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 08:24:46 +00:00
dMetzger a1e8eccb95 [*] BO : set context shop by default when creating a new catalog price rule #PSCFV-3412
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17006 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 07:37:06 +00:00
dMetzger c781df84f5 [-] FO : pagination form cannot have an css id because it is used more than once #PSCFV-3755
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17005 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 07:10:29 +00:00
dMetzger 4cabe99f19 [-] Installer : ignore port when creating the sender e-mail address #PSCFV-3756
// Improved profiling tool

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17004 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-27 06:47:41 +00:00
rGaillard ef4a9f83ba // Fix products and categories import
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17001 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 17:38:46 +00:00
rGaillard bd67a69c13 // Fix link
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16997 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 15:31:40 +00:00
rGaillard 0330483fc5 [-] Installer: Fix #PSCFV-3732
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16993 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 12:46:25 +00:00
dMetzger 8ef26dfbf6 [-] FO : fixed undeletable products in cart (when price < 1¤) #PSCFV-3707
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16992 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 11:27:13 +00:00
dMetzger 21e32ce611 [-] BO : super admins are now added to all shops #PSCFV-3561
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16991 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 09:10:30 +00:00
dMetzger efe90062c9 // Fixed multishop bug when multishop is not activated ^^
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16990 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 08:07:44 +00:00
dMetzger 33a7743691 // Fixed warning/error in updater #PSCFV-3736
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16989 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 07:57:32 +00:00
dMetzger d3c705ab91 [-] FO : fixed bugs on customer messages #PSCFV-3733 #PSCFV-3712
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16988 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-24 07:48:04 +00:00
dMetzger f438395033 [-] MO : fixed image upload in homeslider #PSCFV-3730
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16984 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 17:56:16 +00:00
rGaillard 421ad89e45 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16983 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 17:49:12 +00:00
dMetzger f9a0664810 // Fixed upload of the logo in the installer
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16982 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 17:47:03 +00:00
rGaillard 0489bf4945 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16981 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 17:42:34 +00:00
dMetzger 4e4576ec97 // Wrong id given to the Cart class #PSCFV-3739
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16980 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 17:12:45 +00:00
dMetzger adebadfbc8 [-] BO : deactivated tab does are not displayed anymore #PSCFV-3740
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16979 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 17:06:20 +00:00
rGaillard afe750bb38 // Fix installer
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16978 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 16:56:18 +00:00
dMetzger 4f9189b8c6 // Opti
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16976 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 16:16:16 +00:00
dMetzger ac29a13664 // Fixed alias
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16974 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 15:24:20 +00:00
dMetzger 5534f2b30f // Fixed bad join in hook / module list
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16973 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 15:14:07 +00:00
dMetzger 6cdc8aa6da [*] BO : Changed the default list view for products and categories when multistore is activated
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16972 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 14:36:52 +00:00
rGaillard 01a92dd2dd // Fix installer
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16971 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 14:09:18 +00:00
rGaillard b11bc0e2b9 [-] FO: fix #PSCFV-3699 default carrier selection in opc
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16967 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 12:47:28 +00:00
rGaillard 02c6b751dd [-] FO: fix #PSCFV-3699 default carrier selection in opc
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16966 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 12:45:38 +00:00
rGaillard b840032589 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16964 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 10:02:57 +00:00
dMetzger 8f7543bd47 // Fixed hook call in the installer (without shop context)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16963 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 09:55:58 +00:00
rGaillard 117ab13cac // Fix addresses format
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16962 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 08:49:33 +00:00
dMetzger 221fcde595 // variable missing its $
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16957 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 07:22:06 +00:00
dMetzger 8911b22129 // Norm forbid some " characters but it blocked the installer #PSCFV-3719
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16956 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-23 07:06:38 +00:00
dMetzger 9ab66d1e47 // Multishop optimizations
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16952 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-22 16:17:13 +00:00
rGaillard e89c91369a // Fix display of AdminLocalization
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16950 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-22 10:01:48 +00:00
rGaillard 7207d46fbe [-] BO: Fix #PSCFV-3711
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16949 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-22 09:36:06 +00:00
rGaillard 9c5fa67d60 [-] BO: Fix #PSCFV-3711
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16948 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-22 09:31:27 +00:00
dMetzger 7e8847ff97 // Fixed sql error that occurred in the module duplication when you add a new shop in multishop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16947 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-22 08:58:38 +00:00
dMetzger 03124ab1ef // Missing image #PSCFV-3714
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16946 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-22 08:25:09 +00:00
dMetzger a524d05be1 // fixed #PSCFV-2987
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16937 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 15:02:40 +00:00
dMetzger e9854a8a0e // Removed FO call to shop->name instead of PS_SHOP_NAME
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16936 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 14:24:43 +00:00
dMetzger 88da6433b6 // fixed #PSCFV-3625
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16935 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 13:49:10 +00:00
dMetzger e25a53352b // Fixed #PSCFV-3702
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16934 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 13:21:16 +00:00
dMetzger 683a0c3bf3 // Fixed #PSCFV-3703
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16933 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 12:35:07 +00:00
dMetzger b661125ebf // Fixed #PSCFV-3700
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16932 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 12:14:38 +00:00
dMetzger 68ebd15045 // Fixed #PSCFV-3697
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16931 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 11:42:47 +00:00
rGaillard 1e84944e64 [-] WS: Fix #PSCFV-3317
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16930 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 11:39:29 +00:00
dMetzger b9ab4849d6 // Fixed bug #PSCFV-3677
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16929 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 11:37:33 +00:00
dMetzger 710d1f1275 [-] FO : fixed #PSCFV-3676
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16928 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 10:12:40 +00:00
dMetzger 5a3a7d238c [-] FO : fixed #PSCFV-3675
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16927 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 09:19:48 +00:00
rGaillard d9afd88155 // 404 should return 404...
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16925 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 09:18:00 +00:00
rGaillard e353808db3 [-] BO: fix PSCFV-3681 - addresses of warehouses cant be updated
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16924 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 09:08:02 +00:00
rGaillard 6277b71d20 [-] Core: upgrade TCPDF version
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16923 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 08:55:13 +00:00
rGaillard 18d4e2ec46 // TCPDF UPGRADE
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16922 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 08:53:51 +00:00
dMetzger 85683fd9f0 // One more check
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16921 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 08:41:48 +00:00
dMetzger ebd0c527ea // install / uninstall of override file from modules fixed
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16920 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-21 08:33:54 +00:00
dMetzger 224c24a2fd // Fixed warning on WS #PSCFV-3689
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16915 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 16:27:17 +00:00
dMetzger 8ea01ea0d4 // Fixed CSS display #PSCFV-3673
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16914 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 15:23:13 +00:00
dMetzger e9863b0675 // Forgot to comment a CDATA in javascript
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16913 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 15:06:58 +00:00
dMetzger 25cd7f07f8 // Fixed missing association between shop and categories #PSCFV-3685
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16912 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 14:57:22 +00:00
dMetzger b4a4edc58e // Fixed // Fixed potential warning on homepage #PSCFV-3687
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16911 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 14:53:45 +00:00
dMetzger 53fefc8564 // Fixed upgrade warnings #PSCFV-3633
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16910 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 10:28:09 +00:00
dMetzger cccf6974d7 // Pages excluded for GoogleBot must be for everyone #PSCFV-3674
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16908 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 09:00:25 +00:00
dMetzger 5099be5d19 // W3C
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16907 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 08:48:53 +00:00
dMetzger 66b217dddb // Fixed warning
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16906 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 08:45:20 +00:00
dMetzger 81196865b9 // Fixed potential warning on homepage #PSCFV-3679
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16905 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 08:38:57 +00:00
dMetzger 0c669115c9 // Fixed potential warning on homepage #PSCFV-3678
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16904 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 08:35:59 +00:00
dMetzger e7bb178aa0 // Tpl cleaning
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16903 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 08:27:12 +00:00
dMetzger 631030d398 // Case change part 2
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16902 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 07:39:36 +00:00
dMetzger 5b02eb8bc2 // Case change part 1
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16901 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 07:38:34 +00:00
dMetzger 78449538bb // Grumpf
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16900 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 07:25:52 +00:00
dMetzger 83ac1683e0 [*] Installer : socket management for PDO + refactoring
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16899 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-20 07:03:51 +00:00
dMetzger 4ab7d66963 // Oops
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16895 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 18:57:20 +00:00
dMetzger 37e26eca29 // #PSCFV-3619
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16893 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 15:14:19 +00:00
dMetzger f740bf2632 // Modules translations loading fixed #PSCFV-3559
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16891 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 14:48:01 +00:00
dMetzger 66f454db3d // #PSCFV-3659
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16890 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 14:29:12 +00:00
dMetzger c512507298 // Current cart should not be displayed in the old cart in the order creation (BO) #PSCFV-3566
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16889 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 13:55:33 +00:00
dMetzger ed1f586643 // Fixed assignment #PSCFV-3290
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16888 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 13:38:00 +00:00
dMetzger 00f922254a // Debug information added #PSCFV-3655
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16883 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 12:53:34 +00:00
dMetzger 2e78d28ec6 [-] BO : status image was not saved #PSCFV-3654
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16882 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 12:42:29 +00:00
dMetzger ba3a4325bb // Added index in installer
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16881 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 10:10:01 +00:00
dMetzger ec8b982671 // Added details in profiling tool
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16880 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 10:08:44 +00:00
dMetzger ae9f0b46c7 [-] FO : ObjectModel/Db tried to add entities with a primary key pre-filled #PSCFV-3652 #PSCFV-3651
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16879 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 09:35:05 +00:00
dMetzger 70912a0237 // Changed error management of ajax cart #PSCFV-3646
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16878 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 07:36:36 +00:00
dMetzger 00a5b44f63 // Oops #PSCFV-3647 #PSCFV-3649 #PSCFV-3650
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16877 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 07:06:10 +00:00
dMetzger 3d2a10f295 // Clean AdminController methods did not return the appropriate value #PSCFV-3645
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16876 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-17 07:03:54 +00:00
dMetzger 3f8a46a984 [-] BO : fixed #PSCFV-3627
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16872 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 15:47:49 +00:00
dMetzger 2ce4285d7a // Added missing index
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16871 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 14:32:47 +00:00
dMetzger f09026be73 // Changed max_execution_time for big product selection removal #PSCFV-3181
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16870 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 13:23:52 +00:00
dMetzger 92c22de458 [-] BO : fixed right permissions for new tabs #PSCFV-3640
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16868 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 12:20:46 +00:00
dMetzger 345fb9e7bf // Removed @ inhibiter in front of a function of the installer (I want to show the errors !!!) #PSCFV-3634
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16867 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 12:12:30 +00:00
dMetzger 94555d9fa5 [-] BO : fixed issue with dot and comma in import for floating numbers #PSCFV-3609
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16866 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 12:04:40 +00:00
dMetzger e0a7aeab6b [-] FO : fixed height of homefeatured products (missing height caused problem on floating div position sometimes) #PSCFV-3638
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16865 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 11:36:47 +00:00
dMetzger d76b060d2a [-] Installer : fixed warnings #PSCFV-3633
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16864 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 09:59:35 +00:00
dMetzger c9ee83cc46 // Removed one call of a function called twice #PSCFV-3635
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16861 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 07:47:54 +00:00
dMetzger eb1609d270 // Missing param in MySQL::tryToConnect
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16858 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-16 07:10:41 +00:00
dMetzger b2cd94475c // Removed useless bit of code (retrieval of the manufacturer address in the constructor, 1 query each time, no use)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16852 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 14:26:40 +00:00
dMetzger 15f21f853b // Perfs and clean
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16851 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 14:18:55 +00:00
dMetzger 848153a05f // Perfs and clean
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16850 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 14:10:11 +00:00
dMetzger 99aab49ae3 // GROUP BY is not a function that magically remove doubles! (#2)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16848 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 13:34:23 +00:00
dMetzger 5543a4f795 // removed tmp file
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16847 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 13:30:59 +00:00
dMetzger de4ad1d4b7 // GROUP BY is not a function that magically remove doubles!
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16846 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 13:30:03 +00:00
dMetzger 4959263cfe [-] BO : fixed incorrect substr in customer service #PSCFV-3621
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16845 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 12:32:50 +00:00
dMetzger e6d67bdbb6 // Upgrade improvements including #PSCFV-3451
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16844 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 12:21:18 +00:00
dMetzger f455965bea // small bug fix on BO orders
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16842 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 09:15:50 +00:00
mDeflotte 42ed7b598d [-] Installer : #PSCFV-3603 - loop while loading logo
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16841 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 09:12:20 +00:00
dMetzger 4963d29389 [-] BO : restricted some unauthorized accesses #PSCFV-3611
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16840 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 08:34:16 +00:00
dMetzger 57584f5efa [-] BO : fixed wrong link on AdminHome #PSCFV-3614
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16839 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 08:07:06 +00:00
dMetzger 79fda741cd [-] BO : Attribute deletion fixed #PSCFV-3616
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16838 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 08:05:09 +00:00
dMetzger e60df09495 // Code cleaning
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16837 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-14 07:46:42 +00:00
dMetzger 96040e1cb5 // Code cleaning
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16830 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 16:51:00 +00:00
dMetzger e930b9b8ed // Huge code cleaning on order edition, a lot of values were inconsistent
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16829 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 16:26:40 +00:00
dMetzger 69384f57f1 // Order::_deleteProduct rewritten (a lot of fields were missing)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16827 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 16:04:34 +00:00
dMetzger 7bed77fec3 // Added informations to AdminInformation tab (memory limit and max execution time)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16826 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 15:19:37 +00:00
dMetzger 10296817c9 // Fixed double entities on address page #PSCFV-3596
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16825 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 14:36:09 +00:00
dMetzger c121c6d616 // Added color management of the return states in the UI #PSCFV-3606
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16824 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 14:07:48 +00:00
dMetzger 730a905cfb // Translation #PSCFV-3604 & others
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16822 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 13:16:36 +00:00
dMetzger 804e6c3177 // Translation #PSCFV-3604
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16821 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 13:11:25 +00:00
dMetzger ccf4344a2d [-] Installer : fixed wrong return value in upgrade script
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16820 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 11:51:11 +00:00
dMetzger 90ce1a292d // Code cleaning #PSCFV-3602
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16818 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-13 07:29:42 +00:00
gCharmes 80ca466e13 [-] CLASSES : Report Contry::getCountries() changes from 1.4 to 1.5
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16817 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-12 19:17:04 +00:00
gCharmes 12a842837b [-] CLASSES : Report Contry::getCountries() changes from 1.4 to 1.5
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16816 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-12 19:12:54 +00:00
dMetzger 04e576623f [-] BO : you can now delete multiple order statuses at one #PSCFV-3585
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16804 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 16:00:07 +00:00
dMetzger 070fb96dc4 // BO : Set appropriate text color on listing lines
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16803 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 15:40:13 +00:00
rGaillard 4cdacec76a // bad variable name on adminlogin
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16802 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 15:05:17 +00:00
dMetzger d5337f4f44 [-] FO : fixed cache management conflict for packed product #PSCFV-3294
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16801 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 14:26:15 +00:00
dMetzger 35dcc6370c // Fixed #PSCFV-3530 #PSCFV-3593
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16800 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 13:45:16 +00:00
dMetzger be43898e5a // Low memory variable in the installer has been set to 42M instead of 32M #PSCFV-3588
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16798 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 13:30:20 +00:00
rGaillard 28c8e30784 // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16797 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 12:57:46 +00:00
dMetzger 902d753628 [-] FO : fixed country restrictions for payment modules #PSCFV-2738
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16796 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 12:57:19 +00:00
dMetzger 00045a755b // Fixed strict standard warning #PSCFV-3582
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16793 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 12:29:03 +00:00
dMetzger 7ac72c91bd [-] BO : filename should be allowed to be empty #PSCFV-3592
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16792 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 12:24:18 +00:00
dMetzger a09ed72ec0 // Does not display the blockcustomerprivacy when there is no text set
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16791 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 10:02:23 +00:00
dMetzger 83d14fae1d [-] BO : null values ignored in objectmodel::update #PSCFV-3591
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16790 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 09:56:48 +00:00
dMetzger 5b4edc3a28 [-] BO : images extension weren't checked appropriately #PSCFV-3584
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16789 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-10 08:30:22 +00:00
rGaillard 9665f40bc7 [-] Core: Fix #PSCFV-3581 missing db_prefix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16787 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 17:17:21 +00:00
rGaillard 7b4de2882c [-] FO: Fix #PSCFV-3572 bad redirect link on order with account creation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16786 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 16:31:50 +00:00
dMetzger bf0542beb4 [-] Installer : set admin theme to default after an upgrade
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16785 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 16:23:52 +00:00
rGaillard 5b478b2134 [-] FO: Fix Back button on shopping cart
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16784 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 15:51:42 +00:00
rGaillard 608ab040b8 // Another fix for multishop and webservices
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16781 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 15:27:10 +00:00
rGaillard 39c2a58307 [-] WS: Fix webservices on some entities with multishop #PSCFV-3460
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16780 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 15:15:59 +00:00
rGaillard 2400fc08ea // Fix webservices rewrite in htaccess
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16778 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 14:36:53 +00:00
vChabot 9939577f01 [-] BO : BugFix : #PSCFV-3554 : Class Category, Method calcLevelDepth: throw Exception
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16774 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 12:52:19 +00:00
dMetzger 4f99dfd2d6 // Removed some warnings in the updater
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16770 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-09 07:24:03 +00:00
dMetzger 04e3f3f6f5 // Fixed upgrade bug (wrong db function used)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16768 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 16:38:26 +00:00
dMetzger 8157f836a3 [-] Installer : deprecated tab removed in the 1.4 > 1.5 upgrade #PSCFV-3564
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16766 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 13:47:01 +00:00
vAugagneur 1f1a6ff898 [-] CORE : fixed bug #PSCFV-3406
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16763 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 11:48:25 +00:00
vAugagneur 05268a42d4 [-] BO : fixed bug #PSCFV-2958
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16762 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 09:57:47 +00:00
rGaillard 9b3961238c // small fix on adminpdf
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16761 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 09:55:29 +00:00
vAugagneur fd5894d680 [-] BO : fixed bug #PSCFV-3541
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16760 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 09:49:34 +00:00
vAugagneur e25bf37349 [-] BO : fixed bug #PSCFV-3226
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16759 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 09:41:58 +00:00
dMetzger 8479ef58ee [-] Installer : fixed errors at the installation with insertion of null values in the database #PSCFV-3544
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16758 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 09:23:31 +00:00
vAugagneur f74b6c667c [-] INSTALLER : fixed bug #PSCFV-2979
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16757 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 08:39:32 +00:00
vAugagneur c053d6332b [-] FO : fixed bug #PSCFV-2741
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16756 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 07:17:03 +00:00
dMetzger acaca2f327 // Fixed update mistake #PSCFV-3560
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16755 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 07:06:44 +00:00
dMetzger a5d3dfed09 // Source typo #PSCFV-3562
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16754 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-08 07:02:22 +00:00
dMetzger 596de63ab5 [-] MO : fixed context issues in loyalty #PNM-332
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16751 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 17:45:47 +00:00
rGaillard 019be0aeff [-] BO: Admin Home do not display quick links when access is denied for employee
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16749 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 13:49:20 +00:00
rGaillard c5a07b8c1a // Small fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16748 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 13:34:13 +00:00
rGaillard 7247e325a4 // Disable content of stocks tab if advanced stock management is not activated
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16746 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 13:08:37 +00:00
dMetzger 14cdbef06e // Debug forgotten #PSCFV-3552
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16745 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 12:54:53 +00:00
dMetzger 9a3f623393 // Added an option to ConfigurationTest::test_dir that can give a report of what is not writable (used in autoupgrade)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16744 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 12:41:02 +00:00
dMetzger 3cee49d012 [*] Installer : added timout to sql connection
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16743 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 12:32:40 +00:00
mDeflotte a98846bc57 [-] MO : #PSCFV-3550 - Module Check : Display warning only if the module is active
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16742 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 12:24:19 +00:00
rGaillard 8ba7ebd80b [-] BO: Invoices and products order detail are now not empty after deleting a product
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16741 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 12:20:10 +00:00
vAugagneur 1cf5ddd038 [-] MO : fixed bug #PSCFV-3148 - now referalprogram use module controller
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16740 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 12:17:53 +00:00
rGaillard 284a9acae6 // delete useless spaces
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16739 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 09:38:17 +00:00
rGaillard adba38898a [-] FO: Fix htaccess generation with multishop and configuration with seo rewrite on one shop and without on another shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16738 b9a71923-0436-4b27-9f14-aed3839534dd
2012-08-07 09:37:03 +00:00
704 changed files with 34769 additions and 5615 deletions
-2
View File
@@ -79,8 +79,6 @@ if (Tools::isSubmit('getAvailableFields') AND Tools::isSubmit('entity'))
$jsonArray = array(); $jsonArray = array();
$import = new AdminImportController(); $import = new AdminImportController();
$languages = Language::getLanguages(false);
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
$fields = $import->getAvailableFields(true); $fields = $import->getAvailableFields(true);
foreach ($fields AS $field) foreach ($fields AS $field)
$jsonArray[] = '{"field":"'.addslashes($field).'"}'; $jsonArray[] = '{"field":"'.addslashes($field).'"}';
+2 -2
View File
@@ -251,14 +251,14 @@ function checkingTab($tab)
{ {
if (isset(AdminTab::$tabParenting[$tab])) if (isset(AdminTab::$tabParenting[$tab]))
Tools::redirectAdmin('?tab='.AdminTab::$tabParenting[$tab].'&token='.Tools::getAdminTokenLite(AdminTab::$tabParenting[$tab])); Tools::redirectAdmin('?tab='.AdminTab::$tabParenting[$tab].'&token='.Tools::getAdminTokenLite(AdminTab::$tabParenting[$tab]));
echo sprintf(Tools::displayError('Tab %s cannot be found.'),$tab); echo sprintf(Tools::displayError('Page %s cannot be found.'),$tab);
return false; return false;
} }
// Class file is included in Dispatcher::dispatch() function // Class file is included in Dispatcher::dispatch() function
if (!class_exists($tab, false) OR !$row['id_tab']) if (!class_exists($tab, false) OR !$row['id_tab'])
{ {
echo sprintf(Tools::displayError('Tab file %s cannot be found.'),$tab); echo sprintf(Tools::displayError('The class %s cannot be found.'),$tab);
return false; return false;
} }
$adminObj = new $tab; $adminObj = new $tab;
+1 -1
View File
@@ -344,7 +344,7 @@ echo '
if (Shop::isFeatureActive()) if (Shop::isFeatureActive())
{ {
echo '<div class="multishop_toolbar"> echo '<div class="multishop_toolbar">
<span class="text_multishop">'.translate('Multishop configuration for').'</span>'. <span class="text_multishop">'.translate('Multistore configuration for').'</span>'.
Helper::renderShopList(); Helper::renderShopList();
echo '</div>'; echo '</div>';
} }
+1 -1
View File
@@ -123,7 +123,7 @@ try
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
} }
} }
else if ($context->employee->hasAuthOnShop($split[1])) elseif ($context->employee->hasAuthOnShop($split[1]))
{ {
$shop_id = $split[1]; $shop_id = $split[1];
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
+1 -1
View File
@@ -245,5 +245,5 @@ form#product, form#access_form{ background-color:#ebedf4; border:1px solid #cc
#moduleContainer .moduleFavDesc { font-family:Georgia; font-style:italic; color:#666;} #moduleContainer .moduleFavDesc { font-family:Georgia; font-style:italic; color:#666;}
/*FOOTER*/ /*FOOTER*/
#footer {height:40px; font-size:12px;clear:both;font-size:0.9em;color:#666666} #footer {height:40px;padding-top:5px;font-size:12px;clear:both;font-size:0.9em;color:#666666}
#footer .footer_link, #footer .footer_link:hover {color:#D41958;} #footer .footer_link, #footer .footer_link:hover {color:#D41958;}
@@ -204,7 +204,7 @@
<table class="table float" cellspacing="0" style="margin-right:50px" id="table_{$profile.id_profile}"> <table class="table float" cellspacing="0" style="margin-right:50px" id="table_{$profile.id_profile}">
<tr> <tr>
<th class="center"> <th class="center">
{l s='Tabs'} {l s='Menus'}
</th> </th>
<th class="center"> <th class="center">
<input type="checkbox" name="1" id="viewall" <input type="checkbox" name="1" id="viewall"
@@ -254,7 +254,7 @@
</tr> </tr>
{if !count($tabs)} {if !count($tabs)}
<tr> <tr>
<td colspan="6">{l s='No tab'}</td> <td colspan="6">{l s='No menu'}</td>
</tr> </tr>
{else} {else}
{foreach $tabs AS $tab} {foreach $tabs AS $tab}
@@ -37,11 +37,9 @@
if (!isNaN(element_price) && element_price > 0) if (!isNaN(element_price) && element_price > 0)
{ {
if (element_has_tax) if (element_has_tax)
other_element_price = parseFloat(element_price / ((product_tax / 100) + 1)); other_element_price = parseFloat(element_price / ((product_tax / 100) + 1)).toFixed(6);
else else
other_element_price = ps_round(parseFloat(element_price * ((product_tax / 100) + 1)), 2); other_element_price = ps_round(parseFloat(element_price * ((product_tax / 100) + 1)), 2).toFixed(2);
other_element_price = other_element_price.toFixed(2);
} }
$('#related_to_'+element.attr('name')).val(other_element_price); $('#related_to_'+element.attr('name')).val(other_element_price);
@@ -54,7 +54,7 @@
<div class="warn width2" style="float: left;"> <div class="warn width2" style="float: left;">
<p>{l s='How to restore a database Backup in 10 easy steps:'}</p> <p>{l s='How to restore a database Backup in 10 easy steps:'}</p>
<ol style="font-size: 11px; font-weight: normal; line-height: 20px;"> <ol style="font-size: 11px; font-weight: normal; line-height: 20px;">
<li>{l s='Set "Enable Shop" to "No" in the Preferences > Maintenance tab.'}</li> <li>{l s='Set "Enable Shop" to "No" in the "Maintenance" page under the "Preferences" menu.'}</li>
<li>{l s='Download the Backup from the list below or from your FTP server (in the folder "admin/backups").'}</li> <li>{l s='Download the Backup from the list below or from your FTP server (in the folder "admin/backups").'}</li>
<li>{l s='Check the Backup integrity: look for errors, incomplete file, etc. Be sure to verify all your data.'}</li> <li>{l s='Check the Backup integrity: look for errors, incomplete file, etc. Be sure to verify all your data.'}</li>
<li>{l s='Ask your hosting provider for "phpMyAdmin" access to your database'}</li> <li>{l s='Ask your hosting provider for "phpMyAdmin" access to your database'}</li>
@@ -62,7 +62,7 @@
<div class="warn width2" style="float: left;"> <div class="warn width2" style="float: left;">
<p>{l s='How to restore a database Backup in 10 easy steps:'}</p> <p>{l s='How to restore a database Backup in 10 easy steps:'}</p>
<ol style="font-size: 11px; font-weight: normal; line-height: 20px;"> <ol style="font-size: 11px; font-weight: normal; line-height: 20px;">
<li>{l s='Set "Enable Shop" to "No" in the Preferences > Maintenance tab.'}</li> <li>{l s='Set "Enable Shop" to "No" in the "Maintenance" page under the "Preferences" menu.'}</li>
<li>{l s='Download the Backup from the list below or from your FTP server (in the folder "admin/backups").'}</li> <li>{l s='Download the Backup from the list below or from your FTP server (in the folder "admin/backups").'}</li>
<li>{l s='Check the Backup integrity: look for errors, incomplete file, etc. Be sure to verify all your data.'}</li> <li>{l s='Check the Backup integrity: look for errors, incomplete file, etc. Be sure to verify all your data.'}</li>
<li>{l s='Ask your hosting provider for "phpMyAdmin" access to your database'}</li> <li>{l s='Ask your hosting provider for "phpMyAdmin" access to your database'}</li>
@@ -4,7 +4,7 @@
<input type="text" id="customerFilter" name="customerFilter" value="{$customerFilter|escape:'htmlall':'UTF-8'}" style="width:400px" /> <input type="text" id="customerFilter" name="customerFilter" value="{$customerFilter|escape:'htmlall':'UTF-8'}" style="width:400px" />
<p class="preference_description">{l s='Optional, the cart rule will be available for everyone if you leave this field blank.'}</p> <p class="preference_description">{l s='Optional, the cart rule will be available for everyone if you leave this field blank.'}</p>
</div> </div>
<label>{l s='Validity'}</label> <label>{l s='Valid'}</label>
<div class="margin-form"> <div class="margin-form">
<strong>{l s='from'}</strong> <strong>{l s='from'}</strong>
<input type="text" class="datepicker" name="date_from" <input type="text" class="datepicker" name="date_from"
@@ -54,6 +54,6 @@
name: '{$language.name|escape:'quotes'}' name: '{$language.name|escape:'quotes'}'
}; };
{/foreach} {/foreach}
displayFlags(languages, {$defaultLanguage}); displayFlags(languages, {$id_lang_default});
</script> </script>
<script type="text/javascript" src="themes/default/template/controllers/cart_rules/form.js"></script> <script type="text/javascript" src="themes/default/template/controllers/cart_rules/form.js"></script>
@@ -5,8 +5,8 @@
<div class="margin-form"> <div class="margin-form">
<div class="translatable"> <div class="translatable">
{foreach from=$languages item=language} {foreach from=$languages item=language}
<div class="lang_{$language.id_lang|intval}" style="display:{if $language.id_lang == $defaultLanguage}block{else}none{/if};float:left"> <div class="lang_{$language.id_lang|intval}" style="display:{if $language.id_lang == $id_lang_default}block{else}none{/if};float:left">
<input type="text" id="name_{$language.id_lang|intval}" name="name_{$language.id_lang|intval}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang|intval)}" style="width:400px" /> <input type="text" id="name_{$language.id_lang|intval}" name="name_{$language.id_lang|intval}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang|intval)|escape:html:'UTF-8'}" style="width:400px" />
<sup>*</sup> <sup>*</sup>
</div> </div>
{/foreach} {/foreach}
@@ -36,7 +36,7 @@
<h2><img src="../img/admin/vcard.png" />{l s='Customer information'}</h2> <h2><img src="../img/admin/vcard.png" />{l s='Customer information'}</h2>
<span style="font-size: 14px;"> <span style="font-size: 14px;">
{if $customer->id} {if $customer->id}
<a href="{$link->getAdminLink('AdminCustomers')}&id_customer={$customer->id}&viewcustomer">{$customer->firstname} {$customer->lastname}</a></span> <a href="{$link->getAdminLink('AdminCustomers')|escape:'htmlall':'UTF-8'}&id_customer={$customer->id}&viewcustomer">{$customer->firstname} {$customer->lastname}</a></span>
{l s='#'}{$customer->id}<br /> {l s='#'}{$customer->id}<br />
<a style="text-decoration: underline; color:#268CCD;" href="mailto:{$customer->email}">{$customer->email}</a> <br /><br /> <a style="text-decoration: underline; color:#268CCD;" href="mailto:{$customer->email}">{$customer->email}</a> <br /><br />
{l s='Account registration date:'} {dateFormat date=$customer->date_add}<br /> {l s='Account registration date:'} {dateFormat date=$customer->date_add}<br />
@@ -51,12 +51,12 @@
<h2><img src="../img/admin/cart.gif" /> {l s='Order information'}</h2> <h2><img src="../img/admin/cart.gif" /> {l s='Order information'}</h2>
<span> <span>
{if $order->id} {if $order->id}
<a href="{$link->getAdminLink('AdminOrders')}&id_order={$order->id}&vieworder"> {l s='Order #%d' sprintf=$order->id|string_format:"%06d"}</a></span> <a href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_order={$order->id}&vieworder"> {l s='Order #%d' sprintf=$order->id|string_format:"%06d"}</a></span>
<br /><br /> <br /><br />
{l s='Made on:'} {dateFormat date=$order->date_add}<br /><br /><br /><br /> {l s='Made on:'} {dateFormat date=$order->date_add}<br /><br /><br /><br />
{else} {else}
{l s='No order created from this cart'}</span> {l s='No order created from this cart'}</span>
<p><a class="button" href="{$link->getAdminLink('AdminOrders')}&id_cart={$cart->id}&addorder">{l s='Create an order with from cart'}</a></p> {if $customer->id}<p><a class="button" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_cart={$cart->id}&addorder">{l s='Create an order with from cart'}</a></p>{/if}
{/if} {/if}
</div> </div>
<br style="clear:both;" /> <br style="clear:both;" />
@@ -77,12 +77,12 @@
</tr> </tr>
<tbody> <tbody>
{foreach from=$products item='product'} {foreach from=$products item='product'}
{if isset($customized_datas[$product.id_product][$product.id_product_attribute])} {if isset($customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery])}
<tr> <tr>
<td align="center">{$product.image}</td> <td align="center">{$product.image}</td>
<td><a href="{$link->getAdminLink('AdminProducts')}&id_product={$product.id_product}&updateproduct"> <td><a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}&id_product={$product.id_product}&updateproduct">
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br /> <span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
{if $product.reference}$this->l('Ref:') {$product.reference}{/if} {if $product.reference}{l s='Ref:'} {$product.reference}{/if}
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
</a> </a>
</td> </td>
@@ -91,7 +91,7 @@
<td align="center" class="productQuantity">{$product.qty_in_stock}</td> <td align="center" class="productQuantity">{$product.qty_in_stock}</td>
<td align="right">{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}</td> <td align="right">{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}</td>
</tr> </tr>
{foreach from=$customized_datas[$product.id_product][$product.id_product_attribute] item='customization'} {foreach from=$customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery] item='customization'}
<tr> <tr>
<td colspan="2"> <td colspan="2">
{foreach from=$customization.datas key='type' item='datas'} {foreach from=$customization.datas key='type' item='datas'}
@@ -125,7 +125,7 @@
<tr> <tr>
<td align="center">{$product.image}</td> <td align="center">{$product.image}</td>
<td> <td>
<a href="{$link->getAdminLink('AdminProducts')}&id_product={$product.id_product}&updateproduct"> <a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}&id_product={$product.id_product}&updateproduct">
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br /> <span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
{if $product.reference}{l s='Ref:'} {$product.reference}{/if} {if $product.reference}{l s='Ref:'} {$product.reference}{/if}
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
@@ -175,7 +175,7 @@
</tr> </tr>
{foreach from=$discounts item='discount'} {foreach from=$discounts item='discount'}
<tr> <tr>
<td><a href="{$link->getAdminLink('AdminDiscounts')}&id_discount={$discount.id_discount}&updatediscount">{$discount.name}</a></td> <td><a href="{$link->getAdminLink('AdminDiscounts')|escape:'htmlall':'UTF-8'}&id_discount={$discount.id_discount}&updatediscount">{$discount.name}</a></td>
<td align="center">- {displayWtPriceWithCurrency price=$discount.value_real currency=$currency}</td> <td align="center">- {displayWtPriceWithCurrency price=$discount.value_real currency=$currency}</td>
</tr> </tr>
{/foreach} {/foreach}
@@ -45,7 +45,7 @@
<select name="id_employee_forward" style="vertical-align: middle;"> <select name="id_employee_forward" style="vertical-align: middle;">
<option value="-1">{l s='-- Choose --'}</option> <option value="-1">{l s='-- Choose --'}</option>
{foreach $employees as $employee} {foreach $employees as $employee}
<option value="{$employee.id_employee}"> {$employee.firstname|substr:0:1}. {$employee.lastname}</option> <option value="{$employee.id_employee}"> {Tools::substr($employee.firstname, 0, 1)}. {$employee.lastname}</option>
{/foreach} {/foreach}
<option value="0">{l s='Someone else'}</option> <option value="0">{l s='Someone else'}</option>
</select> </select>
@@ -147,6 +147,7 @@
<script type="text/javascript"> <script type="text/javascript">
var timer;
$(document).ready(function(){ $(document).ready(function(){
$('select[name=id_employee_forward]').change(function(){ $('select[name=id_employee_forward]').change(function(){
if ($(this).val() >= 0) if ($(this).val() >= 0)
@@ -164,7 +165,27 @@
$(this).val(''); $(this).val('');
} }
}); });
timer = setInterval("markAsRead()", 3000);
}); });
function markAsRead()
{
$.ajax({
type: 'POST',
url: 'ajax-tab.php',
async: true,
dataType: 'json',
data: {
controller: 'AdminCustomerThreads',
action: 'markAsRead',
token : '{$token}',
id_thread: {$id_customer_thread}
}
});
clearInterval(timer);
timer = null;
}
</script> </script>
{/block} {/block}
@@ -30,7 +30,7 @@
<script type="text/javascript"> <script type="text/javascript">
function saveCustomerNote() function saveCustomerNote()
{ {
$('#note_feedback').html('<img src="../img/loader.gif" />').show(); $('#note_feedback').html('<img src="../img/loader.gif" alt="" />').show();
var noteContent = $('#noteContent').val(); var noteContent = $('#noteContent').val();
$.ajax({ $.ajax({
@@ -45,7 +45,6 @@
<p>{l s='If you don\'t know how to do this, please contact your hosting provider!'}</p><br /> <p>{l s='If you don\'t know how to do this, please contact your hosting provider!'}</p><br />
{/if} {/if}
{* Screencast deprecated, but I keep the code in case it is updated later
{if $employee->bo_show_screencast} {if $employee->bo_show_screencast}
<div id="adminpresentation" style="display:block"> <div id="adminpresentation" style="display:block">
<h2>{l s='Video'}</h2> <h2>{l s='Video'}</h2>
@@ -97,7 +96,6 @@ $(document).ready(function() {
}); });
</script> </script>
{/if} {/if}
*}
<h2>{l s='Quick links'}</h2> <h2>{l s='Quick links'}</h2>
<ul class="F_list clearfix"> <ul class="F_list clearfix">
@@ -77,23 +77,24 @@
<br /> <br />
<fieldset> <fieldset>
<legend><img src="../img/t/AdminInformation.gif" alt="" /> {l s='Information about your configuration'}</legend> <legend><img src="../img/t/AdminInformation.gif" alt="" /> {l s='Information about your configuration'}</legend>
<h3>{l s='Server information'}</h3> <h3>{l s='Server information'}</h3>
<p>
<b>{l s='Prestashop version'}:</b> {$version.ps|escape:'htmlall':'UTF-8'}
</p>
{if count($uname)} {if count($uname)}
<p> <p>
<b>{l s='Server information'}:</b> {$uname|escape:'htmlall':'UTF-8'} <b>{l s='Server information'}:</b> {$uname|escape:'htmlall':'UTF-8'}
</p> </p>
{/if} {/if}
<p> <p>
<b>{l s='Server software version'}:</b> {$version.server|escape:'htmlall':'UTF-8'} <b>{l s='Server software version'}:</b> {$version.server|escape:'htmlall':'UTF-8'}
</p> </p>
<p> <p>
<b>{l s='PHP version'}:</b> {$version.php|escape:'htmlall':'UTF-8'} <b>{l s='PHP version'}:</b> {$version.php|escape:'htmlall':'UTF-8'}
</p> </p>
<p>
<b>{l s='Memory limit'}:</b> {$version.memory_limit|escape:'htmlall':'UTF-8'}
</p>
<p>
<b>{l s='Max execution time'}:</b> {$version.max_execution_time|escape:'htmlall':'UTF-8'}
</p>
{if $apache_instaweb} {if $apache_instaweb}
<p style="color:red;font-weight:700">{l s='PageSpeed module for Apache installed (mod_instaweb)'}</p> <p style="color:red;font-weight:700">{l s='PageSpeed module for Apache installed (mod_instaweb)'}</p>
{/if} {/if}
@@ -112,6 +113,9 @@
<hr /> <hr />
<h3>{l s='Store information'}</h3> <h3>{l s='Store information'}</h3>
<p>
<b>{l s='Prestashop version'}:</b> {$shop.ps|escape:'htmlall':'UTF-8'}
</p>
<p> <p>
<b>{l s='Shop URL'}:</b> {$shop.url|escape:'htmlall':'UTF-8'} <b>{l s='Shop URL'}:</b> {$shop.url|escape:'htmlall':'UTF-8'}
</p> </p>
@@ -65,7 +65,7 @@
<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'}" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader"> <p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif"> <img src="../img/loader.gif" alt="" />
</p> </p>
<p class="fr no-margin"> <p class="fr no-margin">
@@ -89,7 +89,7 @@
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" /> <input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader"> <p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif"> <img src="../img/loader.gif" alt="" />
</p> </p>
<p class="fr no-margin"> <p class="fr no-margin">
@@ -130,7 +130,7 @@
}, },
beforeSend: function(xhr) beforeSend: function(xhr)
{ {
$('#moduleContainer').html('<img src="../img/loader.gif" border="0">'); $('#moduleContainer').html('<img src="../img/loader.gif" alt="" border="0" />');
}, },
success : function(data) success : function(data)
{ {
@@ -195,7 +195,7 @@
}, },
beforeSend: function(xhr) beforeSend: function(xhr)
{ {
$('#addons_loading').html('<img src="../img/loader.gif" border="0">'); $('#addons_loading').html('<img src="../img/loader.gif" alt="" border="0" />');
}, },
success : function(data) success : function(data)
{ {
@@ -236,7 +236,7 @@
}, },
beforeSend: function(xhr) beforeSend: function(xhr)
{ {
$('#addons_loading').html('<img src="../img/loader.gif" border="0">'); $('#addons_loading').html('<img src="../img/loader.gif" alt="" border="0" />');
}, },
success : function(data) success : function(data)
{ {
@@ -60,12 +60,12 @@
<td class="document_number"> <td class="document_number">
{if get_class($document) eq 'OrderInvoice'} {if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)} {if isset($document->is_delivery)}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateDeliverySlipPDF&id_order_invoice={$document->id}"> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order_invoice={$document->id}">
{else} {else}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateInvoicePDF&id_order_invoice={$document->id}"> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order_invoice={$document->id}">
{/if} {/if}
{elseif get_class($document) eq 'OrderSlip'} {elseif get_class($document) eq 'OrderSlip'}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$document->id}"> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateOrderSlipPDF&id_order_slip={$document->id}">
{/if} {/if}
{if get_class($document) eq 'OrderInvoice'} {if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)} {if isset($document->is_delivery)}
@@ -92,6 +92,8 @@
</span> </span>
{/if} {/if}
{/if} {/if}
{elseif get_class($document) eq 'OrderSlip'}
{displayPrice price=$document->amount currency=$currency->id}
{/if} {/if}
</td> </td>
<td class="right document_action"> <td class="right document_action">
@@ -27,7 +27,7 @@
{* Generate HTML code for printing Invoice Icon with link *} {* Generate HTML code for printing Invoice Icon with link *}
<span style="width:20px; margin-right:5px;"> <span style="width:20px; margin-right:5px;">
{if ($order_state->invoice || $order->invoice_number)} {if ($order_state->invoice || $order->invoice_number)}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateInvoicePDF&id_order={$order->id}"><img src="../img/admin/tab-invoice.gif" alt="invoice" /></a> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order={$order->id}"><img src="../img/admin/tab-invoice.gif" alt="invoice" /></a>
{else} {else}
- -
{/if} {/if}
@@ -36,7 +36,7 @@
{* Generate HTML code for printing Delivery Icon with link *} {* Generate HTML code for printing Delivery Icon with link *}
<span style="width:20px;"> <span style="width:20px;">
{if ($order_state->delivery || $order->delivery_number)} {if ($order_state->delivery || $order->delivery_number)}
<a target="_blank" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateDeliverySlipPDF&id_order={$order->id}"><img src="../img/admin/delivery.gif" alt="delivery" /></a> <a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}"><img src="../img/admin/delivery.gif" alt="delivery" /></a>
{else} {else}
- -
{/if} {/if}
@@ -58,7 +58,7 @@
<td> <td>
<span id="shipping_number_show">{if $line.url && $line.tracking_number}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}</span> <span id="shipping_number_show">{if $line.url && $line.tracking_number}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}</span>
{if $line.can_edit} {if $line.can_edit}
<form style="display: inline;" method="post" action="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id|escape:'htmlall':'UTF-8'}"> <form style="display: inline;" method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id|escape:'htmlall':'UTF-8'}">
<span class="shipping_number_edit" style="display:none;"> <span class="shipping_number_edit" style="display:none;">
<input type="hidden" name="id_order_carrier" value="{$line.id_order_carrier|htmlentities}" /> <input type="hidden" name="id_order_carrier" value="{$line.id_order_carrier|htmlentities}" />
<input type="text" name="tracking_number" value="{$line.tracking_number|htmlentities}" /> <input type="text" name="tracking_number" value="{$line.tracking_number|htmlentities}" />
@@ -24,7 +24,7 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript"> <script type="text/javascript">
var id_cart = ''; var id_cart = {$cart->id|intval};
var id_customer = ''; var id_customer = '';
var changed_shipping_price = false; var changed_shipping_price = false;
var shipping_price_selected_carrier = ''; var shipping_price_selected_carrier = '';
@@ -132,8 +132,8 @@
add_cart_rule(data.id_cart_rule); add_cart_rule(data.id_cart_rule);
}); });
{if $cart->id} {if $cart->id}
setupCustomer('{$cart->id_customer}'); setupCustomer({$cart->id_customer|intval});
useCart('{$cart->id}'); useCart('{$cart->id|intval}');
{/if} {/if}
$('.delete_product').live('click', function(e) { $('.delete_product').live('click', function(e) {
@@ -474,7 +474,8 @@
token: "{getAdminToken tab='AdminCarts'}", token: "{getAdminToken tab='AdminCarts'}",
tab: "AdminCarts", tab: "AdminCarts",
action: "searchCarts", action: "searchCarts",
id_customer: id_customer id_customer: id_customer,
id_cart: id_cart
}, },
success : function(res) success : function(res)
{ {
@@ -552,7 +553,10 @@
if(res.found) if(res.found)
{ {
$('#products_err').hide(); if (!customization_errors)
$('#products_err').hide();
else
customization_errors = false;
$('#products_found').show(); $('#products_found').show();
products_found += '<label>{l s='Product:'}</label><select id="id_product" onclick="display_product_attributes();display_product_customizations();">'; products_found += '<label>{l s='Product:'}</label><select id="id_product" onclick="display_product_attributes();display_product_customizations();">';
attributes_html += '<label>{l s='Combination:'}</label>'; attributes_html += '<label>{l s='Combination:'}</label>';
@@ -950,14 +954,14 @@
<div class="margin-form"> <div class="margin-form">
<input type="text" id="customer" value="" /> <input type="text" id="customer" value="" />
<p>{l s='Search a customer by tapping the first letters of his name'}</p> <p>{l s='Search a customer by tapping the first letters of his name'}</p>
<a class="fancybox button" href="{$link->getAdminLink('AdminCustomers')}&addcustomer&liteDisplaying=1&submitFormAjax=1#"> <a class="fancybox button" href="{$link->getAdminLink('AdminCustomers')|escape:'htmlall':'UTF-8'}&addcustomer&liteDisplaying=1&submitFormAjax=1#">
<img src="../img/admin/add.gif" title="new"/><span>{l s='Add new customer'}</span> <img src="../img/admin/add.gif" title="new"/><span>{l s='Add new customer'}</span>
</a> </a>
</div> </div>
<div id="customers"> <div id="customers">
</div> </div>
</fieldset><br /> </fieldset><br />
<form action="{$link->getAdminLink('AdminOrders')}&submitAdd{$table}=1" method="post" autocomplete="off"> <form action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&submitAdd{$table}=1" method="post" autocomplete="off">
<fieldset id="products_part" style="display:none;"><legend><img src="../img/t/AdminCatalog.gif" />{l s='Cart'}</legend> <fieldset id="products_part" style="display:none;"><legend><img src="../img/t/AdminCatalog.gif" />{l s='Cart'}</legend>
<div> <div>
<label>{l s='Search a product:'} </label> <label>{l s='Search a product:'} </label>
@@ -1099,7 +1103,7 @@
<p> <p>
<label>{l s='Search a voucher:'} </label> <label>{l s='Search a voucher:'} </label>
<input type="text" id="voucher" value="" /> <input type="text" id="voucher" value="" />
<a class="fancybox button" href="{$link->getAdminLink('AdminCartRules')}&addcart_rule&liteDisplaying=1&submitFormAjax=1#"><img src="../img/admin/add.gif" title="new"/>{l s='Add new voucher'}</a> <a class="fancybox button" href="{$link->getAdminLink('AdminCartRules')|escape:'htmlall':'UTF-8'}&addcart_rule&liteDisplaying=1&submitFormAjax=1#"><img src="../img/admin/add.gif" title="new"/>{l s='Add new voucher'}</a>
</p> </p>
<div class="margin-form"> <div class="margin-form">
<table cellspacing="0" cellpadding="0" class="table" id="voucher_list"> <table cellspacing="0" cellpadding="0" class="table" id="voucher_list">
@@ -1135,36 +1139,35 @@
<div id="address_invoice_detail"> <div id="address_invoice_detail">
</div> </div>
</div> </div>
<a class="fancybox button" id="new_address" href="{$link->getAdminLink('AdminAddresses')}&addaddress&id_customer=42&liteDisplaying=1&submitFormAjax=1#"><img src="../img/admin/add.gif" title="new"/>{l s='Add new address'}</a> <a class="fancybox button" id="new_address" href="{$link->getAdminLink('AdminAddresses')|escape:'htmlall':'UTF-8'}&addaddress&id_customer=42&liteDisplaying=1&submitFormAjax=1#"><img src="../img/admin/add.gif" title="new"/>{l s='Add new address'}</a>
</fieldset> </fieldset>
<br /> <br />
<fieldset id="carriers_part" style="display:none;"> <fieldset id="carriers_part" style="display:none;">
<legend><img src="../img/t/AdminCarriers.gif" />{l s='Shipping'}</legend> <legend><img src="../img/t/AdminCarriers.gif" />{l s='Shipping'}</legend>
<div id="carriers_err" style="display:none;" class="warn"></div> <div id="carriers_err" style="display:none;" class="warn"></div>
<div id="carrier_form"> <div id="carrier_form">
<div> <div>
<p> <p>
<label>{l s='Delivery option:'} </label> <label>{l s='Delivery option:'} </label>
<select name="delivery_option" id="delivery_option"> <select name="delivery_option" id="delivery_option">
</select> </select>
</p> </p>
<p> <p>
<label for="shipping_price">{l s='Shipping price:'}</label> <span id="shipping_price" name="shipping_price"></span>&nbsp;<span class="currency_sign"></span>&nbsp; <label for="shipping_price">{l s='Shipping price:'}</label> <span id="shipping_price" name="shipping_price"></span>&nbsp;<span class="currency_sign"></span>&nbsp;
</p> </p>
<p> <p>
<label for="free_shipping">{l s='Free shipping:'}</label> <label for="free_shipping">{l s='Free shipping:'}</label>
<input type="checkbox" id="free_shipping" name="free_shipping" value="1" /> <input type="checkbox" id="free_shipping" name="free_shipping" value="1" />
</p> </p>
</div> </div>
<div id="float:left;"> <div id="float:left;">
{if $recyclable_pack} {if $recyclable_pack}
<p><input type="checkbox" name="carrier_recycled_package" value="1" id="carrier_recycled_package" /> <label for="carrier_recycled_package">{l s='Recycled package'}</label></p> <p><input type="checkbox" name="carrier_recycled_package" value="1" id="carrier_recycled_package" /> <label for="carrier_recycled_package">{l s='Recycled package'}</label></p>
{/if} {/if}
{if $gift_wrapping} {if $gift_wrapping}
<p><input type="checkbox" name="order_gift" id="order_gift" value="1" /> <label for="order_gift">{l s='Gift'}</label></p> <p><input type="checkbox" name="order_gift" id="order_gift" value="1" /> <label for="order_gift">{l s='Gift'}</label></p>
<p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p> <p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p>
{/if} {/if}
</div>
</div> </div>
</div> </div>
</fieldset> </fieldset>
@@ -33,20 +33,19 @@
</head> </head>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
{if $customization_errors|count} {if $customization_errors}
customization_errors = true; parent.customization_errors = true;
var id_selected_product = parent.$('#id_product option:selected').val();
if (parent.searchProducts())
{
parent.$('#products_err', window.parent.document).html('{$customization_errors}');
parent.$('#id_product option[value="'+id_selected_product+'"]').attr('selected', true);
parent.$('#id_product').change();
}
{else} {else}
parent.customization_errors = false;
parent.$('#products_err', window.parent.document).hide(); parent.$('#products_err', window.parent.document).hide();
customization_errors = false;
{/if} {/if}
var id_selected_product = parent.$('#id_product option:selected').val();
if (parent.searchProducts())
{
parent.$('#products_err', window.parent.document).html('{$customization_errors}');
parent.$('#id_product option[value="'+id_selected_product+'"]').attr('selected', true);
parent.$('#id_product').change();
}
</script> </script>
</body> </body>
</html> </html>
@@ -64,7 +64,7 @@
<div class="bloc-command"> <div class="bloc-command">
<div class="button-command"> <div class="button-command">
{if (count($invoices_collection))} {if (count($invoices_collection))}
<a class="button" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateInvoicePDF&id_order={$order->id}" target="_blank"> <a class="button" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order={$order->id}" target="_blank">
<img src="../img/admin/charged_ok.gif" alt="{l s='View invoice'}" /> {l s='View invoice'} <img src="../img/admin/charged_ok.gif" alt="{l s='View invoice'}" /> {l s='View invoice'}
</a> </a>
{else} {else}
@@ -72,7 +72,7 @@
{/if} {/if}
| |
{if (($currentState && $currentState->delivery) || $order->delivery_number)} {if (($currentState && $currentState->delivery) || $order->delivery_number)}
<a class="button" href="{$link->getAdminLink('AdminPdf')}&submitAction=generateDeliverySlipPDF&id_order={$order->id}" target="_blank"> <a class="button" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}" target="_blank">
<img src="../img/admin/delivery.gif" alt="{l s='View delivery slip'}" /> {l s='View delivery slip'} <img src="../img/admin/delivery.gif" alt="{l s='View delivery slip'}" /> {l s='View delivery slip'}
</a> </a>
{else} {else}
@@ -90,6 +90,10 @@
<dt>{l s='Messages:'}</dt> <dt>{l s='Messages:'}</dt>
<dd>{sizeof($messages)}</dd> <dd>{sizeof($messages)}</dd>
|</dl> |</dl>
<dl>
<dt><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{l s='New Customer Messages:'}</a></dt>
<dd><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{sizeof($customer_thread_message)}</a></dd>
|</dl>
<dl> <dl>
<dt>{l s='Products:'}</dt> <dt>{l s='Products:'}</dt>
<dd id="product_number">{sizeof($products)}</dd> <dd id="product_number">{sizeof($products)}</dd>
@@ -198,8 +202,8 @@
<div style="width: 49%; float:right;"> <div style="width: 49%; float:right;">
<div class="button-command-prev-next"> <div class="button-command-prev-next">
<b>{l s='Orders'}</b> : <b>{l s='Orders'}</b> :
{if $previousOrder}<a class="button" href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$previousOrder}">{l s='< Prev'}</a>{/if} {if $previousOrder}<a class="button" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$previousOrder}">{l s='< Prev'}</a>{/if}
{if $nextOrder}<a class="button" href="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$nextOrder}">{l s='Next >'}</a>{/if} {if $nextOrder}<a class="button" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$nextOrder}">{l s='Next >'}</a>{/if}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
@@ -389,7 +393,7 @@
<td> <td>
<input type="text" name="payment_transaction_id" value="" /> <input type="text" name="payment_transaction_id" value="" />
</td> </td>
<td {if count($not_paid_invoices_collection) <= 0}colspan="2"{/if}> <td>
<input type="text" name="payment_amount" size="5" value="" /> <input type="text" name="payment_amount" size="5" value="" />
<select name="payment_currency"> <select name="payment_currency">
{foreach from=$currencies item=current_currency} {foreach from=$currencies item=current_currency}
@@ -397,10 +401,10 @@
{/foreach} {/foreach}
</select> </select>
</td> </td>
{if count($not_paid_invoices_collection) > 0} {if count($invoices_collection) > 0}
<td> <td>
<select name="payment_invoice" id="payment_invoice"> <select name="payment_invoice" id="payment_invoice">
{foreach from=$not_paid_invoices_collection item=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)}</option>
{/foreach} {/foreach}
</select> </select>
@@ -473,7 +477,7 @@
<td> <td>
<span id="shipping_number_show">{if isset($line.url) && isset($line.tracking_number)}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{elseif isset($line.tracking_number)}{$line.tracking_number}{/if}</span> <span id="shipping_number_show">{if isset($line.url) && isset($line.tracking_number)}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{elseif isset($line.tracking_number)}{$line.tracking_number}{/if}</span>
{if $line.can_edit} {if $line.can_edit}
<form style="display: inline;" method="post" action="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}&id_order_invoice={if $line.id_order_invoice}{$line.id_order_invoice|escape:'htmlall':'UTF-8'}{else}0{/if}&id_carrier={if $line.id_carrier}{$line.id_carrier|escape:'htmlall':'UTF-8'}{else}0{/if}"> <form style="display: inline;" method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id}&id_order_invoice={if $line.id_order_invoice}{$line.id_order_invoice|escape:'htmlall':'UTF-8'}{else}0{/if}&id_carrier={if $line.id_carrier}{$line.id_carrier|escape:'htmlall':'UTF-8'}{else}0{/if}">
<span class="shipping_number_edit" style="display:none;"> <span class="shipping_number_edit" style="display:none;">
<input type="text" name="tracking_number" value="{$line.tracking_number|htmlentities}" /> <input type="text" name="tracking_number" value="{$line.tracking_number|htmlentities}" />
<input type="submit" class="button" name="submitShippingNumber" value="{l s='Update'}" /> <input type="submit" class="button" name="submitShippingNumber" value="{l s='Update'}" />
@@ -510,7 +514,7 @@
<legend><img src="../img/admin/delivery.gif" alt="{l s='Shipping address'}" />{l s='Shipping address'}</legend> <legend><img src="../img/admin/delivery.gif" alt="{l s='Shipping address'}" />{l s='Shipping address'}</legend>
{if $can_edit} {if $can_edit}
<form method="post" action="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}"> <form method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id}">
<div style="margin-bottom:5px;"> <div style="margin-bottom:5px;">
<p> <p>
<select name="id_address"> <select name="id_address">
@@ -540,7 +544,7 @@
<legend><img src="../img/admin/invoice.gif" alt="{l s='Invoice address'}" />{l s='Invoice address'}</legend> <legend><img src="../img/admin/invoice.gif" alt="{l s='Invoice address'}" />{l s='Invoice address'}</legend>
{if $can_edit} {if $can_edit}
<form method="post" action="{$link->getAdminLink('AdminOrders')}&vieworder&id_order={$order->id}"> <form method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id}">
<div style="margin-bottom:5px;"> <div style="margin-bottom:5px;">
<p> <p>
<select name="id_address"> <select name="id_address">
@@ -658,7 +662,7 @@
<tr id="total_shipping"> <tr id="total_shipping">
<td><b>{l s='Shipping'}</b></td> <td><b>{l s='Shipping'}</b></td>
<td class="amount" align="right">{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}</td> <td class="amount" align="right">{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}</td>
<td class="partial_refund_fields current-edit" style="display:none;"><input type="text" size="3" name="partialRefundShippingCost" /> &euro;</td> <td class="partial_refund_fields current-edit" style="display:none;"><input type="text" size="3" name="partialRefundShippingCost" value="0" /> &euro;</td>
</tr> </tr>
<tr style="font-size: 20px" id="total_order"> <tr style="font-size: 20px" id="total_order">
<td style="font-size: 20px">{l s='Total'}</td> <td style="font-size: 20px">{l s='Total'}</td>
@@ -745,7 +749,7 @@
<div id="message_m" style="display: {if Tools::getValue('message')}none{else}block{/if}; overflow: auto; width: 400px;"> <div id="message_m" style="display: {if Tools::getValue('message')}none{else}block{/if}; overflow: auto; width: 400px;">
<a href="#" onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false"><b>{l s='Click here'}</b> {l s='to add a comment or send a message to the customer'}</a> <a href="#" onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false"><b>{l s='Click here'}</b> {l s='to add a comment or send a message to the customer'}</a>
</div> </div>
<a href="{$link->getAdminLink('AdminCustomerThreads')}"><b>{l s='Click here'}</b> {l s='to see all messages'}</a><br> <a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}"><b>{l s='Click here'}</b> {l s='to see all messages'}</a><br>
<div id="message" style="display: {if Tools::getValue('message')}block{else}none{/if}"> <div id="message" style="display: {if Tools::getValue('message')}block{else}none{/if}">
<select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, '{l s='Do you want to overwrite your existing message?'}')"> <select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, '{l s='Do you want to overwrite your existing message?'}')">
<option value="0" selected="selected">-- {l s='Choose a standard message'} --</option> <option value="0" selected="selected">-- {l s='Choose a standard message'} --</option>
@@ -26,5 +26,5 @@
{* Generate HTML code for printing Invoice Icon with link *} {* Generate HTML code for printing Invoice Icon with link *}
<span style="width:20px; margin-right:5px;"> <span style="width:20px; margin-right:5px;">
<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateInvoicePDF&id_order_invoice={$id_invoice}"><img src="../img/admin/tab-invoice.gif" alt="invoice" /></a> <a href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateInvoicePDF&id_order_invoice={$id_invoice}"><img src="../img/admin/tab-invoice.gif" alt="invoice" /></a>
</span> </span>
@@ -51,7 +51,7 @@
<tr> <tr>
<td></td> <td></td>
<td class="col-right"> <td class="col-right">
<a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminCategories')}&addcategory"> <a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminCategories')|escape:'htmlall':'UTF-8'}&addcategory">
<img src="../img/admin/add.gif" alt="{l s='Create new category'}" title="{l s='Create new category'}" /> <img src="../img/admin/add.gif" alt="{l s='Create new category'}" title="{l s='Create new category'}" />
<span>{l s='Create new category'}</span> <span>{l s='Create new category'}</span>
</a> </a>
@@ -110,7 +110,7 @@
{/if} {/if}
<option disabled="disabled">----------</option> <option disabled="disabled">----------</option>
</select>&nbsp;&nbsp;&nbsp; </select>&nbsp;&nbsp;&nbsp;
<a class="button bt-icon confirm_leave" style="margin-bottom:0" href="{$link->getAdminLink('AdminManufacturers')}&addmanufacturer"> <a class="button bt-icon confirm_leave" style="margin-bottom:0" href="{$link->getAdminLink('AdminManufacturers')|escape:'htmlall':'UTF-8'}&addmanufacturer">
<img src="../img/admin/add.gif" alt="{l s='Create new manufacturer'}" title="{l s='Create new manufacturer'}" /> <img src="../img/admin/add.gif" alt="{l s='Create new manufacturer'}" title="{l s='Create new manufacturer'}" />
<span>{l s='Create new manufacturer'}</span> <span>{l s='Create new manufacturer'}</span>
</a> </a>
@@ -72,7 +72,7 @@
{else} {else}
<input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" /> <input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" />
<span>{l s='N/A'} - <span>{l s='N/A'} -
<a href="{$link->getAdminLink('AdminFeatures')}&amp;addfeature_value&id_feature={$available_feature.id_feature}" <a href="{$link->getAdminLink('AdminFeatures')|escape:'htmlall':'UTF-8'}&amp;addfeature_value&id_feature={$available_feature.id_feature}"
class="confirm_leave button"><img src="../img/admin/add.gif" alt="values_first" title="{l s='Add pre-defined values first'}" />&nbsp;{l s='Add pre-defined values first'}</a> class="confirm_leave button"><img src="../img/admin/add.gif" alt="values_first" title="{l s='Add pre-defined values first'}" />&nbsp;{l s='Add pre-defined values first'}</a>
</span> </span>
{/if} {/if}
@@ -94,7 +94,7 @@
</table> </table>
<div class="separation"></div> <div class="separation"></div>
<div> <div>
<a href="{$link->getAdminLink('AdminFeatures')}&amp;addfeature" class="confirm_leave button"> <a href="{$link->getAdminLink('AdminFeatures')|escape:'htmlall':'UTF-8'}&amp;addfeature" class="confirm_leave button">
<img src="../img/admin/add.gif" alt="new_features" title="{l s='Add a new feature'}" />&nbsp;{l s='Add a new feature'} <img src="../img/admin/add.gif" alt="new_features" title="{l s='Add a new feature'}" />&nbsp;{l s='Add a new feature'}
</a> </a>
</div> </div>
@@ -83,7 +83,7 @@
<script type="text/javascript"> <script type="text/javascript">
var token = '{$token}'; var token = '{$token}';
var id_product = {if isset($product->id)}{$product->id}{else}0{/if}; var id_product = {if isset($product->id)}{$product->id}{else}0{/if};
var defaultLanguage = {$defaultLanguage}; var id_lang_default = {$id_lang_default};
var product_type_pack = {Product::PTYPE_PACK}; var product_type_pack = {Product::PTYPE_PACK};
var product_type_virtual = {Product::PTYPE_VIRTUAL}; var product_type_virtual = {Product::PTYPE_VIRTUAL};
var product_type_simple = {Product::PTYPE_SIMPLE}; var product_type_simple = {Product::PTYPE_SIMPLE};
@@ -237,7 +237,7 @@
<form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product" style="display:none;"> <form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product" style="display:none;">
<input type="hidden" name="id_product" value="{$id_product}" /> <input type="hidden" name="id_product" value="{$id_product}" />
<input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual}" /> <input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual|escape:html:'UTF-8'}" />
<div class="tab-pane" id="tabPane1"> <div class="tab-pane" id="tabPane1">
{if !$product->active && $product->isAssociatedToShop()} {if !$product->active && $product->isAssociatedToShop()}
<div class="warn draft" > <div class="warn draft" >
@@ -136,7 +136,7 @@
<tr> <tr>
<td class="col-left"><label>{$bullet_common_field} {l s='UPC:'}</label></td> <td class="col-left"><label>{$bullet_common_field} {l s='UPC:'}</label></td>
<td style="padding-bottom:5px;"> <td style="padding-bottom:5px;">
<input size="55" maxlength="12" type="text" name="upc" value="{$product->upc}" style="width: 130px; margin-right: 5px;" /> <span class="small">{l s='(US, Canada)'}</span> <input size="55" maxlength="12" type="text" name="upc" value="{$product->upc|escape:html:'UTF-8'}" style="width: 130px; margin-right: 5px;" /> <span class="small">{l s='(US, Canada)'}</span>
</td> </td>
</tr> </tr>
</table> </table>
@@ -25,10 +25,10 @@
*} *}
<script type="text/javascript"> <script type="text/javascript">
var Customer = new Object();
var product_url = '{$link->getAdminLink('AdminProducts', true)}'; var product_url = '{$link->getAdminLink('AdminProducts', true)}';
$(document).ready(function () { $(document).ready(function () {
var Customer = { Customer = {
"hiddenField": jQuery('#id_customer'), "hiddenField": jQuery('#id_customer'),
"field": jQuery('#customer'), "field": jQuery('#customer'),
"container": jQuery('#customers'), "container": jQuery('#customers'),
@@ -166,12 +166,12 @@ $(document).ready(function () {
</option> </option>
{/foreach} {/foreach}
</select> </select>
<a class="button" href="{$link->getAdminLink('AdminTaxRulesGroup')}&addtax_rules_group&id_product={$product->id}" class="confirm_leave"> <a class="button" href="{$link->getAdminLink('AdminTaxRulesGroup')|escape:'htmlall':'UTF-8'}&addtax_rules_group&id_product={$product->id}" class="confirm_leave">
<img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> {l s='Create'} <img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> {l s='Create'}
</a> </a>
</span> </span>
{if $tax_exclude_taxe_option} {if $tax_exclude_taxe_option}
<span style="margin-left:10px; color:red;">{l s='Taxes are currently disabled'}</span> (<b><a href="{$link->getAdminLink('AdminTaxes')}">{l s='Tax options'}</a></b>) <span style="margin-left:10px; color:red;">{l s='Taxes are currently disabled'}</span> (<b><a href="{$link->getAdminLink('AdminTaxes')|escape:'htmlall':'UTF-8'}">{l s='Tax options'}</a></b>)
<input type="hidden" value="{$product->getIdTaxRulesGroup()}" name="id_tax_rules_group" /> <input type="hidden" value="{$product->getIdTaxRulesGroup()}" name="id_tax_rules_group" />
{/if} {/if}
</td> </td>
@@ -72,12 +72,21 @@
<label>{l s='Carriers:'}</label> <label>{l s='Carriers:'}</label>
</td> </td>
<td class="padding-bottom:5px;"> <td class="padding-bottom:5px;">
<select name="carriers[]" multiple="multiple" size="4" style="height:100px;width:200px;"> <select name="carriers[]" id="carriers_restriction" multiple="multiple" size="4" style="height:100px;width:200px;">
{foreach $carrier_list as $carrier} {foreach $carrier_list as $carrier}
<option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option> <option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option>
{/foreach} {/foreach}
</select> </select>
<br>
<button class="button" onclick="unselectAllCarriers(); return false;">{l s='Unselect all'}</button>
<p class="preference_description">{l s='If no carrier selected, all carriers could be used to ship this product.'}</p> <p class="preference_description">{l s='If no carrier selected, all carriers could be used to ship this product.'}</p>
</td> </td>
</tr> </tr>
</table> </table>
<script>
function unselectAllCarriers()
{
$('#carriers_restriction option').each(function () { $(this).removeAttr('selected')});
return false;
}
</script>
@@ -36,7 +36,7 @@
<p>{l s='When using the advanced stock management (see Preferences/Products), the values you fill here (prices, references) will be used in the supply orders.'}</p> <p>{l s='When using the advanced stock management (see Preferences/Products), the values you fill here (prices, references) will be used in the supply orders.'}</p>
</div> </div>
<p>{l s='Please choose the suppliers associated with this product, and the default one.'}</p> <p>{l s='Please choose the suppliers associated with this product, and the default one.'}</p>
<a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminSuppliers')}&addsupplier"> <a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminSuppliers')|escape:'htmlall':'UTF-8'}&addsupplier">
<img src="../img/admin/add.gif" alt="{l s='Create new supplier'}" title="{l s='Create new supplier'}" /><span>{l s='Create new supplier'}</span> <img src="../img/admin/add.gif" alt="{l s='Create new supplier'}" title="{l s='Create new supplier'}" /><span>{l s='Create new supplier'}</span>
</a> </a>
<table cellpadding="5" style="width:100%"> <table cellpadding="5" style="width:100%">
@@ -35,7 +35,7 @@
</div> </div>
<p>{l s='Please choose the warehouses associated with this product, and the default one.'}</p> <p>{l s='Please choose the warehouses associated with this product, and the default one.'}</p>
<a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminWarehouses')}&addwarehouse"> <a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminWarehouses')|escape:'htmlall':'UTF-8'}&addwarehouse">
<img src="../img/admin/add.gif" alt="{l s='Create new warehouse'}" title="{l s='Create new warehouse'}" /><span>{l s='Create new warehouse'}</span> <img src="../img/admin/add.gif" alt="{l s='Create new warehouse'}" title="{l s='Create new warehouse'}" /><span>{l s='Create new warehouse'}</span>
</a> </a>
@@ -31,7 +31,7 @@
{if isset($tr.$key)} {if isset($tr.$key)}
<a href="{$tr.$key}" onmouseover="$(this).css('text-decoration', 'underline')" onmouseout="$(this).css('text-decoration', 'none')" target="_blank">{$tr.$key}</a> <a href="{$tr.$key}" onmouseover="$(this).css('text-decoration', 'underline')" onmouseout="$(this).css('text-decoration', 'none')" target="_blank">{$tr.$key}</a>
{else} {else}
<a href="{$link->getAdminLink('AdminShopUrl')}&id_shop={$tr.$identifier}&addshop_url" class="multishop_warning">{l s='Click here to set an URL for this shop'}</a> <a href="{$link->getAdminLink('AdminShopUrl')|escape:'htmlall':'UTF-8'}&id_shop={$tr.$identifier}&addshop_url" class="multishop_warning">{l s='Click here to set an URL for this shop'}</a>
{/if} {/if}
{else} {else}
{$smarty.block.parent} {$smarty.block.parent}
@@ -146,17 +146,27 @@ function toggle_condition_group(id_condition_group)
} }
function add_condition(id_condition_group, type, value) function add_condition(id_condition_group, type, value)
{ {
var id_condition = id_condition_group+'_'+type+'_'+value;
if (typeof conditions[id_condition] != 'undefined')
return false;
var condition = new Array(); var condition = new Array();
condition.type = type; condition.type = type;
condition.value = value; condition.value = value;
condition.id_condition_group = id_condition_group; condition.id_condition_group = id_condition_group;
conditions.push(condition); conditions[id_condition] = condition;
return id_condition;
}
function delete_condition(condition)
{
delete conditions[condition];
$('#'+condition).remove();
return false;
} }
function new_condition_group() function new_condition_group()
{ {
last_condition_group++; last_condition_group++;
var html = '<div class="condition_group" id="condition_group_'+last_condition_group+'"><h3>{l s='Condition group'} '+last_condition_group+'</h3>'; var html = '<div class="condition_group" id="condition_group_'+last_condition_group+'"><h3>{l s='Condition group'} '+last_condition_group+'</h3>';
html += '<table cellspacing="0" cellpadding="0" class="table width3"><thead><tr><th width="196px" height="39">{l s='Type'}</th><th width="300px">{l s='Value'}</th></tr></thead><tbody></tbody></table>'; html += '<table cellspacing="0" cellpadding="0" class="table width3"><thead><tr><th width="196px" height="39">{l s='Type'}</th><th width="300px">{l s='Value'}</th><th></th></tr></thead><tbody></tbody></table>';
html += '</div><div class="condition_separator">{l s='OR'}</div><div class="separation"></div>'; html += '</div><div class="condition_separator">{l s='OR'}</div><div class="separation"></div>';
$('#condition_group_list').append(html); $('#condition_group_list').append(html);
toggle_condition_group(last_condition_group); toggle_condition_group(last_condition_group);
@@ -170,9 +180,8 @@ $(document).ready(function() {
}); });
$('#specific_price_rule_form').live('submit', function(e) { $('#specific_price_rule_form').live('submit', function(e) {
var html = ''; var html = '';
$.each(conditions, function() { for (i in conditions)
html += '<input type="hidden" name="condition_group_'+this.id_condition_group+'[]" value="'+this.type+'_'+this.value+'" />'; html += '<input type="hidden" name="condition_group_'+conditions[i].id_condition_group+'[]" value="'+conditions[i].type+'_'+conditions[i].value+'" />';
});
$('#conditions').append(html); $('#conditions').append(html);
}); });
$('#id_feature').change(function() { $('#id_feature').change(function() {
@@ -184,32 +193,42 @@ $(document).ready(function() {
$('#id_attribute_'+$(this).val()).show(); $('#id_attribute_'+$(this).val()).show();
}); });
$('#add_condition_category').click(function() { $('#add_condition_category').click(function() {
add_condition(current_id_condition_group, 'category', $('#id_category option:selected').val()); var id_condition = add_condition(current_id_condition_group, 'category', $('#id_category option:selected').val());
var html = '<tr><td>{l s='Category'}</td><td>'+$('#id_category option:selected').html()+'</td></tr>'; if (!id_condition)
return false;
var html = '<tr id="'+id_condition+'"><td>{l s='Category'}</td><td>'+$('#id_category option:selected').html()+'</td><td><a href="#" onclick="delete_condition(\''+id_condition+'\');"><img src="../img/admin/delete.gif" /></a></td></tr>';
$('#condition_group_'+current_id_condition_group+' table tbody').append(html); $('#condition_group_'+current_id_condition_group+' table tbody').append(html);
return false; return false;
}); });
$('#add_condition_manufacturer').click(function() { $('#add_condition_manufacturer').click(function() {
add_condition(current_id_condition_group, 'manufacturer', $('#id_manufacturer option:selected').val()); var id_condition = add_condition(current_id_condition_group, 'manufacturer', $('#id_manufacturer option:selected').val());
var html = '<tr><td>{l s='Manufacturer'}</td><td>'+$('#id_manufacturer option:selected').html()+'</td></tr>'; if (!id_condition)
return false;
var html = '<tr id="'+id_condition+'"><td>{l s='Manufacturer'}</td><td>'+$('#id_manufacturer option:selected').html()+'</td><td><a href="#" onclick="delete_condition(\''+id_condition+'\');"><img src="../img/admin/delete.gif" /></a></td></tr>';
$('#condition_group_'+current_id_condition_group+' table tbody').append(html); $('#condition_group_'+current_id_condition_group+' table tbody').append(html);
return false; return false;
}); });
$('#add_condition_supplier').click(function() { $('#add_condition_supplier').click(function() {
add_condition(current_id_condition_group, 'supplier', $('#id_supplier option:selected').val()); var id_condition = add_condition(current_id_condition_group, 'supplier', $('#id_supplier option:selected').val());
var html = '<tr><td>{l s='Supplier'}</td><td>'+$('#id_supplier option:selected').html()+'</td></tr>'; if (!id_condition)
return false;
var html = '<tr id="'+id_condition+'"><td>{l s='Supplier'}</td><td>'+$('#id_supplier option:selected').html()+'</td><td><a href="#" onclick="delete_condition(\''+id_condition+'\');"><img src="../img/admin/delete.gif" /></a></td></tr>';
$('#condition_group_'+current_id_condition_group+' table tbody').append(html); $('#condition_group_'+current_id_condition_group+' table tbody').append(html);
return false; return false;
}); });
$('#add_condition_attribute').click(function() { $('#add_condition_attribute').click(function() {
add_condition(current_id_condition_group, 'attribute', $('#id_attribute_'+$('#id_attribute_group option:selected').val()+' option:selected').val()); var id_condition = add_condition(current_id_condition_group, 'attribute', $('#id_attribute_'+$('#id_attribute_group option:selected').val()+' option:selected').val());
var html = '<tr><td>{l s='Attribute'}</td><td>'+$('#id_attribute_group option:selected').html()+': '+$('#id_attribute_'+$('#id_attribute_group option:selected').val()+' option:selected').html()+'</td></tr>'; if (!id_condition)
return false;
var html = '<tr id="'+id_condition+'"><td>{l s='Attribute'}</td><td>'+$('#id_attribute_group option:selected').html()+': '+$('#id_attribute_'+$('#id_attribute_group option:selected').val()+' option:selected').html()+'</td><td><a href="#" onclick="delete_condition(\''+id_condition+'\');"><img src="../img/admin/delete.gif" /></a></td></tr>';
$('#condition_group_'+current_id_condition_group+' table tbody').append(html); $('#condition_group_'+current_id_condition_group+' table tbody').append(html);
return false; return false;
}); });
$('#add_condition_feature').click(function() { $('#add_condition_feature').click(function() {
add_condition(current_id_condition_group, 'feature', $('#id_feature_'+$('#id_feature option:selected').val()+' option:selected').val()); var id_condition = add_condition(current_id_condition_group, 'feature', $('#id_feature_'+$('#id_feature option:selected').val()+' option:selected').val());
var html = '<tr><td>{l s='Feature'}</td><td>'+$('#id_feature option:selected').html()+': '+$('#id_feature_'+$('#id_feature option:selected').val()+' option:selected').html()+'</td></tr>'; if (!id_condition)
return false;
var html = '<tr id="'+id_condition+'"><td>{l s='Feature'}</td><td>'+$('#id_feature option:selected').html()+': '+$('#id_feature_'+$('#id_feature option:selected').val()+' option:selected').html()+'</td><td><a href="#" onclick="delete_condition(\''+id_condition+'\');"><img src="../img/admin/delete.gif" /></a></td></tr>';
$('#condition_group_'+current_id_condition_group+' table tbody').append(html); $('#condition_group_'+current_id_condition_group+' table tbody').append(html);
return false; return false;
}); });
@@ -68,7 +68,7 @@ $(document).ready(function() {
<img src="../img/admin/pdf.gif" alt="{l s='Supply Order State'}"> <img src="../img/admin/pdf.gif" alt="{l s='Supply Order State'}">
{l s='Print the supply order form'} {l s='Print the supply order form'}
</legend> </legend>
<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateSupplyOrderFormPDF&id_supply_order={$supply_order->id}" target="_blank" title="Export as PDF">{l s='Click here to download the supply order form'}.</a> <a href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateSupplyOrderFormPDF&id_supply_order={$supply_order->id}" target="_blank" title="Export as PDF">{l s='Click here to download the supply order form'}.</a>
</fieldset> </fieldset>
{/if} {/if}
@@ -47,7 +47,7 @@
<td> <td>
<select multiple id="select_right" name="products[]"> <select multiple id="select_right" name="products[]">
{foreach from=$field.products item='product'} {foreach from=$field.products item='product'}
<option value="{$product.id_product}">{$product.name}</option> <option selected="selected" value="{$product.id_product}">{$product.name}</option>
{/foreach} {/foreach}
</select> </select>
<span class="hint" name="help_box">{l s='Double-click to move to other column'}<span class="hint-pointer">&nbsp;</span></span> <span class="hint" name="help_box">{l s='Double-click to move to other column'}<span class="hint-pointer">&nbsp;</span></span>
@@ -78,7 +78,7 @@
}); });
$('#tag_form').submit(function() $('#tag_form').submit(function()
{ {
$('#select_left option').each(function(i){ $('#select_right option').each(function(i){
$(this).attr("selected", "selected"); $(this).attr("selected", "selected");
}); });
}); });
@@ -68,7 +68,8 @@
</select> </select>
<select name="theme" style="float:left; margin-right:10px;"> <select name="theme" style="float:left; margin-right:10px;">
{foreach $themes as $theme} {foreach $themes as $theme}
<option value="{$theme->directory}">{$theme->name} &nbsp;</option>
<option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name} &nbsp;</option>
{/foreach} {/foreach}
</select> </select>
{foreach $languages as $language} {foreach $languages as $language}
@@ -152,7 +153,7 @@
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<select name="theme" style="margin-top:10px;"> <select name="theme" style="margin-top:10px;">
{foreach $themes as $theme} {foreach $themes as $theme}
<option value="{$theme->directory}">{$theme->name}</option> <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
{/foreach} {/foreach}
</select>&nbsp;&nbsp; </select>&nbsp;&nbsp;
<input type="submit" class="button" name="submitExport" value="{l s='Export'}" /> <input type="submit" class="button" name="submitExport" value="{l s='Export'}" />
@@ -176,7 +177,7 @@
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<select name="fromTheme"> <select name="fromTheme">
{foreach $themes as $theme} {foreach $themes as $theme}
<option value="{$theme->directory}">{$theme->name}</option> <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
{/foreach} {/foreach}
</select> <span style="font-style: bold; color: red;">*</span> </select> <span style="font-style: bold; color: red;">*</span>
</p> </p>
@@ -190,7 +191,7 @@
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<select name="toTheme"> <select name="toTheme">
{foreach $themes as $theme} {foreach $themes as $theme}
<option value="{$theme->directory}">{$theme->name}</option> <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
{/foreach} {/foreach}
</select> </select>
</p> </p>
@@ -28,7 +28,7 @@
{block name="override_tpl"} {block name="override_tpl"}
{if $post_limit_exceeded} {if !empty($limit_warning)}
<div class="warn"> <div class="warn">
{if $limit_warning['error_type'] == 'suhosin'} {if $limit_warning['error_type'] == 'suhosin'}
{l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'}
@@ -28,7 +28,7 @@
{block name="override_tpl"} {block name="override_tpl"}
{if $post_limit_exceeded} {if !empty($limit_warning)}
<div class="warn"> <div class="warn">
{if $limit_warning['error_type'] == 'suhosin'} {if $limit_warning['error_type'] == 'suhosin'}
{l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'}
@@ -37,7 +37,7 @@
<b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/> <b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/>
{l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} {l s='Please ask your hosting provider to increase the suhosin post and request a limit of'}
{else} {else}
{l s='Warning, your PHP configuration limits the maximum number of fields to post in a form:'}<br/> {l s='Warning, your PHP configuration limits the maximum number of fields to post in a form:'}
<b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/> <b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/>
{l s='Please ask your hosting provider to increase the this limit to'} {l s='Please ask your hosting provider to increase the this limit to'}
{/if} {/if}
@@ -30,7 +30,7 @@
{$tinyMCE} {$tinyMCE}
{if $post_limit_exceeded} {if !empty($limit_warning)}
<div class="warn"> <div class="warn">
{if $limit_warning['error_type'] == 'suhosin'} {if $limit_warning['error_type'] == 'suhosin'}
{l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'}
@@ -28,7 +28,7 @@
{block name="override_tpl"} {block name="override_tpl"}
{if $post_limit_exceeded} {if !empty($limit_warning)}
<div class="warn"> <div class="warn">
{if $limit_warning['error_type'] == 'suhosin'} {if $limit_warning['error_type'] == 'suhosin'}
{l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'}
@@ -24,7 +24,9 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div> </div>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div> </div>
{if $display_footer} {if $display_footer}
{hook h="displayBackOfficeFooter"} {hook h="displayBackOfficeFooter"}
+81 -73
View File
@@ -81,19 +81,19 @@
{/if} {/if}
<link rel="shortcut icon" href="{$img_dir}favicon.ico" /> <link rel="shortcut icon" href="{$img_dir}favicon.ico" />
{if $display_header} {if isset($displayBackOfficeHeader)}
{hook h="displayBackOfficeHeader"} {$displayBackOfficeHeader}
{/if} {/if}
<!--[if IE]> <!--[if IE]>
<link type="text/css" rel="stylesheet" href="{$base_url}css/admin-ie.css" /> <link type="text/css" rel="stylesheet" href="{$base_url}css/admin-ie.css" />
<![endif]--> <![endif]-->
{if isset($brightness)}
<style type="text/css"> <style type="text/css">
div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess { div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess {ldelim}color:{$brightness}{rdelim}
color:{$brightness}
}
</style> </style>
{/if}
</head> </head>
<body style="{if $bo_color}background:{$bo_color};{/if}{if $bo_width > 0}text-align:center;{/if}"> <body style="{if isset($bo_color) && $bo_color}background:{$bo_color};{/if}{if isset($bo_width) && $bo_width > 0}text-align:center;{/if}">
{if $display_header} {if $display_header}
<div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div> <div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div>
@@ -102,7 +102,7 @@
{* begin HEADER *} {* begin HEADER *}
<div id="header"> <div id="header">
<div id="header_infos"> <div id="header_infos">
<a id="header_shopname" href="{$link->getAdminLink('AdminHome')}"><span>{$shop_name}</span></a><div id="notifs_icon_wrapper"> <a id="header_shopname" href="{$link->getAdminLink('AdminHome')|escape:'htmlall':'UTF-8'}"><span>{$shop_name}</span></a><div id="notifs_icon_wrapper">
{if {$show_new_orders} == 1} {if {$show_new_orders} == 1}
<div id="orders_notif" class="notifs"> <div id="orders_notif" class="notifs">
<span id="orders_notif_number_wrapper" class="number_wrapper"> <span id="orders_notif_number_wrapper" class="number_wrapper">
@@ -112,7 +112,7 @@
<h3>{l s='Last orders'}</h3> <h3>{l s='Last orders'}</h3>
<p class="no_notifs">{l s='No new orders has been placed on your shop'}</p> <p class="no_notifs">{l s='No new orders has been placed on your shop'}</p>
<ul id="list_orders_notif"></ul> <ul id="list_orders_notif"></ul>
<p><a href="index.php?controller=AdminOrders&token={getAdminToken tab='AdminOrders'}">{l s='Show all orders'}</a></p> <p><a href="index.php?controller=AdminOrders&amp;token={getAdminToken tab='AdminOrders'}">{l s='Show all orders'}</a></p>
</div> </div>
</div> </div>
{/if} {/if}
@@ -125,7 +125,7 @@
<h3>{l s='Last customers'}</h3> <h3>{l s='Last customers'}</h3>
<p class="no_notifs">{l s='No new customers registered on your shop'}</p> <p class="no_notifs">{l s='No new customers registered on your shop'}</p>
<ul id="list_customers_notif"></ul> <ul id="list_customers_notif"></ul>
<p><a href="index.php?controller=AdminCustomers&token={getAdminToken tab='AdminCustomers'}">{l s='Show all customers'}</a></p> <p><a href="index.php?controller=AdminCustomers&amp;token={getAdminToken tab='AdminCustomers'}">{l s='Show all customers'}</a></p>
</div> </div>
</div> </div>
{/if} {/if}
@@ -138,81 +138,89 @@
<h3>{l s='Last messages'}</h3> <h3>{l s='Last messages'}</h3>
<p class="no_notifs">{l s='No new messages posted on your shop'}</p> <p class="no_notifs">{l s='No new messages posted on your shop'}</p>
<ul id="list_customer_messages_notif"></ul> <ul id="list_customer_messages_notif"></ul>
<p><a href="index.php?tab=AdminCustomerThreads&token={getAdminToken tab='AdminCustomerThreads'}">{l s='Show all messages'}</a></p> <p><a href="index.php?tab=AdminCustomerThreads&amp;token={getAdminToken tab='AdminCustomerThreads'}">{l s='Show all messages'}</a></p>
</div> </div>
</div> </div>
{/if} {/if}
</div> </div>
<span id="employee_links"> <div id="employee_links">
<span class="employee_name">{$first_name}&nbsp;{$last_name}</span> <span class="employee_name">{$first_name}&nbsp;{$last_name}</span>
<span class="separator"></span> <span class="separator">&nbsp;</span>
<a class="employee" href="index.php?controller=AdminEmployees&id_employee={$employee->id}&updateemployee&token={getAdminToken tab='AdminEmployees'}" alt="" /> {l s='My preferences'}</a> <a class="employee" href="index.php?controller=AdminEmployees&amp;id_employee={$employee->id}&amp;updateemployee&amp;token={getAdminToken tab='AdminEmployees'}" alt="">{l s='My preferences'}</a>
<span class="separator"></span><a href="index.php?logout" id="header_logout"> <span class="separator">&nbsp;</span>
<span>{l s='logout'}</span> <a href="index.php?logout" id="header_logout">{l s='logout'}</a>
</a> {if {$base_url}}
{if {$base_url}} <span class="separator">&nbsp;</span>
<span class="separator"></span> <a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}"><span>{l s='View my shop'}</span></a> <a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
{/if}
</span>
<div id="header_search">
<form method="post" action="index.php?controller=AdminSearch&token={getAdminToken tab='AdminSearch'}">
<input type="text" name="bo_query" id="bo_query" value="{$bo_query}" />
<select name="bo_search_type" id="bo_search_type" class="chosen no-search">
<option value="0">{l s='everywhere'}</option>
<option value="1" {if {$search_type} == 1} selected="selected" {/if}>{l s='catalog'}</option>
<optgroup label="{l s='customers'}:">
<option value="2" {if {$search_type} == 2} selected="selected" {/if}>{l s='by name'}</option>
<option value="6" {if {$search_type} == 6} selected="selected" {/if}>{l s='by ip address'}</option>
</optgroup>
<option value="3" {if {$search_type} == 3} selected="selected" {/if}>{l s='orders'}</option>
<option value="4" {if {$search_type} == 4} selected="selected" {/if}>{l s='invoices'}</option>
<option value="5" {if {$search_type} == 5} selected="selected" {/if}>{l s='carts'}</option>
</select>
<input type="submit" id="bo_search_submit" class="button" value="{l s='Search'}"/>
</form>
</div>
{if count($quick_access) > 0}
<div id="header_quick">
<script type="text/javascript">
function quickSelect(elt)
{
var eltVal = $(elt).val();
if (eltVal == "0") return false;
else if (eltVal.substr(eltVal.length - 6) == '_blank') window.open(eltVal.substr(0, eltVal.length - 6), '_blank');
else location.href = eltVal;
}
</script>
<select onchange="quickSelect(this);" id="quick_select" class="chosen no-search">
<option value="0">{l s='Quick Access'}</option>
{foreach $quick_access as $quick}
<option value="{$quick.link}{if $quick.new_window}_blank{/if}">&raquo; {$quick.name}</option>
{/foreach}
</select>
</div>
{/if} {/if}
{hook h="displayBackOfficeTop"}
</div> </div>
<ul id="menu"> <div id="header_search">
{if !$tab} <form method="post" action="index.php?controller=AdminSearch&amp;token={getAdminToken tab='AdminSearch'}">
<div class="mainsubtablist" style="display:none"> <input type="text" name="bo_query" id="bo_query" value="{$bo_query}" />
</div> <select name="bo_search_type" id="bo_search_type" class="chosen no-search">
{/if} <option value="0">{l s='everywhere'}</option>
{foreach $tabs AS $t} <option value="1" {if {$search_type} == 1} selected="selected" {/if}>{l s='catalog'}</option>
<optgroup label="{l s='customers'}:">
<option value="2" {if {$search_type} == 2} selected="selected" {/if}>{l s='by name'}</option>
<option value="6" {if {$search_type} == 6} selected="selected" {/if}>{l s='by ip address'}</option>
</optgroup>
<option value="3" {if {$search_type} == 3} selected="selected" {/if}>{l s='orders'}</option>
<option value="4" {if {$search_type} == 4} selected="selected" {/if}>{l s='invoices'}</option>
<option value="5" {if {$search_type} == 5} selected="selected" {/if}>{l s='carts'}</option>
</select>
<input type="submit" id="bo_search_submit" class="button" value="{l s='Search'}"/>
</form>
</div>
{if count($quick_access) > 0}
<div id="header_quick">
<script type="text/javascript">
function quickSelect(elt)
{
var eltVal = $(elt).val();
if (eltVal == "0")
return false;
else if (eltVal.substr(eltVal.length - 6) == '_blank')
window.open(eltVal.substr(0, eltVal.length - 6), '_blank');
else
location.href = eltVal;
}
</script>
<select onchange="quickSelect(this);" id="quick_select" class="chosen no-search">
<option value="0">{l s='Quick Access'}</option>
{foreach $quick_access as $quick}
<option value="{$quick.link|escape:'htmlall':'UTF-8'}{if $quick.new_window}_blank{/if}">&raquo; {$quick.name}</option>
{/foreach}
</select>
</div>
{/if}
{if isset($displayBackOfficeTop)}
{$displayBackOfficeTop}
{/if}
</div> {* end header *}
<ul id="menu">
{if !$tab}
<div class="mainsubtablist" style="display:none">
</div>
{/if}
{foreach $tabs AS $t}
{if $t.active}
<li class="submenu_size maintab {if $t.current}active{/if}" id="maintab{$t.id_tab}"> <li class="submenu_size maintab {if $t.current}active{/if}" id="maintab{$t.id_tab}">
<span class="title"> <span class="title">
<img src="{$t.img}" alt="" />{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if} <img src="{$t.img}" alt="" />{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}
</span> </span>
<ul class="submenu"> <ul class="submenu">
{foreach from=$t.sub_tabs item=t2} {foreach from=$t.sub_tabs item=t2}
<li><a href="{$t2.href}">{if $t2.name eq ''}{$t2.class_name}{else}{$t2.name}{/if}</a></li> {if $t2.active}
<li><a href="{$t2.href|escape:'htmlall':'UTF-8'}">{if $t2.name eq ''}{$t2.class_name}{else}{$t2.name|escape:'htmlall':'UTF-8'}{/if}</a></li>
{/if}
{/foreach} {/foreach}
</ul> </ul>
</li> </li>
{/foreach} {/if}
</ul> {/foreach}
</div> {* end header *} </ul>
{/if} {/if}
<div id="main"> <div id="main">
<div id="content"> <div id="content">
@@ -224,7 +232,7 @@
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)} {if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
<div class="multishop_toolbar"> <div class="multishop_toolbar">
<span class="text_multishop">{l s='Multishop configuration for'}</span> <span class="text_multishop">{l s='Multistore configuration for'}</span>
{$shop_list} {$shop_list}
</div> </div>
{/if} {/if}
@@ -60,7 +60,7 @@
{block name="td_content"} {block name="td_content"}
{if isset($params.prefix)}{$params.prefix}{/if} {if isset($params.prefix)}{$params.prefix}{/if}
{if isset($params.color) && isset($tr[$params.color])} {if isset($params.color) && isset($tr[$params.color])}
<span class="color_field" style="background-color: {$tr.color}"> <span class="color_field" style="background-color:{$tr.color};color:{if Tools::getBrightness($tr.color) < 128}white{else}#383838{/if}">
{/if} {/if}
{if isset($params.active)} {if isset($params.active)}
@@ -39,6 +39,7 @@
</ul> </ul>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
//<![CDATA[
var submited = false var submited = false
$(function() { $(function() {
//get reference on save link //get reference on save link
@@ -108,6 +109,7 @@
{/block} {/block}
} }
}); });
//]]>
</script> </script>
{/block} {/block}
<div class="pageTitle"> <div class="pageTitle">
@@ -118,7 +120,7 @@
{* Use strip_tags because if the string already has been through htmlentities using escape will break it *} {* Use strip_tags because if the string already has been through htmlentities using escape will break it *}
<span class="breadcrumb item-{$key} ">{$item|strip_tags} <span class="breadcrumb item-{$key} ">{$item|strip_tags}
{if !$smarty.foreach.title.last} {if !$smarty.foreach.title.last}
<img alt="&gt;" style="margin-right:5px" src="../img/admin/separator_breadcrum.png"> <img alt="&gt;" style="margin-right:5px" src="../img/admin/separator_breadcrumb.png" />
{/if} {/if}
</span> </span>
{/foreach} {/foreach}
+1 -1
View File
@@ -45,7 +45,7 @@ class AddressFormatCore extends ObjectModel
'table' => 'address_format', 'table' => 'address_format',
'primary' => 'id_country', 'primary' => 'id_country',
'fields' => array( 'fields' => array(
'format' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'format' => array('type' => self::TYPE_HTML, 'validate' => 'isGenericName', 'required' => true),
'id_country' => array('type' => self::TYPE_INT), 'id_country' => array('type' => self::TYPE_INT),
), ),
); );
+7 -9
View File
@@ -459,12 +459,12 @@ abstract class AdminTabCore
foreach ($rules['required'] as $field) foreach ($rules['required'] as $field)
if (($value = Tools::getValue($field)) == false && (string)$value != '0') if (($value = Tools::getValue($field)) == false && (string)$value != '0')
if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture'))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is required'); $this->_errors[] = sprintf(Tools::displayError('The field %s is required.'), call_user_func(array($className, 'displayFieldName'), $field, $className));
/* Checking for multilingual required fields */ /* Checking for multilingual required fields */
foreach ($rules['requiredLang'] as $fieldLang) foreach ($rules['requiredLang'] as $fieldLang)
if (($empty = Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) === false || $empty !== '0' && empty($empty)) if (($empty = Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) === false || $empty !== '0' && empty($empty))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).'</b> '.$this->l('is required at least in').' '.$defaultLanguage->name; $this->_errors[] = sprintf(Tools::displayError('The field %1$s is required at least in %2$s.'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $defaultLanguage->name);
/* Checking for maximum fields sizes */ /* Checking for maximum fields sizes */
foreach ($rules['size'] as $field => $maxLength) foreach ($rules['size'] as $field => $maxLength)
@@ -474,11 +474,9 @@ abstract class AdminTabCore
/* Checking for maximum multilingual fields size */ /* Checking for maximum multilingual fields size */
foreach ($rules['sizeLang'] as $fieldLang => $maxLength) foreach ($rules['sizeLang'] as $fieldLang => $maxLength)
foreach ($languages as $language) foreach ($languages as $language)
{
if (Tools::getValue($fieldLang.'_'.$language['id_lang']) !== false && Tools::strlen(Tools::getValue($fieldLang.'_'.$language['id_lang'])) > $maxLength) if (Tools::getValue($fieldLang.'_'.$language['id_lang']) !== false && Tools::strlen(Tools::getValue($fieldLang.'_'.$language['id_lang'])) > $maxLength)
$this->_errors[] = sprintf(Tools::displayError('field %1$s is too long. (%2$d chars max, html chars including)'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $maxLength); $this->_errors[] = sprintf(Tools::displayError('field %1$s is too long. (%2$d chars max, html chars including)'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $maxLength);
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max, html chars including').')';
}
/* Overload this method for custom checking */ /* Overload this method for custom checking */
$this->_childValidation(); $this->_childValidation();
@@ -486,15 +484,15 @@ abstract class AdminTabCore
foreach ($rules['validate'] AS $field => $function) foreach ($rules['validate'] AS $field => $function)
if (($value = Tools::getValue($field)) !== false AND !empty($value) AND ($field != 'passwd')) if (($value = Tools::getValue($field)) !== false AND !empty($value) AND ($field != 'passwd'))
if (!Validate::$function($value)) if (!Validate::$function($value))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is invalid'); $this->_errors[] = sprintf(Tools::displayError('The field %1$s (%2$s) is invalid.'), call_user_func(array($className, 'displayFieldName'), $field, $className));
/* Checking for passwd_old validity */ /* Checking for passwd_old validity */
if (($value = Tools::getValue('passwd')) != false) if (($value = Tools::getValue('passwd')) != false)
{ {
if ($className == 'Employee' && !Validate::isPasswdAdmin($value)) if ($className == 'Employee' && !Validate::isPasswdAdmin($value))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).'</b> '.$this->l('is invalid'); $this->_errors[] = sprintf(Tools::displayError('The field %1$s (%2$s) is invalid.'), call_user_func(array($className, 'displayFieldName'), 'passwd', $className));
elseif ($className == 'Customer' && !Validate::isPasswd($value)) elseif ($className == 'Customer' && !Validate::isPasswd($value))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).'</b> '.$this->l('is invalid'); $this->_errors[] = sprintf(Tools::displayError('The field %1$s (%2$s) is invalid.'), call_user_func(array($className, 'displayFieldName'), 'passwd', $className));
} }
/* Checking for multilingual fields validity */ /* Checking for multilingual fields validity */
@@ -502,7 +500,7 @@ abstract class AdminTabCore
foreach ($languages as $language) foreach ($languages as $language)
if (($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) !== false && !empty($value)) if (($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) !== false && !empty($value))
if (!Validate::$function($value)) if (!Validate::$function($value))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is invalid'); $this->_errors[] = sprintf(Tools::displayError('The field %1$s (%2$s) is invalid.'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $language['name']);
} }
/** /**
+8 -6
View File
@@ -50,7 +50,7 @@ class AttributeCore extends ObjectModel
// Lang fields // Lang fields
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
), )
); );
@@ -75,13 +75,15 @@ class AttributeCore extends ObjectModel
{ {
if (!$this->hasMultishopEntries()) if (!$this->hasMultishopEntries())
{ {
$combinations = new Collection('Combination'); $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_attribute = '.(int)$this->id);
$combinations->where($this->def['primary'], '=', $this->id); foreach ($result as $row)
foreach ($combinations as $combination) {
$combination = new Combination($row['id_product_attribute']);
$combination->delete(); $combination->delete();
}
// Delete associated restrictions on cart rules // Delete associated restrictions on cart rules
CartRule::cleanProductRuleIntegrity('attributes', $this->id); CartRule::cleanProductRuleIntegrity('attributes', $this->id);
/* Reinitializing position */ /* Reinitializing position */
$this->cleanPositions((int)$this->id_attribute_group); $this->cleanPositions((int)$this->id_attribute_group);
+7 -15
View File
@@ -93,32 +93,24 @@ class Autoload
// If requested class does not exist, load associated core class // If requested class does not exist, load associated core class
if (isset($this->index[$classname]) && !$this->index[$classname]) if (isset($this->index[$classname]) && !$this->index[$classname])
{ {
require_once($this->root_dir.$this->index[$classname.'Core']); require($this->root_dir.$this->index[$classname.'Core']);
if (file_exists($this->root_dir.'override/'.$this->index[$classname.'Core']))
{ // Since the classname does not exists (we only have a classCore class), we have to emulate the declaration of this class
$this->generateIndex(); $class_infos = new ReflectionClass($classname.'Core');
require_once($this->root_dir.$this->index[$classname]); eval(($class_infos->isAbstract() ? 'abstract ' : '').'class '.$classname.' extends '.$classname.'Core {}');
}
else
{
// Since the classname does not exists (we only have a classCore class), we have to emulate the declaration of this class
$class_infos = new ReflectionClass($classname.'Core');
eval(($class_infos->isAbstract() ? 'abstract ' : '').'class '.$classname.' extends '.$classname.'Core {}');
}
} }
else else
{ {
// request a non Core Class load the associated Core class if exists // request a non Core Class load the associated Core class if exists
if (isset($this->index[$classname.'Core'])) if (isset($this->index[$classname.'Core']))
require_once($this->root_dir.$this->index[$classname.'Core']); require_once($this->root_dir.$this->index[$classname.'Core']);
if (isset($this->index[$classname])) if (isset($this->index[$classname]))
require_once($this->root_dir.$this->index[$classname]); require_once($this->root_dir.$this->index[$classname]);
} }
} }
// Call directly ProductCore, ShopCore class // Call directly ProductCore, ShopCore class
else else
require_once($this->root_dir.$this->index[$classname]); require($this->root_dir.$this->index[$classname]);
} }
/** /**
@@ -185,7 +177,7 @@ class Autoload
$classes = array_merge($classes, $this->getClassesFromDir($path.$file.'/')); $classes = array_merge($classes, $this->getClassesFromDir($path.$file.'/'));
else if (substr($file, -4) == '.php') else if (substr($file, -4) == '.php')
{ {
$content = file_get_contents($this->root_dir.$path.$file); $content = file_get_contents($this->root_dir.$path.$file);
$pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>'.basename($file, '.php').'(Core)?)' $pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>'.basename($file, '.php').'(Core)?)'
.'(\s+extends\s+[a-z][a-z0-9_]*)?(\s+implements\s+[a-z][a-z0-9_]*(\s*,\s*[a-z][a-z0-9_]*)*)?\s*\{#i'; .'(\s+extends\s+[a-z][a-z0-9_]*)?(\s+implements\s+[a-z][a-z0-9_]*(\s*,\s*[a-z][a-z0-9_]*)*)?\s*\{#i';
if (preg_match($pattern, $content, $m)) if (preg_match($pattern, $content, $m))
+11 -5
View File
@@ -594,7 +594,7 @@ class CarrierCore extends ObjectModel
public static function checkCarrierZone($id_carrier, $id_zone) public static function checkCarrierZone($id_carrier, $id_zone)
{ {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT c.`id_carrier` SELECT c.`id_carrier`
FROM `'._DB_PREFIX_.'carrier` c FROM `'._DB_PREFIX_.'carrier` c
LEFT JOIN `'._DB_PREFIX_.'carrier_zone` cz ON (cz.`id_carrier` = c.`id_carrier`) LEFT JOIN `'._DB_PREFIX_.'carrier_zone` cz ON (cz.`id_carrier` = c.`id_carrier`)
@@ -847,6 +847,8 @@ class CarrierCore extends ObjectModel
(SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop` (SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop`
FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop` FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop`
WHERE `id_carrier`='.(int)$old_id.')'); 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);
} }
/** /**
@@ -1154,18 +1156,22 @@ class CarrierCore extends ObjectModel
$query->select('id_carrier'); $query->select('id_carrier');
$query->from('product_carrier', 'pc'); $query->from('product_carrier', 'pc');
$query->innerJoin('carrier', 'c', 'c.id_reference = pc.id_carrier_reference AND c.deleted = 0'); $query->innerJoin('carrier', 'c', 'c.id_reference = pc.id_carrier_reference AND c.deleted = 0');
$query->where('id_product = '.(int)$product->id); $query->where('pc.id_product = '.(int)$product->id);
$query->where('id_shop = '.(int)$id_shop); $query->where('pc.id_shop = '.(int)$id_shop);
$carriers = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); $carriers = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
if (!empty($carriers)) if (!empty($carriers))
{ {
//the product is linked with carriers
$carrier_list = array(); $carrier_list = array();
foreach ($carriers as $carrier) foreach ($carriers as $carrier) //check if the linked carriers are available in current zone
if (Carrier::checkCarrierZone($carrier['id_carrier'], $id_zone)) if (Carrier::checkCarrierZone($carrier['id_carrier'], $id_zone))
$carrier_list[] = $carrier['id_carrier']; $carrier_list[] = $carrier['id_carrier'];
if (!empty($carrier_list)) if (!empty($carrier_list))
return $carrier_list; return $carrier_list;
else
return array();//no linked carrier are available for this zone
} }
$carrier_list = array(); $carrier_list = array();
+17 -15
View File
@@ -172,7 +172,9 @@ class CartCore extends ObjectModel
{ {
if (!$this->id_lang) if (!$this->id_lang)
$this->id_lang = Configuration::get('PS_LANG_DEFAULT'); $this->id_lang = Configuration::get('PS_LANG_DEFAULT');
if (!$this->id_shop)
$this->id_shop = Context::getContext()->shop->id;
$return = parent::add($autodate); $return = parent::add($autodate);
Hook::exec('actionCartSave'); Hook::exec('actionCartSave');
@@ -1228,14 +1230,14 @@ class CartCore extends ObjectModel
return true; return true;
} }
public static function getTotalCart($id_cart, $use_tax_display = false) public static function getTotalCart($id_cart, $use_tax_display = false, $type = CART::BOTH)
{ {
$cart = new Cart($id_cart); $cart = new Cart($id_cart);
if (!Validate::isLoadedObject($cart)) if (!Validate::isLoadedObject($cart))
die(Tools::displayError()); die(Tools::displayError());
$with_taxes = $use_tax_display ? $cart->_taxCalculationMethod != PS_TAX_EXC : true; $with_taxes = $use_tax_display ? $cart->_taxCalculationMethod != PS_TAX_EXC : true;
return Tools::displayPrice($cart->getOrderTotal($with_taxes), Currency::getCurrencyInstance((int)$cart->id_currency), false); return Tools::displayPrice($cart->getOrderTotal($with_taxes, $type), Currency::getCurrencyInstance((int)$cart->id_currency), false);
} }
@@ -2300,7 +2302,7 @@ class CartCore extends ObjectModel
} }
$cache[(int)$dontAutoSeletectOptions] = $delivery_option; $cache[(int)$dontAutoSeletectOptions] = $delivery_option;
return $delivery_option; return $delivery_option;
} }
@@ -2842,9 +2844,8 @@ class CartCore extends ObjectModel
{ {
$sql = 'SELECT c.`id_cart` $sql = 'SELECT c.`id_cart`
FROM '._DB_PREFIX_.'cart c FROM '._DB_PREFIX_.'cart c
LEFT JOIN '._DB_PREFIX_.'orders o ON (c.`id_cart` = o.`id_cart`) WHERE c.`id_cart` NOT IN (SELECT o.`id_cart` FROM '._DB_PREFIX_.'orders o)
WHERE c.`id_customer` = '.(int)$id_customer.' AND c.`id_customer` = '.(int)$id_customer.'
AND o.`id_cart` IS NULL
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'c').' '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'c').'
ORDER BY c.`date_upd` DESC'; ORDER BY c.`date_upd` DESC';
@@ -2991,14 +2992,14 @@ class CartCore extends ObjectModel
return $result; return $result;
} }
public static function getCustomerCarts($id_customer) public static function getCustomerCarts($id_customer, $with_order = true)
{ {
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT * SELECT *
FROM '._DB_PREFIX_.'cart c FROM '._DB_PREFIX_.'cart c
WHERE c.`id_customer` = '.(int)$id_customer.' WHERE c.`id_customer` = '.(int)$id_customer.'
ORDER BY c.`date_add` DESC'); '.(!$with_order ? 'AND id_cart NOT IN (SELECT id_cart FROM '._DB_PREFIX_.'orders o WHERE o.`id_customer` = '.(int)$id_customer.')' : '').'
return $result; ORDER BY c.`date_add` DESC');
} }
public static function replaceZeroByShopName($echo, $tr) public static function replaceZeroByShopName($echo, $tr)
@@ -3332,7 +3333,8 @@ class CartCore extends ObjectModel
WHERE `id_cart` = '.(int)$this->id.' WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.' AND `id_shop` = '.(int)$this->id_shop.'
) )
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); Db::getInstance()->execute($sql);
+39 -17
View File
@@ -47,6 +47,9 @@ class CategoryCore extends ObjectModel
/** @var integer Parent category ID */ /** @var integer Parent category ID */
public $id_parent; public $id_parent;
/** @var integer default Category id */
public $id_category_default;
/** @var integer Parents number */ /** @var integer Parents number */
public $level_depth; public $level_depth;
@@ -95,6 +98,7 @@ class CategoryCore extends ObjectModel
'level_depth' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'level_depth' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
'id_parent' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'id_parent' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'id_shop_default' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'is_root_category' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'is_root_category' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'position' => array('type' => self::TYPE_INT), 'position' => array('type' => self::TYPE_INT),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
@@ -298,6 +302,12 @@ class CategoryCore extends ObjectModel
} }
} }
public function deleteLite()
{
// Directly call the parent of delete, in order to avoid recursion
return parent::delete();
}
public function delete() public function delete()
{ {
if ((int)$this->id === 0 || (int)$this->id === 1) if ((int)$this->id === 0 || (int)$this->id === 1)
@@ -309,7 +319,7 @@ class CategoryCore extends ObjectModel
$all_cat[] = $this; $all_cat[] = $this;
foreach ($all_cat as $cat) foreach ($all_cat as $cat)
{ {
parent::delete(); $cat->deleteLite();
if (!$this->hasMultishopEntries()) if (!$this->hasMultishopEntries())
{ {
$cat->deleteImage(); $cat->deleteImage();
@@ -365,7 +375,7 @@ class CategoryCore extends ObjectModel
$parent_category = new Category($this->id_parent); $parent_category = new Category($this->id_parent);
if (!Validate::isLoadedObject($parent_category)) if (!Validate::isLoadedObject($parent_category))
die('parent category does not exist'); throw new PrestaShopException('Parent category does not exist');
return $parent_category->level_depth + 1; return $parent_category->level_depth + 1;
} }
@@ -451,11 +461,12 @@ class CategoryCore extends ObjectModel
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT * SELECT *
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
'.Shop::addSqlAssociation('category', 'c').'
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').'
WHERE 1 '.$sql_filter.' '.($id_lang ? 'AND `id_lang` = '.(int)$id_lang : '').' WHERE 1 '.$sql_filter.' '.($id_lang ? 'AND `id_lang` = '.(int)$id_lang : '').'
'.($active ? 'AND `active` = 1' : '').' '.($active ? 'AND `active` = 1' : '').'
'.(!$id_lang ? 'GROUP BY c.id_category' : '').' '.(!$id_lang ? 'GROUP BY c.id_category' : '').'
'.($sql_sort != '' ? $sql_sort : 'ORDER BY c.`level_depth` ASC, c.`position` ASC').' '.($sql_sort != '' ? $sql_sort : 'ORDER BY c.`level_depth` ASC, category_shop.`position` ASC').'
'.($sql_limit != '' ? $sql_limit : '') '.($sql_limit != '' ? $sql_limit : '')
); );
@@ -562,14 +573,14 @@ class CategoryCore extends ObjectModel
$order_way = 'ASC'; $order_way = 'ASC';
if ($order_by == 'id_product' || $order_by == 'date_add' || $order_by == 'date_upd') if ($order_by == 'id_product' || $order_by == 'date_add' || $order_by == 'date_upd')
$order_by_prefix = 'p'; $order_by_prefix = 'p';
else if ($order_by == 'name') elseif ($order_by == 'name')
$order_by_prefix = 'pl'; $order_by_prefix = 'pl';
else if ($order_by == 'manufacturer') elseif ($order_by == 'manufacturer')
{ {
$order_by_prefix = 'm'; $order_by_prefix = 'm';
$order_by = 'name'; $order_by = 'name';
} }
else if ($order_by == 'position') elseif ($order_by == 'position')
$order_by_prefix = 'cp'; $order_by_prefix = 'cp';
if ($order_by == 'price') if ($order_by == 'price')
@@ -594,7 +605,7 @@ class CategoryCore extends ObjectModel
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
} }
$sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pa.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`, $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`,
pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`,
il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default,
DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(), DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
@@ -604,11 +615,11 @@ class CategoryCore extends ObjectModel
FROM `'._DB_PREFIX_.'category_product` cp FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.`id_product` = cp.`id_product` ON p.`id_product` = cp.`id_product`
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
ON (p.`id_product` = pa.`id_product`) ON (p.`id_product` = pa.`id_product`)
'.Shop::addSqlAssociation('product_attribute', 'pa', false).' '.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1').'
'.Shop::addSqlAssociation('product', 'p').' '.Product::sqlStock('p', 'product_attribute_shop', false, $context->shop).'
'.Product::sqlStock('p', 'pa', false, $context->shop).'
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl LEFT JOIN `'._DB_PREFIX_.'category_lang` cl
ON (product_shop.`id_category_default` = cl.`id_category` ON (product_shop.`id_category_default` = cl.`id_category`
AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').') AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').')
@@ -633,14 +644,14 @@ class CategoryCore extends ObjectModel
AND tl.`id_lang` = '.(int)$id_lang.') AND tl.`id_lang` = '.(int)$id_lang.')
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m LEFT JOIN `'._DB_PREFIX_.'manufacturer` m
ON m.`id_manufacturer` = p.`id_manufacturer` ON m.`id_manufacturer` = p.`id_manufacturer`
WHERE product_shop.`id_shop` = '.(int)Context::getContext()->shop->id.' WHERE product_shop.`id_shop` = '.(int)$context->shop->id.'
AND (product_attribute_shop.default_on = 1 OR product_attribute_shop.default_on IS NULL) AND ((product_attribute_shop.id_product_attribute IS NOT NULL OR pa.id_product_attribute IS NULL)
OR (product_attribute_shop.id_product_attribute IS NULL AND pa.default_on=1))
AND cp.`id_category` = '.(int)$this->id AND cp.`id_category` = '.(int)$this->id
.($active ? ' AND product_shop.`active` = 1' : '') .($active ? ' AND product_shop.`active` = 1' : '')
.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '') .($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '')
.($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : ''); .($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : '');
$sql .= ' GROUP BY p.`id_product`';
if ($random === true) if ($random === true)
{ {
$sql .= ' ORDER BY RAND()'; $sql .= ' ORDER BY RAND()';
@@ -763,7 +774,7 @@ class CategoryCore extends ObjectModel
AND c3.`id_category` IN ('.implode(',', array_map('intval', $selected_cat)).') AND c3.`id_category` IN ('.implode(',', array_map('intval', $selected_cat)).')
)' : '0').' AS nbSelectedSubCat )' : '0').' AS nbSelectedSubCat
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl'); LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` '.Shop::addSqlRestrictionOnLang('cl', $id_shop).')';
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context) if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')'; $sql .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')';
$sql .= ' WHERE `id_lang` = '.(int)$id_lang; $sql .= ' WHERE `id_lang` = '.(int)$id_lang;
@@ -1177,12 +1188,12 @@ class CategoryCore extends ObjectModel
*/ */
public static function getLastPosition($id_category_parent, $id_shop) public static function getLastPosition($id_category_parent, $id_shop)
{ {
return (Db::getInstance()->getValue(' return (int)(Db::getInstance()->getValue('
SELECT MAX(cs.`position`)+1 SELECT MAX(cs.`position`)
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs LEFT JOIN `'._DB_PREFIX_.'category_shop` cs
ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.') ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')
WHERE c.`id_parent` = '.(int)$id_category_parent)); WHERE c.`id_parent` = '.(int)$id_category_parent) + 1);
} }
public static function getUrlRewriteInformations($id_category) public static function getUrlRewriteInformations($id_category)
@@ -1229,6 +1240,17 @@ class CategoryCore extends ObjectModel
return false; return false;
return ($this->nleft >= $interval['nleft'] && $this->nright <= $interval['nright']); return ($this->nleft >= $interval['nleft'] && $this->nright <= $interval['nright']);
} }
public static function inShopStatic($id_category, Shop $shop = null)
{
if (!$shop || !is_object($shop))
$shop = Context::getContext()->shop;
if (!$interval = Category::getInterval($shop->getCategory()))
return false;
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT nleft, nright FROM `'._DB_PREFIX_.'category` WHERE id_category = '.(int)$id_category);
return ($row['nleft'] >= $interval['nleft'] && $row['nright'] <= $interval['nright']);
}
public function getChildrenWs() public function getChildrenWs()
{ {
+1 -1
View File
@@ -166,7 +166,7 @@ class Curve
{ {
$this->type = ''; $this->type = '';
if ($type == 'bars') if ($type == 'bars')
$this->type = 'bars:{show:true}'; $this->type = 'bars:{show:true,lineWidth:10}';
if ($type == 'steps') if ($type == 'steps')
$this->type = 'lines:{show:true,steps:true}'; $this->type = 'lines:{show:true,steps:true}';
} }
+18 -9
View File
@@ -159,27 +159,36 @@ class ConfigurationTestCore
return false; return false;
} }
public static function test_dir($relative_dir, $recursive = false) public static function test_dir($relative_dir, $recursive = false, &$full_report = null)
{ {
$dir = _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.ltrim($relative_dir, '/'); $dir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($relative_dir, '\\/');
if (!file_exists($dir) || !$dh = opendir($dir)) if (!file_exists($dir) || !$dh = opendir($dir))
{
$full_report = sprintf('Directory %s does not exists or is not writable', $dir); // sprintf for future translation
return false; return false;
$dummy = rtrim($dir, '/').'/'.uniqid(); }
if (@file_put_contents($dummy, 'test')) $dummy = rtrim($dir, '\\/').DIRECTORY_SEPARATOR.uniqid();
if (false && @file_put_contents($dummy, 'test'))
{ {
@unlink($dummy); @unlink($dummy);
if (!$recursive) if (!$recursive)
{
closedir($dh);
return true; return true;
}
} }
else if (!is_writable($dir)) elseif (!is_writable($dir))
return false;
if ($recursive)
{ {
$full_report = sprintf('Directory %s is not writable', $dir); // sprintf for future translation
return false;
}
if ($recursive)
while (($file = readdir($dh)) !== false) while (($file = readdir($dh)) !== false)
if (is_dir($dir.DIRECTORY_SEPARATOR.$file) && $file != '.' && $file != '..' && $file != '.svn') if (is_dir($dir.DIRECTORY_SEPARATOR.$file) && $file != '.' && $file != '..' && $file != '.svn')
if (!ConfigurationTest::test_dir($relative_dir.DIRECTORY_SEPARATOR.$file, true)) if (!ConfigurationTest::test_dir($relative_dir.DIRECTORY_SEPARATOR.$file, $recursive, $full_report))
return false; return false;
}
closedir($dh); closedir($dh);
return true; return true;
} }
+49
View File
@@ -95,6 +95,55 @@ class ContextCore
*/ */
public $smarty; public $smarty;
/**
* @ var Mobile Detect
*/
public $mobile_detect;
/**
* @var boolean|string mobile device of the customer
*/
protected $mobile_device;
public function getMobileDevice()
{
if (is_null($this->mobile_device))
{
$this->mobile_device = false;
if ($this->checkMobileContext())
{
require_once(_PS_TOOL_DIR_.'mobile_Detect/Mobile_Detect.php');
$this->mobile_detect = new Mobile_Detect();
switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
{
case 1: // Only for mobile device
if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet())
$this->mobile_device = true;
break;
case 2: // Only for touchpads
if ($this->mobile_detect->isTablet() && !$this->mobile_detect->is_mobile())
$this->mobile_device = true;
break;
case 3: // For touchpad or mobile devices
if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet())
$this->mobile_device = true;
break;
}
}
}
return $this->mobile_device;
}
protected function checkMobileContext()
{
return isset($_SERVER['HTTP_USER_AGENT'])
&& isset(Context::getContext()->cookie)
&& (bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE')
&& @filemtime(_PS_THEME_MOBILE_DIR_)
&& !Context::getContext()->cookie->no_mobile;
}
/** /**
* Get a singleton context * Get a singleton context
* *
+23 -32
View File
@@ -110,51 +110,42 @@ class CountryCore extends ObjectModel
} }
/** /**
* Return available countries * @brief Return available countries
* *
* @param integer $id_lang Language ID * @param integer $id_lang Language ID
* @param boolean $active return only active coutries * @param boolean $active return only active coutries
* @return array Countries and corresponding zones * @param boolean $contain_states return only country with states
* @param boolean $list_states Include the states list with the returned list
*
* @return Array Countries and corresponding zones
*/ */
public static function getCountries($id_lang, $active = false, $contain_states = null) public static function getCountries($id_lang, $active = false, $contain_states = false, $list_states = true)
{ {
if (!Validate::isBool($active))
die(Tools::displayError());
$states = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT s.*
FROM `'._DB_PREFIX_.'state` s
ORDER BY s.`name` ASC');
$sql = 'SELECT cl.*,c.*, cl.`name` AS country, z.`name` AS 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' : '')
.(!is_null($contain_states) ? ' AND c.`contains_states` = '.(int)$contain_states : '').'
ORDER BY cl.name ASC';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
$countries = array(); $countries = array();
foreach ($result as &$country) 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; $countries[$country['id_country']] = $country;
foreach ($states as &$state)
if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */ if ($list_states)
$countries[$state['id_country']]['states'][] = $state; 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 */
$countries[$state['id_country']]['states'][] = $state;
return $countries; return $countries;
} }
public static function getCountriesByIdShop($id_shop, $id_lang) public static function getCountriesByIdShop($id_shop, $id_lang)
{ {
$sql = 'SELECT * return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
FROM `'._DB_PREFIX_.'country` c SELECT *
LEFT JOIN `'._DB_PREFIX_.'country_shop` cs ON (cs.`id_country`= c.`id_country`) FROM `'._DB_PREFIX_.'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_.'country_shop` cs ON (cs.`id_country`= c.`id_country`)
WHERE `id_shop` = '.(int)$id_shop; LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)$id_lang.')
WHERE `id_shop` = '.(int)$id_shop);
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
} }
/** /**
+3 -1
View File
@@ -105,7 +105,6 @@ class CurrencyCore extends ObjectModel
// price sign before or after the price number // price sign before or after the price number
$this->prefix = $this->format % 2 != 0 ? $this->sign.' ' : ''; $this->prefix = $this->format % 2 != 0 ? $this->sign.' ' : '';
$this->suffix = $this->format % 2 == 0 ? ' '.$this->sign : ''; $this->suffix = $this->format % 2 == 0 ? ' '.$this->sign : '';
} }
/** /**
* Overriding check if currency with the same iso code already exists. * Overriding check if currency with the same iso code already exists.
@@ -181,12 +180,15 @@ class CurrencyCore extends ObjectModel
'left' => $this->sign.' ', 'left' => $this->sign.' ',
'right' => ' '.$this->sign 'right' => ' '.$this->sign
); );
$formats = array( $formats = array(
1 => array('left' => &$formated_strings['left'], 'right' => ''), 1 => array('left' => &$formated_strings['left'], 'right' => ''),
2 => array('left' => '', 'right' => &$formated_strings['right']), 2 => array('left' => '', 'right' => &$formated_strings['right']),
3 => array('left' => &$formated_strings['left'], 'right' => ''), 3 => array('left' => &$formated_strings['left'], 'right' => ''),
4 => array('left' => '', 'right' => &$formated_strings['right']), 4 => array('left' => '', 'right' => &$formated_strings['right']),
5 => array('left' => '', 'right' => &$formated_strings['right'])
); );
return ($formats[$this->format][$side]); return ($formats[$this->format][$side]);
} }
+13 -2
View File
@@ -224,6 +224,17 @@ class CustomerCore extends ObjectModel
$this->newsletter_date_add = date('Y-m-d H:i:s'); $this->newsletter_date_add = date('Y-m-d H:i:s');
if (Context::getContext()->controller->controller_type == 'admin') if (Context::getContext()->controller->controller_type == 'admin')
$this->updateGroup($this->groupBox); $this->updateGroup($this->groupBox);
if ($this->deleted)
{
$addresses = $this->getAddresses((int)Configuration::get('PS_LANG_DEFAULT'));
foreach ($addresses as $address)
{
$obj = new Address((int)$address['id_address']);
$obj->delete();
}
}
return parent::update(true); return parent::update(true);
} }
@@ -737,9 +748,9 @@ class CustomerCore extends ObjectModel
$this->logged = 0; $this->logged = 0;
} }
public function getLastCart() public function getLastCart($with_order = true)
{ {
$carts = Cart::getCustomerCarts((int)$this->id); $carts = Cart::getCustomerCarts((int)$this->id, $with_order);
if (!count($carts)) if (!count($carts))
return false; return false;
$cart = array_shift($carts); $cart = array_shift($carts);
+2
View File
@@ -36,6 +36,7 @@ class CustomerMessageCore extends ObjectModel
public $user_agent; public $user_agent;
public $private; public $private;
public $date_add; public $date_add;
public $read;
/** /**
* @see ObjectModel::$definition * @see ObjectModel::$definition
@@ -52,6 +53,7 @@ class CustomerMessageCore extends ObjectModel
'user_agent' => array('type' => self::TYPE_STRING), 'user_agent' => array('type' => self::TYPE_STRING),
'private' => array('type' => self::TYPE_INT), 'private' => array('type' => self::TYPE_INT),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'read' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool')
), ),
); );
+7 -5
View File
@@ -72,15 +72,17 @@ class CustomerThreadCore extends ObjectModel
return (parent::delete()); return (parent::delete());
} }
public static function getCustomerMessages($id_customer) public static function getCustomerMessages($id_customer, $read = null)
{ {
return Db::getInstance()->executeS(' $sql = 'SELECT *
SELECT *
FROM '._DB_PREFIX_.'customer_thread ct FROM '._DB_PREFIX_.'customer_thread ct
LEFT JOIN '._DB_PREFIX_.'customer_message cm LEFT JOIN '._DB_PREFIX_.'customer_message cm
ON ct.id_customer_thread = cm.id_customer_thread ON ct.id_customer_thread = cm.id_customer_thread
WHERE id_customer = '.(int)$id_customer WHERE id_customer = '.(int)$id_customer;
); if (!is_null($read))
$sql .= ' AND cm.`read` = '.(int)$read;
return Db::getInstance()->executeS($sql);
} }
public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order) public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order)
+3 -3
View File
@@ -250,7 +250,7 @@ class DispatcherCore
{ {
// Dispatch front office controller // Dispatch front office controller
case self::FC_FRONT : case self::FC_FRONT :
$controllers = Dispatcher::getControllers(_PS_FRONT_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_.'controllers/front/'); $controllers = Dispatcher::getControllers(array(_PS_FRONT_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_.'controllers/front/'));
$controllers['index'] = 'IndexController'; $controllers['index'] = 'IndexController';
if (isset($controllers['auth'])) if (isset($controllers['auth']))
@@ -734,9 +734,9 @@ class DispatcherCore
{ {
if ($controller_filename[0] != '.') if ($controller_filename[0] != '.')
{ {
if (is_dir($dir.$controller_filename)) if (!strpos($controller_filename, '.php') && is_dir($dir.$controller_filename))
$controllers += Dispatcher::getControllersInDirectory($dir.$controller_filename.DIRECTORY_SEPARATOR); $controllers += Dispatcher::getControllersInDirectory($dir.$controller_filename.DIRECTORY_SEPARATOR);
else if ($controller_filename != 'index.php') elseif ($controller_filename != 'index.php')
{ {
$key = str_replace(array('controller.php', '.php'), '', strtolower($controller_filename)); $key = str_replace(array('controller.php', '.php'), '', strtolower($controller_filename));
$controllers[$key] = basename($controller_filename, '.php'); $controllers[$key] = basename($controller_filename, '.php');
+21 -24
View File
@@ -251,26 +251,22 @@ class GroupCore extends ObjectModel
* @param $modules * @param $modules
* @param array $shops * @param array $shops
* @return bool * @return bool
* @internal param \id_group $integer
* @internal param \modules $array
* @internal param \authorized $integer
*/ */
public static function addModulesRestrictions($id_group, $modules, $shops = array(1)) public static function addModulesRestrictions($id_group, $modules, $shops = array(1))
{ {
if (!is_array($modules) && !empty($modules)) if (!is_array($modules) || !count($modules) || !is_array($shops) || !count($shops))
return false; return false;
else
{ // Delete all record for this group
//delete all record for this group Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_group` WHERE `id_group` = '.(int)$id_group);
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_group` WHERE `id_group` = '.(int)$id_group);
$sql = 'INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`) VALUES '; $sql = 'INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`) VALUES ';
foreach ($modules as $mod) foreach ($modules as $module)
foreach ($shops as $s) foreach ($shops as $shop)
$sql .= '("'.(int)$mod.'", "'.(int)$s.'", "'.(int)$id_group.'"),'; $sql .= '("'.(int)$module.'", "'.(int)$shop.'", "'.(int)$id_group.'"),';
// removing last comma to avoid SQL error $sql = rtrim($sql, ',');
$sql = substr($sql, 0, strlen($sql) - 1);
return (bool)Db::getInstance()->execute($sql); return (bool)Db::getInstance()->execute($sql);
}
} }
/** /**
@@ -281,14 +277,15 @@ class GroupCore extends ObjectModel
*/ */
public static function addRestrictionsForModule($id_module, $shops = array(1)) public static function addRestrictionsForModule($id_module, $shops = array(1))
{ {
$groups = Group::getGroups(Context::getContext()->language->id); if (!is_array($shops) || !count($shops))
$sql = 'INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`) VALUES '; return false;
foreach ($groups as $g)
foreach ($shops as $s) $res = true;
$sql .= '("'.(int)$id_module.'", "'.(int)$s.'", "'.(int)$g['id_group'].'"),'; foreach ($shops as $shop)
// removing last comma to avoid SQL error $res &= Db::getInstance()->execute('
$sql = substr($sql, 0, strlen($sql) - 1); INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`)
Db::getInstance()->execute($sql); (SELECT '.(int)$id_module.', '.(int)$shop.', id_group FROM `'._DB_PREFIX_.'group`)');
return $res;
} }
/** /**
+43 -24
View File
@@ -180,14 +180,12 @@ class HookCore extends ObjectModel
$cache_id = 'hook_module_list'; $cache_id = 'hook_module_list';
if (!Cache::isStored($cache_id)) if (!Cache::isStored($cache_id))
{ {
$sql = 'SELECT h.id_hook, h.name as h_name, title, description, h.position, live_edit, hm.position as hm_position, m.id_module, m.name, active $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
FROM `'._DB_PREFIX_.'hook` h SELECT h.id_hook, h.name as h_name, title, description, h.position, live_edit, hm.position as hm_position, m.id_module, m.name, active
INNER JOIN `'._DB_PREFIX_.'hook_module` hm ON (h.id_hook = hm.id_hook) FROM `'._DB_PREFIX_.'hook` h
INNER JOIN `'._DB_PREFIX_.'module` as m ON (m.id_module = hm.id_module) INNER JOIN `'._DB_PREFIX_.'hook_module` hm ON (h.id_hook = hm.id_hook AND hm.id_shop = '.(int)Context::getContext()->shop->id.')
WHERE hm.id_shop IN('.implode(', ', Shop::getContextListShopID()).') INNER JOIN `'._DB_PREFIX_.'module` as m ON (m.id_module = hm.id_module)
GROUP BY hm.id_hook, hm.id_module ORDER BY hm.position');
ORDER BY hm.position';
$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
$list = array(); $list = array();
foreach ($results as $result) foreach ($results as $result)
{ {
@@ -244,29 +242,49 @@ class HookCore extends ObjectModel
{ {
$context = Context::getContext(); $context = Context::getContext();
$cache_id = 'hook_module_exec_list'.((isset($context->customer)) ? '_'.$context->customer->id : ''); $cache_id = 'hook_module_exec_list'.((isset($context->customer)) ? '_'.$context->customer->id : '');
if (!Cache::isStored($cache_id)) if (!Cache::isStored($cache_id) || $hook_name == 'displayPayment')
{ {
// Get shops and groups list $frontend = true;
$shop_list = Shop::getContextListShopID(); $groups = array();
if (isset($context->customer) && $context->customer->isLogged()) if (isset($context->employee))
$groups = $context->customer->getGroups(); {
$shop_list = array((int)$context->shop->id);
$frontend = false;
}
else
{
// Get shops and groups list
$shop_list = Shop::getContextListShopID();
if (isset($context->customer) && $context->customer->isLogged())
$groups = $context->customer->getGroups();
elseif (isset($context->customer) && $context->customer->isLogged(true))
$groups = array((int)Configuration::get('PS_GUEST_GROUP'));
else
$groups = array((int)Configuration::get('PS_UNIDENTIFIED_GROUP'));
}
// SQL Request // SQL Request
$sql = new DbQuery(); $sql = new DbQuery();
$sql->select('h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`'); $sql->select('h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`');
$sql->from('module', 'm'); $sql->from('module', 'm');
$sql->innerJoin('hook_module', 'hm', 'hm.`id_module` = m.`id_module`'); $sql->innerJoin('hook_module', 'hm', 'hm.`id_module` = m.`id_module`');
$sql->innerJoin('hook', 'h', 'hm.`id_hook` = h.`id_hook`'); $sql->innerJoin('hook', 'h', 'hm.`id_hook` = h.`id_hook`');
$sql->where('(SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $shop_list).')) = '.count($shop_list)); $sql->where('(SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN ('.implode(', ', $shop_list).')) = '.count($shop_list));
$sql->where('hm.id_shop IN('.implode(', ', $shop_list).')'); if ($hook_name != 'displayPayment')
$sql->where('h.name != "displayPayment"');
// For payment modules, we check that they are available in the contextual country
elseif ($frontend && Validate::isLoadedObject($context->country))
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')');
if (Validate::isLoadedObject($context->shop))
$sql->where('hm.id_shop = '.(int)$context->shop->id);
if (isset($context->customer) && $context->customer->isLogged()) if ($frontend)
{ {
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`'); $sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
$sql->where('mg.`id_group` IN('.implode(', ', $groups).')'); $sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
$sql->groupBy('hm.id_hook, hm.id_module');
} }
$sql->groupBy('hm.id_hook, hm.id_module');
$sql->orderBy('hm.`position`'); $sql->orderBy('hm.`position`');
// Store results per hook name // Store results per hook name
@@ -297,11 +315,12 @@ class HookCore extends ObjectModel
'live_edit' => $row['live_edit'], 'live_edit' => $row['live_edit'],
); );
} }
if ($hook_name != 'displayPayment')
Cache::store($cache_id, $list); {
Cache::store($cache_id, $list);
// @todo remove this in 1.6, we keep it in 1.5 for retrocompatibility // @todo remove this in 1.6, we keep it in 1.5 for retrocompatibility
self::$_hook_modules_cache_exec = $list; self::$_hook_modules_cache_exec = $list;
}
} }
else else
$list = Cache::retrieve($cache_id); $list = Cache::retrieve($cache_id);
+1 -1
View File
@@ -237,7 +237,7 @@ class ImageManagerCore
// Filter on file extension // Filter on file extension
$authorized_extensions = array('gif', 'jpg', 'jpeg', 'jpe', 'png'); $authorized_extensions = array('gif', 'jpg', 'jpeg', 'jpe', 'png');
$name_explode = explode('.', $filename); $name_explode = explode('.', $filename);
if (count($name_explode)) if (count($name_explode) >= 2)
{ {
$current_extension = strtolower($name_explode[count($name_explode) - 1]); $current_extension = strtolower($name_explode[count($name_explode) - 1]);
if (!in_array($current_extension, $authorized_extensions)) if (!in_array($current_extension, $authorized_extensions))
+2 -3
View File
@@ -104,12 +104,12 @@ class LanguageCore extends ObjectModel
} }
/** /**
* Generate traslations files * Generate translations files
* *
*/ */
protected function _generateFiles($newIso = null) protected function _generateFiles($newIso = null)
{ {
$iso_code = $newIso?$newIso:$this->iso_code; $iso_code = $newIso ? $newIso : $this->iso_code;
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code)) if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
mkdir(_PS_TRANSLATIONS_DIR_.$iso_code); mkdir(_PS_TRANSLATIONS_DIR_.$iso_code);
@@ -130,7 +130,6 @@ class LanguageCore extends ObjectModel
@chmod($path_file, 0777); @chmod($path_file, 0777);
} }
} }
/** /**
+18 -2
View File
@@ -124,6 +124,9 @@ class LinkCore
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags')) if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags'))
$params['tags'] = Tools::str2url($product->getTags($id_lang)); $params['tags'] = Tools::str2url($product->getTags($id_lang));
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference'))
$params['reference'] = Tools::str2url($product->reference);
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories')) if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories'))
{ {
@@ -318,7 +321,7 @@ class LinkCore
// If the module has its own route ... just use it ! // 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))
return $this->getPageLink('module-'.$module.'-'.$controller, $params); return $this->getPageLink('module-'.$module.'-'.$controller, $ssl, $id_lang, $params);
else else
return $url.Dispatcher::getInstance()->createUrl('module', $id_lang, $params, $this->allow); return $url.Dispatcher::getInstance()->createUrl('module', $id_lang, $params, $this->allow);
} }
@@ -441,7 +444,20 @@ class LinkCore
$controller = Dispatcher::getInstance()->getController(); $controller = Dispatcher::getInstance()->getController();
if (!empty(Context::getContext()->controller->php_self)) if (!empty(Context::getContext()->controller->php_self))
$controller = Context::getContext()->controller->php_self; $controller = Context::getContext()->controller->php_self;
if ($controller == 'product' && isset($params['id_product']))
return $this->getProductLink((int)$params['id_product'], null, null, null, (int)$id_lang);
elseif ($controller == 'category' && isset($params['id_category']))
return $this->getCategoryLink((int)$params['id_category'], null, (int)$id_lang);
elseif ($controller == 'supplier' && isset($params['id_supplier']))
return $this->getSupplierLink((int)$params['id_supplier'], null, (int)$id_lang);
elseif ($controller == 'manufacturer' && isset($params['id_manufacturer']))
return $this->getManufacturerLink((int)$params['id_manufacturer'], null, (int)$id_lang);
elseif ($controller == 'cms' && isset($params['id_cms']))
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);
return $this->getPageLink($controller, false, $id_lang, $params); return $this->getPageLink($controller, false, $id_lang, $params);
} }
+4 -3
View File
@@ -61,7 +61,8 @@ class LocalizationPackCore
{ {
if (!$id_lang = (int)Language::getIdByIso($this->iso_code_lang)) if (!$id_lang = (int)Language::getIdByIso($this->iso_code_lang))
$id_lang = 1; $id_lang = 1;
Configuration::updateValue('PS_LANG_DEFAULT', $id_lang); if (!$install_mode)
Configuration::updateValue('PS_LANG_DEFAULT', $id_lang);
} }
if ($install_mode && $res && isset($this->iso_currency)) if ($install_mode && $res && isset($this->iso_currency))
@@ -306,9 +307,9 @@ class LocalizationPackCore
$errstr = ''; $errstr = '';
if (@fsockopen('api.prestashop.com', 80, $errno, $errstr, 10)) if (@fsockopen('api.prestashop.com', 80, $errno, $errstr, 10))
{ {
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code']))) if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code'])))
{ {
if ($content = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip')) if ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip'))
{ {
$file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip'; $file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip';
if (file_put_contents($file, $content)) if (file_put_contents($file, $content))
+2 -2
View File
@@ -325,11 +325,11 @@ class MailCore
if (!is_array($_LANGMAIL)) if (!is_array($_LANGMAIL))
return (str_replace('"', '&quot;', $string)); return (str_replace('"', '&quot;', $string));
if (array_key_exists($key, $_LANGMAIL)) if (array_key_exists($key, $_LANGMAIL) && !empty($_LANGMAIL[$key]))
$str = $_LANGMAIL[$key]; $str = $_LANGMAIL[$key];
else else
$str = $string; $str = $string;
return str_replace('"', '&quot;', addslashes($str)); return str_replace('"', '&quot;', stripslashes($str));
} }
} }
+1 -12
View File
@@ -103,8 +103,6 @@ class ManufacturerCore extends ObjectModel
{ {
parent::__construct($id, $id_lang); parent::__construct($id, $id_lang);
/* Get the manufacturer's id_address */
$this->id_address = $this->getManufacturerAddress();
$this->link_rewrite = $this->getLink(); $this->link_rewrite = $this->getLink();
$this->image_dir = _PS_MANU_IMG_DIR_; $this->image_dir = _PS_MANU_IMG_DIR_;
} }
@@ -149,16 +147,7 @@ class ManufacturerCore extends ObjectModel
if (!(int)$this->id) if (!(int)$this->id)
return false; return false;
$result = Db::GetInstance(_PS_USE_SQL_SLAVE_)->getRow(' return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_address` FROM '._DB_PREFIX_.'address WHERE `id_manufacturer` = '.(int)$this->id);
SELECT `id_address`
FROM '._DB_PREFIX_.'address
WHERE `id_manufacturer` = '.(int)$this->id
);
if (!$result)
return false;
return $result['id_address'];
} }
/** /**
+8 -8
View File
@@ -218,7 +218,7 @@ class MediaCore
$file_uri = $js_uri; $file_uri = $js_uri;
// check if js files exists // check if js files exists
if (!preg_match('/^http(s?):\/\//i', $file_uri) && !file_exists($file_uri)) if (!preg_match('/^http(s?):\/\//i', $file_uri) && !@filemtime($file_uri))
return false; return false;
// adding file to the big array...; // adding file to the big array...;
@@ -240,7 +240,7 @@ class MediaCore
$url_data = parse_url($css_uri); $url_data = parse_url($css_uri);
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']); $file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
// check if css files exists // check if css files exists
if (!file_exists($file_uri)) if (!@filemtime($file_uri))
return false; return false;
// adding file to the big array... // adding file to the big array...
@@ -275,7 +275,7 @@ class MediaCore
// check if js files exists, if not try to load query from ajax.googleapis.com // check if js files exists, if not try to load query from ajax.googleapis.com
$return = array(); $return = array();
if (file_exists($file_uri)) if (@filemtime($file_uri))
$return[] = Media::getJSPath($file); $return[] = Media::getJSPath($file);
else else
$return[] = Media::getJSPath(Tools::getCurrentUrlProtocolPrefix().'ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery'.($minifier ? '.min.js' : '.js')); $return[] = Media::getJSPath(Tools::getCurrentUrlProtocolPrefix().'ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery'.($minifier ? '.min.js' : '.js'));
@@ -314,7 +314,7 @@ class MediaCore
$ui_path['css'] = array_merge($ui_path['css'], $comp_css); $ui_path['css'] = array_merge($ui_path['css'], $comp_css);
} }
if (file_exists($file_uri)) if (@filemtime($file_uri))
{ {
if (!empty($ui_tmp)) if (!empty($ui_tmp))
{ {
@@ -351,9 +351,9 @@ class MediaCore
$file = 'jquery.'.$name.'.js'; $file = 'jquery.'.$name.'.js';
$url_data = parse_url($folder); $url_data = parse_url($folder);
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']); $file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
if (file_exists($file_uri.$file)) if (@filemtime($file_uri.$file))
$plugin_path['js'] = Media::getJSPath($folder.$file); $plugin_path['js'] = Media::getJSPath($folder.$file);
else if (file_exists($file_uri.$name.'/'.$file)) elseif (@filemtime($file_uri.$name.'/'.$file))
$plugin_path['js'] = Media::getJSPath($folder.$name.'/'.$file); $plugin_path['js'] = Media::getJSPath($folder.$name.'/'.$file);
else else
return false; return false;
@@ -373,9 +373,9 @@ class MediaCore
$file = 'jquery.'.$name.'.css'; $file = 'jquery.'.$name.'.css';
$url_data = parse_url($folder); $url_data = parse_url($folder);
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']); $file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
if (file_exists($file_uri.$file)) if (@filemtime($file_uri.$file))
return Media::getCSSPath($folder.$file); return Media::getCSSPath($folder.$file);
else if (file_exists($file_uri.$name.'/'.$file)) elseif (@filemtime($file_uri.$name.'/'.$file))
return Media::getCSSPath($folder.$name.'/'.$file); return Media::getCSSPath($folder.$name.'/'.$file);
else else
return false; return false;
+7 -9
View File
@@ -127,7 +127,7 @@ class MetaCore extends ObjectModel
$sql = 'SELECT * $sql = 'SELECT *
FROM '._DB_PREFIX_.'meta m FROM '._DB_PREFIX_.'meta m
LEFT JOIN '._DB_PREFIX_.'meta_lang ml on (m.id_meta = ml.id_meta) LEFT JOIN '._DB_PREFIX_.'meta_lang ml on (m.id_meta = ml.id_meta)
WHERE m.page = \''.pSQL($page).'\' WHERE (m.page = \''.pSQL($page).'\' OR m.page=\''.str_replace('-', '', strtolower($page)).'\')
AND ml.id_lang = '.(int)$id_lang AND ml.id_lang = '.(int)$id_lang
.Shop::addSqlRestrictionOnLang('ml'); .Shop::addSqlRestrictionOnLang('ml');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
@@ -184,21 +184,19 @@ class MetaCore extends ObjectModel
public static function getMetaTags($id_lang, $page_name, $title = '') public static function getMetaTags($id_lang, $page_name, $title = '')
{ {
global $maintenance; global $maintenance;
$page_name = str_replace('-', '', strtolower($page_name));
if (!(isset($maintenance) && (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))))) if (!(isset($maintenance) && (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP'))))))
{ {
if ($id_product = Tools::getValue('id_product')) if ($page_name == 'product' && ($id_product = Tools::getValue('id_product')))
return Meta::getProductMetas($id_product, $id_lang, $page_name); return Meta::getProductMetas($id_product, $id_lang, $page_name);
else if ($id_category = Tools::getValue('id_category')) elseif ($page_name == 'category' && ($id_category = Tools::getValue('id_category')))
return Meta::getCategoryMetas($id_category, $id_lang, $page_name, $title); return Meta::getCategoryMetas($id_category, $id_lang, $page_name, $title);
else if ($id_manufacturer = Tools::getValue('id_manufacturer')) elseif ($page_name == 'manufacturer' && ($id_manufacturer = Tools::getValue('id_manufacturer')))
return Meta::getManufacturerMetas($id_manufacturer, $id_lang, $page_name); return Meta::getManufacturerMetas($id_manufacturer, $id_lang, $page_name);
else if ($id_supplier = Tools::getValue('id_supplier')) elseif ($page_name == 'supplier' && ($id_supplier = Tools::getValue('id_supplier')))
return Meta::getSupplierMetas($id_supplier, $id_lang, $page_name); return Meta::getSupplierMetas($id_supplier, $id_lang, $page_name);
else if ($id_cms = Tools::getValue('id_cms')) elseif ($page_name == 'cms' && ($id_cms = Tools::getValue('id_cms')))
return Meta::getCmsMetas($id_cms, $id_lang, $page_name); return Meta::getCmsMetas($id_cms, $id_lang, $page_name);
else if ($id_cms_category = Tools::getValue('id_cms_category')) elseif ($page_name == 'cms' && ($id_cms_category = Tools::getValue('id_cms_category')))
return Meta::getCmsCategoryMetas($id_cms_category, $id_lang, $page_name); return Meta::getCmsCategoryMetas($id_cms_category, $id_lang, $page_name);
} }
+70 -25
View File
@@ -270,7 +270,7 @@ abstract class ObjectModelCore
$fields = array_merge($fields, $this->getFieldsShop()); $fields = array_merge($fields, $this->getFieldsShop());
// Ensure that we get something to insert // Ensure that we get something to insert
if (!$fields) if (!$fields && isset($this->id) && Validate::isUnsignedId($this->id))
$fields[$this->def['primary']] = $this->id; $fields[$this->def['primary']] = $this->id;
return $fields; return $fields;
} }
@@ -286,7 +286,7 @@ abstract class ObjectModelCore
public function getFieldsShop() public function getFieldsShop()
{ {
$fields = $this->formatFields(self::FORMAT_SHOP); $fields = $this->formatFields(self::FORMAT_SHOP);
if (!$fields) if (!$fields && isset($this->id) && Validate::isUnsignedId($this->id))
$fields[$this->def['primary']] = $this->id; $fields[$this->def['primary']] = $this->id;
return $fields; return $fields;
} }
@@ -449,7 +449,19 @@ abstract class ObjectModelCore
if ($autodate && property_exists($this, 'date_upd')) if ($autodate && property_exists($this, 'date_upd'))
$this->date_upd = date('Y-m-d H:i:s'); $this->date_upd = date('Y-m-d H:i:s');
if (Shop::isTableAssociated($this->def['table']))
{
$id_shop_list = Shop::getContextListShopID();
if (count($this->id_shop_list) > 0)
$id_shop_list = $this->id_shop_list;
}
// Database insertion // Database insertion
if (isset($this->id))
unset($this->id);
if (Shop::checkIdShopDefault($this->def['table']))
$this->id_shop_default = min($id_shop_list);
if (!$result = ObjectModel::$db->insert($this->def['table'], $this->getFields(), $null_values)) if (!$result = ObjectModel::$db->insert($this->def['table'], $this->getFields(), $null_values))
return false; return false;
@@ -459,10 +471,6 @@ abstract class ObjectModelCore
// Database insertion for multishop fields related to the object // Database insertion for multishop fields related to the object
if (Shop::isTableAssociated($this->def['table'])) if (Shop::isTableAssociated($this->def['table']))
{ {
$id_shop_list = Shop::getContextListShopID();
if (count($this->id_shop_list) > 0)
$id_shop_list = $this->id_shop_list;
$fields = $this->getFieldsShop(); $fields = $this->getFieldsShop();
$fields[$this->def['primary']] = (int)$this->id; $fields[$this->def['primary']] = (int)$this->id;
@@ -532,7 +540,13 @@ abstract class ObjectModelCore
// Automatically fill dates // Automatically fill dates
if (array_key_exists('date_upd', $this)) if (array_key_exists('date_upd', $this))
$this->date_upd = date('Y-m-d H:i:s'); $this->date_upd = date('Y-m-d H:i:s');
$id_shop_list = Shop::getContextListShopID();
if (count($this->id_shop_list) > 0)
$id_shop_list = $this->id_shop_list;
if (Shop::checkIdShopDefault($this->def['table']))
$this->id_shop_default = min($id_shop_list);
// Database update // Database update
if (!$result = ObjectModel::$db->update($this->def['table'], $this->getFields(), '`'.pSQL($this->def['primary']).'` = '.(int)$this->id, 0, $null_values)) if (!$result = ObjectModel::$db->update($this->def['table'], $this->getFields(), '`'.pSQL($this->def['primary']).'` = '.(int)$this->id, 0, $null_values))
return false; return false;
@@ -553,9 +567,6 @@ abstract class ObjectModelCore
else else
$all_fields = $fields; $all_fields = $fields;
$id_shop_list = Shop::getContextListShopID();
if (count($this->id_shop_list) > 0)
$id_shop_list = $this->id_shop_list;
foreach ($id_shop_list as $id_shop) foreach ($id_shop_list as $id_shop)
{ {
@@ -612,7 +623,7 @@ abstract class ObjectModelCore
if (Db::getInstance()->getValue('SELECT COUNT(*) FROM '.pSQL(_DB_PREFIX_.$this->def['table']).'_lang WHERE '.$where)) if (Db::getInstance()->getValue('SELECT COUNT(*) FROM '.pSQL(_DB_PREFIX_.$this->def['table']).'_lang WHERE '.$where))
$result &= ObjectModel::$db->update($this->def['table'].'_lang', $field, $where); $result &= ObjectModel::$db->update($this->def['table'].'_lang', $field, $where);
else else
$result &= ObjectModel::$db->insert($this->def['table'].'_lang', $field, 'INSERT'); $result &= ObjectModel::$db->insert($this->def['table'].'_lang', $field, $null_values);
} }
} }
} }
@@ -1015,18 +1026,29 @@ abstract class ObjectModelCore
public function getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit) public function getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
{ {
$assoc = Shop::getAssoTable($this->def['table']); $assoc = Shop::getAssoTable($this->def['table']);
$class_name = WebserviceRequest::$ws_current_classname;
$vars = get_class_vars($class_name);
if ($assoc !== false) if ($assoc !== false)
{ {
$multi_shop_join = ' LEFT JOIN `'._DB_PREFIX_.bqSQL($this->def['table']).'_'.bqSQL($assoc['type']).'` if ($assoc['type'] !== 'fk_shop')
AS multi_shop_'.bqSQL($this->def['table']).' {
ON (main.'.bqSQL($this->def['primary']).' = multi_shop_'.bqSQL($this->def['table']).'.'.bqSQL($this->def['primary']).')'; $multi_shop_join = ' LEFT JOIN `'._DB_PREFIX_.bqSQL($this->def['table']).'_'.bqSQL($assoc['type']).'`
$class_name = WebserviceRequest::$ws_current_classname; AS `multi_shop_'.bqSQL($this->def['table']).'`
$vars = get_class_vars($class_name); ON (main.`'.bqSQL($this->def['primary']).'` = `multi_shop_'.bqSQL($this->def['table']).'`.`'.bqSQL($this->def['primary']).'`)';
foreach ($vars['shopIDs'] as $id_shop) $sql_filter = 'AND id_shop = '.Context::getContext()->shop->id.' '.$sql_filter;
$or[] = ' multi_shop_'.bqSQL($this->def['table']).'.id_shop = '.(int)$id_shop.' '; $sql_join = $multi_shop_join.' '.$sql_join;
$multi_shop_filter = ' AND ('.implode('OR', $or).') '; }
$sql_filter = $multi_shop_filter.' '.$sql_filter; else
$sql_join = $multi_shop_join.' '.$sql_join; {
$vars = get_class_vars($class_name);
foreach ($vars['shopIDs'] as $id_shop)
$or[] = ' main.id_shop = '.(int)$id_shop.' ';
$prepend = '';
if (count($or))
$prepend = 'AND ('.implode('OR', $or).')';
$sql_filter = $prepend.' '.$sql_filter;
}
} }
$query = ' $query = '
SELECT DISTINCT main.`'.bqSQL($this->def['primary']).'` FROM `'._DB_PREFIX_.bqSQL($this->def['table']).'` AS main SELECT DISTINCT main.`'.bqSQL($this->def['primary']).'` FROM `'._DB_PREFIX_.bqSQL($this->def['table']).'` AS main
@@ -1034,10 +1056,31 @@ abstract class ObjectModelCore
WHERE 1 '.$sql_filter.' WHERE 1 '.$sql_filter.'
'.($sql_sort != '' ? $sql_sort : '').' '.($sql_sort != '' ? $sql_sort : '').'
'.($sql_limit != '' ? $sql_limit : ''); '.($sql_limit != '' ? $sql_limit : '');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
} }
public function validateFieldsRequiredDatabase($htmlentities = true)
{
$errors = array();
$required_fields = (isset(self::$fieldsRequiredDatabase[get_class($this)])) ? self::$fieldsRequiredDatabase[get_class($this)] : array();
foreach ($this->def['fields'] as $field => $data)
{
if (!in_array($field, $required_fields))
continue;
if (!method_exists('Validate', $data['validate']))
throw new PrestaShopException('Validation function not found. '.$data['validate']);
$value = Tools::getValue($field);
if (empty($value))
$errors[] = sprintf(Tools::displayError('The field %s is required.'), self::displayFieldName($field, get_class($this), $htmlentities));
}
return $errors;
}
public function getFieldsRequiredDatabase($all = false) public function getFieldsRequiredDatabase($all = false)
{ {
return Db::getInstance()->executeS(' return Db::getInstance()->executeS('
@@ -1165,9 +1208,8 @@ abstract class ObjectModelCore
public function hasMultishopEntries() public function hasMultishopEntries()
{ {
if (!Shop::isTableAssociated($this->def['table']) || !Shop::isFeatureActive()) if (!Shop::isTableAssociated($this->def['table']) || !Shop::isFeatureActive())
return false; return false;
//check if there is more than one entries in associated shop table return (bool)Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.$this->def['table'].'_shop` WHERE `'.$this->def['primary'].'` = '.(int)$this->id);
return (bool)(Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.$this->def['table'].'_shop` WHERE `'.$this->def['primary'].'` = '.(int)$this->id) > 1);
} }
public function isMultishop() public function isMultishop()
@@ -1275,8 +1317,11 @@ abstract class ObjectModelCore
* @param bool $has_active_column true if the table has an active column * @param bool $has_active_column true if the table has an active column
* @return bool * @return bool
*/ */
public static function isCurrentlyUsed($table, $has_active_column = false) public static function isCurrentlyUsed($table = null, $has_active_column = false)
{ {
if ($table === null)
$table = self::$definition['table'];
$query = new DbQuery(); $query = new DbQuery();
$query->select('`id_'.pSQL($table).'`'); $query->select('`id_'.pSQL($table).'`');
$query->from($table); $query->from($table);
+1 -1
View File
@@ -126,7 +126,7 @@ class PackCore extends Product
if (!Pack::isFeatureActive()) if (!Pack::isFeatureActive())
return array(); return array();
$sql = 'SELECT p.*, product_shop.*, pl.*, i.`id_image`, il.`legend`, t.`rate`, cl.`name` AS category_default, a.quantity AS pack_quantity, product_shop.`id_category_default` $sql = 'SELECT p.*, product_shop.*, pl.*, i.`id_image`, il.`legend`, t.`rate`, cl.`name` AS category_default, a.quantity AS pack_quantity, product_shop.`id_category_default`, a.id_product_pack
FROM `'._DB_PREFIX_.'pack` a FROM `'._DB_PREFIX_.'pack` a
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = a.id_product_item LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = a.id_product_item
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
+154 -83
View File
@@ -51,6 +51,9 @@ class ProductCore extends ObjectModel
/** @var integer default Category id */ /** @var integer default Category id */
public $id_category_default; public $id_category_default;
/** @var integer default Shop id */
public $id_shop_default;
/** @var string Manufacturer name */ /** @var string Manufacturer name */
public $manufacturer_name; public $manufacturer_name;
@@ -237,6 +240,7 @@ class ProductCore extends ObjectModel
'multilang_shop' => true, 'multilang_shop' => true,
'fields' => array( 'fields' => array(
// Classic fields // Classic fields
'id_shop_default' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 32),
@@ -346,6 +350,10 @@ class ProductCore extends ObjectModel
'getter' => 'getWsManufacturerName', 'getter' => 'getWsManufacturerName',
'setter' => false 'setter' => false
), ),
'quantity' => array(
'getter' => false,
'setter' => false
),
), ),
'associations' => array( 'associations' => array(
'categories' => array( 'categories' => array(
@@ -646,7 +654,7 @@ class ProductCore extends ObjectModel
StockAvailable::removeProductFromStockAvailable($this->id); StockAvailable::removeProductFromStockAvailable($this->id);
$result = parent::delete(); $result = parent::delete();
$result &= ($this->deleteProductAttributes() && $this->deleteImages() && $this->deleteSceneProducts());
// If there are still entries in product_shop, don't remove completly the product // If there are still entries in product_shop, don't remove completly the product
if ($this->hasMultishopEntries()) if ($this->hasMultishopEntries())
return true; return true;
@@ -655,8 +663,6 @@ class ProductCore extends ObjectModel
if (!$result || if (!$result ||
!GroupReduction::deleteProductReduction($this->id) || !GroupReduction::deleteProductReduction($this->id) ||
!$this->deleteCategories(true) || !$this->deleteCategories(true) ||
!$this->deleteImages() ||
!$this->deleteProductAttributes() ||
!$this->deleteProductFeatures() || !$this->deleteProductFeatures() ||
!$this->deleteTags() || !$this->deleteTags() ||
!$this->deleteCartProducts() || !$this->deleteCartProducts() ||
@@ -666,7 +672,6 @@ class ProductCore extends ObjectModel
!SpecificPrice::deleteByProductId((int)$this->id) || !SpecificPrice::deleteByProductId((int)$this->id) ||
!$this->deletePack() || !$this->deletePack() ||
!$this->deleteProductSale() || !$this->deleteProductSale() ||
!$this->deleteSceneProducts() ||
!$this->deleteSearchIndexes() || !$this->deleteSearchIndexes() ||
!$this->deleteAccessories() || !$this->deleteAccessories() ||
!$this->deleteFromAccessories() || !$this->deleteFromAccessories() ||
@@ -681,12 +686,18 @@ class ProductCore extends ObjectModel
public function deleteSelection($products) public function deleteSelection($products)
{ {
$return = 1; $return = 1;
if (is_array($products) && count($products)) if (is_array($products) && ($count = count($products)))
{
// Deleting products can be quite long on a cheap server. Let's say 1.5 seconds by product (I've seen it!).
if (intval(ini_get('max_execution_time')) < round($count * 1.5))
ini_set('max_execution_time', round($count * 1.5));
foreach ($products as $id_product) foreach ($products as $id_product)
{ {
$product = new Product((int)$id_product); $product = new Product((int)$id_product);
$return &= $product->delete(); $return &= $product->delete();
} }
}
return $return; return $return;
} }
@@ -765,9 +776,9 @@ class ProductCore extends ObjectModel
$result = Db::getInstance()->executeS(' $result = Db::getInstance()->executeS('
SELECT c.`id_category` SELECT c.`id_category`
FROM `'._DB_PREFIX_.'category_product` cp FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.`id_category` = cp.`id_category`)
ON (c.`id_category` = cp.`id_category`) '.Shop::addSqlAssociation('category', 'c', true).'
WHERE cp.`id_category` NOT IN('.implode(',', array_map('intval', $categories)).') WHERE cp.`id_category` NOT IN ('.implode(',', array_map('intval', $categories)).')
AND cp.id_product = '.$this->id AND cp.id_product = '.$this->id
); );
@@ -980,7 +991,7 @@ class ProductCore extends ObjectModel
return count($result) > 0; return count($result) > 0;
} }
public function productAttributeExists($attributes_list, $current_product_attribute = false, Context $context = null) public function productAttributeExists($attributes_list, $current_product_attribute = false, Context $context = null, $all_shops = false, $return_id = false)
{ {
if (!Combination::isFeatureActive()) if (!Combination::isFeatureActive())
return false; return false;
@@ -991,18 +1002,17 @@ class ProductCore extends ObjectModel
FROM `'._DB_PREFIX_.'product_attribute` pa FROM `'._DB_PREFIX_.'product_attribute` pa
JOIN `'._DB_PREFIX_.'product_attribute_shop` pas ON (pas.id_product_attribute = pa.id_product_attribute) JOIN `'._DB_PREFIX_.'product_attribute_shop` pas ON (pas.id_product_attribute = pa.id_product_attribute)
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`) LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
WHERE pas.id_shop ='.(int)$context->shop->id.' AND pa.`id_product` = '.(int)$this->id WHERE 1 '.(!$all_shops ? ' AND pas.id_shop ='.(int)$context->shop->id : '').' AND pa.`id_product` = '.(int)$this->id.
($all_shops ? ' GROUP BY pac.id_attribute, pac.id_product_attribute ' : '')
); );
/* If something's wrong */ /* If something's wrong */
if (!$result || empty($result)) if (!$result || empty($result))
return false; return false;
/* Product attributes simulation */ /* Product attributes simulation */
$product_attributes = array(); $product_attributes = array();
foreach ($result as $product_attribute) foreach ($result as $product_attribute)
$product_attributes[$product_attribute['id_product_attribute']][] = $product_attribute['id_attribute']; $product_attributes[$product_attribute['id_product_attribute']][] = $product_attribute['id_attribute'];
/* Checking product's attribute existence */ /* Checking product's attribute existence */
foreach ($product_attributes as $key => $product_attribute) foreach ($product_attributes as $key => $product_attribute)
if (count($product_attribute) == count($attributes_list)) if (count($product_attribute) == count($attributes_list))
@@ -1012,7 +1022,11 @@ class ProductCore extends ObjectModel
if (!in_array($product_attribute[$i], $attributes_list) || $key == $current_product_attribute) if (!in_array($product_attribute[$i], $attributes_list) || $key == $current_product_attribute)
$diff = true; $diff = true;
if (!$diff) if (!$diff)
{
if ($return_id)
return $key;
return true; return true;
}
} }
return false; return false;
@@ -1048,7 +1062,43 @@ class ProductCore extends ObjectModel
$this->addSupplierReference($id_supplier, $id_product_attribute); $this->addSupplierReference($id_supplier, $id_product_attribute);
return $id_product_attribute; return $id_product_attribute;
} }
public function generateMultipleCombinations($combinations, $attributes)
{
$attributes_list = array();
$res = true;
foreach ($combinations as $key => $combination)
{
$id_combination = (int)$this->productAttributeExists($attributes[$key], false, null, true, true);
$obj = new Combination($id_combination);
if ($id_combination)
{
$obj->minimal_quantity = 1;
$obj->available_date = '0000-00-00';
}
foreach ($combination as $field => $value)
$obj->$field = $value;
$obj->save();
if (!$id_combination)
{
$attribute_list = array();
foreach ($attributes[$key] as $id_attribute)
$attribute_list[] = array(
'id_product_attribute' => (int)$obj->id,
'id_attribute' => (int)$id_attribute
);
$res &= Db::getInstance()->insert('product_attribute_combination', $attribute_list);
}
}
return $res;
}
/** /**
* @param integer $quantity DEPRECATED * @param integer $quantity DEPRECATED
* @param string $supplier_reference DEPRECATED * @param string $supplier_reference DEPRECATED
@@ -1078,6 +1128,7 @@ class ProductCore extends ObjectModel
public function addProductAttributeMultiple($attributes, $set_default = true) public function addProductAttributeMultiple($attributes, $set_default = true)
{ {
Tools::displayAsDeprecated();
$return = array(); $return = array();
$default_value = 1; $default_value = 1;
foreach ($attributes as &$attribute) foreach ($attributes as &$attribute)
@@ -1339,8 +1390,6 @@ class ProductCore extends ObjectModel
WHERE `id_product` = '.(int)$this->id.' WHERE `id_product` = '.(int)$this->id.'
), \'0\') ), \'0\')
WHERE `id_product` = '.(int)$this->id); WHERE `id_product` = '.(int)$this->id);
} }
/** /**
* Delete product attributes * Delete product attributes
@@ -1503,6 +1552,7 @@ class ProductCore extends ObjectModel
public function addAttributeCombinationMultiple($id_attributes, $combinations) public function addAttributeCombinationMultiple($id_attributes, $combinations)
{ {
Tools::displayAsDeprecated();
$attributes_list = array(); $attributes_list = array();
foreach ($id_attributes as $nb => $id_product_attribute) foreach ($id_attributes as $nb => $id_product_attribute)
if (isset($combinations[$nb])) if (isset($combinations[$nb]))
@@ -1515,6 +1565,7 @@ class ProductCore extends ObjectModel
return Db::getInstance()->insert('product_attribute_combination', $attributes_list); return Db::getInstance()->insert('product_attribute_combination', $attributes_list);
} }
/** /**
* Delete a product attributes combination * Delete a product attributes combination
* *
@@ -1583,23 +1634,33 @@ class ProductCore extends ObjectModel
{ {
if (!Combination::isFeatureActive()) if (!Combination::isFeatureActive())
return array(); return array();
$add_shop = '';
$sql = 'SELECT pa.*, product_attribute_shop.*, GROUP_CONCAT(agl.`name`, \''.pSQL($attribute_value_separator).'\', $combinations = Db::getInstance()->executeS('SELECT pa.*, product_attribute_shop.*
al.`name` ORDER BY agl.`id_attribute_group` SEPARATOR \''.pSQL($attribute_separator).'\') as attribute_designation
FROM `'._DB_PREFIX_.'product_attribute` pa FROM `'._DB_PREFIX_.'product_attribute` pa
'.Shop::addSqlAssociation('product_attribute', 'pa').' '.Shop::addSqlAssociation('product_attribute', 'pa').'
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` WHERE pa.`id_product` = '.(int)$this->id.'
GROUP BY pa.`id_product_attribute`');
$product_attributes = array();
foreach ($combinations as $combination)
$product_attributes[] = (int)$combination['id_product_attribute'];
$lang = Db::getInstance()->executeS('SELECT pac.id_product_attribute, GROUP_CONCAT(agl.`name`, \''.pSQL($attribute_value_separator).'\',al.`name` ORDER BY agl.`id_attribute_group` SEPARATOR \''.pSQL($attribute_separator).'\') as attribute_designation
FROM `'._DB_PREFIX_.'product_attribute_combination` pac
LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute`
LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group`
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
WHERE pa.`id_product` = '.(int)$this->id.' WHERE pac.id_product_attribute IN ('.implode(',', $product_attributes).')
GROUP BY pa.`id_product_attribute`'; GROUP BY pac.id_product_attribute');
$res = Db::getInstance()->executeS($sql); foreach ($lang as $k => $row)
$combinations[$k]['attribute_designation'] = $row['attribute_designation'];
//Get quantity of each variations //Get quantity of each variations
foreach ($res as $key => $row) foreach ($combinations as $key => $row)
{ {
$cache_key = $row['id_product'].'_'.$row['id_product_attribute'].'_quantity'; $cache_key = $row['id_product'].'_'.$row['id_product_attribute'].'_quantity';
@@ -1609,10 +1670,10 @@ class ProductCore extends ObjectModel
StockAvailable::getQuantityAvailableByProduct($row['id_product'], $row['id_product_attribute']) StockAvailable::getQuantityAvailableByProduct($row['id_product'], $row['id_product_attribute'])
); );
$res[$key]['quantity'] = Cache::retrieve($cache_key); $combinations[$key]['quantity'] = Cache::retrieve($cache_key);
} }
return $res; return $combinations;
} }
/** /**
@@ -1846,7 +1907,6 @@ class ProductCore extends ObjectModel
); );
$sql->leftJoin('tax', 't', 't.`id_tax` = tr.`id_tax`'); $sql->leftJoin('tax', 't', 't.`id_tax` = tr.`id_tax`');
$sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`'); $sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`');
$sql->join(Product::sqlStock('p', 0));
$sql->where('product_shop.`active` = 1'); $sql->where('product_shop.`active` = 1');
if ($front) if ($front)
@@ -1875,9 +1935,10 @@ class ProductCore extends ObjectModel
{ {
$sql->select('pa.id_product_attribute'); $sql->select('pa.id_product_attribute');
$sql->leftOuterJoin('product_attribute', 'pa', 'p.`id_product` = pa.`id_product`'); $sql->leftOuterJoin('product_attribute', 'pa', 'p.`id_product` = pa.`id_product`');
$sql->join(Shop::addSqlAssociation('product_attribute', 'pa', false)); $sql->join(Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.default_on = 1'));
$sql->where('(product_attribute_shop.default_on = 1 OR product_attribute_shop.default_on IS NULL)'); $sql->where('(pa.id_product_attribute IS NULL OR product_attribute_shop.id_product_attribute IS NOT NULL)');
} }
$sql->join(Product::sqlStock('p', Combination::isFeatureActive() ? 'product_attribute_shop' : 0));
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
@@ -1949,7 +2010,7 @@ class ProductCore extends ObjectModel
FROM `'._DB_PREFIX_.'product` p FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').' '.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.id_product = pa.id_product) LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.id_product = pa.id_product)
'.Shop::addSqlAssociation('product_attribute', 'pa', false).' '.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.default_on = 1').'
WHERE product_shop.`active` = 1 WHERE product_shop.`active` = 1
'.(($ids_product) ? $ids_product : '').' '.(($ids_product) ? $ids_product : '').'
AND p.`id_product` IN ( AND p.`id_product` IN (
@@ -1958,7 +2019,6 @@ class ProductCore extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) 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.'
) )
AND ((pa.`default_on` = 1 AND pa.`id_product_attribute` != 0) OR (pa.`id_product_attribute` IS NULL))
GROUP BY p.id_product GROUP BY p.id_product
ORDER BY RAND()'; ORDER BY RAND()';
@@ -2138,8 +2198,9 @@ class ProductCore extends ObjectModel
$ret = array(); $ret = array();
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT cp.`id_category`, cl.`name`, cl.`link_rewrite` FROM `'._DB_PREFIX_.'category_product` cp SELECT cp.`id_category`, cl.`name`, cl.`link_rewrite` FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.id_category = cp.id_category)
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cp.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cp.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').')
'.Shop::addSqlAssociation('category', 'cp').' '.Shop::addSqlAssociation('category', 'c').'
WHERE cp.`id_product` = '.(int)$id_product.' WHERE cp.`id_product` = '.(int)$id_product.'
AND cl.`id_lang` = '.(int)$id_lang AND cl.`id_lang` = '.(int)$id_lang
); );
@@ -2189,14 +2250,13 @@ class ProductCore extends ObjectModel
'id_shop' => (int)$this->id_shop 'id_shop' => (int)$this->id_shop
); );
} }
Db::getInstance()->execute( Db::getInstance()->execute(
'DELETE FROM `'._DB_PREFIX_.'product_carrier` 'DELETE FROM `'._DB_PREFIX_.'product_carrier`
WHERE id_product = '.(int)$this->id.' WHERE id_product = '.(int)$this->id.'
AND id_shop = '.(int)$this->id_shop AND id_shop = '.(int)$this->id_shop
); );
if (count($data))
Db::getInstance()->insert('product_carrier', $data); Db::getInstance()->insert('product_carrier', $data);
} }
/** /**
@@ -2342,8 +2402,7 @@ class ProductCore extends ObjectModel
&& Configuration::get('VATNUMBER_MANAGEMENT')) && Configuration::get('VATNUMBER_MANAGEMENT'))
$usetax = false; $usetax = false;
$id_customer = 0; if (is_null($id_customer) && Validate::isLoadedObject($context->customer))
if (Validate::isLoadedObject($context->customer))
$id_customer = $context->customer->id; $id_customer = $context->customer->id;
return Product::priceCalculation( return Product::priceCalculation(
@@ -2405,7 +2464,7 @@ class ProductCore extends ObjectModel
$cache_id = $id_product.'-'.$id_shop.'-'.$id_currency.'-'.$id_country.'-'.$id_state.'-'.$zipcode.'-'.$id_group. $cache_id = $id_product.'-'.$id_shop.'-'.$id_currency.'-'.$id_country.'-'.$id_state.'-'.$zipcode.'-'.$id_group.
'-'.$quantity.'-'.(int)$id_product_attribute.'-'.($use_tax?'1':'0').'-'.$decimals.'-'.($only_reduc?'1':'0'). '-'.$quantity.'-'.(int)$id_product_attribute.'-'.($use_tax?'1':'0').'-'.$decimals.'-'.($only_reduc?'1':'0').
'-'.($use_reduc?'1':'0').'-'.$with_ecotax.'-'.$id_customer; '-'.($use_reduc?'1':'0').'-'.$with_ecotax.'-'.$id_customer;
// reference parameter is filled before any returns // reference parameter is filled before any returns
$specific_price = SpecificPrice::getSpecificPrice( $specific_price = SpecificPrice::getSpecificPrice(
(int)$id_product, (int)$id_product,
@@ -2428,41 +2487,33 @@ class ProductCore extends ObjectModel
if (!isset(self::$_pricesLevel2[$cache_id_2])) if (!isset(self::$_pricesLevel2[$cache_id_2]))
{ {
$sql = new DbQuery(); $sql = new DbQuery();
$sql->select('product_shop.`price`, product_shop.`ecotax`, NULL id_product_attribute'); $sql->select('product_shop.`price`, product_shop.`ecotax`');
$sql->from('product', 'p'); $sql->from('product', 'p');
$sql->join(Shop::addSqlAssociation('product', 'p')); $sql->join(Shop::addSqlAssociation('product', 'p'));
$sql->where('p.`id_product` = '.(int)$id_product); $sql->where('p.`id_product` = '.(int)$id_product);
$default_on = false;
if (Combination::isFeatureActive()) if (Combination::isFeatureActive())
{ {
$default_on = true; $sql->select('product_attribute_shop.id_product_attribute, product_attribute_shop.`price` AS attribute_price, product_attribute_shop.default_on');
$sql->select('pa.id_product_attribute, product_attribute_shop.`price` AS attribute_price, (SELECT product_attribute_shop.price $sql->leftJoin('product_attribute', 'pa', 'pa.`id_product` = p.`id_product`');
FROM `'._DB_PREFIX_.'product_attribute` pa $sql->join(Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.id_shop ='.(int)$id_shop));
'.Shop::addSqlAssociation('product_attribute', 'pa').'
WHERE pa.id_product = '.(int)$id_product.'
AND product_attribute_shop.default_on = 1
GROUP BY pa.id_product_attribute
LIMIT 1) as default_on');
$sql->leftJoin('product_attribute', 'pa', 'pa.`id_product` = '.(int)$id_product);
$sql->join(Shop::addSqlAssociation('product_attribute', 'pa', false));
} }
else
$sql->select('0 as id_product_attribute');
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
foreach ($res as $row)
if ($res)
{ {
foreach ($res as $row) $array_tmp = array(
self::$_pricesLevel2[$cache_id_2][(int)$row['id_product_attribute']] = array( 'price' => $row['price'],
'price' => $row['price'], 'ecotax' => $row['ecotax'],
'ecotax' => $row['ecotax'], 'attribute_price' => (isset($row['attribute_price']) ? $row['attribute_price'] : null)
'attribute_price' => (isset($row['attribute_price']) ? $row['attribute_price'] : null) );
); self::$_pricesLevel2[$cache_id_2][(int)$row['id_product_attribute']] = $array_tmp;
if ($default_on)
self::$_pricesLevel2[$cache_id_2][0] = array('price' => $row['price'], if (isset($row['default_on']) && $row['default_on'] == 1)
'ecotax' => $row['ecotax'], self::$_pricesLevel2[$cache_id_2][0] = $array_tmp;
'attribute_price' => $row['attribute_price']);
} }
} }
if (!isset(self::$_pricesLevel2[$cache_id_2][(int)$id_product_attribute])) if (!isset(self::$_pricesLevel2[$cache_id_2][(int)$id_product_attribute]))
return; return;
@@ -2472,7 +2523,6 @@ class ProductCore extends ObjectModel
$price = (float)$result['price']; $price = (float)$result['price'];
else else
$price = (float)$specific_price['price']; $price = (float)$specific_price['price'];
// convert only if the specific price is in the default currency (id_currency = 0) // convert only if the specific price is in the default currency (id_currency = 0)
if (!$specific_price || !($specific_price['price'] >= 0 && $specific_price['id_currency'])) if (!$specific_price || !($specific_price['price'] >= 0 && $specific_price['id_currency']))
$price = Tools::convertPrice($price, $id_currency); $price = Tools::convertPrice($price, $id_currency);
@@ -2626,6 +2676,22 @@ class ProductCore extends ObjectModel
return (isset($row['id_product_attribute']) && $row['id_product_attribute']) ? (int)$row['id_product_attribute'] : 0; return (isset($row['id_product_attribute']) && $row['id_product_attribute']) ? (int)$row['id_product_attribute'] : 0;
} }
public function getDefaultIdProductAttribute()
{
if (!Combination::isFeatureActive())
return 0;
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT pa.`id_product_attribute`
FROM `'._DB_PREFIX_.'product_attribute` pa
'.Shop::addSqlAssociation('product_attribute', 'pa').'
WHERE pa.`id_product` = '.(int)$this->id.'
AND product_attribute_shop.default_on = 1'
);
return (isset($row['id_product_attribute']) && $row['id_product_attribute']) ? (int)$row['id_product_attribute'] : 0;
}
public function getPriceWithoutReduct($notax = false, $id_product_attribute = false) public function getPriceWithoutReduct($notax = false, $id_product_attribute = false)
{ {
return Product::getPriceStatic((int)$this->id, !$notax, $id_product_attribute, 6, null, false, false); return Product::getPriceStatic((int)$this->id, !$notax, $id_product_attribute, 6, null, false, false);
@@ -2712,10 +2778,10 @@ class ProductCore extends ObjectModel
{ {
if (!Combination::isFeatureActive()) if (!Combination::isFeatureActive())
$sql .= ' AND stock.id_product_attribute = 0'; $sql .= ' AND stock.id_product_attribute = 0';
else if (is_numeric($product_attribute)) elseif (is_numeric($product_attribute))
$sql .= ' AND stock.id_product_attribute = '.$product_attribute; $sql .= ' AND stock.id_product_attribute = '.$product_attribute;
else if (is_string($product_attribute)) elseif (is_string($product_attribute))
$sql .= ' AND stock.id_product_attribute = IFNULL('.pSQL($product_attribute).'.id_product_attribute, 0)'; $sql .= ' AND stock.id_product_attribute = IFNULL(`'.bqSQL($product_attribute).'`.id_product_attribute, 0)';
} }
$sql .= StockAvailable::addSqlShopRestriction(null, $id_shop, 'stock').' )'; $sql .= StockAvailable::addSqlShopRestriction(null, $id_shop, 'stock').' )';
@@ -2941,7 +3007,8 @@ class ProductCore extends ObjectModel
($active ? ' AND product_shop.`active` = 1' : ''); ($active ? ' AND product_shop.`active` = 1' : '');
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql)) if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql))
return false; return false;
foreach ($result as &$row)
$row['id_product_attribute'] = Product::getDefaultAttribute((int)$row['id_product']);
return $this->getProductsProperties($id_lang, $result); return $this->getProductsProperties($id_lang, $result);
} }
@@ -3461,6 +3528,8 @@ class ProductCore extends ObjectModel
$usetax = Tax::excludeTaxeOption(); $usetax = Tax::excludeTaxeOption();
$cache_key = $row['id_product'].'-'.$row['id_product_attribute'].'-'.$id_lang.'-'.(int)$usetax; $cache_key = $row['id_product'].'-'.$row['id_product_attribute'].'-'.$id_lang.'-'.(int)$usetax;
if (isset($row['id_product_pack']))
$cache_key .= '-pack'.$row['id_product_pack'];
if (isset(self::$producPropertiesCache[$cache_key])) if (isset(self::$producPropertiesCache[$cache_key]))
return self::$producPropertiesCache[$cache_key]; return self::$producPropertiesCache[$cache_key];
@@ -3964,18 +4033,19 @@ class ProductCore extends ObjectModel
{ {
if (!((int)$id_product > 0) || !is_array($categories) || empty($categories)) if (!((int)$id_product > 0) || !is_array($categories) || empty($categories))
return false; return false;
$sql = 'SELECT id_product FROM `'._DB_PREFIX_.'category_product` WHERE `id_product`='.(int)$id_product.' AND `id_category` IN('; $sql = 'SELECT id_product FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)$id_product.' AND `id_category` IN (';
foreach ($categories as $category) foreach ($categories as $category)
$sql .= (int)$category['id_category'].','; $sql .= (int)$category['id_category'].',';
$sql = rtrim($sql, ',').')'; $sql = rtrim($sql, ',').')';
if (isset(self::$_incat[md5($sql)])) $hash = md5($sql);
return self::$_incat[md5($sql)]; if (!isset(self::$_incat[$hash]))
{
if (!Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql)) if (!Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql))
return false; return false;
self::$_incat[md5($sql)] = (Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows() > 0 ? true : false); self::$_incat[$hash] = (Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows() > 0 ? true : false);
return self::$_incat[md5($sql)]; }
return self::$_incat[$hash];
} }
public function getNoPackPrice() public function getNoPackPrice()
@@ -4187,7 +4257,8 @@ class ProductCore extends ObjectModel
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS( $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
'SELECT cp.`id_category` AS id 'SELECT cp.`id_category` AS id
FROM `'._DB_PREFIX_.'category_product` cp FROM `'._DB_PREFIX_.'category_product` cp
'.Shop::addSqlAssociation('category', 'cp').' LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.id_category = cp.id_category)
'.Shop::addSqlAssociation('category', 'c').'
WHERE cp.`id_product` = '.(int)$this->id WHERE cp.`id_product` = '.(int)$this->id
); );
return $result; return $result;
@@ -4263,7 +4334,7 @@ class ProductCore extends ObjectModel
$ids_orig[] = $id['id']; $ids_orig[] = $id['id'];
$all_ids = array(); $all_ids = array();
$all = Db::getInstance()->executeS('SELECT pa.`id_product_attribute` as id FROM `'._DB_PREFIX_.'product_attribute` '.Shop::addSqlAssociation('product_attribute', 'pa')); $all = Db::getInstance()->executeS('SELECT pa.`id_product_attribute` as id FROM `'._DB_PREFIX_.'product_attribute` pa '.Shop::addSqlAssociation('product_attribute', 'pa'));
if (is_array($all)) if (is_array($all))
foreach ($all as $id) foreach ($all as $id)
$all_ids[] = $id['id']; $all_ids[] = $id['id'];
@@ -4429,11 +4500,12 @@ class ProductCore extends ObjectModel
* @param int $id_product the id of the product * @param int $id_product the id of the product
* @return array product attribute id list * @return array product attribute id list
*/ */
public static function getProductAttributesIds($id_product) public static function getProductAttributesIds($id_product, $shop_only = false)
{ {
return Db::getInstance()->executeS(' return Db::getInstance()->executeS('
SELECT pa.id_product_attribute SELECT pa.id_product_attribute
FROM `'._DB_PREFIX_.'product_attribute` pa FROM `'._DB_PREFIX_.'product_attribute` pa'.
($shop_only ? Shop::addSqlAssociation('product_attribute', 'pa') : '').'
WHERE pa.`id_product` = '.(int)$id_product); WHERE pa.`id_product` = '.(int)$id_product);
} }
@@ -4907,11 +4979,10 @@ class ProductCore extends ObjectModel
public function hasAttributesInOtherShops() public function hasAttributesInOtherShops()
{ {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*) SELECT pa.id_product_attribute
FROM `'._DB_PREFIX_.'product_attribute` pa FROM `'._DB_PREFIX_.'product_attribute` pa
LEFT JOIN `'._DB_PREFIX_.'product_attribute_shop` pas LEFT JOIN `'._DB_PREFIX_.'product_attribute_shop` pas ON (pa.`id_product_attribute` = pas.`id_product_attribute`)
ON (pa.`id_product_attribute` = pas.`id_product_attribute`)
WHERE pa.`id_product` = '.(int)$this->id WHERE pa.`id_product` = '.(int)$this->id
); );
} }
+15 -10
View File
@@ -110,17 +110,25 @@ class ProfileCore extends ObjectModel
return (isset($accesses[$id_tab]) ? $accesses[$id_tab] : false); return (isset($accesses[$id_tab]) ? $accesses[$id_tab] : false);
} }
public static function getProfileAccesses($id_profile) public static function getProfileAccesses($id_profile, $type = 'id_tab')
{ {
if (!in_array($type, array('id_tab', 'class_name')))
return false;
if (!isset(self::$_cache_accesses[$id_profile])) if (!isset(self::$_cache_accesses[$id_profile]))
self::$_cache_accesses[$id_profile] = array();
if (!isset(self::$_cache_accesses[$id_profile][$type]))
{ {
self::$_cache_accesses[$id_profile][$type] = array();
// Super admin profile has full auth // Super admin profile has full auth
if ($id_profile == _PS_ADMIN_PROFILE_) if ($id_profile == _PS_ADMIN_PROFILE_)
{ {
foreach (Tab::getTabs(Context::getContext()->language->id) as $tab) foreach (Tab::getTabs(Context::getContext()->language->id) as $tab)
self::$_cache_accesses[$id_profile][$tab['id_tab']] = array( self::$_cache_accesses[$id_profile][$type][$tab[$type]] = array(
'id_profile' => _PS_ADMIN_PROFILE_, 'id_profile' => _PS_ADMIN_PROFILE_,
'id_tab' => $tab['id_tab'], 'id_tab' => $tab['id_tab'],
'class_name' => $tab['class_name'],
'view' => '1', 'view' => '1',
'add' => '1', 'add' => '1',
'edit' => '1', 'edit' => '1',
@@ -131,19 +139,16 @@ class ProfileCore extends ObjectModel
{ {
$result = Db::getInstance()->executeS(' $result = Db::getInstance()->executeS('
SELECT * SELECT *
FROM `'._DB_PREFIX_.'access` FROM `'._DB_PREFIX_.'access` a
LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab
WHERE `id_profile` = '.(int)$id_profile); WHERE `id_profile` = '.(int)$id_profile);
self::$_cache_accesses[$id_profile] = array();
foreach ($result as $row) foreach ($result as $row)
{ self::$_cache_accesses[$id_profile][$type][$row[$type]] = $row;
if (!isset(self::$_cache_accesses[$id_profile][$row['id_tab']]))
self::$_cache_accesses[$id_profile][$row['id_tab']] = array();
self::$_cache_accesses[$id_profile][$row['id_tab']] = $row;
}
} }
} }
return self::$_cache_accesses[$id_profile];
return self::$_cache_accesses[$id_profile][$type];
} }
} }
+5 -12
View File
@@ -117,27 +117,20 @@ class TabCore extends ObjectModel
$context = Context::getContext(); $context = Context::getContext();
if (!$context->employee || !$context->employee->id_profile) if (!$context->employee || !$context->employee->id_profile)
return false; return false;
/* Profile selection */ /* Profile selection */
$profiles = Db::getInstance()->executeS(' $profiles = Db::getInstance()->executeS('SELECT `id_profile` FROM '._DB_PREFIX_.'profile WHERE `id_profile` != 1');
SELECT `id_profile`
FROM '._DB_PREFIX_.'profile
WHERE `id_profile` != 1
');
if (!$profiles || empty($profiles)) if (!$profiles || empty($profiles))
return false; return true;
/* Query definition */ /* Query definition */
// note : insert ignore should be avoided $query = 'REPLACE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES ';
$query = 'INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES ';
// default admin
$query .= '(1, '.(int)$id_tab.', 1, 1, 1, 1),'; $query .= '(1, '.(int)$id_tab.', 1, 1, 1, 1),';
foreach ($profiles as $profile) foreach ($profiles as $profile)
{ {
// no cast needed for profile[id_profile], which cames from db
// And we disable all profile but current one
$rights = $profile['id_profile'] == $context->employee->id_profile ? 1 : 0; $rights = $profile['id_profile'] == $context->employee->id_profile ? 1 : 0;
$query .= '('.$profile['id_profile'].', '.(int)$id_tab.', '.$rights.', '.$rights.', '.$rights.', '.$rights.'),'; $query .= '('.(int)$profile['id_profile'].', '.(int)$id_tab.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.', '.(int)$rights.'),';
} }
$query = trim($query, ', '); $query = trim($query, ', ');
return Db::getInstance()->execute($query); return Db::getInstance()->execute($query);
+64 -45
View File
@@ -175,9 +175,11 @@ class ToolsCore
* @param boolean $entities * @param boolean $entities
* @return string host * @return string host
*/ */
public static function getHttpHost($http = false, $entities = false) public static function getHttpHost($http = false, $entities = false, $ignore_port = false)
{ {
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']);
if ($ignore_port && $pos = strpos($host, ':'))
$host = substr($host, 0, $pos);
if ($entities) if ($entities)
$host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8'); $host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8');
if ($http) if ($http)
@@ -971,6 +973,8 @@ class ToolsCore
$str = mb_strtolower($str, 'utf-8'); $str = mb_strtolower($str, 'utf-8');
$str = trim($str); $str = trim($str);
if (!function_exists('mb_strtolower'))
$str = Tools::replaceAccentedChars($str);
// Remove all non-whitelist chars. // Remove all non-whitelist chars.
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str); $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str);
@@ -979,7 +983,8 @@ class ToolsCore
// If it was not possible to lowercase the string with mb_strtolower, we do it after the transformations. // If it was not possible to lowercase the string with mb_strtolower, we do it after the transformations.
// This way we lose fewer special chars. // This way we lose fewer special chars.
$str = strtolower($str); if (!function_exists('mb_strtolower'))
$str = strtolower($str);
return $str; return $str;
} }
@@ -1245,7 +1250,7 @@ class ToolsCore
if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')))
return @file_get_contents($url, $use_include_path, $stream_context); return @file_get_contents($url, $use_include_path, $stream_context);
elseif (function_exists('curl_init') && in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) elseif (function_exists('curl_init'))
{ {
$curl = curl_init(); $curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
@@ -1457,8 +1462,6 @@ class ToolsCore
// Default values for parameters // Default values for parameters
if (is_null($path)) if (is_null($path))
$path = _PS_ROOT_DIR_.'/.htaccess'; $path = _PS_ROOT_DIR_.'/.htaccess';
if (is_null($rewrite_settings))
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS');
if (is_null($cache_control)) if (is_null($cache_control))
$cache_control = (int)Configuration::get('PS_HTACCESS_CACHE_CONTROL'); $cache_control = (int)Configuration::get('PS_HTACCESS_CACHE_CONTROL');
if (is_null($disable_multiviews)) if (is_null($disable_multiviews))
@@ -1498,6 +1501,7 @@ class ToolsCore
$domains[$shop_url->domain][] = array( $domains[$shop_url->domain][] = array(
'physical' => $shop_url->physical_uri, 'physical' => $shop_url->physical_uri,
'virtual' => $shop_url->virtual_uri, 'virtual' => $shop_url->virtual_uri,
'id_shop' => $shop_url->id_shop
); );
} }
@@ -1514,63 +1518,74 @@ class ToolsCore
fwrite($write_fd, "\n# Disable Multiviews\nOptions -Multiviews\n\n"); fwrite($write_fd, "\n# Disable Multiviews\nOptions -Multiviews\n\n");
fwrite($write_fd, "RewriteEngine on\n\n"); fwrite($write_fd, "RewriteEngine on\n\n");
// Webservice
fwrite($write_fd, 'RewriteRule ^api/?(.*)$ '."webservice/dispatcher.php?url=$1 [QSA,L]\n\n");
foreach ($domains as $domain => $list_uri) foreach ($domains as $domain => $list_uri)
{
foreach ($list_uri as $uri) foreach ($list_uri as $uri)
{
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']);
$domain_rewrite_cond = 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n";
// Rewrite virtual multishop uri // Rewrite virtual multishop uri
if ($uri['virtual']) if ($uri['virtual'])
{ {
if (!$rewrite_settings) if (!$rewrite_settings)
{ {
fwrite($write_fd, 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n"); fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^'.trim($uri['virtual'], '/').'/?$ '.$uri['physical'].$uri['virtual']."index.php [L,R]\n"); fwrite($write_fd, 'RewriteRule ^'.trim($uri['virtual'], '/').'/?$ '.$uri['physical'].$uri['virtual']."index.php [L,R]\n");
} }
else else
{ {
fwrite($write_fd, 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n"); fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^'.trim($uri['virtual'], '/').'$ '.$uri['physical'].$uri['virtual']." [L,R]\n"); fwrite($write_fd, 'RewriteRule ^'.trim($uri['virtual'], '/').'$ '.$uri['physical'].$uri['virtual']." [L,R]\n");
} }
fwrite($write_fd, 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n"); fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^'.ltrim($uri['virtual'], '/').'(.*) '.$uri['physical']."$1 [L]\n\n"); fwrite($write_fd, 'RewriteRule ^'.ltrim($uri['virtual'], '/').'(.*) '.$uri['physical']."$1 [L]\n\n");
} }
// Webservice if ($rewrite_settings)
fwrite($write_fd, 'RewriteRule ^api/?(.*)$ '."webservice/dispatcher.php?url=$1 [QSA,L]\n\n");
if ($rewrite_settings)
{
// Compatibility with the old image filesystem
fwrite($write_fd, "# Images\n");
if (Configuration::get('PS_LEGACY_IMAGES'))
{
fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ '._PS_PROD_IMG_.'$1-$2$3$4.jpg [L]'."\n");
fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
}
// Rewrite product images < 100 millions
for ($i = 1; $i <= 8; $i++)
{
$img_path = $img_name = '';
for ($j = 1; $j <= $i; $j++)
{ {
$img_path .= '$'.$j.'/'; // Compatibility with the old image filesystem
$img_name .= '$'.$j; fwrite($write_fd, "# Images\n");
} if (Configuration::get('PS_LEGACY_IMAGES'))
$img_name .= '$'.$j; {
fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.'$'.($j + 1).".jpg [L]\n"); fwrite($write_fd, $domain_rewrite_cond);
} fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ '._PS_PROD_IMG_.'$1-$2$3$4.jpg [L]'."\n");
fwrite($write_fd, 'RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-\.*]*)(-[0-9]+)?/.+\.jpg$ img/c/$1$2$3.jpg [L]'."\n"); fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$ img/c/$1$2.jpg [L]'."\n"); fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
} }
// Redirections to dispatcher // Rewrite product images < 100 millions
if ($rewrite_settings) for ($i = 1; $i <= 8; $i++)
{ {
fwrite($write_fd, "\n# Dispatcher\n"); $img_path = $img_name = '';
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -s [OR]\n"); for ($j = 1; $j <= $i; $j++)
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -l [OR]\n"); {
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -d\n"); $img_path .= '$'.$j.'/';
fwrite($write_fd, "RewriteRule ^.*$ - [NC,L]\n"); $img_name .= '$'.$j;
fwrite($write_fd, "RewriteRule ^.*\$ index.php [NC,L]\n"); }
$img_name .= '$'.$j;
fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.'$'.($j + 1).".jpg [L]\n");
}
fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-\.*]*)(-[0-9]+)?/.+\.jpg$ img/c/$1$2$3.jpg [L]'."\n");
fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$ img/c/$1$2.jpg [L]'."\n");
}
}
// Redirections to dispatcher
if ($rewrite_settings)
{
fwrite($write_fd, "\n# Dispatcher\n");
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -s [OR]\n");
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -l [OR]\n");
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -d\n");
fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, "RewriteRule ^.*$ - [NC,L]\n");
fwrite($write_fd, $domain_rewrite_cond);
fwrite($write_fd, "RewriteRule ^.*\$ index.php [NC,L]\n");
}
} }
fwrite($write_fd, "</IfModule>\n\n"); fwrite($write_fd, "</IfModule>\n\n");
@@ -2168,7 +2183,11 @@ FileETag INode MTime Size
public static function modRewriteActive() public static function modRewriteActive()
{ {
return Tools::apacheModExists('mod_rewrite'); if (!Tools::apacheModExists('mod_rewrite'))
return true;
if ((isset($_SERVER['HTTP_MOD_REWRITE']) && strtolower($_SERVER['HTTP_MOD_REWRITE']) == 'on') || strtolower(getenv('HTTP_MOD_REWRITE')) == 'on')
return true;
return false;
} }
public static function unSerialize($serialized, $object = false) public static function unSerialize($serialized, $object = false)
+21 -31
View File
@@ -46,7 +46,7 @@ class TranslateCore
// @todo remove global keyword in translations files and use static // @todo remove global keyword in translations files and use static
global $_LANGADM; global $_LANGADM;
if ($modules_tabs !== null) if ($modules_tabs === null)
$modules_tabs = Tab::getModuleTabList(); $modules_tabs = Tab::getModuleTabList();
if ($_LANGADM == null) if ($_LANGADM == null)
@@ -72,7 +72,8 @@ class TranslateCore
else else
$str = Translate::getGenericAdminTranslation($string, $key, $_LANGADM); $str = Translate::getGenericAdminTranslation($string, $key, $_LANGADM);
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str; if ($htmlentities)
$str = htmlentities($str, ENT_QUOTES, 'utf-8');
$str = str_replace('"', '&quot;', $str); $str = str_replace('"', '&quot;', $str);
if ($sprintf !== null) if ($sprintf !== null)
@@ -125,38 +126,27 @@ class TranslateCore
// $translations_merged is a cache of wether a specific module's translations have already been added to $_MODULES // $translations_merged is a cache of wether a specific module's translations have already been added to $_MODULES
static $translations_merged = array(); static $translations_merged = array();
if ($module instanceof Module) $name = $module instanceof Module ? $module->name : $module;
$name = $module->name; if (!isset($translations_merged[$name]))
else
$name = $module;
$local_path = _PS_MODULE_DIR_.$name.'/';
if (!isset($name) || !isset($translations_merged[$name]))
{ {
// Check if translations exists in a current theme $filesByPriority = array(
if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$name.'/translations/'.Context::getContext()->language->iso_code.'.php')) // Translations in theme
$file_theme = _PS_THEME_DIR_.'modules/'.$name.'/translations/'.Context::getContext()->language->iso_code.'.php'; _PS_THEME_DIR_.'modules/'.$name.'/translations/'.Context::getContext()->language->iso_code.'.php',
elseif (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$name.'/'.Context::getContext()->language->iso_code.'.php')) _PS_THEME_DIR_.'modules/'.$name.'/'.Context::getContext()->language->iso_code.'.php',
$file_theme = _PS_THEME_DIR_.'modules/'.$name.'/'.Context::getContext()->language->iso_code.'.php'; // PrestaShop 1.5 translations
else _PS_MODULE_DIR_.$name.'/translations/'.Context::getContext()->language->iso_code.'.php',
$file_theme = false; // PrestaShop 1.4 translations
_PS_MODULE_DIR_.$name.'/'.Context::getContext()->language->iso_code.'.php'
);
if ($file_theme && !isset($translations_merged[$name]) && Tools::file_exists_cache($file_theme) && include_once($file_theme)) foreach ($filesByPriority as $file)
$_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; if (Tools::file_exists_cache($file))
else {
{ include_once($file);
// @retrocompatibility with translations files in module root
// @since 1.5 modules have a translations/ folder
if (Tools::file_exists_cache($local_path.'/translations/'.Context::getContext()->language->iso_code.'.php'))
$file = $local_path.'/translations/'.Context::getContext()->language->iso_code.'.php';
else
$file = $local_path.'/'.Context::getContext()->language->iso_code.'.php';
// Load translations file if it has not been already done
if (Tools::file_exists_cache($file) && include_once($file))
$_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; $_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE;
} $translations_merged[$name] = true;
$translations_merged[$name] = true; break;
}
} }
$key = md5(str_replace('\'', '\\\'', $string)); $key = md5(str_replace('\'', '\\\'', $string));
+2 -2
View File
@@ -384,7 +384,7 @@ class ValidateCore
$events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $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 .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange';
$events .= '|onselectstart|onstart|onstop'; $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)); 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));
} }
/** /**
@@ -761,7 +761,7 @@ class ValidateCore
*/ */
public static function isFileName($name) public static function isFileName($name)
{ {
return preg_match('/^[a-zA-Z0-9_.-]*$/', $name); return preg_match('/^[a-zA-Z0-9_.-]+$/', $name);
} }
/** /**
+94 -85
View File
@@ -109,6 +109,9 @@ class AdminControllerCore extends Controller
protected $shopLink; protected $shopLink;
/** @var string SQL query */
protected $_listsql = '';
/** @var array Cache for query results */ /** @var array Cache for query results */
protected $_list = array(); protected $_list = array();
@@ -248,6 +251,7 @@ class AdminControllerCore extends Controller
public $controller_name; public $controller_name;
public $multishop_context = -1; public $multishop_context = -1;
public $multishop_context_group = true;
/** /**
* Current breadcrumb position as an array of tab names * Current breadcrumb position as an array of tab names
@@ -321,8 +325,7 @@ class AdminControllerCore extends Controller
$this->initShopContext(); $this->initShopContext();
$currency = Shop::getEntityIds('currency', $this->context->shop->id, true, true); $this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$this->context->currency = new Currency($currency[0]['id_currency']);
} }
/** /**
@@ -605,7 +608,6 @@ class AdminControllerCore extends Controller
{ {
/* Checking fields validity */ /* Checking fields validity */
$this->validateRules(); $this->validateRules();
if (count($this->errors) <= 0) if (count($this->errors) <= 0)
{ {
$object = new $this->className(); $object = new $this->className();
@@ -1270,9 +1272,39 @@ class AdminControllerCore extends Controller
if (empty($sub_tabs)) if (empty($sub_tabs))
unset($tabs[$index]); unset($tabs[$index]);
} }
if (Validate::isLoadedObject($this->context->employee))
{
$accesses = Profile::getProfileAccesses($this->context->employee->id_profile, 'class_name');
/* Hooks are volontary out the initialize array (need those variables already assigned) */ /* Hooks are volontary out the initialize array (need those variables already assigned) */
$bo_color = empty($this->context->employee->bo_color) ? '#FFFFFF' : $this->context->employee->bo_color; $bo_color = empty($this->context->employee->bo_color) ? '#FFFFFF' : $this->context->employee->bo_color;
$this->context->smarty->assign(array(
'autorefresh_notifications' => Configuration::get('PS_ADMIN_REFRESH_NOTIFICATION'),
'help_box' => Configuration::get('PS_HELPBOX'),
'round_mode' => Configuration::get('PS_PRICE_ROUND_MODE'),
'brightness' => Tools::getBrightness($bo_color) < 128 ? 'white' : '#383838',
'bo_width' => (int)$this->context->employee->bo_width,
'bo_color' => isset($this->context->employee->bo_color) ? Tools::htmlentitiesUTF8($this->context->employee->bo_color) : null,
'show_new_orders' => Configuration::get('PS_SHOW_NEW_ORDERS') && $accesses['AdminOrders']['view'],
'show_new_customers' => Configuration::get('PS_SHOW_NEW_CUSTOMERS') && $accesses['AdminCustomers']['view'],
'show_new_messages' => Configuration::get('PS_SHOW_NEW_MESSAGES') && $accesses['AdminCustomerThreads']['view'],
'first_name' => Tools::substr($this->context->employee->firstname, 0, 1),
'last_name' => htmlentities($this->context->employee->lastname, ENT_COMPAT, 'UTF-8'),
'employee' => $this->context->employee,
'search_type' => Tools::getValue('bo_search_type'),
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
'quick_access' => $quick_access,
'multi_shop' => Shop::isFeatureActive(),
'shop_list' => Helper::renderShopList(),
'shop' => $this->context->shop,
'shop_group' => new ShopGroup((int)Shop::getContextShopGroupID()),
'current_parent_id' => (int)Tab::getCurrentParentId(),
'tabs' => $tabs,
'is_multishop' => $is_multishop,
'multishop_context' => $this->multishop_context,
));
}
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'img_dir' => _PS_IMG_, 'img_dir' => _PS_IMG_,
'iso' => $this->context->language->iso_code, 'iso' => $this->context->language->iso_code,
@@ -1280,52 +1312,18 @@ class AdminControllerCore extends Controller
'iso_user' => $this->context->language->iso_code, 'iso_user' => $this->context->language->iso_code,
'country_iso_code' => $this->context->country->iso_code, 'country_iso_code' => $this->context->country->iso_code,
'version' => _PS_VERSION_, 'version' => _PS_VERSION_,
'autorefresh_notifications' => Configuration::get('PS_ADMIN_REFRESH_NOTIFICATION'),
'help_box' => Configuration::get('PS_HELPBOX'),
'round_mode' => Configuration::get('PS_PRICE_ROUND_MODE'),
'brightness' => Tools::getBrightness($bo_color) < 128 ? 'white' : '#383838',
'lang_iso' => $this->context->language->iso_code, 'lang_iso' => $this->context->language->iso_code,
'link' => $this->context->link, 'link' => $this->context->link,
'bo_width' => (int)$this->context->employee->bo_width,
'bo_color' => isset($this->context->employee->bo_color) ? Tools::htmlentitiesUTF8($this->context->employee->bo_color) : null,
'shop_name' => Configuration::get('PS_SHOP_NAME'), 'shop_name' => Configuration::get('PS_SHOP_NAME'),
'show_new_orders' => Configuration::get('PS_SHOW_NEW_ORDERS'),
'show_new_customers' => Configuration::get('PS_SHOW_NEW_CUSTOMERS'),
'show_new_messages' => Configuration::get('PS_SHOW_NEW_MESSAGES'),
'first_name' => Tools::substr($this->context->employee->firstname, 0, 1),
'last_name' => htmlentities($this->context->employee->lastname, ENT_COMPAT, 'UTF-8'),
'base_url' => $this->context->shop->getBaseURL(), 'base_url' => $this->context->shop->getBaseURL(),
'employee' => $this->context->employee, 'tab' => $tab, // Deprecated, this tab is declared in the foreach, so it's the last tab in the foreach
'search_type' => Tools::getValue('bo_search_type'),
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
'quick_access' => $quick_access,
'multi_shop' => Shop::isFeatureActive(),
'shop_list' => Helper::renderShopList(),
'shop' => $this->context->shop,
'shop_group' => new ShopGroup((int)Shop::getContextShopGroupID()),
'tab' => $tab,
'current_parent_id' => (int)Tab::getCurrentParentId(), 'current_parent_id' => (int)Tab::getCurrentParentId(),
'tabs' => $tabs, 'tabs' => $tabs,
'install_dir_exists' => file_exists(_PS_ADMIN_DIR_.'/../install'), 'install_dir_exists' => file_exists(_PS_ADMIN_DIR_.'/../install'),
'is_multishop' => $is_multishop,
'multishop_context' => $this->multishop_context,
'pic_dir' => _THEME_PROD_PIC_DIR_, 'pic_dir' => _THEME_PROD_PIC_DIR_,
'controller_name' => htmlentities(Tools::getValue('controller')), 'controller_name' => htmlentities(Tools::getValue('controller')),
'currentIndex' => self::$currentIndex 'currentIndex' => self::$currentIndex
)); ));
// Shop context
if ($is_multishop)
{
if (Shop::getContext() == Shop::CONTEXT_SHOP)
$shop_name = $this->context->shop->name;
else
$shop_name = 'PrestaShop';
$this->context->smarty->assign(array(
'shop_name' => $shop_name,
));
}
} }
/** /**
@@ -1356,6 +1354,12 @@ class AdminControllerCore extends Controller
*/ */
public function initContent() public function initContent()
{ {
if (!$this->viewAccess())
{
$this->errors[] = Tools::displayError('You do not have permission to view here.');
return;
}
$this->getLanguages(); $this->getLanguages();
// toolbar (save, cancel, new, ..) // toolbar (save, cancel, new, ..)
$this->initToolbar(); $this->initToolbar();
@@ -1669,8 +1673,16 @@ class AdminControllerCore extends Controller
'current' => self::$currentIndex, 'current' => self::$currentIndex,
'token' => $this->token, 'token' => $this->token,
)); ));
$this->context->smarty->assign('submit_form_ajax', (int)Tools::getValue('submitFormAjax')); if ($this->display_header)
$this->context->smarty->assign('displayBackOfficeHeader', Hook::exec('displayBackOfficeHeader', array()));
$this->context->smarty->assign(
array(
'displayBackOfficeTop' => Hook::exec('displayBackOfficeTop', array()),
'submit_form_ajax' => (int)Tools::getValue('submitFormAjax')
)
);
$this->initProcess(); $this->initProcess();
} }
@@ -1812,8 +1824,6 @@ class AdminControllerCore extends Controller
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit here.');
} }
elseif ($submitted_action = Tools::getValue('submitAction'.$this->table))
$this->action = $submitted_action;
elseif (Tools::getValue('submitAdd'.$this->table) elseif (Tools::getValue('submitAdd'.$this->table)
|| Tools::getValue('submitAdd'.$this->table.'AndStay') || Tools::getValue('submitAdd'.$this->table.'AndStay')
|| Tools::getValue('submitAdd'.$this->table.'AndPreview')) || Tools::getValue('submitAdd'.$this->table.'AndPreview'))
@@ -1998,22 +2008,18 @@ class AdminControllerCore extends Controller
$where_shop = Shop::addSqlRestriction($this->shopShareDatas, 'a', $this->shopLinkType); $where_shop = Shop::addSqlRestriction($this->shopShareDatas, 'a', $this->shopLinkType);
} }
$filter_shop = '';
if ($this->multishop_context && Shop::isTableAssociated($this->table) && !empty($this->className)) if ($this->multishop_context && Shop::isTableAssociated($this->table) && !empty($this->className))
{ {
if (Shop::getContext() != Shop::CONTEXT_ALL || Shop::isTableAssociated($this->table) || !$this->context->employee->isSuperAdmin()) if (Shop::getContext() != Shop::CONTEXT_ALL || !$this->context->employee->isSuperAdmin())
{ {
$idenfier_shop = Shop::getContextListShopID();
if (!$this->_group)
$this->_group = ' GROUP BY a.'.pSQL($this->identifier);
elseif (!preg_match('#(\s|,)\s*a\.`?'.pSQL($this->identifier).'`?(\s|,|$)#', $this->_group))
$this->_group .= ', a.'.pSQL($this->identifier);
$test_join = !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_shop').'`? *sa#', $this->_join); $test_join = !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_shop').'`? *sa#', $this->_join);
if (Shop::isFeatureActive() && $test_join) if (Shop::isFeatureActive() && $test_join && Shop::isTableAssociated($this->table))
{ {
$filter_shop = ' JOIN `'._DB_PREFIX_.$this->table.'_shop` sa '; $this->_where .= ' AND a.'.$this->identifier.' IN (
$filter_shop .= 'ON (sa.'.$this->identifier.' = a.'.$this->identifier.' AND sa.id_shop IN ('.implode(', ', $idenfier_shop).'))'; SELECT sa.'.$this->identifier.'
FROM `'._DB_PREFIX_.$this->table.'_shop` sa
WHERE sa.id_shop IN ('.implode(', ', Shop::getContextListShopID()).')
)';
} }
} }
} }
@@ -2022,13 +2028,16 @@ class AdminControllerCore extends Controller
$lang_join = ''; $lang_join = '';
if ($this->lang) if ($this->lang)
{ {
$lang_join = 'LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` b ON (b.`'.$this->identifier.'` = a.`'.$this->identifier.'`'; $lang_join = 'LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` b ON (b.`'.$this->identifier.'` = a.`'.$this->identifier.'` AND b.`id_lang` = '.(int)$id_lang;
$lang_join .= ' AND b.`id_lang` = '.(int)$id_lang;
if ($id_lang_shop) if ($id_lang_shop)
if (Shop::getContext() == Shop::CONTEXT_SHOP) {
$lang_join .= ' AND b.`id_shop`='.(int)$id_lang_shop; if (!Shop::isFeatureActive())
$lang_join .= ' AND b.`id_shop` = 1';
elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
$lang_join .= ' AND b.`id_shop` = '.(int)$id_lang_shop;
else else
$lang_join .= ' AND b.`id_shop` IN ('.implode(',', array_map('intval', Shop::getContextListShopID())).')'; $lang_join .= ' AND b.`id_shop` = a.id_shop_default';
}
$lang_join .= ')'; $lang_join .= ')';
} }
@@ -2048,23 +2057,23 @@ class AdminControllerCore extends Controller
$order_by = pSQL($order_by[0]).'.`'.pSQL($order_by[1]).'`'; $order_by = pSQL($order_by[0]).'.`'.pSQL($order_by[1]).'`';
} }
$sql = 'SELECT SQL_CALC_FOUND_ROWS $this->_listsql = '
'.($this->_tmpTableFilter ? ' * FROM (SELECT ' : '').' SELECT SQL_CALC_FOUND_ROWS
'.($this->lang ? 'b.*, ' : '').'a.*'.(isset($this->_select) ? ', '.$this->_select.' ' : '').$select_shop.' '.($this->_tmpTableFilter ? ' * FROM (SELECT ' : '').'
FROM `'._DB_PREFIX_.$sql_table.'` a '.($this->lang ? 'b.*, ' : '').'a.*'.(isset($this->_select) ? ', '.$this->_select.' ' : '').$select_shop.'
'.$filter_shop.' FROM `'._DB_PREFIX_.$sql_table.'` a
'.$lang_join.' '.$lang_join.'
'.(isset($this->_join) ? $this->_join.' ' : '').' '.(isset($this->_join) ? $this->_join.' ' : '').'
'.$join_shop.' '.$join_shop.'
WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').($this->deleted ? 'AND a.`deleted` = 0 ' : ''). WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').($this->deleted ? 'AND a.`deleted` = 0 ' : '').
(isset($this->_filter) ? $this->_filter : '').$where_shop.' (isset($this->_filter) ? $this->_filter : '').$where_shop.'
'.(isset($this->_group) ? $this->_group.' ' : '').' '.(isset($this->_group) ? $this->_group.' ' : '').'
'.$having_clause.' '.$having_clause.'
ORDER BY '.(($order_by == $this->identifier) ? 'a.' : '').pSQL($order_by).' '.pSQL($order_way). ORDER BY '.(($order_by == $this->identifier) ? 'a.' : '').pSQL($order_by).' '.pSQL($order_way).
($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : ''). ($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : '').
(($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : ''); (($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : '');
$this->_list = Db::getInstance()->executeS($sql); $this->_list = Db::getInstance()->executeS($this->_listsql);
$this->_listTotal = Db::getInstance()->getValue('SELECT FOUND_ROWS() AS `'._DB_PREFIX_.$this->table.'`'); $this->_listTotal = Db::getInstance()->getValue('SELECT FOUND_ROWS() AS `'._DB_PREFIX_.$this->table.'`');
} }
@@ -2186,7 +2195,7 @@ class AdminControllerCore extends Controller
if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture'))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is required.'), Tools::displayError('The field %s is required.'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), $field, $class_name))
); );
/* Checking for multilingual required fields */ /* Checking for multilingual required fields */
@@ -2194,7 +2203,7 @@ class AdminControllerCore extends Controller
if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty)) if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %1$s is required at least in %2$s.'), Tools::displayError('The field %1$s is required at least in %2$s.'),
call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name)),
$default_language->name $default_language->name
); );
@@ -2203,7 +2212,7 @@ class AdminControllerCore extends Controller
if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length) if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length)
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %1$s is too long (%2$d chars max).'), Tools::displayError('The field %1$s is too long (%2$d chars max).'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name), Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)),
$max_length $max_length
); );
@@ -2215,7 +2224,7 @@ class AdminControllerCore extends Controller
if ($field_lang !== false && Tools::strlen($field_lang) > $max_length) if ($field_lang !== false && Tools::strlen($field_lang) > $max_length)
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'), 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), Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name)),
$language['name'], $language['name'],
$max_length $max_length
); );
@@ -2229,7 +2238,7 @@ class AdminControllerCore extends Controller
if (!Validate::$function($value) && !empty($value)) if (!Validate::$function($value) && !empty($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is invalid.'), Tools::displayError('The field %s is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), $field, $class_name))
); );
/* Checking for passwd_old validity */ /* Checking for passwd_old validity */
@@ -2238,12 +2247,12 @@ class AdminControllerCore extends Controller
if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value)) if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is invalid.'), Tools::displayError('The field %s is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name))
); );
elseif ($class_name == 'Customer' && !Validate::isPasswd($value)) elseif ($class_name == 'Customer' && !Validate::isPasswd($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is invalid.'), Tools::displayError('The field %s is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name))
); );
} }
@@ -2254,7 +2263,7 @@ class AdminControllerCore extends Controller
if (!Validate::$function($value)) if (!Validate::$function($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %1$s (%2$s) is invalid.'), Tools::displayError('The field %1$s (%2$s) is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), Tools::safeOutput(call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name)),
$language['name'] $language['name']
); );
} }
@@ -2743,7 +2752,7 @@ class AdminControllerCore extends Controller
$context = stream_context_create($opts); $context = stream_context_create($opts);
foreach ($protocolsList as $protocol => $port) foreach ($protocolsList as $protocol => $port)
{ {
$content = file_get_contents($protocol.$this->addons_url, false, $context); $content = Tools::file_get_contents($protocol.$this->addons_url, false, $context);
// If content returned, we cache it // If content returned, we cache it
if ($content) if ($content)
+1 -1
View File
@@ -177,7 +177,7 @@ abstract class ControllerCore
if ($this->ajax) if ($this->ajax)
{ {
$action = Tools::getValue('action'); $action = Tools::getValue('action');
if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action))) if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true)))
$this->{'displayAjax'.$action}(); $this->{'displayAjax'.$action}();
elseif (method_exists($this, 'displayAjax')) elseif (method_exists($this, 'displayAjax'))
$this->displayAjax(); $this->displayAjax();
+142 -22
View File
@@ -249,6 +249,12 @@ class FrontControllerCore extends Controller
CartRule::autoAddToCart($this->context); CartRule::autoAddToCart($this->context);
} }
// Check mobile context
if (Tools::isSubmit('no_mobile_theme'))
$this->context->cookie->no_mobile = true;
else if (Tools::isSubmit('mobile_theme_ok'))
$this->context->cookie->no_mobile = false;
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8');
setlocale(LC_COLLATE, $locale); setlocale(LC_COLLATE, $locale);
setlocale(LC_CTYPE, $locale); setlocale(LC_CTYPE, $locale);
@@ -305,6 +311,8 @@ class FrontControllerCore extends Controller
$meta_language[] = $lang['iso_code']; $meta_language[] = $lang['iso_code'];
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
// Usefull for layout.tpl
'mobile_device' => $this->context->getMobileDevice(),
'link' => $link, 'link' => $link,
'cart' => $cart, 'cart' => $cart,
'currency' => $currency, 'currency' => $currency,
@@ -338,6 +346,12 @@ class FrontControllerCore extends Controller
'request' => $link->getPaginationLink(false, false, false, true) 'request' => $link->getPaginationLink(false, false, false, true)
)); ));
// Add the tpl files directory for mobile
if ($this->context->getMobileDevice() != false)
$this->context->smarty->assign(array(
'tpl_mobile_uri' => _PS_THEME_MOBILE_DIR_,
));
// Deprecated // Deprecated
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'id_currency_cookie' => (int)$currency->id, 'id_currency_cookie' => (int)$currency->id,
@@ -361,6 +375,14 @@ class FrontControllerCore extends Controller
'pic_dir' => _THEME_PROD_PIC_DIR_ 'pic_dir' => _THEME_PROD_PIC_DIR_
); );
// Add the images directory for mobile
if ($this->context->getMobileDevice() != false)
$assign_array['img_mobile_dir'] = _THEME_MOBILE_IMG_DIR_;
// Add the CSS directory for mobile
if ($this->context->getMobileDevice() != false)
$assign_array['css_mobile_dir'] = _THEME_MOBILE_CSS_DIR_;
foreach ($assign_array as $assign_key => $assign_value) foreach ($assign_array as $assign_key => $assign_value)
if (substr($assign_value, 0, 1) == '/' || $protocol_content == 'https://') if (substr($assign_value, 0, 1) == '/' || $protocol_content == 'https://')
$this->context->smarty->assign($assign_key, $protocol_content.Tools::getMediaServer($assign_value).$assign_value); $this->context->smarty->assign($assign_key, $protocol_content.Tools::getMediaServer($assign_value).$assign_value);
@@ -419,12 +441,25 @@ class FrontControllerCore extends Controller
$this->process(); $this->process();
if (!isset($this->context->cart)) if (!isset($this->context->cart))
$this->context->cart = new Cart(); $this->context->cart = new Cart();
$this->context->smarty->assign(array( if ($this->context->getMobileDevice() == false)
'HOOK_HEADER' => Hook::exec('displayHeader'), {
'HOOK_TOP' => Hook::exec('displayTop'), // These hooks aren't used for the mobile theme.
'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''), // Needed hooks are called in the tpl files.
'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''), if (!isset($this->context->cart))
)); $this->context->cart = new Cart();
$this->context->smarty->assign(array(
'HOOK_HEADER' => Hook::exec('displayHeader'),
'HOOK_TOP' => Hook::exec('displayTop'),
'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
));
}
else
{
$this->context->smarty->assign(array(
'HOOK_MOBILE_HEADER' => Hook::exec('displayMobileHeader'),
));
}
} }
/** /**
@@ -517,7 +552,8 @@ class FrontControllerCore extends Controller
'display_footer' => $this->display_footer, 'display_footer' => $this->display_footer,
)); ));
if (Tools::isSubmit('live_edit')) // Don't use live edit if on mobile device
if ($this->context->getMobileDevice() == false && Tools::isSubmit('live_edit'))
$this->context->smarty->assign('live_edit', $this->getLiveEditFooter()); $this->context->smarty->assign('live_edit', $this->getLiveEditFooter());
$layout = $this->getLayout(); $layout = $this->getLayout();
@@ -572,7 +608,9 @@ class FrontControllerCore extends Controller
{ {
header('HTTP/1.1 503 temporarily overloaded'); header('HTTP/1.1 503 temporarily overloaded');
$this->context->smarty->assign('favicon_url', _PS_IMG_.Configuration::get('PS_FAVICON')); $this->context->smarty->assign('favicon_url', _PS_IMG_.Configuration::get('PS_FAVICON'));
$this->context->smarty->display(_PS_THEME_DIR_.'maintenance.tpl');
$template_dir = ($this->context->getMobileDevice() == true ? _PS_THEME_MOBILE_DIR_ : _PS_THEME_DIR_);
$this->context->smarty->display($template_dir.'maintenance.tpl');
exit; exit;
} }
} }
@@ -597,23 +635,23 @@ class FrontControllerCore extends Controller
if (!preg_match('/^'.Tools::pRegexp(rawurldecode($canonical_url), '/').'([&?].*)?$/', $match_url)) if (!preg_match('/^'.Tools::pRegexp(rawurldecode($canonical_url), '/').'([&?].*)?$/', $match_url))
{ {
$params = array(); $params = array();
$excluded_key = array('isolang', 'id_lang', 'controller', 'fc');
foreach ($_GET as $key => $value)
if (!in_array($key, $excluded_key) && Validate::isUrl($key) && Validate::isUrl($value))
$params[$key] = $value;
$str_params = ''; $str_params = '';
$url_details = parse_url($canonical_url); $url_details = parse_url($canonical_url);
if (!empty($url_details['query'])) if (!empty($url_details['query']))
{ {
parse_str($url_details['query'], $query); parse_str($url_details['query'], $query);
foreach ($query as $key => $value) foreach ($query as $key => $value)
$params[$key] = $value; $params[Tools::safeOutput($key)] = Tools::safeOutput($value);
} }
$excluded_key = array('isolang', 'id_lang', 'controller', 'fc', 'id_product', 'id_category', 'id_manufacturer', 'id_supplier', 'id_cms');
foreach ($_GET as $key => $value)
if (!in_array($key, $excluded_key) && Validate::isUrl($key) && Validate::isUrl($value))
$params[Tools::safeOutput($key)] = Tools::safeOutput($value);
$str_params = http_build_query($params, '', '&'); $str_params = http_build_query($params, '', '&');
if (!empty($str_params)) if (!empty($str_params))
$final_url = preg_replace('/^([^?]*)?.*$/', '$1', $canonical_url).'?'.Tools::safeOutput($str_params); $final_url = preg_replace('/^([^?]*)?.*$/', '$1', $canonical_url).'?'.$str_params;
else else
$final_url = preg_replace('/^([^?]*)?.*$/', '$1', $canonical_url); $final_url = preg_replace('/^([^?]*)?.*$/', '$1', $canonical_url);
@@ -685,8 +723,32 @@ class FrontControllerCore extends Controller
return false; return false;
} }
/**
* Specific medias for mobile device.
*/
public function setMobileMedia()
{
$this->addjquery();
$this->addJS(_THEME_MOBILE_JS_DIR_.'jquery.mobile-1.1.1.min.js');
$this->addJS(_THEME_MOBILE_JS_DIR_.'jqm-docs.js');
$this->addJS(_PS_JS_DIR_.'tools.js');
$this->addJS(_THEME_MOBILE_JS_DIR_.'global.js');
$this->addjqueryPlugin('fancybox');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.1.1.min.css', 'all');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jqm-docs.css', 'all');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'global.css', 'all');
}
public function setMedia() public function setMedia()
{ {
// if website is accessed by mobile device
// @see FrontControllerCore::setMobileMedia()
if ($this->context->getMobileDevice() != false)
{
$this->setMobileMedia();
return true;
}
$this->addCSS(_THEME_CSS_DIR_.'global.css', 'all'); $this->addCSS(_THEME_CSS_DIR_.'global.css', 'all');
$this->addjquery(); $this->addjquery();
$this->addjqueryPlugin('easing'); $this->addjqueryPlugin('easing');
@@ -730,6 +792,10 @@ class FrontControllerCore extends Controller
{ {
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'HOOK_FOOTER' => Hook::exec('displayFooter'), 'HOOK_FOOTER' => Hook::exec('displayFooter'),
'conditions' => Configuration::get('PS_CONDITIONS'),
'id_cgv' => Configuration::get('PS_CONDITIONS_CMS_ID'),
'PS_SHOP_NAME' => Configuration::get('PS_SHOP_NAME'),
'PS_ALLOW_MOBILE_DEVICE' => isset($_SERVER['HTTP_USER_AGENT']) && (bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE') && @filemtime(_PS_THEME_MOBILE_DIR_)
)); ));
} }
@@ -960,15 +1026,20 @@ class FrontControllerCore extends Controller
/** /**
* This is overrided to manage is behaviour * This is overrided to manage is behaviour
* if a customer access to the site with mobile device.
*/ */
public function setTemplate($default_template) public function setTemplate($default_template)
{ {
$template = $this->getOverrideTemplate(); if ($this->context->getMobileDevice() != false)
$this->setMobileTemplate($default_template);
if ($template) else
parent::setTemplate($template); {
else $template = $this->getOverrideTemplate();
parent::setTemplate($default_template); if ($template)
parent::setTemplate($template);
else
parent::setTemplate($default_template);
}
} }
/** /**
@@ -1002,6 +1073,12 @@ class FrontControllerCore extends Controller
$layout_dir = _PS_THEME_DIR_; $layout_dir = _PS_THEME_DIR_;
$layout_override_dir = _PS_THEME_OVERRIDE_DIR_; $layout_override_dir = _PS_THEME_OVERRIDE_DIR_;
if ($this->context->getMobileDevice() != false)
{
$layout_dir = _PS_THEME_MOBILE_DIR_;
$layout_override_dir = _PS_THEME_MOBILE_OVERRIDE_DIR_;
}
$layout = false; $layout = false;
if ($entity) if ($entity)
{ {
@@ -1016,4 +1093,47 @@ class FrontControllerCore extends Controller
return $layout; return $layout;
} }
/**
* This checks if the template set is available for mobile themes,
* otherwise the front template is choosen.
*/
public function setMobileTemplate($template)
{
// Needed for site map
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
$blocksupplier = Module::getInstanceByName('blocksupplier');
$this->context->smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0));
$this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1));
$this->context->smarty->assign('voucherAllowed', (int)Configuration::get('PS_VOUCHERS'));
$this->context->smarty->assign('display_manufacturer_link', (bool)$blockmanufacturer->active);
$this->context->smarty->assign('display_supplier_link', (bool)$blocksupplier->active);
$this->context->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
$this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
$this->context->smarty->assign('conditions', Configuration::get('PS_CONDITIONS'));
$this->context->smarty->assign('id_cgv', Configuration::get('PS_CONDITIONS_CMS_ID'));
$this->context->smarty->assign('PS_SHOP_NAME', Configuration::get('PS_SHOP_NAME'));
$mobile_template = '';
$tpl_file = basename($template);
$dirname = dirname($template).(substr(dirname($template), -1, 1) == '/' ? '' : '/');
if ($dirname == _PS_THEME_DIR_)
{
if (file_exists(_PS_THEME_MOBILE_DIR_.$tpl_file))
$template = _PS_THEME_MOBILE_DIR_.$tpl_file;
}
elseif ($dirname == _PS_THEME_MOBILE_DIR_)
{
if (!file_exists(_PS_THEME_MOBILE_DIR_.$tpl_file) && file_exists(_PS_THEME_DIR_.$tpl_file))
$template = _PS_THEME_DIR_.$tpl_file;
}
$assign = array();
$assign['tpl_file'] = basename($tpl_file, '.tpl');
if (isset($this->php_self))
$assign['controller_name'] = $this->php_self;
$this->context->smarty->assign($assign);
$this->template = $template;
}
} }
+7 -4
View File
@@ -322,7 +322,7 @@ abstract class DbCore
*/ */
public function insert($table, $data, $null_values = false, $use_cache = true, $type = Db::INSERT, $add_prefix = true) public function insert($table, $data, $null_values = false, $use_cache = true, $type = Db::INSERT, $add_prefix = true)
{ {
if (!$data) if (!$data && !$null_values)
return true; return true;
if ($add_prefix) if ($add_prefix)
@@ -596,7 +596,10 @@ abstract class DbCore
$errno = $this->getNumberError(); $errno = $this->getNumberError();
if ($webservice_call && $errno) if ($webservice_call && $errno)
WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. Query was : '.$sql, 97); {
$dbg = debug_backtrace();
WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
}
else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
{ {
if ($sql) if ($sql)
@@ -637,9 +640,9 @@ abstract class DbCore
* @param bool $engine * @param bool $engine
* @return int * @return int
*/ */
public static function checkConnection($server, $user, $pwd, $db, $new_db_link = true, $engine = null) public static function checkConnection($server, $user, $pwd, $db, $new_db_link = true, $engine = null, $timeout = 5)
{ {
return call_user_func_array(array(Db::getClass(), 'tryToConnect'), array($server, $user, $pwd, $db, $new_db_link, $engine)); return call_user_func_array(array(Db::getClass(), 'tryToConnect'), array($server, $user, $pwd, $db, $new_db_link, $engine, $timeout));
} }
/** /**
+9 -3
View File
@@ -161,10 +161,16 @@ class DbMySQLiCore extends Db
/** /**
* @see Db::checkConnection() * @see Db::checkConnection()
*/ */
static public function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null) public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null, $timeout = 5)
{ {
$link = @new mysqli($server, $user, $pwd, $db); $link = mysqli_init();
if (mysqli_connect_error()) if (!$link)
return -1;
if (!$link->options(MYSQLI_OPT_CONNECT_TIMEOUT, $timeout))
return 1;
if (!$link->real_connect($server, $user, $pwd, $db))
return (mysqli_connect_errno() == 1049) ? 2 : 1; return (mysqli_connect_errno() == 1049) ? 2 : 1;
if (strtolower($engine) == 'innodb') if (strtolower($engine) == 'innodb')
+218 -225
View File
@@ -1,225 +1,218 @@
<?php <?php
/* /*
* 2007-2012 PrestaShop * 2007-2012 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
* This source file is subject to the Open Software License (OSL 3.0) * This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt. * that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL: * It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php * http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to * 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 * obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately. * to license@prestashop.com so we can send you a copy immediately.
* *
* DISCLAIMER * DISCLAIMER
* *
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer * 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 * versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information. * needs please refer to http://www.prestashop.com for more information.
* *
* @author PrestaShop SA <contact@prestashop.com> * @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA * @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision$ * @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/** /**
* This class is currently only here for tests * This class is currently only here for tests
* *
* @since 1.5.0 * @since 1.5.0
*/ */
class DbPDOCore extends Db class DbPDOCore extends Db
{ {
/** protected static function _getPDO($host, $user, $password, $dbname, $timeout = 5)
* @see DbCore::connect() {
*/ $dsn = 'mysql:';
public function connect() if ($dbname)
{ $dsn .= 'dbname='.$dbname.';';
try if (preg_match('/^(.*):([0-9]+)$/', $host, $matches))
{ $dsn .= 'host='.$matches[1].';port='.$matches[2];
$dsn = 'mysql:dbname='.$this->database; elseif (preg_match('#^.*:(/.*)$#', $host, $matches))
if (strpos($this->server, ':') !== false) $dsn .= 'unix_socket='.$matches[1];
{ else
list($server, $port) = explode(':', $this->server); $dsn .= 'host='.$host;
$dsn .= ';host='.$server.';port='.$port;
} return new PDO($dsn, $user, $password, array(PDO::ATTR_TIMEOUT => $timeout, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
else }
$dsn .= ';host='.$this->server;
/**
$this->link = new PDO($dsn, $this->user, $this->password); * @see DbCore::connect()
} */
catch (PDOException $e) public function connect()
{ {
throw new PrestaShopDatabaseException(sprintf(Tools::displayError('Link to database cannot be established: %s'), $e->getMessage())); try {
} $this->link = $this->_getPDO($this->server, $this->user, $this->password, $this->database, 5);
} catch (PDOException $e) {
// UTF-8 support throw new PrestaShopDatabaseException(sprintf(Tools::displayError('Link to database cannot be established: %s'), $e->getMessage()));
if ($this->link->exec('SET NAMES \'utf8\'') === false) }
throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
// UTF-8 support
return $this->link; if ($this->link->exec('SET NAMES \'utf8\'') === false)
} throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
/** return $this->link;
* @see DbCore::disconnect() }
*/
public function disconnect() /**
{ * @see DbCore::disconnect()
unset($this->link); */
} public function disconnect()
{
/** unset($this->link);
* @see DbCore::_query() }
*/
protected function _query($sql) /**
{ * @see DbCore::_query()
return $this->link->query($sql); */
} protected function _query($sql)
{
/** return $this->link->query($sql);
* @see DbCore::nextRow() }
*/
public function nextRow($result = false) /**
{ * @see DbCore::nextRow()
if (!$result) */
$result = $this->result; public function nextRow($result = false)
return $result->fetch(PDO::FETCH_ASSOC); {
} if (!$result)
$result = $this->result;
/** return $result->fetch(PDO::FETCH_ASSOC);
* @see DbCore::_numRows() }
*/
protected function _numRows($result) /**
{ * @see DbCore::_numRows()
return $result->rowCount(); */
} protected function _numRows($result)
{
/** return $result->rowCount();
* @see DbCore::Insert_ID() }
*/
public function Insert_ID() /**
{ * @see DbCore::Insert_ID()
return $this->link->lastInsertId(); */
} public function Insert_ID()
{
/** return $this->link->lastInsertId();
* @see DbCore::Affected_Rows() }
*/
public function Affected_Rows() /**
{ * @see DbCore::Affected_Rows()
return $this->result->rowCount(); */
} public function Affected_Rows()
{
/** return $this->result->rowCount();
* @see DbCore::getMsgError() }
*/
public function getMsgError($query = false) /**
{ * @see DbCore::getMsgError()
$error = $this->link->errorInfo(); */
return ($error[0] == '00000') ? '' : $error[2]; public function getMsgError($query = false)
} {
$error = $this->link->errorInfo();
/** return ($error[0] == '00000') ? '' : $error[2];
* @see DbCore::getNumberError() }
*/
public function getNumberError() /**
{ * @see DbCore::getNumberError()
$error = $this->link->errorInfo(); */
return isset($error[1]) ? $error[1] : 0; public function getNumberError()
} {
$error = $this->link->errorInfo();
/** return isset($error[1]) ? $error[1] : 0;
* @see DbCore::getVersion() }
*/
public function getVersion() /**
{ * @see DbCore::getVersion()
return $this->getValue('SELECT VERSION()'); */
} public function getVersion()
{
/** return $this->getValue('SELECT VERSION()');
* @see DbCore::_escape() }
*/
public function _escape($str) /**
{ * @see DbCore::_escape()
$search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"'); */
$replace = array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'); public function _escape($str)
{
return str_replace($search, $replace, $str); $search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"');
} $replace = array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"');
return str_replace($search, $replace, $str);
/** }
* @see DbCore::set_db()
*/ /**
public function set_db($db_name) * @see DbCore::set_db()
{ */
return $this->link->exec('USE '.pSQL($db_name)); public function set_db($db_name)
} {
return $this->link->exec('USE '.pSQL($db_name));
/** }
* @see Db::hasTableWithSamePrefix()
*/ /**
public static function hasTableWithSamePrefix($server, $user, $pwd, $db, $prefix) * @see Db::hasTableWithSamePrefix()
{ */
try public static function hasTableWithSamePrefix($server, $user, $pwd, $db, $prefix)
{ {
$link = @new PDO('mysql:dbname='.$db.';host='.$server, $user, $pwd); try {
} $link = DbPDO::_getPDO($server, $user, $pwd, $db, 5);
catch (PDOException $e) } catch (PDOException $e) {
{ return false;
return false; }
}
$sql = 'SHOW TABLES LIKE \''.$prefix.'%\'';
$sql = 'SHOW TABLES LIKE \''.$prefix.'%\''; $result = $link->query($sql);
$result = $link->query($sql); return (bool)$result->fetch();
return (bool)$result->fetch(); }
}
/**
/** * @see Db::checkConnection()
* @see Db::checkConnection() */
*/ public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null, $timeout = 5)
static public function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null) {
{ try {
try $link = DbPDO::_getPDO($server, $user, $pwd, $db, $timeout);
{ } catch (PDOException $e) {
$link = @new PDO('mysql:dbname='.$db.';host='.$server, $user, $pwd); return ($e->getCode() == 1049) ? 2 : 1;
} }
catch (PDOException $e)
{ if (strtolower($engine) == 'innodb')
return ($e->getCode() == 1049) ? 2 : 1; {
} $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\'';
$result = $link->query($sql);
if (strtolower($engine) == 'innodb') if (!$result)
{ return 4;
$sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; $row = $result->fetch();
$result = $link->query($sql); if (!$row || strtolower($row['Value']) != 'yes')
if (!$result) return 4;
return 4; }
$row = $result->fetch(); unset($link);
if (!$row || strtolower($row['Value']) != 'yes') return 0;
return 4; }
}
unset($link); /**
return 0; * @see Db::checkEncoding()
} */
public static function tryUTF8($server, $user, $pwd)
/** {
* @see Db::checkEncoding() try {
*/ $link = DbPDO::_getPDO($server, $user, $pwd, false, 5);
static public function tryUTF8($server, $user, $pwd) } catch (PDOException $e) {
{ return false;
try }
{ $result = $link->exec('SET NAMES \'utf8\'');
$link = new PDO('mysql:host='.$server, $user, $pwd); unset($link);
}
catch (PDOException $e) return ($result === false) ? false : true;
{ }
return false; }
}
$result = $link->exec('SET NAMES \'utf8\'');
unset($link);
return ($result === false) ? false : true;
}
}
+2 -1
View File
@@ -154,8 +154,9 @@ class MySQLCore extends Db
/** /**
* @see Db::checkConnection() * @see Db::checkConnection()
*/ */
public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null) public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null, $timeout = 5)
{ {
ini_set('mysql.connect_timeout', $timeout);
if (!$link = @mysql_connect($server, $user, $pwd, $newDbLink)) if (!$link = @mysql_connect($server, $user, $pwd, $newDbLink))
return 1; return 1;
if (!@mysql_select_db($db, $link)) if (!@mysql_select_db($db, $link))
@@ -30,6 +30,9 @@
*/ */
class PrestaShopDatabaseExceptionCore extends PrestaShopException class PrestaShopDatabaseExceptionCore extends PrestaShopException
{ {
public function __toString()
{
return $this->message;
}
} }
+6 -5
View File
@@ -361,9 +361,10 @@ class HelperCore
$context = Context::getContext(); $context = Context::getContext();
// Get default value // Get default value
if (Shop::getContext() == Shop::CONTEXT_ALL) $shop_context = Shop::getContext();
if ($shop_context == Shop::CONTEXT_ALL || ($context->controller->multishop_context_group == false && $shop_context == Shop::CONTEXT_GROUP))
$value = ''; $value = '';
else if (Shop::getContext() == Shop::CONTEXT_GROUP) else if ($shop_context == Shop::CONTEXT_GROUP)
$value = 'g-'.Shop::getContextShopGroupID(); $value = 'g-'.Shop::getContextShopGroupID();
else else
$value = 's-'.Shop::getContextShopID(); $value = 's-'.Shop::getContextShopID();
@@ -376,14 +377,14 @@ class HelperCore
foreach ($tree as $gID => $group_data) foreach ($tree as $gID => $group_data)
{ {
if ((!isset($context->controller->multishop_context) || $context->controller->multishop_context & Shop::CONTEXT_GROUP)) if ((!isset($context->controller->multishop_context) || $context->controller->multishop_context & Shop::CONTEXT_GROUP))
$html .= '<option class="group" value="g-'.$gID.'" '.(($value == 'g-'.$gID) ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('Group:').' '.htmlspecialchars($group_data['name']).'</option>'; $html .= '<option class="group" value="g-'.$gID.'" '.(($value == 'g-'.$gID) ? 'selected="selected"' : '').' '.($context->controller->multishop_context_group == false ? 'disabled="disabled"' : '').'>'.Translate::getAdminTranslation('Group:').' '.htmlspecialchars($group_data['name']).'</option>';
else else
$html .= '<optgroup class="group" label="'.Translate::getAdminTranslation('Group:').' '.htmlspecialchars($group_data['name']).'">'; $html .= '<optgroup class="group" label="'.Translate::getAdminTranslation('Group:').' '.htmlspecialchars($group_data['name']).'" '.($context->controller->multishop_context_group == false ? 'disabled="disabled"' : '').'>';
if (!isset($context->controller->multishop_context) || $context->controller->multishop_context & Shop::CONTEXT_SHOP) if (!isset($context->controller->multishop_context) || $context->controller->multishop_context & Shop::CONTEXT_SHOP)
foreach ($group_data['shops'] as $sID => $shopData) foreach ($group_data['shops'] as $sID => $shopData)
if ($shopData['active']) if ($shopData['active'])
$html .= '<option value="s-'.$sID.'" class="shop" '.(($value == 's-'.$sID) ? 'selected="selected"' : '').'>&raquo; '.$shopData['name'].'</option>'; $html .= '<option value="s-'.$sID.'" class="shop" '.(($value == 's-'.$sID) ? 'selected="selected"' : '').'>&raquo; '.($context->controller->multishop_context_group == false ? htmlspecialchars($group_data['name']).' - ' : '').$shopData['name'].'</option>';
if (!(!isset($context->controller->multishop_context) || $context->controller->multishop_context & Shop::CONTEXT_GROUP)) if (!(!isset($context->controller->multishop_context) || $context->controller->multishop_context & Shop::CONTEXT_GROUP))
$html .= '</optgroup>'; $html .= '</optgroup>';
+5 -15
View File
@@ -256,15 +256,7 @@ class HelperListCore extends Helper
{ {
// item_id is the product id in a product image context, else it is the image id. // item_id is the product id in a product image context, else it is the image id.
$item_id = isset($params['image_id']) ? $tr[$params['image_id']] : $id; $item_id = isset($params['image_id']) ? $tr[$params['image_id']] : $id;
// If it's a product image $path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)$tr['id_image'] : '').'.'.$this->imageType;
if (isset($tr['id_image']))
{
$image = new Image((int)$tr['id_image']);
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$image->getExistingImgPath().'.'.$this->imageType;
}
else
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)$tr['id_image'] : '').'.'.$this->imageType;
$this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType); $this->_list[$index][$key] = ImageManager::thumbnail($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType);
} }
else if (isset($params['icon']) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default']))) else if (isset($params['icon']) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default'])))
@@ -540,9 +532,7 @@ class HelperListCore extends Helper
{ {
if (!isset($params['type'])) if (!isset($params['type']))
$params['type'] = 'text'; $params['type'] = 'text';
$value = Context::getContext()->cookie->{$this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)};
$value = Tools::getValue($this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key));
switch ($params['type']) switch ($params['type'])
{ {
case 'bool': case 'bool':
@@ -566,9 +556,9 @@ class HelperListCore extends Helper
case 'select': case 'select':
foreach ($params['list'] as $option_value => $option_display) foreach ($params['list'] as $option_value => $option_display)
{ {
if (isset($_POST[$this->table.'Filter_'.$params['filter_key']]) if (isset(Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']})
&& Tools::getValue($this->table.'Filter_'.$params['filter_key']) == $option_value && Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} == $option_value
&& Tools::getValue($this->table.'Filter_'.$params['filter_key']) != '') && Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} != '')
$this->fields_list[$key]['select'][$option_value]['selected'] = 'selected'; $this->fields_list[$key]['select'][$option_value]['selected'] = 'selected';
} }
break; break;
+74 -33
View File
@@ -167,8 +167,8 @@ abstract class ModuleCore
// We load configuration from the cache // We load configuration from the cache
if (isset(self::$modules_cache[$this->name])) if (isset(self::$modules_cache[$this->name]))
{ {
$this->active = self::$modules_cache[$this->name]['active']; if (isset(self::$modules_cache[$this->name]['id_module']))
$this->id = self::$modules_cache[$this->name]['id_module']; $this->id = self::$modules_cache[$this->name]['id_module'];
foreach (self::$modules_cache[$this->name] as $key => $value) foreach (self::$modules_cache[$this->name] as $key => $value)
if (key_exists($key, $this)) if (key_exists($key, $this))
$this->{$key} = $value; $this->{$key} = $value;
@@ -215,8 +215,13 @@ abstract class ModuleCore
} }
// Install overrides // Install overrides
if (!$this->installOverrides()) try {
$this->installOverrides();
} catch (Exception $e) {
$this->_errors[] = sprintf(Tools::displayError('Unable to install override: %s'), $e->getMessage());
$this->uninstallOverrides();
return false; return false;
}
// Install module and retrieve the installation id // Install module and retrieve the installation id
$result = Db::getInstance()->insert($this->table, array('name' => $this->name, 'active' => 1, 'version' => $this->version)); $result = Db::getInstance()->insert($this->table, array('name' => $this->name, 'active' => 1, 'version' => $this->version));
@@ -584,7 +589,7 @@ abstract class ModuleCore
public function disable($forceAll = false) public function disable($forceAll = false)
{ {
// Disable module for all shops // Disable module for all shops
$sql = 'DELETE FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.$this->id.' '.((!$forceAll) ? ' AND `id_shop` IN('.implode(', ', Shop::getContextListShopID()).')' : ''); $sql = 'DELETE FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$this->id.' '.((!$forceAll) ? ' AND `id_shop` IN('.implode(', ', Shop::getContextListShopID()).')' : '');
Db::getInstance()->execute($sql); Db::getInstance()->execute($sql);
} }
@@ -1284,8 +1289,11 @@ abstract class ModuleCore
if (isset($context->cart)) if (isset($context->cart))
$billing = new Address((int)$context->cart->id_address_invoice); $billing = new Address((int)$context->cart->id_address_invoice);
$frontend = true;
$groups = array(); $groups = array();
if (isset($context->customer)) if (isset($context->employee))
$frontend = false;
elseif (isset($context->customer))
{ {
$groups = $context->customer->getGroups(); $groups = $context->customer->getGroups();
if (empty($groups)) if (empty($groups))
@@ -1296,28 +1304,27 @@ abstract class ModuleCore
if (Db::getInstance()->getValue('SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'displayPayment\'')) if (Db::getInstance()->getValue('SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'displayPayment\''))
$hookPayment = 'displayPayment'; $hookPayment = 'displayPayment';
$list = Shop::getContextListShopID(); $paypal_condition = '';
$sql = 'SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position` $iso_code = Country::getIsoById((int)Configuration::get('PS_COUNTRY_DEFAULT'));
FROM `'._DB_PREFIX_.'module_country` mc $paypal_countries = array('ES', 'FR', 'PL', 'IT');
LEFT JOIN `'._DB_PREFIX_.'module` m ON m.`id_module` = mc.`id_module` if (Context::getContext()->getMobileDevice() && Context::getContext()->shop->getTheme() == 'default' && in_array($iso_code, $paypal_countries))
INNER JOIN `'._DB_PREFIX_.'module_group` mg ON (m.`id_module` = mg.`id_module`) $paypal_condition = ' AND m.`name` = \'paypal\'';
'.(isset($context->customer)
? 'INNER JOIN `'._DB_PREFIX_.'customer_group` cg on (cg.`id_group` = mg.`id_group`AND cg.`id_customer` = '.(int)$context->customer->id.')'
: '').'
LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module`
LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook`
WHERE h.`name` = \''.pSQL($hookPayment).'\'
'.(isset($billing) ? 'AND mc.id_country = '.(int)$billing->id_country : '').'
AND mc.id_shop = '.(int)$context->shop->id.'
AND mg.id_shop = '.(int)$context->shop->id.'
AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).'
AND hm.id_shop IN('.implode(', ', $list).')
'.(count($groups) ? 'AND (mg.`id_group` IN('.implode(', ', $groups).'))' : '').'
GROUP BY hm.id_hook, hm.id_module
ORDER BY hm.`position`, m.`name` DESC';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
return $result; $list = Shop::getContextListShopID();
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position`
FROM `'._DB_PREFIX_.'module` m
'.($frontend ? 'LEFT JOIN `'._DB_PREFIX_.'module_country` mc ON (m.`id_module` = mc.`id_module` AND mc.id_shop = '.(int)$context->shop->id.')' : '').'
'.($frontend ? 'INNER JOIN `'._DB_PREFIX_.'module_group` mg ON (m.`id_module` = mg.`id_module` AND mg.id_shop = '.(int)$context->shop->id.')' : '').'
'.($frontend && isset($context->customer) ? 'INNER JOIN `'._DB_PREFIX_.'customer_group` cg on (cg.`id_group` = mg.`id_group`AND cg.`id_customer` = '.(int)$context->customer->id.')' : '').'
LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module`
LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook`
WHERE h.`name` = \''.pSQL($hookPayment).'\'
'.(isset($billing) && $frontend ? 'AND mc.id_country = '.(int)$billing->id_country : '').'
AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).'
AND hm.id_shop IN('.implode(', ', $list).')
'.(count($groups) && $frontend ? 'AND (mg.`id_group` IN('.implode(', ', $groups).'))' : '').$paypal_condition.'
GROUP BY hm.id_hook, hm.id_module
ORDER BY hm.`position`, m.`name` DESC');
} }
/** /**
@@ -1850,24 +1857,40 @@ abstract class ModuleCore
{ {
$path = Autoload::getInstance()->getClassPath($classname.'Core'); $path = Autoload::getInstance()->getClassPath($classname.'Core');
// Check if there is already an override file, if not, we just need to copy the file
if (!($classpath = Autoload::getInstance()->getClassPath($classname)))
{
$override_src = $this->getLocalPath().'override'.DIRECTORY_SEPARATOR.$path;
$override_dest = _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'override'.DIRECTORY_SEPARATOR.$path;
if (!is_writable(dirname($override_dest)))
throw new Exception(sprintf(Tools::displayError('directory (%s) not writable'), dirname($override_dest)));
copy($override_src, $override_dest);
return true;
}
// Check if override file is writable // Check if override file is writable
$override_path = _PS_ROOT_DIR_.'/'.Autoload::getInstance()->getClassPath($classname); $override_path = _PS_ROOT_DIR_.'/'.Autoload::getInstance()->getClassPath($classname);
if (!is_writable($override_path)) if (!is_writable($override_path))
return false; throw new Exception(sprintf(Tools::displayError('file (%s) not writable'), $override_path));
// Make a reflection of the override class and the module override class // Make a reflection of the override class and the module override class
$override_file = file($override_path); $override_file = file($override_path);
eval(preg_replace(array('#^\s*<\?php#', '#class\s+'.$classname.'\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?#i'), array('', 'class '.$classname.'OverrideOriginal'), implode('', $override_file))); eval(preg_replace(array('#^\s*<\?php#', '#class\s+'.$classname.'\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?#i'), array('', 'class '.$classname.'OverrideOriginal'), implode('', $override_file)));
$override_class = new ReflectionClass($classname.'OverrideOriginal'); $override_class = new ReflectionClass($classname.'OverrideOriginal');
$module_file = file($this->getLocalPath().'override/'.$path); $module_file = file($this->getLocalPath().'override'.DIRECTORY_SEPARATOR.$path);
eval(preg_replace(array('#^\s*<\?php#', '#class\s+'.$classname.'(\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?)?#i'), array('', 'class '.$classname.'Override'), implode('', $module_file))); eval(preg_replace(array('#^\s*<\?php#', '#class\s+'.$classname.'(\s+extends\s+([a-z0-9_]+)(\s+implements\s+([a-z0-9_]+))?)?#i'), array('', 'class '.$classname.'Override'), implode('', $module_file)));
$module_class = new ReflectionClass($classname.'Override'); $module_class = new ReflectionClass($classname.'Override');
// Check if none of the methods already exists in the override class // Check if none of the methods already exists in the override class
foreach ($module_class->getMethods() as $method) foreach ($module_class->getMethods() as $method)
if ($override_class->hasMethod($method->name)) if ($override_class->hasMethod($method->getName()))
return false; throw new Exception(sprintf(Tools::displayError('The method %1$s in the class %2$s is already overriden.'), $method->getName(), $classname));
// Check if none of the properties already exists in the override class
foreach ($module_class->getProperties() as $property)
if ($override_class->hasProperty($property->getName()))
throw new Exception(sprintf(Tools::displayError('The property %1$s in the class %2$s is already defined.'), $property->getName(), $classname));
// Insert the methods from module override in override // Insert the methods from module override in override
$copy_from = array_slice($module_file, $module_class->getStartLine() + 1, $module_class->getEndLine() - $module_class->getStartLine() - 2); $copy_from = array_slice($module_file, $module_class->getStartLine() + 1, $module_class->getEndLine() - $module_class->getStartLine() - 2);
@@ -1888,6 +1911,9 @@ abstract class ModuleCore
{ {
$path = Autoload::getInstance()->getClassPath($classname.'Core'); $path = Autoload::getInstance()->getClassPath($classname.'Core');
if (!Autoload::getInstance()->getClassPath($classname))
return true;
// Check if override file is writable // Check if override file is writable
$override_path = _PS_ROOT_DIR_.'/'.Autoload::getInstance()->getClassPath($classname); $override_path = _PS_ROOT_DIR_.'/'.Autoload::getInstance()->getClassPath($classname);
if (!is_writable($override_path)) if (!is_writable($override_path))
@@ -1906,14 +1932,29 @@ abstract class ModuleCore
$override_file = file($override_path); $override_file = file($override_path);
foreach ($module_class->getMethods() as $method) foreach ($module_class->getMethods() as $method)
{ {
if (!$override_class->hasMethod($method->name)) if (!$override_class->hasMethod($method->getName()))
continue; continue;
$method = $override_class->getMethod($method->name); $method = $override_class->getMethod($method->getName());
$length = $method->getEndLine() - $method->getStartLine() + 1; $length = $method->getEndLine() - $method->getStartLine() + 1;
array_splice($override_file, $method->getStartLine() - 1, $length, array_pad(array(), $length, '#--remove--#')); array_splice($override_file, $method->getStartLine() - 1, $length, array_pad(array(), $length, '#--remove--#'));
} }
// Remove properties from override file
foreach ($module_class->getProperties() as $property)
{
if (!$override_class->hasProperty($property->getName()))
continue;
// Remplacer la ligne de déclaration par "remove"
foreach ($override_file as $line_number => &$line_content)
if (preg_match('/(public|private|protected)\s+(static\s+)?\$'.$property->getName().'/i', $line_content))
{
$line_content = '#--remove--#';
break;
}
}
// Rewrite nice code // Rewrite nice code
$code = ''; $code = '';
foreach ($override_file as $line) foreach ($override_file as $line)
+3 -3
View File
@@ -234,7 +234,7 @@ abstract class ModuleGraphCore extends Module
{ {
if (!Validate::isModuleName($render)) if (!Validate::isModuleName($render))
die(Tools::displayError()); die(Tools::displayError());
if (!Tools::file_exists_cache($file = dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php')) if (!Tools::file_exists_cache($file = _PS_ROOT_DIR_.'/modules/'.$render.'/'.$render.'.php'))
die(Tools::displayError()); die(Tools::displayError());
require_once($file); require_once($file);
$this->_render = new $render($type); $this->_render = new $render($type);
@@ -265,7 +265,7 @@ abstract class ModuleGraphCore extends Module
return Tools::displayError('No graph engine selected'); return Tools::displayError('No graph engine selected');
if (!Validate::isModuleName($render)) if (!Validate::isModuleName($render))
die(Tools::displayError()); die(Tools::displayError());
if (!file_exists(dirname(__FILE__).'/../../modules/'.$render.'/'.$render.'.php')) if (!file_exists(_PS_ROOT_DIR_.'/modules/'.$render.'/'.$render.'.php'))
return Tools::displayError('Graph engine selected is unavailable.'); return Tools::displayError('Graph engine selected is unavailable.');
$id_employee = (int)$context->employee->id; $id_employee = (int)$context->employee->id;
@@ -287,7 +287,7 @@ abstract class ModuleGraphCore extends Module
$url_params['id_lang'] = $id_lang; $url_params['id_lang'] = $id_lang;
$drawer = 'drawer.php?'.http_build_query(array_map('Tools::safeOutput', $url_params), '', '&'); $drawer = 'drawer.php?'.http_build_query(array_map('Tools::safeOutput', $url_params), '', '&');
require_once(dirname(__FILE__).'/../../modules/'.$render.'/'.$render.'.php'); require_once(_PS_ROOT_DIR_.'/modules/'.$render.'/'.$render.'.php');
return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer); return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer);
} }
+3 -3
View File
@@ -69,7 +69,7 @@ abstract class ModuleGridCore extends Module
{ {
if (!Validate::isModuleName($render)) if (!Validate::isModuleName($render))
die(Tools::displayError()); die(Tools::displayError());
if (!Tools::file_exists_cache($file = dirname(__FILE__).'/../../modules/'.$render.'/'.$render.'.php')) if (!Tools::file_exists_cache($file = _PS_ROOT_DIR_.'/modules/'.$render.'/'.$render.'.php'))
die(Tools::displayError()); die(Tools::displayError());
require_once($file); require_once($file);
$this->_render = new $render($type); $this->_render = new $render($type);
@@ -99,7 +99,7 @@ abstract class ModuleGridCore extends Module
return Tools::displayError('No grid engine selected'); return Tools::displayError('No grid engine selected');
if (!Validate::isModuleName($render)) if (!Validate::isModuleName($render))
die(Tools::displayError()); die(Tools::displayError());
if (!file_exists(dirname(__FILE__).'/../../modules/'.$render.'/'.$render.'.php')) if (!file_exists(_PS_ROOT_DIR_.'/modules/'.$render.'/'.$render.'.php'))
return Tools::displayError('Grid engine selected is unavailable.'); return Tools::displayError('Grid engine selected is unavailable.');
$grider = 'grider.php?render='.$render.'&module='.Tools::safeOutput(Tools::getValue('module')); $grider = 'grider.php?render='.$render.'&module='.Tools::safeOutput(Tools::getValue('module'));
@@ -132,7 +132,7 @@ abstract class ModuleGridCore extends Module
if (isset($params['dir']) && Validate::isSortDirection($params['dir'])) if (isset($params['dir']) && Validate::isSortDirection($params['dir']))
$grider .= '&dir='.$params['dir']; $grider .= '&dir='.$params['dir'];
require_once(dirname(__FILE__).'/../../modules/'.$render.'/'.$render.'.php'); require_once(_PS_ROOT_DIR_.'/modules/'.$render.'/'.$render.'.php');
return call_user_func(array($render, 'hookGridEngine'), $params, $grider); return call_user_func(array($render, 'hookGridEngine'), $params, $grider);
} }
+59 -77
View File
@@ -300,7 +300,7 @@ class OrderCore extends ObjectModel
$orderDetail->product_quantity_refunded += (int)($quantity); $orderDetail->product_quantity_refunded += (int)($quantity);
return $orderDetail->update(); return $orderDetail->update();
} }
return $this->_deleteProduct($orderDetail, (int)($quantity)); return $this->_deleteProduct($orderDetail, (int)$quantity);
} }
/** /**
@@ -335,64 +335,51 @@ class OrderCore extends ObjectModel
/* DOES delete the product */ /* DOES delete the product */
protected function _deleteProduct($orderDetail, $quantity) protected function _deleteProduct($orderDetail, $quantity)
{ {
$tax_calculator = $orderDetail->getTaxCalculator(); $product_price_tax_excl = $orderDetail->unit_price_tax_excl * $quantity;
$product_price_tax_incl = $orderDetail->unit_price_tax_incl * $quantity;
$price = $tax_calculator->addTaxes($orderDetail->product_price);
if ($orderDetail->reduction_percent != 0.00)
$reduction_amount = $price * $orderDetail->reduction_percent / 100;
elseif ($orderDetail->reduction_amount != '0.000000')
$reduction_amount = Tools::ps_round($orderDetail->reduction_amount, 2);
if (isset($reduction_amount) && $reduction_amount)
$price = Tools::ps_round($price - $reduction_amount, 2);
$productPriceWithoutTax = number_format($tax_calculator->removeTaxes($price), 2, '.', '');
$price += Tools::ps_round($orderDetail->ecotax * (1 + $orderDetail->ecotax_tax_rate / 100), 2);
$productPrice = number_format($quantity * $price, 2, '.', '');
/* Update cart */ /* Update cart */
$cart = new Cart($this->id_cart); $cart = new Cart($this->id_cart);
$cart->updateQty($quantity, $orderDetail->product_id, $orderDetail->product_attribute_id, false, 'down'); // customization are deleted in deleteCustomization $cart->updateQty($quantity, $orderDetail->product_id, $orderDetail->product_attribute_id, false, 'down'); // customization are deleted in deleteCustomization
$cart->update(); $cart->update();
/* Update order */ /* Update order */
$shippingDiff = $this->total_shipping - $cart->getPackageShippingCost($this->id_carrier, true, null, $this->getCartProducts()); $shipping_diff_tax_incl = $this->total_shipping_tax_incl - $cart->getPackageShippingCost($this->id_carrier, true, null, $this->getCartProducts());
$this->total_products -= $productPriceWithoutTax; $shipping_diff_tax_excl = $this->total_shipping_tax_excl - $cart->getPackageShippingCost($this->id_carrier, false, null, $this->getCartProducts());
$this->total_shipping -= $shipping_diff_tax_incl;
// After upgrading from old version $this->total_shipping_tax_excl -= $shipping_diff_tax_excl;
// total_products_wt is null $this->total_shipping_tax_incl -= $shipping_diff_tax_incl;
// removing a product made order total negative $this->total_products -= $product_price_tax_excl;
// and don't recalculating totals (on getTotalProductsWithTaxes) $this->total_products_wt -= $product_price_tax_incl;
if ($this->total_products_wt != 0) $this->total_paid -= $product_price_tax_incl + $shipping_diff_tax_incl;
$this->total_products_wt -= $productPrice; $this->total_paid_tax_incl -= $product_price_tax_incl + $shipping_diff_tax_incl;
$this->total_paid_tax_excl -= $product_price_tax_excl + $shipping_diff_tax_excl;
$this->total_shipping = $cart->getTotalShippingCost(); $this->total_paid_real -= $product_price_tax_incl + $shipping_diff_tax_incl;
/* It's temporary fix for 1.3 version... */
if ($orderDetail->product_quantity_discount != '0.000000')
$this->total_paid -= ($productPrice + $shippingDiff);
else
$this->total_paid = $cart->getOrderTotal();
$this->total_paid_real -= ($productPrice + $shippingDiff);
$fields = array(
'total_shipping',
'total_shipping_tax_excl',
'total_shipping_tax_incl',
'total_products',
'total_products_wt',
'total_paid',
'total_paid_tax_incl',
'total_paid_tax_excl',
'total_paid_real'
);
/* Prevent from floating precision issues (total_products has only 2 decimals) */ /* Prevent from floating precision issues (total_products has only 2 decimals) */
if ($this->total_products < 0) foreach ($fields as $field)
$this->total_products = 0; if ($this->{$field} < 0)
$this->{$field} = 0;
if ($this->total_paid < 0)
$this->total_paid = 0;
if ($this->total_paid_real < 0)
$this->total_paid_real = 0;
/* Prevent from floating precision issues */ /* Prevent from floating precision issues */
$this->total_paid = number_format($this->total_paid, 2, '.', ''); foreach ($fields as $field)
$this->total_paid_real = number_format($this->total_paid_real, 2, '.', ''); $this->{$field} = number_format($this->{$field}, 2, '.', '');
$this->total_products = number_format($this->total_products, 2, '.', '');
$this->total_products_wt = number_format($this->total_products_wt, 2, '.', '');
/* Update order detail */ /* Update order detail */
$orderDetail->product_quantity -= (int)($quantity); $orderDetail->product_quantity -= (int)$quantity;
if ($orderDetail->product_quantity == 0)
if (!$orderDetail->product_quantity)
{ {
if (!$orderDetail->delete()) if (!$orderDetail->delete())
return false; return false;
@@ -406,6 +393,13 @@ class OrderCore extends ObjectModel
} }
return $this->update(); return $this->update();
} }
else
{
$orderDetail->total_price_tax_incl -= $product_price_tax_incl;
$orderDetail->total_price_tax_excl -= $product_price_tax_excl;
$orderDetail->total_shipping_price_tax_incl -= $shipping_diff_tax_incl;
$orderDetail->total_shipping_price_tax_excl -= $shipping_diff_tax_excl;
}
return $orderDetail->update() && $this->update(); return $orderDetail->update() && $this->update();
} }
@@ -422,7 +416,7 @@ class OrderCore extends ObjectModel
return false; return false;
if (!Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `quantity` = 0')) if (!Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `quantity` = 0'))
return false; return false;
return $this->_deleteProduct($orderDetail, (int)($quantity)); return $this->_deleteProduct($orderDetail, (int)$quantity);
} }
/** /**
@@ -488,9 +482,8 @@ class OrderCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT * SELECT *
FROM `'._DB_PREFIX_.'order_detail` od FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = od.product_id)
ON p.id_product = od.product_id LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
'.Shop::addSqlAssociation('product', 'p').'
WHERE od.`id_order` = '.(int)($this->id)); WHERE od.`id_order` = '.(int)($this->id));
} }
@@ -952,22 +945,9 @@ class OrderCore extends ObjectModel
$products = $this->getProductsDetail(); $products = $this->getProductsDetail();
$return = 0; $return = 0;
foreach ($products as $row) foreach ($products as $row)
{ $return += $row['total_price_tax_incl'];
if (!isset($row['tax_rate']))
$row['tax_rate'] = 0;
$price = Tools::ps_round($row['product_price'] * (1 + $row['tax_rate'] / 100), 2);
if ($row['reduction_percent'])
$price -= $price * ($row['reduction_percent'] * 0.01);
if ($row['reduction_amount'])
$price -= $row['reduction_amount'] * (1 + ($row['tax_rate'] * 0.01));
if ($row['group_reduction'])
$price -= $price * ($row['group_reduction'] * 0.01);
$price += $row['ecotax'] * (1 + $row['ecotax_tax_rate'] / 100);
$return += Tools::ps_round($price, 2) * $row['product_quantity'];
}
if (!$products) if (!$products)
{ {
$this->total_products_wt = $return; $this->total_products_wt = $return;
@@ -1152,19 +1132,21 @@ class OrderCore extends ObjectModel
// Update order payment // Update order payment
if ($use_existing_payment) if ($use_existing_payment)
{ {
$id_order_payment = Db::getInstance()->getValue(' $id_order_payments = Db::getInstance()->executeS('
SELECT MAX(id_order_payment) FROM `'._DB_PREFIX_.'order_payment` op SELECT op.id_order_payment
INNER JOIN `'._DB_PREFIX_.'orders` o FROM `'._DB_PREFIX_.'order_payment` op
ON o.reference = op.order_reference INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.reference = op.order_reference)
WHERE id_order = '.(int)$order_invoice->id_order); LEFT JOIN `'._DB_PREFIX_.'order_invoice_payment` oip ON (oip.id_order_payment = op.id_order_payment)
WHERE oip.id_order_payment IS NULL AND o.id_order = '.(int)$order_invoice->id_order);
if ($id_order_payment) if (count($id_order_payments))
Db::getInstance()->execute(' foreach ($id_order_payments as $order_payment)
INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` Db::getInstance()->execute('
SET INSERT INTO `'._DB_PREFIX_.'order_invoice_payment`
`id_order_invoice` = '.(int)$order_invoice->id.', SET
`id_order_payment` = '.(int)$id_order_payment.', `id_order_invoice` = '.(int)$order_invoice->id.',
`id_order` = '.(int)$order_invoice->id_order); `id_order_payment` = '.(int)$order_payment['id_order_payment'].',
`id_order` = '.(int)$order_invoice->id_order);
} }
// Update order cart rule // Update order cart rule
+10 -3
View File
@@ -39,6 +39,9 @@ class OrderDetailCore extends ObjectModel
/** @var integer */ /** @var integer */
public $product_id; public $product_id;
/** @var integer */
public $id_shop;
/** @var integer */ /** @var integer */
public $product_attribute_id; public $product_attribute_id;
@@ -160,6 +163,7 @@ class OrderDetailCore extends ObjectModel
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'product_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'product_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'product_attribute_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'product_attribute_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'product_name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'product_name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
@@ -460,8 +464,8 @@ class OrderDetailCore extends ObjectModel
Product::getPriceStatic((int)$product['id_product'], true, (int)$product['id_product_attribute'], 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $specific_price); Product::getPriceStatic((int)$product['id_product'], true, (int)$product['id_product_attribute'], 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $specific_price);
$this->specificPrice = $specific_price; $this->specificPrice = $specific_price;
$this->original_product_price = Product::getPriceStatic($product['id_product'], false, (int)$product['id_product_attribute'], null, null, false, false, 1, false); $this->original_product_price = Product::getPriceStatic($product['id_product'], false, (int)$product['id_product_attribute'], 6, null, false, false, 1, false);
$this->product_price = (float)$product['price']; $this->product_price = $this->original_product_price;
$this->unit_price_tax_incl = (float)$product['price_wt']; $this->unit_price_tax_incl = (float)$product['price_wt'];
$this->unit_price_tax_excl = (float)$product['price']; $this->unit_price_tax_excl = (float)$product['price'];
$this->total_price_tax_incl = (float)$product['total_wt']; $this->total_price_tax_incl = (float)$product['total_wt'];
@@ -546,7 +550,10 @@ class OrderDetailCore extends ObjectModel
// Set order invoice id // Set order invoice id
$this->id_order_invoice = (int)$id_order_invoice; $this->id_order_invoice = (int)$id_order_invoice;
// Set shop id
$this->id_shop = (int)$product['id_shop'];
// Add new entry to the table // Add new entry to the table
$this->save(); $this->save();
+1 -1
View File
@@ -119,7 +119,7 @@ class OrderInvoiceCore extends ObjectModel
FROM `'._DB_PREFIX_.'order_detail` od FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.id_product = od.product_id ON p.id_product = od.product_id
'.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
WHERE od.`id_order` = '.(int)$this->id_order.' WHERE od.`id_order` = '.(int)$this->id_order.'
AND od.`id_order_invoice` = '.(int)$this->id); AND od.`id_order_invoice` = '.(int)$this->id);
} }
+1 -1
View File
@@ -48,7 +48,7 @@ class OrderPaymentCore extends ObjectModel
'fields' => array( 'fields' => array(
'order_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9), 'order_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true), 'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isNegativePrice', 'required' => true),
'payment_method' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'payment_method' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
'conversion_rate' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'), 'conversion_rate' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
'transaction_id' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254), 'transaction_id' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254),
+3 -3
View File
@@ -226,9 +226,9 @@ class OrderReturnCore extends ObjectModel
public static function addReturnedQuantity(&$products, $id_order) public static function addReturnedQuantity(&$products, $id_order)
{ {
$details = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' $details = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT od.id_order_detail, IFNULL(GREATEST(od.product_quantity_return, ord.product_quantity),0) as qty_returned SELECT od.id_order_detail, GREATEST(od.product_quantity_return, IFNULL(ord.product_quantity,0)) as qty_returned
FROM ps_order_detail od FROM '._DB_PREFIX_.'order_detail od
LEFT JOIN ps_order_return_detail ord LEFT JOIN '._DB_PREFIX_.'order_return_detail ord
ON ord.id_order_detail = od.id_order_detail ON ord.id_order_detail = od.id_order_detail
WHERE od.id_order = '.(int)$id_order WHERE od.id_order = '.(int)$id_order
); );
+14 -16
View File
@@ -67,9 +67,9 @@ class OrderSlipCore extends ObjectModel
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'conversion_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true), 'conversion_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
'amount' => array('type' => self::TYPE_INT), 'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
'shipping_cost' => array('type' => self::TYPE_INT), 'shipping_cost' => array('type' => self::TYPE_INT),
'shipping_cost_amount' => array('type' => self::TYPE_FLOAT), 'shipping_cost_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
'partial' => array('type' => self::TYPE_INT), 'partial' => array('type' => self::TYPE_INT),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
@@ -115,38 +115,36 @@ class OrderSlipCore extends ObjectModel
.($id_order_detail ? ' WHERE `id_order_detail` = '.(int)($id_order_detail) : '')); .($id_order_detail ? ' WHERE `id_order_detail` = '.(int)($id_order_detail) : ''));
} }
// TODO clean getProducts($resTab) => now getProducts method don't use his parameters
public static function getOrdersSlipProducts($orderSlipId, $order) public static function getOrdersSlipProducts($orderSlipId, $order)
{ {
$cart_rules = $order->getCartRules(true); $cart_rules = $order->getCartRules(true);
$productsRet = OrderSlip::getOrdersSlipDetail($orderSlipId); $productsRet = OrderSlip::getOrdersSlipDetail($orderSlipId);
$products = $order->getProductsDetail(); $order_details = $order->getProductsDetail();
$tmp = array(); $slip_quantity = array();
foreach ($productsRet as $slip_detail) foreach ($productsRet as $slip_detail)
$tmp[$slip_detail['id_order_detail']] = $slip_detail['product_quantity']; $slip_quantity[$slip_detail['id_order_detail']] = $slip_detail['product_quantity'];
$resTab = array(); $products = array();
foreach ($products as $key => $product) foreach ($order_details as $key => $product)
if (isset($tmp[$product['id_order_detail']])) if (isset($slip_quantity[$product['id_order_detail']]))
{ {
$resTab[$key] = $product; $products[$key] = $product;
$resTab[$key]['product_quantity'] = $tmp[$product['id_order_detail']]; $products[$key]['product_quantity'] = $slip_quantity[$product['id_order_detail']];
if (count($cart_rules)) if (count($cart_rules))
{ {
$order->setProductPrices($product); $order->setProductPrices($product);
$realProductPrice = $resTab[$key]['product_price']; $realProductPrice = $products[$key]['product_price'];
// Todo : must be updated to use the cart rules // Todo : must be updated to use the cart rules
foreach ($cart_rules as $cart_rule) foreach ($cart_rules as $cart_rule)
{ {
if ($cart_rule['reduction_percent']) if ($cart_rule['reduction_percent'])
$resTab[$key]['product_price'] -= $realProductPrice * ($cart_rule['reduction_percent'] / 100); $products[$key]['product_price'] -= $realProductPrice * ($cart_rule['reduction_percent'] / 100);
elseif ($cart_rule['reduction_amount']) elseif ($cart_rule['reduction_amount'])
$resTab[$key]['product_price'] -= (($cart_rule['reduction_amount'] * ($product['product_price_wt'] / $order->total_products_wt)) / (1.00 + ($product['tax_rate'] / 100))); $products[$key]['product_price'] -= (($cart_rule['reduction_amount'] * ($product['product_price_wt'] / $order->total_products_wt)) / (1.00 + ($product['tax_rate'] / 100)));
} }
} }
} }
return $order->getProducts($resTab); return $order->getProducts($products);
} }
/** /**

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