forked from Wavyzz/dolibarr
Compare commits
763 Commits
5.0.0-beta
...
5.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb1a94067a | ||
|
|
92acbbd8a8 | ||
|
|
1f9b41b178 | ||
|
|
4e4ad4548a | ||
|
|
5733826a68 | ||
|
|
77d5de6470 | ||
|
|
69eb64a975 | ||
|
|
7e80505104 | ||
|
|
8be9679f84 | ||
|
|
4fc0468356 | ||
|
|
6961db0007 | ||
|
|
e981e719a1 | ||
|
|
a79903a2fc | ||
|
|
aefdc09cdc | ||
|
|
ba03b17354 | ||
|
|
5a3873cfb7 | ||
|
|
b32c552fbc | ||
|
|
cbe855370b | ||
|
|
daf1dbb3a1 | ||
|
|
89b52e24f6 | ||
|
|
fc6fb61476 | ||
|
|
bb72121179 | ||
|
|
cbb80e6727 | ||
|
|
32678015c9 | ||
|
|
2ecf50a6cc | ||
|
|
089aa1df33 | ||
|
|
230bb09c1a | ||
|
|
ebe625aa16 | ||
|
|
63876a1b91 | ||
|
|
b3a127519b | ||
|
|
a0873bad29 | ||
|
|
6c40110613 | ||
|
|
33d1d78329 | ||
|
|
68ded1b4c3 | ||
|
|
3e2c0d26f2 | ||
|
|
a8129ce46e | ||
|
|
702ad5bcde | ||
|
|
89d10ae5aa | ||
|
|
020ceacb46 | ||
|
|
0a9ffa58c1 | ||
|
|
d883c3cd8d | ||
|
|
501f118f92 | ||
|
|
723d8ff106 | ||
|
|
dbf4eaccb7 | ||
|
|
847f408508 | ||
|
|
cd2f655333 | ||
|
|
b697da7399 | ||
|
|
7f21c3f3f2 | ||
|
|
0e6c329695 | ||
|
|
a91d57037e | ||
|
|
c61c13d9fd | ||
|
|
37caae3466 | ||
|
|
bde6815e5d | ||
|
|
d3eff46305 | ||
|
|
45eba9f62e | ||
|
|
c2ec6d5946 | ||
|
|
d42d7343bc | ||
|
|
cea25ecb28 | ||
|
|
2083d88609 | ||
|
|
efd2e85f12 | ||
|
|
beaa56306c | ||
|
|
4c310964a9 | ||
|
|
9778ca414a | ||
|
|
4a8006b330 | ||
|
|
fd6c4fd4d0 | ||
|
|
979a5e70bf | ||
|
|
ad890561c4 | ||
|
|
1a3b9fada5 | ||
|
|
abb3c810de | ||
|
|
0d1bb5e7eb | ||
|
|
ea4a83838c | ||
|
|
d9f32f7ae1 | ||
|
|
c175dfe68b | ||
|
|
89e6d86bf7 | ||
|
|
e903bf2b5c | ||
|
|
66ff7fab34 | ||
|
|
d7614af96e | ||
|
|
294517a8e0 | ||
|
|
bcd624e5a5 | ||
|
|
25e8caa64e | ||
|
|
ae740b7c1b | ||
|
|
bf32acaadd | ||
|
|
32b1f4261b | ||
|
|
abffd29179 | ||
|
|
0e6ba5df4e | ||
|
|
b356c34dc4 | ||
|
|
7e3785d446 | ||
|
|
b9db7eba1b | ||
|
|
f6a8aacc8d | ||
|
|
ca67917e80 | ||
|
|
a4f2325902 | ||
|
|
a4d9f7dbbe | ||
|
|
d463511cff | ||
|
|
d461c0dfa4 | ||
|
|
66542b6367 | ||
|
|
ad308e33cc | ||
|
|
5c9c761911 | ||
|
|
04d73668cc | ||
|
|
366df59658 | ||
|
|
e74927a54c | ||
|
|
6db0e909d6 | ||
|
|
ab0783edcc | ||
|
|
e0850b29cd | ||
|
|
b1fe8e3f2b | ||
|
|
a84c6f9b45 | ||
|
|
104c8ae243 | ||
|
|
882423f935 | ||
|
|
dc0856413c | ||
|
|
eb452397bd | ||
|
|
4c3255857c | ||
|
|
0a797cd12e | ||
|
|
8e733ca2fe | ||
|
|
d5978a5092 | ||
|
|
fbff32823a | ||
|
|
c6e0a4cc87 | ||
|
|
ea7a2b1e2a | ||
|
|
df6983b3c5 | ||
|
|
d56b5f30c8 | ||
|
|
b0ee04c079 | ||
|
|
2d77cb2da5 | ||
|
|
afa68a1418 | ||
|
|
6b528b2bea | ||
|
|
b447501d72 | ||
|
|
821978d54c | ||
|
|
bee507c76c | ||
|
|
bbf34bfda8 | ||
|
|
6cb3199824 | ||
|
|
fea2b081f9 | ||
|
|
517a20db35 | ||
|
|
480d099d81 | ||
|
|
5381eadc75 | ||
|
|
76280f8ae2 | ||
|
|
d740bdbc73 | ||
|
|
76bd5e009a | ||
|
|
d7060b0c4b | ||
|
|
b5ca8ebef9 | ||
|
|
4d78e0d45c | ||
|
|
40737eac2e | ||
|
|
f6144b9ecb | ||
|
|
819edcf43a | ||
|
|
09ebb1dcdc | ||
|
|
c657d193ec | ||
|
|
6b1e81fa1d | ||
|
|
374bff5a5f | ||
|
|
f31eaef0d9 | ||
|
|
68a6a08a01 | ||
|
|
797b68fc20 | ||
|
|
cfb317abdd | ||
|
|
8f0ddf2b8c | ||
|
|
b3d00fb01d | ||
|
|
4f3a24afab | ||
|
|
1785ef9957 | ||
|
|
18f3e11c10 | ||
|
|
9b37b52f45 | ||
|
|
52b92995cc | ||
|
|
8b2d0064a3 | ||
|
|
924a08a078 | ||
|
|
fbbf8cd8a4 | ||
|
|
9a9b31c9c0 | ||
|
|
fbf9986506 | ||
|
|
2db372d99d | ||
|
|
aaa2e393c3 | ||
|
|
8e675fa039 | ||
|
|
90e8f062e9 | ||
|
|
c79137d14c | ||
|
|
f16e65c6b1 | ||
|
|
5e4509953d | ||
|
|
45263c85ec | ||
|
|
ff8b7e6e4d | ||
|
|
92e61e6707 | ||
|
|
45c99d9d24 | ||
|
|
d7c2bdba38 | ||
|
|
756919de2a | ||
|
|
b4b81d8dcb | ||
|
|
24c21cca27 | ||
|
|
4f76626f51 | ||
|
|
fd90bf466b | ||
|
|
2c07d2df22 | ||
|
|
c88e63ecc9 | ||
|
|
e2ce31e1a7 | ||
|
|
1e78c4c418 | ||
|
|
7c638feb3b | ||
|
|
bc8ccd8ec5 | ||
|
|
4bce208035 | ||
|
|
27caa586c2 | ||
|
|
3e14a89eb0 | ||
|
|
63f614d1d5 | ||
|
|
c0b4667713 | ||
|
|
7b6488b1c7 | ||
|
|
0c14e1d233 | ||
|
|
025036595d | ||
|
|
8a4e957554 | ||
|
|
f2f8d7b6a5 | ||
|
|
ade8fd1415 | ||
|
|
dae3e03603 | ||
|
|
44b1eb9e4c | ||
|
|
3991caa674 | ||
|
|
1239e8600a | ||
|
|
65f493ac41 | ||
|
|
94649514f4 | ||
|
|
4c28e1598b | ||
|
|
9281cb9f8a | ||
|
|
ca79d0c274 | ||
|
|
72fd21b183 | ||
|
|
60ac751d84 | ||
|
|
c1b59b1950 | ||
|
|
a333a328d8 | ||
|
|
deceeea8ff | ||
|
|
32ebe8f4d7 | ||
|
|
4839d06fc3 | ||
|
|
9889f0a4a2 | ||
|
|
eac6ac0247 | ||
|
|
f0ba5cdba8 | ||
|
|
28115689e8 | ||
|
|
0df39149c4 | ||
|
|
debfb97903 | ||
|
|
daa4536f83 | ||
|
|
c56074d48f | ||
|
|
cb5117ad06 | ||
|
|
7f87f6688b | ||
|
|
99fb9b7e0e | ||
|
|
09dde659d5 | ||
|
|
d65cb29536 | ||
|
|
fd55ded996 | ||
|
|
755d353dfa | ||
|
|
84fec7c5c7 | ||
|
|
b1e5d8ce98 | ||
|
|
2be6011069 | ||
|
|
fcf99c9bc2 | ||
|
|
ecc6cb5596 | ||
|
|
25df6b799a | ||
|
|
9a59fbada7 | ||
|
|
05582e9586 | ||
|
|
9dca9e4f8b | ||
|
|
e4eb2d2aaf | ||
|
|
7980f1c999 | ||
|
|
0479fdb0a2 | ||
|
|
e2e4403869 | ||
|
|
00ea5d3de0 | ||
|
|
bc10246d05 | ||
|
|
aa1ccad714 | ||
|
|
b011d6e188 | ||
|
|
db220e7af5 | ||
|
|
34cf1fdd76 | ||
|
|
f875597c0b | ||
|
|
581b61bef1 | ||
|
|
433ad9d59d | ||
|
|
66819a34fa | ||
|
|
b0e9f31474 | ||
|
|
65f7de8f64 | ||
|
|
6ab9ba3284 | ||
|
|
31480a902b | ||
|
|
b8a80f9311 | ||
|
|
3a2d9c8610 | ||
|
|
f03ad00466 | ||
|
|
e6697c32c4 | ||
|
|
1add34b451 | ||
|
|
fc4aa96cd7 | ||
|
|
eb09519a26 | ||
|
|
9ebe383beb | ||
|
|
0a4b29e1c4 | ||
|
|
f23f2e61f5 | ||
|
|
5715233fb0 | ||
|
|
a47f3cb0e5 | ||
|
|
ac32161711 | ||
|
|
2f4ff66c43 | ||
|
|
b4733e043c | ||
|
|
9bb9d4d36e | ||
|
|
2cedcfece2 | ||
|
|
4047de82bd | ||
|
|
8ec1784e41 | ||
|
|
a944c82d86 | ||
|
|
03c1521cde | ||
|
|
f49552f6b7 | ||
|
|
9d6f84c3a0 | ||
|
|
3336943ff2 | ||
|
|
d48f2507b5 | ||
|
|
ddbb7ee1f4 | ||
|
|
b6383399aa | ||
|
|
8f577b0754 | ||
|
|
6f3677a322 | ||
|
|
c8957a9184 | ||
|
|
82492dc023 | ||
|
|
bb95f139a8 | ||
|
|
13d01a7010 | ||
|
|
7a0d388073 | ||
|
|
86e690a064 | ||
|
|
ec5c4ebf6b | ||
|
|
39f35bbaab | ||
|
|
16779be162 | ||
|
|
c9ca35ebd1 | ||
|
|
ce37a855ce | ||
|
|
1ded1bd52a | ||
|
|
d21bb1e6b1 | ||
|
|
7ebb5f7d92 | ||
|
|
fdbe4051f1 | ||
|
|
c1d6ad90b3 | ||
|
|
43cb9c30b2 | ||
|
|
c01baf1223 | ||
|
|
4f949bea29 | ||
|
|
983f707553 | ||
|
|
9c60474953 | ||
|
|
d2b766f9f4 | ||
|
|
f36dea5be7 | ||
|
|
ac80d4057d | ||
|
|
3dd160c663 | ||
|
|
36bd63c1a7 | ||
|
|
a05132d26e | ||
|
|
10a10f459c | ||
|
|
a07a77e323 | ||
|
|
f5458b4337 | ||
|
|
9f17e56923 | ||
|
|
25958c241b | ||
|
|
ed6e3fe8a0 | ||
|
|
6903acfe1c | ||
|
|
0671f75417 | ||
|
|
0fe844aa00 | ||
|
|
54a974cb5c | ||
|
|
d14e4dbaba | ||
|
|
f9ed1592e1 | ||
|
|
c3997194b2 | ||
|
|
fd4a19855d | ||
|
|
1fd9f5e1fb | ||
|
|
6aa26e0f62 | ||
|
|
29f07d3e89 | ||
|
|
55c0a99bce | ||
|
|
487b5b25db | ||
|
|
31818e8816 | ||
|
|
a90ec7a8c7 | ||
|
|
3a2f44adac | ||
|
|
380b61a0e9 | ||
|
|
edb79de54e | ||
|
|
1886e68731 | ||
|
|
307c06dfc3 | ||
|
|
32a453e8e6 | ||
|
|
f185a09693 | ||
|
|
8d5c853267 | ||
|
|
13787881d4 | ||
|
|
e82aa97d0e | ||
|
|
c42b48636a | ||
|
|
762dd8030e | ||
|
|
7476a3c8ae | ||
|
|
e802ff3385 | ||
|
|
5e71ff816f | ||
|
|
351c416ed8 | ||
|
|
721534d676 | ||
|
|
f408c886b6 | ||
|
|
3d8c5b377b | ||
|
|
46e330f749 | ||
|
|
7a8a95c815 | ||
|
|
4ea78d20f0 | ||
|
|
749f8cf252 | ||
|
|
94f14f529b | ||
|
|
bcba4a1a38 | ||
|
|
ac58fd91af | ||
|
|
eb2ea07c76 | ||
|
|
5898d27609 | ||
|
|
5553be4aa9 | ||
|
|
2c2bb366bd | ||
|
|
cb7cd3baaf | ||
|
|
1559c45a61 | ||
|
|
70e6c2d41f | ||
|
|
decbda3e23 | ||
|
|
a9354e5f27 | ||
|
|
8ab0ad3b72 | ||
|
|
03aa8343fd | ||
|
|
62a668d899 | ||
|
|
a583fd7a3b | ||
|
|
dba777c57b | ||
|
|
1856b5cfb8 | ||
|
|
913df73ed9 | ||
|
|
41832a0c26 | ||
|
|
dc605c915a | ||
|
|
76a53dfb7d | ||
|
|
2c1477ecea | ||
|
|
5c76229cdf | ||
|
|
3bb1756a13 | ||
|
|
37d158f159 | ||
|
|
6585431849 | ||
|
|
fba7d73052 | ||
|
|
71d8a81751 | ||
|
|
7f8d4deb59 | ||
|
|
e6cdcfca00 | ||
|
|
8ee838c9c4 | ||
|
|
b21998d506 | ||
|
|
358616cda2 | ||
|
|
680c48d90a | ||
|
|
005a40c105 | ||
|
|
9cfc8d4095 | ||
|
|
4002ec9fd5 | ||
|
|
206335bc56 | ||
|
|
983efdd6ee | ||
|
|
71e368aa83 | ||
|
|
eb62c1eb0d | ||
|
|
2aae4ea6ea | ||
|
|
212f200454 | ||
|
|
466dfc85a3 | ||
|
|
53137e53fe | ||
|
|
a4edaf4f43 | ||
|
|
c635baa848 | ||
|
|
157b17b6d5 | ||
|
|
ecab8d874b | ||
|
|
7dc55daf38 | ||
|
|
85f9da7718 | ||
|
|
fd09a3d35e | ||
|
|
e4a5302f51 | ||
|
|
9694a00179 | ||
|
|
477b9c8338 | ||
|
|
40fa816b99 | ||
|
|
1b352768c2 | ||
|
|
064f38b89e | ||
|
|
f07c741176 | ||
|
|
d986247e0f | ||
|
|
ec503d08f6 | ||
|
|
97679a7309 | ||
|
|
b642a3a602 | ||
|
|
c953ae2a3d | ||
|
|
98f376faa2 | ||
|
|
3c81346756 | ||
|
|
31888b0b1d | ||
|
|
a277a6f190 | ||
|
|
5f861c1067 | ||
|
|
98599b0bbf | ||
|
|
7dd06a1ae6 | ||
|
|
6e00d7fee3 | ||
|
|
003045525f | ||
|
|
3e28f22bad | ||
|
|
c5850d29e7 | ||
|
|
83a8fcb7f9 | ||
|
|
374a6d7783 | ||
|
|
82052450a6 | ||
|
|
b9e362833f | ||
|
|
bbd3734a21 | ||
|
|
635157be4c | ||
|
|
e297b64722 | ||
|
|
c9c8079c3d | ||
|
|
45028de51f | ||
|
|
c16489a3c0 | ||
|
|
b2fbef4a91 | ||
|
|
cdcbf58ca8 | ||
|
|
9cc2a74221 | ||
|
|
7e2b41402e | ||
|
|
a9beeec0b3 | ||
|
|
8ce5ed0192 | ||
|
|
46a8041143 | ||
|
|
cb4e0233b9 | ||
|
|
24cad7cfdf | ||
|
|
a2133f391f | ||
|
|
43942e6ea2 | ||
|
|
30b4d9e2e5 | ||
|
|
b777ec79f2 | ||
|
|
b97135240c | ||
|
|
ab8341cc8b | ||
|
|
da1d4d80f2 | ||
|
|
9e44eb0d15 | ||
|
|
5535a126d2 | ||
|
|
f9d29bbe25 | ||
|
|
84fa65ac19 | ||
|
|
99a501fcfb | ||
|
|
792da7f56d | ||
|
|
9948b6d4d9 | ||
|
|
66b8cfe9fd | ||
|
|
bf08407222 | ||
|
|
6d14710e18 | ||
|
|
0aaedcc68c | ||
|
|
594ecf400b | ||
|
|
4843e3f254 | ||
|
|
07e81830d1 | ||
|
|
2bfbf0f6a7 | ||
|
|
1e1028605d | ||
|
|
dcb14db10d | ||
|
|
3c10a32193 | ||
|
|
293560f9c1 | ||
|
|
22b4a150a4 | ||
|
|
39bd9a69ec | ||
|
|
b4ed0a1e12 | ||
|
|
bdead24e2e | ||
|
|
081d3f0814 | ||
|
|
b2776a62d8 | ||
|
|
1307b93d55 | ||
|
|
4875509b56 | ||
|
|
d66bc10d05 | ||
|
|
574f84bb84 | ||
|
|
77c320a092 | ||
|
|
6caa3408ed | ||
|
|
d53a238b49 | ||
|
|
ae7f49b5d8 | ||
|
|
c187f95269 | ||
|
|
eb2d85ab78 | ||
|
|
3542364da8 | ||
|
|
d08857d2c6 | ||
|
|
590fcf8399 | ||
|
|
499eedffa1 | ||
|
|
0ef963604f | ||
|
|
3c79f3acb5 | ||
|
|
4d624fd875 | ||
|
|
f7e5898b4a | ||
|
|
e9765c5190 | ||
|
|
098dc08169 | ||
|
|
94eeaf9ed0 | ||
|
|
be19a999f5 | ||
|
|
8fb9a55d8a | ||
|
|
1fdbcf4c0f | ||
|
|
0fae7ecd5a | ||
|
|
9901aaa9fe | ||
|
|
23aea440d6 | ||
|
|
e1773249c3 | ||
|
|
0eded9a8b7 | ||
|
|
3f5d67d4d6 | ||
|
|
0d1d68d5d9 | ||
|
|
876722733a | ||
|
|
74e00c4d80 | ||
|
|
dbf96b8f59 | ||
|
|
08846da2d3 | ||
|
|
10b231bd9d | ||
|
|
fc401a9c68 | ||
|
|
ac44aa6d81 | ||
|
|
e50bbb05fa | ||
|
|
54aa8696ad | ||
|
|
2644eb064e | ||
|
|
9d3bd9d36f | ||
|
|
0e7da2cd22 | ||
|
|
06ee3b0d1c | ||
|
|
be3a6afb2a | ||
|
|
c4b96ee232 | ||
|
|
0988a2f173 | ||
|
|
d1ef145a6d | ||
|
|
eb71e987c8 | ||
|
|
3d57a457eb | ||
|
|
f762c98a37 | ||
|
|
2fd3aa54f5 | ||
|
|
a37b1fb6c1 | ||
|
|
e0db9a8ca7 | ||
|
|
4ece746437 | ||
|
|
47bf442c84 | ||
|
|
b3d5f40f37 | ||
|
|
27785323ae | ||
|
|
12e919b99d | ||
|
|
8d9ec4f755 | ||
|
|
58a0cb5838 | ||
|
|
3e15ae3da7 | ||
|
|
c36d4b9894 | ||
|
|
394e284a4a | ||
|
|
6830fdca98 | ||
|
|
321933f267 | ||
|
|
60b8582aa9 | ||
|
|
9fd48df839 | ||
|
|
73e6663230 | ||
|
|
c5db333af8 | ||
|
|
99c73cf11a | ||
|
|
7728576f19 | ||
|
|
a321ab5f31 | ||
|
|
d8e394d3aa | ||
|
|
c750ba8b99 | ||
|
|
929904041d | ||
|
|
534e2b1282 | ||
|
|
c9ce955505 | ||
|
|
5c6ecf9aeb | ||
|
|
209990fd15 | ||
|
|
7fdd6ccbd2 | ||
|
|
cca7967144 | ||
|
|
8b4aa701d7 | ||
|
|
6766c33110 | ||
|
|
da7a4a9283 | ||
|
|
54b433ff6b | ||
|
|
8f3ce46c50 | ||
|
|
2c4c48ad6f | ||
|
|
21a648a052 | ||
|
|
d32fd7aa11 | ||
|
|
c2dc140024 | ||
|
|
7376170f01 | ||
|
|
2777c4d4a5 | ||
|
|
1f1c75adfb | ||
|
|
2cebeb72aa | ||
|
|
ecab7cb70e | ||
|
|
d2e4888bdd | ||
|
|
e4dd020887 | ||
|
|
af407a094a | ||
|
|
56b3f2c011 | ||
|
|
530d3503f5 | ||
|
|
9f0528f5f1 | ||
|
|
cb21ad2cc5 | ||
|
|
3992a92dd4 | ||
|
|
43d18cd70c | ||
|
|
4dd740fe2f | ||
|
|
337509d40f | ||
|
|
c11888bcde | ||
|
|
76195f9e45 | ||
|
|
d2d0e66c5c | ||
|
|
71d2ee3aa9 | ||
|
|
4ac7460b26 | ||
|
|
24914e8e4f | ||
|
|
5187ffcc9a | ||
|
|
4e86e59fb3 | ||
|
|
7600a10f2d | ||
|
|
7077b4931c | ||
|
|
5520864970 | ||
|
|
9d7db152ef | ||
|
|
568277433f | ||
|
|
0c84a0f9af | ||
|
|
eb6620f6f6 | ||
|
|
9c9aca979b | ||
|
|
04ed2df827 | ||
|
|
6c4f15df63 | ||
|
|
9d1d010413 | ||
|
|
2af54199da | ||
|
|
1c71eed703 | ||
|
|
add55e8764 | ||
|
|
bdf4fb587f | ||
|
|
7915021495 | ||
|
|
c62a2fb97e | ||
|
|
43b402f608 | ||
|
|
5233c65aba | ||
|
|
4a39c79d56 | ||
|
|
5c4ab99a9a | ||
|
|
6e30831611 | ||
|
|
34cc4b3db5 | ||
|
|
c74cdaf890 | ||
|
|
4296a2802c | ||
|
|
3abbb2a3e5 | ||
|
|
b7babb8a48 | ||
|
|
5c6a1bece0 | ||
|
|
5ed041c0cd | ||
|
|
6503d4db21 | ||
|
|
31fad0a610 | ||
|
|
37d734387b | ||
|
|
6964f196c8 | ||
|
|
083aa63fb4 | ||
|
|
aacfa33012 | ||
|
|
df019b255f | ||
|
|
11d9d5096e | ||
|
|
b5712d1f1c | ||
|
|
f800e38099 | ||
|
|
2a61b360e9 | ||
|
|
74c463fd21 | ||
|
|
caa71b4463 | ||
|
|
0c5f66f10d | ||
|
|
ca113553c6 | ||
|
|
871c69ad08 | ||
|
|
6fa84206aa | ||
|
|
2dcb97e61d | ||
|
|
0547c91d75 | ||
|
|
9adc994e21 | ||
|
|
a4e424ee0e | ||
|
|
1e6196dc4a | ||
|
|
224bd12065 | ||
|
|
372f50bbde | ||
|
|
c6293db23c | ||
|
|
190f432c23 | ||
|
|
4969af8c74 | ||
|
|
95d8faef04 | ||
|
|
ac41b61ad8 | ||
|
|
7fd75c793a | ||
|
|
aa2d783aaa | ||
|
|
0302e8c1f8 | ||
|
|
c1ec3d9b73 | ||
|
|
144743df6d | ||
|
|
aa3bfb06cd | ||
|
|
e7bc4bc70c | ||
|
|
9b436ce871 | ||
|
|
d6083cccb8 | ||
|
|
a4a47a064c | ||
|
|
f7524b93ad | ||
|
|
b42a2616bc | ||
|
|
859a9cadcb | ||
|
|
7d5c708043 | ||
|
|
4e75f064fe | ||
|
|
2802be2ed5 | ||
|
|
3d2143809b | ||
|
|
177ec97689 | ||
|
|
d426ab04f0 | ||
|
|
707ca379c9 | ||
|
|
b645a50742 | ||
|
|
3befe1b83f | ||
|
|
f2eb73a101 | ||
|
|
5bc3107c5d | ||
|
|
35107f1dbf | ||
|
|
56aafa4660 | ||
|
|
3fc8e2cf4c | ||
|
|
6e9d6b4e49 | ||
|
|
0f2963d05b | ||
|
|
f70c4e4d23 | ||
|
|
d5128a1889 | ||
|
|
f321d4a77d | ||
|
|
09520d814a | ||
|
|
5a35588b63 | ||
|
|
5120093872 | ||
|
|
8589f077c0 | ||
|
|
466f89930e | ||
|
|
194639c30e | ||
|
|
5a2b8ff53c | ||
|
|
3ab23ecb7e | ||
|
|
31fcf9aff9 | ||
|
|
85f532f0be | ||
|
|
7c82b18da0 | ||
|
|
d1a41c50d0 | ||
|
|
9f045eb996 | ||
|
|
f21344eee0 | ||
|
|
0486815403 | ||
|
|
0ed8f2d1ab | ||
|
|
b23667b2e6 | ||
|
|
14ce1bf3a6 | ||
|
|
1f48e0486f | ||
|
|
896fbfe2ca | ||
|
|
2dda1d7c74 | ||
|
|
4f86bb0e5b | ||
|
|
653eb4d907 | ||
|
|
d310fb71a1 | ||
|
|
bc2c794484 | ||
|
|
6474591e25 | ||
|
|
b74071dc73 | ||
|
|
518049bed4 | ||
|
|
3131ef7b86 | ||
|
|
cdba7cfa1c | ||
|
|
1eb67484dd | ||
|
|
7716d66ea9 | ||
|
|
b1d5f2689a | ||
|
|
eb8f89119f | ||
|
|
a750007155 | ||
|
|
a3b070d641 | ||
|
|
542499d94e | ||
|
|
bc189c0f6a | ||
|
|
198bef1bb5 | ||
|
|
99542de935 | ||
|
|
f49d332b73 | ||
|
|
46d84f8f11 | ||
|
|
97e21cb775 | ||
|
|
829ff2299e | ||
|
|
08f27a5c28 | ||
|
|
0f0db5a3fb | ||
|
|
45783e6bc5 | ||
|
|
a45915e4a0 | ||
|
|
668937d7c9 | ||
|
|
239e42faa0 | ||
|
|
7a8ac224ed | ||
|
|
79d6fa334b | ||
|
|
863e569593 | ||
|
|
c2bee0f937 | ||
|
|
6dfeaabad5 | ||
|
|
e4ded18477 | ||
|
|
edef8f883b | ||
|
|
1dcecf4873 | ||
|
|
5f704fe5e5 | ||
|
|
d18adc1231 | ||
|
|
e5418a7624 | ||
|
|
c4b9692575 | ||
|
|
51d5de2e22 | ||
|
|
f995768f24 | ||
|
|
578cab9a70 | ||
|
|
5b9acef10c | ||
|
|
e6411dd246 | ||
|
|
34b4d0225e | ||
|
|
92863b1081 | ||
|
|
f45d9b3b4c | ||
|
|
8955f0bce5 | ||
|
|
a950eb399c | ||
|
|
7167c35087 | ||
|
|
142aedc0cd | ||
|
|
de62e4cdb8 | ||
|
|
8b275c6e5c | ||
|
|
bd002656cd | ||
|
|
f68d956eaa | ||
|
|
e020a859f0 |
@@ -12,6 +12,7 @@ php:
|
||||
- '5.5'
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
- nightly
|
||||
|
||||
addons:
|
||||
@@ -50,6 +51,7 @@ env:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: 7.1
|
||||
- php: nightly
|
||||
# FIXME
|
||||
#- env: DB=postgresql
|
||||
@@ -96,7 +98,7 @@ install:
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
||||
composer -n require phpunit/phpunit ^4
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
composer -n require phpunit/phpunit ^5
|
||||
fi
|
||||
echo
|
||||
@@ -136,7 +138,7 @@ before_script:
|
||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
echo
|
||||
echo "Enabling Memcached for PHP <= 5.4"
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1 and nightly!
|
||||
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
fi
|
||||
phpenv rehash
|
||||
@@ -208,7 +210,7 @@ before_script:
|
||||
echo "Setting up Apache + FPM"
|
||||
# enable php-fpm
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# Copy the included pool
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
|
||||
199
ChangeLog
199
ChangeLog
@@ -2,15 +2,6 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
WARNING:
|
||||
|
||||
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
|
||||
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
|
||||
You may also experience troubles with Mysql 5.5.41/42/43 with error "Lost connection" during
|
||||
migration.
|
||||
Upgrading to any other version or any other database system is abolutely required BEFORE trying
|
||||
make a Dolibarr upgrade.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 5.0.0 compared to 4.0.* *****
|
||||
@@ -159,7 +150,76 @@ Dolibarr better:
|
||||
- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters,
|
||||
no more required, were also removed. Use this new one if you were using one of them.
|
||||
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
||||
- Method commande->set_availability(user, availability_id) removed from commande class, use method commande->availability(availability_id, notrigger).
|
||||
|
||||
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
|
||||
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||
|
||||
|
||||
***** ChangeLog for 4.0.4 to 4.0.3 *****
|
||||
FIX: #6227 Document models table header "Unit" is shown in 2 lines in Spanish
|
||||
FIX: #6230
|
||||
FIX: #6237
|
||||
FIX: #6245 Thirdparty link in supplier invoices list, links to "comm/card" instead of "fourn/card" page
|
||||
FIX: #6253 Supplier invoice list filter does not respect "thirdparty" filter
|
||||
FIX: #6277
|
||||
FIX: project list and ajax completion return wrong list.
|
||||
FIX: bug margin calculation by user with multicompany
|
||||
FIX: Can make a stock transfert on product not on sale/purchase.
|
||||
FIX: extrafield input for varchar was not working with special char within (ie double quotes)
|
||||
FIX: javascript error
|
||||
FIX: link for not found photo when using gravatar. Must use external url.
|
||||
FIX: Protection so even if link is output for external user, links is disabled.
|
||||
FIX: repair tool was ko to restore extrafields with type select.
|
||||
FIX: Security access problem with external users on projects/tasks
|
||||
FIX: We must not drop extrafield column if there is still record on other entities.
|
||||
FIX: regression with sedning email when introducing security options to restrict nb of email sending.
|
||||
t
|
||||
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||
FIX: #5958 no discount on supplier command made by replenishment
|
||||
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||
FIX: #5972 #5734
|
||||
FIX: #6007
|
||||
FIX: #6010
|
||||
FIX: #6029
|
||||
FIX: #6043 - Payment mode not visible on supplier invoice list
|
||||
FIX: #6051
|
||||
FIX: #6062
|
||||
FIX: #6088
|
||||
FIX: A draft can be deleted by a user with create permission.
|
||||
FIX: bad permission to see contract on home page
|
||||
FIX: bad permission to see contract statistics
|
||||
FIX: Bcc must not appears to recipient when using SMTPs lib
|
||||
FIX: Consistent description for add or edit product
|
||||
FIX: delete contract extrafields on contract deletion
|
||||
FIX: Deposits and credit notes weren't added in the received and pending columns
|
||||
FIX: export extrafields must not include separe type
|
||||
FIX: Export of opportunity status must be code, not id.
|
||||
FIX: False positive on services not activated
|
||||
FIX: Filter was wrong or lost during navigation
|
||||
FIX: HT and TTC price should always be displayed together
|
||||
FIX: if a supplier price reference is changed after creating an order, we can't clone order.
|
||||
FIX: in export. Error when using a separate extrafields.
|
||||
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||
FIX: javascript error when using on mobile/smartphone
|
||||
FIX: javascript xss injection and a translation
|
||||
FIX: Label of project is in field title not label.
|
||||
FIX: List of people able to validate an expense report was not complete.
|
||||
FIX: Missing field
|
||||
FIX: Module gravatar was not triggered on thirdparty and contact card
|
||||
FIX: Must use external link into a forged email content.
|
||||
FIX: Pb in management of date end of projects
|
||||
FIX: Regression when deleting product
|
||||
FIX: rendering of output of estimated amount on project overview page.
|
||||
FIX: Sanitize title of ajax_dialog
|
||||
FIX: Security to restrict email sending was not efficient
|
||||
FIX: Setting supplier as client when accept a supplier proposal
|
||||
FIX: Some statistics not compatible with multicompany module.
|
||||
FIX: the time spent on project was not visible in its overwiew
|
||||
FIX: Update intervention lline crash with PgSQL
|
||||
FIX: wrong test on dict.php
|
||||
FIX: wrong var name
|
||||
|
||||
***** ChangeLog for 4.0.2 compared to 4.0.1 *****
|
||||
FIX: #5340
|
||||
@@ -258,12 +318,12 @@ NEW: Add the admin info on combo of type of contact
|
||||
NEW: Add the event BILL_PAYED to the list of supported events for module notification.
|
||||
NEW: Add total weight and volume on PDF.
|
||||
NEW: Add hidden option to hide column qty ordered on shipments.
|
||||
NEW: Add view of virtual stock into product list (when appropriate).
|
||||
NEW: Add warning on tasks when they are late (add also the warning tolerance parameter).
|
||||
NEW: Add weight/volume for one product into shipment export.
|
||||
NEW: Add width and height on product card
|
||||
NEW: allow a document to be linked to project of another customer by config setup.
|
||||
NEW: allow project to be shared across entities (for multicompany module).
|
||||
NEW: Add view of virtual stock into product list (when appropriate)
|
||||
NEW: Add warning on tasks when they are late (add also the warning tolerance parameter)
|
||||
NEW: Add weight/volume for one product into shipment export
|
||||
NEW: Add width and height on product table
|
||||
NEW: allow a document to be linked to project from another customer on config
|
||||
NEW: allow project to be shared across entities (for multicompany module)
|
||||
NEW: All variant of ckeditor config can be tested into the setup page of module.
|
||||
NEW: Can change dynamically number of records visible into lists.
|
||||
NEW: Can change type of extrafields (for some combinations only).
|
||||
@@ -366,6 +426,115 @@ So if you included it into your module, change your code like this to be compati
|
||||
if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||
FIX: #2853
|
||||
FIX: #3128
|
||||
FIX: #4447
|
||||
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||
FIX: #5340
|
||||
FIX: #5473
|
||||
FIX: #5474 Country_id of "Don" object is still empty
|
||||
FIX: #5534
|
||||
FIX: #5535 bad dependency.
|
||||
FIX: #5537 AJAX project search does not work properly
|
||||
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||
FIX: #5568
|
||||
FIX: #5594
|
||||
FIX: #5629 PgSQL Interger string stylish error
|
||||
FIX: #5651
|
||||
FIX: #5660
|
||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||
FIX: #5907
|
||||
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||
FIX: #6051
|
||||
FIX: #6088
|
||||
FIX: Can correct stock of lot using eatby or sell by date
|
||||
FIX: Can make a movement on "out of sell" products
|
||||
FIX: cannot update bank account on invoice if module order not activated
|
||||
FIX: Can't create withdrawal document
|
||||
FIX: delete contract extrafields on contract deletion
|
||||
FIX: Direction of movement lost if an error occurs
|
||||
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||
FIX: export extrafields must not include separe type
|
||||
FIX: External user must not be able to edit its discounts
|
||||
FIX: Failed to export contact categories with contact extra fields
|
||||
FIX: header title in commercial area
|
||||
FIX: HT and TTC price should always be displayed together
|
||||
FIX: incoterms
|
||||
FIX: incoterms do not output into crabe invoice PDF
|
||||
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||
FIX: margin tab on customer card must filter on current entity invoices
|
||||
FIX: missing column into SQL on thridparty list
|
||||
FIX: only show projects of related third if external user
|
||||
FIX: PgSQL Module Ressource list crash #5637
|
||||
FIX: php Strict
|
||||
FIX: Regression when deleting product
|
||||
FIX: Security to restrict email sending was not efficient
|
||||
FIX: tag for date rfc in odt substitution
|
||||
FIX: Update intervention lline crash with PgSQL
|
||||
FIX: update limit stock on product stock
|
||||
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||
FIX: wrong test on dict.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||
FIX: #2853
|
||||
FIX: #3128
|
||||
FIX: #4447
|
||||
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||
FIX: #5340
|
||||
FIX: #5473
|
||||
FIX: #5474 Country_id of "Don" object is still empty
|
||||
FIX: #5534
|
||||
FIX: #5535 bad dependency.
|
||||
FIX: #5537 AJAX project search does not work properly
|
||||
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||
FIX: #5568
|
||||
FIX: #5594
|
||||
FIX: #5629 PgSQL Interger string stylish error
|
||||
FIX: #5651
|
||||
FIX: #5660
|
||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||
FIX: #5907
|
||||
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||
FIX: #6051
|
||||
FIX: #6088
|
||||
FIX: Can correct stock of lot using eatby or sell by date
|
||||
FIX: Can make a movement on "out of sell" products
|
||||
FIX: cannot update bank account on invoice if module order not activated
|
||||
FIX: Can't create withdrawal document
|
||||
FIX: delete contract extrafields on contract deletion
|
||||
FIX: Direction of movement lost if an error occurs
|
||||
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||
FIX: export extrafields must not include separe type
|
||||
FIX: External user must not be able to edit its discounts
|
||||
FIX: Failed to export contact categories with contact extra fields
|
||||
FIX: header title in commercial area
|
||||
FIX: HT and TTC price should always be displayed together
|
||||
FIX: incoterms
|
||||
FIX: incoterms do not output into crabe invoice PDF
|
||||
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||
FIX: margin tab on customer card must filter on current entity invoices
|
||||
FIX: missing column into SQL on thridparty list
|
||||
FIX: only show projects of related third if external user
|
||||
FIX: PgSQL Module Ressource list crash #5637
|
||||
FIX: php Strict
|
||||
FIX: Regression when deleting product
|
||||
FIX: Security to restrict email sending was not efficient
|
||||
FIX: tag for date rfc in odt substitution
|
||||
FIX: Update intervention lline crash with PgSQL
|
||||
FIX: update limit stock on product stock
|
||||
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||
FIX: wrong test on dict.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.9.3 compared to 3.9.2 *****
|
||||
FIX: #4383 $userid not defined
|
||||
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||
|
||||
19
README-FR.md
19
README-FR.md
@@ -54,19 +54,10 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
|
||||
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
|
||||
fournis dans ce nouveau package.
|
||||
|
||||
- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
|
||||
il n'y a pas besoin de migration de données.
|
||||
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
|
||||
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||
|
||||
- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
|
||||
ou y varient, vous devez appelez la page "install/" de migration dans votre
|
||||
navigateur (ceci doit se faire automatiquement au premier accès de l'application).
|
||||
Ce sera une URL du genre:
|
||||
http://localhost/dolibarr/htdocs/install/index.php
|
||||
ou
|
||||
http://yourdolibarrhost/install/index.php
|
||||
|
||||
Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
|
||||
Note: Le processus de migration peut etre lance plusieurs fois sans risque.
|
||||
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||
|
||||
|
||||
## CE QUI EST NOUVEAU
|
||||
@@ -86,11 +77,13 @@ Voir fichier ChangeLog.
|
||||
- Gestion des factures clients/fournisseurs et paiements
|
||||
- Gestion des virements bancaires SEPA
|
||||
- Gestion des comptes bancaires
|
||||
- Agenda partagé
|
||||
- Calendrier/Agenda partagé (avec export ical, vcal)
|
||||
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
||||
- Gestion de contrats de services
|
||||
- Gestion de stock
|
||||
- Gestion des expéditions
|
||||
- Gestion des demandes de congès
|
||||
- Gestion des notes de frais
|
||||
- GED (Gestion Electronique de Documents)
|
||||
- EMailings de masse
|
||||
- Réalisation de sondages
|
||||
|
||||
12
README.md
12
README.md
@@ -60,10 +60,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql)
|
||||
## UPGRADING
|
||||
|
||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
|
||||
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
|
||||
- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
|
||||
If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").
|
||||
|
||||
*Note: migration process can safely be done multiple times.*
|
||||
*Note: migration process can safely be done multiple times by calling the page /install/index.php*
|
||||
|
||||
## WHAT'S NEW
|
||||
|
||||
@@ -80,17 +80,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Invoices and payment management
|
||||
- Standing orders management (European SEPA)
|
||||
- Bank accounts management
|
||||
- Shared calendar
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
||||
- Projects management
|
||||
- Contracts management
|
||||
- Stock management
|
||||
- Shipping management
|
||||
- Interventions management
|
||||
- Agenda with ical and vcal export for third party tools integration
|
||||
- Employee's leave requests management
|
||||
- Expense report management
|
||||
- Electronic Document Management (EDM)
|
||||
- Foundations members management
|
||||
- Employee's holidays management
|
||||
- Mass emailing
|
||||
- Surveys
|
||||
- Point of Sale
|
||||
|
||||
@@ -221,7 +221,13 @@ $dolibarr_main_prod='0';
|
||||
# $dolibarr_main_limit_users='0';
|
||||
|
||||
# dolibarr_mailing_limit_sendbyweb
|
||||
# Can set a limit for mailing send by web, can be used for a restricted mode.
|
||||
# Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
|
||||
# Default value: 0 (use database value if exist)
|
||||
# Examples:
|
||||
# $dolibarr_mailing_limit_sendbyweb='0';
|
||||
|
||||
# dolibarr_mailing_limit_sendbycli
|
||||
# Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
|
||||
# Default value: 0 (use database value if exist)
|
||||
# Examples:
|
||||
# $dolibarr_mailing_limit_sendbycli='0';
|
||||
|
||||
@@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
||||
# Misc dependencies
|
||||
# fonts-dejavu-core | ttf-dejavu-core,
|
||||
xdg-utils,
|
||||
virtual-mysql-client,
|
||||
mariadb-client | virtual-mysql-client,
|
||||
${misc:Depends},
|
||||
${perl:Depends}
|
||||
Recommends: apache2 | lighttpd | httpd,
|
||||
virtual-mysql-server
|
||||
mariadb-server | virtual-mysql-server
|
||||
Suggests: www-browser, php5-geoip
|
||||
Description: Web based software to manage a company or foundation
|
||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||
|
||||
22
build/generate_filelist_xml.php
Normal file → Executable file
22
build/generate_filelist_xml.php
Normal file → Executable file
@@ -65,6 +65,8 @@ fputs($fp, '<checksum_list version="'.$release.'">'."\n");
|
||||
|
||||
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||
// need to ignore document custom etc
|
||||
@@ -81,12 +83,22 @@ foreach ($files as $file) {
|
||||
$needtoclose=1;
|
||||
}
|
||||
if (filetype($file)=="file") {
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
|
||||
$md5=md5_file($file);
|
||||
$checksumconcat[]=$md5;
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
//var_dump($checksumconcat);
|
||||
fputs($fp, '<dolibarr_htdocs_dir_checksum>'."\n");
|
||||
fputs($fp, md5(join(',',$checksumconcat))."\n");
|
||||
fputs($fp, '</dolibarr_htdocs_dir_checksum>'."\n");
|
||||
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
||||
|
||||
@@ -106,12 +118,18 @@ foreach ($files as $file) {
|
||||
$needtoclose=1;
|
||||
}
|
||||
if (filetype($file)=="file") {
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
|
||||
$md5=md5_file($file);
|
||||
$checksumconcat[]=$md5;
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, '</dolibarr_script_dir>'."\n");
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
fputs($fp, '<dolibarr_script_dir_checksum>'."\n");
|
||||
fputs($fp, md5(join(',',$checksumconcat))."\n");
|
||||
fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
|
||||
|
||||
fputs($fp, '</checksum_list>'."\n");
|
||||
fclose($fp);
|
||||
|
||||
@@ -41,8 +41,59 @@ require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
* Parameters
|
||||
*/
|
||||
|
||||
define(GEN_NUMBER_FACTURE, 5);
|
||||
|
||||
define(GEN_NUMBER_FACTURE, 1);
|
||||
$year = 2016;
|
||||
$dates = array (mktime(12,0,0,1,3,$year),
|
||||
mktime(12,0,0,1,9,$year),
|
||||
mktime(12,0,0,2,13,$year),
|
||||
mktime(12,0,0,2,23,$year),
|
||||
mktime(12,0,0,3,30,$year),
|
||||
mktime(12,0,0,4,3,$year),
|
||||
mktime(12,0,0,4,3,$year),
|
||||
mktime(12,0,0,5,9,$year),
|
||||
mktime(12,0,0,5,1,$year),
|
||||
mktime(12,0,0,5,13,$year),
|
||||
mktime(12,0,0,5,19,$year),
|
||||
mktime(12,0,0,5,23,$year),
|
||||
mktime(12,0,0,6,3,$year),
|
||||
mktime(12,0,0,6,19,$year),
|
||||
mktime(12,0,0,6,24,$year),
|
||||
mktime(12,0,0,7,3,$year),
|
||||
mktime(12,0,0,7,9,$year),
|
||||
mktime(12,0,0,7,23,$year),
|
||||
mktime(12,0,0,7,30,$year),
|
||||
mktime(12,0,0,8,9,$year),
|
||||
mktime(12,0,0,9,23,$year),
|
||||
mktime(12,0,0,10,3,$year),
|
||||
mktime(12,0,0,11,12,$year),
|
||||
mktime(12,0,0,11,13,$year),
|
||||
mktime(12,0,0,1,3,($year - 1)),
|
||||
mktime(12,0,0,1,9,($year - 1)),
|
||||
mktime(12,0,0,2,13,($year - 1)),
|
||||
mktime(12,0,0,2,23,($year - 1)),
|
||||
mktime(12,0,0,3,30,($year - 1)),
|
||||
mktime(12,0,0,4,3,($year - 1)),
|
||||
mktime(12,0,0,4,3,($year - 1)),
|
||||
mktime(12,0,0,5,9,($year - 1)),
|
||||
mktime(12,0,0,5,1,($year - 1)),
|
||||
mktime(12,0,0,5,13,($year - 1)),
|
||||
mktime(12,0,0,5,19,($year - 1)),
|
||||
mktime(12,0,0,5,23,($year - 1)),
|
||||
mktime(12,0,0,6,3,($year - 1)),
|
||||
mktime(12,0,0,6,19,($year - 1)),
|
||||
mktime(12,0,0,6,24,($year - 1)),
|
||||
mktime(12,0,0,7,3,($year - 1)),
|
||||
mktime(12,0,0,7,9,($year - 1)),
|
||||
mktime(12,0,0,7,23,($year - 1)),
|
||||
mktime(12,0,0,7,30,($year - 1)),
|
||||
mktime(12,0,0,8,9,($year - 1)),
|
||||
mktime(12,0,0,9,23,($year - 1)),
|
||||
mktime(12,0,0,10,3,($year - 1)),
|
||||
mktime(12,0,0,11,12,$year),
|
||||
mktime(12,0,0,11,13,$year),
|
||||
mktime(12,0,0,12,12,$year),
|
||||
mktime(12,0,0,12,13,$year),
|
||||
);
|
||||
|
||||
$ret=$user->fetch('','admin');
|
||||
if (! $ret > 0)
|
||||
@@ -54,16 +105,15 @@ $user->getrights();
|
||||
|
||||
|
||||
$socids = array();
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1";
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client in (1, 3)";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num_socs = $db->num_rows($resql);
|
||||
$num_thirdparties = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num_socs)
|
||||
while ($i < $num_thirdparties)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
$socids[$i] = $row[0];
|
||||
}
|
||||
@@ -79,7 +129,6 @@ if ($resql)
|
||||
while ($i < $num_prods)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
$prodids[$i] = $row[0];
|
||||
}
|
||||
@@ -90,46 +139,51 @@ $result=0;
|
||||
while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
||||
{
|
||||
$i++;
|
||||
$socid = mt_rand(1, $num_socs);
|
||||
$socid = mt_rand(1, $num_thirdparties);
|
||||
|
||||
print "Invoice ".$i." for socid ".$socid;
|
||||
|
||||
$facture = new Facture($db);
|
||||
$facture->date = time();
|
||||
$facture->cond_reglement_id = 3;
|
||||
$facture->mode_reglement_id = 3;
|
||||
$object = new Facture($db);
|
||||
$object->socid = $socids[$socid];
|
||||
$object->date = $dates[mt_rand(1, count($dates)-1)];
|
||||
$object->cond_reglement_id = 3;
|
||||
$object->mode_reglement_id = 3;
|
||||
|
||||
$result=$facture->create($user);
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch(mt_rand(1,2));
|
||||
$fuser->getRights();
|
||||
|
||||
$result=$object->create($fuser);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$result=$facture->validate($user);
|
||||
$nbp = mt_rand(2, 5);
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
$result=$object->validate($fuser);
|
||||
if ($result)
|
||||
{
|
||||
$nbp = mt_rand(2, 5);
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$facture->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
print " OK with ref ".$facture->ref."\n";;
|
||||
print " OK with ref ".$object->ref."\n";;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,$facture->error);
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,$facture->error);
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
|
||||
|
||||
/*
|
||||
@@ -47,7 +48,58 @@ include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
*/
|
||||
|
||||
define(GEN_NUMBER_COMMANDE, 10);
|
||||
|
||||
$year = 2016;
|
||||
$dates = array (mktime(12,0,0,1,3,$year),
|
||||
mktime(12,0,0,1,9,$year),
|
||||
mktime(12,0,0,2,13,$year),
|
||||
mktime(12,0,0,2,23,$year),
|
||||
mktime(12,0,0,3,30,$year),
|
||||
mktime(12,0,0,4,3,$year),
|
||||
mktime(12,0,0,4,3,$year),
|
||||
mktime(12,0,0,5,9,$year),
|
||||
mktime(12,0,0,5,1,$year),
|
||||
mktime(12,0,0,5,13,$year),
|
||||
mktime(12,0,0,5,19,$year),
|
||||
mktime(12,0,0,5,23,$year),
|
||||
mktime(12,0,0,6,3,$year),
|
||||
mktime(12,0,0,6,19,$year),
|
||||
mktime(12,0,0,6,24,$year),
|
||||
mktime(12,0,0,7,3,$year),
|
||||
mktime(12,0,0,7,9,$year),
|
||||
mktime(12,0,0,7,23,$year),
|
||||
mktime(12,0,0,7,30,$year),
|
||||
mktime(12,0,0,8,9,$year),
|
||||
mktime(12,0,0,9,23,$year),
|
||||
mktime(12,0,0,10,3,$year),
|
||||
mktime(12,0,0,11,12,$year),
|
||||
mktime(12,0,0,11,13,$year),
|
||||
mktime(12,0,0,1,3,($year - 1)),
|
||||
mktime(12,0,0,1,9,($year - 1)),
|
||||
mktime(12,0,0,2,13,($year - 1)),
|
||||
mktime(12,0,0,2,23,($year - 1)),
|
||||
mktime(12,0,0,3,30,($year - 1)),
|
||||
mktime(12,0,0,4,3,($year - 1)),
|
||||
mktime(12,0,0,4,3,($year - 1)),
|
||||
mktime(12,0,0,5,9,($year - 1)),
|
||||
mktime(12,0,0,5,1,($year - 1)),
|
||||
mktime(12,0,0,5,13,($year - 1)),
|
||||
mktime(12,0,0,5,19,($year - 1)),
|
||||
mktime(12,0,0,5,23,($year - 1)),
|
||||
mktime(12,0,0,6,3,($year - 1)),
|
||||
mktime(12,0,0,6,19,($year - 1)),
|
||||
mktime(12,0,0,6,24,($year - 1)),
|
||||
mktime(12,0,0,7,3,($year - 1)),
|
||||
mktime(12,0,0,7,9,($year - 1)),
|
||||
mktime(12,0,0,7,23,($year - 1)),
|
||||
mktime(12,0,0,7,30,($year - 1)),
|
||||
mktime(12,0,0,8,9,($year - 1)),
|
||||
mktime(12,0,0,9,23,($year - 1)),
|
||||
mktime(12,0,0,10,3,($year - 1)),
|
||||
mktime(12,0,0,11,12,$year),
|
||||
mktime(12,0,0,11,13,$year),
|
||||
mktime(12,0,0,12,12,$year),
|
||||
mktime(12,0,0,12,13,$year),
|
||||
);
|
||||
|
||||
$ret=$user->fetch('','admin');
|
||||
if ($ret <= 0)
|
||||
@@ -57,34 +109,34 @@ if ($ret <= 0)
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
||||
$societesid = array();
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe where client in (1, 3)";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$num_thirdparties = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
while ($i < $num_thirdparties) {
|
||||
$i++;
|
||||
$row = $db->fetch_row($resql);
|
||||
$societesid[$i] = $row[0];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else { print "err"; }
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
||||
$commandesid = array();
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
$commandesid[$i] = $row[0];
|
||||
$i++;
|
||||
$row = $db->fetch_row($resql);
|
||||
$commandesid[$i] = $row[0];
|
||||
}
|
||||
}
|
||||
else { print "err"; }
|
||||
|
||||
|
||||
$prodids = array();
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
|
||||
$resql = $db->query($sql);
|
||||
@@ -102,59 +154,6 @@ if ($resql)
|
||||
}
|
||||
|
||||
|
||||
$dates = array (mktime(12,0,0,1,3,2003),
|
||||
mktime(12,0,0,1,9,2003),
|
||||
mktime(12,0,0,2,13,2003),
|
||||
mktime(12,0,0,2,23,2003),
|
||||
mktime(12,0,0,3,30,2003),
|
||||
mktime(12,0,0,4,3,2003),
|
||||
mktime(12,0,0,4,3,2003),
|
||||
mktime(12,0,0,5,9,2003),
|
||||
mktime(12,0,0,5,1,2003),
|
||||
mktime(12,0,0,5,13,2003),
|
||||
mktime(12,0,0,5,19,2003),
|
||||
mktime(12,0,0,5,23,2003),
|
||||
mktime(12,0,0,6,3,2003),
|
||||
mktime(12,0,0,6,19,2003),
|
||||
mktime(12,0,0,6,24,2003),
|
||||
mktime(12,0,0,7,3,2003),
|
||||
mktime(12,0,0,7,9,2003),
|
||||
mktime(12,0,0,7,23,2003),
|
||||
mktime(12,0,0,7,30,2003),
|
||||
mktime(12,0,0,8,9,2003),
|
||||
mktime(12,0,0,9,23,2003),
|
||||
mktime(12,0,0,10,3,2003),
|
||||
mktime(12,0,0,11,12,2003),
|
||||
mktime(12,0,0,11,13,2003),
|
||||
mktime(12,0,0,1,3,2002),
|
||||
mktime(12,0,0,1,9,2002),
|
||||
mktime(12,0,0,2,13,2002),
|
||||
mktime(12,0,0,2,23,2002),
|
||||
mktime(12,0,0,3,30,2002),
|
||||
mktime(12,0,0,4,3,2002),
|
||||
mktime(12,0,0,4,3,2002),
|
||||
mktime(12,0,0,5,9,2002),
|
||||
mktime(12,0,0,5,1,2002),
|
||||
mktime(12,0,0,5,13,2002),
|
||||
mktime(12,0,0,5,19,2002),
|
||||
mktime(12,0,0,5,23,2002),
|
||||
mktime(12,0,0,6,3,2002),
|
||||
mktime(12,0,0,6,19,2002),
|
||||
mktime(12,0,0,6,24,2002),
|
||||
mktime(12,0,0,7,3,2002),
|
||||
mktime(12,0,0,7,9,2002),
|
||||
mktime(12,0,0,7,23,2002),
|
||||
mktime(12,0,0,7,30,2002),
|
||||
mktime(12,0,0,8,9,2002),
|
||||
mktime(12,0,0,9,23,2002),
|
||||
mktime(12,0,0,10,3,2002),
|
||||
mktime(12,0,0,11,12,2003),
|
||||
mktime(12,0,0,11,13,2003),
|
||||
mktime(12,0,0,12,12,2003),
|
||||
mktime(12,0,0,12,13,2003),
|
||||
);
|
||||
|
||||
require(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
|
||||
|
||||
print "Build ".GEN_NUMBER_COMMANDE." orders\n";
|
||||
@@ -162,53 +161,63 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
|
||||
{
|
||||
print "Process order ".$s."\n";
|
||||
|
||||
$com = new Commande($db);
|
||||
$object = new Commande($db);
|
||||
|
||||
$com->socid = 4;
|
||||
$com->date_commande = $dates[mt_rand(1, count($dates)-1)];
|
||||
$com->note = 'A comment';
|
||||
$com->source = 1;
|
||||
$com->fk_project = 0;
|
||||
$com->remise_percent = 0;
|
||||
$object->socid = $societesid[mt_rand(1, $num_thirdparties)];
|
||||
$object->date_commande = $dates[mt_rand(1, count($dates)-1)];
|
||||
$object->note = 'My small comment about this order. Hum. Nothing.';
|
||||
$object->source = 1;
|
||||
$object->fk_project = 0;
|
||||
$object->remise_percent = 0;
|
||||
$object->shipping_method_id = mt_rand(1, 2);
|
||||
$object->cond_reglement_id = mt_rand(0, 2);
|
||||
$object->more_reglement_id = mt_rand(0, 7);
|
||||
$object->availability_id = mt_rand(0, 1);
|
||||
|
||||
$listofuserid=array(12,13,16);
|
||||
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($listofuserid[mt_rand(0,2)]);
|
||||
$fuser->getRights();
|
||||
|
||||
$db->begin();
|
||||
|
||||
$result=$com->create($user);
|
||||
$result=$object->create($fuser);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$result=$com->valid($user);
|
||||
$nbp = mt_rand(2, 5);
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
$result=$object->valid($fuser);
|
||||
if ($result > 0)
|
||||
{
|
||||
$nbp = mt_rand(2, 5);
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$com->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
print " OK with ref ".$com->ref."\n";
|
||||
print " OK with ref ".$object->ref."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " KO\n";
|
||||
$db->rollback();
|
||||
dol_print_error($db,$com->error);
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print " KO\n";
|
||||
$db->rollback();
|
||||
dol_print_error($db,$com->error);
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,59 @@ require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
* Parameters
|
||||
*/
|
||||
|
||||
define(GEN_NUMBER_PROPAL, 5);
|
||||
|
||||
define(GEN_NUMBER_PROPAL, 10);
|
||||
$year = 2016;
|
||||
$dates = array (mktime(12,0,0,1,3,$year),
|
||||
mktime(12,0,0,1,9,$year),
|
||||
mktime(12,0,0,2,13,$year),
|
||||
mktime(12,0,0,2,23,$year),
|
||||
mktime(12,0,0,3,30,$year),
|
||||
mktime(12,0,0,4,3,$year),
|
||||
mktime(12,0,0,4,3,$year),
|
||||
mktime(12,0,0,5,9,$year),
|
||||
mktime(12,0,0,5,1,$year),
|
||||
mktime(12,0,0,5,13,$year),
|
||||
mktime(12,0,0,5,19,$year),
|
||||
mktime(12,0,0,5,23,$year),
|
||||
mktime(12,0,0,6,3,$year),
|
||||
mktime(12,0,0,6,19,$year),
|
||||
mktime(12,0,0,6,24,$year),
|
||||
mktime(12,0,0,7,3,$year),
|
||||
mktime(12,0,0,7,9,$year),
|
||||
mktime(12,0,0,7,23,$year),
|
||||
mktime(12,0,0,7,30,$year),
|
||||
mktime(12,0,0,8,9,$year),
|
||||
mktime(12,0,0,9,23,$year),
|
||||
mktime(12,0,0,10,3,$year),
|
||||
mktime(12,0,0,11,12,$year),
|
||||
mktime(12,0,0,11,13,$year),
|
||||
mktime(12,0,0,1,3,($year - 1)),
|
||||
mktime(12,0,0,1,9,($year - 1)),
|
||||
mktime(12,0,0,2,13,($year - 1)),
|
||||
mktime(12,0,0,2,23,($year - 1)),
|
||||
mktime(12,0,0,3,30,($year - 1)),
|
||||
mktime(12,0,0,4,3,($year - 1)),
|
||||
mktime(12,0,0,4,3,($year - 1)),
|
||||
mktime(12,0,0,5,9,($year - 1)),
|
||||
mktime(12,0,0,5,1,($year - 1)),
|
||||
mktime(12,0,0,5,13,($year - 1)),
|
||||
mktime(12,0,0,5,19,($year - 1)),
|
||||
mktime(12,0,0,5,23,($year - 1)),
|
||||
mktime(12,0,0,6,3,($year - 1)),
|
||||
mktime(12,0,0,6,19,($year - 1)),
|
||||
mktime(12,0,0,6,24,($year - 1)),
|
||||
mktime(12,0,0,7,3,($year - 1)),
|
||||
mktime(12,0,0,7,9,($year - 1)),
|
||||
mktime(12,0,0,7,23,($year - 1)),
|
||||
mktime(12,0,0,7,30,($year - 1)),
|
||||
mktime(12,0,0,8,9,($year - 1)),
|
||||
mktime(12,0,0,9,23,($year - 1)),
|
||||
mktime(12,0,0,10,3,($year - 1)),
|
||||
mktime(12,0,0,11,12,$year),
|
||||
mktime(12,0,0,11,13,$year),
|
||||
mktime(12,0,0,12,12,$year),
|
||||
mktime(12,0,0,12,13,$year),
|
||||
);
|
||||
|
||||
$ret=$user->fetch('','admin');
|
||||
if (! $ret > 0)
|
||||
@@ -56,16 +107,15 @@ $user->getrights();
|
||||
|
||||
|
||||
$socids = array();
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client=1";
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE client in (1,3)";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num_socs = $db->num_rows($resql);
|
||||
$num_thirdparties = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num_socs)
|
||||
while ($i < $num_thirdparties)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
$socids[$i] = $row[0];
|
||||
}
|
||||
@@ -81,7 +131,6 @@ if ($resql)
|
||||
while ($i < $num_conts)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
$contids[$row[1]][0] = $row[0]; // A ameliorer
|
||||
}
|
||||
@@ -97,7 +146,6 @@ if ($resql)
|
||||
while ($i < $num_prods)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
$prodids[$i] = $row[0];
|
||||
}
|
||||
@@ -117,27 +165,25 @@ $result=0;
|
||||
while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||
{
|
||||
$i++;
|
||||
$socid = mt_rand(1, $num_socs);
|
||||
$socid = mt_rand(1, $num_thirdparties);
|
||||
print "Proposal ".$i." for socid ".$socid;
|
||||
|
||||
$soc = new Societe($db);
|
||||
|
||||
|
||||
$propal = new Propal($db);
|
||||
$object = new Propal($db);
|
||||
|
||||
$obj = $conf->global->PROPALE_ADDON;
|
||||
$modPropale = new $obj;
|
||||
$numpr = $modPropale->getNextValue($soc,$propal);
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch(mt_rand(1,2));
|
||||
$fuser->getRights();
|
||||
|
||||
$propal->ref = $numpr;
|
||||
$propal->contactid = $contids[$socids[$socid]][0];
|
||||
$propal->socid = $socids[$socid];
|
||||
$propal->datep = time();
|
||||
$propal->cond_reglement_id = 3;
|
||||
$propal->mode_reglement_id = 3;
|
||||
$propal->author = $user->id;
|
||||
$object->contactid = $contids[$socids[$socid]][0];
|
||||
$object->socid = $socids[$socid];
|
||||
$object->datep = $dates[mt_rand(1, count($dates)-1)];
|
||||
$object->cond_reglement_id = 3;
|
||||
$object->mode_reglement_id = 3;
|
||||
|
||||
$result=$propal->create($user);
|
||||
$result=$object->create($fuser);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$nbp = mt_rand(2, 5);
|
||||
@@ -147,18 +193,30 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$propal->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
||||
$result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
print " OK with ref ".$propal->ref."\n";
|
||||
|
||||
$result=$object->valid($fuser);
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
print " OK with ref ".$object->ref."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " KO\n";
|
||||
$db->rollback();
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
README
|
||||
------
|
||||
|
||||
*** Demo
|
||||
Scripts in this directory can be used to reload or save a demo database.
|
||||
Install of package "dialog" is required.
|
||||
|
||||
Scripts in this directory can be used to reinit a demo database.
|
||||
WARNING: This will erase current database with data into initdemo.sql.
|
||||
|
||||
*** Init demo
|
||||
|
||||
The script initdemo.sh will erase current database with data into mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
||||
|
||||
Do a chmod 700 initdemo.sh
|
||||
then run ./initdemo.sh to launch Graphic User Interface.
|
||||
|
||||
Install of package "dialog" is required.
|
||||
|
||||
*** Save demo
|
||||
|
||||
The script savedemo.sh will save current database into a database dump file.
|
||||
|
||||
|
||||
*** Other
|
||||
*** Update demo
|
||||
|
||||
Other scripts into initdata can be used to load data test.
|
||||
The goal of script updatedemo.php is to update dates into the demo data so samples are up to date.
|
||||
|
||||
Binary file not shown.
@@ -162,7 +162,7 @@ export res=$?
|
||||
|
||||
|
||||
# ---------------------------- copy demo files
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" `
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||
if [ "x$documentdir" != "x" ]
|
||||
then
|
||||
echo cp -pr $mydir/documents_demo/* "$documentdir/"
|
||||
@@ -174,7 +174,7 @@ then
|
||||
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
|
||||
else
|
||||
echo Detection of documents directory failed so demo files were not copied.
|
||||
echo Detection of documents directory from $mydir failed so demo files were not copied.
|
||||
fi
|
||||
|
||||
|
||||
|
||||
9055
dev/initdemo/mysqldump_dolibarr_5.0.0.sql
Normal file
9055
dev/initdemo/mysqldump_dolibarr_5.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
28
dev/setup/nginx/dolibarr
Normal file
28
dev/setup/nginx/dolibarr
Normal file
@@ -0,0 +1,28 @@
|
||||
# Dolibarr server configuration sample for NGinx
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
root /path/to/your/htdocs;
|
||||
|
||||
# Optionnal
|
||||
error_log /path/to/your/log/directory/nginx.error.log;
|
||||
access_log /path/to/your/log/directory/nginx.access.log;
|
||||
|
||||
index index.php index.html index.htm;
|
||||
|
||||
# Optionnal
|
||||
server_name your-fqdn.tld;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php;
|
||||
}
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
try_files $uri =404;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_read_timeout 600;
|
||||
include fastcgi_params;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
}
|
||||
}
|
||||
@@ -89,8 +89,11 @@ if ($user->societe_id > 0)
|
||||
//accessforbidden();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'mymodulelist';
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('skeletonlist'));
|
||||
$hookmanager->initHooks(array('mymodulelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@@ -244,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -305,6 +308,7 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
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_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
||||
|
||||
|
||||
@@ -42,11 +42,15 @@ then
|
||||
then
|
||||
aaupper="US"
|
||||
fi
|
||||
if [ $aaupper = "EL" ]
|
||||
then
|
||||
aaupper="GR"
|
||||
fi
|
||||
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
||||
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
||||
then
|
||||
reflang="htdocs/langs/"$aa"_"$aaupper
|
||||
if [ -d $reflang ]
|
||||
if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ]
|
||||
then
|
||||
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
|
||||
echo $dirshort is an alternative language of $reflang
|
||||
|
||||
@@ -17,14 +17,14 @@ fi
|
||||
# To detec
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF
|
||||
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep CRLF
|
||||
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
|
||||
fi
|
||||
|
||||
# To convert
|
||||
if [ "x$1" = "xfix" ]
|
||||
then
|
||||
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
|
||||
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
|
||||
do
|
||||
echo "Fix file $fic"
|
||||
dos2unix "$fic"
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
</tr>
|
||||
|
||||
<!-- Password -->
|
||||
<tr><td valign="top" class="nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
||||
<td valign="top" class="nowrap">
|
||||
<tr><td class="tdtop nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
||||
<td class="tdtop nowrap">
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" />
|
||||
</td></tr>
|
||||
|
||||
|
||||
@@ -26,15 +26,21 @@ fi
|
||||
|
||||
if [ "x$1" = "xall" ]
|
||||
then
|
||||
for dir in `find htdocs/langs/* -type d`
|
||||
do
|
||||
fic=`basename $dir`
|
||||
if [ $fic != "en_US" ]
|
||||
then
|
||||
echo "tx pull -l $fic $2 $3"
|
||||
tx pull -l $fic $2 $3
|
||||
fi
|
||||
done
|
||||
if [ "x$2" = "x" ]
|
||||
then
|
||||
echo "tx pull"
|
||||
tx pull
|
||||
else
|
||||
for dir in `find htdocs/langs/* -type d`
|
||||
do
|
||||
fic=`basename $dir`
|
||||
if [ $fic != "en_US" ]
|
||||
then
|
||||
echo "tx pull -l $fic $2 $3"
|
||||
tx pull -l $fic $2 $3
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cd -
|
||||
else
|
||||
echo "tx pull -l $1 $2 $3 $4 $5"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 43 KiB |
@@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -888,18 +888,18 @@ if ($id)
|
||||
{
|
||||
if ($value == 'country')
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($id == 4) print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" colspan="2" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page to assign mass categories to accounts
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
@@ -48,8 +47,10 @@ $rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel');
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
if (! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$AccCat = new AccountancyCategory($db);
|
||||
|
||||
@@ -89,7 +90,7 @@ llxheader('', $langs->trans('AccountAccounting'));
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$form = new Form($db);
|
||||
|
||||
print load_fiche_titre($langs->trans('Categories'));
|
||||
print load_fiche_titre($langs->trans('AccountingCategory'));
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
@@ -101,8 +102,8 @@ print '<table class="border" width="100%">';
|
||||
// Category
|
||||
print '<tr><td>' . $langs->trans("AccountingCategory") . '</td>';
|
||||
print '<td>';
|
||||
$formaccounting->select_accounting_category($cat_id, 'account_category', 1);
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Display") . '">';
|
||||
$formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 1);
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Select") . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
if (! empty($cat_id)) {
|
||||
@@ -113,11 +114,11 @@ if (! empty($cat_id)) {
|
||||
print '<tr><td>' . $langs->trans("AddCompteFromBK") . '</td>';
|
||||
print '<td>';
|
||||
if (is_array($AccCat->lines_cptbk) && count($AccCat->lines_cptbk) > 0) {
|
||||
print '<select size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
||||
print '<select class="flat minwidth200" size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
||||
foreach ( $AccCat->lines_cptbk as $cpt ) {
|
||||
print '<option value="' . length_accountg($cpt->numero_compte) . '">' . length_accountg($cpt->numero_compte) . ' (' . $cpt->label_compte . ' ' . $cpt->doc_ref . ')</option>';
|
||||
}
|
||||
print '</select> - <input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("add") . '"> ';
|
||||
print '</select><br><input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("Add") . '"> ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -133,7 +134,7 @@ if ($action == 'display' || $action == 'delete') {
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><th class="liste_titre">' . $langs->trans("Numerocompte") . '</th><th class="liste_titre">' . $langs->trans("Description") . '</th><th class="liste_titre" width="60" align="center">Action</th></tr>';
|
||||
print '<tr class="liste_titre"><th class="liste_titre">' . $langs->trans("AccountAccounting") . '</th><th class="liste_titre">' . $langs->trans("Description") . '</th><th class="liste_titre" width="60" align="center">Action</th></tr>';
|
||||
|
||||
if (! empty($cat_id)) {
|
||||
$return = $AccCat->display($cat_id);
|
||||
@@ -144,7 +145,7 @@ if ($action == 'display' || $action == 'delete') {
|
||||
if (is_array($AccCat->lines_display) && count($AccCat->lines_display) > 0) {
|
||||
foreach ( $AccCat->lines_display as $cpt ) {
|
||||
$var = ! $var;
|
||||
print '<tr' . $bc[$var] . '>';
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>' . length_accountg($cpt->account_number) . '</td>';
|
||||
print '<td>' . $cpt->label . '</td>';
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"] . "?account_category=$cat_id&cptid=" . $cpt->rowid, $langs->trans("DeleteCptCategory"), $langs->trans("ConfirmDeleteCptCategory"), "delete", '', 0, "action-delete" . $j);
|
||||
|
||||
1351
htdocs/accountancy/admin/categories_list.php
Normal file
1351
htdocs/accountancy/admin/categories_list.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* 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>
|
||||
@@ -62,7 +62,10 @@ $list_account = array (
|
||||
'ACCOUNTING_VAT_PAY_ACCOUNT',
|
||||
'ACCOUNTING_ACCOUNT_SUSPENSE',
|
||||
'ACCOUNTING_ACCOUNT_TRANSFER_CASH',
|
||||
'DONATION_ACCOUNTINGACCOUNT'
|
||||
'DONATION_ACCOUNTINGACCOUNT',
|
||||
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',
|
||||
'LOAN_ACCOUNTING_ACCOUNT_INTEREST',
|
||||
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -268,7 +268,7 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td valign="top">';
|
||||
print '<tr><td class="tdtop">';
|
||||
print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
||||
print '</td><td colspan="2">';
|
||||
print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/journal.php
|
||||
@@ -121,7 +121,7 @@ dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('Journaux') . '</td>';
|
||||
print '<td colspan="2">' . $langs->trans('Journaux') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ( $list as $key ) {
|
||||
@@ -145,11 +145,11 @@ print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('JournalFinancial') . ' ('.$langs->trans('Opened').')</td>';
|
||||
print '<td colspan="2">' . $langs->trans('JournalFinancial') . ' ('.$langs->trans('Opened').')</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Bank account
|
||||
$sql = "SELECT rowid, label, number, accountancy_journal";
|
||||
$sql = "SELECT rowid, ref, label, number, account_number, accountancy_journal";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "bank_account";
|
||||
$sql .= " WHERE entity = " . $conf->entity;
|
||||
$sql .= " AND clos = 0";
|
||||
@@ -162,16 +162,19 @@ if ($resql) {
|
||||
|
||||
if ($numr > 0)
|
||||
|
||||
$bankaccountstatic=new Account($db);
|
||||
$bankaccountstatic = new Account($db);
|
||||
|
||||
while ( $i < $numr ) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$var = ! $var;
|
||||
|
||||
$bankaccountstatic->rowid = $objp->rowid;
|
||||
$bankaccountstatic->id = $objp->rowid;
|
||||
$bankaccountstatic->ref = $objp->ref;
|
||||
$bankaccountstatic->label = $objp->label;
|
||||
$bankaccountstatic->number = $objp->number;
|
||||
$bankaccountstatic->account_number = $objp->account_number;
|
||||
$bankaccountstatic->accountancy_journal = $objp->accountancy_journal;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
@@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -143,7 +143,7 @@ else {
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
@@ -184,7 +184,7 @@ else {
|
||||
print '<table class="liste ' . ($moreforfilter ? "listwithfilterbefore" : "") . '">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
@@ -192,7 +192,7 @@ else {
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">';
|
||||
print '<td class="liste_titre" colspan="2">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
||||
print '<br>';
|
||||
@@ -200,14 +200,13 @@ else {
|
||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@@ -230,7 +229,7 @@ else {
|
||||
if (empty($description)) {
|
||||
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
print '<tr' . $bc[$var] . '>';
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
|
||||
// Permet d'afficher le compte comptable
|
||||
if ($root_account_description != $displayed_account) {
|
||||
@@ -256,9 +255,9 @@ else {
|
||||
|
||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
||||
print '<td>' . $description . '</td>';
|
||||
print '<td align="right">' . number_format($line->debit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . number_format($line->credit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . number_format($line->credit - $line->debit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . price($line->debit) . '</td>';
|
||||
print '<td align="right">' . price($line->credit) . '</td>';
|
||||
print '<td align="right">' . price($line->credit - $line->debit) . '</td>';
|
||||
print '<td align="center">' . $link;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -38,7 +38,7 @@ $langs->load("other");
|
||||
$langs->load("accountancy");
|
||||
|
||||
// Filter
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST("year",'int');
|
||||
if ($year == 0) {
|
||||
$year_current = strftime("%Y", time());
|
||||
$year_start = $year_current;
|
||||
@@ -47,9 +47,11 @@ if ($year == 0) {
|
||||
$year_start = $year;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("Bookkeeping"));
|
||||
|
||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||
|
||||
@@ -202,9 +202,11 @@ else if ($action == "confirm_create") {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
@@ -274,12 +276,12 @@ if ($action == 'create') {
|
||||
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Docref") . '</td>';
|
||||
print '<td><input type="text" size="20" name="doc_ref" value=""/></td>';
|
||||
print '<td><input type="text" class="minwidth200" name="doc_ref" value=""/></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Doctype") . '</td>';
|
||||
print '<td><input type="text" size="20" name="doc_type" value=""/></td>';
|
||||
print '<td><input type="text" class="minwidth200" name="doc_type" value=""/></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
@@ -345,6 +347,8 @@ if ($action == 'create') {
|
||||
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
|
||||
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
|
||||
|
||||
$var=False;
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
if (count($book->linesmvt) > 0) {
|
||||
|
||||
@@ -356,17 +360,17 @@ if ($action == 'create') {
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"));
|
||||
print_liste_field_titre($langs->trans("Code_tiers"));
|
||||
print_liste_field_titre($langs->trans("Labelcompte"));
|
||||
print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="center"');
|
||||
print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="center"');
|
||||
print_liste_field_titre($langs->trans("Amount"), "", "", "", "", 'align="center"');
|
||||
print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre($langs->trans("Amount"), "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre($langs->trans("Sens"), "", "", "", "", 'align="center"');
|
||||
print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"');
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ( $book->linesmvt as $line ) {
|
||||
foreach ($book->linesmvt as $line) {
|
||||
$var = ! $var;
|
||||
print '<tr' . $bc[$var] . '>';
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
@@ -417,7 +421,7 @@ if ($action == 'create') {
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
$var = ! $var;
|
||||
print '<tr' . $bc[$var] . '>';
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>';
|
||||
print $formventilation->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
|
||||
@@ -105,7 +105,6 @@ if ($action != 'export_csv' && ! isset($_POST['begin']) && ! isset($_GET['begin'
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
@@ -132,74 +131,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
$search_date_end = '';
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping') {
|
||||
|
||||
$import_key = GETPOST('importkey', 'alpha');
|
||||
|
||||
if (! empty($import_key)) {
|
||||
$result = $object->deleteByImportkey($import_key);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
Header("Location: list.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
if ($action == 'delbookkeepingyearconfirm') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
if ($delyear==-1) {
|
||||
$delyear=0;
|
||||
}
|
||||
$deljournal = GETPOST('deljournal','alpha');
|
||||
if ($deljournal==-1) {
|
||||
$deljournal=0;
|
||||
}
|
||||
|
||||
if (! empty($delyear) || ! empty($deljournal))
|
||||
{
|
||||
$result = $object->deleteByYearAndJournal($delyear,$deljournal);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||
}
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages("NoRecordDeleted", null, 'warnings');
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($action == 'delmouvconfirm') {
|
||||
|
||||
$mvt_num = GETPOST('mvt_num', 'int');
|
||||
|
||||
if (! empty($mvt_num)) {
|
||||
$result = $object->deleteMvtNum($mvt_num);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
// Must be after the remove filter action, before the export.
|
||||
$param = '';
|
||||
$filter = array ();
|
||||
if (! empty($search_date_start)) {
|
||||
@@ -266,6 +198,68 @@ if (! empty($search_mvt_num)) {
|
||||
$param .= '&search_mvt_num=' . $search_mvt_num;
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping') {
|
||||
|
||||
$import_key = GETPOST('importkey', 'alpha');
|
||||
|
||||
if (! empty($import_key)) {
|
||||
$result = $object->deleteByImportkey($import_key);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
Header("Location: list.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
if ($action == 'delbookkeepingyearconfirm') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
if ($delyear==-1) {
|
||||
$delyear=0;
|
||||
}
|
||||
$deljournal = GETPOST('deljournal','alpha');
|
||||
if ($deljournal==-1) {
|
||||
$deljournal=0;
|
||||
}
|
||||
|
||||
if (! empty($delyear) || ! empty($deljournal))
|
||||
{
|
||||
$result = $object->deleteByYearAndJournal($delyear,$deljournal);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||
}
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages("NoRecordDeleted", null, 'warnings');
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($action == 'delmouvconfirm') {
|
||||
|
||||
$mvt_num = GETPOST('mvt_num', 'int');
|
||||
|
||||
if (! empty($mvt_num)) {
|
||||
$result = $object->deleteMvtNum($mvt_num);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
Header("Location: list.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
||||
@@ -287,13 +281,18 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title_page = $langs->trans("Bookkeeping");
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
@@ -378,15 +377,15 @@ print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_d
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td><input type="text" name="search_mvt_num" size="6" value="' . $search_mvt_num . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="' . dol_escape_htmltag($search_mvt_num) . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
print $langs->trans('From') . ': ';
|
||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||
@@ -394,15 +393,15 @@ print '<br>';
|
||||
print $langs->trans('to') . ': ';
|
||||
print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
||||
print '<td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_doc_ref" size="8" value="' . dol_escape_htmltag($search_doc_ref) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
||||
print '<br>';
|
||||
print $langs->trans('to');
|
||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
||||
print '<br>';
|
||||
@@ -412,10 +411,10 @@ print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/>';
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
|
||||
@@ -162,7 +162,7 @@ llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
@@ -235,9 +235,8 @@ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60"
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="GET">';
|
||||
print '<td>' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre">' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $langs->trans('From') . ': ';
|
||||
print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
|
||||
@@ -247,10 +246,10 @@ print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/></td>';
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_account" value="' . $search_label_account . '"/></td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td class="liste_titre" align="right" colspan="2">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
|
||||
@@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
|
||||
* Mode List
|
||||
*/
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
|
||||
@@ -150,23 +150,27 @@ class AccountancyCategory
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " AND aa.active = 1";
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) {
|
||||
$error ++;
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
while ( $obj = $this->db->fetch_object($resql)) {
|
||||
if (array_key_exists(length_accountg($obj->account_number), $cpts)) {
|
||||
while ( $obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
if (array_key_exists(length_accountg($obj->account_number), $cpts))
|
||||
{
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account";
|
||||
$sql .= " SET fk_accounting_category=" . $id_cat;
|
||||
$sql .= " WHERE rowid=".$obj->rowid;
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) {
|
||||
$resqlupdate = $this->db->query($sql);
|
||||
if (! $resqlupdate) {
|
||||
$error ++;
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ class AccountancyExport
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20);
|
||||
$Tab['sens'] = $data->sens; // C or D
|
||||
$Tab['signe_montant'] = '+';
|
||||
$Tab['montant'] = str_pad(abs($data->montant) * 100, 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||
$Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
if (! empty($data->date_echeance))
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
@@ -47,7 +48,7 @@ if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Filter
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST("year",'int');
|
||||
if ($year == 0) {
|
||||
$year_current = strftime("%Y", time());
|
||||
$year_start = $year_current;
|
||||
@@ -57,7 +58,7 @@ if ($year == 0) {
|
||||
}
|
||||
|
||||
// Validate History
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
|
||||
|
||||
@@ -179,7 +180,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" hr
|
||||
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql .= " WHERE fd.fk_code_ventilation = 0";
|
||||
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
|
||||
$sql .= " AND f.rowid = fd.fk_facture";
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -222,6 +230,11 @@ $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||
@@ -273,6 +286,11 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
$sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
@@ -301,97 +319,105 @@ print "</table>\n";
|
||||
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||
{
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " SUM(fd.total_ht) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " SUM(fd.total_ht) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price(price2num($row[$i])) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
print '</td></tr></table>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -170,37 +170,37 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= " AND f.facnumber like '%" . $search_invoice . "%'";
|
||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
||||
}
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
||||
$sql .= natural_search("p.ref", $search_ref);
|
||||
}
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
||||
$sql .= natural_search("p.label", $search_label);
|
||||
}
|
||||
if (strlen(trim($search_desc))) {
|
||||
$sql .= " AND fd.description like '%" . $search_desc . "%'";
|
||||
$sql .= natural_search("fd.description", $search_desc);
|
||||
}
|
||||
if (strlen(trim($search_amount))) {
|
||||
$sql .= " AND fd.total_ht like '%" . $search_amount . "%'";
|
||||
$sql .= natural_search("fd.total_ht", $search_amount, 1);
|
||||
}
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
||||
$sql .= natural_search("aa.account_number", $search_account);
|
||||
}
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= " AND (fd.tva_tx like '" . $search_vat . "%')";
|
||||
$sql .= natural_search("fd.tva_tx", $search_vat);
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= " AND (co.label like'" . $search_country . "%')";
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= " AND (s.tva_intra like'" . $search_tvaintra . "%')";
|
||||
$sql .= natural_search("s.tva_intra", $search_tva_intra);
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -283,7 +283,7 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
||||
print $searchpitco;
|
||||
print "</td></tr>\n";
|
||||
|
||||
@@ -210,12 +210,17 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||
}
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Filter
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST('year', 'int');
|
||||
if ($year == 0) {
|
||||
$year_current = strftime("%Y", time());
|
||||
$year_start = $year_current;
|
||||
@@ -68,9 +68,9 @@ if ($action == 'validatehistory') {
|
||||
$db->begin();
|
||||
|
||||
// First clean corrupted data
|
||||
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sqlclean .= " SET fd.fk_code_ventilation = 0";
|
||||
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sqlclean .= " SET erd.fk_code_ventilation = 0";
|
||||
$sqlclean .= ' WHERE erd.fk_code_ventilation NOT IN ';
|
||||
$sqlclean .= ' (SELECT accnt.rowid ';
|
||||
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
@@ -79,18 +79,18 @@ if ($action == 'validatehistory') {
|
||||
|
||||
// Now make the binding
|
||||
if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
|
||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "expensereport_det.fk_code_ventilation = 0";
|
||||
} else {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd, " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
|
||||
$sql1 .= " AND erd.fk_code_ventilation = 0";
|
||||
}
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
@@ -106,9 +106,9 @@ if ($action == 'validatehistory') {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql1 .= " SET fd.fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET erd.fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
@@ -129,12 +129,12 @@ if ($action == 'validatehistory') {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql1.= " SET fd.fk_code_ventilation = 0";
|
||||
$sql1.= " WHERE fd.fk_facture_fourn IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND f.entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1.= " SET erd.fk_code_ventilation = 0";
|
||||
$sql1.= " WHERE erd.fk_expensereport IN ( SELECT er.rowid FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||
$sql1.= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||
$sql1.= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND er.entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql1.=")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
@@ -197,16 +197,17 @@ print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||
$sql .= " WHERE er.date_create >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_create <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||
@@ -250,17 +251,17 @@ print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||
$sql .= " WHERE er.date_create >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_create <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||
@@ -289,55 +290,55 @@ print "</table>\n";
|
||||
|
||||
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||
{
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " WHERE er.date_create >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_create <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@@ -36,9 +37,6 @@ $langs->load("accountancy");
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
// Validate History
|
||||
$action = GETPOST('action');
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("dict");
|
||||
$langs->load("bills");
|
||||
@@ -73,11 +71,11 @@ print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@@ -86,16 +84,16 @@ print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
@@ -104,7 +102,7 @@ if (! empty($conf->tax->enabled))
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
@@ -112,22 +110,22 @@ if (! empty($conf->tax->enabled))
|
||||
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->loan->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuLoanAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
@@ -138,7 +136,7 @@ print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
@@ -148,14 +146,21 @@ print "<br>\n";
|
||||
$step = 0;
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step, '<strong>'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step)."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@@ -43,6 +43,7 @@ $langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("trips");
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth');
|
||||
$date_startday = GETPOST('date_startday');
|
||||
@@ -86,14 +87,14 @@ $idpays = $p[0];
|
||||
|
||||
$sql = "SELECT er.rowid, er.ref, er.date_debut as de,";
|
||||
$sql .= " erd.rowid as erdid, erd.comments, erd.total_ttc, erd.tva_tx, erd.total_ht, erd.total_tva, erd.fk_code_ventilation,";
|
||||
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_code,";
|
||||
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_account,";
|
||||
$sql .= " f.accountancy_code, ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON erd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_valid";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_author";
|
||||
$sql .= " WHERE er.fk_statut > 0 ";
|
||||
$sql .= " AND erd.fk_code_ventilation > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
@@ -43,7 +43,7 @@ $rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel');
|
||||
|
||||
// Filter
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST('year','int');
|
||||
if ($year == 0) {
|
||||
$year_current = strftime("%Y", time());
|
||||
$year_start = $year_current;
|
||||
@@ -64,9 +64,11 @@ if (! $user->rights->accounting->comptarapport->lire)
|
||||
|
||||
$AccCat = new AccountancyCategory($db);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxheader('', $langs->trans('ReportInOut'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
@@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Filter
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST("year",'int');
|
||||
if ($year == 0) {
|
||||
$year_current = strftime("%Y", time());
|
||||
$year_start = $year_current;
|
||||
@@ -55,7 +55,7 @@ if ($year == 0) {
|
||||
}
|
||||
|
||||
// Validate History
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
|
||||
/*
|
||||
@@ -289,58 +289,56 @@ print "</table>\n";
|
||||
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||
{
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND ff.fk_statut > 0 ";
|
||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
$sql .= " ROUND(SUM(ffd.total_ht),2) as total";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
|
||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND ff.fk_statut > 0 ";
|
||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -157,32 +157,32 @@ $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"
|
||||
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||
$sql.= " AND aa.rowid = l.fk_code_ventilation";
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= " AND f.ref like '%" . $search_invoice . "%'";
|
||||
$sql .= natural_search("f.ref", $search_invoice);
|
||||
}
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
||||
$sql .= natural_search("p.ref", $search_ref);
|
||||
}
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
||||
$sql .= natural_search("p.label", $search_label);
|
||||
}
|
||||
if (strlen(trim($search_desc))) {
|
||||
$sql .= " AND l.description like '%" . $search_desc . "%'";
|
||||
$sql .= natural_search("l.description", $search_desc);
|
||||
}
|
||||
if (strlen(trim($search_amount))) {
|
||||
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
|
||||
$sql .= natural_search("l.total_ht", $search_amount, 1);
|
||||
}
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
||||
$sql .= natural_search("aa.account_number", $search_account, 1);
|
||||
}
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
|
||||
$sql .= natural_search("l.tva_tx", $search_vat, 1);
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -255,7 +255,7 @@ if ($result) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
@@ -264,7 +264,7 @@ if ($result) {
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
|
||||
@@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -108,7 +108,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
||||
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
||||
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
|
||||
<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -822,7 +822,7 @@ else
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" size="40" value="'.(isset($_POST["member_login"])?$_POST["member_login"]:$object->login).'"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="maxwidth200" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
@@ -873,7 +873,7 @@ else
|
||||
}
|
||||
|
||||
// Address
|
||||
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -1066,7 +1066,7 @@ else
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" size="30" value="'.(isset($_POST["login"])?$_POST["login"]:$object->login).'"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" class="maxwidth200" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Morphy
|
||||
@@ -1090,7 +1090,7 @@ else
|
||||
print "</td></tr>";
|
||||
|
||||
// Company
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?$_POST["societe"]:$object->societe).'"></td></tr>';
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
@@ -1099,11 +1099,11 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'"></td>';
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Photo
|
||||
@@ -1122,24 +1122,24 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?GETPOST("email",'',2):$object->email).'"></td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" size="30" value="'.(isset($_POST["pass"])?$_POST["pass"]:$object->pass).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="maxwdith200" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode",'',2):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
print ' ';
|
||||
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town",'',2):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
@@ -1153,23 +1153,23 @@ else
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id);
|
||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?$_POST["phone"]:$object->phone).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?GETPOST("phone"):$object->phone).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
@@ -1179,7 +1179,7 @@ else
|
||||
|
||||
// Public profil
|
||||
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
|
||||
print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
|
||||
print $form->selectyesno("public",(isset($_POST["public"])?GETPOST("public",'',2):$object->public),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Categories
|
||||
|
||||
@@ -35,9 +35,10 @@ class AdherentType extends CommonObject
|
||||
{
|
||||
public $table_element = 'adherent_type';
|
||||
public $element = 'adherent_type';
|
||||
public $picto = 'group';
|
||||
|
||||
/** @var string Label */
|
||||
public $libelle;
|
||||
public $label;
|
||||
/**
|
||||
* @var bool
|
||||
* @deprecated Use subscription
|
||||
@@ -199,7 +200,7 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.libelle, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql .= " WHERE d.rowid = ".$rowid;
|
||||
|
||||
@@ -214,7 +215,8 @@ class AdherentType extends CommonObject
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->libelle = $obj->libelle;
|
||||
$this->label = $obj->label;
|
||||
$this->libelle = $obj->label; // For backward compatibility
|
||||
$this->statut = $obj->statut;
|
||||
$this->subscription = $obj->subscription;
|
||||
$this->mail_valid = $obj->mail_valid;
|
||||
@@ -296,6 +298,16 @@ class AdherentType extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getLibStatut
|
||||
*
|
||||
* @return string Return status of a type of member
|
||||
*/
|
||||
function getLibStatut()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* getMailOnValid
|
||||
*
|
||||
|
||||
@@ -170,8 +170,8 @@ class Members extends DolibarrApi
|
||||
foreach($request_data as $field => $value) {
|
||||
$member->$field = $value;
|
||||
}
|
||||
if($member->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(503, 'Error when create member : '.$member->error);
|
||||
if ($member->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, 'Error creating member', array_merge(array($member->error), $member->errors));
|
||||
}
|
||||
return $member->id;
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ class Subscriptions extends DolibarrApi
|
||||
foreach($request_data as $field => $value) {
|
||||
$subscription->$field = $value;
|
||||
}
|
||||
if($subscription->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(503, 'Error when create subscription : '.$subscription->error);
|
||||
if ($subscription->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, 'Error when creating subscription', array_merge(array($subscription->error), $subscription->errors));
|
||||
}
|
||||
return $subscription->id;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ class Subscription extends CommonObject
|
||||
{
|
||||
public $element='subscription';
|
||||
public $table_element='subscription';
|
||||
public $picto='payment';
|
||||
|
||||
var $datec; // Date creation
|
||||
var $datem; // Date modification
|
||||
@@ -277,6 +278,30 @@ class Subscription extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le libelle du statut d'une adhesion
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($statut)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("members");
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load information of the subscription object
|
||||
*
|
||||
|
||||
@@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records with no order and no limits
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
@@ -375,7 +375,7 @@ if (! empty($moreforfilter))
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
@@ -395,8 +395,8 @@ if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titr
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($langs->trans("StateShort"),$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'],$_SERVER["PHP_SELF"],'d.phone','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'],$_SERVER["PHP_SELF"],'d.phone_perso','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'],$_SERVER["PHP_SELF"],'d.phone_mobile','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'],$_SERVER["PHP_SELF"],'d.phone_perso','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'],$_SERVER["PHP_SELF"],'d.phone_mobile','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.email']['checked'])) print_liste_field_titre($arrayfields['d.email']['label'],$_SERVER["PHP_SELF"],'d.email','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.datefin']['checked'])) print_liste_field_titre($arrayfields['d.datefin']['label'],$_SERVER["PHP_SELF"],'d.datefin','',$param,'align="center"',$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
@@ -434,32 +434,32 @@ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
if (! empty($arrayfields['d.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.firstname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_firstname" value="'.$search_firstname.'" size="6"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.lastname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="6"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.company']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_company" value="'.$search_company.'" size="6"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.login']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="6"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.morphy']['checked']))
|
||||
@@ -479,24 +479,24 @@ if (! empty($arrayfields['t.libelle']['checked']))
|
||||
if (! empty($arrayfields['d.address']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_address" value="'.$search_address.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_address" value="'.$search_address.'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.zip']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_zip" value="'.$search_zip.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['d.town']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_town" value="'.$search_town.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.'"></td>';
|
||||
}
|
||||
// State
|
||||
if (! empty($arrayfields['state.nom']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat searchstring" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
|
||||
print '<input class="flat searchstring maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Country
|
||||
@@ -510,25 +510,25 @@ if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
if (! empty($arrayfields['d.phone']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_phone" value="'.$search_phone.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_phone" value="'.$search_phone.'"></td>';
|
||||
}
|
||||
// Phone perso
|
||||
if (! empty($arrayfields['d.phone_perso']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_phone_perso" value="'.$search_phone_perso.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_phone_perso" value="'.$search_phone_perso.'"></td>';
|
||||
}
|
||||
// Phone mobile
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_phone_mobile" value="'.$search_phone_mobile.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_phone_mobile" value="'.$search_phone_mobile.'"></td>';
|
||||
}
|
||||
// Email
|
||||
if (! empty($arrayfields['d.email']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_email" value="'.$search_email.'" size="5"></td>';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_email" value="'.$search_email.'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.datefin']['checked']))
|
||||
@@ -597,7 +597,7 @@ print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $conf->liste_limit)
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@@ -749,7 +749,8 @@ while ($i < $num && $i < $conf->liste_limit)
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($datefin,'day');
|
||||
if ($memberstatic->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("SubscriptionLate"));
|
||||
$textlate .= ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay/60/60/24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay/60/60/24).' '.$langs->trans("days").')';
|
||||
print " ".img_warning($langs->trans("SubscriptionLate").$textlate);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ if ($rowid > 0)
|
||||
$sql.= " c.datef,";
|
||||
$sql.= " c.fk_bank,";
|
||||
$sql.= " b.rowid as bid,";
|
||||
$sql.= " ba.rowid as baid, ba.label, ba.bank";
|
||||
$sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.accountancy_journal, ba.number";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
@@ -807,7 +807,7 @@ if ($rowid > 0)
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
@@ -841,6 +841,10 @@ if ($rowid > 0)
|
||||
{
|
||||
$accountstatic->label=$objp->label;
|
||||
$accountstatic->id=$objp->baid;
|
||||
$accountstatic->number=$objp->number;
|
||||
$accountstatic->account_number=$objp->account_number;
|
||||
$accountstatic->accountancy_journal=$objp->accountancy_journal;
|
||||
$accountstatic->ref=$objp->ref;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
@@ -1035,7 +1039,7 @@ if ($rowid > 0)
|
||||
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
|
||||
|
||||
// No more action
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
|
||||
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>';
|
||||
|
||||
@@ -40,6 +40,7 @@ $action=GETPOST("action",'alpha');
|
||||
$rowid=GETPOST("rowid","int")?GETPOST("rowid","int"):GETPOST("id","int");
|
||||
$typeid=GETPOST("typeid","int");
|
||||
$cancel=GETPOST('cancel');
|
||||
$confirm=GETPOST('confirm');
|
||||
|
||||
if (! $user->rights->adherent->cotisation->lire)
|
||||
accessforbidden();
|
||||
@@ -62,10 +63,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include,
|
||||
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
||||
|
||||
|
||||
if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update' && ! $_POST["cancel"])
|
||||
if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $cancel)
|
||||
{
|
||||
// Charge objet actuel
|
||||
$result=$object->fetch($_POST["rowid"]);
|
||||
$result=$object->fetch($rowid);
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->begin();
|
||||
@@ -138,7 +139,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
|
||||
}
|
||||
}
|
||||
|
||||
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->adherent->cotisation->creer)
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent->cotisation->creer)
|
||||
{
|
||||
$result=$object->fetch($rowid);
|
||||
$result=$object->delete($user);
|
||||
@@ -189,11 +190,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');
|
||||
|
||||
print "\n";
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print "\n";
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur" colspan="3">';
|
||||
@@ -287,49 +288,50 @@ if ($rowid && $action != 'edit')
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur" colspan="3">';
|
||||
print $form->showrefnav($object, 'rowid', $linkback, 1);
|
||||
print '</td></tr>';
|
||||
dol_banner_tab($object, 'rowid', $linkback, 1);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Member
|
||||
$adh->ref=$adh->getFullName($langs);
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1,0,'subscription').'</td>';
|
||||
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1,0,'subscription').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date record
|
||||
/*print '<tr>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->datec,'dayhour').'</td>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->datec,'dayhour').'</td>';
|
||||
print '</tr>';*/
|
||||
|
||||
// Date subscription
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->dateh,'day').'</td>';
|
||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh,'day').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->datef,'day').'</td>';
|
||||
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur">'.dol_print_date($object->datef,'day').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="3">'.price($object->amount).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$object->note.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||
|
||||
// Bank line
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||
if ($object->fk_bank)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
@@ -346,6 +348,8 @@ if ($rowid && $action != 'edit')
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
||||
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -44,11 +44,12 @@ $search_email = GETPOST('search_email','alpha');
|
||||
$type = GETPOST('type','alpha');
|
||||
$status = GETPOST('status','alpha');
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
@@ -166,9 +167,6 @@ $form=new Form($db);
|
||||
// List of members type
|
||||
if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
{
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersTypes"));
|
||||
|
||||
//dol_fiche_head('');
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle, d.subscription, d.vote";
|
||||
@@ -179,8 +177,22 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$nbtotalofrecords = $num;
|
||||
|
||||
$i = 0;
|
||||
|
||||
$param = '';
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
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_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
@@ -213,6 +225,8 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -251,10 +265,10 @@ if ($action == 'create')
|
||||
print $form->selectyesno("vote",0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
||||
$doleditor->Create();
|
||||
@@ -298,20 +312,15 @@ if ($rowid > 0)
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td>';
|
||||
print $form->showrefnav($object, 'rowid', $linkback);
|
||||
print '</td></tr>';
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.dol_escape_htmltag($object->libelle).'</td></tr>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print yn($object->subscription);
|
||||
print '</tr>';
|
||||
|
||||
@@ -319,10 +328,10 @@ if ($rowid > 0)
|
||||
print yn($object->vote);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($object->note)."</td></tr>";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print nl2br($object->mail_valid)."</td></tr>";
|
||||
|
||||
// Other attributes
|
||||
@@ -378,9 +387,7 @@ if ($rowid > 0)
|
||||
$sql.= " AND t.rowid = ".$object->id;
|
||||
if ($sall)
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note_public LIKE '%".$sall."%' OR d.note_private LIKE '%".$sall."%')";
|
||||
$sql.=natural_search(array("f.firstname","d.lastname","d.societe","d.email","d.login","d.address","d.town","d.note_public","d.note_private"), $sall);
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
@@ -388,22 +395,22 @@ if ($rowid > 0)
|
||||
}
|
||||
if ($action == 'search')
|
||||
{
|
||||
if (isset($_POST['search']) && $_POST['search'] != '')
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$_POST['search']."%' OR d.lastname LIKE '%".$_POST['search']."%')";
|
||||
}
|
||||
if (GETPOST('search'))
|
||||
{
|
||||
$sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search'));
|
||||
}
|
||||
}
|
||||
if (! empty($search_lastname))
|
||||
{
|
||||
$sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
|
||||
$sql.= natural_search(array("d.firstname","d.lastname"), $search_lastname);
|
||||
}
|
||||
if (! empty($search_login))
|
||||
{
|
||||
$sql.= " AND d.login LIKE '%".$search_login."%'";
|
||||
$sql.= natural_search("d.login", $search_login);
|
||||
}
|
||||
if (! empty($search_email))
|
||||
{
|
||||
$sql.= " AND d.email LIKE '%".$search_email."%'";
|
||||
$sql.= natural_search("d.email", $search_email);
|
||||
}
|
||||
if ($filter == 'uptodate')
|
||||
{
|
||||
@@ -414,7 +421,7 @@ if ($rowid > 0)
|
||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||
}
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
@@ -654,10 +661,10 @@ if ($rowid > 0)
|
||||
print $form->selectyesno("vote",$object->vote,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('mail_valid',$object->mail_valid,'',280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,'90%');
|
||||
$doleditor->Create();
|
||||
|
||||
@@ -375,7 +375,7 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
|
||||
print '<td align="center"> </td>'."\n";
|
||||
print '<td align="right" class="nowrap">'."\n";
|
||||
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", '', 0, 1);
|
||||
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -329,7 +329,10 @@ print load_fiche_titre($langs->trans("BoxesAvailable"));
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||
print '<input type="hidden" name="action" value="add">'."\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="tagtable liste centpercent">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||
@@ -375,6 +378,8 @@ foreach($boxtoadd as $box)
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<div class="right">';
|
||||
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
|
||||
print '</div>'."\n";
|
||||
@@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
|
||||
print "<br>\n\n";
|
||||
print load_fiche_titre($langs->trans("BoxesActivated"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="tagtable liste">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||
@@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box)
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Other parameters
|
||||
|
||||
@@ -786,7 +786,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -952,7 +952,7 @@ else
|
||||
print '</tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="tdtop">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
@@ -182,6 +182,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@@ -297,6 +298,7 @@ if ($result)
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
@@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -112,7 +112,12 @@ $modules=array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS',
|
||||
'img' => 'trip'
|
||||
)
|
||||
),
|
||||
/* TODO Enable this
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',
|
||||
'img' => 'trip'
|
||||
)*/
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ $hookmanager->initHooks(array('admin'));
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,32,0);
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname=array();
|
||||
@@ -121,7 +121,7 @@ $tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
||||
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
||||
$tabname[30]= MAIN_DB_PREFIX."c_format_cards";
|
||||
//$tabname[31]= MAIN_DB_PREFIX."accounting_system";
|
||||
$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
|
||||
//$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
|
||||
$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
|
||||
$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
||||
|
||||
@@ -158,7 +158,7 @@ $tablib[28]= "DictionaryHolidayTypes";
|
||||
$tablib[29]= "DictionaryOpportunityStatus";
|
||||
$tablib[30]= "DictionaryFormatCards";
|
||||
//$tablib[31]= "DictionaryAccountancysystem";
|
||||
$tablib[32]= "DictionaryAccountancyCategory";
|
||||
//$tablib[32]= "DictionaryAccountancyCategory";
|
||||
$tablib[33]= "DictionaryDepartment";
|
||||
$tablib[34]= "DictionaryFunction";
|
||||
|
||||
@@ -195,7 +195,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new
|
||||
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
||||
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
||||
$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
||||
//$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
||||
$tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department";
|
||||
$tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
|
||||
|
||||
@@ -232,7 +232,7 @@ $tabsqlsort[28]="country ASC, code ASC";
|
||||
$tabsqlsort[29]="position ASC";
|
||||
$tabsqlsort[30]="code ASC";
|
||||
//$tabsqlsort[31]="pcg_version ASC";
|
||||
$tabsqlsort[32]="position ASC";
|
||||
//$tabsqlsort[32]="position ASC";
|
||||
$tabsqlsort[33]="code ASC";
|
||||
$tabsqlsort[34]="code ASC";
|
||||
|
||||
@@ -269,7 +269,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
|
||||
$tabfield[29]= "code,label,percent,position";
|
||||
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfield[31]= "pcg_version,label";
|
||||
$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
||||
//$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
||||
$tabfield[33]= "code,label";
|
||||
$tabfield[34]= "code,label";
|
||||
|
||||
@@ -306,7 +306,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
|
||||
$tabfieldvalue[29]= "code,label,percent,position";
|
||||
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfieldvalue[31]= "pcg_version,label";
|
||||
$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
||||
//$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
||||
$tabfieldvalue[33]= "code,label";
|
||||
$tabfieldvalue[34]= "code,label";
|
||||
|
||||
@@ -343,7 +343,7 @@ $tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country";
|
||||
$tabfieldinsert[29]= "code,label,percent,position";
|
||||
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfieldinsert[31]= "pcg_version,label";
|
||||
$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
||||
//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
||||
$tabfieldinsert[33]= "code,label";
|
||||
$tabfieldinsert[34]= "code,label";
|
||||
|
||||
@@ -382,7 +382,7 @@ $tabrowid[28]= "";
|
||||
$tabrowid[29]= "";
|
||||
$tabrowid[30]= "";
|
||||
//$tabrowid[31]= "";
|
||||
$tabrowid[32]= "";
|
||||
//$tabrowid[32]= "";
|
||||
$tabrowid[33]= "rowid";
|
||||
$tabrowid[34]= "rowid";
|
||||
|
||||
@@ -419,7 +419,7 @@ $tabcond[28]= ! empty($conf->holiday->enabled);
|
||||
$tabcond[29]= ! empty($conf->projet->enabled);
|
||||
$tabcond[30]= ! empty($conf->label->enabled);
|
||||
//$tabcond[31]= ! empty($conf->accounting->enabled);
|
||||
$tabcond[32]= ! empty($conf->accounting->enabled);
|
||||
//$tabcond[32]= ! empty($conf->accounting->enabled);
|
||||
$tabcond[33]= ! empty($conf->hrm->enabled);
|
||||
$tabcond[34]= ! empty($conf->hrm->enabled);
|
||||
|
||||
@@ -456,7 +456,7 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan
|
||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
//$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
|
||||
@@ -493,7 +493,7 @@ $tabfieldcheck[28] = array();
|
||||
$tabfieldcheck[29] = array();
|
||||
$tabfieldcheck[30] = array();
|
||||
//$tabfieldcheck[31] = array();
|
||||
$tabfieldcheck[32] = array();
|
||||
//$tabfieldcheck[32] = array();
|
||||
$tabfieldcheck[33] = array();
|
||||
$tabfieldcheck[34] = array();
|
||||
|
||||
@@ -675,8 +675,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
}
|
||||
|
||||
// Clean some parameters
|
||||
if (! empty($_POST["localtax1_type"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
||||
if (! empty($_POST["localtax2_type"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
||||
if ((! empty($_POST["localtax1_type"]) || ($_POST['localtax1_type'] == '0')) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
||||
if ((! empty($_POST["localtax2_type"]) || ($_POST['localtax2_type'] == '0')) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
|
||||
@@ -1064,6 +1064,8 @@ if ($id)
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||
|
||||
if ($id == 2) // Special cas for state page
|
||||
{
|
||||
@@ -1272,6 +1274,7 @@ if ($id)
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre">';
|
||||
$filterfound=0;
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
$showfield=1; // By defaut
|
||||
@@ -1282,21 +1285,25 @@ if ($id)
|
||||
{
|
||||
if ($value == 'country')
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
print '</td>';
|
||||
$filterfound++;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($id == 4) print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" colspan="2" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
if ($filterfound)
|
||||
{
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -1312,19 +1319,17 @@ if ($id)
|
||||
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||
{
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
|
||||
$tmpaction='edit';
|
||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
|
||||
// Show fields
|
||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||
|
||||
print '<td colspan="3" align="center">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||
@@ -1784,10 +1789,10 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||
print '<td><input type="text" class="flat" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" size="8" name="'.$fieldlist[$field].'"></td>';
|
||||
print '<td><input type="text" class="flat minwidth75" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||
print '<td><input type="text" class="flat" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
print '<td><input type="text" class="flat minwidth100" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field]=='unit') {
|
||||
print '<td>';
|
||||
@@ -1827,8 +1832,8 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
{
|
||||
print '<td>';
|
||||
$size=''; $class='';
|
||||
if ($fieldlist[$field]=='code') $size='size="8" ';
|
||||
if ($fieldlist[$field]=='position') $size='size="4" ';
|
||||
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
||||
if ($fieldlist[$field]=='position') $class='maxwidth50';
|
||||
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
|
||||
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
|
||||
if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
|
||||
|
||||
@@ -46,14 +46,17 @@ $action=GETPOST('action');
|
||||
*/
|
||||
|
||||
// positionne la variable pour le nombre de rss externes
|
||||
$sql ="SELECT MAX(".$db->decrypt('name').") as name FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql ="SELECT ".$db->decrypt('name')." as name FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE ".$db->decrypt('name')." LIKE 'EXTERNAL_RSS_URLRSS_%'";
|
||||
$result=$db->query($sql);
|
||||
//print $sql;
|
||||
$result=$db->query($sql); // We can't use SELECT MAX() because EXTERNAL_RSS_URLRSS_10 is lower than EXTERNAL_RSS_URLRSS_9
|
||||
if ($result)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
preg_match('/([0-9]+)$/i',$obj->name,$reg);
|
||||
if ($reg[1]) $lastexternalrss = $reg[1];
|
||||
while ($obj = $db->fetch_object($result))
|
||||
{
|
||||
preg_match('/([0-9]+)$/i',$obj->name,$reg);
|
||||
if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -404,7 +404,7 @@ if ($action == 'edit')
|
||||
$var=!$var;
|
||||
$liste = array();
|
||||
$liste['user'] = $langs->trans('UserEmail');
|
||||
$liste['company'] = $langs->trans('CompanyEmail');
|
||||
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||
|
||||
print '<tr '.$bc[$var?1:0].'><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
||||
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE',$liste,$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE,0);
|
||||
@@ -619,6 +619,12 @@ else
|
||||
print '</div>';
|
||||
|
||||
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
$text = $langs->trans("WarningPHPMail");
|
||||
print info_admin($text);
|
||||
}
|
||||
|
||||
// Run the test to connect
|
||||
if ($action == 'testconnect')
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ if ($action == 'up')
|
||||
// Get current position
|
||||
$sql = "SELECT m.rowid, m.position, m.type, m.fk_menu";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE m.rowid = ".$_GET["menuId"];
|
||||
$sql.= " WHERE m.rowid = ".GETPOST("menuId","int");
|
||||
dol_syslog("admin/menus/index.php ".$sql);
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows($result);
|
||||
@@ -89,11 +89,11 @@ if ($action == 'up')
|
||||
// Menu before
|
||||
$sql = "SELECT m.rowid, m.position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".$_GET["menuId"]."))";
|
||||
$sql.= " AND m.menu_handler='".$menu_handler_to_search."'";
|
||||
$sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId","int")."))";
|
||||
$sql.= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'";
|
||||
$sql.= " AND m.entity = ".$conf->entity;
|
||||
$sql.= " AND m.type = '".$current['type']."'";
|
||||
$sql.= " AND m.fk_menu = '".$current['fk_menu']."'";
|
||||
$sql.= " AND m.type = '".$db->escape($current['type'])."'";
|
||||
$sql.= " AND m.fk_menu = '".$db->escape($current['fk_menu'])."'";
|
||||
$sql.= " ORDER BY m.position, m.rowid";
|
||||
dol_syslog("admin/menus/index.php ".$sql);
|
||||
$result = $db->query($sql);
|
||||
@@ -127,7 +127,7 @@ elseif ($action == 'down')
|
||||
// Get current position
|
||||
$sql = "SELECT m.rowid, m.position, m.type, m.fk_menu";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE m.rowid = ".$_GET["menuId"];
|
||||
$sql.= " WHERE m.rowid = ".GETPOST("menuId","int");
|
||||
dol_syslog("admin/menus/index.php ".$sql);
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows($result);
|
||||
@@ -145,11 +145,11 @@ elseif ($action == 'down')
|
||||
// Menu after
|
||||
$sql = "SELECT m.rowid, m.position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".$_GET["menuId"]."))";
|
||||
$sql.= " AND m.menu_handler='".$menu_handler_to_search."'";
|
||||
$sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId","int")."))";
|
||||
$sql.= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'";
|
||||
$sql.= " AND m.entity = ".$conf->entity;
|
||||
$sql.= " AND m.type = '".$current['type']."'";
|
||||
$sql.= " AND m.fk_menu = '".$current['fk_menu']."'";
|
||||
$sql.= " AND m.type = '".$db->escape($current['type'])."'";
|
||||
$sql.= " AND m.fk_menu = '".$db->escape($current['fk_menu'])."'";
|
||||
$sql.= " ORDER BY m.position, m.rowid";
|
||||
dol_syslog("admin/menus/index.php ".$sql);
|
||||
$result = $db->query($sql);
|
||||
@@ -180,7 +180,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
|
||||
$db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";
|
||||
$sql.= " WHERE rowid = ".$_GET['menuId'];
|
||||
$sql.= " WHERE rowid = ".GETPOST('menuId','int');
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -245,11 +245,11 @@ if ($action == 'delete')
|
||||
{
|
||||
$sql = "SELECT m.titre";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE m.rowid = ".$_GET['menuId'];
|
||||
$sql.= " WHERE m.rowid = ".GETPOST('menuId','int');
|
||||
$result = $db->query($sql);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete");
|
||||
print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId','int'),$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete");
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
$sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.module";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE menu_handler = '".$menu_handler_to_search."'";
|
||||
$sql.= " WHERE menu_handler = '".$db->escape($menu_handler_to_search)."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
//$sql.= " AND fk_menu >= 0";
|
||||
$sql.= " ORDER BY m.position, m.rowid"; // Order is position then rowid (because we need a sort criteria when position is same)
|
||||
|
||||
@@ -319,7 +319,7 @@ if ($mode != 'marketplace')
|
||||
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||
$moreforfilter.= '</div>';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
|
||||
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
|
||||
$moreforfilter.= '</div>';
|
||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
{
|
||||
@@ -417,7 +417,7 @@ if ($mode != 'marketplace')
|
||||
{
|
||||
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
|
||||
$publisher=dol_escape_htmltag($objMod->getPublisher());
|
||||
if ($reg[1] && $reg[1] != $publisher) continue;
|
||||
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
|
||||
if (! $reg[1] && ! empty($publisher)) continue;
|
||||
}
|
||||
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
|
||||
@@ -485,23 +485,27 @@ if ($mode != 'marketplace')
|
||||
print '</td>';
|
||||
|
||||
// Name
|
||||
print '<td valign="top">'.$objMod->getName();
|
||||
print '<td class="tdtop">'.$objMod->getName();
|
||||
print "</td>\n";
|
||||
|
||||
// Desc
|
||||
print '<td valign="top">';
|
||||
print '<td class="tdtop">';
|
||||
print nl2br($objMod->getDesc());
|
||||
print "</td>\n";
|
||||
|
||||
// Help
|
||||
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
|
||||
$text='';
|
||||
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
||||
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||
|
||||
//if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
|
||||
//else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||
$text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
|
||||
|
||||
$textexternal='';
|
||||
$imginfo="info";
|
||||
if ($objMod->isCoreOrExternalModule() == 'external')
|
||||
{
|
||||
$imginfo="info_black";
|
||||
$textexternal.='<br><strong>'.$langs->trans("Origin").':</strong> '.$langs->trans("ExternalModule",$dirofmodule);
|
||||
if ($objMod->editor_name != 'dolibarr') $textexternal.='<br><strong>'.$langs->trans("Publisher").':</strong> '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name);
|
||||
if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='<br><strong>'.$langs->trans("Url").':</strong> '.$objMod->editor_url;
|
||||
@@ -645,7 +649,8 @@ if ($mode != 'marketplace')
|
||||
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
|
||||
$text.=$langs->trans("DetectionNotPossible");
|
||||
|
||||
print $form->textwithpicto('', $text, 1, 'help', 'minheight20');
|
||||
|
||||
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -659,8 +664,6 @@ if ($mode != 'marketplace')
|
||||
if (preg_match('/experimental/i', $version)) print img_warning($langs->trans("Experimental"), 'style="float: left"');
|
||||
if (preg_match('/deprecated/i', $version)) print img_warning($langs->trans("Deprecated"), 'style="float: left"');
|
||||
|
||||
// Picto external
|
||||
if ($textexternal) print img_picto($langs->trans("ExternalModule",$dirofmodule), 'external', 'style="float: left"');
|
||||
|
||||
print $versiontrans;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||
|
||||
|
||||
// Translations
|
||||
$langs->load("admin");
|
||||
$langs->load("multicurrency");
|
||||
|
||||
// Access control
|
||||
@@ -130,7 +131,7 @@ elseif ($action == 'synchronize')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('multicurrency_syncronize_error', $reponse->error->info), null, 'errors');
|
||||
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,8 +324,17 @@ print '<input type="text" name="rate" value="" size="13" placeholder="'.$langs->
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '</td></form></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$conf->currency.$form->textwithpicto(' ', $langs->trans("BaseCurrency")).'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
print '<td align="right" width="300">1';
|
||||
print '</td></form></tr>';
|
||||
|
||||
foreach ($TCurrency as &$currency)
|
||||
{
|
||||
if($currency->code == $conf->currency) continue;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$currency->code.' - '.$currency->name.'</td>';
|
||||
@@ -334,10 +344,12 @@ foreach ($TCurrency as &$currency)
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update_currency">';
|
||||
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
|
||||
print '<input type="text" name="rate" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13" /> ';
|
||||
print '1 '.$conf->currency.' = ';
|
||||
print '<input type="text" name="rate" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13" /> '.$currency->code.' ';
|
||||
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Modify").'"> ';
|
||||
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Delete").'">';
|
||||
print '</form>';
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,11 @@ if ($action == 'setvalue' && $user->admin)
|
||||
* View
|
||||
*/
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("PrintingSetup"));
|
||||
@@ -127,68 +132,177 @@ if ($mode == 'setup' && $user->admin)
|
||||
if (in_array($key[0], array_keys($supportedoauth2array))) $supported=1;
|
||||
if (! $supported) continue; // show only supported
|
||||
|
||||
|
||||
$OAUTH_SERVICENAME='Unknown';
|
||||
if ($key[0] == 'OAUTH_GITHUB_NAME')
|
||||
{
|
||||
$OAUTH_SERVICENAME='GitHub';
|
||||
$urltorenew=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?state=user,public_repo&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||
$urltodelete=$urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||
$urltocheckperms='https://github.com/settings/applications/';
|
||||
}
|
||||
if ($key[0] == 'OAUTH_GOOGLE_NAME')
|
||||
{
|
||||
$OAUTH_SERVICENAME='Google';
|
||||
$urltorenew=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||
$urltodelete=$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
|
||||
$urltocheckperms='https://security.google.com/settings/security/permissions';
|
||||
}
|
||||
|
||||
// Show value of token
|
||||
$tokenobj=null;
|
||||
// Token
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||
// Dolibarr storage
|
||||
$storage = new DoliStorage($db, $conf);
|
||||
try
|
||||
{
|
||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// Return an error if token not found
|
||||
}
|
||||
|
||||
// Set other properties
|
||||
$refreshtoken=false;
|
||||
$expiredat='';
|
||||
|
||||
$expire = false;
|
||||
// Is token expired or will token expire in the next 30 seconds
|
||||
if (is_object($tokenobj)) {
|
||||
$expire = ($tokenobj->getEndOfLife() !== $tokenobj::EOL_NEVER_EXPIRES && $tokenobj->getEndOfLife() !== $tokenobj::EOL_UNKNOWN && time() > ($tokenobj->getEndOfLife() - 30));
|
||||
}
|
||||
|
||||
if ($key[1] != '' && $key[2] != '') {
|
||||
if (is_object($tokenobj)) {
|
||||
$refreshtoken = $tokenobj->getRefreshToken();
|
||||
|
||||
$endoflife = $tokenobj->getEndOfLife();
|
||||
if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES)
|
||||
{
|
||||
$expiredat = $langs->trans("Never");
|
||||
}
|
||||
elseif ($endoflife == $tokenobj::EOL_UNKNOWN)
|
||||
{
|
||||
$expiredat = $langs->trans("Unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
$expiredat=dol_print_date($endoflife, "dayhour");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$submit_enabled=0;
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=setup&driver='.$driver.'" autocomplete="off">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setconst">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
$var=true;
|
||||
|
||||
$var=false;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
||||
print '<th>'.$langs->trans("Value").'</th>';
|
||||
print '<th> </th>';
|
||||
print '<th class="titlefieldcreate">'.$langs->trans($key[0]).'</th>';
|
||||
print '<th></th>';
|
||||
print '<th></th>';
|
||||
print "</tr>\n";
|
||||
$submit_enabled=0;
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td'.($key['required']?' class=required':'').'>'.$langs->trans($key['varname']).'</td>';
|
||||
print '<td>'.$langs->trans($key['info']).'</td>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("OAuthIDSecret").'</td>';
|
||||
print '<td>';
|
||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
||||
print $langs->trans("SeePreviousTab");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("IsTokenGenerated");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (is_object($tokenobj)) print $langs->trans("HasAccessToken");
|
||||
else print $langs->trans("NoAccessToken");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// Links to delete/checks token
|
||||
if (is_object($tokenobj))
|
||||
{
|
||||
// Delete remote tokens
|
||||
if (! empty($key['delete'])) print '<a class="button" href="'.$key['delete'].'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
||||
// Request remote token
|
||||
print '<a class="button" href="'.$key['renew'].'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
||||
// Check remote access
|
||||
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME_GOOGLE).': <a href="https://security.google.com/settings/security/permissions" target="_google">https://security.google.com/settings/security/permissions</a>';
|
||||
//test on $storage->hasAccessToken($OAUTH_SERVICENAME) ?
|
||||
print '<a class="button" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br><br>';
|
||||
}
|
||||
// Request remote token
|
||||
print '<a class="button" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br><br>';
|
||||
// Check remote access
|
||||
if ($urltocheckperms)
|
||||
{
|
||||
print $langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME).': <a href="'.$urltocheckperms.'" target="_'.strtolower($OAUTH_SERVICENAME).'">'.$urltocheckperms.'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("Token").'</td>';
|
||||
print '<td colspan="2">';
|
||||
if (is_object($tokenobj))
|
||||
{
|
||||
//var_dump($tokenobj);
|
||||
print $tokenobj->getAccessToken().'<br>';
|
||||
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
||||
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
||||
//var_dump($tokenobj->getExtraParams());
|
||||
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
||||
print ''.join(',',$tokenobj->getExtraParams());
|
||||
print '</textarea>';*/
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Show value of token
|
||||
if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS')
|
||||
if (is_object($tokenobj))
|
||||
{
|
||||
// Token
|
||||
// Token refresh
|
||||
$var = ! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("Token").'</td>';
|
||||
print '<td>';
|
||||
// Dolibarr storage
|
||||
$storage = new DoliStorage($db, $conf);
|
||||
try
|
||||
{
|
||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// Return an error if token not found
|
||||
}
|
||||
if (is_object($tokenobj))
|
||||
{
|
||||
//var_dump($tokenobj);
|
||||
print $tokenobj->getAccessToken().'<br>';
|
||||
//print 'Refresh: '.$tokenobj->getRefreshToken().'<br>';
|
||||
//print 'EndOfLife: '.$tokenobj->getEndOfLife().'<br>';
|
||||
//var_dump($tokenobj->getExtraParams());
|
||||
/*print '<br>Extra: <br><textarea class="quatrevingtpercent">';
|
||||
print ''.join(',',$tokenobj->getExtraParams());
|
||||
print '</textarea>';*/
|
||||
}
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("TOKEN_REFRESH").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print yn($refreshtoken);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '</tr>';
|
||||
|
||||
// Token expired
|
||||
$var = ! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("TOKEN_EXPIRED").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print yn($expire);
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
print '</tr>';
|
||||
|
||||
// Token expired at
|
||||
$var = ! $var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td'.($key['required']?' class="required"':'').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("TOKEN_EXPIRE_AT").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $expiredat;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@@ -200,6 +314,7 @@ if ($mode == 'setup' && $user->admin)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ if (!$user->admin) accessforbidden();
|
||||
if ($action == 'add')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1";
|
||||
$sql.= " WHERE id = ".$_GET["pid"];
|
||||
$sql.= " WHERE id = ".GETPOST("pid",'int');
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$db->query($sql);
|
||||
}
|
||||
@@ -52,7 +52,7 @@ if ($action == 'add')
|
||||
if ($action == 'remove')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=0";
|
||||
$sql.= " WHERE id = ".$_GET["pid"];
|
||||
$sql.= " WHERE id = ".GETPOST('pid','int');
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$db->query($sql);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
|
||||
// Show warning about external users
|
||||
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Affiche lignes des permissions
|
||||
@@ -215,8 +215,9 @@ if ($result)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -86,12 +86,12 @@ if ($sfurl)
|
||||
}
|
||||
print ')';
|
||||
}
|
||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
||||
print ' ('.$langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>)<br>';
|
||||
}
|
||||
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
|
||||
|
||||
|
||||
print '</ul>';
|
||||
|
||||
@@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
|
||||
|
||||
// Browser
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
$var=!$var;
|
||||
@@ -71,10 +72,10 @@ print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("Screen").'</td><td col
|
||||
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -90,7 +90,8 @@ $configfileparameters=array(
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'separator',
|
||||
'?dolibarr_mailing_limit_sendbyweb',
|
||||
'?dolibarr_strict_mode'
|
||||
'?dolibarr_mailing_limit_sendbycli',
|
||||
'?dolibarr_strict_mode'
|
||||
);
|
||||
$configfilelib=array(
|
||||
// 'separator',
|
||||
|
||||
@@ -81,7 +81,8 @@ else
|
||||
{
|
||||
if ($base == 1)
|
||||
{
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||
@@ -134,11 +135,13 @@ else
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($base == 2)
|
||||
{
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>Nb of tuples</td>';
|
||||
@@ -173,12 +176,14 @@ else
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($base == 4)
|
||||
{
|
||||
// Sqlite by PDO or by Sqlite3
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||
@@ -207,6 +212,8 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ llxHeader();
|
||||
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
|
||||
|
||||
// Database
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
|
||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
|
||||
@@ -54,14 +55,16 @@ print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.pr
|
||||
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
||||
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
// Tables
|
||||
print '<br>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
|
||||
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
$listofvars=$db->getServerParametersValues();
|
||||
$listofstatus=$db->getServerStatusValues();
|
||||
@@ -76,6 +79,7 @@ else
|
||||
foreach($arraylist as $listname)
|
||||
{
|
||||
print '<br>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
||||
@@ -120,6 +124,7 @@ else
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup');
|
||||
|
||||
// Version
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
$var=!$var;
|
||||
@@ -69,10 +70,12 @@ else
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
// Session
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
$var=!$var;
|
||||
@@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val)
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
$shmoparray=dol_listshmop();
|
||||
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
|
||||
@@ -133,12 +138,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
// Localisation
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
$var=!$var;
|
||||
@@ -234,6 +241,7 @@ if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_F
|
||||
print '<tr '.$bc[$var].'><td> => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -257,6 +265,7 @@ $configfileparameters=array(
|
||||
'?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
|
||||
'separator2' => '',
|
||||
'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
|
||||
'?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
|
||||
'separator'=> '',
|
||||
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
|
||||
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
|
||||
@@ -286,11 +295,13 @@ $configfileparameters=array(
|
||||
'separator4' => '',
|
||||
'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
|
||||
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
|
||||
'?dolibarr_strict_mode' => 'Strict mode is on/off',
|
||||
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
|
||||
'?dolibarr_strict_mode' => 'Strict mode is on/off',
|
||||
'?dolibarr_pdf_force_fpdf' => 'Force fpdf usage to generate PDF'
|
||||
);
|
||||
|
||||
$var=true;
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
|
||||
@@ -308,7 +319,11 @@ foreach($configfileparameters as $key => $value)
|
||||
{
|
||||
$newkey = preg_replace('/^\?/','',$key);
|
||||
|
||||
if (preg_match('/^\?/',$key) && empty(${$newkey})) continue; // We discard parametes starting with ?
|
||||
if (preg_match('/^\?/',$key) && empty(${$newkey}))
|
||||
{
|
||||
if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled))
|
||||
continue; // We discard parameters starting with ?
|
||||
}
|
||||
if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
|
||||
|
||||
$var=!$var;
|
||||
@@ -352,11 +367,13 @@ foreach($configfileparameters as $key => $value)
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
// Parameters in database
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
|
||||
@@ -406,7 +423,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -75,33 +75,40 @@ $file_list = array('missing' => array(), 'updated' => array());
|
||||
|
||||
// File to analyze
|
||||
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
|
||||
$xmlshortfile = '/install/filelist-'.DOL_VERSION.'.xml';
|
||||
$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
|
||||
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||
$xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||
|
||||
|
||||
// Test if remote test is ok
|
||||
$enableremotecheck = True;
|
||||
if (preg_match('/beta|alpha/i', DOL_VERSION)) $enableremotecheck=False;
|
||||
|
||||
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
|
||||
$enableremotecheck = true;
|
||||
|
||||
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
||||
if (dol_is_file($xmlfile))
|
||||
{
|
||||
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span><br>';
|
||||
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile;
|
||||
if (! GETPOST('xmlshortfile')) print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
|
||||
print '<br>';
|
||||
}
|
||||
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||
if ($enableremotecheck)
|
||||
{
|
||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
|
||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = ';
|
||||
print '<input name="xmlremote" class="flat quatrevingtpercent" value="'.$xmlremote.'"><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote.' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span><br>';
|
||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
|
||||
if (! GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
|
||||
print '<br>';
|
||||
}
|
||||
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
||||
print '</form>';
|
||||
@@ -128,7 +135,8 @@ if (GETPOST('target') == 'remote')
|
||||
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
||||
{
|
||||
$xmlfile = $xmlarray['content'];
|
||||
$xml = simplexml_load_file($xmlfile);
|
||||
//print "eee".$xmlfile."eee";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,24 +149,33 @@ if (GETPOST('target') == 'remote')
|
||||
|
||||
if ($xml)
|
||||
{
|
||||
$checksumconcat = array();
|
||||
|
||||
// Scan htdocs
|
||||
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
||||
{
|
||||
$file_list = array();
|
||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0]); // Fill array $file_list
|
||||
$file_list = array();
|
||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
|
||||
|
||||
print_fiche_titre($langs->trans("FilesMissing"));
|
||||
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans("FilesMissing") . '</td>';
|
||||
print '<td>#</td>';
|
||||
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||
print '</tr>'."\n";
|
||||
$var = true;
|
||||
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
|
||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($tmpfilelist as $file)
|
||||
{
|
||||
$i++;
|
||||
$var = !$var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>'.$i.'</td>' . "\n";
|
||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||
print "</tr>\n";
|
||||
@@ -166,28 +183,34 @@ if ($xml)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr ' . $bc[false] . '><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr ' . $bc[false] . '><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("FilesUpdated"));
|
||||
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans("FilesUpdated") . '</td>';
|
||||
print '<td>#</td>';
|
||||
print '<td>' . $langs->trans("Filename") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("Size") . '</td>';
|
||||
print '<td align="right">' . $langs->trans("DateModification") . '</td>';
|
||||
print '</tr>'."\n";
|
||||
$var = true;
|
||||
$tmpfilelist = dol_sort_array($file_list['updated'], 'filename');
|
||||
if (is_array($tmpfilelist) && count($tmpfilelist))
|
||||
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
|
||||
if (is_array($tmpfilelist2) && count($tmpfilelist2))
|
||||
{
|
||||
foreach ($tmpfilelist as $file)
|
||||
$i = 0;
|
||||
foreach ($tmpfilelist2 as $file)
|
||||
{
|
||||
$i++;
|
||||
$var = !$var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>'.$i.'</td>' . "\n";
|
||||
print '<td>'.$file['filename'].'</td>' . "\n";
|
||||
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||
print '<td align="center">'.$file['md5'].'</td>' . "\n";
|
||||
@@ -201,12 +224,42 @@ if ($xml)
|
||||
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
if (empty($tmpfilelist) && empty($tmpfilelist2))
|
||||
{
|
||||
setEventMessage($langs->trans("FileIntegrityIsStrictlyConformedWithReference"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Scan scripts
|
||||
/*
|
||||
if (is_object($xml->dolibarr_script_dir[0]))
|
||||
{
|
||||
$file_list = array();
|
||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
|
||||
}*/
|
||||
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
//var_dump($checksumconcat);
|
||||
$checksumget = md5(join(',',$checksumconcat));
|
||||
$checksumtoget = $xml->dolibarr_htdocs_dir_checksum;
|
||||
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
||||
print $langs->trans("ExpectedChecksum").' = '. ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")) .'<br>';
|
||||
print $langs->trans("CurrentChecksum").' = '.$checksumget;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,12 +276,14 @@ exit($error);
|
||||
* Function to get list of updated or modified files.
|
||||
* $file_list is used as global variable
|
||||
*
|
||||
* @param array $file_list Array for response
|
||||
* @param SimpleXMLElement $dir SimpleXMLElement of files to test
|
||||
* @param string $path Path of file
|
||||
* @return array Array of filenames
|
||||
* @param array $file_list Array for response
|
||||
* @param SimpleXMLElement $dir SimpleXMLElement of files to test
|
||||
* @param string $path Path of files relative to $pathref. We start with ''. Used by recursive calls.
|
||||
* @param string $pathref Path ref (DOL_DOCUMENT_ROOT)
|
||||
* @param array $checksumconcat Array of checksum
|
||||
* @return array Array of filenames
|
||||
*/
|
||||
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
|
||||
function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathref = '', &$checksumconcat = array())
|
||||
{
|
||||
$exclude = 'install';
|
||||
|
||||
@@ -236,20 +291,21 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
|
||||
{
|
||||
$filename = $path.$file['name'];
|
||||
|
||||
if (preg_match('#'.$exclude.'#', $filename)) continue;
|
||||
//if (preg_match('#'.$exclude.'#', $filename)) continue;
|
||||
|
||||
if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename))
|
||||
if (!file_exists($pathref.'/'.$filename))
|
||||
{
|
||||
$file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
|
||||
}
|
||||
else
|
||||
{
|
||||
$md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename);
|
||||
$md5_local = md5_file($pathref.'/'.$filename);
|
||||
if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
|
||||
}
|
||||
$checksumconcat[] = $md5_local;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/');
|
||||
foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/', $pathref, $checksumconcat);
|
||||
|
||||
return $file_list;
|
||||
}
|
||||
|
||||
@@ -102,6 +102,8 @@ foreach($modulesdir as $dir)
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Modules").'</td>';
|
||||
@@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name)
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
sort($rights_ids);
|
||||
$old='';
|
||||
|
||||
@@ -68,8 +68,8 @@ print '<br>';
|
||||
$phparray=phpinfo_array();
|
||||
foreach($phparray as $key => $value)
|
||||
{
|
||||
//print load_fiche_titre($key);
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
|
||||
print '<td width="220px">'.$key.'</td>';
|
||||
@@ -114,7 +114,9 @@ foreach($phparray as $key => $value)
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
||||
?>
|
||||
<table class="centpercent">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<td class="tdtop">
|
||||
|
||||
<div id="div_container_exportoptions">
|
||||
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
|
||||
@@ -179,7 +179,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td valign="top">
|
||||
<td class="tdtop">
|
||||
|
||||
|
||||
<div id="div_container_sub_exportoptions">
|
||||
|
||||
@@ -86,7 +86,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
||||
|
||||
<?php print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b>'; ?><br><br>
|
||||
|
||||
<table><tr><td valign="top">
|
||||
<table><tr><td class="tdtop">
|
||||
|
||||
<?php if ($conf->use_javascript_ajax) { ?>
|
||||
<div id="div_container_exportoptions">
|
||||
@@ -120,7 +120,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</td><td valign="top">
|
||||
</td><td class="tdtop">
|
||||
|
||||
|
||||
<div id="div_container_sub_exportoptions">
|
||||
|
||||
@@ -174,6 +174,15 @@ if ($search_user) { $usefilter++; $sql.=natural_search("u.login", $search_user,
|
||||
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
|
||||
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}*/
|
||||
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
//print $sql;
|
||||
$result = $db->query($sql);
|
||||
@@ -195,7 +204,7 @@ if ($result)
|
||||
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
|
||||
}
|
||||
|
||||
print_barre_liste($langs->trans("ListOfSecurityEvents").' ('.$num.')', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, 0, 'setup');
|
||||
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup');
|
||||
|
||||
if ($action == 'purge')
|
||||
{
|
||||
@@ -204,6 +213,8 @@ if ($result)
|
||||
}
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
||||
@@ -303,7 +314,10 @@ if ($result)
|
||||
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
||||
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
||||
}
|
||||
print "</table></form>";
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
print "</form>";
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -39,7 +39,7 @@ if (GETPOST('msg','alpha')) {
|
||||
}
|
||||
|
||||
|
||||
$urldolibarr='http://www.dolibarr.org/downloads/';
|
||||
$urldolibarr='https://www.dolibarr.org/downloads/';
|
||||
$urldolibarrmodules='https://www.dolistore.com/';
|
||||
$urldolibarrthemes='https://www.dolistore.com/';
|
||||
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
|
||||
@@ -69,12 +69,18 @@ if ($action=='install')
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! preg_match('/\.zip/i',$original_file))
|
||||
if (! preg_match('/\.zip$/i',$original_file))
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! preg_match('/module_.*\-[\d]+\.[\d]+.*$/i',$original_file))
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -117,7 +123,7 @@ if ($action=='install')
|
||||
//var_dump($modulenamedir);
|
||||
if (! dol_is_dir($modulenamedir))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat").'<br>Dir not found: '.$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename.'<br>'.$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -143,7 +149,7 @@ if ($action=='install')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs');
|
||||
setEventMessages($langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +176,8 @@ print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
|
||||
|
||||
if (function_exists('curl_init'))
|
||||
{
|
||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||
|
||||
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
@@ -281,26 +289,32 @@ if ($allowfromweb < 1)
|
||||
|
||||
if ($allowfromweb >= 0)
|
||||
{
|
||||
if ($allowfromweb == 1) print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
else print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
}
|
||||
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
print $langs->trans("UnpackPackageInDolibarrRoot",$dirins).'<br>';
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnpackPackageInDolibarrRoot",$dirins).'<br>';
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUE ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')";
|
||||
$result = $db->query($sql);
|
||||
if ($result > 0)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
||||
$interfaces = new Interfaces($db);
|
||||
$triggers = $interfaces->getTriggersList();
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">
|
||||
<tr class="liste_titre">
|
||||
<td colspan="2">'.$langs->trans("File").'</td>
|
||||
@@ -66,9 +67,9 @@ foreach ($triggers as $trigger)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
||||
print '<td valign="top">'.$trigger['file'].'</td>';
|
||||
print '<td class="tdtop">'.$trigger['file'].'</td>';
|
||||
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
||||
print '<td valign="top">';
|
||||
print '<td class="tdtop">';
|
||||
$text=$trigger['info'];
|
||||
$text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
|
||||
//$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
|
||||
@@ -78,6 +79,7 @@ foreach ($triggers as $trigger)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ class DolibarrApi
|
||||
$feature2 = explode("|", $feature2);
|
||||
}
|
||||
|
||||
return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray,$resource_id,$dbtablename,$feature2,$dbt_keyfield,$dbt_select);
|
||||
return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray, $resource_id, $dbtablename, $feature2, $dbt_keyfield, $dbt_select);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,12 +76,34 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
|
||||
$userClass = Defaults::$userIdentifierClass;
|
||||
|
||||
/*foreach ($_SERVER as $key => $val)
|
||||
{
|
||||
dol_syslog($key.' - '.$val);
|
||||
}*/
|
||||
|
||||
// api key can be provided in url with parameter api_key=xxx or ni header with header DOLAPIKEY:xxx
|
||||
$api_key = '';
|
||||
if (isset($_GET['api_key']))
|
||||
{
|
||||
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||
$api_key = $_GET['api_key']; // For backward compatibility
|
||||
}
|
||||
if (isset($_GET['DOLAPIKEY']))
|
||||
{
|
||||
// TODO Add option to disable use of api key on url. Return errors if used.
|
||||
$api_key = $_GET['DOLAPIKEY']; // With GET method
|
||||
}
|
||||
if (isset($_SERVER['HTTP_DOLAPIKEY']))
|
||||
{
|
||||
$api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded)
|
||||
}
|
||||
|
||||
if ($api_key)
|
||||
{
|
||||
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
||||
$sql.= " u.tms as date_modification, u.entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.api_key = '".$db->escape($_GET['api_key'])."'";
|
||||
$sql.= " WHERE u.api_key = '".$db->escape($api_key)."'";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@@ -97,8 +119,8 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
||||
}
|
||||
|
||||
if ($stored_key != $_GET['api_key']) {
|
||||
$userClass::setCacheIdentifier($_GET['api_key']);
|
||||
if ($stored_key != $api_key) {
|
||||
$userClass::setCacheIdentifier($api_key);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -121,7 +143,7 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RestException(401, "Failed to login to API. No parameter 'api_key' provided");
|
||||
throw new RestException(401, "Failed to login to API. No parameter 'DOLAPIKEY' on HTTP header (neither in URL).");
|
||||
}
|
||||
|
||||
$userClass::setCacheIdentifier(static::$role);
|
||||
|
||||
@@ -34,12 +34,14 @@ class Login
|
||||
/**
|
||||
* Login
|
||||
*
|
||||
* Log user with username and password
|
||||
* Request the API token for a couple username / password.
|
||||
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||
* Both method are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
|
||||
*
|
||||
* @param string $login Username
|
||||
* @param string $login User login
|
||||
* @param string $password User password
|
||||
* @param int $entity Entity (when multicompany module is used). Empty means 1=first company.
|
||||
* @param int $reset Reset token (0=get current token, 1=ask a new token, meaning that all future access using current token will failed)
|
||||
* @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)
|
||||
* @return array Response status and user token
|
||||
*
|
||||
* @throws RestException
|
||||
|
||||
@@ -56,6 +56,16 @@ if (empty($conf->global->MAIN_MODULE_API))
|
||||
exit;
|
||||
}
|
||||
|
||||
// Test if explorer is not disabled
|
||||
if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($conf->global->API_EXPLORER_DISABLED))
|
||||
{
|
||||
$langs->load("admin");
|
||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||
print $langs->trans("WarningAPIExplorerDisabled").'.<br><br>';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$api = new DolibarrApi($db);
|
||||
|
||||
|
||||
@@ -85,10 +85,10 @@ if (! isset($conf->global->ASTERISK_PRIORITY)) $conf->global->ASTERISK_PRIORITY
|
||||
if (! isset($conf->global->ASTERISK_MAX_RETRY)) $conf->global->ASTERISK_MAX_RETRY="2";
|
||||
|
||||
|
||||
$login = $_GET['login'];
|
||||
$password = $_GET['password'];
|
||||
$caller = $_GET['caller'];
|
||||
$called = $_GET['called'];
|
||||
$login = GETPOST('login');
|
||||
$password = GETPOST('password');
|
||||
$caller = GETPOST('caller');
|
||||
$called = GETPOST('called');
|
||||
|
||||
// IP address of Asterisk server
|
||||
$strHost = $conf->global->ASTERISK_HOST;
|
||||
|
||||
@@ -44,7 +44,7 @@ $userid=GETPOST("userid","int");
|
||||
$position=GETPOST("position","int");
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
|
||||
$bookmark=new Bookmark($db);
|
||||
$object=new Bookmark($db);
|
||||
|
||||
|
||||
/*
|
||||
@@ -69,14 +69,14 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == 'update') $bookmark->fetch($_POST["id"]);
|
||||
if ($action == 'update') $object->fetch(GETPOST("id",'int'));
|
||||
// Check if null because user not admin can't set an user and send empty value here.
|
||||
if(!empty($userid))
|
||||
$bookmark->fk_user=$userid;
|
||||
$bookmark->title=$title;
|
||||
$bookmark->url=$url;
|
||||
$bookmark->target=$target;
|
||||
$bookmark->position=$position;
|
||||
$object->fk_user=$userid;
|
||||
$object->title=$title;
|
||||
$object->url=$url;
|
||||
$object->target=$target;
|
||||
$object->position=$position;
|
||||
|
||||
if (! $title) {
|
||||
$error++;
|
||||
@@ -90,10 +90,10 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$bookmark->favicon='none';
|
||||
$object->favicon='none';
|
||||
|
||||
if ($action == 'update') $res=$bookmark->update();
|
||||
else $res=$bookmark->create();
|
||||
if ($action == 'update') $res=$object->update();
|
||||
else $res=$object->create();
|
||||
|
||||
if ($res > 0)
|
||||
{
|
||||
@@ -103,14 +103,14 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
if ($object->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($bookmark->error, $bookmark->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
$action = $invertedaction;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ $form=new Form($db);
|
||||
$head = array();
|
||||
$h=1;
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].($bookmark->id?'id='.$bookmark->id:'');
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id?'id='.$object->id:'');
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
@@ -157,7 +157,7 @@ if ($action == 'create')
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat" name="url" size="50" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||
|
||||
@@ -172,7 +172,7 @@ if ($action == 'create')
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
||||
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$object->position).'">';
|
||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@@ -193,8 +193,9 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
/*
|
||||
* Fact bookmark mode or visually edition
|
||||
*/
|
||||
$bookmark->fetch($id);
|
||||
$object->fetch($id);
|
||||
|
||||
$hselected = 'card';
|
||||
$head = array(
|
||||
array(
|
||||
'',
|
||||
@@ -208,18 +209,22 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
|
||||
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$bookmark->id.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/card.php?id='.$object->id.'">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
|
||||
|
||||
print '<tr><td>';
|
||||
print '<tr><td class="titlefield">';
|
||||
if ($action == 'edit') {
|
||||
print '<span class="fieldrequired">';
|
||||
}
|
||||
@@ -231,8 +236,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
}
|
||||
|
||||
print '</td><td>';
|
||||
if ($action == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">';
|
||||
else print $bookmark->title;
|
||||
if ($action == 'edit') print '<input class="flat minwidth200" name="title" value="'.(isset($_POST["title"])?GETPOST("title",'',2):$object->title).'">';
|
||||
else print $object->title;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>';
|
||||
@@ -244,34 +249,34 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
print '</span>';
|
||||
}
|
||||
print '</td><td>';
|
||||
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
|
||||
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
|
||||
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$object->url).'">';
|
||||
else print '<a href="'.(preg_match('/^http/i',$object->url)?$object->url:DOL_URL_ROOT.$object->url).'"'.($object->target?' target="_blank"':'').'>'.$object->url.'</a>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
||||
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$bookmark->target);
|
||||
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$object->target);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($bookmark->target == 0) print $langs->trans("ReplaceWindow");
|
||||
if ($bookmark->target == 1) print $langs->trans("OpenANewWindow");
|
||||
if ($object->target == 0) print $langs->trans("ReplaceWindow");
|
||||
if ($object->target == 1) print $langs->trans("OpenANewWindow");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||
if ($action == 'edit' && $user->admin)
|
||||
{
|
||||
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print $form->select_dolusers(isset($_POST['userid'])?$_POST['userid']:($object->fk_user?$object->fk_user:''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($bookmark->fk_user)
|
||||
if ($object->fk_user)
|
||||
{
|
||||
$fuser=new User($db);
|
||||
$fuser->fetch($bookmark->fk_user);
|
||||
$fuser->fetch($object->fk_user);
|
||||
print $fuser->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
@@ -283,12 +288,12 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
||||
else print $bookmark->position;
|
||||
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$object->position).'">';
|
||||
else print $object->position;
|
||||
print '</td></tr>';
|
||||
|
||||
// Date creation
|
||||
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($bookmark->datec,'dayhour').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>'.dol_print_date($object->datec,'dayhour').'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -301,18 +306,20 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
}
|
||||
|
||||
|
||||
// Buttons
|
||||
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
// Edit
|
||||
if ($user->rights->bookmark->creer && $action != 'edit')
|
||||
{
|
||||
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$bookmark->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
||||
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$object->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
||||
}
|
||||
|
||||
// Remove
|
||||
if ($user->rights->bookmark->supprimer && $action != 'edit')
|
||||
{
|
||||
print " <a class=\"butActionDelete\" href=\"list.php?bid=".$bookmark->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||
print " <a class=\"butActionDelete\" href=\"list.php?bid=".$object->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@@ -26,8 +26,13 @@
|
||||
/**
|
||||
* Class to manage bookmarks
|
||||
*/
|
||||
class Bookmark
|
||||
class Bookmark extends CommonObject
|
||||
{
|
||||
public $element='bookmark';
|
||||
public $table_element='bookmark';
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
public $picto = 'bookmark';
|
||||
|
||||
var $db;
|
||||
|
||||
var $id;
|
||||
@@ -228,4 +233,15 @@ class Bookmark
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of contact status
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of contact status
|
||||
*/
|
||||
function getLibStatut($mode)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ li.menu_choix0 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* ------------------- R<EFBFBD>capitulatif des articles ------------------- */
|
||||
/* ------------------- Remind of products ------------------- */
|
||||
.liste_articles {
|
||||
min-width: 215px;
|
||||
float: right;
|
||||
@@ -212,6 +212,10 @@ p.titre {
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
.blocksellfinished {
|
||||
min-width: 215px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.titre1 {
|
||||
font-weight: bold;
|
||||
color: #ff9900;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user