mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Compare commits
953 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dbab22060 | ||
|
|
35b1868693 | ||
|
|
bb6440af9d | ||
|
|
cdc160b9a9 | ||
|
|
ec2067df7d | ||
|
|
271f42e761 | ||
|
|
e7a4f04da4 | ||
|
|
efb9d184e4 | ||
|
|
242eaa9394 | ||
|
|
4caeddf7f8 | ||
|
|
44d4ab6f9c | ||
|
|
8f96383186 | ||
|
|
db975bbcc2 | ||
|
|
e609622f2b | ||
|
|
0c9fb16a36 | ||
|
|
0294f3dc34 | ||
|
|
0e57f62d02 | ||
|
|
bc64aba3a6 | ||
|
|
0692e01fea | ||
|
|
47da6793c5 | ||
|
|
e2000473a5 | ||
|
|
9eb66548a5 | ||
|
|
878ee35e5d | ||
|
|
7af883abc1 | ||
|
|
e365a14b5a | ||
|
|
9cbba5941f | ||
|
|
c995794e2d | ||
|
|
12f0a36095 | ||
|
|
fc489380a1 | ||
|
|
0743c656ac | ||
|
|
4d962f165d | ||
|
|
641803ce7c | ||
|
|
9c493127d5 | ||
|
|
1f58c60b6e | ||
|
|
2be7da1031 | ||
|
|
d6cb95b0f7 | ||
|
|
f2407a3f94 | ||
|
|
ec78f21c26 | ||
|
|
53b565ec1d | ||
|
|
21c2dba922 | ||
|
|
f5a7275077 | ||
|
|
a725ffefdd | ||
|
|
5eff0e7a0c | ||
|
|
564badc61b | ||
|
|
ddad00c8e4 | ||
|
|
f24c38db73 | ||
|
|
e188855dca | ||
|
|
9aa5c94612 | ||
|
|
ba724204a4 | ||
|
|
88d8f73614 | ||
|
|
fa4b5d99c0 | ||
|
|
8518c772fb | ||
|
|
a4344a7ec5 | ||
|
|
aae83d248c | ||
|
|
28aa17e4fd | ||
|
|
fd3fd9d945 | ||
|
|
cea3d93b91 | ||
|
|
5649e865c3 | ||
|
|
1e20e082fe | ||
|
|
33e40c12c8 | ||
|
|
9f8e21bc2c | ||
|
|
d28edae460 | ||
|
|
6787998c56 | ||
|
|
ebdcff3b49 | ||
|
|
c1a2e7b12e | ||
|
|
a724cadd1f | ||
|
|
621f0812a1 | ||
|
|
a94b2b4f7e | ||
|
|
cd4f59bb2a | ||
|
|
e8b3875e2e | ||
|
|
d591a83085 | ||
|
|
2fc05a4c1c | ||
|
|
3b7c385c6c | ||
|
|
ccc1d4d1fa | ||
|
|
7e68f9e013 | ||
|
|
ddb68a3ae8 | ||
|
|
edbcf78495 | ||
|
|
0bc5ec8c78 | ||
|
|
65105a3e05 | ||
|
|
9d7f7e2090 | ||
|
|
c0c894d6f4 | ||
|
|
f8cc75ecf2 | ||
|
|
15bc4a7d6b | ||
|
|
a0fffbae04 | ||
|
|
19b9412c13 | ||
|
|
23749b57ec | ||
|
|
3959d12a39 | ||
|
|
dd8d4e9e98 | ||
|
|
586005ff2e | ||
|
|
f9db196512 | ||
|
|
0e91b32e99 | ||
|
|
973f408b6e | ||
|
|
d334fe1292 | ||
|
|
b02c89bd8b | ||
|
|
49d955b794 | ||
|
|
0c1d4c9d51 | ||
|
|
126fbf9f63 | ||
|
|
82b7f0e9e4 | ||
|
|
899f0bee9a | ||
|
|
b56eaf91e8 | ||
|
|
b4895c4dd2 | ||
|
|
fdf5d457a8 | ||
|
|
cee573cf96 | ||
|
|
eecd82a0fd | ||
|
|
dbf330b49c | ||
|
|
05cdbcc092 | ||
|
|
b966286895 | ||
|
|
0e4c113e7f | ||
|
|
ffc1d8fb97 | ||
|
|
42b043feef | ||
|
|
682ad98918 | ||
|
|
fb6a1d1f51 | ||
|
|
51b0758263 | ||
|
|
c73c962459 | ||
|
|
82898b1aca | ||
|
|
9989180c5f | ||
|
|
9247bbcc1d | ||
|
|
15406f16d2 | ||
|
|
707dd85f43 | ||
|
|
e6e440e573 | ||
|
|
8064ecce73 | ||
|
|
da4fe03be7 | ||
|
|
ca8dab36a3 | ||
|
|
01c6de1085 | ||
|
|
6d918ad1c7 | ||
|
|
3bbb30ccf6 | ||
|
|
ffcc6b6d69 | ||
|
|
13d3ff8ef7 | ||
|
|
480ad63c5d | ||
|
|
7773f8f017 | ||
|
|
dfc8698422 | ||
|
|
ff696e0dad | ||
|
|
3dcd1aa05d | ||
|
|
8dfe4fe05f | ||
|
|
65d59405da | ||
|
|
0e2e8fe27f | ||
|
|
0d1f67145e | ||
|
|
c1a046601c | ||
|
|
6054e23b4d | ||
|
|
92f9f3179e | ||
|
|
7232e38dbe | ||
|
|
f2c282305e | ||
|
|
dcc98b6026 | ||
|
|
54b81312b5 | ||
|
|
9142599ea5 | ||
|
|
b1c799ee08 | ||
|
|
09621af54e | ||
|
|
1336d3e791 | ||
|
|
da52742421 | ||
|
|
9d15a7a18c | ||
|
|
2b13c05d13 | ||
|
|
eb8d7f92c3 | ||
|
|
2a9cd21b71 | ||
|
|
44eedb8c6e | ||
|
|
82a35f82b4 | ||
|
|
f033e91cb0 | ||
|
|
41bba0e879 | ||
|
|
5df25fece7 | ||
|
|
c998abe54e | ||
|
|
dc15d09f12 | ||
|
|
9bfd5c4f41 | ||
|
|
46119c99a2 | ||
|
|
f12c709ec1 | ||
|
|
e85548d470 | ||
|
|
637e8f44e6 | ||
|
|
19734c89d6 | ||
|
|
4e844b4687 | ||
|
|
96f08082a2 | ||
|
|
6fd08bc5ef | ||
|
|
406089ef0c | ||
|
|
7cd09eb649 | ||
|
|
7393abea8f | ||
|
|
2436f0967b | ||
|
|
fcdfd370ba | ||
|
|
89ba133c61 | ||
|
|
da2ce063b3 | ||
|
|
fde44f2792 | ||
|
|
181991ee47 | ||
|
|
d82cbf6636 | ||
|
|
e87e354bd5 | ||
|
|
a129e91198 | ||
|
|
cffee1df4b | ||
|
|
02f8ac4cbc | ||
|
|
1683f46d9b | ||
|
|
1e45b9b1cd | ||
|
|
678e23b13a | ||
|
|
1106198c05 | ||
|
|
4ab759b067 | ||
|
|
ad3297b0ef | ||
|
|
d3f630e4b5 | ||
|
|
dc32350ee7 | ||
|
|
58b2365f8a | ||
|
|
6abd4cc120 | ||
|
|
664eafd810 | ||
|
|
66a732c005 | ||
|
|
c8bcd01a10 | ||
|
|
0a2c950401 | ||
|
|
983e28691b | ||
|
|
4ab59eebf3 | ||
|
|
fc29aa7d3b | ||
|
|
1750e385a9 | ||
|
|
77c716565e | ||
|
|
53e9da4748 | ||
|
|
29950a6afa | ||
|
|
00b617d17f | ||
|
|
b027db49b5 | ||
|
|
c75db78cea | ||
|
|
b70f52a615 | ||
|
|
b4d241a12b | ||
|
|
452a8cfe18 | ||
|
|
604052d1a1 | ||
|
|
5275d3cd48 | ||
|
|
67f5ef913e | ||
|
|
fc0c4295bd | ||
|
|
a90afd3180 | ||
|
|
17773f8414 | ||
|
|
bede1116a8 | ||
|
|
b5929fb7c4 | ||
|
|
87b4805bc0 | ||
|
|
fa21b27ced | ||
|
|
6c9cddaa9c | ||
|
|
7ba8cad2aa | ||
|
|
e4a757ff9e | ||
|
|
98eb07d6f2 | ||
|
|
8289eec510 | ||
|
|
6c71cc1e14 | ||
|
|
0c770b8810 | ||
|
|
9a9ed8989e | ||
|
|
444f7703a6 | ||
|
|
ba8ef15916 | ||
|
|
64bb2e6ece | ||
|
|
f0394c42d5 | ||
|
|
962aa9f977 | ||
|
|
0c8291b60f | ||
|
|
8bb8e92ff2 | ||
|
|
80aebef63f | ||
|
|
2741e12376 | ||
|
|
f1565bb283 | ||
|
|
9f6cfc5a07 | ||
|
|
99c309b517 | ||
|
|
313e0f86dc | ||
|
|
bdc8854baa | ||
|
|
03765528e1 | ||
|
|
2468c0e120 | ||
|
|
806c53d4c4 | ||
|
|
71b9ac384f | ||
|
|
d2b96fe0f6 | ||
|
|
a1c0e1ad1f | ||
|
|
be7c1c8a23 | ||
|
|
02bb39d438 | ||
|
|
4b2b2328c3 | ||
|
|
0756a01002 | ||
|
|
3029804db7 | ||
|
|
eed689e1c1 | ||
|
|
a2adc6fc58 | ||
|
|
34c61edcbd | ||
|
|
85fe1d6d1e | ||
|
|
66437c472a | ||
|
|
f38fca8174 | ||
|
|
766463a0b2 | ||
|
|
2852e6ff9e | ||
|
|
54c9a60fa3 | ||
|
|
53244c5f45 | ||
|
|
632751cebc | ||
|
|
136807645d | ||
|
|
ae1da43225 | ||
|
|
f59f605bcc | ||
|
|
562df7a27a | ||
|
|
417daa4289 | ||
|
|
289f90fb1e | ||
|
|
0371183ed9 | ||
|
|
63fafdf120 | ||
|
|
2dc997528b | ||
|
|
bee6abd6fc | ||
|
|
b9540c3eb6 | ||
|
|
dc465d6bac | ||
|
|
f4743c7f1f | ||
|
|
b1de75758f | ||
|
|
265f3d0ab0 | ||
|
|
b1e4e2699b | ||
|
|
eefa65f49b | ||
|
|
039e0ba89e | ||
|
|
34abd39c0c | ||
|
|
8bc826bdda | ||
|
|
6733085071 | ||
|
|
98a613edec | ||
|
|
c016a20aac | ||
|
|
a52ceaf1d2 | ||
|
|
d0d5955fb1 | ||
|
|
053740792f | ||
|
|
9685695577 | ||
|
|
aff8d9c24a | ||
|
|
2ff75dfab4 | ||
|
|
dce1e56a78 | ||
|
|
5221c9e38f | ||
|
|
7bcc76c1aa | ||
|
|
78523e852d | ||
|
|
30d25bcb52 | ||
|
|
30ba753b34 | ||
|
|
e1af439a6d | ||
|
|
bd73545d08 | ||
|
|
7bfad108a8 | ||
|
|
ccf78a1af4 | ||
|
|
b30d7371a4 | ||
|
|
fb30136202 | ||
|
|
e9ecb2e1ee | ||
|
|
102c8a5772 | ||
|
|
8bdece7101 | ||
|
|
ee6780c46e | ||
|
|
759502829c | ||
|
|
68bb625ec7 | ||
|
|
1c07385aba | ||
|
|
830e067eff | ||
|
|
5a4383c9ac | ||
|
|
f2757a63a1 | ||
|
|
308d408cd0 | ||
|
|
2b5bc202fc | ||
|
|
bd52613331 | ||
|
|
946bca3b62 | ||
|
|
a0c81d6230 | ||
|
|
46eed3767f | ||
|
|
52890c64c1 | ||
|
|
faf80b94e9 | ||
|
|
a2733344e7 | ||
|
|
07052196e2 | ||
|
|
bd7e3e57ca | ||
|
|
fb79aaeb0c | ||
|
|
0cb1972674 | ||
|
|
316bc16634 | ||
|
|
3d62ee22d3 | ||
|
|
ff7727466a | ||
|
|
5d22eeeff2 | ||
|
|
3875d26a2f | ||
|
|
db3d16f080 | ||
|
|
bc230dbfc2 | ||
|
|
371c75e76a | ||
|
|
3438a4a9f6 | ||
|
|
9e3a00521d | ||
|
|
5d7587259d | ||
|
|
3c33770f00 | ||
|
|
04091169da | ||
|
|
fe3e11a104 | ||
|
|
ab4da186c5 | ||
|
|
1788508963 | ||
|
|
d75138b362 | ||
|
|
3a7681c186 | ||
|
|
2e32254574 | ||
|
|
c4ca9e92a6 | ||
|
|
6b69e64fb6 | ||
|
|
4e9c7c9efb | ||
|
|
3a32787f15 | ||
|
|
5fc0802eb1 | ||
|
|
7c8bde885b | ||
|
|
91164951de | ||
|
|
4fba60d2bb | ||
|
|
57052e2fba | ||
|
|
9c749a37b1 | ||
|
|
c9972b9eea | ||
|
|
b43dcb24f0 | ||
|
|
8ba05cc242 | ||
|
|
ff5f371428 | ||
|
|
6e60e1f453 | ||
|
|
de17b367c8 | ||
|
|
cdf1d37a1d | ||
|
|
2da16ade6c | ||
|
|
90be175c50 | ||
|
|
be4a00213c | ||
|
|
2f61c4e93b | ||
|
|
1efc2eda69 | ||
|
|
816e4cdde6 | ||
|
|
b905b1b4bc | ||
|
|
d245abe908 | ||
|
|
68ac62d09c | ||
|
|
9b5909300e | ||
|
|
efd44b0ec0 | ||
|
|
5910d10021 | ||
|
|
ed6fefc493 | ||
|
|
ec545f8967 | ||
|
|
5463a02887 | ||
|
|
6cb690e678 | ||
|
|
8fe37b20c0 | ||
|
|
cc0b709ad5 | ||
|
|
2a5e654544 | ||
|
|
b34279da89 | ||
|
|
f95b0c3033 | ||
|
|
88a482c615 | ||
|
|
144de734ce | ||
|
|
1c53035e38 | ||
|
|
e3032ef1c4 | ||
|
|
eba377cdf0 | ||
|
|
10f0434116 | ||
|
|
3c885c1fce | ||
|
|
92ae3c9d52 | ||
|
|
7a9eb0baa7 | ||
|
|
4be2d1414e | ||
|
|
dceb2b5341 | ||
|
|
d963aa8832 | ||
|
|
b630b15991 | ||
|
|
ea3e3b133d | ||
|
|
ff29ac93ad | ||
|
|
3709c6ff47 | ||
|
|
93b4853f8e | ||
|
|
6a20fcc5c0 | ||
|
|
123c047e29 | ||
|
|
b11dbf069e | ||
|
|
b559dc9053 | ||
|
|
e14676be49 | ||
|
|
91ee704dc3 | ||
|
|
1c56f65c27 | ||
|
|
e46d064d5e | ||
|
|
2c32c6c5c9 | ||
|
|
e558adbcfc | ||
|
|
d6e1a6be93 | ||
|
|
4c6f2fc4b5 | ||
|
|
c149af82fe | ||
|
|
d99b3d601a | ||
|
|
fd7d1374c2 | ||
|
|
2be2423dee | ||
|
|
d68719226b | ||
|
|
157112758b | ||
|
|
166d3b08d6 | ||
|
|
6d00097c89 | ||
|
|
0bf1db2fd4 | ||
|
|
ed264182c6 | ||
|
|
44bb5ebf34 | ||
|
|
bb6399e12a | ||
|
|
fc4a16b356 | ||
|
|
d0508d557b | ||
|
|
422191def1 | ||
|
|
620d7109b5 | ||
|
|
332fa77d90 | ||
|
|
ee79df9bc7 | ||
|
|
ae9643bbef | ||
|
|
3deb424b4f | ||
|
|
4e86f872ca | ||
|
|
98d8bad955 | ||
|
|
4fe9a4fd30 | ||
|
|
04fa5ff70b | ||
|
|
fca39d9179 | ||
|
|
3d239e7528 | ||
|
|
11c48a53a5 | ||
|
|
a495d5e982 | ||
|
|
2dd55301de | ||
|
|
52fb627a64 | ||
|
|
1d35d8fd2d | ||
|
|
34dacca77c | ||
|
|
a395ff5ee3 | ||
|
|
10ea7ddeef | ||
|
|
6e08ecde04 | ||
|
|
baadf2dc6c | ||
|
|
1e840fe7ed | ||
|
|
43a47999d7 | ||
|
|
fae0337b3e | ||
|
|
5b8b55cfba | ||
|
|
abc7137c81 | ||
|
|
fc56b88a1f | ||
|
|
d7986fafbc | ||
|
|
9426af8f6a | ||
|
|
21fa60a730 | ||
|
|
e6290b3b62 | ||
|
|
c3d539abff | ||
|
|
a70f5dd90e | ||
|
|
2472dff67b | ||
|
|
0e3ec3ea2d | ||
|
|
e6e224f33c | ||
|
|
0750d4bb6e | ||
|
|
43ed88f056 | ||
|
|
ec3154075a | ||
|
|
0e1cc2b096 | ||
|
|
6abe6462e6 | ||
|
|
b77cadf39a | ||
|
|
9b825df158 | ||
|
|
c9ae46db50 | ||
|
|
6d92591358 | ||
|
|
d5d4b8d8e0 | ||
|
|
cb964a3ab3 | ||
|
|
c02b5b08ea | ||
|
|
a47cd22450 | ||
|
|
567334318a | ||
|
|
4e212054a4 | ||
|
|
8f5f657e4d | ||
|
|
14728e385e | ||
|
|
a3c8f2ed56 | ||
|
|
128bba1d9b | ||
|
|
fd817ed015 | ||
|
|
42a71e9303 | ||
|
|
f85f81c2ee | ||
|
|
dbf7a9a0d0 | ||
|
|
f88d12f55d | ||
|
|
3e485dcb41 | ||
|
|
15313b8d37 | ||
|
|
cd46ccdb66 | ||
|
|
b09c4166b3 | ||
|
|
3d22cbe4da | ||
|
|
4c80e0425b | ||
|
|
8fb5286260 | ||
|
|
36a902167f | ||
|
|
a2a4a74964 | ||
|
|
3467faab6b | ||
|
|
31d9eb192f | ||
|
|
128f6d9a5c | ||
|
|
51b6318f88 | ||
|
|
70e66627fe | ||
|
|
2bd0fdd364 | ||
|
|
87da490b58 | ||
|
|
a20ae60e70 | ||
|
|
6f9fc205ef | ||
|
|
066013c31f | ||
|
|
2824c8b8ab | ||
|
|
144147c5d1 | ||
|
|
d91d14d10c | ||
|
|
6c7c6c9efd | ||
|
|
9266b4e8fd | ||
|
|
b5d7a752f7 | ||
|
|
f96ea0cba0 | ||
|
|
b049b663b6 | ||
|
|
e4c47e65c1 | ||
|
|
04fb93370f | ||
|
|
c89468428e | ||
|
|
9ba7f019ea | ||
|
|
76ee014b52 | ||
|
|
a7ccbb4d9a | ||
|
|
841c4da0f8 | ||
|
|
09fff2150e | ||
|
|
e2c389a4a9 | ||
|
|
b7105d572a | ||
|
|
7a6a515386 | ||
|
|
06f97f4f80 | ||
|
|
f2b39b3eeb | ||
|
|
991a7ffd43 | ||
|
|
35707d1f4f | ||
|
|
5e2d8eac2b | ||
|
|
9b828532cc | ||
|
|
c75fbb7642 | ||
|
|
1e735c48aa | ||
|
|
f1b8941e27 | ||
|
|
45c5abea69 | ||
|
|
261c0fc908 | ||
|
|
b97ad33911 | ||
|
|
0eff2fa15b | ||
|
|
be2a95ca51 | ||
|
|
0453a27bda | ||
|
|
131677a5ea | ||
|
|
e433dabc64 | ||
|
|
ce56f52a30 | ||
|
|
1ea2182bf7 | ||
|
|
77e493755f | ||
|
|
b5a27b4c15 | ||
|
|
25971e373d | ||
|
|
6af9f3b142 | ||
|
|
3dc3214047 | ||
|
|
ee362a42bd | ||
|
|
1f76165e46 | ||
|
|
2acb84b432 | ||
|
|
4faaa81277 | ||
|
|
facd6abec3 | ||
|
|
052511d081 | ||
|
|
0bf213acac | ||
|
|
2810315dc5 | ||
|
|
5fa62f25fa | ||
|
|
ceb368abd4 | ||
|
|
0168a9860b | ||
|
|
dafc7d2617 | ||
|
|
ddcb4c149a | ||
|
|
0859438118 | ||
|
|
0c67185dcf | ||
|
|
675a30d500 | ||
|
|
3d9be1437a | ||
|
|
b546f21ef4 | ||
|
|
505517d142 | ||
|
|
58fd4ad92f | ||
|
|
dff038fddd | ||
|
|
b248d2f1cf | ||
|
|
c04604ea1c | ||
|
|
1c43a83a8b | ||
|
|
20e8dd4c54 | ||
|
|
46e8f1bebf | ||
|
|
5f19291285 | ||
|
|
8f3ff32c82 | ||
|
|
20b50993bb | ||
|
|
d5d97e2d24 | ||
|
|
571d130c3c | ||
|
|
3a8a813c4e | ||
|
|
bed697c98d | ||
|
|
02bed7ce01 | ||
|
|
c052a50d75 | ||
|
|
8a67100a31 | ||
|
|
c559e5cc3e | ||
|
|
bf173fdbf1 | ||
|
|
ae028baea1 | ||
|
|
0c0ef7b683 | ||
|
|
16331ce87b | ||
|
|
bfe305dc47 | ||
|
|
88cd8fface | ||
|
|
424ddcb218 | ||
|
|
3091448d1a | ||
|
|
5b07be0179 | ||
|
|
c68687bdf6 | ||
|
|
87bb971d75 | ||
|
|
f26601e836 | ||
|
|
9918873719 | ||
|
|
3a04fc557b | ||
|
|
0fc51b6564 | ||
|
|
b18e0e3d1e | ||
|
|
ed37f9fb7a | ||
|
|
b18e25db87 | ||
|
|
aab8d4a628 | ||
|
|
c907c6ed08 | ||
|
|
51d7622434 | ||
|
|
2b340579a1 | ||
|
|
0ab399aa37 | ||
|
|
f859967c24 | ||
|
|
db57aea163 | ||
|
|
b1cb32c743 | ||
|
|
5aaf8ff8f3 | ||
|
|
801bf83334 | ||
|
|
eab4014f20 | ||
|
|
29d9771b80 | ||
|
|
4a2d3a55d4 | ||
|
|
3f7a75b0a3 | ||
|
|
599621cc1b | ||
|
|
724badb522 | ||
|
|
7a637104b2 | ||
|
|
3f2f6c3ed3 | ||
|
|
81863e45f4 | ||
|
|
6dbf316e66 | ||
|
|
5f612dfd7c | ||
|
|
2d64c3e560 | ||
|
|
21462d0b82 | ||
|
|
aeead15a62 | ||
|
|
c7721563c5 | ||
|
|
f3fcb7a48a | ||
|
|
e1203d115a | ||
|
|
0763846805 | ||
|
|
eae4269745 | ||
|
|
42543ba005 | ||
|
|
6368ba9a6e | ||
|
|
44f4f9e288 | ||
|
|
fe241cc71f | ||
|
|
7420e6ab9a | ||
|
|
65c4a21898 | ||
|
|
1ec9d08557 | ||
|
|
41f627b80d | ||
|
|
d7236fad99 | ||
|
|
3ee258fefc | ||
|
|
d464922d71 | ||
|
|
ce9a10bd90 | ||
|
|
3ea617ef68 | ||
|
|
5869975ed1 | ||
|
|
900af89827 | ||
|
|
63767b1e31 | ||
|
|
5756f0cfdf | ||
|
|
201e46f34b | ||
|
|
7efd810d57 | ||
|
|
669213a6db | ||
|
|
6353987b15 | ||
|
|
ce33f39bb0 | ||
|
|
5658c7daea | ||
|
|
c005a20cc0 | ||
|
|
fd696f8c28 | ||
|
|
9dcf3e49d0 | ||
|
|
2f4463c983 | ||
|
|
5d512243b8 | ||
|
|
3980e4a32b | ||
|
|
d50c518b70 | ||
|
|
78ec200c73 | ||
|
|
fe92c2605d | ||
|
|
75cd63a29b | ||
|
|
257686c2fe | ||
|
|
f3a555ec69 | ||
|
|
962bda810c | ||
|
|
29820f446d | ||
|
|
ef888d5fca | ||
|
|
c66181a00e | ||
|
|
1eb4975a76 | ||
|
|
4939cc9911 | ||
|
|
7526cb3b8b | ||
|
|
77247ec43a | ||
|
|
f4786c8a0a | ||
|
|
6465e8aa36 | ||
|
|
b8b5b97d78 | ||
|
|
520ce4c3ac | ||
|
|
ffd7f60830 | ||
|
|
647fa49202 | ||
|
|
63abe2f1ff | ||
|
|
45ad23206a | ||
|
|
a80950b96d | ||
|
|
5406e3d34e | ||
|
|
de005f5cd2 | ||
|
|
5d5b7c3af4 | ||
|
|
30894b989c | ||
|
|
70f22f2648 | ||
|
|
654bf4d672 | ||
|
|
4d5621ea6f | ||
|
|
f1758b6f0c | ||
|
|
1a8364adcc | ||
|
|
4928d03c4f | ||
|
|
ad0c4c518f | ||
|
|
8af6b8679e | ||
|
|
70eed40146 | ||
|
|
022f3e640d | ||
|
|
d451703bbf | ||
|
|
303b0e7f31 | ||
|
|
e5b71a1a89 | ||
|
|
de97b248f2 | ||
|
|
ea9a07fb3d | ||
|
|
a4d897f609 | ||
|
|
adf4c94f45 | ||
|
|
9fe9d0e9bf | ||
|
|
3c215730db | ||
|
|
77b8d91895 | ||
|
|
ac8dfb2dd5 | ||
|
|
d42492c67b | ||
|
|
e20e80fae3 | ||
|
|
6d7cb01951 | ||
|
|
e4a7903700 | ||
|
|
61d5152209 | ||
|
|
0146153792 | ||
|
|
348fe00ffb | ||
|
|
b87ac639fd | ||
|
|
89ed156d7e | ||
|
|
39dd1e2dd1 | ||
|
|
30856d5b18 | ||
|
|
4705d41ed2 | ||
|
|
8326ecee78 | ||
|
|
e0fa4e4b5c | ||
|
|
04026dd0b0 | ||
|
|
57a2ea3a53 | ||
|
|
e9505c1109 | ||
|
|
a5e670291e | ||
|
|
8c95ada9fd | ||
|
|
6c118b4dfb | ||
|
|
0b68da4e9e | ||
|
|
f5903c9b02 | ||
|
|
880ac07661 | ||
|
|
b92784c04b | ||
|
|
3cc888f4df | ||
|
|
07d48e627e | ||
|
|
83ec43a2ee | ||
|
|
0edf2f344b | ||
|
|
e26e6288c2 | ||
|
|
5f58eefc79 | ||
|
|
948d2bc4e9 | ||
|
|
c8af143468 | ||
|
|
f3babd2819 | ||
|
|
807b4bf93e | ||
|
|
a39f469a50 | ||
|
|
52419f28c5 | ||
|
|
4aaaa8e21a | ||
|
|
02f21d478a | ||
|
|
51a751f088 | ||
|
|
f5f0b9debc | ||
|
|
e77d7d22a8 | ||
|
|
70d52aca1d | ||
|
|
7d8023fea7 | ||
|
|
9d89e48d15 | ||
|
|
3537f68c7e | ||
|
|
18da6e6d6f | ||
|
|
1043bc964d | ||
|
|
383c92f6c6 | ||
|
|
a57e8a14b8 | ||
|
|
38bd5e0902 | ||
|
|
be1c08ddfe | ||
|
|
b782e5986a | ||
|
|
e4767e91ea | ||
|
|
5850b68f79 | ||
|
|
1c97393a69 | ||
|
|
b58684af98 | ||
|
|
68bc85124b | ||
|
|
5b9a583005 | ||
|
|
4e7549ab7d | ||
|
|
456f25d57e | ||
|
|
b13fc30a0a | ||
|
|
87b33c09e0 | ||
|
|
2e3b6b2fc8 | ||
|
|
628c715878 | ||
|
|
96f9f8ae98 | ||
|
|
531037ddb6 | ||
|
|
35e5480f2f | ||
|
|
4c1d857991 | ||
|
|
6e5258f482 | ||
|
|
9ec5470adf | ||
|
|
260049c917 | ||
|
|
7758c0b8a7 | ||
|
|
e22bd5c048 | ||
|
|
8193e792b5 | ||
|
|
076bfd82a3 | ||
|
|
03cfea2504 | ||
|
|
7c7e89cc3b | ||
|
|
831a66465f | ||
|
|
f391b11da7 | ||
|
|
82d99bfa01 | ||
|
|
f0a68d728a | ||
|
|
7e8ce82e0a | ||
|
|
0f325bdd65 | ||
|
|
82d878dd7a | ||
|
|
74f3b98ea9 | ||
|
|
3e4d7dfaba | ||
|
|
443827ff42 | ||
|
|
b66bd781a4 | ||
|
|
2bad48bdcc | ||
|
|
1027f1059e | ||
|
|
14ca7db5d7 | ||
|
|
59e917cd5f | ||
|
|
65ccbb6249 | ||
|
|
bb6dda087c | ||
|
|
bae73b9a52 | ||
|
|
375557e092 | ||
|
|
cd09099409 | ||
|
|
fb0bd41178 | ||
|
|
bcd835ddbd | ||
|
|
a48473ba7a | ||
|
|
da8dcaa0c9 | ||
|
|
dad4c34ec5 | ||
|
|
d09d036f06 | ||
|
|
c7444865a1 | ||
|
|
bbf219fd7b | ||
|
|
b29fc5552d | ||
|
|
60832c6e87 | ||
|
|
426894f6a6 | ||
|
|
8639956b79 | ||
|
|
3e443e9146 | ||
|
|
5549186e3a | ||
|
|
7c9909ee12 | ||
|
|
d9bfd72c29 | ||
|
|
d1ef4bdbd1 | ||
|
|
18e7a5efa9 | ||
|
|
3c029d0ccf | ||
|
|
b78771f8c4 | ||
|
|
9db5f85d4e | ||
|
|
9c3ba22b02 | ||
|
|
3240a3652d | ||
|
|
7bf6daaca7 | ||
|
|
01a44760a8 | ||
|
|
4381f67a64 | ||
|
|
359dae6af8 | ||
|
|
74ad0586a9 | ||
|
|
47b96e07b7 | ||
|
|
daf32e9f14 | ||
|
|
81a8efd856 | ||
|
|
8870662200 | ||
|
|
feb2e71f0c | ||
|
|
8ab9c96b7e | ||
|
|
e71ff148ba | ||
|
|
6afe9c88f6 | ||
|
|
1c1caaccde | ||
|
|
3ce5674b76 | ||
|
|
978511e127 | ||
|
|
4f45228e7b | ||
|
|
881d176996 | ||
|
|
bb94ea7334 | ||
|
|
4c39816ce6 | ||
|
|
e60cf96c8e | ||
|
|
31ca781236 | ||
|
|
2ddebc123a | ||
|
|
faf1d52d91 | ||
|
|
c509e3bc43 | ||
|
|
12ce4bf7af | ||
|
|
45515fa8b2 | ||
|
|
20d0b0c564 | ||
|
|
1fec53e7f2 | ||
|
|
7001388159 | ||
|
|
64c4e25c02 | ||
|
|
acf0386a9b | ||
|
|
ce7a301896 | ||
|
|
c6c87cd813 | ||
|
|
ac55a052b2 | ||
|
|
931f712c5f | ||
|
|
a0c9cf2d8d | ||
|
|
65629711d0 | ||
|
|
d022b3b0a1 | ||
|
|
701b43d917 | ||
|
|
29f98041e6 | ||
|
|
5b7fb9a4bb | ||
|
|
ba594b20e0 | ||
|
|
a4a44faa7f | ||
|
|
1c665c34cd | ||
|
|
8aa262f302 | ||
|
|
a9b0c4ebc5 | ||
|
|
2d870d0f81 | ||
|
|
73c0471ead | ||
|
|
15da97f1da | ||
|
|
591059847e | ||
|
|
67baa48c16 | ||
|
|
6fa5930e8d | ||
|
|
b10f75932f | ||
|
|
8b2c82dd23 | ||
|
|
efb78d7431 | ||
|
|
7b829bc899 | ||
|
|
b28180d759 | ||
|
|
9816dff00a | ||
|
|
c6774505d8 | ||
|
|
3c1bdd163f | ||
|
|
edeaa6009f | ||
|
|
4efe2a0e09 | ||
|
|
a6ddc90d5b | ||
|
|
7af023665f | ||
|
|
8485fee5f9 | ||
|
|
23829ae637 | ||
|
|
6d5329bbf8 | ||
|
|
d4b5ee6c85 | ||
|
|
edb239837c | ||
|
|
cd141373fb | ||
|
|
d46dfd017a | ||
|
|
fc6a0dfcaa | ||
|
|
21852bd16b | ||
|
|
a0378549b8 | ||
|
|
5f16de8150 | ||
|
|
a25346e302 | ||
|
|
983d7e5177 | ||
|
|
041784876d | ||
|
|
227f01b000 | ||
|
|
fdffc0c13a | ||
|
|
0325b68bfb | ||
|
|
b5a4c58106 | ||
|
|
d3de81fecb | ||
|
|
53a6e0cfaf | ||
|
|
fe17c13a5f | ||
|
|
ff3f85b214 | ||
|
|
e6fa070c84 | ||
|
|
b3043ab3d6 | ||
|
|
4cd5a53b63 | ||
|
|
49f6a634d0 | ||
|
|
ac5b16fd01 | ||
|
|
04a922b5f4 | ||
|
|
17213ae65d | ||
|
|
68d24661db | ||
|
|
bdf8c3ddc6 | ||
|
|
af843ed82c | ||
|
|
53af4b0076 | ||
|
|
8bdf58b942 | ||
|
|
35e48f3a27 | ||
|
|
9d285ea232 | ||
|
|
b52ad0500b | ||
|
|
10ddd621ca | ||
|
|
03d2d24244 | ||
|
|
e1dc5b5188 | ||
|
|
91792e3c0e | ||
|
|
c20d61029c | ||
|
|
223637317b | ||
|
|
0d4badb50b | ||
|
|
8f1b4df5f4 | ||
|
|
6d4aa1ad08 | ||
|
|
9b5a6f4298 | ||
|
|
35ebaf7b79 | ||
|
|
a19f8cd87d | ||
|
|
16c290f735 | ||
|
|
ceaaff0186 | ||
|
|
f88abb9a6f | ||
|
|
0d467972cd | ||
|
|
08f21e3fc4 | ||
|
|
803722e323 | ||
|
|
ca6dd8850a |
234
ChangeLog
234
ChangeLog
@@ -2,6 +2,209 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 14.0.4 compared to 14.0.3 *****
|
||||
|
||||
FIX: $totalarray is overwritten, totals were lost
|
||||
FIX: 13.0 - due to a typo in the 'mode' parameter, the "first name" column of the list of members displays the full name
|
||||
FIX: 13.0: end date required to edit a ticket message
|
||||
FIX: 13.0 feedback of PR #18993: make ticket messages punctual events with attr percentage = -1
|
||||
FIX: 13.0 PR #18993: add comment on modified part
|
||||
FIX: 13.0: sometimes firstname was mistyped as fistname
|
||||
FIX: 14.0 - civility field of private third party creation form has inadequate width
|
||||
FIX: 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none)
|
||||
FIX: 14.0 - due to a typo in the 'mode' parameter, the "first name" co…
|
||||
FIX: #18634 : Problem of virtual stock with reception module enabled
|
||||
FIX: #18695 Added ref_ext to supplier invoice
|
||||
FIX: #18698 Supplier invoice list - "alert" checkbox not working
|
||||
FIX: #18735
|
||||
FIX: #18767 : Adherent delete
|
||||
FIX: #18797
|
||||
FIX: #18854
|
||||
FIX: #18875 in v14
|
||||
FIX: #18910
|
||||
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
|
||||
FIX: #18912 Accountancy - SQL error when custom group is added without country defined
|
||||
FIX: #18934 on-registration in the extrafieldsline database for deliveries
|
||||
FIX: #18968
|
||||
FIX: #19008
|
||||
FIX: #19014 - the properties of some fields are not updated when you submit the form
|
||||
FIX: #19210
|
||||
FIX: #19214 : PostgreSQL error on admin/limits.php
|
||||
FIX: #19241 Project - Fix display salary in overview
|
||||
FIX: #19305
|
||||
FIX: 2 columns for total labels
|
||||
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
|
||||
FIX: Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction
|
||||
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
|
||||
FIX: Accountancy - Option of export popup are inverted
|
||||
FIX: Accountancy - PHP8
|
||||
FIX: Accountancy - Product admin - SQL error when we affect accounting account with product_perentity activated
|
||||
FIX: Accountancy simplified - Salaries are not present in report
|
||||
FIX: Accountancy - Some correction on export name
|
||||
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
|
||||
FIX: add warehouse in projects' overview count
|
||||
FIX: also on customer index for automatic binding
|
||||
FIX: Attachment of pdf into shipment when sending email
|
||||
FIX: autocalculation of the supplier price in main currency.
|
||||
FIX: avoid warning if $categories is an id
|
||||
FIX: bad sign of amount stored for multicurrency columns on credit notes
|
||||
FIX: Bad use of a forced contact of another company on PDF/ODT documents
|
||||
FIX: Bad use of dol_concatdesc()
|
||||
FIX: Button text on proposal card for create a invoice
|
||||
FIX: calculateCosts of BOM must not be included into fetch
|
||||
FIX: calculation of balance in conciliation page on desc sorting.
|
||||
FIX: card.php
|
||||
FIX: Change date format of the inventorycode to be equal as mass stock transfert
|
||||
FIX: check if greater 0
|
||||
FIX: close cash with some terminals in TakePOS
|
||||
FIX: compatibility with Multicompany
|
||||
FIX: consistent UX when calling a tab from the invoice card with empty ref/id
|
||||
FIX: default language defined for IN country
|
||||
FIX: Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode
|
||||
FIX: fetch of product with modulebuilder load too much data
|
||||
FIX: filter for export of accounting documents
|
||||
FIX: Filter on categories
|
||||
FIX: generate documents with PDF options
|
||||
FIX: indentation
|
||||
FIX: init hookmanager after loading $conf values
|
||||
FIX: invoice: inpossible to create an invoice because of very bad check + warnings when trying to print tabs for invoice with no ID
|
||||
FIX: legal issue on expense report pdf (must also show price without tax)
|
||||
FIX: list of categories in stats of supplier invoices
|
||||
FIX: load tranlate array after setting lang
|
||||
FIX: lost superadmin grade after edit user card
|
||||
FIX: missing filter status=1 on rss feeds
|
||||
FIX: missing permission check reported by me@lainwir3d.net on product api
|
||||
FIX: missing return status
|
||||
FIX: missing sql filter by entity
|
||||
FIX: move fetch_optionnal into $ac_static->fetch()
|
||||
FIX: only a superadmin can modify entity
|
||||
FIX: only ones value is return for dictionaries
|
||||
FIX: optional visibility on create card
|
||||
FIX: payment style and html5 tags
|
||||
FIX: payment using wrong type in takepos when too many payment mode
|
||||
FIX: PR#18931 Remove useless explicit call to dol_shutdown
|
||||
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
|
||||
FIX: products/services card: hidden extrafields were overridden
|
||||
FIX: project task list: extrafields could not be displayed
|
||||
FIX: Propal list - Problem of pagination on date
|
||||
FIX: reload user lang
|
||||
FIX: Remove not complete order from the virtual stock
|
||||
FIX: Replenish: SQL error when no warehouse has been created + Warning when there are no warehouses
|
||||
FIX: resource list : Use standard code to handle list filters
|
||||
FIX: restrictedArea for payment delete
|
||||
FIX: Ret PR
|
||||
FIX: second approval back in stable feature as is the setting for minimum amount (last part from PR#14286)
|
||||
FIX: selected lines on supplier invoice create
|
||||
FIX: Selection of type "people" for membership must hide the company
|
||||
FIX: select list of orders not complete when field type of company is on
|
||||
FIX: show end hours in events linked to objects
|
||||
FIX: support of localtax on expense report
|
||||
FIX: task time: can't filter by user with pgsql + show error message
|
||||
FIX: task time: keep on using natural_search
|
||||
FIX: tcpdf vulnerability to roman numeral bomb, cf. tecnickom/TCPDF issue #315
|
||||
FIX: Test when date of invoie is in future (pb with TZ and offset)
|
||||
FIX: Ticket - Card - Wrong font awesome library
|
||||
FIX: Ticket - Duplicate field project when we create ticket from project
|
||||
FIX: translation into email for member at membership validation.
|
||||
FIX: Travis Sanitize SQL
|
||||
FIX: unprivileged user can see task associated with a not allowed project
|
||||
FIX: URGENT: impossible to create an invoice
|
||||
FIX: Use of accent into filename of GED
|
||||
FIX: user date timezone offset
|
||||
FIX: User salary card - translation problem
|
||||
FIX: user without permission can set ticket subject
|
||||
FIX: We need a default price base type in variant creation case with multiprices when parent has been created with only one level price
|
||||
FIX: wrong array key value
|
||||
FIX: wrong check
|
||||
FIX: wrong position of error message
|
||||
Sync transifex.
|
||||
|
||||
***** ChangeLog for 14.0.3 compared to 14.0.2 *****
|
||||
|
||||
FIX: #18698 Supplier invoice list - "alert" checkbox not working
|
||||
FIX: #18735
|
||||
FIX: #18767 : Member delete
|
||||
FIX: #18854
|
||||
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
|
||||
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
|
||||
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
|
||||
FIX: Accountancy - Option of export popup are inverted
|
||||
FIX: Accountancy - Some correction on export name
|
||||
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
|
||||
FIX: add warehouse in projects' overview count
|
||||
FIX: autocalculation of the supplier price in main currency.
|
||||
FIX: avoid warning if $categories is an id
|
||||
FIX: Bad use of a forced contact of another company on PDF/ODT documents
|
||||
FIX: Button text on proposal card to create a invoice
|
||||
FIX: calculateCosts of BOM must not be included into fetch
|
||||
FIX: check if greater 0
|
||||
FIX: default language defined for IN country
|
||||
FIX: fetch of product with modulebuilder load too much data
|
||||
FIX: Filter on categories
|
||||
FIX: indentation
|
||||
FIX: init hookmanager after loading $conf values
|
||||
FIX: legal issue on expense report pdf (must also show price without tax)
|
||||
FIX: missing filter status=1 on rss feeds
|
||||
FIX: move fetch_optionnal into $ac_static->fetch()
|
||||
FIX: payment using wrong type in takepos when too many payment mode
|
||||
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
|
||||
FIX: products/services card: hidden extrafields were overridden
|
||||
FIX: Propal list - Problem of pagination on date
|
||||
FIX: selected lines on supplier invoice create
|
||||
FIX: Selection of type "people" for membership must hide the company
|
||||
FIX: select list of orders not complete when field type of company is on
|
||||
FIX: support of localtax on expense report
|
||||
FIX: task time: can't filter by user with pgsql + show error message
|
||||
FIX: task time: keep on using natural_search
|
||||
FIX: Test when date of invoie is in future (pb with TZ and offset)
|
||||
FIX: translation into email for member at membership validation.
|
||||
FIX: unprivileged user can see task associated with a not allowed project
|
||||
FIX: user without permission can set ticket subject
|
||||
|
||||
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
|
||||
|
||||
FIX: #18353 Invoice list translation issue
|
||||
FIX: #18375 SQL Error on tasks statistics
|
||||
FIX: #18465
|
||||
FIX: #18484
|
||||
FIX: #18531
|
||||
FIX: #18542 REST API: set global $user variable to DolibarrApiAccess::user.
|
||||
FIX: #18544 Shipment REST API: load thirdparty object into the shipment before validating.
|
||||
FIX: #18544 Shipment rest api: load thirdparty object when validating
|
||||
FIX: #18565
|
||||
FIX: #18589 #18617
|
||||
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
|
||||
FIX: #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
|
||||
FIX: Accountancy - Some problems of length with general & subledger account
|
||||
FIX: add DISTINCT
|
||||
FIX: Add option $noescapecommand in executeCLI for better compatibility
|
||||
FIX: Add token to remove error when removing widget
|
||||
FIX: Add token when remove the last widget on home page
|
||||
FIX: an approved holiday can be canceled by an admin.
|
||||
FIX: better sql request
|
||||
FIX: change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done)
|
||||
FIX: Collapsing of extrafields has disappeared.
|
||||
FIX: Date of payment of subscription must not be set to 1970-01-01.
|
||||
FIX: Export of website generates a package that contains a sql error
|
||||
FIX: Field already present in SQL request
|
||||
FIX: increase maxlength of password input
|
||||
FIX: invoice fetch not found syslog debug level instead of error
|
||||
FIX: Invoice list - Wrong name for column total_tva
|
||||
FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts
|
||||
FIX: Manage credit note on situation invoice for calculate margin
|
||||
FIX: Menu List of project was not visible.
|
||||
FIX: migration script
|
||||
FIX: multicompany transverse mode compatibility
|
||||
FIX: option "Default value for field 'Refuse bulk emailings'"
|
||||
FIX: Recommended session.cookie_samesite must be 'Lax' not 'Strict'.
|
||||
FIX: Relative discount with high nb of decimals
|
||||
FIX: salary extrafields don't work and table is not well named
|
||||
FIX: Supplier invoice list - Wrong language key used
|
||||
FIX: wrong table_element_line
|
||||
FIX: wrong users count in multicompany transverse mode
|
||||
FIX: #yogosha6944 Protection against traversal path.
|
||||
|
||||
|
||||
***** ChangeLog for 14.0.1 compared to 14.0.0 *****
|
||||
|
||||
FIX: $conf->task used but it does not exist, use $conf->projet instead
|
||||
@@ -272,6 +475,37 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.5 compared to 13.0.4 *****
|
||||
|
||||
FIX: 13.0: class CommandeFournisseurDispatch provides trigger for UPDATE but not for CREATE / DELETE
|
||||
FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice
|
||||
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
|
||||
FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT)
|
||||
FIX: Accountancy - Some problems of length with general & subledger account
|
||||
FIX: add DISTINCT
|
||||
FIX: an approved holiday can be canceled by an admin.
|
||||
FIX: autocalculation of the supplier price in main currency.
|
||||
FIX: better sql request
|
||||
FIX: cannot add time spend when column ref is not displayed
|
||||
FIX: compatibility postgre sql
|
||||
FIX: holiday card: hooks uninitialized
|
||||
FIX: Invoice - Missing button to reopen an abandoned situation invoice
|
||||
FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts
|
||||
FIX: list of categories in stats of supplier invoices
|
||||
FIX: Manage credit note on situation invoice for calculate margin
|
||||
FIX: method_exists needs object at first param
|
||||
FIX: move fetch_optionnal into $ac_static->fetch()
|
||||
FIX: multicompany transverse mode compatibility
|
||||
FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref)
|
||||
FIX: postgre filter select search extrafield
|
||||
FIX: products/services card: hidden extrafields were overridden
|
||||
FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object
|
||||
FIX: task time: can't filter by user with pgsql + show error message
|
||||
FIX: task time: keep on using natural_search
|
||||
FIX: wrong users count in multicompany transverse mode
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.4 compared to 13.0.3 *****
|
||||
|
||||
FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).
|
||||
|
||||
11
README.md
11
README.md
@@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
|
||||
### Other application/modules
|
||||
|
||||
- Electronic Document Management (EDM)
|
||||
- Electronic Document Management (EDM)
|
||||
- Bookmarks management
|
||||
- Reporting
|
||||
- Data export/import
|
||||
- Barcodes
|
||||
- Barcodes
|
||||
- Margin calculations
|
||||
- LDAP connectivity
|
||||
- ClickToDial integration
|
||||
- Mass emailing
|
||||
- RSS integration
|
||||
- Skype integration
|
||||
- Social platforms linking
|
||||
- Social platforms linking
|
||||
- Payment platforms integration (PayPal, Stripe, Paybox...)
|
||||
- Email-Collector
|
||||
|
||||
@@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Multi-Users and groups with finely grained rights
|
||||
- Multi-Currency
|
||||
- Multi-Company (by adding of an external module)
|
||||
|
||||
- Very user friendly and easy to use
|
||||
- customizable Dashboard
|
||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||
|
||||
- APIs (REST, SOAP)
|
||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||
|
||||
- Support a lot of country specific features:
|
||||
- Spanish Tax RE and ISPF
|
||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||
@@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Compatible with European GDPR rules
|
||||
- ...
|
||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||
- …
|
||||
- ...
|
||||
|
||||
|
||||
### System Environment / Requirements
|
||||
|
||||
@@ -48,17 +48,16 @@ $includecustom=0;
|
||||
$includeconstants=array();
|
||||
|
||||
if (empty($argv[1])) {
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
exit -1;
|
||||
}
|
||||
|
||||
parse_str($argv[1]);
|
||||
|
||||
$i=0;
|
||||
while ($i < $argc) {
|
||||
if (! empty($argv[$i])) {
|
||||
parse_str($argv[$i]);
|
||||
parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ...
|
||||
}
|
||||
if (preg_match('/includeconstant=/', $argv[$i])) {
|
||||
$tmp=explode(':', $includeconstant, 3); // $includeconstant has been set with previous parse_str()
|
||||
@@ -125,8 +124,8 @@ print "\n";
|
||||
|
||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist*.xml', 0, 1, 1);
|
||||
print 'Delete current files '.$outputdir.'/filelist*.xml*'."\n";
|
||||
dol_delete_file($outputdir.'/filelist*.xml*', 0, 1, 1);
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
@@ -237,6 +236,22 @@ fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
|
||||
fputs($fp, '</checksum_list>'."\n");
|
||||
fclose($fp);
|
||||
|
||||
print "File ".$outputfile." generated\n";
|
||||
if (empty($buildzip)) {
|
||||
print "File ".$outputfile." generated\n";
|
||||
} else {
|
||||
if ($buildzip == '1' || $buildzip == 'zip') {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".zip generated\n";
|
||||
}
|
||||
} elseif ($buildzip == '2' || $buildzip == 'gz') {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".gz generated\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
@@ -168,6 +168,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||
- protected $default_monospaced_font = 'courier';
|
||||
+ protected $default_monospaced_font = 'freemono';
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
|
||||
of the function, replace:
|
||||
|
||||
$roman = '';
|
||||
|
||||
with:
|
||||
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,11 +3,26 @@
|
||||
#
|
||||
# Use this sample to search into a ldap
|
||||
#
|
||||
# ldapsearch -h hostname -x
|
||||
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
|
||||
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||
|
||||
# Anonymous access
|
||||
# ldapsearch -h hostname -p 389
|
||||
#
|
||||
# Login access (using a Bind DN)
|
||||
# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
|
||||
#
|
||||
# Login access in SSL (using a Bind DN)
|
||||
# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local
|
||||
# If it fails, you may try to use "hostname" that is real name of certificate.
|
||||
# You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# What to search
|
||||
# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local"
|
||||
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra"
|
||||
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)"
|
||||
#
|
||||
# Example to test a ldap search:
|
||||
# ldapsearch -h hostname -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password
|
||||
# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password
|
||||
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/initdata/import-dbf.php
|
||||
* \brief Script example to create a table from a large DBF file (openoffice)
|
||||
* To purge data, you can have a look at purge-data.php
|
||||
*/
|
||||
// Test si mode batch
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
|
||||
$path = dirname(__FILE__) . '/';
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path = dirname($_SERVER["PHP_SELF"]);
|
||||
require $path . "./../htdocs/master.inc.php";
|
||||
require $path . "/includes/dbase.class.php";
|
||||
|
||||
// Global variables
|
||||
$version = DOL_VERSION;
|
||||
$confirmed = 1;
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
|
||||
@set_time_limit(0);
|
||||
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
|
||||
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
|
||||
|
||||
|
||||
$filepath = $argv[1];
|
||||
$filepatherr = $filepath . '.err';
|
||||
$startchar = empty($argv[2]) ? 0 : (int) $argv[2];
|
||||
$deleteTable = empty($argv[3]) ? 1 : 0;
|
||||
$startlinenb = empty($argv[3]) ? 1 : (int) $argv[3];
|
||||
$endlinenb = empty($argv[4]) ? 0 : (int) $argv[4];
|
||||
|
||||
if (empty($filepath)) {
|
||||
print "Usage: php $script_file myfilepath.dbf [removeChatColumnName] [startlinenb] [endlinenb]\n";
|
||||
print "Example: php $script_file myfilepath.dbf 0 2 1002\n";
|
||||
print "\n";
|
||||
exit(-1);
|
||||
}
|
||||
if (!file_exists($filepath)) {
|
||||
print "Error: File " . $filepath . " not found.\n";
|
||||
print "\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
$ret = $user->fetch('', 'admin');
|
||||
if (!$ret > 0) {
|
||||
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
// Ask confirmation
|
||||
if (!$confirmed) {
|
||||
print "Hit Enter to continue or CTRL+C to stop...\n";
|
||||
$input = trim(fgets(STDIN));
|
||||
}
|
||||
|
||||
// Open input and output files
|
||||
$fhandle = dbase_open($filepath, 0);
|
||||
if (!$fhandle) {
|
||||
print 'Error: Failed to open file ' . $filepath . "\n";
|
||||
exit(1);
|
||||
}
|
||||
$fhandleerr = fopen($filepatherr, 'w');
|
||||
if (!$fhandleerr) {
|
||||
print 'Error: Failed to open file ' . $filepatherr . "\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$langs->setDefaultLang($defaultlang);
|
||||
|
||||
$record_numbers = dbase_numrecords($fhandle);
|
||||
$table_name = substr(basename($filepath), 0, strpos(basename($filepath), '.'));
|
||||
print 'Info: ' . $record_numbers . " lines in file \n";
|
||||
$header = dbase_get_header_info($fhandle);
|
||||
if ($deleteTable) {
|
||||
$db->query("DROP TABLE IF EXISTS `$table_name`");
|
||||
}
|
||||
$sqlCreate = "CREATE TABLE IF NOT EXISTS `$table_name` ( `id` INT(11) NOT NULL AUTO_INCREMENT ";
|
||||
$fieldArray = array("`id`");
|
||||
foreach ($header as $value) {
|
||||
$fieldName = substr(str_replace('_', '', $value['name']), $startchar);
|
||||
$fieldArray[] = "`$fieldName`";
|
||||
$sqlCreate .= ", `" . $fieldName . "` VARCHAR({$value['length']}) NULL DEFAULT NULL ";
|
||||
}
|
||||
$sqlCreate .= ", PRIMARY KEY (`id`)) ENGINE = InnoDB";
|
||||
$resql = $db->query($sqlCreate);
|
||||
if ($resql !== false) {
|
||||
print "Table $table_name created\n";
|
||||
} else {
|
||||
var_dump($db->errno());
|
||||
print "Impossible : " . $sqlCreate . "\n";
|
||||
die();
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$nboflines++;
|
||||
|
||||
$fields = implode(',', $fieldArray);
|
||||
//var_dump($fieldArray);die();
|
||||
$maxLength = 0;
|
||||
for ($i = 1; $i <= $record_numbers; $i++) {
|
||||
if ($startlinenb && $i < $startlinenb) {
|
||||
continue;
|
||||
}
|
||||
if ($endlinenb && $i > $endlinenb) {
|
||||
continue;
|
||||
}
|
||||
$row = dbase_get_record_with_names($fhandle, $i);
|
||||
if ($row === false || (isset($row["deleted"]) && $row["deleted"] == '1')) {
|
||||
continue;
|
||||
}
|
||||
$sqlInsert = "INSERT INTO `$table_name`($fields) VALUES (null,";
|
||||
array_shift($row); // remove delete column
|
||||
foreach ($row as $value) {
|
||||
$sqlInsert .= "'" . $db->escape(utf8_encode($value)) . "', ";
|
||||
}
|
||||
replaceable_echo(implode("\t", $row));
|
||||
$sqlInsert = rtrim($sqlInsert, ', ');
|
||||
$sqlInsert .= ")";
|
||||
$resql = $db->query($sqlInsert);
|
||||
if ($resql === false) {
|
||||
print "Impossible : " . $sqlInsert . "\n";
|
||||
var_dump($row, $db->errno());
|
||||
die();
|
||||
}
|
||||
// $fields = (object) $row;
|
||||
// var_dump($fields);
|
||||
continue;
|
||||
}
|
||||
die();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// commit or rollback
|
||||
print "Nb of lines qualified: " . $nboflines . "\n";
|
||||
print "Nb of errors: " . $error . "\n";
|
||||
if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) {
|
||||
print "Rollback any changes.\n";
|
||||
$db->rollback();
|
||||
} else {
|
||||
print "Commit all changes.\n";
|
||||
$db->commit();
|
||||
}
|
||||
|
||||
$db->close();
|
||||
fclose($fhandle);
|
||||
fclose($fhandleerr);
|
||||
|
||||
exit($error);
|
||||
|
||||
|
||||
/**
|
||||
* replaceable_echo
|
||||
*
|
||||
* @param string $message Message
|
||||
* @param int $force_clear_lines Force clear messages
|
||||
* @return void
|
||||
*/
|
||||
function replaceable_echo($message, $force_clear_lines = null)
|
||||
{
|
||||
static $last_lines = 0;
|
||||
|
||||
if (!is_null($force_clear_lines)) {
|
||||
$last_lines = $force_clear_lines;
|
||||
}
|
||||
|
||||
$toss = array();
|
||||
$status = 0;
|
||||
$term_width = exec('tput cols', $toss, $status);
|
||||
if ($status) {
|
||||
$term_width = 64; // Arbitrary fall-back term width.
|
||||
}
|
||||
|
||||
$line_count = 0;
|
||||
foreach (explode("\n", $message) as $line) {
|
||||
$line_count += count(str_split($line, $term_width));
|
||||
}
|
||||
|
||||
// Erasure MAGIC: Clear as many lines as the last output had.
|
||||
for ($i = 0; $i < $last_lines; $i++) {
|
||||
// Return to the beginning of the line
|
||||
echo "\r";
|
||||
// Erase to the end of the line
|
||||
echo "\033[K";
|
||||
// Move cursor Up a line
|
||||
echo "\033[1A";
|
||||
// Return to the beginning of the line
|
||||
echo "\r";
|
||||
// Erase to the end of the line
|
||||
echo "\033[K";
|
||||
// Return to the beginning of the line
|
||||
echo "\r";
|
||||
// Can be consolodated into
|
||||
// echo "\r\033[K\033[1A\r\033[K\r";
|
||||
}
|
||||
|
||||
$last_lines = $line_count;
|
||||
|
||||
echo $message . "\n";
|
||||
}
|
||||
@@ -1,248 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/initdata/import-product.php
|
||||
* \brief Script example to insert products from a csv file.
|
||||
* To purge data, you can have a look at purge-data.php
|
||||
*/
|
||||
// Test si mode batch
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path = dirname(__FILE__) . '/';
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path = preg_replace('/importdb-products.php/i', '', $_SERVER["PHP_SELF"]);
|
||||
require $path . "../../htdocs/master.inc.php";
|
||||
require $path . "includes/dbase.class.php";
|
||||
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
//$delimiter = ',';
|
||||
//$enclosure = '"';
|
||||
//$linelength = 10000;
|
||||
//$escape = '/';
|
||||
// Global variables
|
||||
$version = DOL_VERSION;
|
||||
$confirmed = 1;
|
||||
$error = 0;
|
||||
|
||||
$tvas = [
|
||||
'1' => "20.00",
|
||||
'2' => "5.50",
|
||||
'3' => "0.00",
|
||||
'4' => "20.60",
|
||||
'5' => "19.60",
|
||||
];
|
||||
$tvasD = [
|
||||
'1' => "20",
|
||||
'2' => "5.5",
|
||||
'3' => "0",
|
||||
'4' => "20",
|
||||
'5' => "20",
|
||||
];
|
||||
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
|
||||
@set_time_limit(0);
|
||||
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
|
||||
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
|
||||
|
||||
$table = $argv[1];
|
||||
|
||||
if (empty($argv[1])) {
|
||||
print "Error: Which table ?\n";
|
||||
print "\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
$ret = $user->fetch('', 'admin');
|
||||
if (!$ret > 0) {
|
||||
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM `$table` WHERE 1";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
while ($fields = $db->fetch_array($resql)) {
|
||||
$errorrecord = 0;
|
||||
if ($fields === false) {
|
||||
continue;
|
||||
}
|
||||
$nboflines++;
|
||||
|
||||
$produit = new Product($db);
|
||||
$produit->type = 0;
|
||||
$produit->status = 1;
|
||||
$produit->ref = trim($fields['REF']);
|
||||
if ($produit->ref == '') {
|
||||
continue;
|
||||
}
|
||||
print "Process line nb " . $j . ", ref " . $produit->ref;
|
||||
$produit->label = trim($fields['LIBELLE']);
|
||||
if ($produit->label == '') {
|
||||
$produit->label = $produit->ref;
|
||||
}
|
||||
if (empty($produit->label)) {
|
||||
continue;
|
||||
}
|
||||
//$produit->description = trim($fields[4] . "\n" . ($fields[5] ? $fields[5] . ' x ' . $fields[6] . ' x ' . $fields[7] : ''));
|
||||
// $produit->volume = price2num($fields[8]);
|
||||
// $produit->volume_unit = 0;
|
||||
$produit->weight = price2num($fields['MASSE']);
|
||||
$produit->weight_units = 0; // -3 = g
|
||||
//$produit->customcode = $fields[10];
|
||||
$produit->barcode = str_pad($fields['CODE'], 12, "0", STR_PAD_LEFT);
|
||||
$produit->barcode_type = '2';
|
||||
$produit->import_key = $fields['CODE'];
|
||||
|
||||
$produit->status = 1;
|
||||
$produit->status_buy = 1;
|
||||
|
||||
$produit->finished = 1;
|
||||
|
||||
// $produit->multiprices[0] = price2num($fields['TARIF0']);
|
||||
// $produit->multiprices[1] = price2num($fields['TARIF1']);
|
||||
// $produit->multiprices[2] = price2num($fields['TARIF2']);
|
||||
// $produit->multiprices[3] = price2num($fields['TARIF3']);
|
||||
// $produit->multiprices[4] = price2num($fields['TARIF4']);
|
||||
// $produit->multiprices[5] = price2num($fields['TARIF5']);
|
||||
// $produit->multiprices[6] = price2num($fields['TARIF6']);
|
||||
// $produit->multiprices[7] = price2num($fields['TARIF7']);
|
||||
// $produit->multiprices[8] = price2num($fields['TARIF8']);
|
||||
// $produit->multiprices[9] = price2num($fields['TARIF9']);
|
||||
// $produit->price_min = null;
|
||||
// $produit->price_min_ttc = null;
|
||||
// $produit->price = price2num($fields[11]);
|
||||
// $produit->price_ttc = price2num($fields[12]);
|
||||
// $produit->price_base_type = 'TTC';
|
||||
// $produit->tva_tx = price2num($fields[13]);
|
||||
$produit->tva_tx = (int) ($tvas[$fields['CODTVA']]);
|
||||
$produit->tva_npr = 0;
|
||||
// $produit->cost_price = price2num($fields[16]);
|
||||
//compta
|
||||
|
||||
$produit->accountancy_code_buy = trim($fields['COMACH']);
|
||||
$produit->accountancy_code_sell = trim($fields['COMVEN']);
|
||||
// $produit->accountancy_code_sell_intra=trim($fields['COMVEN']);
|
||||
// $produit->accountancy_code_sell_export=trim($fields['COMVEN']);
|
||||
// Extrafields
|
||||
// $produit->array_options['options_ecotaxdeee'] = price2num($fields[17]);
|
||||
|
||||
$produit->seuil_stock_alerte = $fields['STALERTE'];
|
||||
$ret = $produit->create($user, 0);
|
||||
if ($ret < 0) {
|
||||
print " - Error in create result code = " . $ret . " - " . $produit->errorsToString();
|
||||
$errorrecord++;
|
||||
} else {
|
||||
print " - Creation OK with ref " . $produit->ref . " - id = " . $ret;
|
||||
}
|
||||
|
||||
dol_syslog("Add prices");
|
||||
|
||||
// If we use price level, insert price for each level
|
||||
if (!$errorrecord && 1) {
|
||||
//$ret1 = $produit->updatePrice($produit->price_ttc, $produit->price_base_type, $user, $produit->tva_tx, $produit->price_min, 1, $produit->tva_npr, 0, 0, array());
|
||||
$ret1 = false;
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
if ($fields['TARIF' . ($i)] == 0) {
|
||||
continue;
|
||||
}
|
||||
$ret1 = $ret1 || $produit->updatePrice(price2num($fields['TARIF' . ($i)]), 'HT', $user, $produit->tva_tx, $produit->price_min, $i + 1, $produit->tva_npr, 0, 0, array()) < 0;
|
||||
}
|
||||
if ($ret1) {
|
||||
print " - Error in updatePrice result " . $produit->errorsToString();
|
||||
$errorrecord++;
|
||||
} else {
|
||||
print " - updatePrice OK";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// dol_syslog("Add multilangs");
|
||||
// Add alternative languages
|
||||
// if (!$errorrecord && 1) {
|
||||
// $produit->multilangs['fr_FR'] = array('label' => $produit->label, 'description' => $produit->description, 'note' => $produit->note_private);
|
||||
// $produit->multilangs['en_US'] = array('label' => $fields[3], 'description' => $produit->description, 'note' => $produit->note_private);
|
||||
//
|
||||
// $ret = $produit->setMultiLangs($user);
|
||||
// if ($ret < 0) {
|
||||
// print " - Error in setMultiLangs result code = " . $ret . " - " . $produit->errorsToString();
|
||||
// $errorrecord++;
|
||||
// } else {
|
||||
// print " - setMultiLangs OK";
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
dol_syslog("Add stocks");
|
||||
// stocks
|
||||
if (!$errorrecord && $fields['STOCK'] != 0) {
|
||||
$rets = $produit->correct_stock($user, 1, $fields['STOCK'], 0, 'Stock importé');
|
||||
if ($rets < 0) {
|
||||
print " - Error in correct_stock result " . $produit->errorsToString();
|
||||
$errorrecord++;
|
||||
} else {
|
||||
print " - correct_stock OK";
|
||||
}
|
||||
}
|
||||
|
||||
//update date créa
|
||||
if (!$errorrecord) {
|
||||
$date = substr($fields['DATCREA'], 0, 4) . '-' . substr($fields['DATCREA'], 4, 2) . '-' . substr($fields['DATCREA'], 6, 2);
|
||||
$retd = $db->query("UPDATE `llx_product` SET `datec` = '$date 00:00:00' WHERE `llx_product`.`rowid` = $produit->id");
|
||||
if ($retd < 1) {
|
||||
print " - Error in update date créa result " . $produit->errorsToString();
|
||||
$errorrecord++;
|
||||
} else {
|
||||
print " - update date créa OK";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
|
||||
if ($errorrecord) {
|
||||
print( 'Error on record nb ' . $i . " - " . $produit->errorsToString() . "\n");
|
||||
var_dump($db);
|
||||
die();
|
||||
$error++; // $errorrecord will be reset
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
} else {
|
||||
die("error : $sql");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// commit or rollback
|
||||
print "Nb of lines qualified: " . $nboflines . "\n";
|
||||
print "Nb of errors: " . $error . "\n";
|
||||
$db->close();
|
||||
|
||||
exit($error);
|
||||
@@ -1,365 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/initdata/import-product.php
|
||||
* \brief Script example to insert products from a csv file.
|
||||
* To purge data, you can have a look at purge-data.php
|
||||
*/
|
||||
// Test si mode batch
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path = dirname(__FILE__) . '/';
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path = preg_replace('/importdb-thirdparties.php/i', '', $_SERVER["PHP_SELF"]);
|
||||
require $path . "../../htdocs/master.inc.php";
|
||||
require $path . "includes/dbase.class.php";
|
||||
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
//$delimiter = ',';
|
||||
//$enclosure = '"';
|
||||
//$linelength = 10000;
|
||||
//$escape = '/';
|
||||
// Global variables
|
||||
$version = DOL_VERSION;
|
||||
$confirmed = 1;
|
||||
$error = 0;
|
||||
|
||||
$civilPrivate = array("MLLE",
|
||||
"MM",
|
||||
"MM/MADAME",
|
||||
"MME",
|
||||
"MME.",
|
||||
"MME²",
|
||||
"MMONSIEUR",
|
||||
"MMR",
|
||||
"MOBNSIEUR",
|
||||
"MOMSIEUR",
|
||||
"MON SIEUR",
|
||||
"MONDIAL",
|
||||
"MONIEUR",
|
||||
"MONJSIEUR",
|
||||
"MONNSIEUR",
|
||||
"MONRIEUR",
|
||||
"MONS",
|
||||
"MONSIEÕR",
|
||||
"MONSIER",
|
||||
"MONSIERU",
|
||||
"MONSIEU",
|
||||
"monsieue",
|
||||
"MONSIEUR",
|
||||
"Monsieur \"",
|
||||
"MONSIEUR \"",
|
||||
"MONSIEUR E",
|
||||
"MONSIEUR DENIS",
|
||||
"MONSIEUR ET MME",
|
||||
"MONSIEUR!",
|
||||
"MONSIEUR.",
|
||||
"MONSIEUR.MADAME",
|
||||
"MONSIEUR3",
|
||||
"MONSIEURN",
|
||||
"MONSIEURT",
|
||||
"MONSIEUR£",
|
||||
"MONSIEYR",
|
||||
"Monsigur",
|
||||
"MONSIIEUR",
|
||||
"MONSIUER",
|
||||
"MONSIZEUR",
|
||||
"MOPNSIEUR",
|
||||
"MOSIEUR",
|
||||
"MR",
|
||||
"Mr Mme",
|
||||
"Mr - MME",
|
||||
"MR BLANC",
|
||||
"MR ET MME",
|
||||
"mr mm",
|
||||
"MR OU MME",
|
||||
"Mr.",
|
||||
"MR/MME",
|
||||
"MRME",
|
||||
"MRR",
|
||||
"Mrs",
|
||||
"Mademoiselle",
|
||||
"MADAOME",
|
||||
"madamme",
|
||||
"MADAME",
|
||||
"M0NSIEUR",
|
||||
"M.et Madame",
|
||||
"M. ET MR",
|
||||
"M.",
|
||||
"M%",
|
||||
"M MME",
|
||||
"M ET MME",
|
||||
"M",
|
||||
"M CROCE",
|
||||
"M DIEVART",
|
||||
);
|
||||
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
|
||||
@set_time_limit(0);
|
||||
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
|
||||
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
|
||||
|
||||
$table = $argv[1];
|
||||
|
||||
if (empty($argv[1])) {
|
||||
print "Error: Quelle table ?\n";
|
||||
print "\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
$ret = $user->fetch('', 'admin');
|
||||
if (!$ret > 0) {
|
||||
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM `$table` WHERE 1 "; //ORDER BY REMISE DESC,`LCIVIL` DESC";
|
||||
$resql = $db->query($sql);
|
||||
//$db->begin();
|
||||
if ($resql) {
|
||||
while ($fields = $db->fetch_array($resql)) {
|
||||
$i++;
|
||||
$errorrecord = 0;
|
||||
|
||||
if ($startlinenb && $i < $startlinenb) {
|
||||
continue;
|
||||
}
|
||||
if ($endlinenb && $i > $endlinenb) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$nboflines++;
|
||||
|
||||
$object = new Societe($db);
|
||||
$object->import_key = $fields['CODE'];
|
||||
$object->state = 1;
|
||||
$object->client = 3;
|
||||
$object->fournisseur = 0;
|
||||
|
||||
$object->name = $fields['FCIVIL'] . ' ' . $fields['FNOM'];
|
||||
//$object->name_alias = $fields[0] != $fields[13] ? trim($fields[0]) : '';
|
||||
|
||||
$date = $fields['DATCREA'] ? $fields['DATCREA'] : ($fields['DATMOD'] ? $fields['DATMOD'] : '20200101');
|
||||
$object->code_client = 'CU' . substr($date, 2, 2) . substr($date, 4, 2) . '-' . str_pad(substr($fields['CODE'], 0, 5), 5, "0", STR_PAD_LEFT);
|
||||
|
||||
|
||||
$object->address = trim($fields['FADR1']);
|
||||
if ($fields['FADR2']) {
|
||||
$object->address .= "\n" . trim($fields['FADR2']);
|
||||
}
|
||||
if ($fields['FADR3']) {
|
||||
$object->address .= "\n" . trim($fields['FADR3']);
|
||||
}
|
||||
|
||||
$object->zip = trim($fields['FPOSTE']);
|
||||
$object->town = trim($fields['FVILLE']);
|
||||
if ($fields['FPAYS']) {
|
||||
$object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid');
|
||||
} else {
|
||||
$object->country_id = 1;
|
||||
}
|
||||
$object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']);
|
||||
$object->phone = substr($object->phone, 0, 20);
|
||||
$object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']);
|
||||
$object->fax = substr($object->fax, 0, 20);
|
||||
$object->email = trim($fields['FMAIL']);
|
||||
// $object->idprof2 = trim($fields[29]);
|
||||
$object->tva_intra = str_replace(['.', ' '], '', $fields['TVAINTRA']);
|
||||
$object->tva_intra = substr($object->tva_intra, 0, 20);
|
||||
$object->default_lang = 'fr_FR';
|
||||
|
||||
$object->cond_reglement_id = dol_getIdFromCode($db, 'PT_ORDER', 'c_payment_term', 'code', 'rowid', 1);
|
||||
$object->multicurrency_code = 'EUR';
|
||||
|
||||
if ($fields['REMISE'] != '0.00') {
|
||||
$object->remise_percent = abs($fields['REMISE']);
|
||||
}
|
||||
|
||||
// $object->code_client = $fields[9];
|
||||
// $object->code_fournisseur = $fields[10];
|
||||
|
||||
|
||||
if ($fields['FCIVIL']) {
|
||||
$labeltype = in_array($fields['FCIVIL'], $civilPrivate) ? 'TE_PRIVATE' : 'TE_SMALL';
|
||||
$object->typent_id = dol_getIdFromCode($db, $labeltype, 'c_typent', 'code');
|
||||
}
|
||||
|
||||
// Set price level
|
||||
$object->price_level = $fields['TARIF'] + 1;
|
||||
// if ($labeltype == 'Revendeur')
|
||||
// $object->price_level = 2;
|
||||
|
||||
print "Process line nb " . $i . ", code " . $fields['CODE'] . ", name " . $object->name;
|
||||
|
||||
|
||||
// Extrafields
|
||||
$object->array_options['options_banque'] = $fields['BANQUE'];
|
||||
$object->array_options['options_banque2'] = $fields['BANQUE2'];
|
||||
$object->array_options['options_banquevalid'] = $fields['VALID'];
|
||||
|
||||
if (!$errorrecord) {
|
||||
$ret = $object->create($user);
|
||||
if ($ret < 0) {
|
||||
print " - Error in create result code = " . $ret . " - " . $object->errorsToString();
|
||||
$errorrecord++;
|
||||
var_dump($object->code_client, $db);
|
||||
die();
|
||||
} else {
|
||||
print " - Creation OK with name " . $object->name . " - id = " . $ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$errorrecord) {
|
||||
dol_syslog("Set price level");
|
||||
$object->set_price_level($object->price_level, $user);
|
||||
}
|
||||
if (!$errorrecord && @$object->remise_percent) {
|
||||
dol_syslog("Set remise client");
|
||||
$object->set_remise_client($object->remise_percent, 'Importé', $user);
|
||||
}
|
||||
|
||||
dol_syslog("Add contact");
|
||||
// Insert an invoice contact if there is an invoice email != standard email
|
||||
if (!$errorrecord && ($fields['LCIVIL'] || $fields['LNOM'])) {
|
||||
$madame = array("MADAME",
|
||||
"MADEMOISELLE",
|
||||
"MELLE",
|
||||
"MLLE",
|
||||
"MM",
|
||||
"Mme",
|
||||
"MNE",
|
||||
);
|
||||
$monsieur = array("M",
|
||||
"M ET MME",
|
||||
"M MME",
|
||||
"M.",
|
||||
"M. MME",
|
||||
"M. OU Mme",
|
||||
"M.ou Madame",
|
||||
"MONSEUR",
|
||||
"MONSIER",
|
||||
"MONSIEU",
|
||||
"MONSIEUR",
|
||||
"monsieur:mme",
|
||||
"MONSIEUR¨",
|
||||
"MONSIEZUR",
|
||||
"MONSIUER",
|
||||
"MONSKIEUR",
|
||||
"MR",
|
||||
);
|
||||
$ret1 = $ret2 = 0;
|
||||
|
||||
$contact = new Contact($db);
|
||||
if (in_array($fields['LCIVIL'], $madame)) {
|
||||
// une dame
|
||||
$contact->civility_id = 'MME';
|
||||
$contact->lastname = $fields['LNOM'];
|
||||
} elseif (in_array($fields['LCIVIL'], $monsieur)) {
|
||||
// un monsieur
|
||||
$contact->civility_id = 'MR';
|
||||
$contact->lastname = $fields['LNOM'];
|
||||
} elseif (in_array($fields['LCIVIL'], ['DOCTEUR'])) {
|
||||
// un monsieur
|
||||
$contact->civility_id = 'DR';
|
||||
$contact->lastname = $fields['LNOM'];
|
||||
} else {
|
||||
// un a rattraper
|
||||
$contact->lastname = $fields['LCIVIL'] . " " . $fields['LNOM'];
|
||||
}
|
||||
$contact->address = trim($fields['LADR1']);
|
||||
if ($fields['LADR2']) {
|
||||
$contact->address .= "\n" . trim($fields['LADR2']);
|
||||
}
|
||||
if ($fields['LADR3']) {
|
||||
$contact->address .= "\n" . trim($fields['LADR3']);
|
||||
}
|
||||
|
||||
$contact->zip = trim($fields['LPOSTE']);
|
||||
$contact->town = trim($fields['LVILLE']);
|
||||
if ($fields['FPAYS']) {
|
||||
$contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid');
|
||||
} else {
|
||||
$contact->country_id = 1;
|
||||
}
|
||||
$contact->email = $fields['LMAIL'];
|
||||
$contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']);
|
||||
$contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']);
|
||||
$contact->socid = $object->id;
|
||||
|
||||
$ret1 = $contact->create($user);
|
||||
if ($ret1 > 0) {
|
||||
//$ret2=$contact->add_contact($object->id, 'BILLING');
|
||||
}
|
||||
if ($ret1 < 0 || $ret2 < 0) {
|
||||
print " - Error in create contact result code = " . $ret1 . " " . $ret2 . " - " . $contact->errorsToString();
|
||||
$errorrecord++;
|
||||
} else {
|
||||
print " - create contact OK";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//update date créa
|
||||
if (!$errorrecord) {
|
||||
$datec = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2);
|
||||
$retd = $db->query("UPDATE `llx_societe` SET `datec` = '$datec 00:00:00' WHERE `rowid` = $object->id");
|
||||
if ($retd < 1) {
|
||||
print " - Error in update date créa result " . $object->errorsToString();
|
||||
$errorrecord++;
|
||||
} else {
|
||||
print " - update date créa OK";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
|
||||
if ($errorrecord) {
|
||||
print( 'Error on record nb ' . $i . " - " . $object->errorsToString() . "\n");
|
||||
var_dump($db, $object, $contact);
|
||||
// $db->rollback();
|
||||
die();
|
||||
$error++; // $errorrecord will be reset
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
} else {
|
||||
die("error : $sql");
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
|
||||
|
||||
|
||||
// commit or rollback
|
||||
print "Nb of lines qualified: " . $nboflines . "\n";
|
||||
print "Nb of errors: " . $error . "\n";
|
||||
$db->close();
|
||||
|
||||
exit($error);
|
||||
@@ -1,599 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* \file dev/initdata/dbf/includes/dbase.class.php
|
||||
* \ingroup dev
|
||||
* \brief Class to manage DBF databases
|
||||
*/
|
||||
|
||||
// source : https://github.com/donfbecker/php-dbase
|
||||
|
||||
define('DBASE_RDONLY', 0);
|
||||
define('DBASE_WRONLY', 1);
|
||||
define('DBASE_RDWR', 2);
|
||||
define('DBASE_TYPE_DBASE', 0);
|
||||
define('DBASE_TYPE_FOXPRO', 1);
|
||||
|
||||
/**
|
||||
* Class for DBase
|
||||
*/
|
||||
class DBase
|
||||
{
|
||||
private $fd;
|
||||
private $headerLength = 0;
|
||||
private $fields = array();
|
||||
private $fieldCount = 0;
|
||||
private $recordLength = 0;
|
||||
private $recordCount = 0;
|
||||
|
||||
/**
|
||||
* resource dbase_open
|
||||
* @param string $filename filename
|
||||
* @param int $mode mode
|
||||
* @return DBase
|
||||
*/
|
||||
public static function open($filename, $mode)
|
||||
{
|
||||
if (!file_exists($filename)) {
|
||||
return false;
|
||||
}
|
||||
$modes = array('r', 'w', 'r+');
|
||||
$mode = $modes[$mode];
|
||||
$fd = fopen($filename, $mode);
|
||||
if (!$fd) {
|
||||
return false;
|
||||
}
|
||||
return new DBase($fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* resource dbase_create
|
||||
* @param string $filename filename
|
||||
* @param array $fields fields
|
||||
* @param int $type DBASE_TYPE_DBASE
|
||||
* @return DBase
|
||||
*/
|
||||
public static function create($filename, $fields, $type = DBASE_TYPE_DBASE)
|
||||
{
|
||||
if (file_exists($filename)) {
|
||||
return false;
|
||||
}
|
||||
$fd = fopen($filename, 'c+');
|
||||
if (!$fd) {
|
||||
return false;
|
||||
}
|
||||
// Byte 0 (1 byte): Valid dBASE for DOS file; bits 0-2 indicate version number, bit 3
|
||||
// indicates the presence of a dBASE for DOS memo file, bits 4-6 indicate the
|
||||
// presence of a SQL table, bit 7 indicates the presence of any memo file
|
||||
// (either dBASE m PLUS or dBASE for DOS)
|
||||
self::putChar8($fd, 5);
|
||||
// Byte 1-3 (3 bytes): Date of last update; formatted as YYMMDD
|
||||
self::putChar8($fd, date('Y') - 1900);
|
||||
self::putChar8($fd, date('m'));
|
||||
self::putChar8($fd, date('d'));
|
||||
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
|
||||
self::putInt32($fd, 0);
|
||||
// Byte 8-9 (16-bit number): Number of bytes in the header.
|
||||
self::putInt16($fd, 32 + (32 * count($fields)) + 1);
|
||||
// Byte 10-11 (16-bit number): Number of bytes in record.
|
||||
// Make sure the include the byte for deleted flag
|
||||
$len = 1;
|
||||
foreach ($fields as &$field) {
|
||||
$len += self::length($field);
|
||||
}
|
||||
self::putInt16($fd, $len);
|
||||
// Byte 12-13 (2 bytes): Reserved, 0 filled.
|
||||
self::putInt16($fd, 0);
|
||||
// Byte 14 (1 byte): Flag indicating incomplete transaction
|
||||
// The ISMARKEDO function checks this flag. BEGIN TRANSACTION sets it to 1, END TRANSACTION and ROLLBACK reset it to 0.
|
||||
self::putChar8($fd, 0);
|
||||
// Byte 15 (1 byte): Encryption flag. If this flag is set to 1, the message Database encrypted appears. Changing this flag to 0 removes the message, but does not decrypt the file.
|
||||
self::putChar8($fd, 0);
|
||||
// Byte 16-27 (12 bytes): Reserved for dBASE for DOS in a multi-user environment
|
||||
self::putInt32($fd, 0);
|
||||
self::putInt32($fd, 0);
|
||||
self::putInt32($fd, 0);
|
||||
// Byte 28 (1 byte): Production .mdx file flag; 0x01 if there is a production .mdx file, 0x00 if not
|
||||
self::putChar8($fd, 0);
|
||||
// Byte 29 (1 byte): Language driver ID
|
||||
// (no clue what this is)
|
||||
self::putChar8($fd, 0);
|
||||
// Byte 30-31 (2 bytes): Reserved, 0 filled.
|
||||
self::putInt16($fd, 0);
|
||||
// Byte 32 - n (32 bytes each): Field descriptor array
|
||||
foreach ($fields as &$field) {
|
||||
self::putString($fd, $field[0], 11); // Byte 0 - 10 (11 bytes): Field name in ASCII (zero-filled)
|
||||
self::putString($fd, $field[1], 1); // Byte 11 (1 byte): Field type in ASCII (C, D, F, L, M, or N)
|
||||
self::putInt32($fd, 0); // Byte 12 - 15 (4 bytes): Reserved
|
||||
self::putChar8($fd, self::length($field)); // Byte 16 (1 byte): Field length in binary. The maximum length of a field is 254 (0xFE).
|
||||
self::putChar8($fd, $field[3]); // Byte 17 (1 byte): Field decimal count in binary
|
||||
self::putInt16($fd, 0); // Byte 18 - 19 (2 bytes): Work area ID
|
||||
self::putChar8($fd, 0); // Byte 20 (1 byte): Example (??)
|
||||
self::putInt32($fd, 0); // Byte 21 - 30 (10 bytes): Reserved
|
||||
self::putInt32($fd, 0);
|
||||
self::putInt16($fd, 0);
|
||||
self::putChar8($fd, 0); // Byte 31 (1 byte): Production MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not
|
||||
}
|
||||
// Byte n + 1 (1 byte): 0x0D as the field descriptor array terminator
|
||||
self::putChar8($fd, 0x0D);
|
||||
return new DBase($fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DBase instance
|
||||
* @param mixed $fd file descriptor
|
||||
* @return void
|
||||
*/
|
||||
private function __construct($fd)
|
||||
{
|
||||
$this->fd = $fd;
|
||||
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
|
||||
fseek($this->fd, 4, SEEK_SET);
|
||||
$this->recordCount = self::getInt32($fd);
|
||||
// Byte 8-9 (16-bit number): Number of bytes in the header.
|
||||
fseek($this->fd, 8, SEEK_SET);
|
||||
$this->headerLength = self::getInt16($fd);
|
||||
// Number of fields is (headerLength - 33) / 32)
|
||||
$this->fieldCount = ($this->headerLength - 33) / 32;
|
||||
// Byte 10-11 (16-bit number): Number of bytes in record.
|
||||
fseek($this->fd, 10, SEEK_SET);
|
||||
$this->recordLength = self::getInt16($fd);
|
||||
// Byte 32 - n (32 bytes each): Field descriptor array
|
||||
fseek($fd, 32, SEEK_SET);
|
||||
for ($i = 0; $i < $this->fieldCount; $i++) {
|
||||
$data = fread($this->fd, 32);
|
||||
$field = array_map('trim', unpack('a11name/a1type/c4/c1length/c1precision/s1workid/c1example/c10/c1production', $data));
|
||||
$this->fields[] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_close
|
||||
* @return void
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
fclose($this->fd);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* dbase_get_header_info
|
||||
* @return array
|
||||
*/
|
||||
public function get_header_info()
|
||||
{
|
||||
// phpcs:disable
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_numfields
|
||||
* @return int
|
||||
*/
|
||||
public function numfields()
|
||||
{
|
||||
return $this->fieldCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_numrecords
|
||||
* @return int
|
||||
*/
|
||||
public function numrecords()
|
||||
{
|
||||
return $this->recordCount;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* dbase_add_record
|
||||
* @param array $record record
|
||||
* @return bool
|
||||
*/
|
||||
public function add_record($record)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (count($record) != $this->fieldCount) {
|
||||
return false;
|
||||
}
|
||||
// Seek to end of file, minus the end of file marker
|
||||
fseek($this->fd, 0, SEEK_END);
|
||||
// Put the deleted flag
|
||||
self::putChar8($this->fd, 0x20);
|
||||
// Put the record
|
||||
if (!$this->putRecord($record)) {
|
||||
return false;
|
||||
}
|
||||
// Update the record count
|
||||
fseek($this->fd, 4);
|
||||
self::putInt32($this->fd, ++$this->recordCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* dbase_replace_record
|
||||
* @param array $record record
|
||||
* @param int $record_number record number
|
||||
* @return bool
|
||||
*/
|
||||
public function replace_record($record, $record_number)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (count($record) != $this->fieldCount) {
|
||||
return false;
|
||||
}
|
||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
||||
return false;
|
||||
}
|
||||
// Skip to the record location, plus the 1 byte for the deleted flag
|
||||
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)) + 1);
|
||||
return $this->putRecord($record);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* dbase_delete_record
|
||||
* @param int $record_number record number
|
||||
* @return bool
|
||||
*/
|
||||
public function delete_record($record_number)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
||||
return false;
|
||||
}
|
||||
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
|
||||
self::putChar8($this->fd, 0x2A);
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* dbase_get_record
|
||||
* @param int $record_number record number
|
||||
* @return array
|
||||
*/
|
||||
public function get_record($record_number)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
||||
return false;
|
||||
}
|
||||
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
|
||||
$record = array(
|
||||
'deleted' => self::getChar8($this->fd) == 0x2A ? 1 : 0
|
||||
);
|
||||
foreach ($this->fields as $i => &$field) {
|
||||
$value = trim(fread($this->fd, $field['length']));
|
||||
if ($field['type'] == 'L') {
|
||||
$value = strtolower($value);
|
||||
if ($value == 't' || $value == 'y') {
|
||||
$value = true;
|
||||
} elseif ($value == 'f' || $value == 'n') {
|
||||
$value = false;
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
$record[$i] = $value;
|
||||
}
|
||||
return $record;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* dbase_get_record_with_names
|
||||
* @param int $record_number record number
|
||||
* @return array
|
||||
*/
|
||||
public function get_record_with_names($record_number)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($record_number < 1 || $record_number > $this->recordCount) {
|
||||
return false;
|
||||
}
|
||||
$record = $this->get_record($record_number);
|
||||
foreach ($this->fields as $i => &$field) {
|
||||
$record[$field['name']] = $record[$i];
|
||||
unset($record[$i]);
|
||||
}
|
||||
return $record;
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_pack
|
||||
* @return void
|
||||
*/
|
||||
public function pack()
|
||||
{
|
||||
$in_offset = $out_offset = $this->headerLength;
|
||||
$new_count = 0;
|
||||
$rec_count = $this->recordCount;
|
||||
while ($rec_count > 0) {
|
||||
fseek($this->fd, $in_offset, SEEK_SET);
|
||||
$record = fread($this->fd, $this->recordLength);
|
||||
$deleted = substr($record, 0, 1);
|
||||
if ($deleted != '*') {
|
||||
fseek($this->fd, $out_offset, SEEK_SET);
|
||||
fwrite($this->fd, $record);
|
||||
$out_offset += $this->recordLength;
|
||||
$new_count++;
|
||||
}
|
||||
$in_offset += $this->recordLength;
|
||||
$rec_count--;
|
||||
}
|
||||
ftruncate($this->fd, $out_offset);
|
||||
// Update the record count
|
||||
fseek($this->fd, 4);
|
||||
self::putInt32($this->fd, $new_count);
|
||||
}
|
||||
|
||||
/*
|
||||
* A few utilitiy functions
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param string $field field
|
||||
* @return int
|
||||
*/
|
||||
private static function length($field)
|
||||
{
|
||||
switch ($field[1]) {
|
||||
case 'D': // Date: Numbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
|
||||
return 8;
|
||||
case 'T': // DateTime (YYYYMMDDhhmmss.uuu) (FoxPro)
|
||||
return 18;
|
||||
case 'M': // Memo (ignored): All ASCII characters (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
|
||||
case 'N': // Number: -.0123456789 (right justified, padded with whitespaces)
|
||||
case 'F': // Float: -.0123456789 (right justified, padded with whitespaces)
|
||||
case 'C': // String: All ASCII characters (padded with whitespaces up to the field's length)
|
||||
return $field[2];
|
||||
case 'L': // Boolean: YyNnTtFf? (? when not initialized)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Functions for reading and writing bytes
|
||||
*/
|
||||
|
||||
/**
|
||||
* getChar8
|
||||
* @param mixed $fd file descriptor
|
||||
* @return int
|
||||
*/
|
||||
private static function getChar8($fd)
|
||||
{
|
||||
return ord(fread($fd, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* putChar8
|
||||
* @param mixed $fd file descriptor
|
||||
* @param mixed $value value
|
||||
* @return bool
|
||||
*/
|
||||
private static function putChar8($fd, $value)
|
||||
{
|
||||
return fwrite($fd, chr($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* getInt16
|
||||
* @param mixed $fd file descriptor
|
||||
* @param int $n n
|
||||
* @return bool
|
||||
*/
|
||||
private static function getInt16($fd, $n = 1)
|
||||
{
|
||||
$data = fread($fd, 2 * $n);
|
||||
$i = unpack("S$n", $data);
|
||||
if ($n == 1) {
|
||||
return (int) $i[1];
|
||||
} else {
|
||||
return array_merge($i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* putInt16
|
||||
* @param mixed $fd file descriptor
|
||||
* @param mixed $value value
|
||||
* @return bool
|
||||
*/
|
||||
private static function putInt16($fd, $value)
|
||||
{
|
||||
return fwrite($fd, pack('S', $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* getInt32
|
||||
* @param mixed $fd file descriptor
|
||||
* @param int $n n
|
||||
* @return bool
|
||||
*/
|
||||
private static function getInt32($fd, $n = 1)
|
||||
{
|
||||
$data = fread($fd, 4 * $n);
|
||||
$i = unpack("L$n", $data);
|
||||
if ($n == 1) {
|
||||
return (int) $i[1];
|
||||
} else {
|
||||
return array_merge($i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* putint32
|
||||
* @param mixed $fd file descriptor
|
||||
* @param mixed $value value
|
||||
* @return bool
|
||||
*/
|
||||
private static function putInt32($fd, $value)
|
||||
{
|
||||
return fwrite($fd, pack('L', $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* putString
|
||||
* @param mixed $fd file descriptor
|
||||
* @param mixed $value value
|
||||
* @param int $length length
|
||||
* @return bool
|
||||
*/
|
||||
private static function putString($fd, $value, $length = 254)
|
||||
{
|
||||
$ret = fwrite($fd, pack('A' . $length, $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* putRecord
|
||||
* @param mixed $record record
|
||||
* @return bool
|
||||
*/
|
||||
private function putRecord($record)
|
||||
{
|
||||
foreach ($this->fields as $i => &$field) {
|
||||
$value = $record[$i];
|
||||
// Number types are right aligned with spaces
|
||||
if ($field['type'] == 'N' || $field['type'] == 'F' && strlen($value) < $field['length']) {
|
||||
$value = str_repeat(' ', $field['length'] - strlen($value)) . $value;
|
||||
}
|
||||
self::putString($this->fd, $value, $field['length']);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('dbase_open')) {
|
||||
/**
|
||||
* dbase_open
|
||||
* @param string $filename filename
|
||||
* @param int $mode mode
|
||||
* @return DBase
|
||||
*/
|
||||
function dbase_open($filename, $mode)
|
||||
{
|
||||
return DBase::open($filename, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_create
|
||||
* @param string $filename filename
|
||||
* @param array $fields fields
|
||||
* @param int $type type
|
||||
* @return DBase
|
||||
*/
|
||||
function dbase_create($filename, $fields, $type = DBASE_TYPE_DBASE)
|
||||
{
|
||||
return DBase::create($filename, $fields, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_close
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_close($dbase_identifier)
|
||||
{
|
||||
return $dbase_identifier->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_get_header_info
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @return string
|
||||
*/
|
||||
function dbase_get_header_info($dbase_identifier)
|
||||
{
|
||||
return $dbase_identifier->get_header_info();
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_numfields
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @return int
|
||||
*/
|
||||
function dbase_numfields($dbase_identifier)
|
||||
{
|
||||
$dbase_identifier->numfields();
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_numrecords
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @return int
|
||||
*/
|
||||
function dbase_numrecords($dbase_identifier)
|
||||
{
|
||||
return $dbase_identifier->numrecords();
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_add_record
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @param array $record record
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_add_record($dbase_identifier, $record)
|
||||
{
|
||||
return $dbase_identifier->add_record($record);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_delete_record
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @param int $record_number record number
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_delete_record($dbase_identifier, $record_number)
|
||||
{
|
||||
return $dbase_identifier->delete_record($record_number);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_replace_record
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @param array $record record
|
||||
* @param int $record_number record number
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_replace_record($dbase_identifier, $record, $record_number)
|
||||
{
|
||||
return $dbase_identifier->replace_record($record, $record_number);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_get_record
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @param int $record_number record number
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_get_record($dbase_identifier, $record_number)
|
||||
{
|
||||
return $dbase_identifier->get_record($record_number);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_get_record_with_names
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @param int $record_number record number
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_get_record_with_names($dbase_identifier, $record_number)
|
||||
{
|
||||
return $dbase_identifier->get_record_with_names($record_number);
|
||||
}
|
||||
|
||||
/**
|
||||
* dbase_pack
|
||||
* @param Resource $dbase_identifier dbase identifier
|
||||
* @return bool
|
||||
*/
|
||||
function dbase_pack($dbase_identifier)
|
||||
{
|
||||
return $dbase_identifier->pack();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -91,19 +91,19 @@ $tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account
|
||||
$tabsqlsort = array();
|
||||
$tabsqlsort[32] = "position ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
// Name of the fields in the result of select to display the dictionary
|
||||
$tabfield = array();
|
||||
$tabfield[32] = "code,label,range_account,category_type,formula,position,country";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
// Name of editing fields for record modification
|
||||
$tabfieldvalue = array();
|
||||
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
// Name of the fields in the table for inserting a record
|
||||
$tabfieldinsert = array();
|
||||
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Name of the rowid if the field is not of type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
||||
$tabrowid = array();
|
||||
@@ -151,7 +151,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
if ($value == 'range_account' && empty($_POST['range_account'])) {
|
||||
continue;
|
||||
}
|
||||
if ($value == 'country' || $value == 'country_id') {
|
||||
if (($value == 'country' || $value == 'country_id') && (!empty($_POST['country_id']))) {
|
||||
continue;
|
||||
}
|
||||
if (!GETPOSTISSET($value) || GETPOST($value) == '') {
|
||||
@@ -176,6 +176,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
if ($fieldnamekey == 'category_type') {
|
||||
$fieldnamekey = 'Calculated';
|
||||
}
|
||||
if ($fieldnamekey == 'country') {
|
||||
$fieldnamekey = 'Country';
|
||||
}
|
||||
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||
}
|
||||
@@ -263,7 +266,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
}
|
||||
}
|
||||
|
||||
// Si verif ok et action modify, on modifie la ligne
|
||||
// If check ok and action modify, we modify the line
|
||||
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
@@ -430,12 +433,12 @@ print load_fiche_titre($titre, $linkback, $titlepicto);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
// Confirmation of the deletion of the line
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
// Complete requete recherche valeurs avec critere de tri
|
||||
// Complete search query with sorting criteria
|
||||
$sql = $tabsql[$id];
|
||||
|
||||
if ($search_country_id > 0) {
|
||||
@@ -634,14 +637,14 @@ if ($resql) {
|
||||
// Title of lines
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$showfield = 1; // By defaut
|
||||
// Determines the name of the field in relation to the possible names
|
||||
// in data dictionaries
|
||||
$showfield = 1; // By default
|
||||
$class = "left";
|
||||
$sortable = 1;
|
||||
$valuetoshow = '';
|
||||
|
||||
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow = ucfirst($fieldlist[$field]); // By default
|
||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field] == 'source') {
|
||||
$valuetoshow = $langs->trans("Contact");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -260,6 +260,22 @@ $linkback = '';
|
||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($title, $linkback, 'accountancy');
|
||||
|
||||
// Show message if accountancy hidden options are activated to help to resolve some problems
|
||||
if (!$user->admin) {
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
@@ -186,18 +186,35 @@ if ($action == 'update') {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$db->begin();
|
||||
|
||||
$sql = '';
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
|
||||
$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
|
||||
$sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
||||
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
|
||||
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
|
||||
$resql_exists = $db->query($sql_exists);
|
||||
if (!$resql_exists) {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$nb_exists = $db->num_rows($resql_exists);
|
||||
if ($nb_exists <= 0) {
|
||||
// insert
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->escape($accountancy_field_name) . ")";
|
||||
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
|
||||
} else {
|
||||
$obj_exists = $db->fetch_object($resql_exists);
|
||||
// update
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
|
||||
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
|
||||
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
||||
$sql .= " WHERE rowid = ".((int) $productid);
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
dol_syslog("/accountancy/admin/productaccount.php sql=".$sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$ok++;
|
||||
|
||||
@@ -429,7 +429,7 @@ if ($action != 'export_csv') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$accounting_account.'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($opening_balance, 'MT')).'</td>';
|
||||
}
|
||||
|
||||
$urlzoom = '';
|
||||
@@ -443,9 +443,9 @@ if ($action != 'export_csv') {
|
||||
}
|
||||
}
|
||||
// Debit
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->debit, 'MT')).'</a></td>';
|
||||
// Credit
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->credit, 'MT')).'</a></td>';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||
@@ -466,10 +466,10 @@ if ($action != 'export_csv') {
|
||||
if (!empty($show_subgroup)) {
|
||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
|
||||
}
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
@@ -481,10 +481,10 @@ if ($action != 'export_csv') {
|
||||
|
||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
|
||||
print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
|
||||
}
|
||||
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
|
||||
@@ -591,7 +591,7 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
if (!empty($accountancyexport->errors)) {
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
|
||||
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
||||
// Specify as export : update field date_export or date_validated
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
@@ -602,17 +602,17 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " SET";
|
||||
if (!$notifiedexportdate && !$notifiedvalidationdate) {
|
||||
if (!empty($notifiedexportdate) && !empty($notifiedvalidationdate)) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
$sql .= ", date_validated = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedexportdate) {
|
||||
} elseif (!empty($notifiedexportdate)) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedvalidationdate) {
|
||||
} elseif (!empty($notifiedvalidationdate)) {
|
||||
$sql .= " date_validated = '".$db->idate($now)."'";
|
||||
}
|
||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||
|
||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
$error++;
|
||||
|
||||
@@ -119,8 +119,8 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
|
||||
);
|
||||
@@ -468,7 +468,7 @@ class AccountancyExport
|
||||
/**
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
* Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
@@ -496,7 +496,7 @@ class AccountancyExport
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
@@ -504,9 +504,9 @@ class AccountancyExport
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
$Tab['end'] = 'O2003';
|
||||
$Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel
|
||||
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
@@ -516,14 +516,19 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : Quadratus
|
||||
* Export format : Quadratus (Format ASCII)
|
||||
* Format since 2015 compatible QuadraCOMPTA
|
||||
* Last review for this format : 2021/09/13 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html
|
||||
* In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)"
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportQuadratus(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $db;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
@@ -536,6 +541,44 @@ class AccountancyExport
|
||||
$code_compta = $data->subledger_account;
|
||||
}
|
||||
|
||||
$Tab = array();
|
||||
|
||||
if (!empty($data->subledger_account)) {
|
||||
$Tab['type_ligne'] = 'C';
|
||||
$Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8);
|
||||
$Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30);
|
||||
|
||||
if ($data->doc_type == 'customer_invoice') {
|
||||
$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6));
|
||||
$Tab['filler'] = str_repeat(' ', 52);
|
||||
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8);
|
||||
} elseif ($data->doc_type == 'supplier_invoice') {
|
||||
$Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6));
|
||||
$Tab['filler'] = str_repeat(' ', 52);
|
||||
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8);
|
||||
} else {
|
||||
$Tab['filler'] = str_repeat(' ', 59);
|
||||
$Tab['coll_compte'] = str_pad(' ', 8);
|
||||
}
|
||||
|
||||
$Tab['filler2'] = str_repeat(' ', 110);
|
||||
$Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB)
|
||||
|
||||
if ($data->doc_type == 'customer_invoice') {
|
||||
$Tab['type_compte'] = 'C';
|
||||
} elseif ($data->doc_type == 'supplier_invoice') {
|
||||
$Tab['coll_compte'] = 'F';
|
||||
} else {
|
||||
$Tab['coll_compte'] = 'G';
|
||||
}
|
||||
|
||||
$Tab['filler3'] = str_repeat(' ', 235);
|
||||
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
print implode($Tab);
|
||||
}
|
||||
|
||||
$Tab = array();
|
||||
$Tab['type_ligne'] = 'M';
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8);
|
||||
|
||||
@@ -297,7 +297,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
|
||||
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
||||
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
|
||||
$sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines
|
||||
$sql .= " AND fk_docdet = ".((int) $this->fk_docdet); // This field can be 0 if record is for several lines
|
||||
}
|
||||
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
|
||||
@@ -937,7 +937,6 @@ class BookKeeping extends CommonObject
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
@@ -1090,7 +1089,6 @@ class BookKeeping extends CommonObject
|
||||
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
|
||||
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
@@ -1751,7 +1749,6 @@ class BookKeeping extends CommonObject
|
||||
$line->date_creation = $obj->date_creation;
|
||||
$line->date_modification = $obj->date_modification;
|
||||
$line->date_export = $obj->date_export;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesmvt[] = $line;
|
||||
@@ -1816,7 +1813,6 @@ class BookKeeping extends CommonObject
|
||||
$line->sens = $obj->sens;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesexport[] = $line;
|
||||
|
||||
@@ -170,6 +170,8 @@ if ($action == 'validatehistory') {
|
||||
} else {
|
||||
$num_lines = $db->num_rows($result);
|
||||
|
||||
$facture_static = new Facture($db);
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
$i = 0;
|
||||
@@ -213,6 +215,18 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Manage Deposit
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
|
||||
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
|
||||
$accountdeposittoventilated = new AccountingAccount($db);
|
||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
||||
$objp->code_sell_p = '';
|
||||
$objp->code_sell_t = '';
|
||||
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest);
|
||||
@@ -265,8 +279,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -314,7 +328,7 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
@@ -349,8 +363,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -436,7 +450,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("TotalVente").'</td>';
|
||||
print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -497,7 +511,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
print "<br>\n";
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400">'.$langs->trans("TotalMarge").'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
|
||||
@@ -369,9 +369,9 @@ if ($result) {
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneCustomer").'</span><br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
|
||||
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
@@ -637,11 +637,15 @@ if ($result) {
|
||||
}
|
||||
|
||||
// Manage Deposit
|
||||
if ($objp->description == "(DEPOSIT)") {
|
||||
$accountdeposittoventilated = new AccountingAccount($db);
|
||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
||||
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
|
||||
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
|
||||
$accountdeposittoventilated = new AccountingAccount($db);
|
||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
||||
$objp->code_sell_p = '';
|
||||
$objp->code_sell_t = '';
|
||||
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($objp->code_sell_p)) {
|
||||
|
||||
@@ -154,8 +154,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -197,7 +197,7 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
@@ -233,8 +233,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -276,7 +276,7 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
@@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
|
||||
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') {
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
@@ -627,7 +627,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@@ -648,7 +648,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
@@ -717,9 +717,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
@@ -894,7 +894,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||
} else {
|
||||
|
||||
@@ -609,7 +609,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER.'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
@@ -834,7 +834,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
} else {
|
||||
|
||||
@@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -309,7 +309,7 @@ if ($resql) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("Unknown");
|
||||
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
|
||||
} else {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
@@ -344,8 +344,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
|
||||
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
|
||||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td class="left">'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
@@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
|
||||
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
|
||||
@@ -369,9 +369,9 @@ if ($result) {
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
|
||||
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
@@ -620,10 +620,12 @@ if ($result) {
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($objp->code_buy_p)) {
|
||||
@@ -724,11 +726,13 @@ if ($result) {
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '<br>';
|
||||
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Suggested accounting account
|
||||
|
||||
@@ -38,10 +38,12 @@ header('Content-Type: text/csv');
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
|
||||
if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") { // Specific filename for FEC model export into the general ledger
|
||||
// Specific filename for FEC model export into the general ledger
|
||||
if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2')
|
||||
&& $type_export == "general_ledger") {
|
||||
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
|
||||
if (empty($search_date_end)) {
|
||||
// TODO Get the max date into bookeeping table
|
||||
// TODO Get the max date into bookkeeping table
|
||||
$search_date_end = dol_now();
|
||||
}
|
||||
$datetouseforfilename = $search_date_end;
|
||||
@@ -58,7 +60,7 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/adherents/admin/adherent.php
|
||||
* \file htdocs/adherents/admin/member.php
|
||||
* \ingroup member
|
||||
* \brief Page to setup the module Foundation
|
||||
*/
|
||||
@@ -205,16 +205,16 @@ print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Login/Pass required for members
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Mail required for members
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Login/Pass required for members
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Send mail information is on by default
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
|
||||
@@ -225,6 +225,13 @@ print '<tr class="oddeven"><td>'.$langs->trans("MemberCreateAnExternalUserForSub
|
||||
print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Allow members to change type on renewal forms
|
||||
/* To test during next beta
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
|
||||
print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
|
||||
print "</td></tr>\n";
|
||||
*/
|
||||
|
||||
// Insert subscription into bank account
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
||||
$arraychoices = array('0'=>$langs->trans("None"));
|
||||
|
||||
@@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') {
|
||||
|
||||
if ($action == 'update') {
|
||||
$public = GETPOST('MEMBER_ENABLE_PUBLIC');
|
||||
$amount = GETPOST('MEMBER_NEWFORM_AMOUNT');
|
||||
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
||||
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
||||
@@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td class="right">';
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
|
||||
@@ -645,7 +645,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
|
||||
@@ -716,7 +716,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
|
||||
@@ -787,7 +787,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
|
||||
@@ -913,7 +913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$object->state_id = GETPOST('state_id', 'int');
|
||||
|
||||
// We set country_id, country_code and country for the selected country
|
||||
$object->country_id = GETPOST('country_id', 'int') ?GETPOST('country_id', 'int') : $mysoc->country_id;
|
||||
$object->country_id = GETPOST('country_id', 'int') ? GETPOST('country_id', 'int') : $mysoc->country_id;
|
||||
if ($object->country_id) {
|
||||
$tmparray = getCountry($object->country_id, 'all');
|
||||
$object->country_code = $tmparray['code'];
|
||||
@@ -921,12 +921,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
if (!empty($socid)) {
|
||||
$object = new Societe($db);
|
||||
$soc = new Societe($db);
|
||||
if ($socid > 0) {
|
||||
$object->fetch($socid);
|
||||
$soc->fetch($socid);
|
||||
}
|
||||
|
||||
if (!($object->id > 0)) {
|
||||
if (!($soc->id > 0)) {
|
||||
$langs->load("errors");
|
||||
print($langs->trans('ErrorRecordNotFound'));
|
||||
exit;
|
||||
@@ -1009,7 +1009,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print "</td>\n";
|
||||
|
||||
// Company
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $object->company).'"></td></tr>';
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $soc->name).'"></td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
@@ -1033,7 +1033,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
|
||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $object->email).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $soc->email).'"></td></tr>';
|
||||
|
||||
// Website
|
||||
print '<tr><td>'.$form->editfieldkey('Web', 'member_url', '', $object, 0).'</td>';
|
||||
@@ -1041,21 +1041,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Address
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET('address') ?GETPOST('address', 'alphanohtml') : $object->address).'</textarea>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET('address') ?GETPOST('address', 'alphanohtml') : $soc->address).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||
print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
|
||||
print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $soc->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
|
||||
print ' ';
|
||||
print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
|
||||
print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $soc->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
|
||||
if (empty($soc->country_id)) {
|
||||
$soc->country_id = $mysoc->country_id;
|
||||
$soc->country_code = $mysoc->country_code;
|
||||
$soc->state_id = $mysoc->state_id;
|
||||
}
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id');
|
||||
print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $soc->country_id, 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
@@ -1064,9 +1068,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// State
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($object->country_id) {
|
||||
if ($soc->country_id) {
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
|
||||
print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code);
|
||||
} else {
|
||||
print $countrynotdefined;
|
||||
}
|
||||
@@ -1075,7 +1079,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" size="20" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $object->phone).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" size="20" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $soc->phone).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
|
||||
@@ -1506,7 +1510,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
|
||||
@@ -1821,14 +1825,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$company = new Societe($db);
|
||||
$result = $company->fetch($object->socid);
|
||||
print $company->getNomUrl(1);
|
||||
|
||||
// Show link to invoices
|
||||
$tmparray = $company->getOutstandingBills('customer');
|
||||
if (!empty($tmparray['refs'])) {
|
||||
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
|
||||
// TODO Add alert if warning on at least one invoice late
|
||||
print '</a>';
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("NoThirdPartyAssociatedToMember");
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Login Dolibarr
|
||||
// Login Dolibarr - Link to user
|
||||
print '<tr><td>';
|
||||
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
|
||||
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
|
||||
@@ -1846,7 +1858,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
//VCard
|
||||
// VCard
|
||||
print '<tr><td>';
|
||||
print $langs->trans("VCard").'</td><td colspan="3">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
|
||||
@@ -1941,7 +1953,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (!empty($conf->societe->enabled) && !$object->socid) {
|
||||
if ($user->rights->societe->creer) {
|
||||
if (Adherent::STATUS_DRAFT != $object->statut) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";;
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";;
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
}
|
||||
@@ -1954,7 +1966,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (!$user->socid && !$object->user_id) {
|
||||
if ($user->rights->user->user->creer) {
|
||||
if (Adherent::STATUS_DRAFT != $object->statut) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
}
|
||||
@@ -2002,8 +2014,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Generated documents
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
//$filename = 'tmp_cards.php';
|
||||
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'member');
|
||||
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$genallowed = $user->rights->adherent->lire;
|
||||
$delallowed = $user->rights->adherent->creer;
|
||||
|
||||
@@ -1900,8 +1900,8 @@ class Adherent extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql .= " statut = ".self::STATUS_VALIDATED;
|
||||
$sql .= ", datevalid = '".$this->db->idate($now)."'";
|
||||
$sql .= ", fk_user_valid=".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= ", fk_user_valid=".((int) $user->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@@ -2185,6 +2185,9 @@ class Adherent extends CommonObject
|
||||
if (!empty($this->ref)) {
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->login)) {
|
||||
$label .= '<br><b>'.$langs->trans('Login').':</b> '.$this->login;
|
||||
}
|
||||
if (!empty($this->firstname) || !empty($this->lastname)) {
|
||||
$label .= '<br><b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class AdherentStats extends Stats
|
||||
|
||||
$this->where .= " m.statut != -1";
|
||||
$this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
|
||||
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
|
||||
if ($this->memberid) {
|
||||
$this->where .= " AND m.rowid = ".((int) $this->memberid);
|
||||
}
|
||||
|
||||
@@ -317,6 +317,7 @@ $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.p
|
||||
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
||||
$sql .= " d.note_private, d.note_public,";
|
||||
$sql .= " s.nom,";
|
||||
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
|
||||
$sql .= " t.libelle as type, t.subscription,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
// Add fields from extrafields
|
||||
@@ -491,7 +492,7 @@ if (GETPOSTISSET("search_status")) {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
|
||||
$titre = $langs->trans("MembersListNotUpToDate");
|
||||
}
|
||||
if ($search_status == Adherent::STATUS_RESILIATED) {
|
||||
if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is ''
|
||||
$titre = $langs->trans("MembersListResiliated");
|
||||
}
|
||||
if ($search_status == Adherent::STATUS_EXCLUDED) {
|
||||
@@ -832,7 +833,7 @@ if (!empty($arrayfields['d.gender']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['d.company']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['d.login']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder);
|
||||
@@ -905,6 +906,7 @@ while ($i < min($num, $limit)) {
|
||||
$memberstatic->id = $obj->rowid;
|
||||
$memberstatic->ref = $obj->ref;
|
||||
$memberstatic->civility_id = $obj->civility;
|
||||
$memberstatic->login = $obj->login;
|
||||
$memberstatic->lastname = $obj->lastname;
|
||||
$memberstatic->firstname = $obj->firstname;
|
||||
$memberstatic->gender = $obj->gender;
|
||||
@@ -919,9 +921,13 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
if (!empty($obj->fk_soc)) {
|
||||
$memberstatic->fetch_thirdparty();
|
||||
$companyname = $memberstatic->thirdparty->name;
|
||||
if ($memberstatic->thirdparty->id > 0) {
|
||||
$companyname = $memberstatic->thirdparty->name;
|
||||
$companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
|
||||
}
|
||||
} else {
|
||||
$companyname = $obj->company;
|
||||
$companynametoshow = $obj->company;
|
||||
}
|
||||
$memberstatic->company = $companyname;
|
||||
|
||||
@@ -955,7 +961,8 @@ while ($i < min($num, $limit)) {
|
||||
// Firstname
|
||||
if (!empty($arrayfields['d.firstname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
|
||||
print $obj->firstname;
|
||||
print $memberstatic->getNomUrl(0, 0, 'card', 'firstname');
|
||||
//print $obj->firstname;
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -964,7 +971,8 @@ while ($i < min($num, $limit)) {
|
||||
// Lastname
|
||||
if (!empty($arrayfields['d.lastname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">';
|
||||
print $obj->lastname;
|
||||
print $memberstatic->getNomUrl(0, 0, 'card', 'lastname');
|
||||
//print $obj->lastname;
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -984,7 +992,7 @@ while ($i < min($num, $limit)) {
|
||||
// Company
|
||||
if (!empty($arrayfields['d.company']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
|
||||
print $companyname;
|
||||
print $companynametoshow;
|
||||
print "</td>\n";
|
||||
}
|
||||
// Login
|
||||
@@ -1094,7 +1102,9 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// EMail
|
||||
if (!empty($arrayfields['d.email']['checked'])) {
|
||||
print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).'">';
|
||||
print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1);
|
||||
print "</td>\n";
|
||||
}
|
||||
// End of subscription date
|
||||
$datefin = $db->jdate($obj->datefin);
|
||||
|
||||
@@ -195,9 +195,7 @@ foreach ($data as $val) {
|
||||
}
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center">';
|
||||
//print '<a href="month.php?year='.$year.'">';
|
||||
print $year;
|
||||
//print '</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php?date_select='.((int) $year).'">'.$year.'</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
||||
|
||||
@@ -209,7 +209,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
// Subscription informations
|
||||
$datesubscription = 0;
|
||||
$datesubend = 0;
|
||||
$paymentdate = 0;
|
||||
$paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01
|
||||
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
|
||||
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
||||
}
|
||||
@@ -260,7 +260,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
}
|
||||
|
||||
// Check if a payment is mandatory or not
|
||||
if (!$error && $adht->subscription) { // Member type need subscriptions
|
||||
if ($adht->subscription) { // Member type need subscriptions
|
||||
if (!is_numeric($amount)) {
|
||||
// If field is '' or not a numeric value
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
|
||||
@@ -268,28 +268,35 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
} else {
|
||||
// If an amount has been provided, we check also fields that becomes mandatory when amount is not null.
|
||||
if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') {
|
||||
if (GETPOST("subscription")) {
|
||||
if (!GETPOST("label")) {
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) {
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
} else {
|
||||
if (GETPOST("accountid")) {
|
||||
if (GETPOST("accountid", 'int')) {
|
||||
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
}
|
||||
if ($errmsg) {
|
||||
$error++;
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -601,14 +608,22 @@ if ($rowid > 0) {
|
||||
$company = new Societe($db);
|
||||
$result = $company->fetch($object->fk_soc);
|
||||
print $company->getNomUrl(1);
|
||||
|
||||
// Show link to invoices
|
||||
$tmparray = $company->getOutstandingBills('customer');
|
||||
if (!empty($tmparray['refs'])) {
|
||||
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
|
||||
// TODO Add alert if warning on at least one invoice late
|
||||
print '</a>';
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("NoThirdPartyAssociatedToMember");
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Login Dolibarr
|
||||
// Login Dolibarr - Link to user
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrUser");
|
||||
@@ -626,9 +641,11 @@ if ($rowid > 0) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
|
||||
} else {
|
||||
if ($object->user_id) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
||||
$linkeduser = new User($db);
|
||||
$linkeduser->fetch($object->user_id);
|
||||
print $linkeduser->getNomUrl(-1);
|
||||
} else {
|
||||
print $langs->trans("NoDolibarrAccess");
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
@@ -926,8 +943,10 @@ if ($rowid > 0) {
|
||||
}
|
||||
if (!$datefrom) {
|
||||
$datefrom = $object->datevalid;
|
||||
if ($object->datefin > 0) {
|
||||
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) > dol_now()) {
|
||||
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
|
||||
} else {
|
||||
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
|
||||
}
|
||||
}
|
||||
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
|
||||
@@ -946,7 +965,7 @@ if ($rowid > 0) {
|
||||
|
||||
if ($adht->subscription) {
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.GETPOST('subscription').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'. price(GETPOSTISSET('subscription') ? GETPOST('subscription') : $adht->amount).'"> '.$langs->trans("Currency".$conf->currency) .'</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td>';
|
||||
@@ -970,17 +989,18 @@ if ($rowid > 0) {
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>';
|
||||
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'>';
|
||||
print '<label for="none"> '.$langs->trans("None").'</label><br>';
|
||||
// Add entry into bank accoun
|
||||
if (!empty($conf->banque->enabled)) {
|
||||
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
|
||||
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
|
||||
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
|
||||
}
|
||||
// Add invoice with no payments
|
||||
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
|
||||
//if (empty($object->fk_soc)) print ' disabled';
|
||||
print '> '.$langs->trans("MoreActionInvoiceOnly");
|
||||
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
|
||||
if ($object->fk_soc) {
|
||||
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
||||
} else {
|
||||
@@ -1004,13 +1024,13 @@ if ($rowid > 0) {
|
||||
}
|
||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||
}
|
||||
print '<br>';
|
||||
print '</label><br>';
|
||||
}
|
||||
// Add invoice with payments
|
||||
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
|
||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
|
||||
//if (empty($object->fk_soc)) print ' disabled';
|
||||
print '> '.$langs->trans("MoreActionBankViaInvoice");
|
||||
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
|
||||
if ($object->fk_soc) {
|
||||
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
|
||||
} else {
|
||||
@@ -1034,7 +1054,7 @@ if ($rowid > 0) {
|
||||
}
|
||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||
}
|
||||
print '<br>';
|
||||
print '</label><br>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@@ -311,6 +311,7 @@ print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="date_select" value="'.$date_select.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
||||
@@ -318,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
/*$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}*/
|
||||
$colspan = 8;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
// Name
|
||||
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
|
||||
@@ -165,24 +165,27 @@ $urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal
|
||||
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
|
||||
$message .= '<div class="urllink">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('onlinepaymenturl1');
|
||||
$message .= '<br>';
|
||||
|
||||
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
||||
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
|
||||
$message .= '<div class="urllink">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('onlinepaymenturl2');
|
||||
$message .= '<br>';
|
||||
|
||||
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
||||
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
|
||||
$message .= '<div class="urllink">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('onlinepaymenturl3');
|
||||
$message .= '<br>';
|
||||
|
||||
print $message;
|
||||
|
||||
@@ -696,7 +696,7 @@ $tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') {
|
||||
$tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
|
||||
}
|
||||
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
|
||||
print '<label for="use_vat">'.$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@@ -706,7 +706,7 @@ $tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') {
|
||||
$tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
|
||||
}
|
||||
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
|
||||
print '<label for="no_vat">'.$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "</table>";
|
||||
@@ -721,12 +721,12 @@ print "</tr>\n";
|
||||
|
||||
if ($mysoc->useLocalTax(1)) {
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> <label for="lt1">'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print '<div class="nobordernopadding">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print '<label for="lt1">'.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
|
||||
if (!isOnlyOneLocalTax(1)) {
|
||||
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
|
||||
@@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) {
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> <label for="nolt1">'.$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||
print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
|
||||
print "</td></tr>\n";
|
||||
} else {
|
||||
if (empty($mysoc->country_code)) {
|
||||
@@ -765,7 +765,7 @@ print "</tr>\n";
|
||||
|
||||
if ($mysoc->useLocalTax(2)) {
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> <label for="lt2">'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print '<div class="nobordernopadding">';
|
||||
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
||||
@@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) {
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> <label for="nolt2">'.$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<div>";
|
||||
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
||||
@@ -803,7 +803,7 @@ print "</table>";
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
if ($mysoc->useRevenueStamp()) {
|
||||
|
||||
@@ -104,13 +104,11 @@ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
// Social networks
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.position FR
|
||||
$tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
||||
$tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]);
|
||||
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
@@ -233,7 +233,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR
|
||||
$tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
|
||||
$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
|
||||
$tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
|
||||
$tabsql[38] = "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity = ".getEntity($tabname[38]);
|
||||
$tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel";
|
||||
$tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact";
|
||||
$tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode";
|
||||
@@ -1175,6 +1175,8 @@ if ($id) {
|
||||
$sql .= natural_search("r.code_region", $search_code);
|
||||
} elseif ($search_code != '' && $id == 7) {
|
||||
$sql .= natural_search("a.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 10) {
|
||||
$sql .= natural_search("t.code", $search_code);
|
||||
} elseif ($search_code != '' && $id != 9) {
|
||||
$sql .= natural_search("code", $search_code);
|
||||
}
|
||||
@@ -1452,6 +1454,10 @@ if ($id) {
|
||||
print $tdsoffields;
|
||||
|
||||
|
||||
// Line to enter new values
|
||||
print '<!-- line to add new entry -->';
|
||||
print '<tr class="oddeven nodrag nodrop nohover">';
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
if (GETPOST('actionadd')) {
|
||||
@@ -1471,9 +1477,6 @@ if ($id) {
|
||||
unset($fieldlist[2]); // Remove field ??? if dictionary Regions
|
||||
}
|
||||
|
||||
// Line to enter new values
|
||||
print '<!-- line to add new entry -->';
|
||||
print '<tr class="oddeven nodrag nodrop nohover">';
|
||||
|
||||
if (empty($reshook)) {
|
||||
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
||||
|
||||
@@ -232,7 +232,7 @@ class PrestaShopWebservice
|
||||
if ($response != '') {
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
if (libxml_get_errors()) {
|
||||
$msg = var_export(libxml_get_errors(), true);
|
||||
libxml_clear_errors();
|
||||
|
||||
@@ -84,7 +84,7 @@ class Dolistore
|
||||
|
||||
try {
|
||||
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
|
||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
|
||||
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
|
||||
|
||||
// Here we set the option array for the Webservice : we want categories resources
|
||||
@@ -134,7 +134,7 @@ class Dolistore
|
||||
|
||||
try {
|
||||
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
|
||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
|
||||
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
|
||||
|
||||
// Here we set the option array for the Webservice : we want products resources
|
||||
@@ -217,15 +217,15 @@ class Dolistore
|
||||
for ($i = 0; $i < $nbofcateg; $i++) {
|
||||
$cat = $this->categories[$i];
|
||||
if ($cat->is_root_category == 1 && $parent == 0) {
|
||||
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ';
|
||||
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
|
||||
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.((int) $cat->id).'" ';
|
||||
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a></h3>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
|
||||
$select = ($cat->id == $this->categorie) ? ' selected' : '';
|
||||
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
|
||||
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.((int) $cat->id).'"';
|
||||
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
|
||||
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
|
||||
$html .= '>'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
}
|
||||
@@ -267,9 +267,9 @@ class Dolistore
|
||||
|
||||
// add image or default ?
|
||||
if ($product->id_default_image != '') {
|
||||
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
|
||||
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
|
||||
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
|
||||
$images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
|
||||
$images .= '<img src="'.urlencode($image_url).'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
} else {
|
||||
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
|
||||
}
|
||||
@@ -277,11 +277,11 @@ class Dolistore
|
||||
// free or pay ?
|
||||
if ($product->price > 0) {
|
||||
$price = '<h3>'.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>';
|
||||
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
} else {
|
||||
$price = '<h3>'.$langs->trans('Free').'</h3>';
|
||||
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
|
||||
$download_link .= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
|
||||
$download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
|
||||
}
|
||||
|
||||
//checking versions
|
||||
@@ -319,14 +319,14 @@ class Dolistore
|
||||
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
|
||||
|
||||
//output template
|
||||
$html .= '<tr class="app oddeven '.$compatible.'">
|
||||
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
|
||||
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
|
||||
.'<br><small>'.$version.'</small></h2>
|
||||
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
|
||||
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">
|
||||
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td>
|
||||
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1])
|
||||
.'<br><small>'.dol_escape_htmltag($version).'</small></h2>
|
||||
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
|
||||
// do not load if display none
|
||||
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
|
||||
$html .= '<td class="margeCote center">'.$price.'</td>';
|
||||
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>';
|
||||
$html .= '<td class="margeCote">'.$download_link.'</td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
@@ -343,7 +343,7 @@ class Dolistore
|
||||
public function get_previous_link($text = '<<')
|
||||
{
|
||||
// phpcs:enable
|
||||
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
||||
return '<a href="'.$this->get_previous_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@@ -356,7 +356,7 @@ class Dolistore
|
||||
public function get_next_link($text = '>>')
|
||||
{
|
||||
// phpcs:enable
|
||||
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
||||
return '<a href="'.$this->get_next_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@@ -48,8 +48,8 @@ $arrayofparameters = array(
|
||||
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
@@ -213,7 +213,7 @@ if ($action == 'edit') {
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
@@ -264,7 +264,7 @@ if ($action == 'edit') {
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
$formcompany = new FormCompany($db);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
|
||||
} elseif ($val['type'] == 'securekey') {
|
||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
@@ -309,7 +309,7 @@ if ($action == 'edit') {
|
||||
} else {
|
||||
if (!empty($arrayofparameters)) {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
@@ -366,7 +366,7 @@ if ($action == 'edit') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
print $product->getNomUrl(1);
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ if (!$user->admin) {
|
||||
|
||||
// Constant and translation of the module description
|
||||
$modules = array(
|
||||
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
|
||||
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
|
||||
'SOCIETE' => 'FCKeditorForCompany',
|
||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||
'DETAILS' => 'FCKeditorForProductDetails',
|
||||
@@ -54,11 +56,11 @@ $modules = array(
|
||||
'MAILING' => 'FCKeditorForMailing',
|
||||
'MAIL' => 'FCKeditorForMail',
|
||||
'TICKET' => 'FCKeditorForTicket',
|
||||
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
|
||||
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
|
||||
);
|
||||
// Conditions for the option to be offered
|
||||
$conditions = array(
|
||||
'NOTE_PUBLIC' => 1,
|
||||
'NOTE_PRIVATE' => 1,
|
||||
'SOCIETE' => 1,
|
||||
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
||||
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||
@@ -66,11 +68,11 @@ $conditions = array(
|
||||
'MAILING' => !empty($conf->mailing->enabled),
|
||||
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
||||
'TICKET' => !empty($conf->ticket->enabled),
|
||||
'NOTE_PUBLIC' => 1,
|
||||
'NOTE_PRIVATE' => 1,
|
||||
);
|
||||
// Picto
|
||||
$picto = array(
|
||||
'NOTE_PUBLIC' => 'generic',
|
||||
'NOTE_PRIVATE' => 'generic',
|
||||
'SOCIETE' => 'generic',
|
||||
'PRODUCTDESC' => 'product',
|
||||
'DETAILS' => 'product',
|
||||
@@ -78,8 +80,6 @@ $picto = array(
|
||||
'MAILING' => 'email',
|
||||
'MAIL' => 'email',
|
||||
'TICKET' => 'ticket',
|
||||
'NOTE_PUBLIC' => 'generic',
|
||||
'NOTE_PRIVATE' => 'generic',
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -109,8 +109,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
// Show into other
|
||||
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
|
||||
print "<br>";
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("SetupDescription5")."</span><br>";
|
||||
print '<br class="hideonsmartphone">';
|
||||
|
||||
// Show logo
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
|
||||
@@ -43,6 +43,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('adminldap', 'globaladmin'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -150,7 +151,7 @@ $arraylist['0'] = $langs->trans("No");
|
||||
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr");
|
||||
$arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
|
||||
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnSynchroActiveExample");
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
|
||||
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
|
||||
}
|
||||
@@ -163,7 +164,7 @@ if (!empty($conf->societe->enabled)) {
|
||||
$arraylist['0'] = $langs->trans("No");
|
||||
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
|
||||
print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnContactActiveExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>';
|
||||
}
|
||||
|
||||
// Synchro member active
|
||||
@@ -174,7 +175,7 @@ if (!empty($conf->adherent->enabled)) {
|
||||
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
|
||||
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
|
||||
print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnMemberActiveExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>';
|
||||
}
|
||||
|
||||
// Synchro member type active
|
||||
@@ -185,7 +186,7 @@ if (!empty($conf->adherent->enabled)) {
|
||||
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
|
||||
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
|
||||
print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE);
|
||||
print '</td><td>'.$langs->trans("LDAPDnMemberTypeActiveExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
@@ -214,33 +215,33 @@ $arraylist = array();
|
||||
$arraylist['3'] = 'Version 3';
|
||||
$arraylist['2'] = 'Version 2';
|
||||
print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION);
|
||||
print '</td><td>'.$langs->trans("LDAPServerProtocolVersion").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerProtocolVersion").'</span></td></tr>';
|
||||
|
||||
// Serveur primaire
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("LDAPPrimaryServer").'</td><td>';
|
||||
print '<input size="25" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
|
||||
print '<input class="minwidth200" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
|
||||
|
||||
// Serveur secondaire
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("LDAPSecondaryServer").'</td><td>';
|
||||
print '<input size="25" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
|
||||
print '<input class="minwidth200" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
|
||||
|
||||
// Port
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerPort").'</td><td>';
|
||||
if (!empty($conf->global->LDAP_SERVER_PORT)) {
|
||||
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
|
||||
print '<input class="width75" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
|
||||
} else {
|
||||
print '<input size="25" type="text" name="port" value="389">';
|
||||
print '<input class="width75" type="text" name="port" value="389">';
|
||||
}
|
||||
print '</td><td>'.$langs->trans("LDAPServerPortExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerPortExample").'</span></td></tr>';
|
||||
|
||||
// DNserver
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerDn").'</td><td>';
|
||||
print '<input size="25" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPServerDnExample").'</td></tr>';
|
||||
print '<input class="minwidth300" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerDnExample").'</span></td></tr>';
|
||||
|
||||
// Utiliser TLS
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerUseTLS").'</td><td>';
|
||||
@@ -248,7 +249,7 @@ $arraylist = array();
|
||||
$arraylist['0'] = $langs->trans("No");
|
||||
$arraylist['1'] = $langs->trans("Yes");
|
||||
print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS);
|
||||
print '</td><td>'.$langs->trans("LDAPServerUseTLSExample").'</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerUseTLSExample").'</span></td></tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("ForANonAnonymousAccess").'</td>';
|
||||
@@ -257,18 +258,18 @@ print "</tr>\n";
|
||||
// DNAdmin
|
||||
print '<!-- LDAP_ADMIN_DN -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPAdminDn").'</td><td>';
|
||||
print '<input size="25" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
|
||||
print '<input class="minwidth300" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
|
||||
print '</td><td class="maxwidthhalf"><span class="opacitymedium">'.$langs->trans("LDAPAdminDnExample").'</span></td></tr>';
|
||||
|
||||
// Pass
|
||||
print '<!-- LDAP_ADMIN_PASS -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
|
||||
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
|
||||
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
|
||||
print '<input class="minwidth150" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
|
||||
} else {
|
||||
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
|
||||
print '<input class="minwidth150" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
|
||||
}
|
||||
print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans('Password').' (ex: secret)</span></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ if (empty($mysoc->country_code)) {
|
||||
|
||||
$sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
||||
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <>0 OR t.localtax2 <>0)";
|
||||
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <> '0' OR t.localtax2 <> '0')";
|
||||
$sql .= " ORDER BY t.taux ASC";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@@ -132,6 +132,7 @@ print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td>'.$langs->trans("Example").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
@@ -140,7 +141,8 @@ print '<input size="32" type="text" name="MAILING_EMAIL_FROM" value="'.$conf->gl
|
||||
if (!empty($conf->global->MAILING_EMAIL_FROM) && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) {
|
||||
print ' '.img_warning($langs->trans("BadEMail"));
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">'.dol_escape_htmltag(($mysoc->name ? $mysoc->name : 'MyName').' <noreply@example.com>').'</span></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MailingEMailError").'</td><td>';
|
||||
@@ -148,12 +150,14 @@ print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf
|
||||
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && !isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) {
|
||||
print ' '.img_warning($langs->trans("BadEMail"));
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td><td><span class="opacitymedium">webmaster@example.com></span></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MailingDelay").'</td><td>';
|
||||
print '<input class="width75" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
|
||||
print '</td></tr>';
|
||||
print '</td><td></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Constant to add salt into the unsubscribe and check read tag.
|
||||
@@ -165,15 +169,17 @@ print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAI
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td><td></td>';
|
||||
print '</tr>';
|
||||
|
||||
// default blacklist from mailing
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus") . '</td>';
|
||||
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv("No_Email")) . '</td>';
|
||||
print '<td>';
|
||||
$blacklist_setting=array(0=>$langs->trans('No'),1=>$langs->trans('Yes'),-1=>$langs->trans('DefaultStatusEmptyMandatory'));
|
||||
$blacklist_setting=array(0=>$langs->trans('No'), 1=>$langs->trans('Yes'), 2=>$langs->trans('DefaultStatusEmptyMandatory'));
|
||||
print $form->selectarray("MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS);
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -181,7 +187,8 @@ if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >=
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MailAdvTargetRecipients").'</td><td>';
|
||||
print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR');
|
||||
print '</td></tr>';
|
||||
print '</td><td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -833,23 +833,23 @@ if ($action == 'edit') {
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') {
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) {
|
||||
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
|
||||
} else {
|
||||
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
|
||||
// List of IP show as record to add in SPF if we use the mail method
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
|
||||
// List of IP show as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
|
||||
// TODO Add a key to allow to show the IP/name of server detected dynamically
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
|
||||
}
|
||||
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
|
||||
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,6 +160,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
|
||||
|
||||
$tabhelp = array();
|
||||
$tabhelp[25] = array(
|
||||
'label'=>$langs->trans('EnterAnyCode'),
|
||||
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
|
||||
'content'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||
@@ -228,7 +229,7 @@ if (!empty($conf->agenda->enabled)) {
|
||||
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
|
||||
}
|
||||
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
|
||||
$elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
|
||||
$elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
|
||||
}
|
||||
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {
|
||||
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership'));
|
||||
@@ -564,8 +565,8 @@ $sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, priv
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||
$sql .= " WHERE entity IN (".getEntity('email_template').")";
|
||||
if (!$user->admin) {
|
||||
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".$user->id."))"; // Show only public and private to me
|
||||
$sql .= " AND (active = 1 OR fk_user = ".$user->id.")"; // Show only active or owned by me
|
||||
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me
|
||||
$sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me
|
||||
}
|
||||
if (empty($conf->global->MAIN_MULTILANGS)) {
|
||||
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
|
||||
@@ -683,8 +684,8 @@ if ($action == 'view') {
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters = array(
|
||||
'fieldlist' => $fieldlist,
|
||||
'tabname' => $tabname[$id]
|
||||
'fieldlist' => $fieldlist,
|
||||
'tabname' => $tabname[$id]
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
@@ -822,7 +823,7 @@ if ($resql) {
|
||||
print '</td>';
|
||||
} elseif ($value == 'fk_user') {
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth150');
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150');
|
||||
print '</td>';
|
||||
} elseif ($value == 'topic') {
|
||||
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
@@ -1071,8 +1072,8 @@ if ($resql) {
|
||||
if ($showfield) {
|
||||
print '<!-- '.$fieldlist[$field].' -->';
|
||||
print '<td class="'.$class.'"';
|
||||
if ($value == 'topic') {
|
||||
print ' title="'.$valuetoshow.'"';
|
||||
if (in_array($value, array('code', 'label', 'topic'))) {
|
||||
print ' title="'.dol_escape_htmltag($valuetoshow).'"';
|
||||
}
|
||||
print '>';
|
||||
print $valuetoshow;
|
||||
@@ -1187,7 +1188,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
if ($value == 'fk_user') {
|
||||
print '<td>';
|
||||
if ($user->admin) {
|
||||
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
||||
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300');
|
||||
} else {
|
||||
if ($context == 'add') { // I am not admin and we show the add form
|
||||
print $user->getNomUrl(1); // Me
|
||||
|
||||
@@ -133,7 +133,7 @@ if ($action == 'install') {
|
||||
|
||||
// $original_file should match format module_modulename-x.y[.z].zip
|
||||
$original_file = basename($_FILES["fileinstall"]["name"]);
|
||||
$original_file = preg_replace('/\(\d+\)\.zip$/i', '.zip', $original_file);
|
||||
$original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file);
|
||||
$newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file;
|
||||
|
||||
if (!$original_file) {
|
||||
@@ -588,6 +588,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
$disabled_modules = array();
|
||||
if (!empty($_SESSION["disablemodules"])) {
|
||||
$disabled_modules = explode(',', $_SESSION["disablemodules"]);
|
||||
}
|
||||
|
||||
// Show list of modules
|
||||
$oldfamily = '';
|
||||
$foundoneexternalmodulewithupdate = 0;
|
||||
@@ -613,6 +618,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$modulenameshort = strtolower(preg_replace('/^mod/i', '', get_class($objMod)));
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
|
||||
|
||||
// Check filters
|
||||
@@ -754,6 +760,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
$codeenabledisable = '';
|
||||
$codetoconfig = '';
|
||||
|
||||
// Force disable of module disabled into session (for demo for example)
|
||||
if (in_array($modulenameshort, $disabled_modules)) {
|
||||
$objMod->disabled = true;
|
||||
}
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (!empty($conf->global->$const_name)) { // If module is already activated
|
||||
// Set $codeenabledisable
|
||||
@@ -761,6 +772,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
if (!empty($arrayofwarnings[$modName])) {
|
||||
$codeenabledisable .= '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||
}
|
||||
|
||||
if (!empty($objMod->disabled)) {
|
||||
$codeenabledisable .= $langs->trans("Disabled");
|
||||
} elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) {
|
||||
@@ -1013,16 +1025,16 @@ if ($mode == 'marketplace') {
|
||||
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
|
||||
|
||||
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$dolistore->url.'">';
|
||||
print '<form method="POST" class="centpercent" id="searchFormList" action="'.urlencode($dolistore->url).'">';
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
|
||||
<input type="hidden" name="mode" value="marketplace">
|
||||
<div class="divsearchfield">
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo $options['search'] ?>"><br>
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>"><br>
|
||||
</div>
|
||||
<div class="divsearchfield">
|
||||
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
|
||||
<a class="buttonreset" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
|
||||
<a class="buttonreset" href="<?php echo urlencode($dolistore->url) ?>"><?php echo $langs->trans('Reset') ?></a>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -1039,7 +1051,7 @@ if ($mode == 'marketplace') {
|
||||
|
||||
<div id="category-tree-left">
|
||||
<ul class="tree">
|
||||
<?php echo $dolistore->get_categories(); ?>
|
||||
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="listing-content">
|
||||
|
||||
@@ -92,7 +92,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') {
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||
|
||||
@@ -55,7 +55,8 @@ if ($action == 'update') {
|
||||
if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_RIGHT"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_TOP')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@@ -100,7 +100,7 @@ if (empty($conf->use_javascript_ajax)) {
|
||||
print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT", $arrval, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button small" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
@@ -108,7 +108,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@@ -117,7 +117,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@@ -126,7 +126,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
|
||||
@@ -683,6 +683,8 @@ if ($conf->use_javascript_ajax) {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
|
||||
}
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringPropal").'</td>';
|
||||
@@ -693,6 +695,9 @@ if ($conf->use_javascript_ajax) {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
|
||||
}
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
@@ -702,10 +707,23 @@ if ($conf->use_javascript_ajax) {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
|
||||
}
|
||||
print "</td>";
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
/*
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringProject").'</td>';
|
||||
print '<td class="right">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT);
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
*/
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
|
||||
|
||||
@@ -51,7 +51,7 @@ if ($action == 'getlastversion') {
|
||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
|
||||
}
|
||||
@@ -505,7 +505,7 @@ if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="tdoverflowmax300">'.$obj->name.'</td>'."\n";
|
||||
print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
|
||||
print '<td class="tdoverflowmax300">';
|
||||
if (isASecretKey($obj->name)) {
|
||||
if (empty($dolibarr_main_prod)) {
|
||||
|
||||
@@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
|
||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."xmlfileend";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
|
||||
@@ -63,7 +63,7 @@ print '<br>';
|
||||
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
|
||||
$test = !function_exists('xdebug_is_enabled');
|
||||
if ($test) {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
|
||||
} else {
|
||||
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
|
||||
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
|
||||
|
||||
@@ -91,7 +91,13 @@ print '<br>';
|
||||
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
||||
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
||||
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
|
||||
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None').' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Strict').")</span><br>\n";
|
||||
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
|
||||
if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
|
||||
} elseif (ini_get('session.cookie_samesite') == 'Strict') {
|
||||
print ' '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
|
||||
}
|
||||
print "<br>\n";
|
||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
|
||||
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||
|
||||
@@ -207,6 +207,9 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
//if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&radio_dump=postgresql_options">'.$langs->trans("UnHidePassword").'</a>';
|
||||
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '</fieldset>';
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ if (!empty($conf->syslog->enabled)) {
|
||||
|
||||
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
|
||||
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
|
||||
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
|
||||
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFilesShort").'</label><br><br>';
|
||||
|
||||
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
|
||||
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';
|
||||
|
||||
@@ -61,7 +61,7 @@ $version = '0.0';
|
||||
if ($action == 'getlastversion') {
|
||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ if (!$user->admin) {
|
||||
$id = GETPOST('rowid', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$optioncss = GETPOST('optionscss', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ09');
|
||||
|
||||
$langcode = GETPOST('langcode', 'alphanohtml');
|
||||
$transkey = GETPOST('transkey', 'alphanohtml');
|
||||
@@ -458,18 +459,8 @@ if ($mode == 'searchkey') {
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Line to search new record
|
||||
print "\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<tr class="liste_titre_filter"><td>';
|
||||
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
|
||||
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1);
|
||||
print '</td>'."\n";
|
||||
@@ -495,6 +486,15 @@ if ($mode == 'searchkey') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') {
|
||||
ksort($recordtoshow);
|
||||
}
|
||||
@@ -541,7 +541,7 @@ if ($mode == 'searchkey') {
|
||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||
} elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
|
||||
//print $key.'-'.$val;
|
||||
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
|
||||
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("TranslationOverwriteKey")).'</a>';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
||||
|
||||
@@ -80,7 +80,7 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
public function __isAllowed()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db;
|
||||
global $conf, $db, $user;
|
||||
|
||||
$login = '';
|
||||
$stored_key = '';
|
||||
@@ -147,8 +147,13 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
if ($result <= 0) {
|
||||
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
|
||||
}
|
||||
|
||||
$fuser->getrights();
|
||||
|
||||
// Set the property $user to the $user of API
|
||||
static::$user = $fuser;
|
||||
// Set also the global variable $user to the $user of API
|
||||
$user = $fuser;
|
||||
|
||||
if ($fuser->socid) {
|
||||
static::$role = 'external';
|
||||
|
||||
@@ -504,7 +504,7 @@ class Documents extends DolibarrApi
|
||||
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
|
||||
*
|
||||
* @param string $filename Name of file to create ('FA1705-0123.txt')
|
||||
* @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
|
||||
* @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...)
|
||||
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
|
||||
* @param string $subdir Subdirectory (Only if ref not provided)
|
||||
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)
|
||||
|
||||
@@ -1683,7 +1683,7 @@ class Setup extends DolibarrApi
|
||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."endxmlfile";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
throw new RestException(500, $errormsg);
|
||||
|
||||
@@ -389,7 +389,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
@@ -71,6 +71,10 @@ if (empty($action) && empty($id) && empty($ref)) {
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
if ($object->id > 0) {
|
||||
$object->calculateCosts();
|
||||
}
|
||||
|
||||
|
||||
// Security check - Protection if external user
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
@@ -112,8 +116,13 @@ if (empty($reshook)) {
|
||||
|
||||
$triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
|
||||
// Actions cancel, add, update, delete or clone
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
// The fetch/fetch_lines was redone into the inc.php so we must recall the calculateCosts()
|
||||
if ($action == 'confirm_validate' && $object->id > 0) {
|
||||
$object->calculateCosts();
|
||||
}
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
||||
@@ -311,8 +320,6 @@ if (($id || $ref) && $action == 'edit') {
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = bomPrepareHead($object);
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom');
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class BOM extends CommonObject
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'),
|
||||
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||
@@ -381,7 +381,7 @@ class BOM extends CommonObject
|
||||
if ($result > 0 && !empty($this->table_element_line)) {
|
||||
$this->fetchLines();
|
||||
}
|
||||
$this->calculateCosts();
|
||||
//$this->calculateCosts(); // This consume a high number of subrequests. Do not call it into fetch but when you need it.
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -431,13 +431,13 @@ class BOM extends CommonObject
|
||||
if (count($filter) > 0) {
|
||||
foreach ($filter as $key => $value) {
|
||||
if ($key == 't.rowid') {
|
||||
$sqlwhere[] = $key.'='.$value;
|
||||
$sqlwhere[] = $key.' = '.((int) $value);
|
||||
} elseif (strpos($key, 'date') !== false) {
|
||||
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
|
||||
$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
|
||||
} elseif ($key == 'customsql') {
|
||||
$sqlwhere[] = $value;
|
||||
} else {
|
||||
$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
|
||||
$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -946,7 +946,7 @@ class BOM extends CommonObject
|
||||
$this->lines = array();
|
||||
|
||||
$objectline = new BOMLine($this->db);
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.((int) $this->id)));
|
||||
|
||||
if (is_numeric($result)) {
|
||||
$this->error = $this->error;
|
||||
@@ -1035,7 +1035,8 @@ class BOM extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM costs calculation based on cost_price or pmp of each BOM line
|
||||
* BOM costs calculation based on cost_price or pmp of each BOM line.
|
||||
* Set the property ->total_cost and ->unit_cost of BOM.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -1045,30 +1046,36 @@ class BOM extends CommonObject
|
||||
$this->unit_cost = 0;
|
||||
$this->total_cost = 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
|
||||
foreach ($this->lines as &$line) {
|
||||
if (is_array($this->lines) && count($this->lines)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$tmpproduct = new Product($this->db);
|
||||
$result = $tmpproduct->fetch($line->fk_product);
|
||||
if ($result < 0) {
|
||||
$this->error = $tmpproduct->error;
|
||||
return -1;
|
||||
}
|
||||
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
|
||||
if (empty($line->unit_cost)) {
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
|
||||
$line->unit_cost = $productFournisseur->fourn_unitprice;
|
||||
|
||||
foreach ($this->lines as &$line) {
|
||||
$tmpproduct->cost_price = 0;
|
||||
$tmpproduct->pmp = 0;
|
||||
|
||||
$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
|
||||
if ($result < 0) {
|
||||
$this->error = $tmpproduct->error;
|
||||
return -1;
|
||||
}
|
||||
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
|
||||
if (empty($line->unit_cost)) {
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
|
||||
$line->unit_cost = $productFournisseur->fourn_unitprice;
|
||||
}
|
||||
}
|
||||
|
||||
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
|
||||
|
||||
$this->total_cost += $line->total_cost;
|
||||
}
|
||||
|
||||
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
|
||||
$this->total_cost += $line->total_cost;
|
||||
}
|
||||
|
||||
$this->total_cost = price2num($this->total_cost, 'MT');
|
||||
if ($this->qty) {
|
||||
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
|
||||
$this->total_cost = price2num($this->total_cost, 'MT');
|
||||
if ($this->qty) {
|
||||
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,9 @@ function bomAdminPrepareHead()
|
||||
//$this->tabs = array(
|
||||
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
|
||||
//); // to remove a tab
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom');
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ if ($action == 'create') {
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||
$liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow"));
|
||||
print $form->selectarray('target', $liste, 1);
|
||||
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1);
|
||||
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
||||
|
||||
// Owner
|
||||
|
||||
@@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -540,7 +540,7 @@ class Categorie extends CommonObject
|
||||
$sql .= ", visible = ".(int) $this->visible;
|
||||
$sql .= ", fk_parent = ".(int) $this->fk_parent;
|
||||
$sql .= ", fk_user_modif = ".(int) $user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
@@ -686,7 +686,7 @@ class Categorie extends CommonObject
|
||||
if ($this->db->query($sql)) {
|
||||
if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) {
|
||||
$sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie';
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::add_type", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -774,7 +774,7 @@ class Categorie extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]);
|
||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||
$sql .= " WHERE fk_categorie = ".((int) $this->id);
|
||||
$sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $obj->id);
|
||||
|
||||
dol_syslog(get_class($this).'::del_type', LOG_DEBUG);
|
||||
@@ -826,11 +826,11 @@ class Categorie extends CommonObject
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX.(empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type])." as o";
|
||||
$sql .= " WHERE o.entity IN (".getEntity($obj->element).")";
|
||||
$sql .= " AND c.fk_categorie = ".$this->id;
|
||||
$sql .= " AND c.fk_categorie = ".((int) $this->id);
|
||||
$sql .= " AND c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = o.rowid";
|
||||
// Protection for external users
|
||||
if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) {
|
||||
$sql .= " AND o.rowid = ".$user->socid;
|
||||
$sql .= " AND o.rowid = ".((int) $user->socid);
|
||||
}
|
||||
if ($limit > 0 || $offset > 0) {
|
||||
$sql .= $this->db->plimit($limit + 1, $offset);
|
||||
@@ -870,7 +870,7 @@ class Categorie extends CommonObject
|
||||
public function containsObject($type, $object_id)
|
||||
{
|
||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]);
|
||||
$sql .= " WHERE fk_categorie = ".$this->id." AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $object_id);
|
||||
$sql .= " WHERE fk_categorie = ".((int) $this->id)." AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $object_id);
|
||||
dol_syslog(get_class($this)."::containsObject", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@@ -1501,7 +1501,7 @@ class Categorie extends CommonObject
|
||||
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id;
|
||||
// This seems useless because the table already contains id of category of 1 unique type. So commented.
|
||||
// So now it works also with external added categories.
|
||||
//$sql .= " AND c.type = ".$this->MAP_ID[$type];
|
||||
//$sql .= " AND c.type = ".((int) $this->MAP_ID[$type]);
|
||||
$sql .= " AND c.entity IN (".getEntity('category').")";
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
@@ -1796,7 +1796,7 @@ class Categorie extends CommonObject
|
||||
foreach ($langs_available as $key => $value) {
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql .= " WHERE fk_category=".$this->id;
|
||||
$sql .= " WHERE fk_category=".((int) $this->id);
|
||||
$sql .= " AND lang = '".$this->db->escape($key)."'";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@@ -1806,10 +1806,10 @@ class Categorie extends CommonObject
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql2 .= " SET label='".$this->db->escape($this->label)."',";
|
||||
$sql2 .= " description='".$this->db->escape($this->description)."'";
|
||||
$sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||
$sql2 .= " WHERE fk_category=".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
|
||||
} else {
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
|
||||
$sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->label);
|
||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label);
|
||||
$sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
|
||||
}
|
||||
dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG);
|
||||
@@ -1822,10 +1822,10 @@ class Categorie extends CommonObject
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql2 .= " SET label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||
$sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||
$sql2 .= " WHERE fk_category=".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
|
||||
} else {
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
|
||||
$sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->multilangs["$key"]["label"]);
|
||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"]);
|
||||
$sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
|
||||
}
|
||||
|
||||
@@ -1864,7 +1864,7 @@ class Categorie extends CommonObject
|
||||
|
||||
$sql = "SELECT lang, label, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql .= " WHERE fk_category=".$this->id;
|
||||
$sql .= " WHERE fk_category=".((int) $this->id);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
@@ -1963,6 +1963,12 @@ class Categorie extends CommonObject
|
||||
if ($type == 'bank_account') {
|
||||
$type = 'account';
|
||||
}
|
||||
if ($type == 'customer') {
|
||||
$type = 'societe';
|
||||
}
|
||||
if ($type == 'supplier') {
|
||||
$type = 'fournisseur';
|
||||
}
|
||||
|
||||
if (empty($searchList) && !is_array($searchList)) {
|
||||
return "";
|
||||
|
||||
@@ -205,10 +205,14 @@ foreach ($fulltree as $key => $val) {
|
||||
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_view().'</a>';
|
||||
$entry .= '</td>';
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>';
|
||||
if ($user->rights->categorie->creer) {
|
||||
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type) . '">' . img_edit() . '</a>';
|
||||
}
|
||||
$entry .= '</td>';
|
||||
$entry .= '<td class="right" width="20px;">';
|
||||
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>';
|
||||
if ($user->rights->categorie->supprimer) {
|
||||
$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '">' . img_delete() . '</a>';
|
||||
}
|
||||
$entry .= '</td>';
|
||||
|
||||
$entry .= '</tr>';
|
||||
|
||||
@@ -70,9 +70,18 @@ $offsetvalue = GETPOST('offsetvalue', 'int');
|
||||
$offsetunit = GETPOST('offsetunittype_duration', 'aZ09');
|
||||
$remindertype = GETPOST('selectremindertype', 'aZ09');
|
||||
$modelmail = GETPOST('actioncommsendmodel_mail', 'int');
|
||||
$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed
|
||||
if ($complete == 'na' || $complete == -2) {
|
||||
$complete = -1;
|
||||
}
|
||||
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
if ($fulldayevent) {
|
||||
$datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
} else {
|
||||
$datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
@@ -240,7 +249,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
exit;
|
||||
}
|
||||
|
||||
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
|
||||
@@ -471,7 +480,7 @@ if (empty($reshook) && $action == 'update') {
|
||||
$apmin = GETPOST('apmin', 'int');
|
||||
$p2hour = GETPOST('p2hour', 'int');
|
||||
$p2min = GETPOST('p2min', 'int');
|
||||
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
if ($aphour == -1) {
|
||||
@@ -1074,15 +1083,15 @@ if ($action == 'create') {
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
|
||||
print '<td>';
|
||||
$percent = GETPOST('complete')!=='' ? GETPOST('complete') : -1;
|
||||
$percent = $complete !=='' ? $complete : -1;
|
||||
if (GETPOSTISSET('status')) {
|
||||
$percent = GETPOST('status');
|
||||
} elseif (GETPOSTISSET('percentage')) {
|
||||
$percent = GETPOST('percentage');
|
||||
$percent = GETPOST('percentage', 'int');
|
||||
} else {
|
||||
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) {
|
||||
if ($complete == '0' || GETPOST("afaire") == 1) {
|
||||
$percent = '0';
|
||||
} elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) {
|
||||
} elseif ($complete == 100 || GETPOST("afaire") == 2) {
|
||||
$percent = 100;
|
||||
}
|
||||
}
|
||||
@@ -1214,7 +1223,11 @@ if ($action == 'create') {
|
||||
if (!empty($projectid)) {
|
||||
$projectsListId = $projectid;
|
||||
}
|
||||
$tid = GETPOST("projecttaskid") ? GETPOST("projecttaskid") : '';
|
||||
if ($origin=='task') {
|
||||
$tid= GETPOST("originid");
|
||||
} else {
|
||||
$tid = GETPOST("projecttaskid") ? GETPOST("projecttaskid") : '';
|
||||
}
|
||||
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId);
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -1222,12 +1235,16 @@ if ($action == 'create') {
|
||||
// Object linked
|
||||
if (!empty($origin) && !empty($originid)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
|
||||
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
|
||||
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
|
||||
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
||||
|
||||
if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
|
||||
// We do not use link for object that already contains a hard coded
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
|
||||
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
|
||||
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
|
||||
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
||||
}
|
||||
}
|
||||
|
||||
$reg = array();
|
||||
@@ -1254,7 +1271,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@@ -1348,7 +1365,7 @@ if ($id > 0) {
|
||||
$result5 = $object->fetch_optionals();
|
||||
|
||||
if ($listUserAssignedUpdated || $donotclearsession) {
|
||||
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
|
||||
@@ -1542,7 +1559,7 @@ if ($id > 0) {
|
||||
|
||||
// Status
|
||||
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
|
||||
$percent = GETPOST("percentage") ? GETPOST("percentage") : $object->percentage;
|
||||
$percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage;
|
||||
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@@ -585,12 +585,15 @@ class ActionComm extends CommonObject
|
||||
//dol_syslog(var_export($this->userassigned, true));
|
||||
$already_inserted = array();
|
||||
foreach ($this->userassigned as $key => $val) {
|
||||
if (!is_array($val)) { // For backward compatibility when val=id
|
||||
// Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val.
|
||||
if (!is_array($val)) { // For backward compatibility when $val='id'.
|
||||
$val = array('id'=>$val);
|
||||
}
|
||||
|
||||
if ($val['id'] > 0) {
|
||||
if (!empty($already_inserted[$val['id']])) continue;
|
||||
if (!empty($already_inserted[$val['id']])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||
$sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")";
|
||||
@@ -612,7 +615,10 @@ class ActionComm extends CommonObject
|
||||
if (!empty($this->socpeopleassigned)) {
|
||||
$already_inserted = array();
|
||||
foreach ($this->socpeopleassigned as $id => $val) {
|
||||
if (!empty($already_inserted[$val['id']])) continue;
|
||||
// Common value with new behavior is to have $val = iduser and $this->socpeopleassigned is an array of iduser => $val.
|
||||
if (!empty($already_inserted[$id])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||
$sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)";
|
||||
@@ -623,7 +629,7 @@ class ActionComm extends CommonObject
|
||||
dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
} else {
|
||||
$already_inserted[$val['id']] = true;
|
||||
$already_inserted[$id] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -729,13 +735,14 @@ class ActionComm extends CommonObject
|
||||
/**
|
||||
* Load object from database
|
||||
*
|
||||
* @param int $id Id of action to get
|
||||
* @param string $ref Ref of action to get
|
||||
* @param string $ref_ext Ref ext to get
|
||||
* @param string $email_msgid Email msgid
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id Id of action to get
|
||||
* @param string $ref Ref of action to get
|
||||
* @param string $ref_ext Ref ext to get
|
||||
* @param string $email_msgid Email msgid
|
||||
* @param string $loadresources 1=Load also resources
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
|
||||
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -852,8 +859,13 @@ class ActionComm extends CommonObject
|
||||
$this->event_paid = $obj->event_paid;
|
||||
$this->status = $obj->status;
|
||||
|
||||
$this->fetchResources();
|
||||
$this->fetch_optionals();
|
||||
|
||||
if ($loadresources) {
|
||||
$this->fetchResources();
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
@@ -875,7 +887,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
$sql = 'SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm_resources';
|
||||
$sql .= ' WHERE fk_actioncomm = '.$this->id;
|
||||
$sql .= ' WHERE fk_actioncomm = '.((int) $this->id);
|
||||
$sql .= " AND element_type IN ('user', 'socpeople')";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@@ -919,7 +931,7 @@ class ActionComm extends CommonObject
|
||||
// phpcs:enable
|
||||
$sql = "SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
||||
$sql .= " WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
||||
$sql .= " WHERE element_type = 'user' AND fk_actioncomm = ".((int) $this->id);
|
||||
|
||||
$resql2 = $this->db->query($sql);
|
||||
if ($resql2) {
|
||||
@@ -996,7 +1008,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
|
||||
$sql .= " WHERE fk_actioncomm = ".$this->id;
|
||||
$sql .= " WHERE fk_actioncomm = ".((int) $this->id);
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if (!$res) {
|
||||
@@ -1159,7 +1171,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
// Now insert assignedusers
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'user'";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".((int) $this->id)." AND element_type = 'user'";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$already_inserted = array();
|
||||
@@ -1184,7 +1196,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'socpeople'";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".((int) $this->id)." AND element_type = 'socpeople'";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!empty($this->socpeopleassigned)) {
|
||||
@@ -1320,7 +1332,7 @@ class ActionComm extends CommonObject
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
}
|
||||
if (!$user->rights->agenda->allactions->read) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".$user->id;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql .= " WHERE 1 = 1";
|
||||
@@ -1329,14 +1341,14 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
$sql .= " AND a.entity IN (".getEntity('agenda').")";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
|
||||
}
|
||||
if ($user->socid) {
|
||||
$sql .= " AND a.fk_soc = ".$user->socid;
|
||||
$sql .= " AND a.fk_soc = ".((int) $user->socid);
|
||||
}
|
||||
if (!$user->rights->agenda->allactions->read) {
|
||||
$sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id;
|
||||
$sql .= " OR ar.fk_element = ".$user->id; // Added by PV
|
||||
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id);
|
||||
$sql .= " OR ar.fk_element = ".((int) $user->id);
|
||||
$sql .= ")";
|
||||
}
|
||||
|
||||
@@ -2226,7 +2238,7 @@ class ActionComm extends CommonObject
|
||||
//Select all action comm reminders for event
|
||||
$sql = "SELECT rowid as id, typeremind, dateremind, status, offsetvalue, offsetunit, fk_user";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
|
||||
$sql .= " WHERE fk_actioncomm = ".$this->id;
|
||||
$sql .= " WHERE fk_actioncomm = ".((int) $this->id);
|
||||
if ($onlypast) {
|
||||
$sql .= " AND dateremind <= '".$this->db->idate(dol_now())."'";
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
@@ -689,7 +689,7 @@ if ($pid) {
|
||||
$sql .= " AND a.fk_project=".((int) $pid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= ' AND a.fk_soc = '.$socid;
|
||||
|
||||
@@ -447,7 +447,7 @@ if ($pid) {
|
||||
$sql .= " AND a.fk_project=".((int) $pid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -608,7 +608,7 @@ if ($resql) {
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
|
||||
@@ -416,7 +416,7 @@ $massactionbutton = '';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
@@ -558,7 +558,7 @@ if ($pid) {
|
||||
$sql .= " AND a.fk_project=".((int) $pid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= ' AND a.fk_soc = '.((int) $socid);
|
||||
|
||||
@@ -426,7 +426,7 @@ $massactionbutton = '';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
@@ -579,7 +579,7 @@ if ($pid) {
|
||||
$sql .= " AND a.fk_project = ".((int) $pid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= ' AND a.fk_soc = '.((int) $socid);
|
||||
@@ -892,15 +892,23 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
||||
}
|
||||
} else {
|
||||
/* Use this list to have for all users */
|
||||
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
|
||||
$sql .= " AND ug.fk_user = u.rowid ";
|
||||
} else {
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||
}
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
$sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " AND u.statut = 1";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
|
||||
}
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@@ -826,7 +826,7 @@ if ($object->id > 0) {
|
||||
$sql .= ", p.datep as dp, p.fin_validite as date_limit";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
||||
$sql .= " ORDER BY p.datep DESC";
|
||||
|
||||
@@ -891,7 +891,7 @@ if ($object->id > 0) {
|
||||
$sql .= ", c.facture as billed";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND c.entity IN (".getEntity('commande').')';
|
||||
$sql .= " ORDER BY c.date_commande DESC";
|
||||
|
||||
@@ -907,7 +907,7 @@ if ($object->id > 0) {
|
||||
$sql2 .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql2 .= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||
$sql2 .= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql2 .= ' AND s.rowid = '.$object->id;
|
||||
$sql2 .= ' AND s.rowid = '.((int) $object->id);
|
||||
// Show orders with status validated, shipping started and delivered (well any order we can bill)
|
||||
$sql2 .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";
|
||||
|
||||
@@ -967,7 +967,7 @@ if ($object->id > 0) {
|
||||
$sql .= ', s.nom';
|
||||
$sql .= ', s.rowid as socid';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id;
|
||||
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND e.entity IN (".getEntity('expedition').")";
|
||||
$sql .= ' GROUP BY e.rowid';
|
||||
$sql .= ', e.ref';
|
||||
@@ -1032,7 +1032,7 @@ if ($object->id > 0) {
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND c.entity IN (".getEntity('contract').")";
|
||||
$sql .= " ORDER BY c.datec DESC";
|
||||
|
||||
@@ -1106,7 +1106,7 @@ if ($object->id > 0) {
|
||||
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND f.entity IN (".getEntity('intervention').")";
|
||||
$sql .= " ORDER BY f.tms DESC";
|
||||
|
||||
@@ -1171,7 +1171,7 @@ if ($object->id > 0) {
|
||||
$sql .= ', f.suspended as suspended';
|
||||
$sql .= ', s.nom, s.rowid as socid';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
||||
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
|
||||
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= ' GROUP BY f.rowid, f.titre, f.total_ht, f.total_tva, f.total_ttc,';
|
||||
$sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,';
|
||||
@@ -1263,7 +1263,7 @@ if ($object->id > 0) {
|
||||
$sql .= ', SUM(pf.amount) as am';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
|
||||
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
|
||||
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= ' GROUP BY f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc,';
|
||||
$sql .= ' f.datef, f.datec, f.paye, f.fk_statut,';
|
||||
|
||||
@@ -90,7 +90,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
|
||||
$sql .= " WHERE s.fk_stcomm = st.id";
|
||||
$sql .= " AND p.entity IN (".getEntity('socpeople').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($type == "c") {
|
||||
$sql .= " AND s.client IN (1, 3)";
|
||||
|
||||
@@ -106,10 +106,16 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
print getCustomerProposalPieChart($socid);
|
||||
print '<br>';
|
||||
print getCustomerOrderPieChart($socid);
|
||||
print '<br>';
|
||||
$tmp = getCustomerProposalPieChart($socid);
|
||||
if ($tmp) {
|
||||
print $tmp;
|
||||
print '<br>';
|
||||
}
|
||||
$tmp = getCustomerOrderPieChart($socid);
|
||||
if ($tmp) {
|
||||
print $tmp;
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Draft customer proposals
|
||||
@@ -130,7 +136,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.fk_statut = ".Propal::STATUS_DRAFT;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -227,7 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
||||
$sql .= " AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -323,7 +329,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT;
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND c.fk_soc = ".((int) $socid);
|
||||
@@ -420,10 +426,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
$sql .= " AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
|
||||
$sql .= " AND cf.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND cf.fk_soc = ".$socid;
|
||||
$sql .= " AND cf.fk_soc = ".((int) $socid);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -517,7 +523,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
|
||||
$sql .= " AND s.client IN (".Societe::CUSTOMER.", ".Societe::PROSPECT.", ".Societe::CUSTOMER_AND_PROSPECT.")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = $socid";
|
||||
@@ -613,7 +619,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
|
||||
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
|
||||
$sql .= " AND s.fournisseur = ".Societe::SUPPLIER;
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -719,7 +725,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.fk_product = p.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -794,7 +800,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -910,7 +916,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
|
||||
@@ -726,7 +726,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
print $object->showOptionals($extrafields, 'create');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -60,7 +60,7 @@ $search_lastname = GETPOST("search_lastname", 'alphanohtml');
|
||||
$search_firstname = GETPOST("search_firstname", 'alphanohtml');
|
||||
$search_email = GETPOST("search_email", 'alphanohtml');
|
||||
$search_other = GETPOST("search_other", 'alphanohtml');
|
||||
$search_dest_status = GETPOST('search_dest_status', 'alphanohtml');
|
||||
$search_dest_status = GETPOST('search_dest_status', 'int');
|
||||
|
||||
// Search modules dirs
|
||||
$modulesdir = dolGetModulesDirs('/mailings');
|
||||
@@ -473,7 +473,7 @@ if ($object->fetch($id) >= 0) {
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
if ($search_dest_status != '' && $search_dest_status >= -1) {
|
||||
$sql .= " AND mc.statut=".$db->escape($search_dest_status)." ";
|
||||
$sql .= " AND mc.statut = ".((int) $search_dest_status);
|
||||
$asearchcriteriahasbeenset++;
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
@@ -539,6 +539,8 @@ if ($object->fetch($id) >= 0) {
|
||||
}
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
||||
|
||||
print '</form>';
|
||||
@@ -633,11 +635,11 @@ if ($object->fetch($id) >= 0) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->lastname.'</td>';
|
||||
print '<td>'.$obj->firstname.'</td>';
|
||||
print '<td class="tdoverflowmax150">'.img_picto('$obj->email', 'email', 'class="paddingright"').$obj->email.'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'.$obj->lastname.'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.$obj->firstname.'</td>';
|
||||
print '<td>'.$obj->other.'</td>';
|
||||
print '<td class="center">';
|
||||
print '<td class="center tdoverflowmax150">';
|
||||
if (empty($obj->source_id) || empty($obj->source_type)) {
|
||||
print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility
|
||||
} else {
|
||||
|
||||
@@ -384,8 +384,8 @@ if (empty($reshook)) {
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
|
||||
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
|
||||
$object->socid = GETPOST('socid', 'int');
|
||||
$object->contact_id = GETPOST('contactid', 'int');
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
@@ -826,8 +826,8 @@ if (empty($reshook)) {
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
|
||||
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
|
||||
if (empty($remise_percent)) {
|
||||
$remise_percent = 0;
|
||||
}
|
||||
@@ -1214,6 +1214,8 @@ if (empty($reshook)) {
|
||||
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
@@ -1226,7 +1228,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Define special_code for special lines
|
||||
$special_code = GETPOST('special_code');
|
||||
$special_code = GETPOST('special_code', 'int');
|
||||
if (!GETPOST('qty')) {
|
||||
$special_code = 3;
|
||||
}
|
||||
@@ -1245,7 +1247,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@@ -1275,7 +1277,7 @@ if (empty($reshook)) {
|
||||
|
||||
$qty = price2num(GETPOST('qty', 'alpha'), 'MS');
|
||||
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
|
||||
|
||||
if ($result >= 0) {
|
||||
$db->commit();
|
||||
@@ -1343,9 +1345,9 @@ if (empty($reshook)) {
|
||||
// Terms of payment
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
} elseif ($action == 'setremisepercent' && $usercancreate) {
|
||||
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent')));
|
||||
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
|
||||
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue')));
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
|
||||
} elseif ($action == 'setmode' && $usercancreate) {
|
||||
// Payment choice
|
||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||
@@ -2581,7 +2583,7 @@ if ($action == 'create') {
|
||||
// Create an invoice and classify billed
|
||||
if ($object->statut == Propal::STATUS_SIGNED) {
|
||||
if (!empty($conf->facture->enabled) && $usercancreateinvoice) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
|
||||
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
||||
|
||||
@@ -1879,8 +1879,8 @@ class Propal extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET ref = '".$this->db->escape($num)."',";
|
||||
$sql .= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".((int) $user->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(get_class($this)."::valid", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -1906,7 +1906,7 @@ class Propal extends CommonObject
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
|
||||
// Now we rename also files into index
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'propale/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'propale/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'propale/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
@@ -1974,7 +1974,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2030,7 +2030,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite != '' ? "'".$this->db->idate($date_fin_validite)."'" : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2101,7 +2101,7 @@ class Propal extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
||||
$sql .= " SET date_livraison = ".($delivery_date != '' ? "'".$this->db->idate($delivery_date)."'" : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2156,9 +2156,9 @@ class Propal extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
||||
$sql .= " SET fk_availability = '".$id."'";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET fk_availability = ".((int) $id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(__METHOD__.' availability('.$id.')', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2221,7 +2221,7 @@ class Propal extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
|
||||
$sql .= " SET fk_input_reason = ".((int) $id);
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2346,7 +2346,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET remise_percent = ".((float) $remise);
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2409,7 +2409,7 @@ class Propal extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET remise_absolue = ".((float) $remise);
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2530,7 +2530,7 @@ class Propal extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@@ -2563,8 +2563,13 @@ class Propal extends CommonObject
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
// PDF
|
||||
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||
|
||||
//$ret=$object->fetch($id); // Reload to get new records
|
||||
$this->generateDocument($modelpdf, $outputlangs);
|
||||
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@@ -2651,8 +2656,13 @@ class Propal extends CommonObject
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
// PDF
|
||||
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||
|
||||
//$ret=$object->fetch($id); // Reload to get new records
|
||||
$this->generateDocument($modelpdf, $outputlangs);
|
||||
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
$this->oldcopy = clone $this;
|
||||
@@ -2707,7 +2717,7 @@ class Propal extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
@@ -2780,7 +2790,7 @@ class Propal extends CommonObject
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.fk_statut = c.id";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { //restriction
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -2789,7 +2799,7 @@ class Propal extends CommonObject
|
||||
$sql .= " AND p.fk_statut = ".self::STATUS_DRAFT;
|
||||
}
|
||||
if ($notcurrentuser > 0) {
|
||||
$sql .= " AND p.fk_user_author <> ".$user->id;
|
||||
$sql .= " AND p.fk_user_author <> ".((int) $user->id);
|
||||
}
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
@@ -2934,7 +2944,7 @@ class Propal extends CommonObject
|
||||
if (!$error && !empty($this->table_element_line)) {
|
||||
$tabletodelete = $this->table_element_line;
|
||||
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id).")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id);
|
||||
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
@@ -2970,7 +2980,7 @@ class Propal extends CommonObject
|
||||
|
||||
// Delete main record
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
|
||||
$res = $this->db->query($sql);
|
||||
if (!$res) {
|
||||
$error++;
|
||||
@@ -3285,7 +3295,7 @@ class Propal extends CommonObject
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".$user->id;
|
||||
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
|
||||
$clause = " AND";
|
||||
}
|
||||
$sql .= $clause." p.entity IN (".getEntity('propal').")";
|
||||
@@ -3296,7 +3306,7 @@ class Propal extends CommonObject
|
||||
$sql .= " AND p.fk_statut = ".self::STATUS_SIGNED;
|
||||
}
|
||||
if ($user->socid) {
|
||||
$sql .= " AND p.fk_soc = ".$user->socid;
|
||||
$sql .= " AND p.fk_soc = ".((int) $user->socid);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -3462,7 +3472,7 @@ class Propal extends CommonObject
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".$user->id;
|
||||
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
|
||||
$clause = "AND";
|
||||
}
|
||||
$sql .= " ".$clause." p.entity IN (".getEntity('propal').")";
|
||||
@@ -4156,7 +4166,7 @@ class PropaleLigne extends CommonObjectLine
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid);
|
||||
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql)) {
|
||||
// Remove extrafields
|
||||
|
||||
@@ -94,10 +94,10 @@ class PropaleStats extends Stats
|
||||
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
|
||||
$this->where .= ($this->where ? ' AND ' : '')."p.entity IN (".getEntity('propal').")";
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) {
|
||||
$this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($this->socid) {
|
||||
$this->where .= " AND p.fk_soc = ".$this->socid;
|
||||
$this->where .= " AND p.fk_soc = ".((int) $this->socid);
|
||||
}
|
||||
if ($this->userid > 0) {
|
||||
$this->where .= ' AND fk_user_author = '.((int) $this->userid);
|
||||
|
||||
@@ -67,8 +67,11 @@ print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal');
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichethirdleft">';
|
||||
|
||||
print getCustomerProposalPieChart($socid);
|
||||
print '<br>';
|
||||
$tmp = getCustomerProposalPieChart($socid);
|
||||
if ($tmp) {
|
||||
print $tmp;
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Draft proposals
|
||||
@@ -85,7 +88,7 @@ if (!empty($conf->propal->enabled)) {
|
||||
$sql .= " AND p.fk_soc = s.rowid";
|
||||
$sql .= " AND p.fk_statut =".Propal::STATUS_DRAFT;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND p.fk_soc = ".((int) $socid);
|
||||
@@ -163,7 +166,7 @@ if ($socid) {
|
||||
$sql .= " AND c.fk_soc = ".((int) $socid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " ORDER BY c.tms DESC";
|
||||
$sql .= $db->plimit($max, 0);
|
||||
@@ -236,7 +239,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
|
||||
$sql .= " AND p.entity IN (".getEntity($propalstatic->element).")";
|
||||
$sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -319,7 +322,7 @@ if (! empty($conf->propal->enabled))
|
||||
$sql.= " AND c.entity = ".$conf->entity;
|
||||
$sql.= " AND c.fk_statut = 1";
|
||||
if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid);
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
|
||||
$sql.= " ORDER BY c.rowid DESC";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@@ -394,7 +397,7 @@ if (! empty($conf->propal->enabled))
|
||||
$sql.= " AND c.entity = ".$conf->entity;
|
||||
$sql.= " AND c.fk_statut = 2 ";
|
||||
if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid);
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
|
||||
$sql.= " ORDER BY c.rowid DESC";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -88,12 +88,30 @@ $search_zip = GETPOST('search_zip', 'alpha');
|
||||
$search_state = GETPOST("search_state");
|
||||
$search_country = GETPOST("search_country", 'int');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
|
||||
$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
|
||||
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
|
||||
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_end_startday = GETPOST('search_date_end_startday', 'int');
|
||||
$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int');
|
||||
$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int');
|
||||
$search_date_end_endday = GETPOST('search_date_end_endday', 'int');
|
||||
$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int');
|
||||
$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int');
|
||||
$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
|
||||
$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
|
||||
$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int');
|
||||
$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int');
|
||||
$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int');
|
||||
$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int');
|
||||
$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int');
|
||||
$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int');
|
||||
$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
|
||||
$search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
|
||||
$search_availability = GETPOST('search_availability', 'int');
|
||||
$search_categ_cus = GETPOST("search_categ_cus", 'int');
|
||||
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
|
||||
@@ -278,12 +296,30 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_type = '';
|
||||
$search_country = '';
|
||||
$search_type_thirdparty = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startyear = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_dateend_start = '';
|
||||
$search_dateend_end = '';
|
||||
$search_datedelivery_start = '';
|
||||
$search_datedelivery_end = '';
|
||||
$search_date_end_startday = '';
|
||||
$search_date_end_startmonth = '';
|
||||
$search_date_end_startyear = '';
|
||||
$search_date_end_endday = '';
|
||||
$search_date_end_endmonth = '';
|
||||
$search_date_end_endyear = '';
|
||||
$search_date_end_start = '';
|
||||
$search_date_end_end = '';
|
||||
$search_date_delivery_startday = '';
|
||||
$search_date_delivery_startmonth = '';
|
||||
$search_date_delivery_startyear = '';
|
||||
$search_date_delivery_endday = '';
|
||||
$search_date_delivery_endmonth = '';
|
||||
$search_date_delivery_endyear = '';
|
||||
$search_date_delivery_start = '';
|
||||
$search_date_delivery_end = '';
|
||||
$search_availability = '';
|
||||
$search_status = '';
|
||||
$object_statut = '';
|
||||
@@ -471,11 +507,11 @@ $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date
|
||||
$sql .= ' p.note_public, p.note_private,';
|
||||
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
|
||||
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user";
|
||||
}
|
||||
if ($search_categ_cus) {
|
||||
if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
|
||||
$sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
@@ -493,7 +529,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
||||
if (!empty($search_categ_cus)) {
|
||||
if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
|
||||
}
|
||||
$sql .= ', '.MAIN_DB_PREFIX.'propal as p';
|
||||
@@ -520,7 +556,7 @@ if ($search_user > 0) {
|
||||
$sql .= ' WHERE p.fk_soc = s.rowid';
|
||||
$sql .= ' AND p.entity IN ('.getEntity('propal').')';
|
||||
if (!$user->rights->societe->client->voir && !$socid) { //restriction
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
|
||||
if ($search_town) {
|
||||
@@ -592,6 +628,7 @@ if ($search_multicurrency_montant_ttc != '') {
|
||||
if ($sall) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||
}
|
||||
|
||||
if ($search_categ_cus > 0) {
|
||||
$sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus);
|
||||
}
|
||||
@@ -627,17 +664,17 @@ if ($search_date_start) {
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
if ($search_dateend_start) {
|
||||
$sql .= " AND p.fin_validite >= '".$db->idate($search_dateend_start)."'";
|
||||
if ($search_date_end_start) {
|
||||
$sql .= " AND p.fin_validite >= '".$db->idate($search_date_end_start)."'";
|
||||
}
|
||||
if ($search_dateend_end) {
|
||||
$sql .= " AND p.fin_validite <= '".$db->idate($search_dateend_end)."'";
|
||||
if ($search_date_end_end) {
|
||||
$sql .= " AND p.fin_validite <= '".$db->idate($search_date_end_end)."'";
|
||||
}
|
||||
if ($search_datedelivery_start) {
|
||||
$sql .= " AND p.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
|
||||
if ($search_date_delivery_start) {
|
||||
$sql .= " AND p.date_livraison >= '".$db->idate($search_date_delivery_start)."'";
|
||||
}
|
||||
if ($search_datedelivery_end) {
|
||||
$sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
|
||||
if ($search_date_delivery_end) {
|
||||
$sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'";
|
||||
}
|
||||
if ($search_sale > 0) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
|
||||
@@ -712,12 +749,60 @@ if ($resql) {
|
||||
if ($sall) {
|
||||
$param .= '&sall='.urlencode($sall);
|
||||
}
|
||||
if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
|
||||
if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
|
||||
if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
|
||||
if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
|
||||
if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
|
||||
if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
|
||||
if ($search_date_startday) {
|
||||
$param .= '&search_date_startday='.urlencode($search_date_startday);
|
||||
}
|
||||
if ($search_date_startmonth) {
|
||||
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
|
||||
}
|
||||
if ($search_date_startyear) {
|
||||
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
|
||||
}
|
||||
if ($search_date_endday) {
|
||||
$param .= '&search_date_endday='.urlencode($search_date_endday);
|
||||
}
|
||||
if ($search_date_endmonth) {
|
||||
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
|
||||
}
|
||||
if ($search_date_endyear) {
|
||||
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
|
||||
}
|
||||
if ($search_date_end_startday) {
|
||||
$param .= '&search_date_end_startday='.urlencode($search_date_end_startday);
|
||||
}
|
||||
if ($search_date_end_startmonth) {
|
||||
$param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
|
||||
}
|
||||
if ($search_date_end_startyear) {
|
||||
$param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear);
|
||||
}
|
||||
if ($search_date_end_endday) {
|
||||
$param .= '&search_date_end_endday='.urlencode($search_date_end_endday);
|
||||
}
|
||||
if ($search_date_end_endmonth) {
|
||||
$param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
|
||||
}
|
||||
if ($search_date_end_endyear) {
|
||||
$param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear);
|
||||
}
|
||||
if ($search_date_delivery_startday) {
|
||||
$param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
|
||||
}
|
||||
if ($search_date_delivery_startmonth) {
|
||||
$param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
|
||||
}
|
||||
if ($search_date_delivery_startyear) {
|
||||
$param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
|
||||
}
|
||||
if ($search_date_delivery_endday) {
|
||||
$param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
|
||||
}
|
||||
if ($search_date_delivery_endmonth) {
|
||||
$param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
|
||||
}
|
||||
if ($search_date_delivery_endyear) {
|
||||
$param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
|
||||
}
|
||||
if ($search_ref) {
|
||||
$param .= '&search_ref='.urlencode($search_ref);
|
||||
}
|
||||
@@ -1017,10 +1102,10 @@ if ($resql) {
|
||||
if (!empty($arrayfields['p.fin_validite']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_dateend_start ? $search_dateend_start : -1, 'search_dateend_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_dateend_end ? $search_dateend_end : -1, 'search_dateend_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -1028,10 +1113,10 @@ if ($resql) {
|
||||
if (!empty($arrayfields['p.date_livraison']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -1708,8 +1793,8 @@ if ($resql) {
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->statut = $obj->statut;
|
||||
$userstatic->email = $obj->user_email;
|
||||
$userstatic->statut = $obj->user_statut;
|
||||
$userstatic->entity = $obj->user_entity;
|
||||
$userstatic->photo = $obj->photo;
|
||||
$userstatic->office_phone = $obj->office_phone;
|
||||
|
||||
@@ -709,8 +709,8 @@ if ($socid > 0) {
|
||||
//$sql.= " UNION ";
|
||||
// Discount linked to invoices
|
||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||
$sql2 .= " rc.fk_facture_source,";
|
||||
$sql2 .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture, rc.fk_facture_source,";
|
||||
$sql2 .= " u.login, u.rowid as user_id,";
|
||||
$sql2 .= " f.rowid as invoiceid, f.ref,";
|
||||
$sql2 .= " fa.ref as invoice_source_ref, fa.type as type";
|
||||
@@ -850,7 +850,7 @@ if ($socid > 0) {
|
||||
// Discount linked to invoice lines
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line,";
|
||||
$sql .= " rc.fk_invoice_supplier_source,";
|
||||
$sql .= " u.login, u.rowid as user_id,";
|
||||
$sql .= " f.rowid as invoiceid, f.ref as ref,";
|
||||
@@ -869,7 +869,8 @@ if ($socid > 0) {
|
||||
//$sql.= " UNION ";
|
||||
// Discount linked to invoices
|
||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql2 .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier,";
|
||||
$sql2 .= " rc.fk_invoice_supplier_source,";
|
||||
$sql2 .= " u.login, u.rowid as user_id,";
|
||||
$sql2 .= " f.rowid as invoiceid, f.ref as ref,";
|
||||
|
||||
@@ -278,6 +278,7 @@ if (empty($reshook)) {
|
||||
if (!empty($origin) && !empty($originid)) {
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $subelement = $origin;
|
||||
$regs = array();
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||
$element = $regs [1];
|
||||
$subelement = $regs [2];
|
||||
@@ -597,9 +598,9 @@ if (empty($reshook)) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'setremisepercent' && $usercancreate) {
|
||||
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
|
||||
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
|
||||
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
|
||||
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
|
||||
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') {
|
||||
// Define vat_rate
|
||||
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
|
||||
@@ -629,7 +630,7 @@ if (empty($reshook)) {
|
||||
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
|
||||
|
||||
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
|
||||
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
|
||||
if (empty($remise_percent)) {
|
||||
$remise_percent = 0;
|
||||
}
|
||||
@@ -1019,6 +1020,8 @@ if (empty($reshook)) {
|
||||
$special_code = 3;
|
||||
}
|
||||
|
||||
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
|
||||
|
||||
// Check minimum price
|
||||
$productid = GETPOST('productid', 'int');
|
||||
if (!empty($productid)) {
|
||||
@@ -1034,7 +1037,7 @@ if (empty($reshook)) {
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@@ -1059,7 +1062,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
|
||||
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
|
||||
|
||||
if ($result >= 0) {
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
@@ -1392,6 +1395,7 @@ if (empty($reshook)) {
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans('Order')." - ".$langs->trans('Card');
|
||||
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
|
||||
llxHeader('', $title, $help_url);
|
||||
@@ -1717,7 +1721,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
};
|
||||
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
// Template to use by default
|
||||
@@ -2345,17 +2349,17 @@ if ($action == 'create' && $usercancreate) {
|
||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
|
||||
// Multicurrency Amount HT
|
||||
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
|
||||
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).'</td>';
|
||||
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).'</td>';
|
||||
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -2365,23 +2369,23 @@ if ($action == 'create' && $usercancreate) {
|
||||
$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
|
||||
}
|
||||
print '<tr><td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td class="valuefield">'.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).$alert.'</td>';
|
||||
print '<td class="valuefield">'.price($object->total_ht, 1, '', 1, -1, -1, $conf->currency).$alert.'</td>';
|
||||
|
||||
// Total VAT
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td class="valuefield">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td class="valuefield">'.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
|
||||
print '<td class="valuefield">'.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<td class="valuefield">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
|
||||
print '<td class="valuefield">'.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<td class="valuefield">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
// Total TTC
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="valuefield">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="valuefield">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
//print '<tr><td>' . $langs->trans('Status') . '</td><td>' . $object->getLibStatut(4) . '</td></tr>';
|
||||
|
||||
@@ -717,6 +717,8 @@ class Orders extends DolibarrApi
|
||||
throw new RestException(404, 'Order not found');
|
||||
}
|
||||
|
||||
$result = $this->commande->fetch_thirdparty(); // do not check result, as failure is not fatal (used only for mail notification substitutes)
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@@ -729,13 +731,6 @@ class Orders extends DolibarrApi
|
||||
throw new RestException(500, 'Error when validating Order: '.$this->commande->error);
|
||||
}
|
||||
$result = $this->commande->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Order not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$this->commande->fetchObjectLinked();
|
||||
|
||||
|
||||
@@ -299,13 +299,9 @@ class Commande extends CommonOrder
|
||||
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
|
||||
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>56),
|
||||
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
||||
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60),
|
||||
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
|
||||
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80),
|
||||
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
|
||||
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||
'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
||||
@@ -344,6 +340,10 @@ class Commande extends CommonOrder
|
||||
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
|
||||
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
|
||||
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
|
||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300),
|
||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>304),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400),
|
||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
);
|
||||
@@ -493,8 +493,8 @@ class Commande extends CommonOrder
|
||||
$sql .= " SET ref = '".$this->db->escape($num)."',";
|
||||
$sql .= " fk_statut = ".self::STATUS_VALIDATED.",";
|
||||
$sql .= " date_valid='".$this->db->idate($now)."',";
|
||||
$sql .= " fk_user_valid = ".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " fk_user_valid = ".((int) $user->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::valid", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -624,7 +624,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
|
||||
$sql .= " SET fk_statut = ".self::STATUS_DRAFT;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
if ($this->db->query($sql)) {
|
||||
if (!$error) {
|
||||
@@ -807,7 +807,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
|
||||
$sql .= " SET fk_statut = ".self::STATUS_CANCELED;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
$sql .= " AND fk_statut = ".self::STATUS_VALIDATED;
|
||||
|
||||
dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
|
||||
@@ -2543,7 +2543,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
|
||||
$sql .= " SET date_commande = ".($date ? "'".$this->db->idate($date)."'" : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".((int) self::STATUS_DRAFT);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".((int) self::STATUS_DRAFT);
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2615,7 +2615,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
|
||||
$sql .= " SET date_livraison = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2688,7 +2688,7 @@ class Commande extends CommonOrder
|
||||
$sql .= " WHERE c.entity IN (".getEntity('commande').")";
|
||||
$sql .= " AND c.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) { //restriction
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
@@ -2697,7 +2697,7 @@ class Commande extends CommonOrder
|
||||
$sql .= " AND c.fk_statut = ".self::STATUS_DRAFT;
|
||||
}
|
||||
if (is_object($excluser)) {
|
||||
$sql .= " AND c.fk_user_author <> ".$excluser->id;
|
||||
$sql .= " AND c.fk_user_author <> ".((int) $excluser->id);
|
||||
}
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
@@ -3395,8 +3395,8 @@ class Commande extends CommonOrder
|
||||
// Delete extrafields of lines and lines
|
||||
if (!$error && !empty($this->table_element_line)) {
|
||||
$tabletodelete = $this->table_element_line;
|
||||
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
|
||||
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id).")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id);
|
||||
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
@@ -3432,7 +3432,7 @@ class Commande extends CommonOrder
|
||||
|
||||
// Delete main record
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
|
||||
$res = $this->db->query($sql);
|
||||
if (!$res) {
|
||||
$error++;
|
||||
@@ -3507,14 +3507,14 @@ class Commande extends CommonOrder
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".$user->id;
|
||||
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
|
||||
$clause = " AND";
|
||||
}
|
||||
$sql .= $clause." c.entity IN (".getEntity('commande').")";
|
||||
//$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0";
|
||||
$sql .= " AND ((c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")) OR (c.fk_statut = ".self::STATUS_CLOSED." AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
|
||||
if ($user->socid) {
|
||||
$sql .= " AND c.fk_soc = ".$user->socid;
|
||||
$sql .= " AND c.fk_soc = ".((int) $user->socid);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -3917,7 +3917,7 @@ class Commande extends CommonOrder
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON co.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".$user->id;
|
||||
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
|
||||
$clause = "AND";
|
||||
}
|
||||
$sql .= " ".$clause." co.entity IN (".getEntity('commande').")";
|
||||
@@ -4649,7 +4649,7 @@ class OrderLine extends CommonOrderLine
|
||||
$sql .= ",total_localtax1='".price2num($this->total_localtax1)."'";
|
||||
$sql .= ",total_localtax2='".price2num($this->total_localtax2)."'";
|
||||
$sql .= ",total_ttc='".price2num($this->total_ttc)."'";
|
||||
$sql .= " WHERE rowid = ".$this->rowid;
|
||||
$sql .= " WHERE rowid = ".((int) $this->rowid);
|
||||
|
||||
dol_syslog("OrderLine::update_total", LOG_DEBUG);
|
||||
|
||||
|
||||
@@ -94,13 +94,13 @@ class CommandeStats extends Stats
|
||||
$this->where .= ($this->where ? ' AND ' : '').'c.entity IN ('.getEntity('commande').')';
|
||||
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) {
|
||||
$this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if ($this->socid) {
|
||||
$this->where .= " AND c.fk_soc = ".$this->socid;
|
||||
$this->where .= " AND c.fk_soc = ".((int) $this->socid);
|
||||
}
|
||||
if ($this->userid > 0) {
|
||||
$this->where .= ' AND c.fk_user_author = '.$this->userid;
|
||||
$this->where .= ' AND c.fk_user_author = '.((int) $this->userid);
|
||||
}
|
||||
|
||||
if ($typentid) {
|
||||
|
||||
@@ -87,7 +87,7 @@ if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " WHERE s.fk_stcomm = st.id AND c.fk_soc = s.rowid";
|
||||
$sql .= " AND s.entity IN (".getEntity('societe').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
if (GETPOST("search_nom")) {
|
||||
$sql .= natural_search("s.nom", GETPOST("search_nom"));
|
||||
|
||||
@@ -77,8 +77,11 @@ print load_fiche_titre($langs->trans("OrdersArea"), '', 'order');
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
print getCustomerOrderPieChart($socid);
|
||||
print '<br>';
|
||||
$tmp = getCustomerOrderPieChart($socid);
|
||||
if ($tmp) {
|
||||
print $tmp;
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -101,7 +104,7 @@ if (!empty($conf->commande->enabled)) {
|
||||
$sql .= " AND c.fk_soc = ".((int) $socid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -169,7 +172,7 @@ if ($socid) {
|
||||
$sql .= " AND c.fk_soc = ".((int) $socid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " ORDER BY c.tms DESC";
|
||||
$sql .= $db->plimit($max, 0);
|
||||
@@ -253,7 +256,7 @@ if (!empty($conf->commande->enabled)) {
|
||||
$sql .= " AND c.fk_soc = ".((int) $socid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " ORDER BY c.rowid DESC";
|
||||
|
||||
@@ -342,7 +345,7 @@ if (!empty($conf->commande->enabled)) {
|
||||
$sql .= " AND c.fk_soc = ".((int) $socid);
|
||||
}
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " ORDER BY c.rowid DESC";
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user