Compare commits
985 Commits
1.5.5.0
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f02c8ca58 | ||
|
|
bfed3532bf | ||
|
|
2962141d51 | ||
|
|
73bf2a7db1 | ||
|
|
9aa656c9d7 | ||
|
|
1140b5e8b5 | ||
|
|
6a690b255b | ||
|
|
152960639f | ||
|
|
448a4c9994 | ||
|
|
7526fe4766 | ||
|
|
50eee795ed | ||
|
|
97be96ede8 | ||
|
|
0b47ef1b3b | ||
|
|
ba15d975bc | ||
|
|
47d58ff930 | ||
|
|
d06bf10bbb | ||
|
|
d0d234f555 | ||
|
|
19d975a0b4 | ||
|
|
6393746f04 | ||
|
|
db99f188a2 | ||
|
|
fe8e349931 | ||
|
|
3f8b76f78c | ||
|
|
947f9bb21c | ||
|
|
83400c691c | ||
|
|
f4601d9680 | ||
|
|
28e1a94bb6 | ||
|
|
ad6367f2bf | ||
|
|
5a8c335d78 | ||
|
|
4479db88a0 | ||
|
|
339c954cb3 | ||
|
|
c4837e65ec | ||
|
|
2117c89352 | ||
|
|
9f10a851e5 | ||
|
|
66a9ee03fc | ||
|
|
c69688cc11 | ||
|
|
26d1ad0668 | ||
|
|
6a99b84452 | ||
|
|
6ddf220aee | ||
|
|
9328a3c473 | ||
|
|
c8dfe1c174 | ||
|
|
75df12dd94 | ||
|
|
6d7e2055ce | ||
|
|
4d327a537f | ||
|
|
747926039a | ||
|
|
5e4382eb08 | ||
|
|
036e2362c9 | ||
|
|
fc193d5c8b | ||
|
|
75e6a03591 | ||
|
|
dd05692400 | ||
|
|
b5eb7c5c28 | ||
|
|
f0f3679cbd | ||
|
|
175da3ecf6 | ||
|
|
743c4f4607 | ||
|
|
40abef8aac | ||
|
|
8be339463d | ||
|
|
f0f630fb50 | ||
|
|
3f42a381a4 | ||
|
|
0e1898be09 | ||
|
|
c1969028f2 | ||
|
|
cd83ec93c7 | ||
|
|
ab730dc3da | ||
|
|
7523828a7a | ||
|
|
e2d8a33a81 | ||
|
|
a7869a1f06 | ||
|
|
de404706d9 | ||
|
|
3f9338e13d | ||
|
|
38da826671 | ||
|
|
fee461fdf1 | ||
|
|
8dd951c2df | ||
|
|
7e93b2cffd | ||
|
|
19da345531 | ||
|
|
bd8eebdc33 | ||
|
|
4312d241f3 | ||
|
|
7eb70486e0 | ||
|
|
ebc3dfee62 | ||
|
|
ee487fde59 | ||
|
|
c7f1fcb49a | ||
|
|
530b6dc501 | ||
|
|
5364be686e | ||
|
|
aaaf8588c1 | ||
|
|
6ee2852fa5 | ||
|
|
02acd47c9e | ||
|
|
32e92762f5 | ||
|
|
3b7387ffe8 | ||
|
|
472dc8c27d | ||
|
|
92cf31e5c3 | ||
|
|
fa7d44d67f | ||
|
|
b9c4b5d2a7 | ||
|
|
fbd28f3e49 | ||
|
|
8c8340db4e | ||
|
|
7cc351e83d | ||
|
|
91cde1ab3a | ||
|
|
e6f9f806bf | ||
|
|
fc4a660f76 | ||
|
|
f3147b4e57 | ||
|
|
514c087962 | ||
|
|
00887942d3 | ||
|
|
afe6c9bc6f | ||
|
|
fc6041fa33 | ||
|
|
76b03856e2 | ||
|
|
ef5779f63f | ||
|
|
d0522417eb | ||
|
|
50c95f568c | ||
|
|
d321b9a5bc | ||
|
|
d95885caae | ||
|
|
71139df65f | ||
|
|
1fb8ef823d | ||
|
|
29001b3392 | ||
|
|
eac7fbb694 | ||
|
|
fa4b5e0b7d | ||
|
|
d30830f6fe | ||
|
|
b2e5c6090d | ||
|
|
2556a7bb68 | ||
|
|
7226f33f90 | ||
|
|
3f3dc0feb9 | ||
|
|
d4253b9849 | ||
|
|
2b8d069cf9 | ||
|
|
9817ef6840 | ||
|
|
581645ce6d | ||
|
|
87be153e42 | ||
|
|
f85c6b59c8 | ||
|
|
99e98a5164 | ||
|
|
4c1ad83b18 | ||
|
|
26a43260c5 | ||
|
|
c69429c126 | ||
|
|
02c04a9884 | ||
|
|
cf65877f3f | ||
|
|
f0abdca08f | ||
|
|
0e54bf0f76 | ||
|
|
12276f41fb | ||
|
|
be13f82b30 | ||
|
|
f5cc6862cb | ||
|
|
0a65de5e5f | ||
|
|
f4740088c1 | ||
|
|
c44b1d617c | ||
|
|
c452444620 | ||
|
|
3f817e8729 | ||
|
|
66f314bbb2 | ||
|
|
bf8cd29868 | ||
|
|
b8b7fbaf71 | ||
|
|
9ea79f8cb5 | ||
|
|
b3c54a59dd | ||
|
|
06d73554be | ||
|
|
ad555f1d30 | ||
|
|
4b6ee72072 | ||
|
|
e000f8c627 | ||
|
|
6ef7f258ea | ||
|
|
2be72f50d1 | ||
|
|
d49c4cf62e | ||
|
|
c7323c2bfe | ||
|
|
2a3192d98c | ||
|
|
b16e4b5a8e | ||
|
|
8f72282594 | ||
|
|
a5bb4f0323 | ||
|
|
062fb90c2e | ||
|
|
9193a29a44 | ||
|
|
671062af07 | ||
|
|
80c60be952 | ||
|
|
1b019dffc5 | ||
|
|
f9dc0b0252 | ||
|
|
9611ea1f70 | ||
|
|
d17515a728 | ||
|
|
036fa7cba6 | ||
|
|
9c57c71deb | ||
|
|
7812731095 | ||
|
|
a8a204edf3 | ||
|
|
11f60492be | ||
|
|
f919cc899d | ||
|
|
fbdddba753 | ||
|
|
cbfa8dfc30 | ||
|
|
8547f663d1 | ||
|
|
372130f7d7 | ||
|
|
f78cde96d6 | ||
|
|
48f00b2367 | ||
|
|
c958436a76 | ||
|
|
a56fb7c639 | ||
|
|
16efe89bed | ||
|
|
56799f53c8 | ||
|
|
da43700361 | ||
|
|
d7b46e80af | ||
|
|
b311a0c719 | ||
|
|
a0f4eab4c1 | ||
|
|
9ef10ee806 | ||
|
|
f9b1545037 | ||
|
|
c56e8471c2 | ||
|
|
8953c55b7f | ||
|
|
653c38e01a | ||
|
|
78af47e2d3 | ||
|
|
26b4fbf883 | ||
|
|
c98b5e0c78 | ||
|
|
6d5ca9969e | ||
|
|
90bef56c84 | ||
|
|
75cde08776 | ||
|
|
c6319a754e | ||
|
|
9d18ef8186 | ||
|
|
f58526c701 | ||
|
|
d5eedd5eaa | ||
|
|
a43851469e | ||
|
|
0288696c90 | ||
|
|
64706075d5 | ||
|
|
7c1623c7fa | ||
|
|
ed2fbba996 | ||
|
|
87bb957431 | ||
|
|
7b029457e4 | ||
|
|
b605f33359 | ||
|
|
580e201c48 | ||
|
|
d409614222 | ||
|
|
e1c7541a38 | ||
|
|
1bee84d26c | ||
|
|
af61191a7e | ||
|
|
07222be5dd | ||
|
|
9f2580f3bd | ||
|
|
d2e475dd3a | ||
|
|
2b67d7072c | ||
|
|
b885c63564 | ||
|
|
d74291e5b5 | ||
|
|
1d90218e0d | ||
|
|
9660cef0aa | ||
|
|
4b1f198cc4 | ||
|
|
0aca1d4a67 | ||
|
|
526f32b6a0 | ||
|
|
faa4a18a82 | ||
|
|
79cba4b655 | ||
|
|
0ba8fbc39a | ||
|
|
edf54eb2ca | ||
|
|
e86c56172d | ||
|
|
48b7a49b1a | ||
|
|
12a257db7a | ||
|
|
63141a9c4d | ||
|
|
c84689ec71 | ||
|
|
4103339f53 | ||
|
|
9a879bc133 | ||
|
|
e1d1479f22 | ||
|
|
2dbaa5f73b | ||
|
|
9a3cfece69 | ||
|
|
ee06d3114d | ||
|
|
c5c861b59e | ||
|
|
0bc1d21432 | ||
|
|
4c484afda1 | ||
|
|
025b62f995 | ||
|
|
8f6a5bb3a1 | ||
|
|
a7d0794c43 | ||
|
|
6359c1ca33 | ||
|
|
9a26cf02a8 | ||
|
|
eb8ea1cba5 | ||
|
|
4e6585a1b8 | ||
|
|
a03efe152c | ||
|
|
942d3c7151 | ||
|
|
1e094f4016 | ||
|
|
a9643c80c3 | ||
|
|
438a3dda2b | ||
|
|
4cd3e1b830 | ||
|
|
97ef888345 | ||
|
|
4207bdff32 | ||
|
|
6f57093f50 | ||
|
|
8cb1806e49 | ||
|
|
759fe2f671 | ||
|
|
0416aca547 | ||
|
|
cc3363011e | ||
|
|
c516035e0e | ||
|
|
c5324a653b | ||
|
|
3cd702da42 | ||
|
|
65401efcb6 | ||
|
|
84454bbc1c | ||
|
|
f0ed5a303c | ||
|
|
4803530eed | ||
|
|
ea8a5277f2 | ||
|
|
2ffc296279 | ||
|
|
971722a13f | ||
|
|
fc9b39968b | ||
|
|
81945cef71 | ||
|
|
1cc0134ec3 | ||
|
|
b9de912dd3 | ||
|
|
6d3640e895 | ||
|
|
56693da6e0 | ||
|
|
3e33a259ef | ||
|
|
8e506ddff2 | ||
|
|
03ad842697 | ||
|
|
554ab9414f | ||
|
|
747ec9a2c4 | ||
|
|
2f5e15e2b1 | ||
|
|
373604fc97 | ||
|
|
101b37b40a | ||
|
|
ad4ecefcf9 | ||
|
|
3e999ab591 | ||
|
|
010ad76e6f | ||
|
|
5fd3ad5adf | ||
|
|
6cddb57ce3 | ||
|
|
ae63336a37 | ||
|
|
feca06417f | ||
|
|
5d28d38a22 | ||
|
|
398548fecf | ||
|
|
83d4d0d258 | ||
|
|
c401e61b81 | ||
|
|
5bb4d48ddd | ||
|
|
e557db6429 | ||
|
|
ce4170574c | ||
|
|
e6e2db8400 | ||
|
|
70d2e6e10b | ||
|
|
7cbaada844 | ||
|
|
bc7e8eb355 | ||
|
|
bc38b542fe | ||
|
|
2989538ce1 | ||
|
|
e857fb5978 | ||
|
|
1ae587475b | ||
|
|
d20aea0563 | ||
|
|
ce8d01ad4c | ||
|
|
2aa52356ad | ||
|
|
c1ecf43be8 | ||
|
|
16ffbd8ee5 | ||
|
|
61884ec223 | ||
|
|
a05c748e81 | ||
|
|
a9e45fccf3 | ||
|
|
d25b41ef97 | ||
|
|
5d8c0a0fc2 | ||
|
|
15cd0b9fbc | ||
|
|
3dea171047 | ||
|
|
35df3f463c | ||
|
|
198e75245d | ||
|
|
8ef22c3548 | ||
|
|
9b8a7edad8 | ||
|
|
332c8ff49f | ||
|
|
c9d20f35b3 | ||
|
|
f2d70076bd | ||
|
|
c36625a136 | ||
|
|
5daa79c1e1 | ||
|
|
8ef1e043af | ||
|
|
6965bb29c1 | ||
|
|
72ccc90cc9 | ||
|
|
7133e74c17 | ||
|
|
2e2151a1bb | ||
|
|
8a682081de | ||
|
|
6747d3bbac | ||
|
|
b8273a13e6 | ||
|
|
3a38af9982 | ||
|
|
6b1d69dd7d | ||
|
|
eb14e25e2a | ||
|
|
f1ea9ba5b4 | ||
|
|
e4faa2bb75 | ||
|
|
3ba5905042 | ||
|
|
22fd1b84c4 | ||
|
|
ad27dbe8d1 | ||
|
|
6ee538c710 | ||
|
|
237b950eb6 | ||
|
|
7ae9832992 | ||
|
|
81497be5ab | ||
|
|
837ca34e7e | ||
|
|
9c861642a5 | ||
|
|
dec9ef40a8 | ||
|
|
b4e18954f9 | ||
|
|
fd2dc4ff64 | ||
|
|
f25a418785 | ||
|
|
6f4b85430c | ||
|
|
2a28e47650 | ||
|
|
f3755e2d0a | ||
|
|
bce6e8f09f | ||
|
|
cc8ec4fd45 | ||
|
|
80f6f4e223 | ||
|
|
50002ec714 | ||
|
|
c6e3e28894 | ||
|
|
f8edca8ac8 | ||
|
|
2a54296b96 | ||
|
|
1adfa1584c | ||
|
|
1358c696cd | ||
|
|
5e407db21e | ||
|
|
3282bd19e4 | ||
|
|
3bc02bbe10 | ||
|
|
af9182dad5 | ||
|
|
3539eb3697 | ||
|
|
a377ecd571 | ||
|
|
8d7e96176c | ||
|
|
f9cfde9a05 | ||
|
|
ee29f4365e | ||
|
|
a10dcab6e7 | ||
|
|
0a441b9a4b | ||
|
|
4f9191fe0c | ||
|
|
2afbe8fd04 | ||
|
|
85c6e799c3 | ||
|
|
418155cf2b | ||
|
|
3f6139be42 | ||
|
|
9d5a9225e5 | ||
|
|
0dbaa59985 | ||
|
|
06c62c1684 | ||
|
|
0f9c81a683 | ||
|
|
a07733fcec | ||
|
|
1786f8e907 | ||
|
|
9fc9df6ba4 | ||
|
|
9e3b82e8ed | ||
|
|
8cfe9a2065 | ||
|
|
45e9040606 | ||
|
|
1a1f3de775 | ||
|
|
6c739ee2b3 | ||
|
|
5c66ed4791 | ||
|
|
d1a7ff50d5 | ||
|
|
7b02da5fdf | ||
|
|
36ca7bc508 | ||
|
|
075a911cee | ||
|
|
6f878353a6 | ||
|
|
bb96c8754f | ||
|
|
dc1632a8b0 | ||
|
|
a87bbf84b4 | ||
|
|
4505387046 | ||
|
|
286084c42d | ||
|
|
789911184b | ||
|
|
39a543188a | ||
|
|
9bae53a4d9 | ||
|
|
819dac6622 | ||
|
|
8d1bca5542 | ||
|
|
246340b78c | ||
|
|
75ffa8c4f8 | ||
|
|
f6bbb6e241 | ||
|
|
68d84892c7 | ||
|
|
2feb5dd8d2 | ||
|
|
d0a4636966 | ||
|
|
d796d0012e | ||
|
|
df4ae671a2 | ||
|
|
df97566018 | ||
|
|
338efcad7f | ||
|
|
7a6dea4964 | ||
|
|
008c6ce759 | ||
|
|
85946bacbe | ||
|
|
cd8af9ae67 | ||
|
|
fa88a0bd93 | ||
|
|
2899dfba5e | ||
|
|
ae7d33effe | ||
|
|
e4a642128a | ||
|
|
30adb0932d | ||
|
|
7d0e9a5f06 | ||
|
|
4daaa206d2 | ||
|
|
644e38c05f | ||
|
|
77b2b4b6ca | ||
|
|
d63288affd | ||
|
|
c51fe5b22d | ||
|
|
717e195f57 | ||
|
|
f78a093a1c | ||
|
|
f9f5a4b090 | ||
|
|
92ffb1eab1 | ||
|
|
f4610c06e0 | ||
|
|
68cba08303 | ||
|
|
2969a7f74c | ||
|
|
1ed26e2d4e | ||
|
|
302260539b | ||
|
|
d125ca0a36 | ||
|
|
adb1779764 | ||
|
|
a652590885 | ||
|
|
2515d81bdd | ||
|
|
bf65404413 | ||
|
|
e3db5570d0 | ||
|
|
68131dc28b | ||
|
|
7a7da1097d | ||
|
|
df0a24d63c | ||
|
|
4254ae6edc | ||
|
|
3f4f298ad4 | ||
|
|
2a475d066f | ||
|
|
b941ac007b | ||
|
|
d6ffb45eb1 | ||
|
|
b6bba0c787 | ||
|
|
3477cac1e0 | ||
|
|
d3d0897012 | ||
|
|
e0978a0b84 | ||
|
|
148348855e | ||
|
|
b61e3e68b9 | ||
|
|
98aea24fc3 | ||
|
|
1787923c4c | ||
|
|
481cb5c28a | ||
|
|
b2b0c4f00b | ||
|
|
2aee99c0b0 | ||
|
|
48f20a4393 | ||
|
|
139a74e4cd | ||
|
|
121fcdc39f | ||
|
|
fe6494bf35 | ||
|
|
a4b7fc942f | ||
|
|
fef8d2beac | ||
|
|
6dacc07e62 | ||
|
|
805989da39 | ||
|
|
093bf9e065 | ||
|
|
75cb92c329 | ||
|
|
f28131fe9b | ||
|
|
96646b5c7a | ||
|
|
18ab409eeb | ||
|
|
a92ced814a | ||
|
|
3d8591c588 | ||
|
|
09ad15730b | ||
|
|
6c9b71ee58 | ||
|
|
0af24ab034 | ||
|
|
f100027e5d | ||
|
|
6a0c376a18 | ||
|
|
62d946ea68 | ||
|
|
31f421153d | ||
|
|
c75cda2429 | ||
|
|
e7c860a3dd | ||
|
|
8580dd0b39 | ||
|
|
9e837d1ecc | ||
|
|
cfd70bf660 | ||
|
|
0662cd3b12 | ||
|
|
6c4a69ea0b | ||
|
|
b92c9869a4 | ||
|
|
992cc6b437 | ||
|
|
7f32e8d187 | ||
|
|
cafe2ed9d2 | ||
|
|
e38d808a85 | ||
|
|
86631202df | ||
|
|
d601844e82 | ||
|
|
ea57b3fdd1 | ||
|
|
f979cbef57 | ||
|
|
8b2215eec5 | ||
|
|
0f288583ca | ||
|
|
8762c310b9 | ||
|
|
6e0c3e1aa2 | ||
|
|
8f09d49ffc | ||
|
|
3585bf33c8 | ||
|
|
6610bd2067 | ||
|
|
43a60f1b57 | ||
|
|
f2e39488b6 | ||
|
|
e190c8df9f | ||
|
|
d1956572a5 | ||
|
|
ca1bc3daa8 | ||
|
|
d87c816038 | ||
|
|
3b75dd6785 | ||
|
|
89d86793b0 | ||
|
|
33b5971a7a | ||
|
|
711f5b0bdf | ||
|
|
4668d8ffa2 | ||
|
|
e9a3c98af9 | ||
|
|
da48cea96e | ||
|
|
a40356d21c | ||
|
|
3a0081912d | ||
|
|
a027dbd061 | ||
|
|
3d1d178bba | ||
|
|
4bb4199f5a | ||
|
|
3e0c5e71f4 | ||
|
|
fe7035aae9 | ||
|
|
96be4068f5 | ||
|
|
250a9f17a2 | ||
|
|
bf6a0e0077 | ||
|
|
6974a88b59 | ||
|
|
f4cadbdfd6 | ||
|
|
1ccc25f56c | ||
|
|
c4e549db13 | ||
|
|
a876b13c1c | ||
|
|
eb7655e318 | ||
|
|
99f325dc3c | ||
|
|
c466320887 | ||
|
|
a6e8af99f9 | ||
|
|
6bbcbb536f | ||
|
|
294384d9ea | ||
|
|
953f0641e8 | ||
|
|
a5dc1ce6f6 | ||
|
|
172986a461 | ||
|
|
23df6cb875 | ||
|
|
f4c2bacea3 | ||
|
|
626ccf0985 | ||
|
|
a76a7273ea | ||
|
|
9e4b6c020f | ||
|
|
9e64ecc887 | ||
|
|
9ad046677c | ||
|
|
4fcbde878d | ||
|
|
f30bc80485 | ||
|
|
e706b531bc | ||
|
|
340f6cebe4 | ||
|
|
97a25eb9c6 | ||
|
|
ecb4ccfdda | ||
|
|
2b55944874 | ||
|
|
452e07ab0b | ||
|
|
4a66bdcdf9 | ||
|
|
f899380e3b | ||
|
|
1b9472cc37 | ||
|
|
9c04f1dace | ||
|
|
1cce312aaa | ||
|
|
f39c2c40cf | ||
|
|
b7ff8d634a | ||
|
|
f983e0eaf1 | ||
|
|
6bb1fa6a4d | ||
|
|
05eafdb14f | ||
|
|
cfc41ec4ef | ||
|
|
6822373378 | ||
|
|
dd5cd33bb4 | ||
|
|
7eddca6d15 | ||
|
|
7d764c5ce8 | ||
|
|
f9ad0d1b79 | ||
|
|
e040c096d1 | ||
|
|
b6f13648db | ||
|
|
22173355a5 | ||
|
|
06b6facc2d | ||
|
|
e0e5f80767 | ||
|
|
3e85622972 | ||
|
|
67d0ac95b5 | ||
|
|
6e191fe054 | ||
|
|
5ebc2e5e91 | ||
|
|
813ef8bc7e | ||
|
|
c2b9ff40ef | ||
|
|
a4178a9fd2 | ||
|
|
40617c0a81 | ||
|
|
ca01b58262 | ||
|
|
9d94337c9b | ||
|
|
6449ecfb32 | ||
|
|
6d8cc454e1 | ||
|
|
345d4cdbcf | ||
|
|
66435cbf4a | ||
|
|
84d8ccfa2b | ||
|
|
2be5233584 | ||
|
|
33c2669692 | ||
|
|
6b30cc5084 | ||
|
|
19fb32545d | ||
|
|
4e472fae50 | ||
|
|
30367e6427 | ||
|
|
126c21d39a | ||
|
|
50bd3d613d | ||
|
|
98148cfe03 | ||
|
|
4fc4ee721e | ||
|
|
d3ad12e536 | ||
|
|
8c1240cb2c | ||
|
|
81ec2822ec | ||
|
|
7a7a2fb8c3 | ||
|
|
47bf9a397a | ||
|
|
f3e36b896b | ||
|
|
1abb064958 | ||
|
|
252ab56d75 | ||
|
|
9109708944 | ||
|
|
e21eef3a87 | ||
|
|
3ded9549cf | ||
|
|
37170c74b3 | ||
|
|
017d19330a | ||
|
|
78c1dce528 | ||
|
|
37f928ade9 | ||
|
|
48d9c37590 | ||
|
|
a6e67b078e | ||
|
|
7486844222 | ||
|
|
95a2b2a8a8 | ||
|
|
757fe64217 | ||
|
|
5245038ea1 | ||
|
|
91d495a4a8 | ||
|
|
ae8c8218fd | ||
|
|
81e66233d8 | ||
|
|
1800c6589c | ||
|
|
bdd84771b7 | ||
|
|
54b3ac5a32 | ||
|
|
7f9183b1d4 | ||
|
|
931d240ca1 | ||
|
|
e900474b8e | ||
|
|
69cb20d5e8 | ||
| 81ca3ac1f9 | |||
|
|
6f840eceba | ||
|
|
5e7dbea970 | ||
|
|
beb0a74135 | ||
|
|
0f4781053b | ||
|
|
10d6e97aca | ||
|
|
3448027861 | ||
|
|
89ac0bc439 | ||
|
|
3d477c62eb | ||
|
|
c9b53685c5 | ||
|
|
1cc92fc9c2 | ||
|
|
17323a04b6 | ||
|
|
1d6593612f | ||
|
|
4c399875d9 | ||
|
|
92b987c0f8 | ||
|
|
41af17e06b | ||
|
|
6acebca8fa | ||
|
|
6850db0612 | ||
|
|
aefab21a62 | ||
|
|
d9a24d61ac | ||
|
|
6195d0c319 | ||
|
|
b3a425c73a | ||
|
|
ccb3179c1a | ||
|
|
b4547568a5 | ||
|
|
d37f545058 | ||
|
|
5c4de83e91 | ||
|
|
6796b64e18 | ||
|
|
3b075e049b | ||
|
|
84dc75f57e | ||
|
|
92382e347c | ||
|
|
dedc59f1db | ||
|
|
c6222c51c8 | ||
|
|
a1555c3fc8 | ||
|
|
31697fde3c | ||
|
|
5206496f64 | ||
|
|
cf82157d47 | ||
|
|
7dbb6088a4 | ||
|
|
50bbf1a547 | ||
|
|
32a7a28567 | ||
|
|
a578cfb2e2 | ||
|
|
39468476ab | ||
|
|
214b844ef7 | ||
|
|
5c3b8015e5 | ||
|
|
7aa348eb93 | ||
|
|
e2a1f5101c | ||
|
|
7d05da1618 | ||
|
|
429c9442a3 | ||
|
|
2dc91758c3 | ||
|
|
9b878a33a8 | ||
|
|
7eb3b22829 | ||
|
|
e2ac223f4e | ||
|
|
5b7580d487 | ||
|
|
1cebd5920e | ||
|
|
4f639329e9 | ||
|
|
91ae972655 | ||
|
|
f8ca06d927 | ||
|
|
eb6600e840 | ||
|
|
14cd72121a | ||
|
|
42cdc988ac | ||
|
|
8c6aaa3c7d | ||
|
|
63f4743134 | ||
|
|
e0b59082f9 | ||
|
|
0361d5db8d | ||
|
|
ea6ea955bb | ||
|
|
803b6ce8ec | ||
|
|
0c511dead5 | ||
|
|
6b47f5713e | ||
|
|
5eb4c93b8c | ||
|
|
0a9f425281 | ||
|
|
65559c5cf4 | ||
|
|
e7286c44f2 | ||
|
|
4e1d6de9b0 | ||
|
|
75a9629b8a | ||
|
|
27f14b9a31 | ||
|
|
70d48d0af1 | ||
|
|
f6dc81d0f1 | ||
|
|
2e311410b2 | ||
|
|
0452979ce7 | ||
|
|
3aec242600 | ||
|
|
93aae26269 | ||
|
|
f293562ea4 | ||
|
|
66f46eee03 | ||
|
|
672da852c5 | ||
|
|
965b8a1bf3 | ||
|
|
47c5f400ee | ||
|
|
322654cacf | ||
|
|
3151064daf | ||
|
|
e6e8efc19a | ||
|
|
6ee6317fee | ||
|
|
2d5bd901f4 | ||
|
|
b9b4265517 | ||
|
|
15dd1cf96f | ||
|
|
1c58c1ea6b | ||
|
|
852faeab7a | ||
|
|
8504574ae1 | ||
|
|
e68c124218 | ||
|
|
08efa4e313 | ||
|
|
e0739ea1e0 | ||
|
|
0e3d53321a | ||
|
|
d7c1cd90bf | ||
|
|
c0afb55d11 | ||
|
|
3b9c125198 | ||
|
|
08373c0541 | ||
|
|
73dd524de8 | ||
|
|
10472ef83c | ||
|
|
6da1228359 | ||
|
|
d0ef8cca8f | ||
|
|
97ec6341e8 | ||
|
|
5363e75238 | ||
|
|
a3d9643833 | ||
|
|
4f06b74a29 | ||
|
|
61295e4e21 | ||
|
|
d9bc07d030 | ||
|
|
3eb4d65fc9 | ||
|
|
452f41df8d | ||
|
|
db4b69d10c | ||
|
|
5095b45e47 | ||
|
|
30591b7c28 | ||
|
|
f9b1f0ab5e | ||
|
|
cc36eb2d27 | ||
|
|
53c1e56c51 | ||
|
|
8590b0e699 | ||
|
|
876be3b452 | ||
|
|
e5276ff531 | ||
|
|
90091d4f2c | ||
|
|
3870388e1c | ||
|
|
ea1bdbc849 | ||
|
|
f0297824d7 | ||
|
|
c91a86740f | ||
|
|
a37033e478 | ||
|
|
9fa6c86a94 | ||
|
|
f4f3084c35 | ||
|
|
a4d131eac9 | ||
|
|
e2dac03baa | ||
|
|
dfdbe39ee3 | ||
|
|
31c94caebc | ||
|
|
4a3e0c5075 | ||
|
|
c42d71b8f5 | ||
|
|
669c3791b5 | ||
|
|
3e750490fe | ||
|
|
01be908e51 | ||
|
|
9f12ff15be | ||
|
|
53805f2b93 | ||
|
|
614e56283a | ||
|
|
85a471a690 | ||
|
|
86d3a8afe1 | ||
|
|
f94f0f14a4 | ||
|
|
31d762b88a | ||
|
|
9713f93075 | ||
|
|
c5afbc75bd | ||
|
|
332d68c7ec | ||
|
|
f30a088848 | ||
|
|
3c090535a9 | ||
|
|
c4681c1fb1 | ||
|
|
021790a3e2 | ||
|
|
4968a792b4 | ||
|
|
a383d55421 | ||
|
|
00f3045690 | ||
|
|
5362f4d426 | ||
|
|
9880d152d4 | ||
|
|
990a889b1c | ||
|
|
e6d0a3e5a4 | ||
|
|
242556e176 | ||
|
|
c502c9766f | ||
|
|
54f7c65165 | ||
|
|
641cf225f2 | ||
|
|
6ea3783013 | ||
|
|
dcad699ede | ||
|
|
e1d0347757 | ||
|
|
b975a9375c | ||
|
|
9c756a7fcb | ||
|
|
6b03af9ef9 | ||
|
|
ec556bb307 | ||
|
|
e6f8dba2e6 | ||
|
|
25ba388d69 | ||
|
|
e5337f5e76 | ||
|
|
683513a9d2 | ||
|
|
19a6c4373e | ||
|
|
2874f14983 | ||
|
|
7491f46322 | ||
|
|
4c49048e39 | ||
|
|
e5f53afd5f | ||
|
|
9377775eca | ||
|
|
768a8b36d5 | ||
|
|
1b0c5be93d | ||
|
|
663f592306 | ||
|
|
ec11b7e064 | ||
|
|
7e1c0d5a24 | ||
|
|
53241af228 | ||
|
|
a7d619b208 | ||
|
|
6b080e1f02 | ||
|
|
0f81518ba2 | ||
|
|
6e5fb47642 | ||
|
|
824a6b90f3 | ||
|
|
284711b22f | ||
|
|
2f6e0e3fae | ||
|
|
d59f3383cf | ||
|
|
4d68595447 | ||
|
|
07bdcd4129 | ||
|
|
e9d066c981 | ||
|
|
56a1449c69 | ||
|
|
63c19ce1a9 | ||
|
|
3ca2c8da95 | ||
|
|
00c1860d22 | ||
|
|
9348768ceb | ||
|
|
7b0349ca33 | ||
|
|
efa81a7107 | ||
|
|
da353c884d | ||
|
|
df56d7af42 | ||
|
|
87567ed1a0 | ||
|
|
5d38743b72 | ||
|
|
75a663b6e3 | ||
|
|
f4892686c1 | ||
|
|
b55a84e961 | ||
|
|
6daf8ebbfa | ||
|
|
5d8e187faa | ||
|
|
0891c986d6 | ||
|
|
8fedbe189c | ||
|
|
cd7d604b75 | ||
|
|
5caae97813 | ||
|
|
572a2e45aa | ||
|
|
98f60d039b | ||
|
|
656717fb4c | ||
|
|
e08c8b2d25 | ||
|
|
97f1db480a | ||
|
|
c3772fb355 | ||
|
|
da12fbdd5e | ||
|
|
94bdde4630 | ||
|
|
abf5ad195c | ||
|
|
b2ccf88296 | ||
|
|
f7eb6b3a16 | ||
|
|
6059b4301a | ||
|
|
36d9e0eed5 | ||
|
|
c6d2e1252e | ||
|
|
fe209e0c55 | ||
|
|
f535d60a29 | ||
|
|
36ca7f294a | ||
|
|
477457a44f | ||
|
|
6177589cd3 | ||
|
|
4853772198 | ||
|
|
62303e58df | ||
|
|
82939730dd | ||
|
|
397e42637a | ||
|
|
6dc0edec3a | ||
|
|
d019500d81 | ||
|
|
00afa8ae47 | ||
|
|
a013be8380 | ||
|
|
a436456fa4 | ||
| 5f1e08e7e2 | |||
|
|
4c633b8b46 | ||
|
|
9cd73b411d | ||
|
|
805e80e54c | ||
|
|
d0087267df | ||
|
|
f7fefe789d | ||
|
|
37e3b9e9e4 | ||
|
|
b72f2a7176 | ||
|
|
39c8a8fc2d | ||
|
|
24146181c6 | ||
|
|
e6abe1c5a0 | ||
|
|
eec8aaa4f8 | ||
|
|
08b8277a7a | ||
|
|
51083e17af | ||
|
|
40c64b54e2 | ||
|
|
4a8f6c3116 | ||
|
|
1196c5d736 | ||
|
|
01cbffad9b | ||
|
|
c736c28ab5 | ||
|
|
6d1c8c54af | ||
|
|
be83f1364d | ||
|
|
f24391be5a | ||
|
|
75303e82e0 | ||
|
|
ddc16a2f65 | ||
|
|
0a2d8175a7 | ||
|
|
ffd712312d | ||
|
|
4bb0e16509 | ||
|
|
39c882cdb4 | ||
|
|
598469e41e | ||
|
|
6aad506c80 | ||
|
|
99b162d16b | ||
|
|
de200e1c5e | ||
|
|
2620242176 | ||
|
|
6fd7f0114e | ||
|
|
1a5b9de372 | ||
|
|
5a685537a4 | ||
|
|
536bdb550b | ||
|
|
1673a080a0 | ||
|
|
0a4264c947 | ||
|
|
0ccbe8cb15 | ||
|
|
ad428dfb2b | ||
|
|
bc071f2b04 | ||
|
|
9f2423c2c5 | ||
|
|
235bfada7e | ||
|
|
b1a0e715a6 | ||
|
|
8412192822 | ||
|
|
c4bb5a99e4 | ||
|
|
d48df48a03 | ||
|
|
7bcd8ee83c | ||
|
|
bbea6c4a9b | ||
|
|
eb69498d2c | ||
|
|
df418a80db | ||
|
|
cf35d3762b | ||
|
|
f610b0d844 | ||
|
|
415ca83b62 | ||
|
|
1a81191c09 | ||
|
|
a7f6e91ac0 | ||
|
|
dc4978ff57 | ||
|
|
1138e8d01a | ||
|
|
13c5450ca1 | ||
|
|
7f3652bea0 | ||
|
|
dab86dffe1 | ||
|
|
1e10dab8f8 | ||
|
|
8051b0021e | ||
|
|
5d0f1499ac | ||
|
|
30d9ebe68f | ||
|
|
7ec55106ce | ||
|
|
b7232aabd7 | ||
|
|
ce20d55e77 | ||
|
|
a38fe5ddd3 | ||
|
|
c35d846f60 | ||
|
|
75f0b38ff1 | ||
|
|
cbc7b9567a | ||
|
|
64698d1590 | ||
|
|
84ded9f3db | ||
|
|
f5e28b9212 | ||
|
|
390b49122e | ||
|
|
be9398c6c5 | ||
|
|
d5cdcab859 | ||
|
|
49b6fda40f | ||
|
|
0023950c72 | ||
|
|
7d4feac247 | ||
|
|
8e72d122e6 | ||
|
|
bb45c93d4f | ||
|
|
55fc51f20b | ||
|
|
1c6eb93951 | ||
|
|
44f7356d44 | ||
|
|
de3b121b11 | ||
|
|
239c5adb5a | ||
|
|
942a946147 | ||
|
|
5f1506ffc2 | ||
|
|
cd1ed74d8e | ||
|
|
a32ff1e930 | ||
|
|
876c49b690 | ||
|
|
783b02b34f | ||
|
|
c94dbb36ce |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -104,4 +104,4 @@ modules/upscarrier
|
||||
modules/uspscarrier
|
||||
modules/wexpay
|
||||
modules/yotpo
|
||||
modules/zingaya
|
||||
modules/zingaya
|
||||
@@ -16,13 +16,14 @@
|
||||
- bMancone
|
||||
- bumbu
|
||||
- Burhan
|
||||
- Cédric Mouleyre
|
||||
- Caleydon Media
|
||||
- cam.lafit
|
||||
- Captain FLAM
|
||||
- Captain-FLAM
|
||||
- ccauw
|
||||
- Cédric Mouleyre
|
||||
- ChristopheBoucaut
|
||||
- CINS
|
||||
- cippest
|
||||
- cmouleyre
|
||||
- Corentin Delcourt
|
||||
@@ -34,42 +35,50 @@
|
||||
- David Gasperoni
|
||||
- Davy Rolink
|
||||
- djfm
|
||||
- dlage
|
||||
- dMetzger
|
||||
- (d)oekia
|
||||
- Dragan Skrbic
|
||||
- DrÿSs'
|
||||
- dreammeup
|
||||
- DrySs
|
||||
- DrÿSs
|
||||
- DrÿSs'
|
||||
- dSevere
|
||||
- Edouard Gaulué
|
||||
- emily-d
|
||||
- Fabio Chelly
|
||||
- fBrignoli
|
||||
- fram
|
||||
- Francois Gaillard
|
||||
- François Gaillard
|
||||
- Fran?s Gaillard
|
||||
- fSerny
|
||||
- Gabriel Schwardy
|
||||
- gBrunier
|
||||
- gCharmes
|
||||
- gPoulain
|
||||
- gr4devel
|
||||
- Grégoire Bélorgey
|
||||
- Gregory Roussac
|
||||
- gRoussac
|
||||
- Guillaume DELOINCE
|
||||
- ha99y
|
||||
- hAitmansour
|
||||
- Ha!*!*y
|
||||
- indesign47
|
||||
- inem0o
|
||||
- ivancasasempere
|
||||
- Jérôme Nadaud
|
||||
- jBreux
|
||||
- jeckyl
|
||||
- jeromenadaud
|
||||
- Jerome Nadaud
|
||||
- Jérôme Nadaud
|
||||
- jessylenne
|
||||
- jmCollin
|
||||
- jObregon
|
||||
- Jonathan Danse
|
||||
- joseantgv
|
||||
- Julien
|
||||
- Kevin Granger
|
||||
- kpodemski
|
||||
- Krystian Podemski
|
||||
@@ -77,8 +86,11 @@
|
||||
- lCherifi
|
||||
- ldecoker
|
||||
- lLefevre
|
||||
- LOIC ROSSET ltd
|
||||
- makk1ntosh
|
||||
- marcinsz101
|
||||
- Marco Cervellin
|
||||
- matiasiglesias
|
||||
- Mats Rynge
|
||||
- MatthieuB
|
||||
- Maxence
|
||||
@@ -101,32 +113,39 @@
|
||||
- PhpMadman
|
||||
- Pierre
|
||||
- Piotr Kaczor
|
||||
- Piotr Moćko
|
||||
- Piotr Mocko
|
||||
- PrestaEdit
|
||||
- prestarocket
|
||||
- Prestaspirit
|
||||
- pxls
|
||||
- Rémi Gaillard
|
||||
- Raphaël Malié
|
||||
- raulgundin
|
||||
- Rémi Gaillard
|
||||
- rGaillard
|
||||
- Rimas Kudelis
|
||||
- rMalie
|
||||
- rMontagne
|
||||
- romainberger
|
||||
- root
|
||||
- runningz
|
||||
- Sébastien
|
||||
- Sébastien Bocahu
|
||||
- sagaradonis
|
||||
- Samy Rabih
|
||||
- Sarah Lorenzini
|
||||
- Seb
|
||||
- Sébastien
|
||||
- Sébastien Bocahu
|
||||
- Seynaeve
|
||||
- Shagshag
|
||||
- sjousse
|
||||
- sLorenzini
|
||||
- smartdatasoft
|
||||
- soufyan
|
||||
- soware
|
||||
- Staging
|
||||
- sThiebaut
|
||||
- Sylvain WITMEYER
|
||||
- tDidierjean
|
||||
- unknown
|
||||
- vAugagneur
|
||||
- vChabot
|
||||
- Vincent Augagneur
|
||||
@@ -138,3 +157,5 @@
|
||||
- Xavier
|
||||
- Xavier POITAU
|
||||
- Yoozio
|
||||
- zimmi1
|
||||
|
||||
|
||||
41
README.md
41
README.md
@@ -2,47 +2,48 @@ README
|
||||
======
|
||||

|
||||
|
||||
PREPARATION
|
||||
ABOUT
|
||||
--------
|
||||
|
||||
To install PrestaShop, you need a remote web server or on your computer (MAMP), with access to a database like MySQL.
|
||||
You'll need access to phpMyAdmin to create a database and to indicate the information in the database in the installer.
|
||||
PrestaShop is a free and open-source e-commerce web application, committed to providing the best shopping cart experience for both merchants and consumers.
|
||||
|
||||
|
||||
SERVER CONFIGURATION
|
||||
--------
|
||||
|
||||
To install PrestaShop, you need a web server running PHP5 and any flavor of MySQL5 (MySQL, MariaDB, Percona Server...).
|
||||
You will also need a database administration tool, such as phpMyAdmin, in order to create a database for PrestaShop.
|
||||
We recommend the Apache or Nginx web servers.
|
||||
|
||||
If your host does not offer PHP5 by default, here are a few [explanations][2] about PHP5 or the .htaccess file for certain hosting services (1&1, Free, Lycos, OVH, Infomaniak, Amen, GoDaddy, etc).
|
||||
|
||||
If you want your online store ready to go, visit [http://www.prestabox.com][1]: it lets you create your online store in less than 10 minutes without any technical knowledge.
|
||||
|
||||
If you do not host and unable to create your store, we offer a turnkey store, which lets you create your online store in less than 10 minutes without any technical knowledge.
|
||||
We invite you to visit: [http://www.prestabox.com][1]
|
||||
|
||||
INSTALLATION
|
||||
--------
|
||||
|
||||
Simply go to your PrestaShop web directory and use installer :-)
|
||||
With your web browser, go to the root of your PrestaShop directory, and the installer will start. Follow the instructions until PrestaShop is installed.
|
||||
|
||||
If you have any PHP error, perhaps you don't have PHP5 or you need to activate it on your web host.
|
||||
Please go to our forum to find pre-installation settings (PHP 5, htaccess) for certain hosting services (1&1, Free, Lycos, OVH, Infomaniak, Amen, GoDaddy, etc).
|
||||
If you have any PHP error, perhaps you don't have PHP5 or you need to activate it on your web host. See the page linked above.
|
||||
If you don't find any solution to start the installer, please post on [the PrestaShop forums][3].
|
||||
|
||||
English webhost [specifics settings][2]
|
||||
|
||||
|
||||
If you don't find any solution to launch installer, please post on [our forum][3]
|
||||
|
||||
|
||||
There are always solutions for your issues ;-)
|
||||
|
||||
DOCUMENTATION
|
||||
--------
|
||||
|
||||
For any extra documentation (how-to), please read our [Online documentation][4]
|
||||
The official PrestaShop documentation is available online [on its own website][4].
|
||||
|
||||
|
||||
FORUMS
|
||||
--------
|
||||
|
||||
You can also discuss, help and contribute with PrestaShop community on [our forums][5]
|
||||
You can discuss, help and contribute with PrestaShop community on [the PrestaShop forums][5].
|
||||
|
||||
|
||||
Thanks for downloading and using PrestaShop e-commerce Open-source solution!
|
||||
Thank you for downloading and using PrestaShop e-commerce Open-source solution!
|
||||
|
||||
[1]: http://www.prestabox.com
|
||||
[2]: http://www.prestashop.com/forums/topic/2946-pre-installation-settings-php-5-htaccess-for-certain-hosting-services/
|
||||
[3]: http://www.prestashop.com/forums/forum/7-installing-prestashop/
|
||||
[4]: http://doc.prestashop.com
|
||||
[5]: http://www.prestashop.com/forums/
|
||||
[5]: http://www.prestashop.com/forums/
|
||||
|
||||
@@ -26,45 +26,12 @@
|
||||
|
||||
define('_PS_ADMIN_DIR_', getcwd());
|
||||
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
|
||||
|
||||
/* Getting cookie or logout */
|
||||
require_once(_PS_ADMIN_DIR_.'/init.php');
|
||||
|
||||
$context = Context::getContext();
|
||||
|
||||
if (Tools::isSubmit('changeParentUrl'))
|
||||
echo '<script type="text/javascript">parent.parent.document.location.href = "'.addslashes(urldecode(Tools::getValue('changeParentUrl'))).'";</script>';
|
||||
if (Tools::isSubmit('installBoughtModule'))
|
||||
{
|
||||
$file = false;
|
||||
while ($file === false OR file_exists(_PS_MODULE_DIR_.$file))
|
||||
$file = uniqid();
|
||||
$file = _PS_MODULE_DIR_.$file.'.zip';
|
||||
$sourceFile = 'http://addons.prestashop.com/iframe/getboughtfile.php?id_order_detail='.Tools::getValue('id_order_detail').'&token='.Tools::getValue('token');
|
||||
if (!copy($sourceFile, $file))
|
||||
{
|
||||
if (!($content = file_get_contents($sourceFile)))
|
||||
die(displayJavascriptAlert('Access denied: Please download your module directly from PrestaShop Addons website'));
|
||||
elseif (!file_put_contents($file, $content))
|
||||
die(displayJavascriptAlert('Local error: your module directory is not writable'));
|
||||
}
|
||||
$first6 = fread($fd = fopen($file, 'r'), 6);
|
||||
if (!strncmp($first6, 'Error:', 6))
|
||||
{
|
||||
$displayJavascriptAlert = displayJavascriptAlert(fread($fd, 1024));
|
||||
fclose($fd);
|
||||
unlink($file);
|
||||
die($displayJavascriptAlert);
|
||||
}
|
||||
fclose($fd);
|
||||
if (!Tools::ZipExtract($file, _PS_MODULE_DIR_))
|
||||
{
|
||||
unlink($file);
|
||||
die(displayJavascriptAlert('Cannot unzip file'));
|
||||
}
|
||||
unlink($file);
|
||||
die(displayJavascriptAlert('Module copied to disk'));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('ajaxReferrers'))
|
||||
{
|
||||
require(_PS_CONTROLLER_DIR_.'admin/AdminReferrersController.php');
|
||||
@@ -101,39 +68,6 @@ if (Tools::isSubmit('ajaxProductPackItems'))
|
||||
die('['.implode(',', $jsonArray).']');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('ajaxStates') AND Tools::isSubmit('id_country'))
|
||||
{
|
||||
$states = Db::getInstance()->executeS('
|
||||
SELECT s.id_state, s.name
|
||||
FROM '._DB_PREFIX_.'state s
|
||||
LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`)
|
||||
WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1
|
||||
ORDER BY s.`name` ASC');
|
||||
|
||||
if (is_array($states) AND !empty($states))
|
||||
{
|
||||
$list = '';
|
||||
if (Tools::getValue('no_empty') != true)
|
||||
{
|
||||
$empty_value = (Tools::isSubmit('empty_value')) ? Tools::getValue('empty_value') : '----------';
|
||||
$list = '<option value="0">'.Tools::htmlentitiesUTF8($empty_value).'</option>'."\n";
|
||||
}
|
||||
|
||||
foreach ($states AS $state)
|
||||
$list .= '<option value="'.(int)($state['id_state']).'"'.((isset($_GET['id_state']) AND $_GET['id_state'] == $state['id_state']) ? ' selected="selected"' : '').'>'.$state['name'].'</option>'."\n";
|
||||
}
|
||||
else
|
||||
$list = 'false';
|
||||
|
||||
die($list);
|
||||
}
|
||||
|
||||
if (Tools::getValue('form_language_id'))
|
||||
{
|
||||
if (!($context->cookie->employee_form_lang = (int)(Tools::getValue('form_language_id'))))
|
||||
die ('Error while updating cookie.');
|
||||
die ('Form language updated.');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitTrackClickOnHelp'))
|
||||
{
|
||||
@@ -144,15 +78,6 @@ if (Tools::isSubmit('submitTrackClickOnHelp'))
|
||||
HelpAccess::trackClick($label, $version);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('toggleScreencast'))
|
||||
{
|
||||
if (Validate::isLoadedObject($context->employee))
|
||||
{
|
||||
$context->employee->bo_show_screencast = !$context->employee->bo_show_screencast;
|
||||
$context->employee->update();
|
||||
}
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('getChildrenCategories') && Tools::isSubmit('id_category_parent'))
|
||||
{
|
||||
$children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat'), Context::getContext()->language->id, null, Tools::getValue('use_shop_context'));
|
||||
@@ -200,17 +125,6 @@ if (Tools::isSubmit('getParentCategoriesId') && $id_category = Tools::getValue('
|
||||
die(Tools::jsonEncode($output));
|
||||
}
|
||||
|
||||
/* Update attribute */
|
||||
if (Tools::isSubmit('ajaxUpdateTaxRule'))
|
||||
{
|
||||
$id_tax_rule = Tools::getValue('id_tax_rule');
|
||||
$tax_rules = new TaxRule((int)$id_tax_rule);
|
||||
$output = array();
|
||||
foreach ($tax_rules as $key => $result)
|
||||
$output[$key] = $result;
|
||||
die(Tools::jsonEncode($output));
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('getZones'))
|
||||
{
|
||||
$zones = Zone::getZones();
|
||||
@@ -223,8 +137,3 @@ if (Tools::isSubmit('getZones'))
|
||||
$array = array('hasError' => false, 'errors' => '', 'data' => $html);
|
||||
die(Tools::jsonEncode($html));
|
||||
}
|
||||
|
||||
function displayJavascriptAlert($s)
|
||||
{
|
||||
echo '<script type="text/javascript">alert(\''.addslashes($s).'\');</script>';
|
||||
}
|
||||
|
||||
@@ -22,26 +22,18 @@
|
||||
|
||||
$upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS));
|
||||
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
|
||||
{
|
||||
$error = SYS_DISABLED;
|
||||
}
|
||||
elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
|
||||
{
|
||||
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
|
||||
}else if(!$upload->isFileUploaded('file'))
|
||||
{
|
||||
elseif (!$upload->isFileUploaded('file'))
|
||||
$error = ERR_FILE_NOT_UPLOADED;
|
||||
}else if(!$upload->moveUploadedFile($_GET['folder']))
|
||||
{
|
||||
$error = ERR_FILE_MOVE_FAILED;
|
||||
}
|
||||
elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
|
||||
{
|
||||
elseif (!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
|
||||
$error = ERR_FILE_TYPE_NOT_ALLOWED;
|
||||
}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
|
||||
{
|
||||
elseif (defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
|
||||
$error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
|
||||
}else
|
||||
elseif (!$upload->moveUploadedFile($_GET['folder']))
|
||||
$error = ERR_FILE_MOVE_FAILED;
|
||||
else
|
||||
{
|
||||
include_once(CLASS_FILE);
|
||||
$path = $upload->getFilePath();
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
if(!empty($_GET['search']))
|
||||
{
|
||||
include_once(CLASS_SEARCH);
|
||||
|
||||
if (!preg_match('/^'.Tools::pRegexp(realpath(dirname(__FILE__).'/'.$_GET['search_folder']), '/').'/i', _PS_ROOT_DIR_.'/img/cms'))
|
||||
exit;
|
||||
$search = new Search($_GET['search_folder']);
|
||||
$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
|
||||
$search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
|
||||
|
||||
@@ -78,9 +78,9 @@
|
||||
define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid
|
||||
|
||||
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
|
||||
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png');// //
|
||||
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png');// //
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
|
||||
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png');
|
||||
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,jpeg,jpeg,png');
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
|
||||
define('CONFIG_UPLOAD_INVALID_EXTS', '');
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
//FILESYSTEM CONFIG <br>
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php");
|
||||
if (_PS_MODE_DEMO_)
|
||||
die('This functionality has been disabled.');
|
||||
|
||||
define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration
|
||||
if(!isset($_SESSION))
|
||||
{
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid
|
||||
|
||||
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
|
||||
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
|
||||
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png,txt'); //
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
|
||||
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf');
|
||||
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,jpeg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf');
|
||||
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
|
||||
define('CONFIG_UPLOAD_INVALID_EXTS', '');
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
$timer_start = microtime(true);
|
||||
define('_PS_ADMIN_DIR_', getcwd());
|
||||
|
||||
if (!defined('PS_ADMIN_DIR'))
|
||||
define('PS_ADMIN_DIR', _PS_ADMIN_DIR_);
|
||||
|
||||
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
|
||||
require(_PS_ADMIN_DIR_.'/functions.php');
|
||||
|
||||
|
||||
@@ -49,9 +49,12 @@ try
|
||||
AdminTab::$currentIndex = $currentIndex;
|
||||
|
||||
$iso = $context->language->iso_code;
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php');
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php');
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php');
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php'))
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php');
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php'))
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php');
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'))
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php');
|
||||
|
||||
/* Server Params */
|
||||
$protocol_link = (Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://';
|
||||
|
||||
@@ -30,6 +30,7 @@ select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disab
|
||||
|
||||
/*BUTTON*/
|
||||
.button{
|
||||
cursor: pointer;
|
||||
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top;
|
||||
background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent;
|
||||
background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent;
|
||||
@@ -673,4 +674,4 @@ ul.listForm li {padding-bottom:3px;}
|
||||
|
||||
/************** SCENE *****************/
|
||||
|
||||
#large_scene_image{clear:both;border:1px solid transparent;}
|
||||
#large_scene_image{clear:both;border:1px solid transparent;}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
.toolbarBox .process-icon-new-module { background-image: url('../img/process-icon-new-module.png')}
|
||||
.toolbarBox .process-icon-new-module-addon { background-image: url('../img/process-icon-new-module-addon.png')}
|
||||
|
||||
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:1}
|
||||
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:11}
|
||||
|
||||
|
||||
/*FILTER MODULE*/
|
||||
|
||||
@@ -66,7 +66,8 @@
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
var infos = msg.infos.split('_');
|
||||
var infos = msg.infos.replace("\\'", "'").split('_');
|
||||
|
||||
$('input[name=firstname]').val(infos[0]);
|
||||
$('input[name=lastname]').val(infos[1]);
|
||||
$('input[name=company]').val(infos[2]);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</td>
|
||||
{foreach from=$ranges key=r item=range}
|
||||
<td class="center">
|
||||
<input name="fees[{$zone.id_zone|intval}][{$range.id_range|intval}]" type="text"
|
||||
<input name="fees[{$zone.id_zone|intval}][{$range.id_range|intval}]" type="text"
|
||||
{if !isset($fields_value['zones'][$zone.id_zone]) || (isset($fields_value['zones'][$zone.id_zone]) && !$fields_value['zones'][$zone.id_zone])} disabled="disabled"{/if} {if isset($price_by_range[$range.id_range][$zone.id_zone]) && $price_by_range[$range.id_range][$zone.id_zone] && isset($fields_value['zones'][$zone.id_zone]) && $fields_value['zones'][$zone.id_zone]} value="{$price_by_range[$range.id_range][$zone.id_zone]|string_format:'%.6f'}" {else} value="" {/if} /> {$currency_sign}
|
||||
</td>
|
||||
{/foreach}
|
||||
@@ -53,7 +53,7 @@
|
||||
{if $smarty.foreach.ranges.first}
|
||||
<td class="center"> </td>
|
||||
{else}
|
||||
<td class="center"><button class="button">{l s='Delete'}</button</td>
|
||||
<td class="center"><button class="button">{l s='Delete'}</button></td>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</tr>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<h2><img src="../img/admin/cart.gif" /> {l s='Order information'}</h2>
|
||||
<span>
|
||||
{if $order->id}
|
||||
<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>
|
||||
<a href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_order={$order->id}&vieworder"> {l s='Order #%s' sprintf=$order->reference}</a></span>
|
||||
<br /><br />
|
||||
{l s='Made on:'} {dateFormat date=$order->date_add}<br /><br /><br /><br />
|
||||
{else}
|
||||
@@ -187,4 +187,4 @@
|
||||
<div class="clear" style="height:20px;"> </div>
|
||||
{/block}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,14 +57,14 @@
|
||||
|
||||
<dl>
|
||||
<dt>{l s='Sent on:'}</dt>
|
||||
<dd>{$message.date_add}</dd>
|
||||
<dd>{$message.date_add} </dd>
|
||||
|
||||
</dl>
|
||||
|
||||
{if empty($message.id_employee)}
|
||||
<dl>
|
||||
<dt>{l s='Browser:'}</dt>
|
||||
<dd>{$message.user_agent}</dd>
|
||||
<dd>{$message.user_agent} </dd>
|
||||
</dl>
|
||||
{/if}
|
||||
|
||||
@@ -79,34 +79,35 @@
|
||||
</dl>
|
||||
{/if}
|
||||
|
||||
{if !empty($message.id_order) && empty($message.id_employee)}
|
||||
{if !empty($message.id_order) && $is_valid_order_id && empty($message.id_employee)}
|
||||
<dl>
|
||||
<dt>{l s='Order #'}</dt>
|
||||
<dd><a href="index.php?tab=AdminOrders&id_order={$message.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">
|
||||
{$message.id_order} <img src="../img/admin/search.gif" alt="{l s='View'}" />
|
||||
</a></dd>
|
||||
<dd><a href="index.php?tab=AdminOrders&id_order={$message.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">{$message.id_order} <img src="../img/admin/search.gif" alt="{l s='View'}" /></a>
|
||||
</dd>
|
||||
</dl>
|
||||
{/if}
|
||||
|
||||
{if !empty($message.id_product) && empty($message.id_employee)}
|
||||
<dl>
|
||||
<dt>{l s='Product #'}</dt>
|
||||
<dd><a href="index.php?tab=AdminProducts&id_product={$message.id_product}&updateproduct&token={getAdminToken tab='AdminProducts'}" title="{l s='View order'}">
|
||||
{$message.id_product} <img src="../img/admin/search.gif" alt="{l s='View'}" />
|
||||
</a></dd>
|
||||
<dd><a href="index.php?tab=AdminProducts&id_product={$message.id_product}&updateproduct&token={getAdminToken tab='AdminProducts'}" title="{l s='View order'}">{$message.id_product} <img src="../img/admin/search.gif" alt="{l s='View'}" /></a></dd>
|
||||
</dl>
|
||||
{/if}
|
||||
|
||||
<form action="{$current}&token={$token}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post">
|
||||
<b>{l s='Subject:'}</b>
|
||||
<input type="hidden" name="id_customer_message" value="{$message.id_customer_message}" />
|
||||
<select name="id_contact" onchange="this.form.submit();">
|
||||
{foreach $contacts as $contact}
|
||||
<option value="{$contact.id_contact}" {if $contact.id_contact == $message.id_contact}selected="selected"{/if}>
|
||||
{$contact.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<dl>
|
||||
<dt>{l s='Subject:'}</dt>
|
||||
<dd>
|
||||
<select name="id_contact" onchange="this.form.submit();">
|
||||
{foreach $contacts as $contact}
|
||||
<option value="{$contact.id_contact}" {if $contact.id_contact == $message.id_contact}selected="selected"{/if}>
|
||||
{$contact.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php",
|
||||
data: "token={getAdminToken tab='AdminCustomers'}&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer={$customer->id}¬e="+noteContent,
|
||||
data: "token={getAdminToken tab='AdminCustomers'}&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer={$customer->id}¬e="+encodeURIComponent(noteContent),
|
||||
async : true,
|
||||
success: function(r) {
|
||||
$('#note_feedback').html('').hide();
|
||||
|
||||
@@ -48,11 +48,11 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#group_discount_category").fancybox({
|
||||
onStart: function () {
|
||||
beforeLoad: function () {
|
||||
$('#group_discount_category_fancybox').show();
|
||||
initFancyBox();
|
||||
},
|
||||
onClosed: function () {
|
||||
beforeClose: function () {
|
||||
$('#group_discount_category_fancybox').hide();
|
||||
}
|
||||
});
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}'+jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
|
||||
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}' + ' ' + jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
|
||||
|
||||
var input_hidden = document.createElement("input");
|
||||
input_hidden.setAttribute('type', 'hidden');
|
||||
@@ -168,7 +168,7 @@
|
||||
{foreach $input['values'] key=key item=category }
|
||||
<tr class="alt_row" id="{$category.id_category}">
|
||||
<td>{$category.path}</td>
|
||||
<td>{l s='Discount: %d%%' sprintf=$category.reduction}</td>
|
||||
<td>{l s='Discount: %.2f%%' sprintf=$category.reduction}</td>
|
||||
<td>
|
||||
<a href="#" onclick="deleteCategoryReduction({$category.id_category});"><img src="../img/admin/delete.gif"></a>
|
||||
<input type="hidden" class="category_reduction" name="category_reduction[{$category.id_category}]" value="{$category.reduction}">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<fieldset>
|
||||
<ul>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Name:'}</span> {$group->name[$language->id]}</li>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Discount: %d%%' sprintf=$group->reduction}</span></li>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Discount: %.2f%%' sprintf=$group->reduction}</span></li>
|
||||
<li><span style="font-weight: bold; font-size: 13px; color:#000;">{l s='Current category discount:'}</span>
|
||||
{if !$categorieReductions}
|
||||
{l s='None'}
|
||||
@@ -39,7 +39,7 @@
|
||||
{foreach $categorieReductions key=key item=category }
|
||||
<tr class="alt_row">
|
||||
<td>{$category.path}</td>
|
||||
<td>{l s='Discount: %d%%' sprintf=$category.reduction}</td>
|
||||
<td>{l s='Discount: %.2f%%' sprintf=$category.reduction}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
@@ -58,6 +58,7 @@
|
||||
</ul>
|
||||
</fieldset>
|
||||
<h2>{l s='Members of this customer group'}</h2>
|
||||
<p>{l s='Limited to the first 100 customers.'} {l s='Please use filters to narrow your search.'}</p>
|
||||
{$customerList}
|
||||
|
||||
{/block}
|
||||
{/block}
|
||||
|
||||
@@ -110,14 +110,14 @@ $(document).ready(function() {
|
||||
</ul>
|
||||
|
||||
<div id="partner_preactivation">
|
||||
<p class="center"><img src="../img/loader.gif" alt="" /></p>
|
||||
<p class="center"><img src="../img/loader.gif" alt="" /> {l s='Loading...'}</p>
|
||||
</div>
|
||||
|
||||
<div class="separation"></div>
|
||||
|
||||
|
||||
{$tips_optimization}
|
||||
<div id="discover_prestashop"><p class="center"><img src="../img/loader.gif" alt="" />{l s='Loading...'}</p></div>
|
||||
<div id="discover_prestashop"><p class="center"><img src="../img/loader.gif" alt="" /> {l s='Loading...'}</p></div>
|
||||
|
||||
{hook h="displayAdminHomeInfos"}
|
||||
{hook h="displayBackOfficeHome"} {*old name of the hook*}
|
||||
@@ -212,7 +212,7 @@ $(document).ready(function() {
|
||||
{
|
||||
// don't show/hide screencast if it's deactivated
|
||||
{if $employee->bo_show_screencast}
|
||||
$('#adminpresentation').fadeOut('slow');
|
||||
$('#adminpresentation').fadeOut('slow');
|
||||
{/if}
|
||||
$('#partner_preactivation').fadeOut('slow');
|
||||
$('#discover_prestashop').fadeOut('slow');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
**
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
@@ -10,72 +10,25 @@
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
**
|
||||
* DISCLAIMER
|
||||
*
|
||||
**
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
**
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
{if $module_confirmation}
|
||||
<div class="module_confirmation conf confirm">
|
||||
{l s='Your .CSV file has been sucessfully imported into your shop.'}
|
||||
{l s='Your .CSV file has been sucessfully imported into your shop. Don\'t forget to Re-build the products search index.'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var truncateAuthorized = {$truncateAuthorized|intval};
|
||||
|
||||
$(document).ready(function(){
|
||||
activeClueTip();
|
||||
$("a#upload_file_import_link").fancybox({
|
||||
'titleShow' : false,
|
||||
'transitionIn' : 'elastic',
|
||||
'transitionOut' : 'elastic'
|
||||
});
|
||||
|
||||
$('#preview_import').submit(function(e) {
|
||||
if ($('#truncate').get(0).checked)
|
||||
{
|
||||
console.log(truncateAuthorized);
|
||||
if (truncateAuthorized)
|
||||
{
|
||||
if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '?'))
|
||||
{
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jAlert('{l s='You do not have permission to delete here. When the multistore is enabled, only a SuperAdmin can delete all items before an import.' js=1}');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function activeClueTip()
|
||||
{
|
||||
$('.info_import').cluetip({
|
||||
splitTitle: '|',
|
||||
showTitle: false
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
{**
|
||||
* Upload fancybox
|
||||
*}
|
||||
<div style="display: none">
|
||||
<div id="upload_file_import" style="padding-left: 10px; background-color: #EBEDF4; border: 1px solid #CCCED7">
|
||||
<div class="clear"> </div>
|
||||
@@ -97,28 +50,16 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"> </div>
|
||||
|
||||
{**
|
||||
* Import fieldset
|
||||
*}
|
||||
<form id="preview_import"
|
||||
action="{$current}&token={$token}"
|
||||
method="post"
|
||||
style="display:inline"
|
||||
enctype="multipart/form-data"
|
||||
class="clear">
|
||||
|
||||
<form id="preview_import" action="{$current}&token={$token}" method="post" style="display:inline" enctype="multipart/form-data" class="clear">
|
||||
<fieldset style="float: left; margin: 0pt 20px 0pt 0pt; width: 70%;">
|
||||
<legend><img src="../img/admin/import.gif" />{l s='Import '}</legend>
|
||||
|
||||
<label class="clear">{if count($files_to_import) > 1}{l s='Your CSV file (%d files):' sprintf=count($files_to_import)}{else}{l s='Your CSV file (%d file):' sprintf=count($files_to_import)}{/if}</label>
|
||||
<div class="margin-form">
|
||||
{if count($files_to_import)}
|
||||
<select name="csv">
|
||||
{foreach $files_to_import AS $filename}
|
||||
<option value="{$filename}">{$filename}</option>
|
||||
<option value="{$filename}"{if $csv_selected == $filename} selected="selected"{/if}>{$filename|escape:'htmlall':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{/if}
|
||||
@@ -126,33 +67,44 @@
|
||||
<a href="#upload_file_import" id="upload_file_import_link" class="button"><img src="../img/admin/add.gif" alt="Uplaod" title="Upload" />{l s='Upload'}</a>
|
||||
</div>
|
||||
<div style="width:50%; margin: 0 auto;">
|
||||
<a href="#" onclick="$('#sample_files_import').slideToggle(); return false;">{l s='Click to view our sample import csv files.'}</a>
|
||||
<ul id="sample_files_import" style="display:none">
|
||||
<li><a href="../docs/csv_import/categories_import.csv">{l s='Sample Categories file'}</a></li>
|
||||
<li><a href="../docs/csv_import/products_import.csv">{l s='Sample Products file'}</a></li>
|
||||
<li><a href="../docs/csv_import/combinations_import.csv">{l s='Sample Combinations file'}</a></li>
|
||||
<li><a href="../docs/csv_import/customers_import.csv">{l s='Sample Customers file'}</a></li>
|
||||
<li><a href="../docs/csv_import/addresses_import.csv">{l s='Sample Addresses file'}</a></li>
|
||||
<li><a href="../docs/csv_import/manufacturers_import.csv">{l s='Sample Manufacturers file'}</a></li>
|
||||
<li><a href="../docs/csv_import/suppliers_import.csv">{l s='Sample Suppliers file'}</a></li>
|
||||
{if $PS_ADVANCED_STOCK_MANAGEMENT}
|
||||
<li><a href="../docs/csv_import/supply_orders_import.csv">{l s='Supply Orders sample file'}</a></li>
|
||||
<li><a href="../docs/csv_import/supply_orders_details_import.csv">{l s='Supply Orders Details sample file'}</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
<div style="width:50%; display: inline-block; float :left;">
|
||||
<a href="#" onclick="$('#sample_files_import').slideToggle(); return false;">{l s='Click to view our sample import csv files.'}</a>
|
||||
<ul id="sample_files_import" style="display:none;">
|
||||
<li><a class="_blank" href="../docs/csv_import/categories_import.csv">{l s='Sample Categories file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/products_import.csv">{l s='Sample Products file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/combinations_import.csv">{l s='Sample Combinations file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/customers_import.csv">{l s='Sample Customers file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/addresses_import.csv">{l s='Sample Addresses file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/manufacturers_import.csv">{l s='Sample Manufacturers file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/suppliers_import.csv">{l s='Sample Suppliers file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/alias_import.csv">{l s='Sample Alias file'}</a></li>
|
||||
{if $PS_ADVANCED_STOCK_MANAGEMENT}
|
||||
<li><a class="_blank" href="../docs/csv_import/supply_orders_import.csv">{l s='Supply Orders sample file'}</a></li>
|
||||
<li><a class="_blank" href="../docs/csv_import/supply_orders_details_import.csv">{l s='Supply Orders Details sample file'}</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
<div style="width:50%; float:left;">
|
||||
<a href="#" onclick="$('#csv_files_import').slideToggle(); return false;">{l s='Click to view your csv files.'}</a>
|
||||
<ul id="csv_files_import" style="display:none;">
|
||||
{foreach $files_to_import AS $filename}
|
||||
<li><a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}">{$filename}</a>
|
||||
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}&delete=1"><img src="../img/admin/delete.gif" /></a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
<label class="clear">{l s='What kind of entity would you like to import?'} </label>
|
||||
<div class="margin-form">
|
||||
<select name="entity" id="entity">
|
||||
{foreach $entities AS $entity => $i}
|
||||
<option value="{$i}" {if $entity == $i}selected="selected"{/if}>
|
||||
<option value="{$i}"{if $entity_selected == $i} selected="selected"{/if}>
|
||||
{$entity}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="clear">{l s='Language of the file'}</label>
|
||||
<div class="margin-form">
|
||||
<select name="iso_lang">
|
||||
@@ -168,26 +120,30 @@
|
||||
</div>
|
||||
<label class="clear">{l s='Field separator'} </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="2" value=";" name="separator"/>
|
||||
<input type="text" size="2" value="{if isset($separator_selected)}{$separator_selected|escape:'htmlall':'UTF-8'}{else};{/if}" name="separator"/>
|
||||
{l s='e.g. '}"1<span class="bold" style="color: red">;</span>Ipod<span class="bold" style="color: red">;</span>129.90<span class="bold" style="color: red">;</span>5"
|
||||
</div>
|
||||
<label class="clear">{l s='Multiple value separator'} </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="2" value="," name="multiple_value_separator"/>
|
||||
<input type="text" size="2" value="{if isset($multiple_value_separator_selected)}{$multiple_value_separator_selected|escape:'htmlall':'UTF-8'}{else},{/if}" name="multiple_value_separator"/>
|
||||
{l s='e.g. '}"Ipod;red.jpg<span class="bold" style="color: red">,</span>blue.jpg<span class="bold" style="color: red">,</span>green.jpg;129.90"
|
||||
</div>
|
||||
<label for="truncate" class="clear">{l s='Delete all'} <span id="entitie">{l s='categories'}</span> {l s='before import?'} </label>
|
||||
<div class="margin-form">
|
||||
<input name="truncate" id="truncate" type="checkbox"/>
|
||||
</div>
|
||||
<label for="match_ref" class="clear" style="display: none">{l s='Use product reference as key?'}</label>
|
||||
<label for="regenerate" class="clear">{l s='No thumbnails regeneration'}</label>
|
||||
<div class="margin-form">
|
||||
<input name="match_ref" id="match_ref" type="checkbox" style="margin-top: 6px; display:none"/>
|
||||
<input name="regenerate" id="regenerate" type="checkbox" />
|
||||
</div>
|
||||
<label for="forceIDs" class="clear">{l s='Force all ID\'s during import?'} </label>
|
||||
<div class="margin-form">
|
||||
<input name="forceIDs" id="forceIDs" type="checkbox"/> {l s='If you don\'t use this option, all ID\'s will be auto-incremented.'}
|
||||
</div>
|
||||
<label for="match_ref" class="clear" style="display: none">{l s='Use product reference as key?'}</label>
|
||||
<div class="margin-form">
|
||||
<input name="match_ref" id="match_ref" type="checkbox" style="margin-top: 6px; display:none"/>
|
||||
</div>
|
||||
<div class="space margin-form">
|
||||
<input type="submit" name="submitImportFile" value="{l s='Next step'}" class="button" {if empty($files_to_import)}disabled{/if}/>
|
||||
{if empty($files_to_import)}<span style="color:red;">{l s='You must upload a file in order to proceed to the next step'}</span>{/if}
|
||||
@@ -210,13 +166,10 @@
|
||||
{/if}
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<fieldset style="display:block;">
|
||||
|
||||
<legend>
|
||||
<img src="../img/admin/import.gif" />{l s='Available fields'}
|
||||
</legend>
|
||||
|
||||
<div id="availableFields">
|
||||
{$available_fields}
|
||||
</div>
|
||||
@@ -224,74 +177,93 @@
|
||||
<div class="clear">
|
||||
<br /><br />{l s='* Required field'}
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<div class="clear"> </div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("select#entity").change( function() {
|
||||
|
||||
if ($("#entity > option:selected").val() == 7 || $("#entity > option:selected").val() == 8)
|
||||
{
|
||||
$("label[for=truncate],#truncate").hide();
|
||||
}
|
||||
else
|
||||
$("label[for=truncate],#truncate").show();
|
||||
|
||||
|
||||
if ($("#entity > option:selected").val() == 8)
|
||||
{
|
||||
$(".import_supply_orders_details").show();
|
||||
$('input[name=multiple_value_separator]').val('|');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".import_supply_orders_details").hide();
|
||||
$('input[name=multiple_value_separator]').val(',');
|
||||
}
|
||||
|
||||
|
||||
if ($("#entity > option:selected").val() == 1)
|
||||
{
|
||||
$("label[for=match_ref],#match_ref").show();
|
||||
}
|
||||
else
|
||||
$("label[for=match_ref],#match_ref").hide();
|
||||
|
||||
if ($("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 0)
|
||||
{
|
||||
$(".import_products_categories").show();
|
||||
}
|
||||
else
|
||||
$(".import_products_categories").hide();
|
||||
|
||||
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 3 || $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6)
|
||||
$("label[for=forceIDs],#forceIDs").show();
|
||||
else
|
||||
$("label[for=forceIDs],#forceIDs").hide();
|
||||
|
||||
$("#entitie").html($("#entity > option:selected").text().toLowerCase());
|
||||
$.ajax({
|
||||
url: 'ajax.php',
|
||||
data: {
|
||||
getAvailableFields:1,
|
||||
entity: $("#entity").val()
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(j) {
|
||||
var fields = "";
|
||||
$("#availableFields").empty();
|
||||
|
||||
for (var i = 0; i < j.length; i++)
|
||||
fields += j[i].field;
|
||||
|
||||
$("#availableFields").html(fields);
|
||||
activeClueTip();
|
||||
},
|
||||
error: function(j) {
|
||||
}
|
||||
$(document).ready(function(){
|
||||
var truncateAuthorized = {$truncateAuthorized|intval};
|
||||
activeClueTip();
|
||||
$("a#upload_file_import_link").fancybox({
|
||||
'titleShow' : false,
|
||||
'transitionIn' : 'elastic',
|
||||
'transitionOut' : 'elastic'
|
||||
});
|
||||
|
||||
$('#preview_import').submit(function(e){
|
||||
if ($('#truncate').get(0).checked)
|
||||
if (truncateAuthorized)
|
||||
{
|
||||
if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '?'))
|
||||
e.preventDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
jAlert('{l s='You do not have permission to delete here. When the multistore is enabled, only a SuperAdmin can delete all items before an import.' js=1}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("select#entity").change(function(){
|
||||
if ($("#entity > option:selected").val() == 8 || $("#entity > option:selected").val() == 9)
|
||||
$("label[for=truncate],#truncate").hide();
|
||||
else
|
||||
$("label[for=truncate],#truncate").show();
|
||||
|
||||
if ($("#entity > option:selected").val() == 9)
|
||||
$(".import_supply_orders_details").show();
|
||||
else
|
||||
{
|
||||
$(".import_supply_orders_details").hide();
|
||||
$('input[name=multiple_value_separator]').val('{if isset($multiple_value_separator_selected)}{$multiple_value_separator_selected}{else},{/if}');
|
||||
}
|
||||
if ($("#entity > option:selected").val() == 1)
|
||||
$("label[for=match_ref], #match_ref").show();
|
||||
else
|
||||
$("label[for=match_ref], #match_ref").hide();
|
||||
|
||||
if ($("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 0)
|
||||
$(".import_products_categories").show();
|
||||
else
|
||||
$(".import_products_categories").hide();
|
||||
|
||||
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 ||
|
||||
$("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6)
|
||||
$("label[for=regenerate], #regenerate").show()
|
||||
else
|
||||
$("label[for=regenerate], #regenerate").hide();
|
||||
|
||||
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 3 || $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6 || $("#entity > option:selected").val() == 7)
|
||||
$("label[for=forceIDs], #forceIDs").show();
|
||||
else
|
||||
$("label[for=forceIDs], #forceIDs").hide();
|
||||
$("#entitie").html($("#entity > option:selected").text().toLowerCase());
|
||||
$.ajax({
|
||||
url: 'ajax.php',
|
||||
data: {
|
||||
getAvailableFields:1,
|
||||
entity: $("#entity").val()
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(j){
|
||||
var fields = "";
|
||||
$("#availableFields").empty();
|
||||
|
||||
for (var i = 0; i < j.length; i++)
|
||||
fields += j[i].field;
|
||||
|
||||
$("#availableFields").html(fields);
|
||||
activeClueTip();
|
||||
},
|
||||
error: function(j){}
|
||||
});
|
||||
});
|
||||
$("select#entity").trigger('change');
|
||||
function activeClueTip()
|
||||
{
|
||||
$('.info_import').cluetip({
|
||||
splitTitle: '|',
|
||||
showTitle: false
|
||||
});
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -22,20 +22,52 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{extends file="helpers/view/view.tpl"}
|
||||
|
||||
{block name="override_tpl"}
|
||||
<script type="text/javascript">
|
||||
var errorEmpty = "{l s='Please name your matching configuration to save.'}"
|
||||
var errorEmpty = '{l s='Please name your matching configuration to save.' js=1}';
|
||||
var token = '{$token}';
|
||||
var current = 0;
|
||||
function showTable(nb)
|
||||
{
|
||||
$('#btn_left').disabled = null;
|
||||
$('#btn_right').disabled = null;
|
||||
if (nb <= 0)
|
||||
{
|
||||
nb = 0;
|
||||
$('#btn_left').disabled = 'true';
|
||||
}
|
||||
if (nb >= {$nb_table} - 1)
|
||||
{
|
||||
nb = {$nb_table} - 1;
|
||||
$('#btn_right').disabled = 'true';
|
||||
}
|
||||
$('#table' + current).hide();
|
||||
current = nb;
|
||||
$('#table' + current).show();
|
||||
}
|
||||
$(document).ready(function(){
|
||||
var btn_save_import = $('span[class~="process-icon-save-import"]').parent();
|
||||
var btn_submit_import = $('#import');
|
||||
if (btn_save_import.length > 0 && btn_submit_import.length > 0)
|
||||
{
|
||||
btn_submit_import.hide();
|
||||
btn_save_import.find('span').removeClass('process-icon-save-import');
|
||||
btn_save_import.find('span').addClass('process-icon-save');
|
||||
btn_save_import.click(function(){
|
||||
btn_submit_import.before('<input type="hidden" name="' + btn_submit_import.attr("name") + '" value="1" />');
|
||||
$('#import_form').submit();
|
||||
});
|
||||
}
|
||||
showTable(current);
|
||||
});
|
||||
</script>
|
||||
<div id="container-customer">
|
||||
<h2>{l s='View your data'}</h2>
|
||||
<div>
|
||||
<b>{l s='Save and load your configuration for importing files'} : </b><br><br>
|
||||
<input type="text" name="newImportMatchs" id="newImportMatchs">
|
||||
<a id="saveImportMatchs" class="button" href="#">{l s='Save'}</a><br><br>
|
||||
<b>{l s='Save and load your configuration for importing files'} : </b><br/><br/>
|
||||
<input type="text" name="newImportMatchs" id="newImportMatchs" />
|
||||
<a id="saveImportMatchs" class="button" href="#">{l s='Save'}</a><br /><br />
|
||||
<div id="selectDivImportMatchs" {if !$import_matchs}style="display:none"{/if}>
|
||||
<select id="valueImportMatchs">
|
||||
{foreach $import_matchs as $match}
|
||||
@@ -46,21 +78,18 @@
|
||||
<a class="button" id="deleteImportMatchs" href="#">{l s='Delete'}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>{l s='Please set the value type of each column'}</h3>
|
||||
|
||||
<div id="error_duplicate_type" class="warning warn" style="display:none;">
|
||||
<h3>{l s='Columns cannot have the same value type'}</h3>
|
||||
</div>
|
||||
|
||||
<div id="required_column" class="warning warn" style="display:none;">
|
||||
<h3>{l s='Column'} <span id="missing_column"> </span> {l s='must be set'}</h3>
|
||||
</div>
|
||||
|
||||
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form">
|
||||
{l s='Skip'} <input type="text" size="2" name="skip" value="1" /> {l s='lines'}
|
||||
<input type="hidden" name="csv" value="{$fields_value.csv}" />
|
||||
<input type="hidden" name="convert" value="{$fields_value.convert}" />
|
||||
<input type="hidden" name="regenerate" value="{$fields_value.regenerate}" />
|
||||
<input type="hidden" name="entity" value="{$fields_value.entity}" />
|
||||
<input type="hidden" name="iso_lang" value="{$fields_value.iso_lang}" />
|
||||
{if $fields_value.truncate}
|
||||
@@ -72,49 +101,8 @@
|
||||
{if $fields_value.match_ref}
|
||||
<input type="hidden" name="match_ref" value="1" />
|
||||
{/if}
|
||||
<input type="hidden" name="separator" value="{$fields_value.separator}">
|
||||
<input type="hidden" name="multiple_value_separator" value="{$fields_value.multiple_value_separator}">
|
||||
<script type="text/javascript">
|
||||
var current = 0;
|
||||
|
||||
function showTable(nb)
|
||||
{
|
||||
getE('btn_left').disabled = null;
|
||||
getE('btn_right').disabled = null;
|
||||
if (nb <= 0)
|
||||
{
|
||||
nb = 0;
|
||||
getE('btn_left').disabled = 'true';
|
||||
}
|
||||
if (nb >= {$nb_table} - 1)
|
||||
{
|
||||
nb = {$nb_table} - 1;
|
||||
getE('btn_right').disabled = 'true';
|
||||
}
|
||||
toggle(getE('table'+current), false);
|
||||
current = nb;
|
||||
toggle(getE('table'+current), true);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var btn_save_import = $('span[class~="process-icon-save-import"]').parent();
|
||||
var btn_submit_import = $('#import');
|
||||
|
||||
if (btn_save_import.length > 0 && btn_submit_import.length > 0)
|
||||
{
|
||||
btn_submit_import.hide();
|
||||
btn_save_import.find('span').removeClass('process-icon-save-import');
|
||||
btn_save_import.find('span').addClass('process-icon-save');
|
||||
btn_save_import.click(function() {
|
||||
btn_submit_import.before('<input type="hidden" name="'+btn_submit_import.attr("name")+'" value="1" />');
|
||||
|
||||
$('#import_form').submit();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<input type="hidden" name="separator" value="{$fields_value.separator}" />
|
||||
<input type="hidden" name="multiple_value_separator" value="{$fields_value.multiple_value_separator}" />
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="3" align="center">
|
||||
@@ -123,7 +111,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" align="center">
|
||||
<input id="btn_left" value="{l s='<<'}" type="button" class="button" onclick="showTable(current - 1)" />
|
||||
<input id="btn_left" value="{l s='<<'}" type="button" class="button" onclick="showTable(current - 1);" />
|
||||
</td>
|
||||
<td align="left">
|
||||
{section name=nb_i start=0 loop=$nb_table step=1}
|
||||
@@ -132,12 +120,10 @@
|
||||
{/section}
|
||||
</td>
|
||||
<td valign="top" align="center">
|
||||
<input id="btn_right" value="{l s='>>'}" type="button" class="button" onclick="showTable(current + 1)" />
|
||||
<input id="btn_right" value="{l s='>>'}" type="button" class="button" onclick="showTable(current + 1);" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">showTable(current);</script>
|
||||
</form>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
*}
|
||||
|
||||
<div class="width4">
|
||||
{$localization_form}
|
||||
{if isset($localization_form)}{$localization_form}{/if}
|
||||
</div>
|
||||
<br />
|
||||
<div class="width4">
|
||||
{$localization_options}
|
||||
{if isset($localization_options)}{$localization_options}{/if}
|
||||
</div>
|
||||
@@ -59,14 +59,14 @@
|
||||
<td>{$module->categoryName}</td>
|
||||
<td>
|
||||
<select name="i_{$module->name}" class="moduleFavorite" style="width:50px">
|
||||
<option value="" selected="selected">---</option>
|
||||
<option value="" selected="selected">-</option>
|
||||
<option value="1" {if isset($module->preferences.interest) && $module->preferences.interest eq '1'}selected="selected"{/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if isset($module->preferences.interest) && $module->preferences.interest eq '0'}selected="selected"{/if}>{l s='No'}</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="f_{$module->name}" class="moduleFavorite" style="width:50px">
|
||||
<option value="" selected="selected">---</option>
|
||||
<option value="" selected="selected">-</option>
|
||||
<option value="1" {if isset($module->preferences.favorite) && $module->preferences.favorite eq '1'}selected="selected"{/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if isset($module->preferences.favorite) && $module->preferences.favorite eq '0'}selected="selected"{/if}>{l s='No'}</option>
|
||||
</select>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript" src="../js/jquery/plugins/jquery.uitablefilter.js"></script>
|
||||
{if $add_permission eq '1'}
|
||||
{if isset($logged_on_addons)}
|
||||
<!--start addons login-->
|
||||
@@ -62,10 +62,7 @@
|
||||
<!--start filter module-->
|
||||
<style>.ac_results { border:1px solid #C2C4D9; }</style>
|
||||
<div class="filter-module">
|
||||
<form id="filternameForm" method="post">
|
||||
<input type="text" value="" name="filtername" autocomplete="off" class="ac_input">
|
||||
<input type="submit" class="button" value="{l s='Search'}">
|
||||
</form>
|
||||
<input style="float: left; margin-right: 15px" placeholder="{l s='Search'}" type="text" value="" name="quicksearch" autocomplete="off" onkeyup="$.uiTableFilter($('#moduleContainer').find('table'), this.value);">
|
||||
<form method="post">
|
||||
<div class="select-filter">
|
||||
<label class="search-filter">{l s='Sort by'}:</label>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
});
|
||||
|
||||
// Method to check / uncheck all modules checkbox
|
||||
$('#checkme').click(function()
|
||||
$('#moduleContainer').on("click", "#checkme", function()
|
||||
{
|
||||
if ($(this).attr("rel") == 'false')
|
||||
{
|
||||
@@ -321,8 +321,8 @@
|
||||
catch(e){}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.toggle_favorite').live('click', function(event)
|
||||
|
||||
$('#moduleContainer').on("click", ".toggle_favorite", function()
|
||||
{
|
||||
var el = $(this);
|
||||
var value_pref = el.data('value');
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
</td>
|
||||
<td><img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}"></td>
|
||||
<td>
|
||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
||||
<h3>{$module->displayName}
|
||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}" title="{$module->name}">
|
||||
<h3>{$module->displayName}<span style="display:none">{$module->name}</span>
|
||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||
<span class="setup must-have">{l s='Must Have'}</span>
|
||||
{else}
|
||||
@@ -77,7 +77,7 @@
|
||||
</dl>
|
||||
</div>
|
||||
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}</p>
|
||||
{if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="conf">{$module->message}</div>{/if}
|
||||
{if isset($module->message) && (empty($module->name) === false) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="conf">{$module->message}</div>{/if}
|
||||
<div class="row-actions-module">
|
||||
{if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
@@ -101,7 +101,7 @@
|
||||
<a href="{$module->addons_buy_url}" target="_blank" class="button updated"><span><img src="../img/admin/cart_addons.png"> {if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}</span></a>
|
||||
</li>
|
||||
{else}
|
||||
{if $module->id && isset($module->version_addons) && $module->version_addons}
|
||||
{if isset($module->version_addons) && $module->version_addons}
|
||||
<li><a href="{$module->options.update_url}" class="button updated"><span>{l s='Update it!'}</span></a></li>
|
||||
{/if}
|
||||
<li>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<td valign="top">
|
||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
||||
<h3>
|
||||
<span style="display:none">{$module->name}</span>
|
||||
{$module->displayName|truncate:36:'…'} {$module->version}
|
||||
{if isset($module->id) && $module->id gt 0 }
|
||||
{if $module->active}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
{l s='Show'} :
|
||||
<select id="show_modules" onChange="autoUrl('show_modules', '{$url_show_modules}')">
|
||||
<option value="all">{l s='All modules'} </option>
|
||||
<option>---------------</option>
|
||||
<option>-</option>
|
||||
|
||||
{foreach $modules as $module}
|
||||
<option value="{$module->id|intval}" {if $display_key == $module->id}selected="selected"{/if}>{$module->displayName}</option>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{* Generate HTML code for printing Invoice Icon with link *}
|
||||
<span style="width:20px; margin-right:5px;">
|
||||
{if ($order_state->invoice || $order->invoice_number)}
|
||||
<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>
|
||||
<a 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}
|
||||
-
|
||||
{/if}
|
||||
@@ -35,7 +35,7 @@
|
||||
{* Generate HTML code for printing Delivery Icon with link *}
|
||||
<span style="width:20px;">
|
||||
{if ($order_state->delivery || $order->delivery_number)}
|
||||
<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>
|
||||
<a href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}"><img src="../img/admin/delivery.gif" alt="delivery" /></a>
|
||||
{else}
|
||||
-
|
||||
{/if}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
{if $display_warehouse}<td>{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if}
|
||||
{if $display_warehouse}<td align="center">{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if}
|
||||
{if ($order->hasBeenPaid())}
|
||||
<td align="center" class="productQuantity">
|
||||
{$product['product_quantity_refunded']}
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
var defaults_order_state = new Array();
|
||||
var customization_errors = false;
|
||||
var pic_dir = '{$pic_dir}';
|
||||
var currency_format = 5;
|
||||
var currency_sign = '';
|
||||
var currency_blank = false;
|
||||
var priceDisplayPrecision = 2;
|
||||
|
||||
{foreach from=$defaults_order_state key='module' item='id_order_state'}
|
||||
defaults_order_state['{$module}'] = '{$id_order_state}';
|
||||
{/foreach}
|
||||
@@ -117,7 +122,7 @@
|
||||
$('#vouchers_err').hide();
|
||||
var mytab = new Array();
|
||||
for (var i = 0; i < data.vouchers.length; i++)
|
||||
mytab[mytab.length] = { data: data.vouchers[i], value: data.vouchers[i].name+' - '+data.vouchers[i].description };
|
||||
mytab[mytab.length] = { data: data.vouchers[i], value: data.vouchers[i].name + (data.vouchers[i].code.length > 0 ? ' - ' + data.vouchers[i].code : '')};
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
@@ -505,7 +510,6 @@
|
||||
}
|
||||
displaySummary(res);
|
||||
resetBind();
|
||||
updateCurrencySign();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -652,11 +656,12 @@
|
||||
var id_product = Number(this.id_product);
|
||||
var id_product_attribute = Number(this.id_product_attribute);
|
||||
cart_quantity[Number(this.id_product)+'_'+Number(this.id_product_attribute)+'_'+Number(this.id_customization)] = this.cart_quantity;
|
||||
cart_content += '<tr><td><img src="'+this.image_link+'" title="'+this.name+'" /></td><td>'+this.name+'<br />'+this.attributes_small+'</td><td>'+this.reference+'</td><td><input type="text" size="7" rel="'+this.id_product+'_'+this.id_product_attribute+'" class="product_unit_price" value="'+this.price+'" /> <span class="currency_sign"></span></td><td>';
|
||||
cart_content += '<tr><td><img src="'+this.image_link+'" title="'+this.name+'" /></td><td>'+this.name+'<br />'+this.attributes_small+'</td><td>'+this.reference+'</td><td><input type="text" size="7" rel="'+this.id_product+'_'+this.id_product_attribute+'" class="product_unit_price" value="'+this.numeric_price+'" /></td><td>';
|
||||
cart_content += (!this.id_customization ? '<div style="float:left;"><a href="#" class="increaseqty_product" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" ><img src="../img/admin/up.gif" /></a><br /><a href="#" class="decreaseqty_product" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'"><img src="../img/admin/down.gif" /></a></div>' : '');
|
||||
cart_content += (!this.id_customization ? '<div style="float:left;"><input type="text" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" class="cart_quantity" size="2" value="'+this.cart_quantity+'" />' : '');
|
||||
cart_content += (!this.id_customization ? '<a href="#" class="delete_product" rel="delete_'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" ><img src="../img/admin/delete.gif" /></a></div>' : '');
|
||||
cart_content += '</td><td>'+this.total+' <span class="currency_sign"></span></td></tr>';
|
||||
cart_content += '</td><td>' + formatCurrency(this.numeric_total, currency_format, currency_sign, currency_blank) + '</td></tr>';
|
||||
|
||||
if (this.id_customization && this.id_customization != 0)
|
||||
{
|
||||
$.each(this.customized_datas[this.id_product][this.id_product_attribute][id_address_delivery], function() {
|
||||
@@ -694,17 +699,15 @@
|
||||
function updateCartVouchers(vouchers)
|
||||
{
|
||||
var vouchers_html = '';
|
||||
if (vouchers.length > 0)
|
||||
{
|
||||
$.each(vouchers, function() {
|
||||
if (typeof(vouchers) == 'object')
|
||||
$.each(vouchers, function(){
|
||||
vouchers_html += '<tr><td>'+this.name+'</td><td>'+this.description+'</td><td>'+this.value_real+'</td><td><a href="#" class="delete_discount" rel="'+this.id_discount+'"><img src="../img/admin/delete.gif" /></a></td></tr>';
|
||||
});
|
||||
$('#voucher_list').show();
|
||||
}
|
||||
else
|
||||
$('#voucher_list tbody').html($.trim(vouchers_html));
|
||||
if ($('#voucher_list tbody').html().length == 0)
|
||||
$('#voucher_list').hide();
|
||||
|
||||
$('#voucher_list tbody').html(vouchers_html);
|
||||
else
|
||||
$('#voucher_list').show();
|
||||
}
|
||||
|
||||
function updateCartPaymentList(payment_list)
|
||||
@@ -712,8 +715,23 @@
|
||||
$('#payment_list').html(payment_list);
|
||||
}
|
||||
|
||||
function fixPriceFormat(price)
|
||||
{
|
||||
if(price.indexOf(',') > 0 && price.indexOf('.') > 0) // if contains , and .
|
||||
if(price.indexOf(',') < price.indexOf('.')) // if , is before .
|
||||
price = price.replace(',',''); // remove ,
|
||||
price = price.replace(' ',''); // remove any spaces
|
||||
price = price.replace(',','.'); // remove , if price did not cotain both , and .
|
||||
return price;
|
||||
}
|
||||
|
||||
function displaySummary(jsonSummary)
|
||||
{
|
||||
currency_format = jsonSummary.currency.format;
|
||||
currency_sign = jsonSummary.currency.sign;
|
||||
currency_blank = jsonSummary.currency.blank;
|
||||
priceDisplayPrecision = jsonSummary.currency.decimals ? 2 : 0;
|
||||
|
||||
updateCartProducts(jsonSummary.summary.products, jsonSummary.summary.gift_products, jsonSummary.cart.id_address_delivery);
|
||||
updateCartVouchers(jsonSummary.summary.discounts);
|
||||
updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice);
|
||||
@@ -739,20 +757,19 @@
|
||||
$('#free_shipping').removeAttr('checked');
|
||||
|
||||
$('#gift_message').html(jsonSummary.cart.gift_message);
|
||||
if(!changed_shipping_price)
|
||||
$('#shipping_price').html('<b>'+jsonSummary.summary.total_shipping+'</b>');
|
||||
if (!changed_shipping_price)
|
||||
$('#shipping_price').html('<b>' + formatCurrency(parseFloat(jsonSummary.summary.total_shipping), currency_format, currency_sign, currency_blank) + '</b>');
|
||||
shipping_price_selected_carrier = jsonSummary.summary.total_shipping;
|
||||
|
||||
$('#total_vouchers').html(jsonSummary.summary.total_discounts_tax_exc);
|
||||
$('#total_shipping').html(jsonSummary.summary.total_shipping_tax_exc);
|
||||
$('#total_taxes').html(jsonSummary.summary.total_tax);
|
||||
$('#total_without_taxes').html(jsonSummary.summary.total_price_without_tax);
|
||||
$('#total_with_taxes').html(jsonSummary.summary.total_price);
|
||||
$('#total_products').html(jsonSummary.summary.total_products);
|
||||
$('#total_vouchers').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_discounts_tax_exc)), currency_format, currency_sign, currency_blank));
|
||||
$('#total_shipping').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_shipping_tax_exc)), currency_format, currency_sign, currency_blank));
|
||||
$('#total_taxes').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_tax)), currency_format, currency_sign, currency_blank));
|
||||
$('#total_without_taxes').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_price_without_tax)), currency_format, currency_sign, currency_blank));
|
||||
$('#total_with_taxes').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_price)), currency_format, currency_sign, currency_blank));
|
||||
$('#total_products').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_products)), currency_format, currency_sign, currency_blank));
|
||||
id_currency = jsonSummary.cart.id_currency;
|
||||
$('#id_currency option').removeAttr('selected');
|
||||
$('#id_currency option[value="'+id_currency+'"]').attr('selected', true);
|
||||
updateCurrencySign();
|
||||
id_lang = jsonSummary.cart.id_lang;
|
||||
$('#id_lang option').removeAttr('selected');
|
||||
$('#id_lang option[value="'+id_lang+'"]').attr('selected', true);
|
||||
@@ -780,21 +797,21 @@
|
||||
qty: qty,
|
||||
id_customer: id_customer,
|
||||
id_cart: id_cart,
|
||||
},
|
||||
},
|
||||
success : function(res)
|
||||
{
|
||||
displaySummary(res);
|
||||
var errors = '';
|
||||
if(res.errors.length)
|
||||
{
|
||||
$.each(res.errors, function() {
|
||||
errors += this+'<br />';
|
||||
});
|
||||
$('#products_err').show();
|
||||
}
|
||||
else
|
||||
$('#products_err').hide();
|
||||
$('#products_err').html(errors);
|
||||
displaySummary(res);
|
||||
var errors = '';
|
||||
if (res.errors.length)
|
||||
{
|
||||
$.each(res.errors, function() {
|
||||
errors += this + '<br />';
|
||||
});
|
||||
$('#products_err').show();
|
||||
}
|
||||
else
|
||||
$('#products_err').hide();
|
||||
$('#products_err').html(errors);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -890,11 +907,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
function updateCurrencySign()
|
||||
{
|
||||
$('.currency_sign').html(currencies[id_currency]);
|
||||
}
|
||||
|
||||
function sendMailToCustomer()
|
||||
{
|
||||
$.ajax({
|
||||
@@ -927,11 +939,33 @@
|
||||
var addresses_invoice_options = '';
|
||||
var address_invoice_detail = '';
|
||||
var address_delivery_detail = '';
|
||||
var delivery_address_edit_link = '';
|
||||
var invoice_address_edit_link = '';
|
||||
|
||||
$.each(addresses, function() {
|
||||
if (this.id_address == id_address_invoice)
|
||||
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
|
||||
{
|
||||
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city;
|
||||
|
||||
if (this.state != null)
|
||||
address_invoice_detail += ' '+this.state;
|
||||
|
||||
address_invoice_detail += '</br>'+this.country;
|
||||
|
||||
invoice_address_edit_link = "{$link->getAdminLink('AdminAddresses')}&id_address="+this.id_address+"&updateaddress&realedit=1&liteDisplaying=1&submitFormAjax=1#";
|
||||
}
|
||||
|
||||
if(this.id_address == id_address_delivery)
|
||||
address_delivery_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
|
||||
{
|
||||
address_delivery_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city;
|
||||
|
||||
if (this.state != null)
|
||||
address_delivery_detail += ' '+this.state;
|
||||
|
||||
address_delivery_detail += '</br>'+this.country;
|
||||
|
||||
delivery_address_edit_link = "{$link->getAdminLink('AdminAddresses')}&id_address="+this.id_address+"&updateaddress&realedit=1&liteDisplaying=1&submitFormAjax=1#";
|
||||
}
|
||||
|
||||
addresses_delivery_options += '<option value="'+this.id_address+'" '+(this.id_address == id_address_delivery ? 'selected="selected"' : '')+'>'+this.alias+'</option>';
|
||||
addresses_invoice_options += '<option value="'+this.id_address+'" '+(this.id_address == id_address_invoice ? 'selected="selected"' : '')+'>'+this.alias+'</option>';
|
||||
@@ -951,6 +985,8 @@
|
||||
$('#id_address_invoice').html(addresses_invoice_options);
|
||||
$('#address_delivery_detail').html(address_delivery_detail);
|
||||
$('#address_invoice_detail').html(address_invoice_detail);
|
||||
$('#edit_delivery_address').attr('href', delivery_address_edit_link);
|
||||
$('#edit_invoice_address').attr('href', invoice_address_edit_link);
|
||||
}
|
||||
|
||||
function updateAddresses()
|
||||
@@ -986,7 +1022,7 @@
|
||||
<label>{l s='Search customers'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" id="customer" value="" />
|
||||
<p>{l s='Search a customer by tapping the first letters of his/her name'}</p>
|
||||
<p>{l s='Search a customer by typing the first letters of his/her name'}</p>
|
||||
<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>
|
||||
</a>
|
||||
@@ -1001,7 +1037,7 @@
|
||||
<div class="margin-form">
|
||||
<input type="hidden" value="" id="id_cart" name="id_cart" />
|
||||
<input type="text" id="product" value="" />
|
||||
<p>{l s='Search a product by tapping the first letters of his/her name.'}</p>
|
||||
<p>{l s='Search a product by typing the first letters of his/her name.'}</p>
|
||||
</div>
|
||||
<div id="products_found">
|
||||
<div id="product_list">
|
||||
@@ -1161,14 +1197,14 @@
|
||||
<div id="address_delivery">
|
||||
<h3>{l s='Delivery'}</h3>
|
||||
<select id="id_address_delivery" name="id_address_delivery">
|
||||
</select>
|
||||
</select> <a class="fancybox" id="edit_delivery_address" href="#"><img src="../img/admin/edit.gif" /></a>
|
||||
<div id="address_delivery_detail">
|
||||
</div>
|
||||
</div>
|
||||
<div id="address_invoice">
|
||||
<h3>{l s='Invoice'}</h3>
|
||||
<select id="id_address_invoice" name="id_address_invoice">
|
||||
</select>
|
||||
</select> <a class="fancybox" id="edit_invoice_address" href="#"><img src="../img/admin/edit.gif" /></a>
|
||||
<div id="address_invoice_detail">
|
||||
</div>
|
||||
</div>
|
||||
@@ -1186,7 +1222,7 @@
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="shipping_price">{l s='Shipping price'}</label> <span id="shipping_price" name="shipping_price"></span> <span class="currency_sign"></span>
|
||||
<label for="shipping_price">{l s='Shipping price'}</label> <span id="shipping_price" name="shipping_price"></span>
|
||||
</p>
|
||||
<p>
|
||||
<label for="free_shipping">{l s='Free shipping'}</label>
|
||||
@@ -1210,12 +1246,12 @@
|
||||
<div id="send_email_feedback"></div>
|
||||
<div id="cart_summary" style="clear:both;float:left;">
|
||||
<ul>
|
||||
<li><span class="total_cart">{l s='Total products'}</span><span id="total_products"></span><span class="currency_sign"></span></li>
|
||||
<li><span class="total_cart">{l s='Total vouchers'}</span><span id="total_vouchers"></span><span class="currency_sign"></span></li>
|
||||
<li><span class="total_cart">{l s='Total shipping'}</span><span id="total_shipping"></span><span class="currency_sign"></span></li>
|
||||
<li><span class="total_cart">{l s='Total taxes'}</span><span id="total_taxes"></span><span class="currency_sign"></span></li>
|
||||
<li><span class="total_cart">{l s='Total without taxes'}</span><span id="total_without_taxes"></span><span class="currency_sign"></span></li>
|
||||
<li><span class="total_cart">{l s='Total with taxes'}</span><span id="total_with_taxes"></span><span class="currency_sign"></span></li>
|
||||
<li><span class="total_cart">{l s='Total products'}</span><span id="total_products"></span></li>
|
||||
<li><span class="total_cart">{l s='Total vouchers'}</span><span id="total_vouchers"></span></li>
|
||||
<li><span class="total_cart">{l s='Total shipping'}</span><span id="total_shipping"></span></li>
|
||||
<li><span class="total_cart">{l s='Total taxes'}</span><span id="total_taxes"></span></li>
|
||||
<li><span class="total_cart">{l s='Total without taxes'}</span><span id="total_without_taxes"></span></li>
|
||||
<li><span class="total_cart">{l s='Total with taxes'}</span><span id="total_with_taxes"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="order_message_right">
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<div class="bloc-command">
|
||||
<div class="button-command">
|
||||
{if (count($invoices_collection))}
|
||||
<a class="button" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&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}">
|
||||
<img src="../img/admin/charged_ok.gif" alt="{l s='View invoice'}" /> {l s='View invoice'}
|
||||
</a>
|
||||
{else}
|
||||
@@ -73,7 +73,7 @@
|
||||
{/if}
|
||||
|
|
||||
{if (($currentState && $currentState->delivery) || $order->delivery_number)}
|
||||
<a class="button" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&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}">
|
||||
<img src="../img/admin/delivery.gif" alt="{l s='View delivery slip'}" /> {l s='View delivery slip'}
|
||||
</a>
|
||||
{else}
|
||||
@@ -124,10 +124,10 @@
|
||||
<!-- History of status -->
|
||||
<table cellspacing="0" cellpadding="0" class="table history-status" style="width: 100%;">
|
||||
<colgroup>
|
||||
<col width="1%">
|
||||
<col width="">
|
||||
<col width="20%">
|
||||
<col width="20%">
|
||||
<col width="1%"/>
|
||||
<col width=""/>
|
||||
<col width="20%"/>
|
||||
<col width="20%"/>
|
||||
</colgroup>
|
||||
{foreach from=$history item=row key=key}
|
||||
{if ($key == 0)}
|
||||
@@ -153,7 +153,7 @@
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/tab-customers.gif" /> {l s='Customer information'}</legend>
|
||||
<span style="font-weight: bold; font-size: 14px;"><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
|
||||
<span style="font-weight: bold; font-size: 14px;"><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$gender->name|escape:'htmlall':'UTF-8'} {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
|
||||
(<a href="mailto:{$customer->email}">{$customer->email}</a>)<br /><br />
|
||||
{if ($customer->isGuest())}
|
||||
{l s='This order has been placed by a guest.'}
|
||||
@@ -299,12 +299,12 @@
|
||||
<form id="formAddPayment" method="post" action="{$current_index}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
|
||||
<table class="table" width="100%" cellspacing="0" cellpadding="0">
|
||||
<colgroup>
|
||||
<col width="15%">
|
||||
<col width="">
|
||||
<col width="20%">
|
||||
<col width="10%">
|
||||
<col width="10%">
|
||||
<col width="1%">
|
||||
<col width="15%"/>
|
||||
<col width=""/>
|
||||
<col width="20%"/>
|
||||
<col width="10%"/>
|
||||
<col width="10%"/>
|
||||
<col width="1%"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -751,7 +751,7 @@
|
||||
<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}">
|
||||
<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>
|
||||
{foreach from=$orderMessages item=orderMessage}
|
||||
<option value="{$orderMessage['message']|escape:'htmlall':'UTF-8'}">{$orderMessage['name']}</option>
|
||||
{/foreach}
|
||||
@@ -787,8 +787,6 @@
|
||||
</fieldset>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clear"> </div>
|
||||
<br /><br /><a href="{$current_index}&token={$smarty.get.token}"><img src="../img/admin/arrow2.gif" /> {l s='Back to list'}</a><br />
|
||||
{/block}
|
||||
{/block}
|
||||
@@ -41,7 +41,7 @@
|
||||
{/if}
|
||||
{$smarty.block.parent}
|
||||
{if $input.type == 'radio' && $input.name == 'smarty_cache'}
|
||||
<a href="{$current}&token={$token}&empty_smarty_cache=1" class="clear button" href="">{l s='Clear Smarty cache'}</a>
|
||||
<a href="{$current}&token={$token}&empty_smarty_cache=1" class="clear button" href="">{l s='Clear Smarty cache & Autoload cache'}</a>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
@@ -103,11 +103,11 @@
|
||||
<td class="col-left"><label>{l s='Manufacturer:'}</label></td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<select name="id_manufacturer" id="id_manufacturer">
|
||||
<option value="0">-- {l s='Choose (optional)'} --</option>
|
||||
<option value="0">- {l s='Choose (optional)'} -</option>
|
||||
{if $product->id_manufacturer}
|
||||
<option value="{$product->id_manufacturer}" selected="selected">{$product->manufacturer_name}</option>
|
||||
{/if}
|
||||
<option disabled="disabled">----------</option>
|
||||
<option disabled="disabled">-</option>
|
||||
</select>
|
||||
<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'}" />
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<select name="attribute" id="attribute" style="width: 200px;">
|
||||
<option value="0">---</option>
|
||||
<option value="0">-</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
@@ -252,7 +252,7 @@
|
||||
<li style="float: left; width: {$imageWidth}px;">
|
||||
<input type="checkbox" name="id_image_attr[]" value="{$image.id_image}" id="id_image_attr_{$image.id_image}" />
|
||||
<label for="id_image_attr_{$image.id_image}" style="float: none;">
|
||||
<img src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-small_default.jpg" alt="{$image.legend|escape:'htmlall':'UTF-8'}" title="{$image.legend|escape:'htmlall':'UTF-8'}" />
|
||||
<img src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-{$imageType}.jpg" alt="{$image.legend|escape:'htmlall':'UTF-8'}" title="{$image.legend|escape:'htmlall':'UTF-8'}" />
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
|
||||
@@ -29,6 +29,19 @@
|
||||
<h4>{if isset($id_image)}{l s='Edit this product image'}{else}{l s='Add a new image to this product'}{/if}</h4> <div class="separation"></div><br />
|
||||
|
||||
<table cellpadding="5" style="width:100%">
|
||||
<tr>
|
||||
<td class="col-left">
|
||||
<label>{l s='Legend:'}</label>
|
||||
</td>
|
||||
<td style="padding-bottom:5px;" class="translatable">
|
||||
{foreach from=$languages item=language}
|
||||
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;">
|
||||
<input class="updateCurrentText" size="43" type="text" {if !$product->id}disabled="disabled"{/if} id="legend_{$language.id_lang}" name="legend_{$language.id_lang}" value="{$product->name[$language.id_lang]|escape:'htmlall':'UTF-8'}"/>
|
||||
<span class="hint" name="help_box">{l s='Invalid characters:'} <>;=#{}<span class="hint-pointer"> </span></span>
|
||||
</div>
|
||||
{/foreach}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left"><label class="file_upload_label">{l s='File:'}</label></td>
|
||||
<td style="padding-bottom:5px;">
|
||||
@@ -57,6 +70,7 @@
|
||||
<thead>
|
||||
<tr class="nodrag nodrop">
|
||||
<th style="width: 100px;">{l s='Image'}</th>
|
||||
<th>{l s='Legend'}</th>
|
||||
<th>{l s='Position'}</th>
|
||||
{if $shops}
|
||||
{foreach from=$shops item=shop}
|
||||
@@ -78,9 +92,10 @@
|
||||
<tr id="image_id">
|
||||
<td style="padding: 4px;">
|
||||
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
|
||||
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-small_default.jpg" alt="image_id" title="image_id" />
|
||||
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-{$imageType}.jpg" alt="legend" title="legend" />
|
||||
</a>
|
||||
</td>
|
||||
<td>legend</td>
|
||||
<td id="td_image_id" class="pointer dragHandle center positionImage">
|
||||
image_position
|
||||
</td>
|
||||
@@ -101,7 +116,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var upbutton = '{l s='Upload an image'}';
|
||||
var token = '{$token}';
|
||||
@@ -128,7 +142,7 @@
|
||||
}
|
||||
else
|
||||
assoc = false;
|
||||
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}enabled{else}forbbiden{/if}", assoc);
|
||||
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}enabled{else}forbbiden{/if}", assoc, "{$image->legend[$default_language]|@addcslashes:'\"'}");
|
||||
{/foreach}
|
||||
{literal}
|
||||
$("#imageTable").tableDnD(
|
||||
@@ -147,20 +161,20 @@
|
||||
updateImagePosition(image_up);
|
||||
}
|
||||
});
|
||||
|
||||
var filecheck = 1;
|
||||
var uploader = new qq.FileUploader(
|
||||
var params = new Array;
|
||||
params['id_product'] = {/literal}{$id_product|intval}{literal};
|
||||
params['id_category'] = {/literal}{$id_category_default|intval}{literal};
|
||||
params['token'] = "{/literal}{$token}{literal}";
|
||||
params['tab'] = "AdminProducts";
|
||||
params['action'] = "addImage";
|
||||
params['ajax'] = 1;
|
||||
uploader = new qq.FileUploader(
|
||||
{
|
||||
element: document.getElementById("file-uploader"),
|
||||
action: "ajax-tab.php",
|
||||
debug: false,
|
||||
params: {
|
||||
id_product : {/literal}{$id_product}{literal},
|
||||
id_category : {/literal}{$id_category_default}{literal},
|
||||
token : "{/literal}{$token}{literal}",
|
||||
tab : "AdminProducts",
|
||||
action : 'addImage',
|
||||
ajax: 1
|
||||
},
|
||||
onComplete: function(id, fileName, responseJSON)
|
||||
{
|
||||
var percent = ((filecheck * 100) / nbfile);
|
||||
@@ -185,7 +199,7 @@
|
||||
cover = "forbbiden";
|
||||
if (responseJSON.cover == "1")
|
||||
cover = "enabled";
|
||||
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops)
|
||||
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops, responseJSON.legend[{/literal}{$default_language|intval}{literal}])
|
||||
$("#imageTable tr:last").after(responseJSON.html);
|
||||
$("#countImage").html(parseInt($("#countImage").html()) + 1);
|
||||
$("#img" + id).remove();
|
||||
@@ -198,6 +212,12 @@
|
||||
},
|
||||
onSubmit: function(id, filename)
|
||||
{
|
||||
$('input[id^="legend_"]').each(function()
|
||||
{
|
||||
id = $(this).prop("id").replace("legend_", "legend[") + "]";
|
||||
params[id] = $(this).val();
|
||||
});
|
||||
uploader.setParams(params);
|
||||
$("#imageTable").show();
|
||||
$("#listImage").append("<li id='img"+id+"'><div class=\"float\" >" + filename + "</div></div><a style=\"margin-left:10px\"href=\"javascript:delQueue(" + id +");\"><img src=\"../img/admin/disabled.gif\" alt=\"\" border=\"0\"></a><p class=\"errorImg\"></p></li>");
|
||||
}
|
||||
@@ -309,13 +329,14 @@
|
||||
$("#img" + id).remove();
|
||||
}
|
||||
|
||||
function imageLine(id, path, position, cover, shops)
|
||||
function imageLine(id, path, position, cover, shops, legend)
|
||||
{
|
||||
line = $("#lineType").html();
|
||||
line = line.replace(/image_id/g, id);
|
||||
line = line.replace(/[a-z]{2}-default/g, path);
|
||||
line = line.replace(/[a-z]{0,2}-default/g, path);
|
||||
line = line.replace(/image_path/g, path);
|
||||
line = line.replace(/image_position/g, position);
|
||||
line = line.replace(/legend/g, legend);
|
||||
line = line.replace(/blank/g, cover);
|
||||
line = line.replace(/<tbody>/gi, "");
|
||||
line = line.replace(/<\/tbody>/gi, "");
|
||||
@@ -330,7 +351,6 @@
|
||||
|
||||
$("#imageList").append(line);
|
||||
}
|
||||
|
||||
$('.fancybox').fancybox();
|
||||
});
|
||||
{/literal}
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
</tr>
|
||||
<tr class="redirect_product_options" style="display:none">
|
||||
<td class="col-left">
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="redirect_type" type="radio" onclick=""}
|
||||
<label class="text">{l s='Redirect:'}</label>
|
||||
</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
@@ -184,7 +184,7 @@
|
||||
</tr>
|
||||
<tr class="redirect_product_options redirect_product_options_product_choise" style="display:none">
|
||||
<td class="col-left">
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="id_product_redirected" type="radio" onclick=""}
|
||||
<label class="text">{l s='Related product:'}</label>
|
||||
</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
@@ -375,8 +375,19 @@
|
||||
<td style="padding-bottom:5px;" class="translatable">
|
||||
{foreach from=$languages item=language}
|
||||
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if}float: left;">
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var input_id = '{/literal}tags_{$language.id_lang}{literal}';
|
||||
$('#'+input_id).tagify({delimiters: [13,44], addTagPrompt: '{/literal}{l s='Add tag' js=1}{literal}'});
|
||||
$({/literal}'#{$table}{literal}_form').submit( function() {
|
||||
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
<input size="55" type="text" id="tags_{$language.id_lang}" name="tags_{$language.id_lang}"
|
||||
value="{$product->getTags($language.id_lang, true)|htmlentitiesUTF8}" />
|
||||
value="{$product->getTags($language.id_lang, true)|htmlentitiesUTF8}" class="tagify" />
|
||||
<span class="hint" name="help_box">{l s='Forbidden characters:'} !<;>;?=+#"°{}_$%<span class="hint-pointer"> </span></span>
|
||||
</div>
|
||||
{/foreach}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<input size="30" type="text" id="{$input_name}_{$language.id_lang}"
|
||||
name="{$input_name}_{$language.id_lang}"
|
||||
value="{$input_value[$language.id_lang]|htmlentitiesUTF8|default:''}"
|
||||
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"/>
|
||||
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();" onblur="updateLinkRewrite();"/>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
@@ -178,7 +178,7 @@ $(document).ready(function () {
|
||||
</tr>
|
||||
<tr {if !$ps_use_ecotax} style="display:none;"{/if}>
|
||||
<td class="col-left">
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="ecot" type="default"}
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="ecotax" type="default"}
|
||||
<label>{l s='Eco-tax (tax incl.):'}</label>
|
||||
</td>
|
||||
<td>
|
||||
@@ -223,7 +223,7 @@ $(document).ready(function () {
|
||||
<tr>
|
||||
<td class="col-left"><label><b>{l s='Final retail price:'}</b></label></td>
|
||||
<td>
|
||||
<span {if !$country_display_tax_label}style="display:none"{/if} >
|
||||
<span>
|
||||
{$currency->prefix}<span id="finalPrice" style="font-weight: bold;">0.00</span>{$currency->suffix}<span {if $ps_tax}style="display:none;"{/if}> ({l s='tax incl.'})</span>
|
||||
</span>
|
||||
<span {if $ps_tax}style="display:none;"{/if} >
|
||||
@@ -249,7 +249,7 @@ $(document).ready(function () {
|
||||
<script type="text/javascript">
|
||||
var product_prices = new Array();
|
||||
{foreach from=$combinations item='combination'}
|
||||
product_prices['{$combination.id_product_attribute}'] = '{$combination.price}';
|
||||
product_prices['{$combination.id_product_attribute}'] = '{$combination.price|@addcslashes:'\''}';
|
||||
{/foreach}
|
||||
</script>
|
||||
<div id="add_specific_price" style="display: none;">
|
||||
@@ -375,7 +375,7 @@ $(document).ready(function () {
|
||||
<div class="margin-form">
|
||||
<input type="text" name="sp_reduction" value="0.00" size="11" />
|
||||
<select name="sp_reduction_type">
|
||||
<option selected="selected">---</option>
|
||||
<option selected="selected">-</option>
|
||||
<option value="amount">{l s='Amount'}</option>
|
||||
<option value="percentage">{l s='Percentage'}</option>
|
||||
</select>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<p>{l s='Click "Save and Stay" after changing selected suppliers to display the associated product references.'}</p>
|
||||
<div id="suppliers_accordion" style="margin-top:10px; display:block;">
|
||||
{foreach from=$associated_suppliers item=supplier}
|
||||
<h3 style="margin-bottom:0;"><a href="#">{$supplier->name}</a></h3>
|
||||
<h3 style="margin-bottom:0;"><a href="#">{if isset($supplier->name)}{$supplier->name}{/if}</a></h3>
|
||||
<div style="display:block;">
|
||||
|
||||
<table cellpadding="10" cellspacing="0" class="table">
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
$('#file_missing').hide();
|
||||
$('#virtual_product_name').attr('value', fileName);
|
||||
$("#upload-confirmation .error").remove();
|
||||
$('#upload-confirmation div').find('span').remove();
|
||||
$('#upload-confirmation div').prepend('<span>{l s='The file'} "<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">'+fileName+'</a>" {l s='has successfully been uploaded'}' +
|
||||
'<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" /></span>');
|
||||
$("#upload-confirmation").show();
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{l s='The field `request_uri` is the URL from which the customers come to your website.'}<br />
|
||||
{l s='For example, if the visitor accesses a product page, the URL will be'} "{$uri}music-ipods/1-ipod-nano.html".<br />
|
||||
{l s='This is helpful because you can add tags or tokens in the links pointing to your website.'}
|
||||
{l s='For example, you can post a link "%dindex.php?prestashop" in the forum and get statistics by entering "%prestashop" in the field `request_uri`. '}
|
||||
{l s='For example, you can post a link "%1$sindex.php?prestashop" in the forum and get statistics by entering "%%prestashop" in the field `request_uri`. ' sprintf=[$uri]}
|
||||
{l s='This method is more reliable than the `http_referer`, but there is one disadvantage. If a search engine references a page with your link, then it will be displayed in the search results and you will not only have visitors from the forum, but also those from the search engine.'}
|
||||
</li>
|
||||
<br />
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<label>{l s='Filter by product:'}</label>
|
||||
<div class="margin-left">
|
||||
<select id="selectProduct" name="selectProduct" style="width: 200px;" onfocus="fillProducts();" onchange="updateConversionRate(this.value);">
|
||||
<option value="0" selected="selected">-- {l s='All'} --</option>
|
||||
<option value="0" selected="selected">- {l s='All'} -</option>
|
||||
</select>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="margin-form">
|
||||
<select id="id_category" name="id_category">
|
||||
{foreach from=$categories item='category'}
|
||||
<option value="{$category.id_category}">{$category.name}</option>
|
||||
<option value="{$category.id_category|intval}">({$category.id_category|intval}) {$category.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a class="button bt-icon" href="#" id="add_condition_category">
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
function ajaxStoreStates(id_state_selected)
|
||||
{
|
||||
$.ajax({
|
||||
url: "ajax.php",
|
||||
url: "index.php",
|
||||
cache: false,
|
||||
data: "ajaxStates=1&id_country="+$('#PS_SHOP_COUNTRY_ID').val() + "&id_state=" + $('#PS_SHOP_STATE_ID').val(),
|
||||
data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+$('#PS_SHOP_COUNTRY_ID').val() + "&id_state=" + $('#PS_SHOP_STATE_ID').val(),
|
||||
success: function(html)
|
||||
{
|
||||
if (html == 'false')
|
||||
|
||||
@@ -54,7 +54,7 @@ $(document).ready(function() {
|
||||
</div>
|
||||
|
||||
<div class="margin-form">
|
||||
<input type="submit" id="_form_submit_btn" value="{l s='Save'}" name="submitChangestate" class="button" style="display: none;">
|
||||
<input type="submit" id="{$table}_form_submit_btn" value="{l s='Save'}" name="submitChangestate" class="button" style="display: none;">
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
$("#states-label").hide();
|
||||
} else {
|
||||
$.ajax({
|
||||
url: "ajax.php",
|
||||
url: "index.php",
|
||||
cache: false,
|
||||
data: "ajaxStates=1&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}",
|
||||
data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}",
|
||||
success: function(html){
|
||||
if (html == "false")
|
||||
{
|
||||
@@ -88,10 +88,10 @@
|
||||
{
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax.php',
|
||||
url: 'index.php',
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
data: 'ajaxStates=1&ajaxUpdateTaxRule=1&id_tax_rule='+id_tax_rule,
|
||||
data: 'ajax=1&tab=AdminTaxRulesGroup&token={getAdminToken tab='AdminTaxRulesGroup'}&ajaxStates=1&action=updateTaxRule&id_tax_rule='+id_tax_rule,
|
||||
success: function(data){
|
||||
$('#tax_rule_form').show();
|
||||
$('#id_tax_rule').val(data.id);
|
||||
|
||||
@@ -33,22 +33,22 @@
|
||||
{/if}
|
||||
|
||||
<form method="post" action="{$currentIndex}&{$identifier}&token={$token}&id_tax_rules_group={$id_tax_rules_group}&updatetax_rules_group#{$table}" class="form">
|
||||
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
|
||||
<input type="hidden" id="submitFilter{$list_id}" name="submitFilter{$list_id}" value="0"/>
|
||||
<table class="table_grid">
|
||||
<tr>
|
||||
<td style="vertical-align: bottom;">
|
||||
<span style="float: left;">
|
||||
{if $page > 1}
|
||||
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$table}').value=1"/>
|
||||
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$table}').value={$page - 1}"/>
|
||||
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$list_id}').value=1"/>
|
||||
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$list_id}').value={$page - 1}"/>
|
||||
{/if}
|
||||
{l s='Page'} <b>{$page}</b> / {$total_pages}
|
||||
{if $page < $total_pages}
|
||||
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$table}').value={$page + 1};"/>
|
||||
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$table}').value={$total_pages}"/>
|
||||
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$list_id}').value={$page + 1};"/>
|
||||
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$list_id}').value={$total_pages}"/>
|
||||
{/if}
|
||||
| {l s='Display'}
|
||||
<select name="pagination" onchange="submit()">
|
||||
<select name="{$list_id}_pagination" onchange="submit()">
|
||||
{* Choose number of results per page *}
|
||||
{foreach $pagination AS $value}
|
||||
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
|
||||
@@ -57,7 +57,7 @@
|
||||
/ {$list_total} {l s='result(s)'}
|
||||
</span>
|
||||
<span style="float: right;">
|
||||
<input type="submit" name="submitReset{$table}" value="{l s='Reset'}" class="button" />
|
||||
<input type="submit" name="submitReset{$list_id}" value="{l s='Reset'}" class="button" />
|
||||
</span>
|
||||
<span class="clear"></span>
|
||||
</td>
|
||||
@@ -66,7 +66,7 @@
|
||||
<td>
|
||||
<table
|
||||
{if $table_id} id={$table_id}{/if}
|
||||
class="table {if $table_dnd}tableDnD{/if} {$table}"
|
||||
class="table {if $table_dnd}tableDnD{/if} {$list_id}"
|
||||
cellpadding="0" cellspacing="0"
|
||||
style="width: 100%; margin-bottom:10px;"
|
||||
>
|
||||
@@ -84,7 +84,7 @@
|
||||
<tr class="nodrag nodrop">
|
||||
<th class="center">
|
||||
{if $has_bulk_actions}
|
||||
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$table}Box[]', this.checked)" />
|
||||
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$list_id}Box[]', this.checked)" />
|
||||
{/if}
|
||||
</th>
|
||||
{foreach $fields_display AS $key => $params}
|
||||
|
||||
@@ -34,54 +34,51 @@
|
||||
<title>{$meta_title} - PrestaShop™</title>
|
||||
{if $display_header}
|
||||
<script type="text/javascript">
|
||||
var help_class_name = '{$controller_name}';
|
||||
var iso_user = '{$iso_user}';
|
||||
var country_iso_code = '{$country_iso_code}';
|
||||
var _PS_VERSION_ = '{$smarty.const._PS_VERSION_}';
|
||||
|
||||
var helpboxes = {$help_box};
|
||||
var roundMode = {$round_mode};
|
||||
{if isset($shop_context)}
|
||||
{if $shop_context == Shop::CONTEXT_ALL}
|
||||
var youEditFieldFor = "{l s='A modification of this field will be applied for all shops' slashes=1 }";
|
||||
{elseif $shop_context == Shop::CONTEXT_GROUP}
|
||||
var youEditFieldFor = "{l s='A modification of this field will be applied for all shops of group ' slashes=1 }<b>{$shop_name}</b>";
|
||||
{else}
|
||||
var youEditFieldFor = "{l s='A modification of this field will be applied for the shop ' slashes=1 }<b>{$shop_name}</b>";
|
||||
{/if}
|
||||
{else}
|
||||
var youEditFieldFor = '';
|
||||
{/if}
|
||||
{* Notifications vars *}
|
||||
var autorefresh_notifications = '{$autorefresh_notifications}';
|
||||
var new_order_msg = '{l s='A new order has been placed on your shop.' slashes=1}';
|
||||
var order_number_msg = '{l s='Order number: ' slashes=1}';
|
||||
var total_msg = '{l s='Total: ' slashes=1}';
|
||||
var from_msg = '{l s='From: ' slashes=1}';
|
||||
var see_order_msg = '{l s='View this order' slashes=1}';
|
||||
var new_customer_msg = '{l s='A new customer registered on your shop.' slashes=1}';
|
||||
var customer_name_msg = '{l s='Customer name: ' slashes=1}';
|
||||
var see_customer_msg = '{l s='View this customer' slashes=1}';
|
||||
var new_msg = '{l s='A new message posted on your shop.' slashes=1}';
|
||||
var excerpt_msg = '{l s='Excerpt: ' slashes=1}';
|
||||
var see_msg = '{l s='Read this message' slashes=1}';
|
||||
var token_admin_orders = '{getAdminToken tab='AdminOrders' slashes=1}';
|
||||
var token_admin_customers = '{getAdminToken tab='AdminCustomers' slashes=1}';
|
||||
var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads' slashes=1}';
|
||||
var currentIndex = '{$currentIndex}';
|
||||
var choose_language_translate = "{l s='Choose language' slashes=1 }";
|
||||
var help_class_name = '{$controller_name|@addcslashes:'\''}';
|
||||
var iso_user = '{$iso_user|@addcslashes:'\''}';
|
||||
var country_iso_code = '{$country_iso_code|@addcslashes:'\''}';
|
||||
var _PS_VERSION_ = '{$smarty.const._PS_VERSION_|@addcslashes:'\''}';
|
||||
var helpboxes = {$help_box|intval};
|
||||
var roundMode = {$round_mode|intval};
|
||||
{if isset($shop_context)}
|
||||
{if $shop_context == Shop::CONTEXT_ALL}
|
||||
var youEditFieldFor = '{l s='A modification of this field will be applied for all shops' js=1}';
|
||||
{elseif $shop_context == Shop::CONTEXT_GROUP}
|
||||
var youEditFieldFor = '{l s='A modification of this field will be applied for all shops of group' js=1} <b>{$shop_name|@addcslashes:'\''}</b>';
|
||||
{else}
|
||||
var youEditFieldFor = '{l s='A modification of this field will be applied for the shop' js=1} <b>{$shop_name|@addcslashes:'\''}</b>';
|
||||
{/if}
|
||||
{else}
|
||||
var youEditFieldFor = '';
|
||||
{/if}
|
||||
var autorefresh_notifications = '{$autorefresh_notifications|@addcslashes:'\''}';
|
||||
var new_order_msg = '{l s='A new order has been placed on your shop.' js=1}';
|
||||
var order_number_msg = '{l s='Order number: ' js=1}';
|
||||
var total_msg = '{l s='Total: ' js=1}';
|
||||
var from_msg = '{l s='From: ' js=1}';
|
||||
var see_order_msg = '{l s='View this order' js=1}';
|
||||
var new_customer_msg = '{l s='A new customer registered on your shop.' js=1}';
|
||||
var customer_name_msg = '{l s='Customer name: ' js=1}';
|
||||
var see_customer_msg = '{l s='View this customer' js=1}';
|
||||
var new_msg = '{l s='A new message posted on your shop.' js=1}';
|
||||
var excerpt_msg = '{l s='Excerpt: ' js=1}';
|
||||
var see_msg = '{l s='Read this message' js=1}';
|
||||
var token_admin_orders = '{getAdminToken tab='AdminOrders'}';
|
||||
var token_admin_customers = '{getAdminToken tab='AdminCustomers'}';
|
||||
var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads'}';
|
||||
var currentIndex = '{$currentIndex|@addcslashes:'\''}';
|
||||
var choose_language_translate = '{l s='Choose language' js=1}';
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{if isset($css_files)}
|
||||
{foreach from=$css_files key=css_uri item=media}
|
||||
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
|
||||
{/foreach}
|
||||
{foreach from=$css_files key=css_uri item=media}
|
||||
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if isset($js_files)}
|
||||
{foreach from=$js_files item=js_uri}
|
||||
<script type="text/javascript" src="{$js_uri}"></script>
|
||||
{/foreach}
|
||||
{foreach from=$js_files item=js_uri}
|
||||
<script type="text/javascript" src="{$js_uri}"></script>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_dir}favicon.ico" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$img_dir}favicon.ico" />
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
|
||||
{block name="defaultForm"}
|
||||
<form id="{if isset($fields.form.form.id_form)}{$fields.form.form.id_form|escape:'htmlall':'UTF-8'}{else}{$table}_form{/if}" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
|
||||
<form id="{if isset($fields.form.form.id_form)}{$fields.form.form.id_form|escape:'htmlall':'UTF-8'}{else}{if $table == null}configuration_form{else}{$table}_form{/if}{/if}" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
|
||||
{if $form_id}
|
||||
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
|
||||
{/if}
|
||||
@@ -68,7 +68,7 @@
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var input_id = '{/literal}{if isset($input.id)}{$input.id}_{$language.id_lang}{else}{$input.name}_{$language.id_lang}{/if}{literal}';
|
||||
$('#'+input_id).tagify({addTagPrompt: '{/literal}{l s='Add tag' js=1}{literal}'});
|
||||
$('#'+input_id).tagify({delimiters: [13,44], addTagPrompt: '{/literal}{l s='Add tag' js=1}{literal}'});
|
||||
$({/literal}'#{$table}{literal}_form').submit( function() {
|
||||
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
|
||||
});
|
||||
@@ -97,8 +97,7 @@
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var input_id = '{/literal}{if isset($input.id)}{$input.id}{else}{$input.name}{/if}{literal}';
|
||||
$('#'+input_id).tagify();
|
||||
$('#'+input_id).tagify({addTagPrompt: '{/literal}{l s='Add tag'}{literal}'});
|
||||
$('#'+input_id).tagify({delimiters: [13,44], addTagPrompt: '{/literal}{l s='Add tag'}{literal}'});
|
||||
$({/literal}'#{$table}{literal}_form').submit( function() {
|
||||
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
|
||||
});
|
||||
@@ -168,7 +167,7 @@
|
||||
{/if}
|
||||
>{$option->$input.options.name}</option>
|
||||
{elseif $option == "-"}
|
||||
<option value="">--</option>
|
||||
<option value="">-</option>
|
||||
{else}
|
||||
<option value="{$option[$input.options.id]}"
|
||||
{if isset($input.multiple)}
|
||||
@@ -192,7 +191,7 @@
|
||||
{/if}
|
||||
{elseif $input.type == 'radio'}
|
||||
{foreach $input.values as $value}
|
||||
<input type="radio" name="{$input.name}"id="{$value.id}" value="{$value.value|escape:'htmlall':'UTF-8'}"
|
||||
<input type="radio" name="{$input.name}" id="{$value.id}" value="{$value.value|escape:'htmlall':'UTF-8'}"
|
||||
{if $fields_value[$input.name] == $value.value}checked="checked"{/if}
|
||||
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
|
||||
<label {if isset($input.class)}class="{$input.class}"{/if} for="{$value.id}">
|
||||
@@ -237,7 +236,7 @@
|
||||
{if isset($fields_value[$input.name].image) && $fields_value[$input.name].image}
|
||||
<div id="image">
|
||||
{$fields_value[$input.name].image}
|
||||
<p align="center">{l s='File size'} {$fields_value[$input.name].size}kb</p>
|
||||
<p align="center">{l s='File size'} {$fields_value[$input.name].size}{l s='kb'}</p>
|
||||
<a href="{$current}&{$identifier}={$form_id}&token={$token}&deleteImage=1">
|
||||
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
|
||||
</a>
|
||||
@@ -432,7 +431,8 @@
|
||||
};
|
||||
{/foreach}
|
||||
// we need allowEmployeeFormLang var in ajax request
|
||||
allowEmployeeFormLang = {$allowEmployeeFormLang};
|
||||
allowEmployeeFormLang = {$allowEmployeeFormLang|intval};
|
||||
employee_token = '{getAdminToken tab='AdminEmployees'}';
|
||||
displayFlags(languages, id_language, allowEmployeeFormLang);
|
||||
|
||||
$(document).ready(function() {
|
||||
@@ -454,6 +454,7 @@
|
||||
});
|
||||
|
||||
});
|
||||
state_token = '{getAdminToken tab='AdminStates'}';
|
||||
{block name="script"}{/block}
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
*}
|
||||
{if count($categories) && isset($categories)}
|
||||
<script type="text/javascript">
|
||||
var inputName = '{$categories.input_name}';
|
||||
var inputName = '{$categories.input_name|@addcslashes:'\''}';
|
||||
var use_radio = {if $categories.use_radio}1{else}0{/if};
|
||||
var selectedCat = '{implode value=$categories.selected_cat}';
|
||||
var selectedLabel = '{$categories.trads.selected}';
|
||||
var home = '{$categories.trads.Root.name}';
|
||||
var selectedCat = {$categories.selected_cat|@implode|intval};
|
||||
var selectedLabel = '{$categories.trads.selected|@addcslashes:'\''}';
|
||||
var home = '{$categories.trads.Root.name|@addcslashes:'\''}';
|
||||
var use_radio = {if $categories.use_radio}1{else}0{/if};
|
||||
var use_context = {if isset($categories.use_context)}1{else}0{/if};
|
||||
$(document).ready(function(){
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
{/if}
|
||||
class="{if !$no_link}pointer{/if}
|
||||
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
|
||||
{if isset($params.class)} {$params.class}{/if}
|
||||
{if isset($params.align)} {$params.align}{/if}"
|
||||
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
|
||||
onclick="document.location = '{$current_index}&{$identifier}={$tr.$identifier}{if $view}&view{else}&update{/if}{$table}&token={$token}'">
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
{else}
|
||||
{if $params.type == 'bool'}
|
||||
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$key}">
|
||||
<option value="">--</option>
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
@@ -197,7 +197,7 @@
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.filter_key)}
|
||||
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>--</option>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if $option_display == $params.value || $option_value == $params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
{block name="defaultOptions"}
|
||||
<form action="{$current}&token={$token}"
|
||||
id="{$table}_form"
|
||||
id="{if $table == null}configuration_form{else}{$table}_form{/if}"
|
||||
{if isset($categoryData['name'])} name={$categoryData['name']}{/if}
|
||||
{if isset($categoryData['id'])} id={$categoryData['id']} {/if}
|
||||
method="post"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
{if $k == 'modules-list'}
|
||||
<div id="modules_list_container" style="display:none">
|
||||
<div style="float:right;margin:5px">
|
||||
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
|
||||
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png" /></a>
|
||||
</div>
|
||||
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0" /></div>
|
||||
<div id="modules_list_container_tab" style="display:none;"></div>
|
||||
@@ -87,7 +87,7 @@
|
||||
btn_submit.hide();
|
||||
//bind enter key press to validate form
|
||||
$('#{$table}_form').keypress(function (e) {
|
||||
if (e.which == 13 && e.target.localName != 'textarea')
|
||||
if (e.which == 13 && e.target.localName != 'textarea' && !e.target.hasClass('tagify'))
|
||||
$('#desc-{$table}-save').click();
|
||||
});
|
||||
//submit the form
|
||||
|
||||
@@ -264,13 +264,17 @@ class AddressCore extends ObjectModel
|
||||
if(!isset($id_address) || empty($id_address))
|
||||
return false;
|
||||
|
||||
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT c.`active`
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = a.`id_country`
|
||||
WHERE a.`id_address` = '.(int)$id_address))
|
||||
return false;
|
||||
return ($result['active']);
|
||||
$cache_id = 'Address::isCountryActiveById_'.(int)$id_address;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getvalue('
|
||||
SELECT c.`active`
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = a.`id_country`
|
||||
WHERE a.`id_address` = '.(int)$id_address);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,12 +328,17 @@ class AddressCore extends ObjectModel
|
||||
{
|
||||
if (!$id_customer)
|
||||
return false;
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_address`
|
||||
FROM `'._DB_PREFIX_.'address`
|
||||
WHERE `id_customer` = '.(int)$id_customer.' AND `deleted` = 0'.($active ? ' AND `active` = 1' : '')
|
||||
);
|
||||
$cache_id = 'Address::getFirstCustomerAddressId_'.(int)$id_customer.'-'.(bool)$active;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_address`
|
||||
FROM `'._DB_PREFIX_.'address`
|
||||
WHERE `id_customer` = '.(int)$id_customer.' AND `deleted` = 0'.($active ? ' AND `active` = 1' : '')
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,5 +388,4 @@ class AddressCore extends ObjectModel
|
||||
$query->where('id_warehouse = 0');
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ abstract class AdminTabCore
|
||||
}
|
||||
|
||||
$asso = Shop::getAssoTable($this->table);
|
||||
if ($asso !== false && $assos['type'] == 'shop')
|
||||
if ($asso !== false && $asso['type'] == 'shop')
|
||||
{
|
||||
$filterKey = $asso['type'];
|
||||
$idenfierShop = Shop::getContextListShopID();
|
||||
@@ -1500,7 +1500,7 @@ abstract class AdminTabCore
|
||||
case 'bool':
|
||||
echo '
|
||||
<select name="'.$this->table.'Filter_'.$key.'">
|
||||
<option value="">--</option>
|
||||
<option value="">-</option>
|
||||
<option value="1"'.($value == 1 ? ' selected="selected"' : '').'>'.$this->l('Yes').'</option>
|
||||
<option value="0"'.(($value == 0 && $value != '') ? ' selected="selected"' : '').'>'.$this->l('No').'</option>
|
||||
</select>';
|
||||
@@ -1524,7 +1524,7 @@ abstract class AdminTabCore
|
||||
if (isset($params['filter_key']))
|
||||
{
|
||||
echo '<select onchange="$(\'#submitFilter'.$this->table.'\').focus();$(\'#submitFilter'.$this->table.'\').click();" name="'.$this->table.'Filter_'.$params['filter_key'].'" '.(isset($params['width']) ? 'style="width: '.$params['width'].'px"' : '').'>
|
||||
<option value=""'.(($value == 0 && $value != '') ? ' selected="selected"' : '').'>--</option>';
|
||||
<option value=""'.(($value == 0 && $value != '') ? ' selected="selected"' : '').'>-</option>';
|
||||
if (isset($params['select']) && is_array($params['select']))
|
||||
foreach ($params['select'] as $optionValue => $optionDisplay)
|
||||
{
|
||||
|
||||
@@ -124,5 +124,21 @@ class AliasCore extends ObjectModel
|
||||
{
|
||||
return Configuration::get('PS_ALIAS_FEATURE_ACTIVE');
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is allow to know if a alias exist for AdminImportController
|
||||
* @since 1.5.6.0
|
||||
* @return bool
|
||||
*/
|
||||
public static function aliasExists($id_alias)
|
||||
{
|
||||
$row = Db::getInstance()->getRow('
|
||||
SELECT `id_alias`
|
||||
FROM '._DB_PREFIX_.'alias a
|
||||
WHERE a.`id_alias` = '.(int)$id_alias
|
||||
);
|
||||
|
||||
return isset($row['id_alias']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class AttributeCore extends ObjectModel
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
|
||||
'.Shop::addSqlAssociation('attribute_group', 'ag').'
|
||||
'.Shop::addSqlAssociation('attribute', 'a').'
|
||||
'.($not_null ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL' : '').'
|
||||
'.($not_null ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL AND agl.`id_attribute_group` IS NOT NULL' : '').'
|
||||
ORDER BY agl.`name` ASC, a.`position` ASC
|
||||
');
|
||||
}
|
||||
@@ -343,4 +343,4 @@ class AttributeCore extends ObjectModel
|
||||
|
||||
return (is_numeric($position)) ? $position : -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,15 @@ class Autoload
|
||||
*/
|
||||
public $index = array();
|
||||
|
||||
public $_include_override_path = true;
|
||||
|
||||
protected function __construct()
|
||||
{
|
||||
$this->root_dir = dirname(dirname(__FILE__)).'/';
|
||||
if (file_exists($this->root_dir.Autoload::INDEX_FILE))
|
||||
$this->index = include($this->root_dir.Autoload::INDEX_FILE);
|
||||
else
|
||||
$this->generateIndex();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,9 +84,8 @@ class Autoload
|
||||
if (strpos(strtolower($classname), 'smarty_') === 0)
|
||||
return;
|
||||
|
||||
// regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists
|
||||
if (!isset($this->index[$classname])
|
||||
|| ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
|
||||
// regenerate the class index if the requested file doesn't exists
|
||||
if ((isset($this->index[$classname]) && $this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
|
||||
|| (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core'])))
|
||||
$this->generateIndex();
|
||||
|
||||
@@ -119,36 +122,32 @@ class Autoload
|
||||
{
|
||||
$classes = array_merge(
|
||||
$this->getClassesFromDir('classes/'),
|
||||
$this->getClassesFromDir('override/classes/'),
|
||||
$this->getClassesFromDir('controllers/'),
|
||||
$this->getClassesFromDir('override/controllers/')
|
||||
$this->getClassesFromDir('controllers/')
|
||||
);
|
||||
|
||||
if ($this->_include_override_path)
|
||||
$classes = array_merge(
|
||||
$classes,
|
||||
$this->getClassesFromDir('override/classes/'),
|
||||
$this->getClassesFromDir('override/controllers/')
|
||||
);
|
||||
|
||||
ksort($classes);
|
||||
$content = '<?php return '.var_export($classes, true).'; ?>';
|
||||
|
||||
// Write classes index on disc to cache it
|
||||
$filename = $this->root_dir.Autoload::INDEX_FILE;
|
||||
if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename)))
|
||||
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
|
||||
if ($filename_tmp !== false && file_put_contents($filename_tmp, $content, LOCK_EX) !== false)
|
||||
{
|
||||
header('HTTP/1.1 503 temporarily overloaded');
|
||||
// Cannot use PrestaShopException in this context
|
||||
die('/cache/class_index.php is not writable, please give write permissions (chmod 666) on this file.');
|
||||
if (!rename($filename_tmp, $filename))
|
||||
unlink($filename_tmp);
|
||||
else
|
||||
@chmod($filename, 0666);
|
||||
}
|
||||
// $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die.
|
||||
else
|
||||
{
|
||||
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
|
||||
if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
|
||||
{
|
||||
rename($filename_tmp, $filename);
|
||||
@chmod($filename, 0664);
|
||||
}
|
||||
else
|
||||
{
|
||||
// $filename_tmp couldn't be written. $filename should be there anyway (even if outdated),
|
||||
// no need to die.
|
||||
error_log('Cannot write temporary file '.$filename_tmp);
|
||||
}
|
||||
}
|
||||
error_log('Cannot write temporary file '.$filename_tmp);
|
||||
|
||||
$this->index = $classes;
|
||||
}
|
||||
@@ -192,4 +191,3 @@ class Autoload
|
||||
return isset($this->index[$classname]) ? $this->index[$classname] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class CMSCore extends ObjectModel
|
||||
public $link_rewrite;
|
||||
public $id_cms_category;
|
||||
public $position;
|
||||
public $indexation;
|
||||
public $active;
|
||||
|
||||
/**
|
||||
@@ -46,6 +47,7 @@ class CMSCore extends ObjectModel
|
||||
'fields' => array(
|
||||
'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'position' => array('type' => self::TYPE_INT),
|
||||
'indexation' => array('type' => self::TYPE_BOOL),
|
||||
'active' => array('type' => self::TYPE_BOOL),
|
||||
|
||||
// Lang fields
|
||||
@@ -188,7 +190,7 @@ class CMSCore extends ObjectModel
|
||||
return (Db::getInstance()->getValue($sql));
|
||||
}
|
||||
|
||||
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true)
|
||||
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true, $id_shop = null)
|
||||
{
|
||||
$sql = new DbQuery();
|
||||
$sql->select('*');
|
||||
@@ -196,6 +198,9 @@ class CMSCore extends ObjectModel
|
||||
if ($id_lang)
|
||||
$sql->innerJoin('cms_lang', 'l', 'c.id_cms = l.id_cms AND l.id_lang = '.(int)$id_lang);
|
||||
|
||||
if ($id_shop)
|
||||
$sql->innerJoin('cms_shop', 'cs', 'c.id_cms = cs.id_cms AND cs.id_shop = '.(int)$id_shop);
|
||||
|
||||
if ($active)
|
||||
$sql->where('c.active = 1');
|
||||
|
||||
|
||||
@@ -277,17 +277,20 @@ class CarrierCore extends ObjectModel
|
||||
|
||||
public function getMaxDeliveryPriceByWeight($id_zone)
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_weight').'
|
||||
ORDER BY w.`delimiter2` DESC LIMIT 1';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
if (!isset($result[0]['price']))
|
||||
return false;
|
||||
return $result[0]['price'];
|
||||
$cache_id = 'Carrier::getMaxDeliveryPriceByWeight_'.(int)$this->id.'-'.(int)$id_zone;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_weight').'
|
||||
ORDER BY w.`delimiter2` DESC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,17 +360,20 @@ class CarrierCore extends ObjectModel
|
||||
|
||||
public function getMaxDeliveryPriceByPrice($id_zone)
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_price').'
|
||||
ORDER BY r.`delimiter2` DESC LIMIT 1';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
if (!isset($result[0]['price']))
|
||||
return false;
|
||||
return $result[0]['price'];
|
||||
$cache_id = 'Carrier::getMaxDeliveryPriceByPrice_'.(int)$this->id.'-'.(int)$id_zone;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT d.`price`
|
||||
FROM `'._DB_PREFIX_.'delivery` d
|
||||
INNER JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price`
|
||||
WHERE d.`id_zone` = '.(int)$id_zone.'
|
||||
AND d.`id_carrier` = '.(int)$this->id.'
|
||||
'.Carrier::sqlDeliveryRangeShop('range_price').'
|
||||
ORDER BY r.`delimiter2` DESC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -449,7 +455,13 @@ class CarrierCore extends ObjectModel
|
||||
GROUP BY c.`id_carrier`
|
||||
ORDER BY c.`position` ASC';
|
||||
|
||||
$carriers = Db::getInstance()->executeS($sql);
|
||||
$cache_id = 'Carrier::getCarriers_'.md5($sql);
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$carriers = Db::getInstance()->executeS($sql);
|
||||
Cache::store($cache_id, $carriers);
|
||||
}
|
||||
$carriers = Cache::retrieve($cache_id);
|
||||
|
||||
if (is_array($carriers) && count($carriers))
|
||||
{
|
||||
@@ -775,11 +787,11 @@ class CarrierCore extends ObjectModel
|
||||
if ($delete)
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'delivery`
|
||||
WHERE id_shop = '.(int)$values['id_shop'].'
|
||||
AND id_shop_group='.(int)$values['id_shop_group'].'
|
||||
WHERE '.(is_null($values['id_shop']) ? 'ISNULL(`id_shop`) ' : 'id_shop = '.(int)$values['id_shop']).'
|
||||
AND '.(is_null($values['id_shop_group']) ? 'ISNULL(`id_shop`) ' : 'id_shop_group='.(int)$values['id_shop_group']).'
|
||||
AND id_carrier='.(int)$values['id_carrier'].
|
||||
($values['id_range_price'] !== null ? ' AND id_range_price='.(int)$values['id_range_price'] : '').
|
||||
($values['id_range_weight'] !== null ? ' AND id_range_weight='.(int)$values['id_range_weight'] : '').'
|
||||
($values['id_range_price'] !== null ? ' AND id_range_price='.(int)$values['id_range_price'] : ' AND (ISNULL(`id_range_price`) OR `id_range_price` = 0)').
|
||||
($values['id_range_weight'] !== null ? ' AND id_range_weight='.(int)$values['id_range_weight'] : ' AND (ISNULL(`id_range_weight`) OR `id_range_weight` = 0)').'
|
||||
AND id_zone='.(int)$values['id_zone']
|
||||
);
|
||||
|
||||
@@ -1199,7 +1211,14 @@ class CarrierCore extends ObjectModel
|
||||
$query->where('pc.id_product = '.(int)$product->id);
|
||||
$query->where('pc.id_shop = '.(int)$id_shop);
|
||||
|
||||
$carriers_for_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
$cache_id = 'Carrier::getAvailableCarrierList_'.(int)$product->id.'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$carriers_for_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
Cache::store($cache_id, $carriers_for_product);
|
||||
}
|
||||
$carriers_for_product = Cache::retrieve($cache_id);
|
||||
|
||||
$carrier_list = array();
|
||||
if (!empty($carriers_for_product))
|
||||
{
|
||||
|
||||
117
classes/Cart.php
117
classes/Cart.php
@@ -325,7 +325,7 @@ class CartCore extends ObjectModel
|
||||
if (!CartRule::isFeatureActive() || !$this->id)
|
||||
return array();
|
||||
|
||||
$cache_key = 'Cart::getCartRules'.$this->id.'-'.$filter;
|
||||
$cache_key = 'Cart::getCartRules_'.$this->id.'-'.$filter;
|
||||
if (!Cache::isStored($cache_key))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
@@ -340,6 +340,7 @@ class CartCore extends ObjectModel
|
||||
'.($filter == CartRule::FILTER_ACTION_SHIPPING ? 'AND free_shipping = 1' : '').'
|
||||
'.($filter == CartRule::FILTER_ACTION_GIFT ? 'AND gift_product != 0' : '').'
|
||||
'.($filter == CartRule::FILTER_ACTION_REDUCTION ? 'AND (reduction_percent != 0 OR reduction_amount != 0)' : '')
|
||||
.' ORDER by cr.priority ASC'
|
||||
);
|
||||
Cache::store($cache_key, $result);
|
||||
}
|
||||
@@ -367,12 +368,16 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
if (!CartRule::isFeatureActive())
|
||||
return 0;
|
||||
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'cart_cart_rule`
|
||||
WHERE `id_cart_rule` = '.(int)$id_cart_rule.' AND `id_cart` = '.(int)$this->id
|
||||
);
|
||||
$cache_id = 'Cart::getDiscountsCustomer_'.(int)$this->id.'-'.(int)$id_cart_rule;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'cart_cart_rule`
|
||||
WHERE `id_cart_rule` = '.(int)$id_cart_rule.' AND `id_cart` = '.(int)$this->id);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function getLastProduct()
|
||||
@@ -429,7 +434,7 @@ class CartCore extends ObjectModel
|
||||
product_shop.`available_for_order`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`,
|
||||
stock.`quantity` AS quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, p.`weight`,
|
||||
p.`date_add`, p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category,
|
||||
CONCAT(cp.`id_product`, IFNULL(cp.`id_product_attribute`, 0), IFNULL(cp.`id_address_delivery`, 0)) AS unique_id, cp.id_address_delivery,
|
||||
CONCAT(LPAD(cp.`id_product`, 10, 0), LPAD(IFNULL(cp.`id_product_attribute`, 0), 10, 0), IFNULL(cp.`id_address_delivery`, 0)) AS unique_id, cp.id_address_delivery,
|
||||
product_shop.`wholesale_price`, product_shop.advanced_stock_management, ps.product_supplier_reference supplier_reference');
|
||||
|
||||
// Build FROM
|
||||
@@ -631,14 +636,19 @@ class CartCore extends ObjectModel
|
||||
|
||||
if (!isset($row['pai_id_image']) || $row['pai_id_image'] == 0)
|
||||
{
|
||||
$row2 = Db::getInstance()->getRow('
|
||||
SELECT image_shop.`id_image` id_image, il.`legend`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (i.id_image = image_shop.id_image AND image_shop.cover=1 AND image_shop.id_shop='.(int)$row['id_shop'].')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
|
||||
WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1'
|
||||
);
|
||||
|
||||
$cache_id = 'Cart::getProducts_'.'-pai_id_image-'.(int)$row['id_product'].'-'.(int)$this->id_lang.'-'.(int)$row['id_shop'];
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$row2 = Db::getInstance()->getRow('
|
||||
SELECT image_shop.`id_image` id_image, il.`legend`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (i.id_image = image_shop.id_image AND image_shop.cover=1 AND image_shop.id_shop='.(int)$row['id_shop'].')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
|
||||
WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1'
|
||||
);
|
||||
Cache::store($cache_id, $row2);
|
||||
}
|
||||
$row2 = Cache::retrieve($cache_id);
|
||||
if (!$row2)
|
||||
$row2 = array('id_image' => false, 'legend' => false);
|
||||
else
|
||||
@@ -726,7 +736,7 @@ class CartCore extends ObjectModel
|
||||
*
|
||||
* @result integer Products quantity
|
||||
*/
|
||||
public function nbProducts()
|
||||
public function nbProducts()
|
||||
{
|
||||
if (!$this->id)
|
||||
return 0;
|
||||
@@ -762,10 +772,11 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
// You can't add a cart rule that does not exist
|
||||
$cartRule = new CartRule($id_cart_rule, Context::getContext()->language->id);
|
||||
|
||||
if (!Validate::isLoadedObject($cartRule))
|
||||
return false;
|
||||
|
||||
if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id))
|
||||
if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart_rule = '.(int)$id_cart_rule.' AND id_cart = '.(int)$this->id))
|
||||
return false;
|
||||
|
||||
// Add the cart rule to the cart
|
||||
@@ -1076,9 +1087,9 @@ class CartCore extends ObjectModel
|
||||
);
|
||||
$id_customization = Db::getInstance()->Insert_ID();
|
||||
}
|
||||
|
||||
|
||||
$query = 'INSERT INTO `'._DB_PREFIX_.'customized_data` (`id_customization`, `type`, `index`, `value`)
|
||||
VALUES ('.(int)$id_customization.', '.(int)$type.', '.(int)$index.', \''.pSql($field).'\')';
|
||||
VALUES ('.(int)$id_customization.', '.(int)$type.', '.(int)$index.', \''.pSQL($field).'\')';
|
||||
|
||||
if (!Db::getInstance()->execute($query))
|
||||
return false;
|
||||
@@ -1092,7 +1103,13 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function orderExists()
|
||||
{
|
||||
return (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$this->id);
|
||||
$cache_id = 'Cart::orderExists_'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$this->id);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1259,7 +1276,7 @@ class CartCore extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getTotalCart($id_cart, $use_tax_display = false, $type = CART::BOTH)
|
||||
public static function getTotalCart($id_cart, $use_tax_display = false, $type = Cart::BOTH)
|
||||
{
|
||||
$cart = new Cart($id_cart);
|
||||
if (!Validate::isLoadedObject($cart))
|
||||
@@ -1675,6 +1692,7 @@ class CartCore extends ObjectModel
|
||||
$warehouse_count_by_address[$product['id_address_delivery']][$warehouse['id_warehouse']]++;
|
||||
}
|
||||
}
|
||||
unset($product);
|
||||
|
||||
arsort($warehouse_count_by_address);
|
||||
|
||||
@@ -1692,9 +1710,12 @@ class CartCore extends ObjectModel
|
||||
$id_warehouse = 0;
|
||||
foreach ($warehouse_count_by_address[$product['id_address_delivery']] as $id_war => $val)
|
||||
{
|
||||
$product['carrier_list'] = array_merge($product['carrier_list'], Carrier::getAvailableCarrierList(new Product($product['id_product']), $id_war, $product['id_address_delivery'], null, $this));
|
||||
if (in_array((int)$id_war, $product['warehouse_list']) && $id_warehouse == 0)
|
||||
$id_warehouse = (int)$id_war;
|
||||
if (in_array((int)$id_war, $product['warehouse_list']))
|
||||
{
|
||||
$product['carrier_list'] = array_merge($product['carrier_list'], Carrier::getAvailableCarrierList(new Product($product['id_product']), $id_war, $product['id_address_delivery'], null, $this));
|
||||
if (!$id_warehouse)
|
||||
$id_warehouse = (int)$id_war;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($grouped_by_warehouse[$product['id_address_delivery']]['in_stock'][$id_warehouse]))
|
||||
@@ -1713,6 +1734,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
$grouped_by_warehouse[$product['id_address_delivery']][$key][$id_warehouse][] = $product;
|
||||
}
|
||||
unset($product);
|
||||
|
||||
// Step 3 : grouped product from grouped_by_warehouse by available carriers
|
||||
$grouped_by_carriers = array();
|
||||
@@ -1731,7 +1753,6 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
if (!isset($grouped_by_carriers[$id_address_delivery][$key][$id_warehouse]))
|
||||
$grouped_by_carriers[$id_address_delivery][$key][$id_warehouse] = array();
|
||||
|
||||
foreach ($product_list as $product)
|
||||
{
|
||||
$package_carriers_key = implode(',', $product['carrier_list']);
|
||||
@@ -1796,7 +1817,6 @@ class CartCore extends ObjectModel
|
||||
);
|
||||
$package_list[$id_address_delivery][$key][$id_warehouse][$id_carrier]['carrier_list'] =
|
||||
array_intersect($package_list[$id_address_delivery][$key][$id_warehouse][$id_carrier]['carrier_list'], $data['carrier_list']);
|
||||
|
||||
$package_list[$id_address_delivery][$key][$id_warehouse][$id_carrier]['product_list'] =
|
||||
array_merge($package_list[$id_address_delivery][$key][$id_warehouse][$id_carrier]['product_list'], $data['product_list']);
|
||||
|
||||
@@ -2272,18 +2292,23 @@ class CartCore extends ObjectModel
|
||||
public function getAddressCollection()
|
||||
{
|
||||
$collection = array();
|
||||
$result = Db::getInstance()->executeS(
|
||||
'SELECT DISTINCT `id_address_delivery`
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE id_cart = '.(int)$this->id
|
||||
);
|
||||
$cache_id = 'Cart::getAddressCollection'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS(
|
||||
'SELECT DISTINCT `id_address_delivery`
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE id_cart = '.(int)$this->id
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
$result = Cache::retrieve($cache_id);
|
||||
|
||||
$result[] = array('id_address_delivery' => (int)$this->id_address_delivery);
|
||||
|
||||
foreach ($result as $row)
|
||||
if ((int)$row['id_address_delivery'] != 0)
|
||||
$collection[(int)$row['id_address_delivery']] = new Address((int)$row['id_address_delivery']);
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
@@ -3033,7 +3058,6 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function addTextFieldToProduct($id_product, $index, $type, $text_value)
|
||||
{
|
||||
$text_value = str_replace(array("\n", "\r"), '', nl2br($text_value));
|
||||
if (!_PS_MAGIC_QUOTES_GPC_){
|
||||
$text_value = str_replace('\\', '\\\\', $text_value);
|
||||
$text_value = str_replace('\'', '\\\'', $text_value);
|
||||
@@ -3214,7 +3238,7 @@ class CartCore extends ObjectModel
|
||||
public function getWsCartRows()
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT id_product, id_product_attribute, quantity
|
||||
SELECT id_product, id_product_attribute, quantity, id_address_delivery
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE id_cart = '.(int)$this->id.' AND id_shop = '.(int)Context::getContext()->shop->id
|
||||
);
|
||||
@@ -3415,6 +3439,7 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function setNoMultishipping()
|
||||
{
|
||||
$emptyCache = $result = false;
|
||||
if (Configuration::get('PS_ALLOW_MULTISHIPPING'))
|
||||
{
|
||||
// Upgrading quantities
|
||||
@@ -3433,7 +3458,9 @@ class CartCore extends ObjectModel
|
||||
AND `id_shop` = '.(int)$this->id_shop.'
|
||||
AND id_product = '.$product['id_product'].'
|
||||
AND id_product_attribute = '.$product['id_product_attribute'];
|
||||
Db::getInstance()->execute($sql);
|
||||
$result = Db::getInstance()->execute($sql);
|
||||
if ($result)
|
||||
$emptyCache = true;
|
||||
}
|
||||
|
||||
// Merging multiple lines
|
||||
@@ -3451,15 +3478,22 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
|
||||
// Update delivery address for each product line
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'cart_product`
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
|
||||
SET `id_address_delivery` = (
|
||||
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
|
||||
WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
|
||||
)
|
||||
WHERE `id_cart` = '.(int)$this->id.'
|
||||
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : ''));
|
||||
|
||||
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
|
||||
|
||||
$cache_id = 'Cart::setNoMultishipping'.(int)$this->id.'-'.(int)$this->id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
if ($result = (bool)Db::getInstance()->execute($sql))
|
||||
$emptyCache = true;
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
|
||||
if (Customization::isFeatureActive())
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'customization`
|
||||
@@ -3468,6 +3502,9 @@ class CartCore extends ObjectModel
|
||||
WHERE `id_cart` = '.(int)$this->id.'
|
||||
)
|
||||
WHERE `id_cart` = '.(int)$this->id);
|
||||
|
||||
if ($emptyCache)
|
||||
$this->_products = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -254,6 +254,17 @@ class CartRuleCore extends ObjectModel
|
||||
}
|
||||
else
|
||||
$cart_rule['quantity_for_user'] = 0;
|
||||
unset($cart_rule);
|
||||
|
||||
foreach ($result as $cart_rule)
|
||||
if ($cart_rule['shop_restriction'])
|
||||
{
|
||||
$cartRuleShops = Db::getInstance()->executeS('SELECT id_shop FROM '._DB_PREFIX_.'cart_rule_shop WHERE id_cart_rule = '.(int)$cart_rule['id_cart_rule']);
|
||||
foreach ($cartRuleShops as $cartRuleShop)
|
||||
if (Shop::isFeatureActive() && ($cartRuleShop['id_shop'] == Context::getContext()->shop->id))
|
||||
continue 2;
|
||||
unset($result[$key]);
|
||||
}
|
||||
|
||||
// Retrocompatibility with 1.4 discounts
|
||||
foreach ($result as &$cart_rule)
|
||||
@@ -464,7 +475,7 @@ class CartRuleCore extends ObjectModel
|
||||
// Check if the products chosen by the customer are usable with the cart rule
|
||||
if ($this->product_restriction)
|
||||
{
|
||||
$r = $this->checkProductRestrictions($context, false, $display_error);
|
||||
$r = $this->checkProductRestrictions($context, false, $display_error, $alreadyInCart);
|
||||
if ($r !== false && $display_error)
|
||||
return $r;
|
||||
elseif (!$r && !$display_error)
|
||||
@@ -523,6 +534,7 @@ class CartRuleCore extends ObjectModel
|
||||
return (!$display_error) ? false : Tools::displayError('This voucher is already in your cart');
|
||||
if ($otherCartRule['gift_product'])
|
||||
--$nb_products;
|
||||
|
||||
if ($this->cart_rule_restriction && $otherCartRule['cart_rule_restriction'] && $otherCartRule['id_cart_rule'] != $this->id)
|
||||
{
|
||||
$combinable = Db::getInstance()->getValue('
|
||||
@@ -550,7 +562,7 @@ class CartRuleCore extends ObjectModel
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function checkProductRestrictions(Context $context, $return_products = false, $display_error = true)
|
||||
protected function checkProductRestrictions(Context $context, $return_products = false, $display_error = true, $alreadyInCart = false)
|
||||
{
|
||||
$selectedProducts = array();
|
||||
|
||||
@@ -585,6 +597,8 @@ class CartRuleCore extends ObjectModel
|
||||
if (in_array($cartAttribute['id_attribute'], $productRule['values']))
|
||||
{
|
||||
$countMatchingProducts += $cartAttribute['quantity'];
|
||||
if ($alreadyInCart && $this->gift_product == $cartProduct['id_product']&& $this->gift_product_attribute == $cartProduct['id_product_attribute'])
|
||||
--$countMatchingProducts;
|
||||
$matchingProductsList[] = $cartAttribute['id_product'].'-'.$cartAttribute['id_product_attribute'];
|
||||
}
|
||||
if ($countMatchingProducts < $productRuleGroup['quantity'])
|
||||
@@ -603,6 +617,8 @@ class CartRuleCore extends ObjectModel
|
||||
if (in_array($cartProduct['id_product'], $productRule['values']))
|
||||
{
|
||||
$countMatchingProducts += $cartProduct['quantity'];
|
||||
if ($alreadyInCart && $this->gift_product == $cartProduct['id_product'])
|
||||
--$countMatchingProducts;
|
||||
$matchingProductsList[] = $cartProduct['id_product'].'-0';
|
||||
}
|
||||
if ($countMatchingProducts < $productRuleGroup['quantity'])
|
||||
@@ -1185,7 +1201,7 @@ class CartRuleCore extends ObjectModel
|
||||
SELECT cr.*, crl.*
|
||||
FROM '._DB_PREFIX_.'cart_rule cr
|
||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_lang crl ON (cr.id_cart_rule = crl.id_cart_rule AND crl.id_lang = '.(int)$id_lang.')
|
||||
WHERE code LIKE \'%'.pSQL($name).'%\'
|
||||
WHERE code LIKE \'%'.pSQL($name).'%\' OR name LIKE \'%'.pSQL($name).'%\'
|
||||
');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ class CategoryCore extends ObjectModel
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
|
||||
// Lang fields
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64),
|
||||
'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 64),
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 128),
|
||||
'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128),
|
||||
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||
@@ -666,9 +666,9 @@ class CategoryCore extends ObjectModel
|
||||
* @param boolean $active return only active categories
|
||||
* @return array categories
|
||||
*/
|
||||
public static function getHomeCategories($id_lang, $active = true)
|
||||
public static function getHomeCategories($id_lang, $active = true, $id_shop = false)
|
||||
{
|
||||
return self::getChildren(Configuration::get('PS_HOME_CATEGORY'), $id_lang, $active);
|
||||
return self::getChildren(Configuration::get('PS_HOME_CATEGORY'), $id_lang, $active, $id_shop);
|
||||
}
|
||||
|
||||
public static function getRootCategory($id_lang = null, Shop $shop = null)
|
||||
@@ -704,16 +704,22 @@ class CategoryCore extends ObjectModel
|
||||
if (!Validate::isBool($active))
|
||||
die(Tools::displayError());
|
||||
|
||||
$query = 'SELECT c.`id_category`, cl.`name`, cl.`link_rewrite`, category_shop.`id_shop`
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').')
|
||||
'.Shop::addSqlAssociation('category', 'c').'
|
||||
WHERE `id_lang` = '.(int)$id_lang.'
|
||||
AND c.`id_parent` = '.(int)$id_parent.'
|
||||
'.($active ? 'AND `active` = 1' : '').'
|
||||
GROUP BY c.`id_category`
|
||||
ORDER BY category_shop.`position` ASC';
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
$cache_id = 'Category::getChildren_'.(int)$id_parent.'-'.(int)$id_lang.'-'.(bool)$active.'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$query = 'SELECT c.`id_category`, cl.`name`, cl.`link_rewrite`, category_shop.`id_shop`
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl').')
|
||||
'.Shop::addSqlAssociation('category', 'c').'
|
||||
WHERE `id_lang` = '.(int)$id_lang.'
|
||||
AND c.`id_parent` = '.(int)$id_parent.'
|
||||
'.($active ? 'AND `active` = 1' : '').'
|
||||
GROUP BY c.`id_category`
|
||||
ORDER BY category_shop.`position` ASC';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1008,14 +1014,20 @@ class CategoryCore extends ObjectModel
|
||||
public function getGroups()
|
||||
{
|
||||
$groups = array();
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT cg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group cg
|
||||
WHERE cg.`id_category` = '.(int)$this->id
|
||||
);
|
||||
foreach ($result as $group)
|
||||
$groups[] = $group['id_group'];
|
||||
return $groups;
|
||||
$cache_id = 'Category::getGroups_'.(int)$this->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT cg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group cg
|
||||
WHERE cg.`id_category` = '.(int)$this->id
|
||||
);
|
||||
$groups = array();
|
||||
foreach ($result as $group)
|
||||
$groups[] = $group['id_group'];
|
||||
Cache::store($cache_id, $groups);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function addGroupsIfNoExist($id_group)
|
||||
@@ -1036,24 +1048,23 @@ class CategoryCore extends ObjectModel
|
||||
*/
|
||||
public function checkAccess($id_customer)
|
||||
{
|
||||
if (!$id_customer)
|
||||
$cache_id = 'Category::checkAccess_'.(int)$this->id.'-'.$id_customer.(!$id_customer ? '-'.(int)Group::getCurrent()->id : '');
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
if (!$id_customer)
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group ctg
|
||||
WHERE ctg.`id_category` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id.'
|
||||
');
|
||||
} else {
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
WHERE ctg.`id_category` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id);
|
||||
else
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM '._DB_PREFIX_.'category_group ctg
|
||||
INNER JOIN '._DB_PREFIX_.'customer_group cg on (cg.`id_group` = ctg.`id_group` AND cg.`id_customer` = '.(int)$id_customer.')
|
||||
WHERE ctg.`id_category` = '.(int)$this->id
|
||||
);
|
||||
WHERE ctg.`id_category` = '.(int)$this->id);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
if ($result && isset($result['id_group']) && $result['id_group'])
|
||||
return true;
|
||||
return false;
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1199,12 +1210,16 @@ class CategoryCore extends ObjectModel
|
||||
*/
|
||||
public static function getInterval($id)
|
||||
{
|
||||
$sql = 'SELECT nleft, nright, level_depth
|
||||
FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.(int)$id;
|
||||
if (!$result = Db::getInstance()->getRow($sql))
|
||||
return false;
|
||||
return $result;
|
||||
$cache_id = 'Category::getInterval_'.(int)$id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT nleft, nright, level_depth
|
||||
FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.(int)$id;
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1386,11 +1401,17 @@ class CategoryCore extends ObjectModel
|
||||
|
||||
public static function getCategoriesWithoutParent()
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT DISTINCT c.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE `level_depth` = 1');
|
||||
$cache_id = 'Category::getCategoriesWithoutParent_'.(int)Context::getContext()->language->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT DISTINCT c.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE `level_depth` = 1');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function isRootCategoryForAShop()
|
||||
@@ -1409,12 +1430,17 @@ class CategoryCore extends ObjectModel
|
||||
public static function getTopCategory($id_lang = null)
|
||||
{
|
||||
if (is_null($id_lang))
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
$id_category = Db::getInstance()->getValue('
|
||||
SELECT `id_category`
|
||||
FROM `'._DB_PREFIX_.'category`
|
||||
WHERE `id_parent` = 0');
|
||||
return new Category($id_category, $id_lang);
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
$cache_id = 'Category::getTopCategory_'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$id_category = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_category`
|
||||
FROM `'._DB_PREFIX_.'category`
|
||||
WHERE `id_parent` = 0');
|
||||
Cache::store($cache_id, new Category($id_category, $id_lang));
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
public function addPosition($position, $id_shop = null)
|
||||
|
||||
@@ -58,7 +58,8 @@ class ConfigurationTestCore
|
||||
'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache/',
|
||||
'translations_dir' => 'translations',
|
||||
'customizable_products_dir' => 'upload',
|
||||
'virtual_products_dir' => 'download'
|
||||
'virtual_products_dir' => 'download',
|
||||
'files' => false
|
||||
);
|
||||
}
|
||||
|
||||
@@ -318,4 +319,21 @@ class ConfigurationTestCore
|
||||
{
|
||||
return extension_loaded('Dom');
|
||||
}
|
||||
|
||||
public static function test_files()
|
||||
{
|
||||
$files = array(
|
||||
'/cache/smarty/compile/index.php',
|
||||
'/classes/log/index.php',
|
||||
'/classes/cache/index.php',
|
||||
'/config/index.php',
|
||||
'/tools/tar/Archive_Tar.php',
|
||||
'/tools/pear/PEAR.php',
|
||||
'/index.php'
|
||||
);
|
||||
foreach ($files as $file)
|
||||
if (!file_exists(rtrim(_PS_ROOT_DIR_, DIRECTORY_SEPARATOR).str_replace('/', DIRECTORY_SEPARATOR, $file)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ class ConnectionCore extends ObjectModel
|
||||
'id_connections' => (int)$cookie->id_connections,
|
||||
'id_page' => (int)$id_page,
|
||||
'time_start' => $time_start
|
||||
));
|
||||
), false, true, Db::INSERT_IGNORE);
|
||||
|
||||
// This array is serialized and used by the ajax request to identify the page
|
||||
return array(
|
||||
@@ -114,7 +114,7 @@ class ConnectionCore extends ObjectModel
|
||||
// This is a bot and we have to retrieve its connection ID
|
||||
$sql = 'SELECT `id_connections` FROM `'._DB_PREFIX_.'connections`
|
||||
WHERE ip_address = '.ip2long(Tools::getRemoteAddr()).'
|
||||
AND DATE_ADD(`date_add`, INTERVAL 30 MINUTE) > \''.pSQL(date('Y-m-d H:i:00')).'\'
|
||||
AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
ORDER BY `date_add` DESC';
|
||||
if ($id_connections = Db::getInstance()->getValue($sql))
|
||||
@@ -128,7 +128,7 @@ class ConnectionCore extends ObjectModel
|
||||
$sql = 'SELECT `id_guest`
|
||||
FROM `'._DB_PREFIX_.'connections`
|
||||
WHERE `id_guest` = '.(int)$cookie->id_guest.'
|
||||
AND DATE_ADD(`date_add`, INTERVAL 30 MINUTE) > \''.pSQL(date('Y-m-d H:i:00')).'\'
|
||||
AND `date_add` > \''.pSQL(date('Y-m-d H:i:00', time() - 1800)).'\'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
ORDER BY `date_add` DESC';
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
|
||||
@@ -73,7 +73,7 @@ class CurrencyCore extends ObjectModel
|
||||
'sign' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 8),
|
||||
'format' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'decimals' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
|
||||
'conversion_rate' =>array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true, 'shop' => true),
|
||||
'conversion_rate' =>array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat', 'required' => true, 'shop' => true),
|
||||
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
),
|
||||
@@ -81,6 +81,7 @@ class CurrencyCore extends ObjectModel
|
||||
|
||||
/** @var array Currency cache */
|
||||
static protected $currencies = array();
|
||||
protected static $countActiveCurrencies = array();
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'currencies',
|
||||
@@ -106,14 +107,23 @@ class CurrencyCore extends ObjectModel
|
||||
$this->suffix = $this->format % 2 == 0 ? ' '.$this->sign : '';
|
||||
}
|
||||
/**
|
||||
* Overriding check if currency with the same iso code already exists.
|
||||
* If it's true, currency is doesn't added.
|
||||
* Overriding check if currency rate is not empty and if currency with the same iso code already exists.
|
||||
* If it's true, currency is not added.
|
||||
*
|
||||
* @see ObjectModelCore::add()
|
||||
*/
|
||||
public function add($autodate = true, $nullValues = false)
|
||||
{
|
||||
return Currency::exists($this->iso_code, $this->iso_code_num) ? false : parent::add();
|
||||
if ((float)$this->conversion_rate <= 0)
|
||||
return false;
|
||||
return Currency::exists($this->iso_code, $this->iso_code_num) ? false : parent::add($autodate, $nullValues);
|
||||
}
|
||||
|
||||
public function update($autodate = true, $nullValues = false)
|
||||
{
|
||||
if ((float)$this->conversion_rate <= 0)
|
||||
return false;
|
||||
return parent::update($autodate, $nullValues);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,8 +197,9 @@ class CurrencyCore extends ObjectModel
|
||||
4 => array('left' => '', 'right' => &$formated_strings['right']),
|
||||
5 => array('left' => '', 'right' => &$formated_strings['right'])
|
||||
);
|
||||
|
||||
return ($formats[$this->format][$side]);
|
||||
if (isset($formats[$this->format][$side]))
|
||||
return ($formats[$this->format][$side]);
|
||||
return $this->sign;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,10 +296,16 @@ class CurrencyCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdByIsoCode($iso_code, $id_shop = 0)
|
||||
{
|
||||
$query = Currency::getIdByQuery($id_shop);
|
||||
$query->where('iso_code = \''.pSQL($iso_code).'\'');
|
||||
|
||||
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query->build());
|
||||
$cache_id = 'Currency::getIdByIsoCode_'.pSQL($iso_code).'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$query = Currency::getIdByQuery($id_shop);
|
||||
$query->where('iso_code = \''.pSQL($iso_code).'\'');
|
||||
|
||||
$result = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query->build());
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -414,5 +431,23 @@ class CurrencyCore extends ObjectModel
|
||||
self::$currencies[(int)($id)] = new Currency($id);
|
||||
return self::$currencies[(int)($id)];
|
||||
}
|
||||
}
|
||||
|
||||
public static function countActiveCurrencies($id_shop = null)
|
||||
{
|
||||
if ($id_shop === null)
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
|
||||
if (!isset(self::$countActiveCurrencies[$id_shop]))
|
||||
self::$countActiveCurrencies[$id_shop] = Db::getInstance()->getValue('
|
||||
SELECT COUNT(DISTINCT c.id_currency) FROM `'._DB_PREFIX_.'currency` c
|
||||
LEFT JOIN '._DB_PREFIX_.'currency_shop cs ON (cs.id_currency = c.id_currency AND cs.id_shop = '.(int)$id_shop.')
|
||||
WHERE c.`active` = 1
|
||||
');
|
||||
return self::$countActiveCurrencies[$id_shop];
|
||||
}
|
||||
|
||||
public static function isMultiCurrencyActivated($id_shop = null)
|
||||
{
|
||||
return (Currency::countActiveCurrencies($id_shop) > 1);
|
||||
}
|
||||
}
|
||||
@@ -362,15 +362,18 @@ class CustomerCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_customer))
|
||||
return true;
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = \''.(int)$id_customer.'\'
|
||||
AND active = 1
|
||||
AND `deleted` = 0');
|
||||
if (isset($result['id_customer']))
|
||||
return false;
|
||||
return true;
|
||||
$cache_id = 'Customer::isBanned_'.(int)$id_customer;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (bool)!Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = \''.(int)$id_customer.'\'
|
||||
AND active = 1
|
||||
AND `deleted` = 0');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -413,7 +416,7 @@ class CustomerCore extends ObjectModel
|
||||
public static function customerHasAddress($id_customer, $id_address)
|
||||
{
|
||||
$key = (int)$id_customer.'-'.(int)$id_address;
|
||||
if (!array_key_exists($id_address, self::$_customerHasAddress))
|
||||
if (!array_key_exists($key, self::$_customerHasAddress))
|
||||
{
|
||||
self::$_customerHasAddress[$key] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `id_address`
|
||||
@@ -439,15 +442,22 @@ class CustomerCore extends ObjectModel
|
||||
*/
|
||||
public function getAddresses($id_lang)
|
||||
{
|
||||
$sql = 'SELECT DISTINCT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
|
||||
'.(Context::getContext()->shop->getGroup()->share_order ? '' : Shop::addSqlAssociation('country', 'c')).'
|
||||
WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0';
|
||||
$share_order = (bool)Context::getContext()->shop->getGroup()->share_order;
|
||||
$cache_id = 'Customer::getAddresses'.(int)$this->id.'-'.(int)$id_lang.'-'.$share_order;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT DISTINCT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
|
||||
FROM `'._DB_PREFIX_.'address` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
|
||||
'.($share_order ? '' : Shop::addSqlAssociation('country', 'c')).'
|
||||
WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0';
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -476,12 +486,17 @@ class CustomerCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isUnsignedId($id_customer) || !Validate::isMd5($passwd))
|
||||
die (Tools::displayError());
|
||||
|
||||
$sql = 'SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = '.$id_customer.'
|
||||
$cache_id = 'Customer::checkPassword'.(int)$id_customer.'-'.$passwd;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT `id_customer`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE `id_customer` = '.$id_customer.'
|
||||
AND `passwd` = \''.$passwd.'\'';
|
||||
return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -574,12 +589,16 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
public static function customerIdExistsStatic($id_customer)
|
||||
{
|
||||
$row = Db::getInstance()->getRow('
|
||||
SELECT `id_customer`
|
||||
FROM '._DB_PREFIX_.'customer c
|
||||
WHERE c.`id_customer` = '.(int)$id_customer);
|
||||
|
||||
return isset($row['id_customer']);
|
||||
$cache_id = 'Customer::customerIdExistsStatic'.(int)$id_customer;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_customer`
|
||||
FROM '._DB_PREFIX_.'customer c
|
||||
WHERE c.`id_customer` = '.(int)$id_customer);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -589,9 +608,11 @@ class CustomerCore extends ObjectModel
|
||||
*/
|
||||
public function updateGroup($list)
|
||||
{
|
||||
$this->cleanGroups();
|
||||
if ($list && !empty($list))
|
||||
{
|
||||
$this->cleanGroups();
|
||||
$this->addGroups($list);
|
||||
}
|
||||
else
|
||||
$this->addGroups(array($this->id_default_group));
|
||||
}
|
||||
@@ -606,7 +627,7 @@ class CustomerCore extends ObjectModel
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
$row = array('id_customer' => (int)$this->id, 'id_group' => (int)$group);
|
||||
Db::getInstance()->insert('customer_group', $row);
|
||||
Db::getInstance()->insert('customer_group', $row, false, true, Db::INSERT_IGNORE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class CustomerMessageCore extends ObjectModel
|
||||
'fields' => array(
|
||||
'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_customer_thread' => array('type' => self::TYPE_INT),
|
||||
'ip_address' => array('type' => self::TYPE_INT, 'validate' => 'isIp2Long'),
|
||||
'ip_address' => array('type' => self::TYPE_STRING, 'validate' => 'isIp2Long', 'size' => 15),
|
||||
'message' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true, 'size' => 65000),
|
||||
'file_name' => array('type' => self::TYPE_STRING),
|
||||
'user_agent' => array('type' => self::TYPE_STRING),
|
||||
|
||||
@@ -369,7 +369,7 @@ class DispatcherCore
|
||||
|
||||
// If there are several languages, get language from uri
|
||||
if ($this->use_routes && Language::isMultiLanguageActivated())
|
||||
if (preg_match('#^/([a-z]{2})/#', $this->request_uri, $m))
|
||||
if (preg_match('#^/([a-z]{2})(?:/.*)?$#', $this->request_uri, $m))
|
||||
{
|
||||
$_GET['isolang'] = $m[1];
|
||||
$this->request_uri = substr($this->request_uri, 3);
|
||||
@@ -549,7 +549,7 @@ class DispatcherCore
|
||||
if ($id_shop === null)
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
|
||||
if ($this->use_routes && !isset($this->routes[$id_shop]))
|
||||
if (!isset($this->routes[$id_shop]))
|
||||
$this->loadRoutes($id_shop);
|
||||
|
||||
if (!isset($this->routes[$id_shop]) || !isset($this->routes[$id_shop][$id_lang]) || !isset($this->routes[$id_shop][$id_lang][$route_id]))
|
||||
@@ -594,14 +594,14 @@ class DispatcherCore
|
||||
if ($id_shop === null)
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
|
||||
if ($this->use_routes && !isset($this->routes[$id_shop]))
|
||||
if (!isset($this->routes[$id_shop]))
|
||||
$this->loadRoutes($id_shop);
|
||||
|
||||
|
||||
if (!isset($this->routes[$id_shop][$id_lang][$route_id]))
|
||||
{
|
||||
$query = http_build_query($params, '', '&');
|
||||
$index_link = $this->use_routes ? '' : 'index.php';
|
||||
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '').$anchor;
|
||||
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : ((trim($route_id) == '') ? '' : 'index.php?controller='.$route_id).(($query) ? '&'.$query : '').$anchor;
|
||||
}
|
||||
$route = $this->routes[$id_shop][$id_lang][$route_id];
|
||||
// Check required fields
|
||||
|
||||
@@ -312,16 +312,37 @@ class FeatureCore extends ObjectModel
|
||||
*/
|
||||
public static function cleanPositions()
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'feature` f
|
||||
LEFT JOIN (
|
||||
SELECT @i := @i +1 AS rank, id_feature, position
|
||||
FROM `'._DB_PREFIX_.'feature`
|
||||
JOIN (SELECT @i :=1) dummy
|
||||
ORDER by position
|
||||
) AS f2
|
||||
USING (id_feature)
|
||||
SET f.position = f2.rank - 1');
|
||||
//Reordering positions to remove "holes" in them (after delete for instance)
|
||||
$sql = "SELECT id_feature, position FROM "._DB_PREFIX_."feature ORDER BY id_feature";
|
||||
$db = Db::getInstance();
|
||||
$r = $db->executeS($sql, false);
|
||||
$shiftTable = array(); //List of update queries (one query is necessary for each "hole" in the table)
|
||||
$currentDelta = 0;
|
||||
$minId = 0;
|
||||
$maxId = 0;
|
||||
$futurePosition = 1;
|
||||
while ($line = $db->nextRow($r)) {
|
||||
$delta = $futurePosition - $line['position']; //Difference between current position and future position
|
||||
if ($delta != $currentDelta) {
|
||||
$shiftTable[] = array('minId' => $minId, 'maxId' => $maxId, 'delta' => $currentDelta);
|
||||
$currentDelta = $delta;
|
||||
$minId = $line['id_feature'];
|
||||
}
|
||||
$maxId = $line['id_feature'];
|
||||
$futurePosition++;
|
||||
}
|
||||
$shiftTable[] = array('minId' => $minId, 'maxId' => $maxId, 'delta' => $currentDelta);
|
||||
|
||||
//Executing generated queries
|
||||
foreach ($shiftTable as $line) {
|
||||
$delta = $line['delta'];
|
||||
if ($delta == 0) continue;
|
||||
$delta = $delta > 0 ? '+' . (int)$delta : (int)$delta;
|
||||
$minId = (int)$line['minId'];
|
||||
$maxId = (int)$line['maxId'];
|
||||
$sql = "UPDATE "._DB_PREFIX_."feature SET position = position $delta WHERE id_feature >= $minId AND id_feature <= $maxId";
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -128,34 +128,50 @@ class FeatureValueCore extends ObjectModel
|
||||
return $tab['value'];
|
||||
}
|
||||
|
||||
public static function addFeatureValueImport($id_feature, $name)
|
||||
public static function addFeatureValueImport($id_feature, $value, $id_product = null, $id_lang = null, $custom = false)
|
||||
{
|
||||
$rq = Db::getInstance()->executeS('
|
||||
SELECT fv.`id_feature_value`
|
||||
FROM '._DB_PREFIX_.'feature_value fv
|
||||
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl
|
||||
ON (fvl.`id_feature_value` = fv.`id_feature_value`)
|
||||
WHERE `value` = \''.pSQL($name).'\'
|
||||
AND fv.`id_feature` = '.(int)$id_feature.'
|
||||
GROUP BY fv.`id_feature_value` LIMIT 1
|
||||
');
|
||||
|
||||
if (!isset($rq[0]['id_feature_value']) || !$id_feature_value = (int)$rq[0]['id_feature_value'])
|
||||
$id_feature_value = false;
|
||||
if (!is_null($id_product) && $id_product)
|
||||
{
|
||||
// Feature doesn't exist, create it
|
||||
$feature_value = new FeatureValue();
|
||||
$id_feature_value = Db::getInstance()->getValue('
|
||||
SELECT fp.`id_feature_value`
|
||||
FROM '._DB_PREFIX_.'feature_product fp
|
||||
INNER JOIN '._DB_PREFIX_.'feature_value fv USING (`id_feature_value`)
|
||||
WHERE fp.`id_feature` = '.(int)$id_feature.'
|
||||
AND fv.`custom` = '.(int)$custom.'
|
||||
AND fp.`id_product` = '.(int)$id_product);
|
||||
|
||||
$languages = Language::getLanguages();
|
||||
foreach ($languages as $language)
|
||||
$feature_value->value[$language['id_lang']] = strval($name);
|
||||
|
||||
$feature_value->id_feature = (int)$id_feature;
|
||||
$feature_value->custom = 1;
|
||||
$feature_value->add();
|
||||
|
||||
return (int)$feature_value->id;
|
||||
if ($custom && $id_feature_value && !is_null($id_lang) && $id_lang)
|
||||
Db::getInstance()->execute('
|
||||
UPDATE '._DB_PREFIX_.'feature_value_lang
|
||||
SET `value` = \''.pSQL($value).'\'
|
||||
WHERE `id_feature_value` = '.(int)$id_feature_value.'
|
||||
AND `value` != \''.pSQL($value).'\'
|
||||
AND `id_lang` = '.(int)$id_lang);
|
||||
}
|
||||
return (int)$id_feature_value;
|
||||
|
||||
if (!$custom)
|
||||
$id_feature_value = Db::getInstance()->getValue('
|
||||
SELECT fv.`id_feature_value`
|
||||
FROM '._DB_PREFIX_.'feature_value fv
|
||||
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.`id_feature_value` = fv.`id_feature_value` AND fvl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE `value` = \''.pSQL($value).'\'
|
||||
AND fv.`id_feature` = '.(int)$id_feature.'
|
||||
AND fv.`custom` = 0
|
||||
GROUP BY fv.`id_feature_value`');
|
||||
|
||||
if ($id_feature_value)
|
||||
return (int)$id_feature_value;
|
||||
|
||||
// Feature doesn't exist, create it
|
||||
$feature_value = new FeatureValue();
|
||||
$feature_value->id_feature = (int)$id_feature;
|
||||
$feature_value->custom = (bool)$custom;
|
||||
foreach (Language::getLanguages() as $language)
|
||||
$feature_value->value[$language['id_lang']] = $value;
|
||||
$feature_value->add();
|
||||
|
||||
return (int)$feature_value->id;
|
||||
}
|
||||
|
||||
public function add($autodate = true, $nullValues = false)
|
||||
|
||||
@@ -102,6 +102,13 @@ class QqUploadedFileForm
|
||||
$image = new Image();
|
||||
$image->id_product = (int)$product->id;
|
||||
$image->position = Image::getHighestPosition($product->id) + 1;
|
||||
$legends = Tools::getValue('legend');
|
||||
if (is_array($legends))
|
||||
foreach ($legends as $key => $legend)
|
||||
if (!empty($legend) && Validate::isGenericName($legend))
|
||||
$image->legend[(int)$key] = $legend;
|
||||
else
|
||||
return array('error' => sprintf(Tools::displayError('Error on image legend "%1s." is not a valid legend.'), Tools::safeOutput($legend)));
|
||||
if (!Image::getCover($image->id_product))
|
||||
$image->cover = 1;
|
||||
else
|
||||
@@ -136,7 +143,7 @@ class QqUploadedFileForm
|
||||
|
||||
if (!$image->update())
|
||||
return array('error' => Tools::displayError('Error while updating status'));
|
||||
$img = array('id_image' => $image->id, 'position' => $image->position, 'cover' => $image->cover, 'name' => $this->getName());
|
||||
$img = array('id_image' => $image->id, 'position' => $image->position, 'cover' => $image->cover, 'name' => $this->getName(), 'legend' => $image->legend);
|
||||
return array('success' => $img);
|
||||
}
|
||||
|
||||
@@ -184,6 +191,13 @@ class QqUploadedFileXhr
|
||||
$image = new Image();
|
||||
$image->id_product = (int)($product->id);
|
||||
$image->position = Image::getHighestPosition($product->id) + 1;
|
||||
$legends = Tools::getValue('legend');
|
||||
if (is_array($legends))
|
||||
foreach ($legends as $key => $legend)
|
||||
if (!empty($legend) && Validate::isGenericName($legend))
|
||||
$image->legend[(int)$key] = $legend;
|
||||
else
|
||||
return array('error' => sprintf(Tools::displayError('Error on image legend "%1s." is not a valid legend.'), Tools::safeOutput($legend)));
|
||||
if (!Image::getCover($image->id_product))
|
||||
$image->cover = 1;
|
||||
else
|
||||
@@ -223,7 +237,7 @@ class QqUploadedFileXhr
|
||||
|
||||
if (!$image->update())
|
||||
return array('error' => Tools::displayError('Error while updating status'));
|
||||
$img = array('id_image' => $image->id, 'position' => $image->position, 'cover' => $image->cover, 'name' => $this->getName());
|
||||
$img = array('id_image' => $image->id, 'position' => $image->position, 'cover' => $image->cover, 'name' => $this->getName(), 'legend' => $image->legend);
|
||||
return array('success' => $img);
|
||||
}
|
||||
|
||||
|
||||
@@ -305,17 +305,43 @@ class GroupCore extends ObjectModel
|
||||
public static function getCurrent()
|
||||
{
|
||||
static $groups = array();
|
||||
|
||||
$customer = Context::getContext()->customer;
|
||||
if (Validate::isLoadedObject($customer))
|
||||
{
|
||||
$id_group = (int)$customer->id_default_group;
|
||||
$group = new Group((int)$id_group);
|
||||
if (!$group->isAssociatedToShop(Context::getContext()->shop->id))
|
||||
$group = new Group((int)Configuration::get('PS_CUSTOMER_GROUP'));
|
||||
}
|
||||
else
|
||||
$id_group = (int)Configuration::get('PS_UNIDENTIFIED_GROUP');
|
||||
|
||||
|
||||
if (!isset($groups[$id_group]) && isset($group))
|
||||
$groups[$id_group] = $group;
|
||||
|
||||
if (!isset($groups[$id_group]))
|
||||
$groups[$id_group] = new Group($id_group);
|
||||
|
||||
return $groups[$id_group];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Light back office search for Group
|
||||
*
|
||||
* @param integer $id_lang Language ID
|
||||
* @param string $query Searched string
|
||||
* @param boolean $unrestricted allows search without lang and includes first group and exact match
|
||||
* @return array Corresponding groupes
|
||||
*/
|
||||
public static function searchByName($query)
|
||||
{
|
||||
return Db::getInstance()->getRow('
|
||||
SELECT g.*, gl.*
|
||||
FROM `'._DB_PREFIX_.'group` g
|
||||
LEFT JOIN `'._DB_PREFIX_.'group_lang` gl
|
||||
ON (g.`id_group` = gl.`id_group`)
|
||||
WHERE `name` LIKE \''.pSQL($query).'\'
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -137,6 +137,7 @@ class GroupReductionCore extends ObjectModel
|
||||
SELECT `reduction`
|
||||
FROM `'._DB_PREFIX_.'product_group_reduction_cache`
|
||||
WHERE `id_product` = '.(int)$id_product.' AND `id_group` = '.(int)$id_group);
|
||||
// Should return string (decimal in database) and not a float
|
||||
return self::$reduction_cache[$id_product.'-'.$id_group];
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ class HookCore extends ObjectModel
|
||||
*/
|
||||
public static $executed_hooks = array();
|
||||
|
||||
public static $native_module;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -316,7 +318,7 @@ class HookCore extends ObjectModel
|
||||
if (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.' AND id_shop = '.(int)$context->shop->id.' LIMIT 1) = '.(int)$context->country->id.')');
|
||||
if (Validate::isLoadedObject($context->currency))
|
||||
$sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -2) LIMIT 1) IN ('.(int)$context->currency->id.', -2))');
|
||||
$sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -1, -2) LIMIT 1) IN ('.(int)$context->currency->id.', -1, -2))');
|
||||
}
|
||||
if (Validate::isLoadedObject($context->shop))
|
||||
$sql->where('hm.id_shop = '.(int)$context->shop->id);
|
||||
@@ -324,7 +326,10 @@ class HookCore extends ObjectModel
|
||||
if ($frontend)
|
||||
{
|
||||
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
|
||||
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
if (Validate::isLoadedObject($context->shop))
|
||||
$sql->where('mg.id_shop = '.((int)$context->shop->id).' AND mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
else
|
||||
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
$sql->groupBy('hm.id_hook, hm.id_module');
|
||||
}
|
||||
|
||||
@@ -388,6 +393,10 @@ class HookCore extends ObjectModel
|
||||
*/
|
||||
public static function exec($hook_name, $hook_args = array(), $id_module = null, $array_return = false, $check_exceptions = true)
|
||||
{
|
||||
static $disable_non_native_modules = null;
|
||||
if ($disable_non_native_modules === null)
|
||||
$disable_non_native_modules = (bool)Configuration::get('PS_DISABLE_NON_NATIVE_MODULE');
|
||||
|
||||
// Check arguments validity
|
||||
if (($id_module && !is_numeric($id_module)) || !Validate::isHookName($hook_name))
|
||||
throw new PrestaShopException('Invalid id_module or hook_name');
|
||||
@@ -416,12 +425,19 @@ class HookCore extends ObjectModel
|
||||
// Look on modules list
|
||||
$altern = 0;
|
||||
$output = '';
|
||||
|
||||
|
||||
if ($disable_non_native_modules && !isset(Hook::$native_module))
|
||||
Hook::$native_module = Module::getNativeModuleList();
|
||||
|
||||
foreach ($module_list as $array)
|
||||
{
|
||||
// Check errors
|
||||
if ($id_module && $id_module != $array['id_module'])
|
||||
continue;
|
||||
|
||||
if ((bool)$disable_non_native_modules && Hook::$native_module && count(Hook::$native_module) && !in_array($array['module'], self::$native_module))
|
||||
continue;
|
||||
|
||||
if (!($moduleInstance = Module::getInstanceByName($array['module'])))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ class ImageCore extends ObjectModel
|
||||
/** @var boolean Image is cover */
|
||||
public $cover;
|
||||
|
||||
/** @var string Legend */
|
||||
public $legend;
|
||||
|
||||
/** @var string image extension */
|
||||
public $image_format = 'jpg';
|
||||
|
||||
@@ -66,6 +69,7 @@ class ImageCore extends ObjectModel
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'cover' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'shop' => true),
|
||||
'legend' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -120,16 +124,22 @@ class ImageCore extends ObjectModel
|
||||
*
|
||||
* @param integer $id_lang Language ID
|
||||
* @param integer $id_product Product ID
|
||||
* @param integer $id_product_attribute Product Attribute ID
|
||||
* @return array Images
|
||||
*/
|
||||
public static function getImages($id_lang, $id_product)
|
||||
public static function getImages($id_lang, $id_product, $id_product_attribute = NULL)
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)
|
||||
WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang.'
|
||||
ORDER BY i.`position` ASC');
|
||||
$attribute_filter = ($id_product_attribute ? ' AND ai.`id_product_attribute` = '.(int)$id_product_attribute : '');
|
||||
$sql = 'SELECT *
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)';
|
||||
|
||||
if ($id_product_attribute)
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` ai ON (i.`id_image` = ai.`id_image`)';
|
||||
|
||||
$sql .= ' WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang . $attribute_filter.'
|
||||
ORDER BY i.`position` ASC';
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -644,7 +654,7 @@ class ImageCore extends ObjectModel
|
||||
*/
|
||||
public static function testFileSystem()
|
||||
{
|
||||
$safe_mode = ini_get('safe_mode');
|
||||
$safe_mode = Tools::getSafeModeStatus();
|
||||
if ($safe_mode)
|
||||
return false;
|
||||
$folder1 = _PS_PROD_IMG_DIR_.'testfilesystem/';
|
||||
|
||||
@@ -127,16 +127,20 @@ class ImageTypeCore extends ObjectModel
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
*/
|
||||
public static function getByNameNType($name, $type = null)
|
||||
public static function getByNameNType($name, $type = null, $order = null)
|
||||
{
|
||||
if (!isset(self::$images_types_name_cache[$name.'_'.$type]))
|
||||
if (!isset(self::$images_types_name_cache[$name.'_'.$type.'_'.$order]))
|
||||
{
|
||||
self::$images_types_name_cache[$name.'_'.$type] = Db::getInstance()->getRow('
|
||||
self::$images_types_name_cache[$name.'_'.$type.'_'.$order] = Db::getInstance()->getRow('
|
||||
SELECT `id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes`
|
||||
FROM `'._DB_PREFIX_.'image_type`
|
||||
WHERE `name` = \''.pSQL($name).'\' '.(!is_null($type) ? 'AND `'.pSQL($type).'` = 1' : ''));
|
||||
WHERE
|
||||
`name` LIKE \''.pSQL($name).'\''
|
||||
.(!is_null($type) ? ' AND `'.pSQL($type).'` = 1' : '')
|
||||
.(!is_null($order) ? ' ORDER BY `'.bqSQL($order).'` ASC' : '')
|
||||
);
|
||||
}
|
||||
return self::$images_types_name_cache[$name.'_'.$type];
|
||||
return self::$images_types_name_cache[$name.'_'.$type.'_'.$order];
|
||||
}
|
||||
|
||||
public static function getFormatedName($name)
|
||||
|
||||
@@ -111,18 +111,22 @@ class LanguageCore extends ObjectModel
|
||||
$iso_code = $newIso ? $newIso : $this->iso_code;
|
||||
|
||||
if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||
mkdir(_PS_TRANSLATIONS_DIR_.$iso_code);
|
||||
{
|
||||
if (@mkdir(_PS_TRANSLATIONS_DIR_.$iso_code))
|
||||
@chmod(_PS_TRANSLATIONS_DIR_.$iso_code, 0777);
|
||||
}
|
||||
|
||||
foreach ($this->translationsFilesAndVars as $file => $var)
|
||||
{
|
||||
$path_file = _PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php';
|
||||
if (!file_exists($path_file))
|
||||
if ($file != 'tabs')
|
||||
file_put_contents($path_file, '<?php
|
||||
@file_put_contents($path_file, '<?php
|
||||
global $'.$var.';
|
||||
$'.$var.' = array();
|
||||
?>');
|
||||
else
|
||||
file_put_contents($path_file, '<?php
|
||||
@file_put_contents($path_file, '<?php
|
||||
$'.$var.' = array();
|
||||
return $'.$var.';
|
||||
?>');
|
||||
@@ -192,7 +196,7 @@ class LanguageCore extends ObjectModel
|
||||
|
||||
public function add($autodate = true, $nullValues = false, $only_add = false)
|
||||
{
|
||||
if (!parent::add($autodate))
|
||||
if (!parent::add($autodate, $nullValues))
|
||||
return false;
|
||||
|
||||
if ($only_add)
|
||||
@@ -202,10 +206,9 @@ class LanguageCore extends ObjectModel
|
||||
$this->_generateFiles();
|
||||
|
||||
// @todo Since a lot of modules are not in right format with their primary keys name, just get true ...
|
||||
$resUpdateSQL = $this->loadUpdateSQL();
|
||||
$resUpdateSQL = true;
|
||||
Tools::generateHtaccess();
|
||||
return $resUpdateSQL;
|
||||
$this->loadUpdateSQL();
|
||||
|
||||
return Tools::generateHtaccess();
|
||||
}
|
||||
|
||||
public function toggleStatus()
|
||||
@@ -461,7 +464,8 @@ class LanguageCore extends ObjectModel
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
rmdir($dir);
|
||||
if (is_writable($dir))
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
@@ -488,7 +492,8 @@ class LanguageCore extends ObjectModel
|
||||
// Files deletion
|
||||
foreach (Language::getFilesList($this->iso_code, _THEME_NAME_, false, false, false, true, true) as $key => $file)
|
||||
if (file_exists($key))
|
||||
unlink($key);
|
||||
unlink($key);
|
||||
|
||||
$modList = scandir(_PS_MODULE_DIR_);
|
||||
foreach ($modList as $mod)
|
||||
{
|
||||
@@ -510,37 +515,32 @@ class LanguageCore extends ObjectModel
|
||||
Language::recurseDeleteDir(_PS_MAIL_DIR_.$this->iso_code);
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code))
|
||||
Language::recurseDeleteDir(_PS_TRANSLATIONS_DIR_.$this->iso_code);
|
||||
}
|
||||
|
||||
if (!parent::delete())
|
||||
return false;
|
||||
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
|
||||
{
|
||||
// delete images
|
||||
$files_copy = array(
|
||||
'/en.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('thickbox').'.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('home').'.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('large').'.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('medium').'.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('small').'.jpg'
|
||||
|
||||
$images = array(
|
||||
'.jpg',
|
||||
'-default-'.ImageType::getFormatedName('thickbox').'.jpg',
|
||||
'-default-'.ImageType::getFormatedName('home').'.jpg',
|
||||
'-default-'.ImageType::getFormatedName('large').'.jpg',
|
||||
'-default-'.ImageType::getFormatedName('medium').'.jpg',
|
||||
'-default-'.ImageType::getFormatedName('small').'.jpg'
|
||||
);
|
||||
$tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_);
|
||||
foreach ($tos as $to)
|
||||
foreach ($files_copy as $file)
|
||||
$images_directories = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_);
|
||||
foreach ($images_directories as $image_directory)
|
||||
foreach ($images as $image)
|
||||
{
|
||||
$name = str_replace('/en', ''.$this->iso_code, $file);
|
||||
|
||||
if (file_exists($to.$name))
|
||||
unlink($to.$name);
|
||||
if (file_exists($image_directory.$this->iso_code.$image))
|
||||
unlink($image_directory.$this->iso_code.$image);
|
||||
if (file_exists(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg'))
|
||||
unlink(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
if (!parent::delete())
|
||||
return false;
|
||||
|
||||
return Tools::generateHtaccess();
|
||||
}
|
||||
|
||||
|
||||
public function deleteSelection($selection)
|
||||
{
|
||||
if (!is_array($selection))
|
||||
@@ -549,11 +549,10 @@ class LanguageCore extends ObjectModel
|
||||
$result = true;
|
||||
foreach ($selection as $id)
|
||||
{
|
||||
$this->id = (int)($id);
|
||||
$result = $result && $this->delete();
|
||||
$language = new Language($id);
|
||||
$result = $result && $language->delete();
|
||||
}
|
||||
|
||||
Tools::generateHtaccess();
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -620,6 +619,35 @@ class LanguageCore extends ObjectModel
|
||||
return Db::getInstance()->getValue('SELECT `language_code` FROM `'._DB_PREFIX_.'lang` WHERE `iso_code` = \''.pSQL(strtolower($iso_code)).'\'');
|
||||
}
|
||||
|
||||
public static function getLanguageByIETFCode($code)
|
||||
{
|
||||
if (!Validate::isLanguageCode($code))
|
||||
die(sprintf(Tools::displayError('Fatal error: IETF code %s is not correct'), $code));
|
||||
|
||||
// $code is in the form of 'xx-YY' where xx is the language code
|
||||
// and 'YY' a country code identifying a variant of the language.
|
||||
$lang_country = explode('-', $code);
|
||||
// Get the language component of the code
|
||||
$lang = $lang_country[0];
|
||||
|
||||
// Find the id_lang of the language.
|
||||
// We look for anything with the correct language code
|
||||
// and sort on equality with the exact IETF code wanted.
|
||||
// That way using only one query we get either the exact wanted language
|
||||
// or a close match.
|
||||
$id_lang = Db::getInstance()->getValue(
|
||||
'SELECT `id_lang` FROM '
|
||||
.'`'._DB_PREFIX_.'lang` WHERE LEFT(`language_code`,2) = \''.pSQL($lang).'\' '
|
||||
.'ORDER BY language_code = \''.pSQL($code).'\' DESC'
|
||||
);
|
||||
|
||||
// Instantiate the Language object if we found it.
|
||||
if ($id_lang)
|
||||
return new Language($id_lang);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array (id_lang, iso_code)
|
||||
*
|
||||
@@ -689,26 +717,28 @@ class LanguageCore extends ObjectModel
|
||||
if (Language::getIdByIso($iso_code))
|
||||
return true;
|
||||
|
||||
// Initialize the language
|
||||
$lang = new Language();
|
||||
$lang->iso_code = $iso_code;
|
||||
$lang->language_code = $iso_code;
|
||||
$lang->active = true;
|
||||
|
||||
// If the language pack has not been provided, retrieve it from prestashop.com
|
||||
if (!$lang_pack)
|
||||
$lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code));
|
||||
|
||||
// If a language pack has been found or provided, prefill the language object with the value
|
||||
if ($lang_pack)
|
||||
{
|
||||
if (isset($lang_pack->name)
|
||||
&& isset($lang_pack->version)
|
||||
&& isset($lang_pack->iso_code))
|
||||
$lang->name = $lang_pack->name;
|
||||
}
|
||||
elseif ($params_lang !== null && is_array($params_lang))
|
||||
foreach (get_object_vars($lang_pack) as $key => $value)
|
||||
if ($key != 'iso_code' && isset(Language::$definition['fields'][$key]))
|
||||
$lang->$key = $value;
|
||||
|
||||
// Use the values given in parameters to override the data retrieved automatically
|
||||
if ($params_lang !== null && is_array($params_lang))
|
||||
foreach ($params_lang as $key => $value)
|
||||
$lang->$key = $value;
|
||||
else
|
||||
return false;
|
||||
|
||||
if ($key != 'iso_code' && isset(Language::$definition['fields'][$key]))
|
||||
$lang->$key = $value;
|
||||
|
||||
if (!$lang->add(true, false, $only_add))
|
||||
return false;
|
||||
|
||||
@@ -726,7 +756,7 @@ class LanguageCore extends ObjectModel
|
||||
}
|
||||
else
|
||||
Language::_copyNoneFlag((int)$lang->id);
|
||||
|
||||
|
||||
$files_copy = array(
|
||||
'/en.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('thickbox').'.jpg',
|
||||
@@ -736,7 +766,7 @@ class LanguageCore extends ObjectModel
|
||||
'/en-default-'.ImageType::getFormatedName('small').'.jpg',
|
||||
'/en-default-'.ImageType::getFormatedName('scene').'.jpg'
|
||||
);
|
||||
|
||||
|
||||
foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to)
|
||||
foreach ($files_copy as $file)
|
||||
@copy(dirname(__FILE__).'/../img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file));
|
||||
@@ -789,13 +819,22 @@ class LanguageCore extends ObjectModel
|
||||
$lang_pack_ok = false;
|
||||
$errors = array();
|
||||
$file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip';
|
||||
|
||||
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso)))
|
||||
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
|
||||
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
|
||||
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
|
||||
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))
|
||||
if (!@file_put_contents($file, $content))
|
||||
$errors[] = Tools::displayError('Server does not have permissions for writing.');
|
||||
{
|
||||
if (is_writable(dirname($file)))
|
||||
{
|
||||
@unlink($file);
|
||||
@file_put_contents($file, $content);
|
||||
}
|
||||
elseif (!is_writable($file))
|
||||
$errors[] = Tools::displayError('Server does not have permissions for writing.').' ('.$file.')';
|
||||
}
|
||||
if (file_exists($file))
|
||||
{
|
||||
$gz = new Archive_Tar($file, true);
|
||||
|
||||
@@ -91,12 +91,8 @@ class LinkCore
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null)
|
||||
$shop = new Shop($id_shop);
|
||||
else
|
||||
$shop = Context::getContext()->shop;
|
||||
|
||||
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$url = $this->getBaseLink($id_shop).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
if (!is_object($product))
|
||||
{
|
||||
@@ -163,11 +159,7 @@ class LinkCore
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
$url = $this->getBaseLink($id_shop).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
if (!is_object($category))
|
||||
$category = new Category($category, $id_lang);
|
||||
@@ -206,11 +198,7 @@ class LinkCore
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
$url = $this->getBaseLink($id_shop).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$dispatcher = Dispatcher::getInstance();
|
||||
if (!is_object($cms_category))
|
||||
@@ -239,19 +227,12 @@ class LinkCore
|
||||
* @param int $id_lang
|
||||
* @return string
|
||||
*/
|
||||
public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = null, $id_shop = null)
|
||||
public function getCMSLink($cms, $alias = null, $ssl = null, $id_lang = null, $id_shop = null)
|
||||
{
|
||||
$base = (($ssl && $this->ssl_enable) ? 'https://' : 'http://');
|
||||
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
$url = $base.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$url = $this->getBaseLink($id_shop, $ssl).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$dispatcher = Dispatcher::getInstance();
|
||||
if (!is_object($cms))
|
||||
@@ -290,11 +271,8 @@ class LinkCore
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$url = $this->getBaseLink($id_shop).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$dispatcher = Dispatcher::getInstance();
|
||||
if (!is_object($supplier))
|
||||
@@ -327,11 +305,7 @@ class LinkCore
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
$url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
$url = $this->getBaseLink($id_shop).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
$dispatcher = Dispatcher::getInstance();
|
||||
if (!is_object($manufacturer))
|
||||
@@ -360,18 +334,12 @@ class LinkCore
|
||||
* @param int $id_lang
|
||||
* @return string
|
||||
*/
|
||||
public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = false, $id_lang = null, $id_shop = null)
|
||||
public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = null, $id_lang = null, $id_shop = null)
|
||||
{
|
||||
$base = (($ssl && $this->ssl_enable) ? 'https://' : 'http://');
|
||||
|
||||
if (!$id_lang)
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
$url = $base.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop);
|
||||
$url = $this->getBaseLink($id_shop, $ssl).$this->getLangLink($id_lang, null, $id_shop);
|
||||
|
||||
// If the module has its own route ... just use it !
|
||||
if (Dispatcher::getInstance()->hasRoute('module-'.$module.'-'.$controller, $id_lang, $id_shop))
|
||||
@@ -453,10 +421,18 @@ class LinkCore
|
||||
*
|
||||
* @return string Page link
|
||||
*/
|
||||
public function getPageLink($controller, $ssl = false, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null)
|
||||
public function getPageLink($controller, $ssl = null, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null)
|
||||
{
|
||||
|
||||
//If $controller contains '&' char, it means that $controller contains request data and must be parsed first
|
||||
$p = strpos($controller, '&');
|
||||
if ($p !== false) {
|
||||
$request = substr($controller, $p + 1);
|
||||
$request_url_encode = false;
|
||||
$controller = substr($controller, 0, $p);
|
||||
}
|
||||
|
||||
$controller = Tools::strReplaceFirst('.php', '', $controller);
|
||||
|
||||
if (!$id_lang)
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
|
||||
@@ -469,16 +445,9 @@ class LinkCore
|
||||
parse_str($request, $request);
|
||||
}
|
||||
|
||||
if ($id_shop === null)
|
||||
$shop = Context::getContext()->shop;
|
||||
else
|
||||
$shop = new Shop($id_shop);
|
||||
|
||||
$uri_path = Dispatcher::getInstance()->createUrl($controller, $id_lang, $request, false, '', $id_shop);
|
||||
$url = ($ssl && $this->ssl_enable) ? 'https://' : 'http://';
|
||||
$url .= $shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang, null, $id_shop).ltrim($uri_path, '/');
|
||||
|
||||
return $url;
|
||||
return $this->getBaseLink($id_shop, $ssl).$this->getLangLink($id_lang, null, $id_shop).ltrim($uri_path, '/');
|
||||
}
|
||||
|
||||
public function getCatImageLink($name, $id_category, $type = null)
|
||||
@@ -642,5 +611,26 @@ class LinkCore
|
||||
|
||||
return Language::getIsoById($id_lang).'/';
|
||||
}
|
||||
|
||||
protected function getBaseLink($id_shop = null, $ssl = null)
|
||||
{
|
||||
static $force_ssl = null;
|
||||
|
||||
if ($ssl === null)
|
||||
{
|
||||
if ($force_ssl === null)
|
||||
$force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'));
|
||||
$ssl = $force_ssl;
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null)
|
||||
$shop = new Shop($id_shop);
|
||||
else
|
||||
$shop = Context::getContext()->shop;
|
||||
|
||||
$base = (($ssl && $this->ssl_enable) ? 'https://'.$shop->domain_ssl : 'http://'.$shop->domain);
|
||||
|
||||
return $base.$shop->getBaseURI();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ class LocalizationPackCore
|
||||
|
||||
if ($install_mode && $res && isset($this->iso_currency))
|
||||
{
|
||||
Cache::clean('Currency::getIdByIsoCode_*');
|
||||
$res &= Configuration::updateValue('PS_CURRENCY_DEFAULT', (int)Currency::getIdByIsoCode($this->iso_currency));
|
||||
Currency::refreshCurrencies();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class LoggerCore extends ObjectModel
|
||||
'fields' => array(
|
||||
'severity' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'required' => true),
|
||||
'error_code' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'required' => true),
|
||||
'message' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true),
|
||||
'object_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'object_type' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||
@@ -149,6 +149,11 @@ class LoggerCore extends ObjectModel
|
||||
|
||||
return $this->hash;
|
||||
}
|
||||
|
||||
public static function eraseAllLogs()
|
||||
{
|
||||
return Db::getInstance()->execute('TRUNCATE TABLE '._DB_PREFIX_.'log');
|
||||
}
|
||||
|
||||
/**
|
||||
* check if this log message already exists in database.
|
||||
|
||||
116
classes/Mail.php
116
classes/Mail.php
@@ -50,9 +50,11 @@ class MailCore
|
||||
* @param bool $modeSMTP
|
||||
* @param string $template_path
|
||||
* @param bool $die
|
||||
* @param string $bcc Bcc recipient
|
||||
*/
|
||||
public static function Send($id_lang, $template, $subject, $template_vars, $to,
|
||||
$to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null, $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null)
|
||||
$to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
|
||||
$template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null)
|
||||
{
|
||||
$configuration = Configuration::getMultiple(array(
|
||||
'PS_SHOP_EMAIL',
|
||||
@@ -126,37 +128,56 @@ class MailCore
|
||||
}
|
||||
|
||||
/* Construct multiple recipients list if needed */
|
||||
$to_list = new Swift_RecipientList();
|
||||
if (is_array($to) && isset($to))
|
||||
{
|
||||
$to_list = new Swift_RecipientList();
|
||||
foreach ($to as $key => $addr)
|
||||
{
|
||||
$to_name = null;
|
||||
$addr = trim($addr);
|
||||
if (!Validate::isEmail($addr))
|
||||
{
|
||||
Tools::dieOrLog(Tools::displayError('Error: invalid e-mail address'), $die);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_array($to_name))
|
||||
{
|
||||
if ($to_name && is_array($to_name) && Validate::isGenericName($to_name[$key]))
|
||||
$to_name = $to_name[$key];
|
||||
}
|
||||
if ($to_name == null)
|
||||
$to_name = $addr;
|
||||
/* Encode accentuated chars */
|
||||
$to_list->addTo($addr, '=?UTF-8?B?'.base64_encode($to_name).'?=');
|
||||
|
||||
if ($to_name == null || $to_name == $addr)
|
||||
$to_name = '';
|
||||
else
|
||||
{
|
||||
if (function_exists('mb_encode_mimeheader'))
|
||||
$to_name = mb_encode_mimeheader($to_name, 'utf-8');
|
||||
else
|
||||
$to_name = self::mimeEncode($to_name);
|
||||
}
|
||||
|
||||
$to_list->addTo($addr, $to_name);
|
||||
}
|
||||
$to_plugin = $to[0];
|
||||
$to = $to_list;
|
||||
} else {
|
||||
/* Simple recipient, one address */
|
||||
$to_plugin = $to;
|
||||
if ($to_name == null)
|
||||
$to_name = $to;
|
||||
$to = new Swift_Address($to, '=?UTF-8?B?'.base64_encode($to_name).'?=');
|
||||
if ($to_name == null || $to_name == $to)
|
||||
$to_name = '';
|
||||
else
|
||||
{
|
||||
if (function_exists('mb_encode_mimeheader'))
|
||||
$to_name = mb_encode_mimeheader($to_name, 'utf-8');
|
||||
else
|
||||
$to_name = self::mimeEncode($to_name);
|
||||
}
|
||||
|
||||
$to_list->addTo($to, $to_name);
|
||||
}
|
||||
if(isset($bcc)) {
|
||||
$to_list->addBcc($bcc);
|
||||
}
|
||||
$to = $to_list;
|
||||
try {
|
||||
/* Connect with the appropriate configuration */
|
||||
if ($configuration['PS_MAIL_METHOD'] == 2)
|
||||
@@ -224,12 +245,19 @@ class MailCore
|
||||
include_once($template_path.$iso.'/lang.php');
|
||||
else if ($module_name && file_exists($theme_path.'mails/'.$iso.'/lang.php'))
|
||||
include_once($theme_path.'mails/'.$iso.'/lang.php');
|
||||
else
|
||||
else if (file_exists(_PS_MAIL_DIR_.$iso.'/lang.php'))
|
||||
include_once(_PS_MAIL_DIR_.$iso.'/lang.php');
|
||||
else
|
||||
{
|
||||
Tools::dieOrLog(Tools::displayError('Error - The lang file is missing for :').' '.$iso, $die);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Create mail and attach differents parts */
|
||||
$message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject);
|
||||
|
||||
$message->setCharset('utf-8');
|
||||
|
||||
/* Set Message-ID - getmypid() is blocked on some hosting */
|
||||
$message->setId(Mail::generateId());
|
||||
|
||||
@@ -372,4 +400,68 @@ class MailCore
|
||||
return vsprintf("<%s.%d.%s@%s>", $midparams);
|
||||
}
|
||||
|
||||
public static function isMultibyte($data)
|
||||
{
|
||||
$length = strlen($data);
|
||||
|
||||
for ($i = 0; $i < $length; $i++)
|
||||
{
|
||||
$result = ord(($data[$i]));
|
||||
|
||||
if ($result > 128)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function mimeEncode($string, $charset = 'UTF-8', $newline = "\r\n")
|
||||
{
|
||||
if (!self::isMultibyte($string) && strlen($string) < 75)
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
|
||||
$charset = strtoupper($charset);
|
||||
$start = '=?' . $charset . '?B?';
|
||||
$end = '?=';
|
||||
$sep = $end . $newline . ' ' . $start;
|
||||
$length = 75 - strlen($start) - strlen($end);
|
||||
$length = $length - ($length % 4);
|
||||
|
||||
if ($charset === 'UTF-8')
|
||||
{
|
||||
$parts = array();
|
||||
$maxchars = floor(($length * 3) / 4);
|
||||
$stringLength = strlen($string);
|
||||
|
||||
while ($stringLength > $maxchars)
|
||||
{
|
||||
$i = (int)$maxchars;
|
||||
$result = ord($string[$i]);
|
||||
|
||||
while ($result >= 128 && $result <= 191)
|
||||
{
|
||||
$i--;
|
||||
$result = ord($string[$i]);
|
||||
}
|
||||
|
||||
$parts[] = base64_encode(substr($string, 0, $i));
|
||||
$string = substr($string, $i);
|
||||
$stringLength = strlen($string);
|
||||
}
|
||||
|
||||
$parts[] = base64_encode($string);
|
||||
$string = implode($sep, $parts);
|
||||
}
|
||||
else
|
||||
{
|
||||
$string = chunk_split(base64_encode($string), $length, $sep);
|
||||
$string = preg_replace('/' . preg_quote($sep) . '$/', '', $string);
|
||||
}
|
||||
|
||||
return $start . $string . $end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class ManufacturerCore extends ObjectModel
|
||||
|
||||
// Lang fields
|
||||
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||
'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 254),
|
||||
'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
||||
|
||||
@@ -39,7 +39,7 @@ class MediaCore
|
||||
'ui.accordion' => array('fileName' => 'jquery.ui.accordion.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true),
|
||||
'ui.autocomplete' => array('fileName' => 'jquery.ui.autocomplete.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true),
|
||||
'ui.button' => array('fileName' => 'jquery.ui.button.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true),
|
||||
'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true),
|
||||
'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position','ui.button'), 'theme' => true),
|
||||
'ui.slider' => array('fileName' => 'jquery.ui.slider.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true),
|
||||
'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true),
|
||||
'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true),
|
||||
@@ -109,7 +109,7 @@ class MediaCore
|
||||
|
||||
// If the string is too big preg_replace return an error
|
||||
// In this case, we don't compress the content
|
||||
if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR)
|
||||
if (function_exists('preg_last_error') && preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR)
|
||||
{
|
||||
if (_PS_MODE_DEV_)
|
||||
error_log('ERROR: PREG_BACKTRACK_LIMIT_ERROR in function packJSinHTML');
|
||||
@@ -201,7 +201,7 @@ class MediaCore
|
||||
if (!preg_match('/^http(s?):\/\//i', $file_uri) && !@filemtime($file_uri))
|
||||
return false;
|
||||
|
||||
if (Context::getContext()->controller->controller_type == 'admin')
|
||||
if (Context::getContext()->controller->controller_type == 'admin' && !array_key_exists('host', $url_data))
|
||||
{
|
||||
$js_uri = preg_replace('/^'.preg_quote(__PS_BASE_URI__, '/').'/', '/', $js_uri);
|
||||
$js_uri = dirname(preg_replace('/\?.+$/', '', $_SERVER['REQUEST_URI']).'a').'/..'.$js_uri;
|
||||
@@ -271,10 +271,10 @@ class MediaCore
|
||||
|
||||
if ($add_no_conflict)
|
||||
$return[] = Media::getJSPath(_PS_JS_DIR_.'jquery/jquery.noConflict.php?version='.$version);
|
||||
|
||||
|
||||
//added query migrate for compatibility with new version of jquery will be removed in ps 1.6
|
||||
$return[] = Media::getJSPath(_PS_JS_DIR_.'jquery/jquery-migrate-1.2.1.js');
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,11 @@ class MetaCore extends ObjectModel
|
||||
{
|
||||
if ($file != 'index.php' && !in_array(strtolower(str_replace('Controller.php', '', $file)), $exlude_pages))
|
||||
{
|
||||
$reflection = new ReflectionClass(str_replace('.php', '', $file));
|
||||
$properties = $reflection->getDefaultProperties();
|
||||
$class_name = str_replace('.php', '', $file);
|
||||
if (class_exists($class_name))
|
||||
$reflection = new ReflectionClass(str_replace('.php', '', $file));
|
||||
if (isset($reflection) && $reflection)
|
||||
$properties = $reflection->getDefaultProperties();
|
||||
if (isset($properties['php_self']))
|
||||
$selected_pages[$properties['php_self']] = $properties['php_self'];
|
||||
else if (preg_match('/^[a-z0-9_.-]*\.php$/i', $file))
|
||||
@@ -82,11 +85,11 @@ class MetaCore extends ObjectModel
|
||||
// Add modules controllers to list (this function is cool !)
|
||||
foreach (glob(_PS_MODULE_DIR_.'*/controllers/front/*.php') as $file)
|
||||
{
|
||||
$filename = basename($file, '.php');
|
||||
$filename = Tools::strtolower(basename($file, '.php'));
|
||||
if ($filename == 'index')
|
||||
continue;
|
||||
|
||||
$module = basename(dirname(dirname(dirname($file))));
|
||||
$module = Tools::strtolower(basename(dirname(dirname(dirname($file)))));
|
||||
$selected_pages[$module.' - '.$filename] = 'module-'.$module.'-'.$filename;
|
||||
}
|
||||
|
||||
@@ -274,24 +277,31 @@ class MetaCore extends ObjectModel
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
WHERE cl.`id_lang` = '.(int)$id_lang.'
|
||||
AND cl.`id_category` = '.(int)$id_category.Shop::addSqlRestrictionOnLang('cl');
|
||||
if ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql))
|
||||
|
||||
$cache_id = 'Meta::getCategoryMetas'.(int)$id_category.'-'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
if (empty($row['meta_description']))
|
||||
$row['meta_description'] = strip_tags($row['description']);
|
||||
|
||||
// Paginate title
|
||||
if (!empty($row['meta_title']))
|
||||
$row['meta_title'] = $title.$row['meta_title'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
if ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql))
|
||||
{
|
||||
if (empty($row['meta_description']))
|
||||
$row['meta_description'] = strip_tags($row['description']);
|
||||
|
||||
// Paginate title
|
||||
if (!empty($row['meta_title']))
|
||||
$row['meta_title'] = $title.$row['meta_title'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
else
|
||||
$row['meta_title'] = $row['name'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
if (!empty($title))
|
||||
$row['meta_title'] = $title.(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
$result = Meta::completeMetaTags($row, $row['name']);
|
||||
}
|
||||
else
|
||||
$row['meta_title'] = $row['name'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
if (!empty($title))
|
||||
$row['meta_title'] = $title.(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
return Meta::completeMetaTags($row, $row['name']);
|
||||
$result = Meta::getHomeMetas($id_lang, $page_name);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
|
||||
return Meta::getHomeMetas($id_lang, $page_name);
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -191,7 +191,7 @@ abstract class ObjectModelCore
|
||||
if ($id)
|
||||
{
|
||||
// Load object from database if object id is present
|
||||
$cache_id = 'objectmodel_'.$this->def['classname'].'_'.(int)$id.'_'.(int)$id_shop.'_'.(int)$id_lang;
|
||||
$cache_id = 'objectmodel_'.$this->def['classname'].'_'.(int)$id.'_'.(int)$this->id_shop.'_'.(int)$id_lang;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = new DbQuery();
|
||||
@@ -893,7 +893,7 @@ abstract class ObjectModelCore
|
||||
* @param int $id_lang
|
||||
* @return bool|string
|
||||
*/
|
||||
public function validateField($field, $value, $id_lang = null)
|
||||
public function validateField($field, $value, $id_lang = null, $skip = array(), $human_errors = false)
|
||||
{
|
||||
$this->cacheFieldsRequiredDatabase();
|
||||
$data = $this->def['fields'][$field];
|
||||
@@ -901,9 +901,12 @@ abstract class ObjectModelCore
|
||||
// Check if field is required
|
||||
$required_fields = (isset(self::$fieldsRequiredDatabase[get_class($this)])) ? self::$fieldsRequiredDatabase[get_class($this)] : array();
|
||||
if (!$id_lang || $id_lang == Configuration::get('PS_LANG_DEFAULT'))
|
||||
if (!empty($data['required']) || in_array($field, $required_fields))
|
||||
if (!in_array('required', $skip) && (!empty($data['required']) || in_array($field, $required_fields)))
|
||||
if (Tools::isEmpty($value))
|
||||
return 'Property '.get_class($this).'->'.$field.' is empty';
|
||||
if ($human_errors)
|
||||
return sprintf(Tools::displayError('The %s field is required.'), $this->displayFieldName($field, get_class($this)));
|
||||
else
|
||||
return 'Property '.get_class($this).'->'.$field.' is empty';
|
||||
|
||||
// Default value
|
||||
if (!$value && !empty($data['default']))
|
||||
@@ -913,11 +916,11 @@ abstract class ObjectModelCore
|
||||
}
|
||||
|
||||
// Check field values
|
||||
if (!empty($data['values']) && is_array($data['values']) && !in_array($value, $data['values']))
|
||||
return 'Property '.get_class($this).'->'.$field.' has bad value (allowed values are: '.implode(', ', $data['values']).')';
|
||||
if (!in_array('values', $skip) && !empty($data['values']) && is_array($data['values']) && !in_array($value, $data['values']))
|
||||
return 'Property '.get_class($this).'->'.$field.' has bad value (allowed values are: '.implode(', ', $data['values']).')';
|
||||
|
||||
// Check field size
|
||||
if (!empty($data['size']))
|
||||
if (!in_array('size', $skip) && !empty($data['size']))
|
||||
{
|
||||
$size = $data['size'];
|
||||
if (!is_array($data['size']))
|
||||
@@ -925,11 +928,24 @@ abstract class ObjectModelCore
|
||||
|
||||
$length = Tools::strlen($value);
|
||||
if ($length < $size['min'] || $length > $size['max'])
|
||||
return 'Property '.get_class($this).'->'.$field.' length ('.$length.') must be between '.$size['min'].' and '.$size['max'];
|
||||
{
|
||||
if ($human_errors)
|
||||
{
|
||||
if (isset($data['lang']) && $data['lang'])
|
||||
{
|
||||
$language = new Language((int)$id_lang);
|
||||
return sprintf(Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'), $this->displayFieldName($field, get_class($this)), $language->name, $size['max']);
|
||||
}
|
||||
else
|
||||
return sprintf(Tools::displayError('The %1$s field is too long (%2$d chars max).'), $this->displayFieldName($field, get_class($this)), $size['max']);
|
||||
}
|
||||
else
|
||||
return 'Property '.get_class($this).'->'.$field.' length ('.$length.') must be between '.$size['min'].' and '.$size['max'];
|
||||
}
|
||||
}
|
||||
|
||||
// Check field validator
|
||||
if (!empty($data['validate']))
|
||||
if (!in_array('validate', $skip) && !empty($data['validate']))
|
||||
{
|
||||
if (!method_exists('Validate', $data['validate']))
|
||||
throw new PrestaShopException('Validation function not found. '.$data['validate']);
|
||||
@@ -948,7 +964,12 @@ abstract class ObjectModelCore
|
||||
$res = false;
|
||||
}
|
||||
if (!$res)
|
||||
return 'Property '.get_class($this).'->'.$field.' is not valid';
|
||||
{
|
||||
if ($human_errors)
|
||||
return sprintf(Tools::displayError('The %s field is invalid.'), $this->displayFieldName($field, get_class($this)));
|
||||
else
|
||||
return 'Property '.get_class($this).'->'.$field.' is not valid';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1118,7 +1139,7 @@ abstract class ObjectModelCore
|
||||
{
|
||||
$vars = get_class_vars($class_name);
|
||||
foreach ($vars['shopIDs'] as $id_shop)
|
||||
$or[] = ' main.id_shop = '.(int)$id_shop.' ';
|
||||
$or[] = '(main.id_shop = '.(int)$id_shop.(isset($this->def['fields']['id_shop_group']) ? ' OR (id_shop = 0 AND id_shop_group='.(int)Shop::getGroupFromShop((int)$id_shop).')' : '').')';
|
||||
|
||||
$prepend = '';
|
||||
if (count($or))
|
||||
@@ -1213,11 +1234,16 @@ abstract class ObjectModelCore
|
||||
if ($id_shop === null)
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
|
||||
$sql = 'SELECT id_shop
|
||||
FROM `'.pSQL(_DB_PREFIX_.$this->def['table']).'_shop`
|
||||
WHERE `'.$this->def['primary'].'` = '.(int)$this->id.'
|
||||
AND id_shop = '.(int)$id_shop;
|
||||
return (bool)Db::getInstance()->getValue($sql);
|
||||
$cache_id = 'objectmodel_shop_'.$this->def['classname'].'_'.(int)$this->id.'-'.(int)$id_shop;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT id_shop
|
||||
FROM `'.pSQL(_DB_PREFIX_.$this->def['table']).'_shop`
|
||||
WHERE `'.$this->def['primary'].'` = '.(int)$this->id.'
|
||||
AND id_shop = '.(int)$id_shop;
|
||||
Cache::store($cache_id, (bool)Db::getInstance()->getValue($sql));
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1637,4 +1663,4 @@ abstract class ObjectModelCore
|
||||
{
|
||||
$this->update_fields = $fields;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,6 +399,8 @@ abstract class PaymentModuleCore extends Module
|
||||
} // end foreach ($products)
|
||||
|
||||
$cart_rules_list = '';
|
||||
$total_reduction_value_ti = 0;
|
||||
$total_reduction_value_tex = 0;
|
||||
foreach ($cart_rules as $cart_rule)
|
||||
{
|
||||
$package = array('id_carrier' => $order->id_carrier, 'id_address' => $order->id_address_delivery, 'products' => $order->product_list);
|
||||
@@ -419,7 +421,8 @@ abstract class PaymentModuleCore extends Module
|
||||
** THEN
|
||||
** The voucher is cloned with a new value corresponding to the remainder
|
||||
*/
|
||||
if (count($order_list) == 1 && $values['tax_incl'] > $order->total_products_wt && $cart_rule['obj']->partial_use == 1 && $cart_rule['obj']->reduction_amount > 0)
|
||||
|
||||
if (count($order_list) == 1 && $values['tax_incl'] > ($order->total_products_wt - $total_reduction_value_ti) && $cart_rule['obj']->partial_use == 1 && $cart_rule['obj']->reduction_amount > 0)
|
||||
{
|
||||
// Create a new voucher from the original
|
||||
$voucher = new CartRule($cart_rule['obj']->id); // We need to instantiate the CartRule without lang parameter to allow saving it
|
||||
@@ -432,9 +435,9 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
// Set the new voucher value
|
||||
if ($voucher->reduction_tax)
|
||||
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_incl : 0);
|
||||
$voucher->reduction_amount = $values['tax_incl'] - ($order->total_products_wt - $total_reduction_value_ti) - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_incl : 0);
|
||||
else
|
||||
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_excl : 0);
|
||||
$voucher->reduction_amount = $values['tax_excl'] - ($order->total_products - $total_reduction_value_tex) - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_excl : 0);
|
||||
|
||||
$voucher->id_customer = $order->id_customer;
|
||||
$voucher->quantity = 1;
|
||||
@@ -466,7 +469,10 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
$values['tax_incl'] -= $values['tax_incl'] - $order->total_products_wt;
|
||||
$values['tax_excl'] -= $values['tax_excl'] - $order->total_products;
|
||||
|
||||
}
|
||||
$total_reduction_value_ti += $values['tax_incl'];
|
||||
$total_reduction_value_tex += $values['tax_excl'];
|
||||
|
||||
$order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values, 0, $cart_rule['obj']->free_shipping);
|
||||
|
||||
@@ -530,6 +536,13 @@ abstract class PaymentModuleCore extends Module
|
||||
if ($order_status->logable)
|
||||
ProductSale::addProductSale((int)$product['id_product'], (int)$product['cart_quantity']);
|
||||
|
||||
// Set the order state
|
||||
$new_history = new OrderHistory();
|
||||
$new_history->id_order = (int)$order->id;
|
||||
$new_history->changeIdOrderState((int)$id_order_state, $order, true);
|
||||
$new_history->addWithemail(true, $extra_vars);
|
||||
|
||||
// Switch to back order if needed
|
||||
if (Configuration::get('PS_STOCK_MANAGEMENT') && $order_detail->getStockState())
|
||||
{
|
||||
$history = new OrderHistory();
|
||||
@@ -538,13 +551,6 @@ abstract class PaymentModuleCore extends Module
|
||||
$history->addWithemail();
|
||||
}
|
||||
|
||||
// Set order state in order history ONLY even if the "out of stock" status has not been yet reached
|
||||
// So you migth have two order states
|
||||
$new_history = new OrderHistory();
|
||||
$new_history->id_order = (int)$order->id;
|
||||
$new_history->changeIdOrderState((int)$id_order_state, $order, true);
|
||||
$new_history->addWithemail(true, $extra_vars);
|
||||
|
||||
unset($order_detail);
|
||||
|
||||
// Order is reloaded because the status just changed
|
||||
|
||||
@@ -229,7 +229,13 @@ class ProductCore extends ObjectModel
|
||||
protected static $_prices = array();
|
||||
protected static $_pricesLevel2 = array();
|
||||
protected static $_incat = array();
|
||||
|
||||
/**
|
||||
* @since 1.5.6.1
|
||||
* @var array $_cart_quantity is deprecated since 1.5.6.1
|
||||
*/
|
||||
protected static $_cart_quantity = array();
|
||||
|
||||
protected static $_tax_rules_group = array();
|
||||
protected static $_cacheFeatures = array();
|
||||
protected static $_frontFeaturesCache = array();
|
||||
@@ -519,6 +525,17 @@ class ProductCore extends ObjectModel
|
||||
if (!Validate::isLoadedObject($customer))
|
||||
die(Tools::displayError());
|
||||
self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
|
||||
$cur_cart = Context::getContext()->cart;
|
||||
$id_address = 0;
|
||||
if (Validate::isLoadedObject($cur_cart))
|
||||
$id_address = (int)$cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
|
||||
$address_infos = Address::getCountryAndState($id_address);
|
||||
|
||||
if (self::$_taxCalculationMethod != PS_TAX_EXC
|
||||
&& !empty($address_infos['vat_number'])
|
||||
&& $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY')
|
||||
&& Configuration::get('VATNUMBER_MANAGEMENT'))
|
||||
self::$_taxCalculationMethod = PS_TAX_EXC;
|
||||
}
|
||||
else
|
||||
self::$_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
@@ -730,10 +747,10 @@ class ProductCore extends ObjectModel
|
||||
/**
|
||||
* @see ObjectModel::validateField()
|
||||
*/
|
||||
public function validateField($field, $value, $id_lang = null)
|
||||
public function validateField($field, $value, $id_lang = null, $skip = array(), $human_errors = false)
|
||||
{
|
||||
$value = ($field == 'description_short' ? strip_tags($value) : $value);
|
||||
return parent::validateField($field, $value, $id_lang);
|
||||
return parent::validateField($field, $value, $id_lang, $skip, $human_errors);
|
||||
}
|
||||
|
||||
public function toggleStatus()
|
||||
@@ -1368,8 +1385,8 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
|
||||
$product_supplier->product_supplier_reference = pSQL($supplier_reference);
|
||||
$product_supplier->product_supplier_price_te = (float)$price;
|
||||
$product_supplier->id_currency = (int)$id_currency;
|
||||
$product_supplier->product_supplier_price_te = !is_null($price) ? (float)$price : (float)$product_supplier->product_supplier_price_te;
|
||||
$product_supplier->id_currency = !is_null($id_currency) ? (int)$id_currency : (int)$product_supplier->id_currency;
|
||||
$product_supplier->save();
|
||||
}
|
||||
}
|
||||
@@ -2423,13 +2440,18 @@ class ProductCore extends ObjectModel
|
||||
{
|
||||
if (!$context)
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = 'SELECT image_shop.`id_image`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
'.Shop::addSqlAssociation('image', 'i').'
|
||||
WHERE i.`id_product` = '.(int)$id_product.'
|
||||
AND image_shop.`cover` = 1';
|
||||
return Db::getInstance()->getRow($sql);
|
||||
$cache_id = 'Product::getOrderStates_'.(int)$id_product.'-'.(int)$context->shop->id;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT image_shop.`id_image`
|
||||
FROM `'._DB_PREFIX_.'image` i
|
||||
'.Shop::addSqlAssociation('image', 'i').'
|
||||
WHERE i.`id_product` = '.(int)$id_product.'
|
||||
AND image_shop.`cover` = 1';
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2468,8 +2490,9 @@ class ProductCore extends ObjectModel
|
||||
|
||||
if (!Validate::isBool($usetax) || !Validate::isUnsignedId($id_product))
|
||||
die(Tools::displayError());
|
||||
|
||||
// Initializations
|
||||
$id_group = (isset($context->customer) ? $context->customer->id_default_group : (int)Configuration::get('PS_CUSTOMER_GROUP'));
|
||||
$id_group = (int)Group::getCurrent()->id;
|
||||
|
||||
// If there is cart in context or if the specified id_cart is different from the context cart id
|
||||
if (!is_object($cur_cart) || (Validate::isUnsignedInt($id_cart) && $id_cart && $cur_cart->id != $id_cart))
|
||||
@@ -2490,15 +2513,17 @@ class ProductCore extends ObjectModel
|
||||
$cart_quantity = 0;
|
||||
if ((int)$id_cart)
|
||||
{
|
||||
$condition = '';
|
||||
$cache_name = (int)$id_cart.'_'.(int)$id_product;
|
||||
if (!isset(self::$_cart_quantity[$cache_name]) || self::$_cart_quantity[$cache_name] != (int)$quantity)
|
||||
self::$_cart_quantity[$cache_name] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT SUM(`quantity`)
|
||||
$cache_id = 'Product::getPriceStatic_'.(int)$id_product.'-'.(int)$id_cart;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$sql = 'SELECT SUM(`quantity`)
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE `id_product` = '.(int)$id_product.'
|
||||
AND `id_cart` = '.(int)$id_cart);
|
||||
$cart_quantity = self::$_cart_quantity[$cache_name];
|
||||
AND `id_cart` = '.(int)$id_cart;
|
||||
$cart_quantity = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
Cache::store($cache_id, $cart_quantity);
|
||||
}
|
||||
$cart_quantity = Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
$id_currency = (int)Validate::isLoadedObject($context->currency) ? $context->currency->id : Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
@@ -2508,7 +2533,7 @@ class ProductCore extends ObjectModel
|
||||
$id_state = 0;
|
||||
$zipcode = 0;
|
||||
|
||||
if (!$id_address)
|
||||
if (!$id_address && Validate::isLoadedObject($cur_cart))
|
||||
$id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
|
||||
|
||||
if ($id_address)
|
||||
@@ -2719,8 +2744,7 @@ class ProductCore extends ObjectModel
|
||||
if ($use_group_reduction)
|
||||
{
|
||||
$reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group);
|
||||
|
||||
if (!empty($reduction_from_category) && (float)$reduction_from_category == 0)
|
||||
if ($reduction_from_category !== false)
|
||||
$price -= $price * (float)$reduction_from_category;
|
||||
else // apply group reduction if there is no group reduction for this category
|
||||
$price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100);
|
||||
@@ -2914,7 +2938,7 @@ class ProductCore extends ObjectModel
|
||||
* @param Shop $shop
|
||||
* @return string
|
||||
*/
|
||||
public static function sqlStock($product_alias, $product_attribute = 0, $inner_join = false, Shop $shop = null)
|
||||
public static function sqlStock($product_alias, $product_attribute = null, $inner_join = false, Shop $shop = null)
|
||||
{
|
||||
$id_shop = ($shop !== null ? (int)$shop->id : null);
|
||||
$sql = (($inner_join) ? ' INNER ' : ' LEFT ').'
|
||||
@@ -3055,18 +3079,18 @@ class ProductCore extends ObjectModel
|
||||
if (!Combination::isFeatureActive())
|
||||
return array();
|
||||
$sql = 'SELECT ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name,
|
||||
a.`id_attribute`, al.`name` AS attribute_name, a.`color` AS attribute_color, pa.`id_product_attribute`,
|
||||
IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`price`, product_attribute_shop.`ecotax`, pa.`weight`,
|
||||
a.`id_attribute`, al.`name` AS attribute_name, a.`color` AS attribute_color, product_attribute_shop.`id_product_attribute`,
|
||||
IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`price`, product_attribute_shop.`ecotax`, product_attribute_shop.`weight`,
|
||||
product_attribute_shop.`default_on`, pa.`reference`, product_attribute_shop.`unit_price_impact`,
|
||||
pa.`minimal_quantity`, pa.`available_date`, ag.`group_type`
|
||||
product_attribute_shop.`minimal_quantity`, product_attribute_shop.`available_date`, ag.`group_type`
|
||||
FROM `'._DB_PREFIX_.'product_attribute` pa
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
'.Product::sqlStock('pa', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_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_lang` al ON a.`id_attribute` = al.`id_attribute`
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON ag.`id_attribute_group` = agl.`id_attribute_group`
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_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_lang` al ON (a.`id_attribute` = al.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group`)
|
||||
'.Shop::addSqlAssociation('attribute', 'a').'
|
||||
WHERE pa.`id_product` = '.(int)$this->id.'
|
||||
AND al.`id_lang` = '.(int)$id_lang.'
|
||||
@@ -3159,8 +3183,9 @@ class ProductCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (p.`id_manufacturer`= m.`id_manufacturer`)
|
||||
'.Product::sqlStock('p', 0).'
|
||||
WHERE `id_product_1` = '.(int)$this->id.
|
||||
($active ? ' AND product_shop.`active` = 1' : '').'
|
||||
($active ? ' AND product_shop.`active` = 1 AND product_shop.`visibility` != \'none\'' : '').'
|
||||
GROUP BY product_shop.id_product';
|
||||
|
||||
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql))
|
||||
return false;
|
||||
foreach ($result as &$row)
|
||||
@@ -3312,7 +3337,7 @@ class ProductCore extends ObjectModel
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = new DbQuery();
|
||||
$sql->select('p.`id_product`, pl.`name`, p.`active`, p.`reference`, m.`name` AS manufacturer_name, stock.`quantity`, product_shop.advanced_stock_management, p.`customizable`');
|
||||
$sql->select('p.`id_product`, pl.`name`, p.`ean13`, p.`upc`, p.`active`, p.`reference`, m.`name` AS manufacturer_name, stock.`quantity`, product_shop.advanced_stock_management, p.`customizable`');
|
||||
$sql->from('category_product', 'cp');
|
||||
$sql->leftJoin('product', 'p', 'p.`id_product` = cp.`id_product`');
|
||||
$sql->join(Shop::addSqlAssociation('product', 'p'));
|
||||
@@ -3323,6 +3348,8 @@ class ProductCore extends ObjectModel
|
||||
$sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`');
|
||||
|
||||
$where = 'pl.`name` LIKE \'%'.pSQL($query).'%\'
|
||||
OR p.`ean13` LIKE \'%'.pSQL($query).'%\'
|
||||
OR p.`upc` LIKE \'%'.pSQL($query).'%\'
|
||||
OR p.`reference` LIKE \'%'.pSQL($query).'%\'
|
||||
OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\'
|
||||
OR p.`id_product` IN (SELECT id_product FROM '._DB_PREFIX_.'product_supplier sp WHERE `product_supplier_reference` LIKE \'%'.pSQL($query).'%\')';
|
||||
@@ -3576,6 +3603,7 @@ class ProductCore extends ObjectModel
|
||||
if ($result3)
|
||||
{
|
||||
$result3['id_feature_value'] = $new_id_feature_value;
|
||||
$result3['value'] = pSQL($result3['value']);
|
||||
$return &= Db::getInstance()->insert('feature_value_lang', $result3);
|
||||
}
|
||||
}
|
||||
@@ -4285,19 +4313,25 @@ class ProductCore extends ObjectModel
|
||||
|
||||
public function checkAccess($id_customer)
|
||||
{
|
||||
if (!$id_customer)
|
||||
return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND ctg.`id_group` ='.(int)Group::getCurrent()->id);
|
||||
else
|
||||
return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT cg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND cg.`id_customer` = '.(int)$id_customer);
|
||||
$cache_id = 'Product::checkAccess_'.(int)$this->id.'-'.(int)$id_customer.(!$id_customer ? '-'.(int)Group::getCurrent()->id : '');
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
if (!$id_customer)
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT ctg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id);
|
||||
else
|
||||
$result = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT cg.`id_group`
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)
|
||||
WHERE cp.`id_product` = '.(int)$this->id.' AND cg.`id_customer` = '.(int)$id_customer);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -4857,8 +4891,12 @@ class ProductCore extends ObjectModel
|
||||
*/
|
||||
public static function getAttributesParams($id_product, $id_product_attribute)
|
||||
{
|
||||
$id_lang = (int)Context::getContext()->language->id;
|
||||
$id_shop = (int)Context::getContext()->shop->id;
|
||||
$cache_id = 'Product::getAttributesParams_'.(int)$id_product.'-'.(int)$id_product_attribute.'-'.(int)$id_lang.'-'.(int)$id_shop;
|
||||
|
||||
// if blocklayered module is installed we check if user has set custom attribute name
|
||||
if (Module::isInstalled('blocklayered'))
|
||||
if (Module::isInstalled('blocklayered') && Module::isEnabled('blocklayered'))
|
||||
{
|
||||
$nb_custom_values = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT la.`id_attribute`, la.`url_name` as `name`
|
||||
@@ -4869,7 +4907,7 @@ class ProductCore extends ObjectModel
|
||||
ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` la
|
||||
ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE la.`url_name` IS NOT NULL AND la.`url_name` != \'\'
|
||||
AND pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute);
|
||||
@@ -4887,7 +4925,7 @@ class ProductCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND g.`id_lang` = '.(int)$id_lang.'
|
||||
AND g.`url_name` IS NOT NULL AND g.`url_name` != \'\'');
|
||||
if (empty($group))
|
||||
{
|
||||
@@ -4897,7 +4935,7 @@ class ProductCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute` a
|
||||
ON (a.`id_attribute_group` = g.`id_attribute_group`)
|
||||
WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND g.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND g.`id_lang` = '.(int)$id_lang.'
|
||||
AND g.`name` IS NOT NULL');
|
||||
}
|
||||
$result[] = array_merge($attribute, $group[0]);
|
||||
@@ -4906,9 +4944,9 @@ class ProductCore extends ObjectModel
|
||||
SELECT DISTINCT a.`id_attribute_group`, al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (a.`id_attribute` = pac.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
@@ -4917,45 +4955,30 @@ class ProductCore extends ObjectModel
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.id_product_attribute = '.(int)$id_product_attribute.'
|
||||
AND a.`id_attribute` NOT IN('.implode(', ', $tab_id_attribute).')');
|
||||
$result = array_merge($values_not_custom, $result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (al.`id_attribute` = a.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (pac.`id_attribute` = a.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pa.`id_product_attribute` = pac.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute.'
|
||||
AND agl.`id_lang` = '.(int)Context::getContext()->language->id);
|
||||
return array_merge($values_not_custom, $result);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT al.`name`, agl.`name` as `group`
|
||||
FROM `'._DB_PREFIX_.'attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (al.`id_attribute` = a.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (al.`id_attribute` = a.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac
|
||||
ON (pac.`id_attribute` = a.`id_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (pa.`id_product_attribute` = pac.`id_product_attribute`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)Context::getContext()->language->id.')
|
||||
ON (a.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
|
||||
WHERE pa.`id_product` = '.(int)$id_product.'
|
||||
AND pac.`id_product_attribute` = '.(int)$id_product_attribute.'
|
||||
AND agl.`id_lang` = '.(int)Context::getContext()->language->id);
|
||||
AND agl.`id_lang` = '.(int)$id_lang);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
$result = Cache::retrieve($cache_id);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -299,10 +299,10 @@ class ProductDownloadCore extends ObjectModel
|
||||
*/
|
||||
public static function getNewFilename()
|
||||
{
|
||||
$ret = sha1(microtime());
|
||||
if (file_exists(_PS_DOWNLOAD_DIR_.$ret))
|
||||
$ret = ProductDownload::getNewFilename();
|
||||
return $ret;
|
||||
do {
|
||||
$filename = sha1(microtime());
|
||||
} while (file_exists(_PS_DOWNLOAD_DIR_.$filename));
|
||||
return $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,4 +314,4 @@ class ProductDownloadCore extends ObjectModel
|
||||
{
|
||||
return Configuration::get('PS_VIRTUAL_PROD_FEATURE_ACTIVE');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,11 +74,21 @@ class ProductSaleCore
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
|
||||
|
||||
//Subquery: get product ids in a separate query to (greatly!) improve performances and RAM usage
|
||||
$sql = 'SELECT cp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'category_group` cg
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
|
||||
WHERE cg.`id_group` '.$sql_groups;
|
||||
$products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
$ids = array();
|
||||
foreach ($products as $product)
|
||||
$ids[$product['id_product']] = 1;
|
||||
$ids = array_keys($ids);
|
||||
sort($ids);
|
||||
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
||||
|
||||
$prefix = '';
|
||||
if ($order_by == 'date_add')
|
||||
$prefix = 'p.';
|
||||
|
||||
//Main query
|
||||
$sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity,
|
||||
pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`,
|
||||
pl.`meta_keywords`, pl.`meta_title`, pl.`name`,
|
||||
@@ -104,12 +114,7 @@ class ProductSaleCore
|
||||
'.Product::sqlStock('p').'
|
||||
WHERE product_shop.`active` = 1
|
||||
AND p.`visibility` != \'none\'
|
||||
AND p.`id_product` IN (
|
||||
SELECT cp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'category_group` cg
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
|
||||
WHERE cg.`id_group` '.$sql_groups.'
|
||||
)
|
||||
AND p.`id_product` IN ('.$ids.')
|
||||
GROUP BY product_shop.id_product
|
||||
ORDER BY '.(!empty($order_table) ? '`'.pSQL($order_table).'`.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).'
|
||||
LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products;
|
||||
@@ -141,11 +146,27 @@ class ProductSaleCore
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||
|
||||
//Subquery: get product ids in a separate query to (greatly!) improve performances and RAM usage
|
||||
$sql = 'SELECT cp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'category_group` cg
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
|
||||
WHERE cg.`id_group` '.$sql_groups.' AND cp.`id_product` IS NOT NULL';
|
||||
$products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
$ids = array();
|
||||
foreach ($products as $product)
|
||||
$ids[$product['id_product']] = 1;
|
||||
$ids = array_keys($ids);
|
||||
sort($ids);
|
||||
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
||||
|
||||
//Main query
|
||||
$sql = 'SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, MAX(image_shop.`id_image`) id_image, il.`legend`,
|
||||
ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category
|
||||
ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category, p.show_price, p.available_for_order, p.quantity, p.customizable,
|
||||
IFNULL(pa.minimal_quantity, p.minimal_quantity) as minimal_quantity, p.out_of_stock
|
||||
FROM `'._DB_PREFIX_.'product_sale` ps
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product`
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (ps.`id_product` = pa.`id_product` AND pa.default_on = 1)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
ON p.`id_product` = pl.`id_product`
|
||||
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
|
||||
@@ -157,15 +178,11 @@ class ProductSaleCore
|
||||
AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
|
||||
WHERE product_shop.`active` = 1
|
||||
AND p.`visibility` != \'none\'
|
||||
AND p.`id_product` IN (
|
||||
SELECT cp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'category_group` cg
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
|
||||
WHERE cg.`id_group` '.$sql_groups.'
|
||||
)
|
||||
AND p.`id_product` IN ('.$ids.')
|
||||
GROUP BY product_shop.id_product
|
||||
ORDER BY sales DESC
|
||||
LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products;
|
||||
|
||||
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql))
|
||||
return false;
|
||||
|
||||
@@ -173,6 +190,13 @@ class ProductSaleCore
|
||||
{
|
||||
$row['link'] = $context->link->getProductLink($row['id_product'], $row['link_rewrite'], $row['category'], $row['ean13']);
|
||||
$row['id_image'] = Product::defineProductImage($row, $id_lang);
|
||||
$row['allow_oosp'] = Product::isAvailableWhenOutOfStock($row['out_of_stock']);
|
||||
$row['price_tax_exc'] = Product::getPriceStatic(
|
||||
(int)$row['id_product'],
|
||||
false,
|
||||
((isset($row['id_product_attribute']) && !empty($row['id_product_attribute'])) ? (int)$row['id_product_attribute'] : null),
|
||||
(Product::$_taxCalculationMethod == PS_TAX_EXC ? 2 : 6)
|
||||
);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -139,21 +139,22 @@ class ReferrerCore extends ObjectModel
|
||||
}
|
||||
|
||||
$sql = 'SELECT COUNT(DISTINCT cs.id_connections_source) AS visits,
|
||||
COUNT(DISTINCT cs.id_connections) as visitors,
|
||||
COUNT(DISTINCT c.id_guest) as uniqs,
|
||||
COUNT(DISTINCT cp.time_start) as pages
|
||||
FROM '._DB_PREFIX_.'referrer_cache rc
|
||||
LEFT JOIN '._DB_PREFIX_.'referrer r ON rc.id_referrer = r.id_referrer
|
||||
LEFT JOIN '._DB_PREFIX_.'referrer_shop rs ON r.id_referrer = rs.id_referrer
|
||||
LEFT JOIN '._DB_PREFIX_.'connections_source cs ON rc.id_connections_source = cs.id_connections_source
|
||||
LEFT JOIN '._DB_PREFIX_.'connections c ON cs.id_connections = c.id_connections
|
||||
LEFT JOIN '._DB_PREFIX_.'connections_page cp ON cp.id_connections = c.id_connections
|
||||
'.$join.'
|
||||
WHERE cs.date_add BETWEEN '.ModuleGraph::getDateBetween($employee).'
|
||||
'.Shop::addSqlRestriction(false, 'rs').'
|
||||
'.Shop::addSqlRestriction(false, 'c').'
|
||||
AND rc.id_referrer = '.(int)$this->id
|
||||
.$where;
|
||||
COUNT(DISTINCT cs.id_connections) as visitors,
|
||||
COUNT(DISTINCT c.id_guest) as uniqs,
|
||||
COUNT(DISTINCT cp.time_start) as pages
|
||||
FROM '._DB_PREFIX_.'referrer_cache rc
|
||||
LEFT JOIN '._DB_PREFIX_.'referrer r ON rc.id_referrer = r.id_referrer
|
||||
LEFT JOIN '._DB_PREFIX_.'referrer_shop rs ON r.id_referrer = rs.id_referrer
|
||||
LEFT JOIN '._DB_PREFIX_.'connections_source cs ON rc.id_connections_source = cs.id_connections_source
|
||||
LEFT JOIN '._DB_PREFIX_.'connections c ON cs.id_connections = c.id_connections
|
||||
LEFT JOIN '._DB_PREFIX_.'connections_page cp ON cp.id_connections = c.id_connections
|
||||
'.$join.'
|
||||
WHERE 1'.
|
||||
((isset($employee->stats_date_from) && isset($employee->stats_date_from))? ' AND cs.date_add BETWEEN \''.pSQL($employee->stats_date_from).' 00:00:00\' AND \''.pSQL($employee->stats_date_to).' 23:59:59\'' : '').
|
||||
Shop::addSqlRestriction(false, 'rs').
|
||||
Shop::addSqlRestriction(false, 'c').
|
||||
' AND rc.id_referrer = '.(int)$this->id.
|
||||
$where;
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
|
||||
}
|
||||
|
||||
@@ -314,6 +315,7 @@ class ReferrerCore extends ObjectModel
|
||||
FROM '._DB_PREFIX_.'referrer r
|
||||
LEFT JOIN '._DB_PREFIX_.'connections_source cs ON ('.self::$_join.')
|
||||
WHERE id_referrer = '.(int)$row['id_referrer'].'
|
||||
AND id_connections_source IS NOT NULL
|
||||
)');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,36 +140,33 @@ class SearchCore
|
||||
$string = implode(' ', $processed_words);
|
||||
}
|
||||
|
||||
if ($indexation)
|
||||
// If the language is constituted with symbol and there is no "words", then split every chars
|
||||
if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen'))
|
||||
{
|
||||
// If the language is constituted with symbol and there is no "words", then split every chars
|
||||
if (in_array($iso_code, array('zh', 'tw', 'ja')) && function_exists('mb_strlen'))
|
||||
{
|
||||
// Cut symbols from letters
|
||||
$symbols = '';
|
||||
$letters = '';
|
||||
foreach (explode(' ', $string) as $mb_word)
|
||||
if (strlen(Tools::replaceAccentedChars($mb_word)) == mb_strlen(Tools::replaceAccentedChars($mb_word)))
|
||||
$letters .= $mb_word.' ';
|
||||
else
|
||||
$symbols .= $mb_word.' ';
|
||||
|
||||
if (preg_match_all('/./u', $symbols, $matches))
|
||||
$symbols = implode(' ', $matches[0]);
|
||||
// Cut symbols from letters
|
||||
$symbols = '';
|
||||
$letters = '';
|
||||
foreach (explode(' ', $string) as $mb_word)
|
||||
if (strlen(Tools::replaceAccentedChars($mb_word)) == mb_strlen(Tools::replaceAccentedChars($mb_word)))
|
||||
$letters .= $mb_word.' ';
|
||||
else
|
||||
$symbols .= $mb_word.' ';
|
||||
|
||||
if (preg_match_all('/./u', $symbols, $matches))
|
||||
$symbols = implode(' ', $matches[0]);
|
||||
|
||||
$string = $letters.$symbols;
|
||||
}
|
||||
else
|
||||
$string = $letters.$symbols;
|
||||
}
|
||||
elseif ($indexation)
|
||||
{
|
||||
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
|
||||
if ($minWordLen > 1)
|
||||
{
|
||||
$minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN');
|
||||
if ($minWordLen > 1)
|
||||
{
|
||||
$minWordLen -= 1;
|
||||
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string);
|
||||
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string);
|
||||
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
||||
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
||||
}
|
||||
$minWordLen -= 1;
|
||||
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string);
|
||||
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string);
|
||||
$string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
||||
$string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
if (parent::add($autodate, $nullValues))
|
||||
{
|
||||
// Flush cache when we adding a new specific price
|
||||
self::$_specificPriceCache = array();
|
||||
SpecificPrice::$_specificPriceCache = array();
|
||||
Product::flushPriceCache();
|
||||
// Set cache of feature detachable to true
|
||||
Configuration::updateGlobalValue('PS_SPECIFIC_PRICE_FEATURE_ACTIVE', '1');
|
||||
@@ -108,7 +108,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
if (parent::update($null_values))
|
||||
{
|
||||
// Flush cache when we updating a new specific price
|
||||
self::$_specificPriceCache = array();
|
||||
SpecificPrice::$_specificPriceCache = array();
|
||||
Product::flushPriceCache();
|
||||
return true;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
if (parent::delete())
|
||||
{
|
||||
// Flush cache when we deletind a new specific price
|
||||
self::$_specificPriceCache = array();
|
||||
SpecificPrice::$_specificPriceCache = array();
|
||||
Product::flushPriceCache();
|
||||
// Refresh cache of feature detachable
|
||||
Configuration::updateGlobalValue('PS_SPECIFIC_PRICE_FEATURE_ACTIVE', SpecificPrice::isCurrentlyUsed($this->def['table']));
|
||||
@@ -169,7 +169,8 @@ class SpecificPriceCore extends ObjectModel
|
||||
|
||||
$priority = SpecificPrice::getPriority($id_product);
|
||||
foreach (array_reverse($priority) as $k => $field)
|
||||
$select .= ' IF (`'.bqSQL($field).'` = '.(int)$$field.', '.pow(2, $k + 1).', 0) + ';
|
||||
if (!empty($field))
|
||||
$select .= ' IF (`'.bqSQL($field).'` = '.(int)$$field.', '.pow(2, $k + 1).', 0) + ';
|
||||
|
||||
return rtrim($select, ' +').') AS `score`';
|
||||
}
|
||||
@@ -179,9 +180,9 @@ class SpecificPriceCore extends ObjectModel
|
||||
if (!SpecificPrice::isFeatureActive())
|
||||
return explode(';', Configuration::get('PS_SPECIFIC_PRICE_PRIORITIES'));
|
||||
|
||||
if (!isset(self::$_cache_priorities[(int)$id_product]))
|
||||
if (!isset(SpecificPrice::$_cache_priorities[(int)$id_product]))
|
||||
{
|
||||
self::$_cache_priorities[(int)$id_product] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SpecificPrice::$_cache_priorities[(int)$id_product] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `priority`, `id_specific_price_priority`
|
||||
FROM `'._DB_PREFIX_.'specific_price_priority`
|
||||
WHERE `id_product` = '.(int)$id_product.'
|
||||
@@ -189,7 +190,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
');
|
||||
}
|
||||
|
||||
$priority = self::$_cache_priorities[(int)$id_product];
|
||||
$priority = SpecificPrice::$_cache_priorities[(int)$id_product];
|
||||
|
||||
if (!$priority)
|
||||
$priority = Configuration::get('PS_SPECIFIC_PRICE_PRIORITIES');
|
||||
@@ -208,11 +209,11 @@ class SpecificPriceCore extends ObjectModel
|
||||
*/
|
||||
|
||||
$key = ((int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.(int)$id_group.'-'.(int)$quantity.'-'.(int)$id_product_attribute.'-'.(int)$id_cart.'-'.(int)$id_customer.'-'.(int)$real_quantity);
|
||||
if (!array_key_exists($key, self::$_specificPriceCache))
|
||||
if (!array_key_exists($key, SpecificPrice::$_specificPriceCache))
|
||||
{
|
||||
$now = date('Y-m-d H:i:s');
|
||||
self::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT *, '.SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
$query = '
|
||||
SELECT *, '.SpecificPrice::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group, $id_customer).'
|
||||
FROM `'._DB_PREFIX_.'specific_price`
|
||||
WHERE `id_product` IN (0, '.(int)$id_product.')
|
||||
AND `id_product_attribute` IN (0, '.(int)$id_product_attribute.')
|
||||
@@ -227,11 +228,22 @@ class SpecificPriceCore extends ObjectModel
|
||||
AND
|
||||
(`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`)
|
||||
)
|
||||
AND id_cart IN (0, '.(int)$id_cart.')'.
|
||||
(($real_quantity != 0 && !Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION')) ? ' AND IF(`from_quantity` > 1, `from_quantity`, 0) <= IF(id_product_attribute=0,'.(int)$quantity.' ,'.(int)$real_quantity.')' : 'AND `from_quantity` <= '.(int)$real_quantity).'
|
||||
ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC');
|
||||
AND id_cart IN (0, '.(int)$id_cart.') ';
|
||||
|
||||
if ($real_quantity != 0 && !Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION'))
|
||||
$query .= ' AND IF(`from_quantity` > 1, `from_quantity`, 0) <= IF(id_product_attribute=0,'.(int)$quantity.' ,'.(int)$real_quantity.')';
|
||||
else
|
||||
{
|
||||
$qty_to_use = $id_cart ? (int)$quantity : (int)$real_quantity;
|
||||
$query .= 'AND `from_quantity` <= '.max(1, $qty_to_use);
|
||||
}
|
||||
|
||||
$query .= ' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC';
|
||||
|
||||
SpecificPrice::$_specificPriceCache[$key] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
|
||||
|
||||
}
|
||||
return self::$_specificPriceCache[$key];
|
||||
return SpecificPrice::$_specificPriceCache[$key];
|
||||
}
|
||||
|
||||
public static function setPriorities($priorities)
|
||||
@@ -301,7 +313,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
if (!isset($last_quantity[(int)$specific_price['id_product_attribute']]))
|
||||
$last_quantity[(int)$specific_price['id_product_attribute']] = $specific_price['from_quantity'];
|
||||
elseif ($last_quantity[(int)$specific_price['id_product_attribute']] == $specific_price['from_quantity'])
|
||||
break;
|
||||
continue;
|
||||
|
||||
$last_quantity[(int)$specific_price['id_product_attribute']] = $specific_price['from_quantity'];
|
||||
if ($specific_price['from_quantity'] > 1)
|
||||
|
||||
@@ -183,7 +183,7 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
|
||||
if ($conditions_group)
|
||||
{
|
||||
$where .= ' AND (';
|
||||
$where .= ' AND ((';
|
||||
foreach ($conditions_group as $id_condition_group => $condition_group)
|
||||
{
|
||||
$fields = array(
|
||||
@@ -235,7 +235,7 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
|
||||
$where = rtrim($where, ' AND ').') OR (';
|
||||
}
|
||||
$where = rtrim($where, 'OR (');
|
||||
$where = rtrim($where, 'OR (').')';
|
||||
}
|
||||
if ($products && count($products))
|
||||
$where .= ' AND p.id_product IN ('.implode(', ', array_map('intval', $products)).')';
|
||||
@@ -267,7 +267,7 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
public static function applyRuleToProduct($id_rule, $id_product, $id_product_attribute = null)
|
||||
{
|
||||
$rule = new SpecificPriceRule((int)$id_rule);
|
||||
if (!Validate::isLoadedObject($rule))
|
||||
if (!Validate::isLoadedObject($rule) || !$id_product)
|
||||
return false;
|
||||
|
||||
$specific_price = new SpecificPrice();
|
||||
|
||||
@@ -80,13 +80,19 @@ class StateCore extends ObjectModel
|
||||
*/
|
||||
public static function getNameById($id_state)
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `id_state` = '.(int)$id_state
|
||||
);
|
||||
|
||||
return $result['name'];
|
||||
if (!$id_state)
|
||||
return false;
|
||||
$cache_id = 'State::getNameById_'.(int)$id_state;
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `name`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `id_state` = '.(int)$id_state
|
||||
);
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,13 +103,19 @@ class StateCore extends ObjectModel
|
||||
*/
|
||||
public static function getIdByName($state)
|
||||
{
|
||||
$result = Db::getInstance()->getValue('
|
||||
SELECT `id_state`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `name` LIKE \''.pSQL($state).'\'
|
||||
');
|
||||
|
||||
return (int)$result;
|
||||
if (empty($state))
|
||||
return false;
|
||||
$cache_id = 'State::getNameById_'.pSQL($state);
|
||||
if (!Cache::isStored($cache_id))
|
||||
{
|
||||
$result = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_state`
|
||||
FROM `'._DB_PREFIX_.'state`
|
||||
WHERE `name` LIKE \''.pSQL($state).'\'
|
||||
');
|
||||
Cache::store($cache_id, $result);
|
||||
}
|
||||
return Cache::retrieve($cache_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,7 @@ class SupplierCore extends ObjectModel
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
|
||||
// Lang fields
|
||||
'description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'),
|
||||
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
|
||||
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
|
||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user