mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-06 15:17:02 +00:00
Compare commits
1314 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e680be54ad | ||
|
|
3224795368 | ||
|
|
ec5bd78a33 | ||
|
|
d0c5d2aace | ||
|
|
ed4ce1a36e | ||
|
|
a6d7f91a58 | ||
|
|
f6f6c2b2ac | ||
|
|
8c628df639 | ||
|
|
ffd3f762ce | ||
|
|
24628a8487 | ||
|
|
573d147dad | ||
|
|
4ab767e95b | ||
|
|
18b64238ee | ||
|
|
65ded811b4 | ||
|
|
57f454693a | ||
|
|
b6409b5cba | ||
|
|
e6a83f7d19 | ||
|
|
c39e1d140f | ||
|
|
1c69f1ca95 | ||
|
|
a21c071349 | ||
|
|
741a6d5dab | ||
|
|
0c0a602330 | ||
|
|
7d13018eba | ||
|
|
44c65c0117 | ||
|
|
e9e758c4b3 | ||
|
|
7e7acb8d28 | ||
|
|
1ab897db28 | ||
|
|
1a990850ca | ||
|
|
36e360e167 | ||
|
|
9ffdb1a1f0 | ||
|
|
64b15f9282 | ||
|
|
e8ebe51f1c | ||
|
|
ec2a7d2f48 | ||
|
|
6782e7c15c | ||
|
|
3c73e3e8cf | ||
|
|
4ab7d19776 | ||
|
|
34e33bd13a | ||
|
|
49fa22fa3d | ||
|
|
10fcd79155 | ||
|
|
6cdc8f2823 | ||
|
|
d611ebfc86 | ||
|
|
599a7c6080 | ||
|
|
4c21f1192d | ||
|
|
63e78baf21 | ||
|
|
fa2c689a34 | ||
|
|
a53b440b8b | ||
|
|
8189832af2 | ||
|
|
135f869e1a | ||
|
|
2d56525a25 | ||
|
|
03773dd929 | ||
|
|
5b8dba68f3 | ||
|
|
f63c75e18d | ||
|
|
6dd0bd8b90 | ||
|
|
94e86f875a | ||
|
|
b582b20003 | ||
|
|
e58e82eea1 | ||
|
|
dddc4feda8 | ||
|
|
a65421a268 | ||
|
|
b6696dcc26 | ||
|
|
4e3d8fb98f | ||
|
|
e0aaff932e | ||
|
|
17ea760851 | ||
|
|
f3d11aede3 | ||
|
|
8053d65f33 | ||
|
|
01809d2cc3 | ||
|
|
ac8e3d1a69 | ||
|
|
b669ccf733 | ||
|
|
8c42c6bf0b | ||
|
|
97bdd22795 | ||
|
|
0f3cd7913c | ||
|
|
502cfc8d76 | ||
|
|
d31e826305 | ||
|
|
28a62a2581 | ||
|
|
deff6bad36 | ||
|
|
f2bc80b7d9 | ||
|
|
b5b5cac0ac | ||
|
|
308f30510b | ||
|
|
574513a9c8 | ||
|
|
f37bc7d46b | ||
|
|
9f5db434df | ||
|
|
1c8abd6e36 | ||
|
|
c95fcd6fbd | ||
|
|
e6009366e8 | ||
|
|
286502d872 | ||
|
|
0749bdc006 | ||
|
|
72ef137dbe | ||
|
|
f624bdef5c | ||
|
|
9730680e41 | ||
|
|
c59fa40615 | ||
|
|
4dc08dd37c | ||
|
|
e76c7564dc | ||
|
|
802bac82f0 | ||
|
|
c64cc13e4c | ||
|
|
30be62eabe | ||
|
|
1c1703b349 | ||
|
|
6916f3242c | ||
|
|
d2630a5c3f | ||
|
|
3e02776fcd | ||
|
|
376bfe63e0 | ||
|
|
950a3b4703 | ||
|
|
2f5ffb7421 | ||
|
|
043ef8ef3e | ||
|
|
a959a2deaf | ||
|
|
65a3f4e5f3 | ||
|
|
97355ad024 | ||
|
|
99300d2d61 | ||
|
|
e070d9d9f1 | ||
|
|
8f9bb79978 | ||
|
|
405a5c29df | ||
|
|
4f2a2b290b | ||
|
|
fd5218c10b | ||
|
|
73ab4aa42e | ||
|
|
66a60b1257 | ||
|
|
c975954944 | ||
|
|
86799ed742 | ||
|
|
1da6eca3be | ||
|
|
a462158582 | ||
|
|
152b8991d3 | ||
|
|
5adcf013d7 | ||
|
|
9d6401cbd3 | ||
|
|
9f178bb467 | ||
|
|
f3b2cc9bcb | ||
|
|
b18a8c1b2b | ||
|
|
30dd7e560b | ||
|
|
ca35a4df75 | ||
|
|
fe0a6d1a8b | ||
|
|
f9223087df | ||
|
|
f3980ef9a1 | ||
|
|
93553d18fc | ||
|
|
e35561093d | ||
|
|
b0742aa0c6 | ||
|
|
efad2b142a | ||
|
|
362f895e72 | ||
|
|
224b73eb89 | ||
|
|
c4cf45e7f8 | ||
|
|
cb45e57a99 | ||
|
|
e7f62f79ef | ||
|
|
6fb21ccd77 | ||
|
|
f55d814cbb | ||
|
|
8fa22a6c7d | ||
|
|
b86ca3a4ec | ||
|
|
ab51e70ff4 | ||
|
|
0bde83c0e7 | ||
|
|
589754851c | ||
|
|
253930ba6d | ||
|
|
09c19bbba5 | ||
|
|
ac96ebffa5 | ||
|
|
f01715452f | ||
|
|
875b01dcd6 | ||
|
|
61def7e332 | ||
|
|
86b24ff618 | ||
|
|
1d29d74204 | ||
|
|
2cf820e181 | ||
|
|
bf8ab4dec2 | ||
|
|
7b772bde3c | ||
|
|
dfbad82ba8 | ||
|
|
84938d88fc | ||
|
|
ed5f66729d | ||
|
|
ee5218c46d | ||
|
|
6758d71e2e | ||
|
|
1eec3d88cf | ||
|
|
34f1c196f1 | ||
|
|
a87e2fb5db | ||
|
|
cecafa5e28 | ||
|
|
a0e5f2d8ec | ||
|
|
47080f9b78 | ||
|
|
dd15767263 | ||
|
|
a698085196 | ||
|
|
2d4e1a94a4 | ||
|
|
dad49b9ac8 | ||
|
|
c5c1abaeff | ||
|
|
eb4f933753 | ||
|
|
931f27cb70 | ||
|
|
e6e00d4c7f | ||
|
|
3cf48129c6 | ||
|
|
b50bf02e90 | ||
|
|
431e3428b3 | ||
|
|
6d2e056b10 | ||
|
|
1cbfacc864 | ||
|
|
f2b51d321f | ||
|
|
0fe0b8906c | ||
|
|
0876f03fe4 | ||
|
|
dd239af810 | ||
|
|
5f2fae940c | ||
|
|
02f94875b1 | ||
|
|
52536f9803 | ||
|
|
7f963bd9f3 | ||
|
|
fcfbd478ca | ||
|
|
d7164dd588 | ||
|
|
d20b2768e1 | ||
|
|
68301c52c1 | ||
|
|
57aa9fa817 | ||
|
|
910291796b | ||
|
|
e4a661721f | ||
|
|
4068a20b8e | ||
|
|
c3be6db4f3 | ||
|
|
80678c97f0 | ||
|
|
711d20f874 | ||
|
|
7f299e1aa2 | ||
|
|
ab612a3f32 | ||
|
|
c0c244adc6 | ||
|
|
46a985076e | ||
|
|
7f82fab69b | ||
|
|
12ed1b3383 | ||
|
|
eab279dd12 | ||
|
|
e59a927faa | ||
|
|
1c1cb13c4d | ||
|
|
45a37eabe2 | ||
|
|
bbe6d81aa2 | ||
|
|
5d19b1bb72 | ||
|
|
866f05fea5 | ||
|
|
bd22554756 | ||
|
|
703e170773 | ||
|
|
a226242e69 | ||
|
|
1438f8aa10 | ||
|
|
79564bab81 | ||
|
|
5c7dd0b536 | ||
|
|
7e340b8b78 | ||
|
|
a026dc577c | ||
|
|
ed6c56629e | ||
|
|
97574707e5 | ||
|
|
942726eb74 | ||
|
|
e1eb3f804e | ||
|
|
2133a1390c | ||
|
|
7fab959a2f | ||
|
|
88f64ab82f | ||
|
|
1563d63051 | ||
|
|
82026658e2 | ||
|
|
26eec19a62 | ||
|
|
f548db2783 | ||
|
|
2da689e7e9 | ||
|
|
8afb4804c3 | ||
|
|
56b8902969 | ||
|
|
95cee6c845 | ||
|
|
dc58bcbd91 | ||
|
|
8d3698e6a3 | ||
|
|
c04526dc11 | ||
|
|
6a0d622344 | ||
|
|
74797e0768 | ||
|
|
6fd0851dc9 | ||
|
|
41e2773781 | ||
|
|
bf03412bf0 | ||
|
|
6b25aa1274 | ||
|
|
634acdd770 | ||
|
|
f2f01adfc9 | ||
|
|
9cd2d1d21f | ||
|
|
fa144847e5 | ||
|
|
17138f715b | ||
|
|
0babd05bff | ||
|
|
c5f14e55c5 | ||
|
|
03918c8ada | ||
|
|
80c7008a6c | ||
|
|
3d143cd3f0 | ||
|
|
365264b393 | ||
|
|
3b4aea4966 | ||
|
|
cb77bc9085 | ||
|
|
691aff990b | ||
|
|
0f6ca667d9 | ||
|
|
ba41229a83 | ||
|
|
7c9d28098b | ||
|
|
eccf9e4d85 | ||
|
|
96dffc0b74 | ||
|
|
308d0bfc0c | ||
|
|
f9dcf2db7d | ||
|
|
88798f2b86 | ||
|
|
28ecdc46b6 | ||
|
|
6a30031f49 | ||
|
|
d4f23e391f | ||
|
|
79b7463886 | ||
|
|
eddae25d7f | ||
|
|
5e9c85fc06 | ||
|
|
b44adb34ec | ||
|
|
f0f6cac84a | ||
|
|
17e87f58c3 | ||
|
|
273698e2fc | ||
|
|
66f88e0e8e | ||
|
|
de945008fb | ||
|
|
5f91505b8e | ||
|
|
6a25c283ec | ||
|
|
74fa9289a7 | ||
|
|
ab4b975912 | ||
|
|
2260089301 | ||
|
|
9dd35f1e32 | ||
|
|
6b90cee851 | ||
|
|
6da132c034 | ||
|
|
bc966a8ea8 | ||
|
|
6eab0c9b75 | ||
|
|
cf253fae8a | ||
|
|
c0eaa8fb50 | ||
|
|
a4889de80a | ||
|
|
acac599f6b | ||
|
|
1436ffa53f | ||
|
|
c68a3dd0a6 | ||
|
|
29c42022ef | ||
|
|
dd814c1b5e | ||
|
|
7fc2c71f58 | ||
|
|
e6a3d3c982 | ||
|
|
46380ee9ff | ||
|
|
1fa3908888 | ||
|
|
914e6a1789 | ||
|
|
9a1d073072 | ||
|
|
3712caf7b1 | ||
|
|
a770e18bb2 | ||
|
|
5dc0cfb666 | ||
|
|
e4ab02c77a | ||
|
|
a0f729cd8d | ||
|
|
d544b1c264 | ||
|
|
d8549cbebe | ||
|
|
4ae4734dbf | ||
|
|
cc72de7121 | ||
|
|
29bf2c2e40 | ||
|
|
e31771c8a9 | ||
|
|
b938942c78 | ||
|
|
262bc6d44d | ||
|
|
acd8d23c6c | ||
|
|
940bb8f9b1 | ||
|
|
27d22d4c9c | ||
|
|
4024055755 | ||
|
|
441c046fbd | ||
|
|
649fd579e2 | ||
|
|
c08478e156 | ||
|
|
389327ae63 | ||
|
|
122ee3e259 | ||
|
|
ef5f048343 | ||
|
|
9f56efada1 | ||
|
|
c3553b1fb1 | ||
|
|
1eebfefc79 | ||
|
|
f7391c04d4 | ||
|
|
90537515fa | ||
|
|
1da3d093be | ||
|
|
c923134b97 | ||
|
|
8eb11787de | ||
|
|
727062cf9e | ||
|
|
4054b9497d | ||
|
|
4ea7154c9e | ||
|
|
a35f12dffb | ||
|
|
8b6022bada | ||
|
|
1bbbac2cc7 | ||
|
|
ca632f6467 | ||
|
|
256d9555b4 | ||
|
|
7db73f0688 | ||
|
|
b9d6650298 | ||
|
|
f17d4922dd | ||
|
|
6a1b6cc922 | ||
|
|
3ec088d485 | ||
|
|
b11cb0059e | ||
|
|
989e5d1845 | ||
|
|
f8d0c4e3f9 | ||
|
|
3af1850600 | ||
|
|
f8c0a4d2e5 | ||
|
|
c0c28c912e | ||
|
|
ad55c66e77 | ||
|
|
d276b1a5e1 | ||
|
|
e899781cb5 | ||
|
|
5dd014f835 | ||
|
|
136bad46ce | ||
|
|
bd09d2a2cb | ||
|
|
2b2428021f | ||
|
|
a9537f210a | ||
|
|
3993bb5c27 | ||
|
|
0c35b59ac1 | ||
|
|
f68effefe6 | ||
|
|
45f1b4c427 | ||
|
|
9c0a53728b | ||
|
|
84c4fb4468 | ||
|
|
da2310a011 | ||
|
|
96fe58bafc | ||
|
|
da5328f725 | ||
|
|
e741502528 | ||
|
|
25988d7c3d | ||
|
|
61b68a5b41 | ||
|
|
7b6626d8eb | ||
|
|
f864bc8fec | ||
|
|
5c5277b54a | ||
|
|
7eff19547c | ||
|
|
05b6bcbab2 | ||
|
|
7640279a6b | ||
|
|
2447117b03 | ||
|
|
334b96807c | ||
|
|
3dcba630fe | ||
|
|
d43f78b5d2 | ||
|
|
d197391668 | ||
|
|
50fe25eab3 | ||
|
|
4192964217 | ||
|
|
247b42474d | ||
|
|
5e3a4359f8 | ||
|
|
5a051d1c45 | ||
|
|
fd63de7706 | ||
|
|
08d5edd991 | ||
|
|
7074467fc2 | ||
|
|
e61aecd0ff | ||
|
|
dbf1145c53 | ||
|
|
d34b74297e | ||
|
|
e8ce1b1592 | ||
|
|
663c5df115 | ||
|
|
62c24bbad0 | ||
|
|
2e07791d43 | ||
|
|
bc397f9dcf | ||
|
|
e91184064c | ||
|
|
abe9ef19ca | ||
|
|
18d3e357f7 | ||
|
|
4c02636027 | ||
|
|
98d47bc832 | ||
|
|
a990cc771d | ||
|
|
3a8fa432de | ||
|
|
d41c7e2298 | ||
|
|
636906de6f | ||
|
|
9323bb07a7 | ||
|
|
bfc5f27e30 | ||
|
|
aeee88602c | ||
|
|
251a2e46a8 | ||
|
|
87ab67dd4c | ||
|
|
75e537e428 | ||
|
|
383605b597 | ||
|
|
9a18ce2868 | ||
|
|
79a99e042f | ||
|
|
ce6627282c | ||
|
|
775e66f1ed | ||
|
|
d09ad3a7b7 | ||
|
|
429a334d35 | ||
|
|
978784c267 | ||
|
|
18736600ef | ||
|
|
94ee8c6491 | ||
|
|
225704d1f7 | ||
|
|
ffb56703c6 | ||
|
|
8694d1e924 | ||
|
|
2408d086a0 | ||
|
|
09f4b0b494 | ||
|
|
6c55a35445 | ||
|
|
97a572cf96 | ||
|
|
de78c92808 | ||
|
|
e38f967b1b | ||
|
|
a07fe944c5 | ||
|
|
32e32ddc51 | ||
|
|
042780b4a1 | ||
|
|
70ad78a398 | ||
|
|
805027bb8c | ||
|
|
9453c93966 | ||
|
|
b74d2d8bba | ||
|
|
b709892311 | ||
|
|
aba8b21d66 | ||
|
|
abd2801ac8 | ||
|
|
ee7ce8221d | ||
|
|
89079362b6 | ||
|
|
79fe419f13 | ||
|
|
b4a528c05e | ||
|
|
60c375dbca | ||
|
|
c7dfcfe426 | ||
|
|
0456dbfa42 | ||
|
|
c806e0ad8d | ||
|
|
a8acafdb69 | ||
|
|
208a7f8620 | ||
|
|
31ed07648e | ||
|
|
bf08bddec3 | ||
|
|
8d4ae8950a | ||
|
|
c95d7e5548 | ||
|
|
c90ac7cc6a | ||
|
|
0678ba47de | ||
|
|
60f43d40e4 | ||
|
|
43e6332bd8 | ||
|
|
9142783564 | ||
|
|
d3b0e9ed5d | ||
|
|
0721bd5c27 | ||
|
|
1d5e9c67f0 | ||
|
|
20ad921cb2 | ||
|
|
aeee20ab42 | ||
|
|
26c1df6168 | ||
|
|
b037423621 | ||
|
|
8e040a83d0 | ||
|
|
a450342e93 | ||
|
|
d4c0331f41 | ||
|
|
5f74ca9504 | ||
|
|
141a6f218b | ||
|
|
0bb3464e81 | ||
|
|
e5dfc1af82 | ||
|
|
5b130dd876 | ||
|
|
196422de87 | ||
|
|
2a5bcf0bdd | ||
|
|
638908acb8 | ||
|
|
f7ffcafb27 | ||
|
|
cca4aa7f6f | ||
|
|
ec60f2b0f3 | ||
|
|
5f595bd86f | ||
|
|
13909fc1bd | ||
|
|
a589d369bc | ||
|
|
5ac88a7b1a | ||
|
|
e3f1baacbe | ||
|
|
bc09e9a797 | ||
|
|
f93eb3a5b3 | ||
|
|
6922e942ba | ||
|
|
6397650183 | ||
|
|
6fd89db736 | ||
|
|
d6071bd894 | ||
|
|
5c1d088744 | ||
|
|
4bc01767c8 | ||
|
|
acb532db89 | ||
|
|
8c9ccde962 | ||
|
|
c1958d76b1 | ||
|
|
a804f17934 | ||
|
|
8fb05d4fe3 | ||
|
|
ee9d0355d4 | ||
|
|
139b58ce6d | ||
|
|
4a8eff32cb | ||
|
|
6c6d1a7f53 | ||
|
|
a59825a79b | ||
|
|
81bb4a43f5 | ||
|
|
184369af9c | ||
|
|
d492ca15da | ||
|
|
5a17c923f0 | ||
|
|
dfcaa60e04 | ||
|
|
f3317793cb | ||
|
|
41a3e7eaa3 | ||
|
|
4357e331ad | ||
|
|
49fe1a75db | ||
|
|
68dfa92425 | ||
|
|
987fd7f922 | ||
|
|
449f0d6237 | ||
|
|
dcbdf94023 | ||
|
|
6e7150cef2 | ||
|
|
949209d708 | ||
|
|
0aab014af1 | ||
|
|
a5941e472e | ||
|
|
9a18a461be | ||
|
|
95bbba4607 | ||
|
|
d8efe74126 | ||
|
|
dafe9d8274 | ||
|
|
505862efad | ||
|
|
3e3616bc36 | ||
|
|
f72c16a604 | ||
|
|
d1be813d05 | ||
|
|
17cdecf45c | ||
|
|
0906e79211 | ||
|
|
4acb5ee4c8 | ||
|
|
0bce33e92a | ||
|
|
929fa2f620 | ||
|
|
fb66c5ec60 | ||
|
|
54850f62a8 | ||
|
|
ea0e38277d | ||
|
|
e099fd43dd | ||
|
|
d90efae709 | ||
|
|
2131232e14 | ||
|
|
c823e9e06f | ||
|
|
d325d92f89 | ||
|
|
84143cd096 | ||
|
|
d7f5993665 | ||
|
|
88ddd5546a | ||
|
|
25d6ca3fea | ||
|
|
3709523836 | ||
|
|
0e17079b03 | ||
|
|
2752924d16 | ||
|
|
7c1144fa2c | ||
|
|
6008f1abb2 | ||
|
|
d4f200171f | ||
|
|
2dd8d8b442 | ||
|
|
d5dc0fa2e6 | ||
|
|
8cb9568334 | ||
|
|
4cc33fc06e | ||
|
|
73c94b861e | ||
|
|
7b0fde72b8 | ||
|
|
564d7dd567 | ||
|
|
3f21bd618c | ||
|
|
ed1f803647 | ||
|
|
4b03f3aba9 | ||
|
|
7b7fa5aa24 | ||
|
|
15a1c68ede | ||
|
|
9e252298cf | ||
|
|
89d4a04d85 | ||
|
|
1cd0c5d925 | ||
|
|
43ab711254 | ||
|
|
c671e47a5d | ||
|
|
983988c9e1 | ||
|
|
790a206e0a | ||
|
|
f5759c3327 | ||
|
|
a15a2f4ee5 | ||
|
|
2e4dc5a2ea | ||
|
|
9b78cf401b | ||
|
|
ed64c93aa0 | ||
|
|
618792b541 | ||
|
|
1bbba0e9b3 | ||
|
|
3a8300f172 | ||
|
|
6e40357e3f | ||
|
|
20a767b452 | ||
|
|
ff96f18adb | ||
|
|
a768181a75 | ||
|
|
edb52e253b | ||
|
|
ee52b8d4d9 | ||
|
|
7154fa0f4a | ||
|
|
7e54239710 | ||
|
|
a54be505d4 | ||
|
|
3efa23fb71 | ||
|
|
2254257250 | ||
|
|
18f4f057eb | ||
|
|
246f2186a5 | ||
|
|
ed6c248bbe | ||
|
|
c22b1c0e9d | ||
|
|
5087b19135 | ||
|
|
26175c8795 | ||
|
|
4400c9bfa8 | ||
|
|
f99cac5d4c | ||
|
|
d81d66ea5d | ||
|
|
00d6e2a58c | ||
|
|
e48fa00893 | ||
|
|
98bf4594b4 | ||
|
|
2e38270083 | ||
|
|
9e578f4edd | ||
|
|
2186673b2a | ||
|
|
4080c8c877 | ||
|
|
8af40f2444 | ||
|
|
6619abb02b | ||
|
|
9806e092df | ||
|
|
f1d8af128d | ||
|
|
84e5fb33c0 | ||
|
|
a42afcf6e4 | ||
|
|
3d16450dd8 | ||
|
|
ad9edb2b43 | ||
|
|
0b1671e1a3 | ||
|
|
7361488270 | ||
|
|
f75e6f6ad0 | ||
|
|
dd3a075c24 | ||
|
|
263949134c | ||
|
|
ebf7c78199 | ||
|
|
68634edc0d | ||
|
|
c7be90e1ad | ||
|
|
6fa3d8c769 | ||
|
|
42e2f247e1 | ||
|
|
005b9c0a8a | ||
|
|
137e559d2e | ||
|
|
f20b7d6577 | ||
|
|
4b22936d66 | ||
|
|
b47d738e94 | ||
|
|
200f70c813 | ||
|
|
a0535c8127 | ||
|
|
750d15134f | ||
|
|
43e398e078 | ||
|
|
e1965e6ad9 | ||
|
|
79d69dcb32 | ||
|
|
e21ac44427 | ||
|
|
0211e4fa86 | ||
|
|
dba0579b92 | ||
|
|
8524095e75 | ||
|
|
6d2a6feae2 | ||
|
|
1898065da5 | ||
|
|
e76ee39840 | ||
|
|
1b484b1c25 | ||
|
|
a8dcaffd19 | ||
|
|
5b960b476c | ||
|
|
bd13f01718 | ||
|
|
6bb717d8a9 | ||
|
|
828440785e | ||
|
|
55d6d3620d | ||
|
|
09d7d578b6 | ||
|
|
807991ea7d | ||
|
|
8b59919829 | ||
|
|
13d8351166 | ||
|
|
dfd527ae68 | ||
|
|
40d2c95df4 | ||
|
|
57ef395ad2 | ||
|
|
8b68db4c75 | ||
|
|
38d9085acf | ||
|
|
659cd2c92b | ||
|
|
df3a449a72 | ||
|
|
c7b47b1e6c | ||
|
|
f2a090169f | ||
|
|
3acd3a5209 | ||
|
|
1887d25497 | ||
|
|
6d4ac8e10e | ||
|
|
57d47ca1d4 | ||
|
|
fe1922586e | ||
|
|
ddaef1a827 | ||
|
|
e327457af7 | ||
|
|
fc184d42f7 | ||
|
|
c0e9d3b347 | ||
|
|
757757af2b | ||
|
|
5803e3bc85 | ||
|
|
442e62d76c | ||
|
|
086e9a926f | ||
|
|
90a341de2f | ||
|
|
d4ea6d146a | ||
|
|
af991b4008 | ||
|
|
c17017be9b | ||
|
|
e9fcca84db | ||
|
|
6aa7fa589e | ||
|
|
5a07b0a8be | ||
|
|
d9363e7486 | ||
|
|
7aab1b611a | ||
|
|
64be22f08e | ||
|
|
83a13b83d3 | ||
|
|
abbf3e8a4f | ||
|
|
971265eb6b | ||
|
|
f14a699c08 | ||
|
|
2aea0350eb | ||
|
|
18a556bce0 | ||
|
|
783adab8a5 | ||
|
|
1a802b5822 | ||
|
|
99bf56d031 | ||
|
|
34135f0e17 | ||
|
|
c22f23a1c4 | ||
|
|
5ef8588ad1 | ||
|
|
cef5e09a58 | ||
|
|
6933c599ad | ||
|
|
10f6a202af | ||
|
|
47bd030293 | ||
|
|
86cb201539 | ||
|
|
619856ad58 | ||
|
|
b539273351 | ||
|
|
dc4c4c3742 | ||
|
|
78e81a5e7d | ||
|
|
ae18ce444c | ||
|
|
d1b35594e7 | ||
|
|
79befe9508 | ||
|
|
cc75457e50 | ||
|
|
0fa58aaee6 | ||
|
|
a3f3f7cdaa | ||
|
|
30dc174d30 | ||
|
|
400198f7a3 | ||
|
|
347d3d7fef | ||
|
|
716af071b8 | ||
|
|
43f8bbc360 | ||
|
|
1ff76bf1a0 | ||
|
|
6da9662110 | ||
|
|
8d13668595 | ||
|
|
62dcc1f55b | ||
|
|
efb0c354a5 | ||
|
|
09c9faba9c | ||
|
|
c9a6bd2d64 | ||
|
|
5d32485fc5 | ||
|
|
b4aa93a185 | ||
|
|
a0fddbec27 | ||
|
|
533faad8c2 | ||
|
|
3a24a45ade | ||
|
|
643501b25d | ||
|
|
3c5abf88e7 | ||
|
|
bec6011c8e | ||
|
|
d6a90990bd | ||
|
|
5b2c6abf90 | ||
|
|
2839c134a0 | ||
|
|
2c3ea3b59b | ||
|
|
72c9f5dceb | ||
|
|
9a71643bed | ||
|
|
ffd61a6844 | ||
|
|
c66cded184 | ||
|
|
6c2a23cf10 | ||
|
|
9877d918b4 | ||
|
|
8a5b845b2c | ||
|
|
c2c98db80e | ||
|
|
54dc83aa59 | ||
|
|
efc8b02d11 | ||
|
|
1c64b7bd54 | ||
|
|
20560d5256 | ||
|
|
1f6b7ce6ab | ||
|
|
0b518c4eb8 | ||
|
|
21285aa51f | ||
|
|
76990ead8a | ||
|
|
48493f78c2 | ||
|
|
b99c06a8a4 | ||
|
|
563331af03 | ||
|
|
09adf27190 | ||
|
|
53c7d2ac85 | ||
|
|
fa0458d220 | ||
|
|
29e0d93e4f | ||
|
|
4f09cb3592 | ||
|
|
187b76d359 | ||
|
|
428f26b02c | ||
|
|
e976e627ad | ||
|
|
48564ff8cb | ||
|
|
f881d7a5c8 | ||
|
|
5b9b345bf8 | ||
|
|
c54e428d24 | ||
|
|
2b69ac4651 | ||
|
|
3cd2f19ddf | ||
|
|
5ed64d99f6 | ||
|
|
20acd516d6 | ||
|
|
d30ef85c66 | ||
|
|
5c5c3113bc | ||
|
|
79dcec028f | ||
|
|
17bd2f3324 | ||
|
|
f4b4f6ff89 | ||
|
|
8dd675a275 | ||
|
|
f4c59e70b5 | ||
|
|
8da0ac369c | ||
|
|
a361b124d6 | ||
|
|
3d2d54aafa | ||
|
|
28da462c4e | ||
|
|
94a6c8d525 | ||
|
|
8fbfce086c | ||
|
|
73ac717c4d | ||
|
|
3fb57a1dbe | ||
|
|
af9718951f | ||
|
|
d40b7aef11 | ||
|
|
54ac4b5308 | ||
|
|
3ee28f8d48 | ||
|
|
32f8a93021 | ||
|
|
39624e1ddb | ||
|
|
26b7420a2d | ||
|
|
c010865fe0 | ||
|
|
aaeb905dcf | ||
|
|
ad8b954401 | ||
|
|
ef9f145beb | ||
|
|
c0d04f5870 | ||
|
|
f512bbc9fa | ||
|
|
b8f5fe2b21 | ||
|
|
be73390fde | ||
|
|
17cd2bc543 | ||
|
|
74712ba931 | ||
|
|
0d22a238dd | ||
|
|
56e9170a6b | ||
|
|
b333fd6772 | ||
|
|
4eb469eb59 | ||
|
|
4ff0d3c654 | ||
|
|
4f1dd0673e | ||
|
|
caf05b5c26 | ||
|
|
2643ab7a17 | ||
|
|
6caea136a5 | ||
|
|
1d23d65910 | ||
|
|
8cc3de5807 | ||
|
|
9b022df709 | ||
|
|
aba061cb72 | ||
|
|
ae4d725595 | ||
|
|
6a76dc41d1 | ||
|
|
2b649c64a3 | ||
|
|
db2944cb15 | ||
|
|
3d40184373 | ||
|
|
e788c51ff3 | ||
|
|
d7fc389182 | ||
|
|
53f3a18245 | ||
|
|
4b01bdb0d8 | ||
|
|
ecafbe823e | ||
|
|
8abde38ebf | ||
|
|
0fd7f768a9 | ||
|
|
9c38d68b65 | ||
|
|
f0de5dde53 | ||
|
|
2cdbf0ba76 | ||
|
|
34e4f4d7c2 | ||
|
|
61c0b58798 | ||
|
|
b2db0ea683 | ||
|
|
bd0fb02bb2 | ||
|
|
f0aed23416 | ||
|
|
65368519c7 | ||
|
|
53db6f22d6 | ||
|
|
5d47a987f4 | ||
|
|
4222b0be1d | ||
|
|
a1f03e22d4 | ||
|
|
cddaa7b7a1 | ||
|
|
3b99ca74ab | ||
|
|
58dee36f1b | ||
|
|
ae24fc07ba | ||
|
|
13ca0db761 | ||
|
|
42641396c6 | ||
|
|
04326171e7 | ||
|
|
d90d450bef | ||
|
|
d2b20154de | ||
|
|
b176d866d0 | ||
|
|
07a9a79626 | ||
|
|
b60da458d5 | ||
|
|
40ffbc550f | ||
|
|
35076148cc | ||
|
|
3175ff9a76 | ||
|
|
81457b1e48 | ||
|
|
e9d5472d72 | ||
|
|
7c4bd371e7 | ||
|
|
98ed7e4dd3 | ||
|
|
8404ef1d83 | ||
|
|
0d99d84adf | ||
|
|
8492962923 | ||
|
|
99627f856f | ||
|
|
b917cc20f6 | ||
|
|
c582e88b7b | ||
|
|
9a00603600 | ||
|
|
550b5e3bb4 | ||
|
|
5ceb57a2cf | ||
|
|
16e96f6454 | ||
|
|
c162ee5337 | ||
|
|
66d34e7035 | ||
|
|
f57f7f72ed | ||
|
|
c911cfe310 | ||
|
|
223c8b53b4 | ||
|
|
add1154014 | ||
|
|
6ede731cfe | ||
|
|
0619cc0e3d | ||
|
|
06a686ad1a | ||
|
|
15aed06f9d | ||
|
|
012936dc7d | ||
|
|
0fb5b4a323 | ||
|
|
dc3cfb4c23 | ||
|
|
450e7894aa | ||
|
|
b8e7dbd147 | ||
|
|
a41c53d7f4 | ||
|
|
419faa2a47 | ||
|
|
1d3b181a1c | ||
|
|
e0d4ec4a28 | ||
|
|
f95d8cbdde | ||
|
|
e22c9151d1 | ||
|
|
f6ae58a05d | ||
|
|
cb3fc1c951 | ||
|
|
7f84fd2b4c | ||
|
|
518a67bf8a | ||
|
|
cc6af53eff | ||
|
|
7b27f62f10 | ||
|
|
16d69a1925 | ||
|
|
66fb39c98d | ||
|
|
9bfd68ad24 | ||
|
|
846665bd57 | ||
|
|
04f92584d4 | ||
|
|
3891422735 | ||
|
|
a806c3336d | ||
|
|
5310fd38bf | ||
|
|
507df94427 | ||
|
|
f55ea8ddbb | ||
|
|
865030914e | ||
|
|
e5baa91433 | ||
|
|
059eaccbe2 | ||
|
|
b432e1ad2c | ||
|
|
e9c25c1330 | ||
|
|
bc1a263b13 | ||
|
|
98ec83aa36 | ||
|
|
fe2b527561 | ||
|
|
57d57160dd | ||
|
|
c60964ac16 | ||
|
|
9d4c5a4d1b | ||
|
|
2e6cd93908 | ||
|
|
f9e4d35cad | ||
|
|
96ca03371e | ||
|
|
f3e4da9e0b | ||
|
|
bcde89b52e | ||
|
|
6becdc495d | ||
|
|
483130176c | ||
|
|
4481a3d10e | ||
|
|
0caf9a63fc | ||
|
|
82a08d3a6a | ||
|
|
a4bbf889ec | ||
|
|
a4beb96754 | ||
|
|
e4212161b5 | ||
|
|
f271ded65b | ||
|
|
5eff7ff3fe | ||
|
|
342542622f | ||
|
|
0be995a108 | ||
|
|
6486b0b4f8 | ||
|
|
c3f79087fd | ||
|
|
87caf8b58f | ||
|
|
4a94813509 | ||
|
|
8c9429d77a | ||
|
|
a0c3524056 | ||
|
|
beba210031 | ||
|
|
c50f28325a | ||
|
|
4efa575201 | ||
|
|
bf8bfb1d23 | ||
|
|
40eaa026b2 | ||
|
|
4c7d2d66f0 | ||
|
|
cfcf5bacea | ||
|
|
1f12365518 | ||
|
|
538a00b3eb | ||
|
|
ba623fe3f0 | ||
|
|
5a27041a54 | ||
|
|
c899cf4098 | ||
|
|
a99b84bb86 | ||
|
|
c0bede1670 | ||
|
|
868f80340b | ||
|
|
5f0b692bc4 | ||
|
|
73ad04c049 | ||
|
|
5d6cdc2fee | ||
|
|
fc712e0869 | ||
|
|
f049e3f482 | ||
|
|
19e517558b | ||
|
|
7c9a115574 | ||
|
|
93f51f7087 | ||
|
|
c9bb6dfdde | ||
|
|
5c14eda02a | ||
|
|
8ee0cb3af5 | ||
|
|
1404e2a90a | ||
|
|
b58d72e9fd | ||
|
|
be03a3e175 | ||
|
|
bf46d970b8 | ||
|
|
c36e405acd | ||
|
|
ebe4f78a62 | ||
|
|
5bda3e14d3 | ||
|
|
cac0684696 | ||
|
|
6b89707c6e | ||
|
|
efcdbbe30c | ||
|
|
ce4c86de9d | ||
|
|
d9b69ae61b | ||
|
|
412174e8bb | ||
|
|
2691a5dbaa | ||
|
|
eef34cec7c | ||
|
|
0449396678 | ||
|
|
5b456b9d44 | ||
|
|
adb44b1b0a | ||
|
|
4f5bd4b705 | ||
|
|
9370031805 | ||
|
|
8ee258272b | ||
|
|
fd5dfd769a | ||
|
|
fb6d6e7599 | ||
|
|
8c90cafcba | ||
|
|
36f3d3b479 | ||
|
|
3647fcb48e | ||
|
|
2368c3c8a7 | ||
|
|
60a041e454 | ||
|
|
5613938877 | ||
|
|
8817a1a19e | ||
|
|
5b4caedbef | ||
|
|
b431b1e095 | ||
|
|
dac295ea19 | ||
|
|
2c2ac08bf7 | ||
|
|
3b8e9d8e47 | ||
|
|
9682671de2 | ||
|
|
29559e571c | ||
|
|
cfb25d068d | ||
|
|
9b8c6bef99 | ||
|
|
168a1ea6e5 | ||
|
|
1515517bc3 | ||
|
|
7b20c9e448 | ||
|
|
008c9e6f7b | ||
|
|
d26edd74d1 | ||
|
|
6f3be6fdde | ||
|
|
603019116b | ||
|
|
0f7b5ea1f4 | ||
|
|
d62a83ba0c | ||
|
|
b873f850af | ||
|
|
16e45f6c4e | ||
|
|
5c34747a74 | ||
|
|
cd4099cf4b | ||
|
|
4ceb22c0ad | ||
|
|
cd76a63c2e | ||
|
|
6871416bc1 | ||
|
|
f401e08d0e | ||
|
|
c8dd17ffa7 | ||
|
|
766e8cbcf7 | ||
|
|
86ad6a262b | ||
|
|
614900443d | ||
|
|
0be7bbd57e | ||
|
|
5b45cc552f | ||
|
|
b6653f99be | ||
|
|
520b3c5e89 | ||
|
|
ebe2ca9e9d | ||
|
|
63740b17bb | ||
|
|
800a7af874 | ||
|
|
75bdd68779 | ||
|
|
0f9ac24f52 | ||
|
|
5ac39c53b3 | ||
|
|
3edc895edc | ||
|
|
ecc06c5917 | ||
|
|
c672e1b435 | ||
|
|
9165660286 | ||
|
|
60673c579f | ||
|
|
3967864df7 | ||
|
|
c76e288b6b | ||
|
|
a4549b0c12 | ||
|
|
3fc838a2b4 | ||
|
|
a81fbe6c92 | ||
|
|
34429bbcf5 | ||
|
|
1cb7d943ec | ||
|
|
a57af66b2b | ||
|
|
59c388a3f5 | ||
|
|
282c3e32fc | ||
|
|
e841d43a06 | ||
|
|
474d7b638c | ||
|
|
44c9d10cbb | ||
|
|
e863e3f56d | ||
|
|
432f5a5647 | ||
|
|
3545b560fe | ||
|
|
4e86ce2a77 | ||
|
|
4881787cf0 | ||
|
|
3172cdbd55 | ||
|
|
6601922c13 | ||
|
|
049d6bc4de | ||
|
|
9fddd6b1ba | ||
|
|
ea4762e3d0 | ||
|
|
cb44f0fe13 | ||
|
|
a8fa776713 | ||
|
|
cb82f0df0c | ||
|
|
c6fc914a4e | ||
|
|
c7096574ab | ||
|
|
c98a3ae40a | ||
|
|
39e4250998 | ||
|
|
6c44253798 | ||
|
|
4836bce5b0 | ||
|
|
184a889301 | ||
|
|
9b0609a7f1 | ||
|
|
824216035f | ||
|
|
e690231f05 | ||
|
|
22201f83b2 | ||
|
|
be4ab13f6d | ||
|
|
24186ae143 | ||
|
|
eba8cc630d | ||
|
|
e835e0d269 | ||
|
|
c420892800 | ||
|
|
ada7c067b3 | ||
|
|
8109c8460e | ||
|
|
aeddff23ad | ||
|
|
c93c05fe8c | ||
|
|
01d0020b28 | ||
|
|
aa78f4f9db | ||
|
|
7879b57ea3 | ||
|
|
a4794cac60 | ||
|
|
6bd6510ce9 | ||
|
|
88225eb590 | ||
|
|
ef1c1d2a24 | ||
|
|
f461f1968d | ||
|
|
2513edc53a | ||
|
|
40d03c6848 | ||
|
|
75d6a728b1 | ||
|
|
739d1dd3d1 | ||
|
|
97b338fc5d | ||
|
|
5350cf8e52 | ||
|
|
0c2959da80 | ||
|
|
37cba66ad7 | ||
|
|
03606ae644 | ||
|
|
292453e425 | ||
|
|
9639840b46 | ||
|
|
db6cdec9b5 | ||
|
|
b74c17c582 | ||
|
|
20a139ca0a | ||
|
|
4fd5555146 | ||
|
|
2e4cc5f0be | ||
|
|
983dc7c376 | ||
|
|
f461434fb4 | ||
|
|
907655bb09 | ||
|
|
41d6a0a099 | ||
|
|
573d14f854 | ||
|
|
c0719694ba | ||
|
|
49aea5aad1 | ||
|
|
076569027a | ||
|
|
2a7cc3aeb0 | ||
|
|
89dca6086d | ||
|
|
c00bbdb0fe | ||
|
|
60bdf881b1 | ||
|
|
ae9237c4b9 | ||
|
|
51a221809b | ||
|
|
d7d176c169 | ||
|
|
374413eaae | ||
|
|
96538a2b6f | ||
|
|
39a3a6dbd2 | ||
|
|
58d959fdef | ||
|
|
3de7238d7b | ||
|
|
66b2065d7c | ||
|
|
e4b012c40f | ||
|
|
adf5283375 | ||
|
|
1f5baa9d70 | ||
|
|
7d09306047 | ||
|
|
c3ae8cdd62 | ||
|
|
fef6ed5f34 | ||
|
|
778b212bd0 | ||
|
|
d675bdfdf2 | ||
|
|
0923414af1 | ||
|
|
d9b0dce5f4 | ||
|
|
b28bae20b7 | ||
|
|
a235ad1bc3 | ||
|
|
db0114b600 | ||
|
|
2aad48505e | ||
|
|
347493dbbd | ||
|
|
f09e69e9b1 | ||
|
|
2c410f4ecc | ||
|
|
5e26f8da37 | ||
|
|
8d6b86529b | ||
|
|
18859963e5 | ||
|
|
37828e5716 | ||
|
|
27bb69a4f7 | ||
|
|
c41c994772 | ||
|
|
5610569fe7 | ||
|
|
ba0ad4dfe9 | ||
|
|
049443f4cc | ||
|
|
ba76ea086c | ||
|
|
a7beec2548 | ||
|
|
49bc5a5d5d | ||
|
|
d9fd6bfc87 | ||
|
|
4d5f0fce6c | ||
|
|
e7114d9c4c | ||
|
|
8957a9ba5b | ||
|
|
a9ce82c8e9 | ||
|
|
85f1e05860 | ||
|
|
5bdf4cb099 | ||
|
|
c52b1f8cc3 | ||
|
|
5176aef78c | ||
|
|
8fc0ed81ff | ||
|
|
b84838bfbb | ||
|
|
2adf724458 | ||
|
|
fd8f546d1f | ||
|
|
c33de304dc | ||
|
|
c6afb86765 | ||
|
|
71e2af6c4c | ||
|
|
15b74e19d7 | ||
|
|
74eece5956 | ||
|
|
ada764bb7f | ||
|
|
e2e99009a3 | ||
|
|
8e879e2d73 | ||
|
|
7808586751 | ||
|
|
23e66d58d3 | ||
|
|
214b8baf8f | ||
|
|
756a913e94 | ||
|
|
720bdc7aaf | ||
|
|
b49d1e2e2c | ||
|
|
c0e76b05e2 | ||
|
|
ca0e7c781e | ||
|
|
50bcc77cd0 | ||
|
|
6decfd05a0 | ||
|
|
6bae680e4a | ||
|
|
3532f4136c | ||
|
|
af406bb473 | ||
|
|
78decd9b67 | ||
|
|
4d2a27d908 | ||
|
|
f2afdcba6f | ||
|
|
2d4c43e51a | ||
|
|
43124e3c06 | ||
|
|
7b80a0a60e | ||
|
|
74fc9007dd | ||
|
|
e0705293e1 | ||
|
|
29f3f7c330 | ||
|
|
ef2d83ab08 | ||
|
|
ba9520d6f5 | ||
|
|
1cbab04c35 | ||
|
|
e8deed9244 | ||
|
|
b3ff690497 | ||
|
|
a8f03abd1d | ||
|
|
9be41a4e37 | ||
|
|
0e0e81f5ae | ||
|
|
b020cc1c39 | ||
|
|
4eab7f6a88 | ||
|
|
8f213f819b | ||
|
|
4bd6f761e5 | ||
|
|
9dfcbb7c8e | ||
|
|
488981753a | ||
|
|
7622cdc1cf | ||
|
|
bf503db267 | ||
|
|
fe6ffe4555 | ||
|
|
028ad25fc6 | ||
|
|
a6d0a90c73 | ||
|
|
716cd2e729 | ||
|
|
034e06f636 | ||
|
|
dfa4627998 | ||
|
|
942b6f3305 | ||
|
|
fda03757fc | ||
|
|
6955ea581c | ||
|
|
950d98528a | ||
|
|
8b2d62d27a | ||
|
|
2b3d1e9ce0 | ||
|
|
15d5985ec4 | ||
|
|
bd94543b71 | ||
|
|
ab93196432 | ||
|
|
d8c5955ba4 | ||
|
|
0f64611843 | ||
|
|
7244204f35 | ||
|
|
6eee3c3432 | ||
|
|
3801de3449 | ||
|
|
d97fefebf8 | ||
|
|
06d55f2746 | ||
|
|
c54bc30bda | ||
|
|
f2138a4e23 | ||
|
|
8d0bb8fc12 | ||
|
|
57c5d4b15c | ||
|
|
41433ecbf5 | ||
|
|
e0a4c5b6a8 | ||
|
|
219a77f121 | ||
|
|
43c0299c25 | ||
|
|
7b65cba5e4 | ||
|
|
0e3b3c4193 | ||
|
|
35bbe00e17 | ||
|
|
673c18a5ce | ||
|
|
dc32b278f9 | ||
|
|
58c767c0a6 | ||
|
|
7678316b5a | ||
|
|
988622629a | ||
|
|
c090b4629b | ||
|
|
a9a3759d6e | ||
|
|
19b4e91e25 | ||
|
|
f0d98542e4 | ||
|
|
a32ed9c8f2 | ||
|
|
67635f0b20 | ||
|
|
5d90b4f070 | ||
|
|
c212eb1f20 | ||
|
|
5ae0b5a3f2 | ||
|
|
06d907d633 | ||
|
|
737c5ff2ba | ||
|
|
ba19934c06 | ||
|
|
8885bb87be | ||
|
|
690c873291 | ||
|
|
158cdd27bc | ||
|
|
51286a2c46 | ||
|
|
16538077ee | ||
|
|
3181e54aa6 | ||
|
|
8028a153af | ||
|
|
0a03750d26 | ||
|
|
e9b1a91180 | ||
|
|
8677dd48ad | ||
|
|
c3d309d07e | ||
|
|
63e78a8895 | ||
|
|
4b54a962b2 | ||
|
|
f3d2f0b453 | ||
|
|
fe638db414 | ||
|
|
e51be3fd85 | ||
|
|
4fd345cb88 | ||
|
|
41e2de18aa | ||
|
|
df567a0603 | ||
|
|
419fb93a91 | ||
|
|
c7473be8c7 | ||
|
|
311a01ef41 | ||
|
|
1a163907a3 | ||
|
|
2acdc00547 | ||
|
|
b622d8865c | ||
|
|
786fcfb580 | ||
|
|
eec8512f96 | ||
|
|
be62caef2b | ||
|
|
eabd52b186 | ||
|
|
101087680b | ||
|
|
372f1770e0 | ||
|
|
a44dcdc9ff | ||
|
|
d44b172602 | ||
|
|
241d7610ba | ||
|
|
6929b2d717 | ||
|
|
e743f61913 | ||
|
|
7f4e5dd01a | ||
|
|
8a1b58cf7c | ||
|
|
2a20766912 | ||
|
|
b49679eb90 | ||
|
|
b2ea073c16 | ||
|
|
54085a59c3 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@
|
||||
/data/config.php
|
||||
/build
|
||||
/node_modules
|
||||
npm-debug.log
|
||||
/test.php
|
||||
/main.html
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ DirectoryIndex index.php index.html
|
||||
|
||||
# PROTECTED DIRECTORIES
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^/?(data|api)/ - [F]
|
||||
RewriteRule ^/?(data|api|client)/ - [F]
|
||||
|
||||
RewriteRule ^/?data/config\.php$ - [F]
|
||||
RewriteRule ^/?data/logs/ - [F]
|
||||
@@ -19,6 +19,7 @@ DirectoryIndex index.php index.html
|
||||
RewriteRule ^/?application/ - [F]
|
||||
RewriteRule ^/?custom/ - [F]
|
||||
RewriteRule ^/?vendor/ - [F]
|
||||
RewriteRule ^/?client/?$ - [F]
|
||||
#END PROTECTED DIRECTORIES
|
||||
|
||||
RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
|
||||
|
||||
45
Gruntfile.js
45
Gruntfile.js
@@ -2,8 +2,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,13 +30,15 @@ module.exports = function (grunt) {
|
||||
'client/lib/jquery-ui.min.js',
|
||||
'client/lib/jquery.ui.touch-punch.min.js',
|
||||
'client/lib/moment.min.js',
|
||||
'client/lib/moment-timezone-with-data.min.js',
|
||||
'client/lib/moment-timezone.min.js',
|
||||
'client/lib/moment-timezone-data.js',
|
||||
'client/lib/jquery.timepicker.min.js',
|
||||
'client/lib/jquery.autocomplete.js',
|
||||
'client/lib/bootstrap.min.js',
|
||||
'client/lib/bootstrap-datepicker.js',
|
||||
'client/lib/bull.js',
|
||||
'client/lib/marked.min.js',
|
||||
'client/lib/autobahn.js',
|
||||
|
||||
'client/src/namespace.js',
|
||||
'client/src/exceptions.js',
|
||||
@@ -87,12 +89,16 @@ module.exports = function (grunt) {
|
||||
themeList.push(file.substr(0, file.length - 5));
|
||||
});
|
||||
|
||||
var cssminFilesData = {};
|
||||
var lessData = {};
|
||||
themeList.forEach(function (theme) {
|
||||
var name = camelCaseToHyphen(theme);
|
||||
var files = {};
|
||||
files['client/css/espo/'+name+'.css'] = 'frontend/less/'+name+'/main.less';
|
||||
files['client/css/espo/'+name+'-iframe.css'] = 'frontend/less/'+name+'/iframe/main.less';
|
||||
|
||||
cssminFilesData['client/css/espo/'+name+'.css'] = 'client/css/espo/'+name+'.css';
|
||||
cssminFilesData['client/css/espo/'+name+'-iframe.css'] = 'client/css/espo/'+name+'-iframe.css';
|
||||
var o = {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
@@ -117,16 +123,22 @@ module.exports = function (grunt) {
|
||||
}
|
||||
},
|
||||
clean: {
|
||||
start: ['build/*'],
|
||||
start: ['build/EspoCRM-*'],
|
||||
final: ['build/tmp'],
|
||||
beforeFinal: {
|
||||
src: ['build/tmp/custom/Espo/Custom/*', '!build/tmp/custom/Espo/Custom/.htaccess']
|
||||
}
|
||||
},
|
||||
less: lessData,
|
||||
cssmin: {
|
||||
themes: {
|
||||
files: cssminFilesData
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
mangle: false,
|
||||
sourceMap: true,
|
||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
|
||||
},
|
||||
'build/tmp/client/espo.min.js': jsFilesToMinify.map(function (item) {
|
||||
@@ -171,10 +183,13 @@ module.exports = function (grunt) {
|
||||
'html/**',
|
||||
'bootstrap.php',
|
||||
'cron.php',
|
||||
'daemon.php',
|
||||
'rebuild.php',
|
||||
'clear_cache.php',
|
||||
'upgrade.php',
|
||||
'extension.php',
|
||||
'websocket.php',
|
||||
'command.php',
|
||||
'index.php',
|
||||
'LICENSE.txt',
|
||||
'.htaccess',
|
||||
@@ -225,26 +240,6 @@ module.exports = function (grunt) {
|
||||
}
|
||||
},
|
||||
replace: {
|
||||
timestamp: {
|
||||
options: {
|
||||
patterns: [
|
||||
{
|
||||
match: 'timestamp',
|
||||
replacement: '<%= new Date().getTime() %>'
|
||||
}
|
||||
]
|
||||
},
|
||||
files: [
|
||||
{
|
||||
src: 'build/tmp/html/main.html',
|
||||
dest: 'build/tmp/html/main.html'
|
||||
},
|
||||
{
|
||||
src: 'build/tmp/html/portal.html',
|
||||
dest: 'build/tmp/html/portal.html'
|
||||
}
|
||||
]
|
||||
},
|
||||
version: {
|
||||
options: {
|
||||
patterns: [
|
||||
@@ -289,6 +284,7 @@ module.exports = function (grunt) {
|
||||
'clean:start',
|
||||
'mkdir:tmp',
|
||||
'less',
|
||||
'cssmin',
|
||||
'uglify',
|
||||
'copy:frontendFolders',
|
||||
'copy:frontendLib',
|
||||
@@ -299,5 +295,4 @@ module.exports = function (grunt) {
|
||||
'chmod',
|
||||
'clean:final'
|
||||
]);
|
||||
|
||||
};
|
||||
|
||||
19
README.md
19
README.md
@@ -8,8 +8,8 @@ Download the latest release from our [website](http://www.espocrm.com).
|
||||
|
||||
### Requirements
|
||||
|
||||
* PHP 5.6 or above (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.5.3 or above.
|
||||
* PHP 7.1 or above (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.5.3 or above, or MariaDB.
|
||||
|
||||
For more information about server configuration see [this article](https://www.espocrm.com/documentation/administration/server-configuration/).
|
||||
|
||||
@@ -17,10 +17,14 @@ For more information about server configuration see [this article](https://www.e
|
||||
|
||||
Documentation for administrators, users and developers is available [here](https://www.espocrm.com/documentation/).
|
||||
|
||||
### How to report bug
|
||||
### How to report a bug
|
||||
|
||||
Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our [forum](http://forum.espocrm.com/forum/bug-reports).
|
||||
|
||||
### How to install a stable version
|
||||
|
||||
[Download](https://www.espocrm.com/download/) the latest version. See the [instructions](https://www.espocrm.com/documentation/administration/installation/) about installation.
|
||||
|
||||
### How to get started (for developers)
|
||||
|
||||
1. Clone repository to your local computer.
|
||||
@@ -34,7 +38,7 @@ Now you can build. Build will create compiled css files.
|
||||
|
||||
To compose a proper config.php and populate database you can run install by opening `http(s)://{YOUR_CRM_URL}/install` location in a browser. Then open `data/config.php` file and add `isDeveloperMode => true`.
|
||||
|
||||
### How to build
|
||||
### How to build (for developers)
|
||||
|
||||
You need to have nodejs and Grunt CLI installed.
|
||||
|
||||
@@ -48,6 +52,12 @@ The build will be created in the `build` directory.
|
||||
|
||||
Before we can merge your pull request you need to accept our CLA [here](https://github.com/espocrm/cla). It's very simple to do.
|
||||
|
||||
Branches:
|
||||
|
||||
* hotfix/* – upcoming maintenance release; fixes should be pushed to this branch;
|
||||
* master – develop branch; new features should be pushed to this branch;
|
||||
* stable – last stable release.
|
||||
|
||||
### How to make a translation
|
||||
|
||||
Build po file with command:
|
||||
@@ -66,4 +76,3 @@ Json files will be created in build directory grouped by folders.
|
||||
### License
|
||||
|
||||
EspoCRM is published under the GNU GPLv3 [license](https://raw.githubusercontent.com/espocrm/espocrm/master/LICENSE.txt).
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -48,7 +48,9 @@ class EmailAddress extends \Espo\Core\Acl\Base
|
||||
if (!$this->getAclManager()->check($user, $e, 'edit')) {
|
||||
$isFobidden = true;
|
||||
if (
|
||||
$e->get('isPortalUser') && $excludeEntity->getEntityType() === 'Contact' &&
|
||||
$e->getEntityType() === 'User' &&
|
||||
$e->isPortal() &&
|
||||
$excludeEntity->getEntityType() === 'Contact' &&
|
||||
$e->get('contactId') === $excludeEntity->id
|
||||
) {
|
||||
$isFobidden = false;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,6 +46,21 @@ class Note extends \Espo\Core\Acl\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
if ($parent) {
|
||||
if ($this->getAclManager()->checkEntity($user, $parent, 'stream')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkEntityEdit(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -48,7 +48,9 @@ class PhoneNumber extends \Espo\Core\Acl\Base
|
||||
if (!$this->getAclManager()->check($user, $e, 'edit')) {
|
||||
$isFobidden = true;
|
||||
if (
|
||||
$e->get('isPortalUser') && $excludeEntity->getEntityType() === 'Contact' &&
|
||||
$e->getEntityType() === 'User' &&
|
||||
$e->isPortal() &&
|
||||
$excludeEntity->getEntityType() === 'Contact' &&
|
||||
$e->get('contactId') === $excludeEntity->id
|
||||
) {
|
||||
$isFobidden = false;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -44,6 +44,9 @@ class User extends \Espo\Core\Acl\Base
|
||||
if (!$user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
if ($entity->isSuperAdmin() && !$user->isSuperAdmin()) {
|
||||
return false;
|
||||
}
|
||||
return $this->checkEntity($user, $entity, $data, 'create');
|
||||
}
|
||||
|
||||
@@ -55,6 +58,12 @@ class User extends \Espo\Core\Acl\Base
|
||||
if (!$user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
if ($entity->isSystem()) {
|
||||
return false;
|
||||
}
|
||||
if ($entity->isSuperAdmin() && !$user->isSuperAdmin()) {
|
||||
return false;
|
||||
}
|
||||
return parent::checkEntityDelete($user, $entity, $data);
|
||||
}
|
||||
|
||||
@@ -63,11 +72,17 @@ class User extends \Espo\Core\Acl\Base
|
||||
if ($entity->id === 'system') {
|
||||
return false;
|
||||
}
|
||||
if ($entity->isSystem()) {
|
||||
return false;
|
||||
}
|
||||
if (!$user->isAdmin()) {
|
||||
if ($user->id !== $entity->id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ($entity->isSuperAdmin() && !$user->isSuperAdmin()) {
|
||||
return false;
|
||||
}
|
||||
return $this->checkEntity($user, $entity, $data, 'edit');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,5 +41,26 @@ class Note extends \Espo\Core\AclPortal\Base
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('type') !== 'Post') return false;
|
||||
|
||||
if ($entity->get('type') === 'Post' && $entity->get('targetType')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$entity->get('parentId') || !$entity->get('parentType')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
if ($parent) {
|
||||
if ($this->getAclManager()->checkEntity($user, $parent, 'stream')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -33,39 +33,38 @@ use \Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class ActionHistoryRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
public function beforeListLinked()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
public function beforeMassDelete()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -69,7 +69,7 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
public function postActionUploadUpgradePackage($params, $data)
|
||||
{
|
||||
if ($this->getConfig()->get('restrictedMode')) {
|
||||
if (!$this->getUser()->get('isSuperAdmin')) {
|
||||
if (!$this->getUser()->isSuperAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
public function postActionRunUpgrade($params, $data)
|
||||
{
|
||||
if ($this->getConfig()->get('restrictedMode')) {
|
||||
if (!$this->getUser()->get('isSuperAdmin')) {
|
||||
if (!$this->getUser()->isSuperAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
@@ -108,4 +108,10 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
$adminNotificationManager = new \Espo\Core\Utils\AdminNotificationManager($this->getContainer());
|
||||
return $adminNotificationManager->getNotificationList();
|
||||
}
|
||||
|
||||
public function actionSystemRequirementList($params)
|
||||
{
|
||||
$systemRequirementManager = new \Espo\Core\Utils\SystemRequirements($this->getContainer());
|
||||
return $systemRequirementManager->getAllRequiredList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,4 +41,20 @@ class Attachment extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
return parent::actionList($params, $data, $request);
|
||||
}
|
||||
|
||||
public function postActionGetAttachmentFromImageUrl($params, $data)
|
||||
{
|
||||
if (empty($data->url)) throw new BadRequest();
|
||||
if (empty($data->field)) throw new BadRequest('postActionGetAttachmentFromImageUrl: No field specified');
|
||||
|
||||
return $this->getRecordService()->getAttachmentFromImageUrl($data)->getValueMap();
|
||||
}
|
||||
|
||||
public function postActionGetCopiedAttachment($params, $data)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (empty($data->field)) throw new BadRequest('postActionGetCopiedAttachment copy: No field specified');
|
||||
|
||||
return $this->getRecordService()->getCopiedAttachment($data)->getValueMap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,27 +40,27 @@ class AuthLogRecord extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -80,17 +80,17 @@ class AuthToken extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,12 +46,8 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
return $this->getRecordService()->getCopiedAttachments($id);
|
||||
}
|
||||
|
||||
public function actionSendTestEmail($params, $data, $request)
|
||||
public function postActionSendTestEmail($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->checkScope('Email')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -34,16 +34,18 @@ use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionGetFolders($params, $data, $request)
|
||||
public function postActionGetFolders($params, $data)
|
||||
{
|
||||
return $this->getRecordService()->getFolders(array(
|
||||
'host' => $request->get('host'),
|
||||
'port' => $request->get('port'),
|
||||
'ssl' => $request->get('ssl') === 'true',
|
||||
'username' => $request->get('username'),
|
||||
'password' => $request->get('password'),
|
||||
'id' => $request->get('id')
|
||||
));
|
||||
return $this->getRecordService()->getFolders([
|
||||
'host' => $data->host ?? null,
|
||||
'port' => $data->port ?? null,
|
||||
'ssl' => $data->ssl ?? false,
|
||||
'username' => $data->username ?? null,
|
||||
'password' => $data->password ?? null,
|
||||
'id' => $data->id ?? null,
|
||||
'emailAddress' => $data->emailAddress ?? null,
|
||||
'userId' => $data->userId ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function checkControllerAccess()
|
||||
@@ -53,12 +55,8 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionTestConnection($params, $data, $request)
|
||||
public function postActionTestConnection($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data->password)) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data->id);
|
||||
if (!$emailAccount || !$emailAccount->id) {
|
||||
@@ -75,4 +73,3 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
return $this->getRecordService()->testConnection(get_object_vars($data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -42,11 +42,13 @@ class EmailAddress extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
$q = $request->get('q');
|
||||
$limit = intval($request->get('limit'));
|
||||
if (empty($limit) || $limit > 30) {
|
||||
$limit = 5;
|
||||
$maxSize = intval($request->get('maxSize'));
|
||||
if (empty($maxSize) || $maxSize > 50) {
|
||||
$maxSize = $this->getConfig()->get('recordsPerPage', 20);
|
||||
}
|
||||
return $this->getRecordService()->searchInAddressBook($q, $limit);
|
||||
|
||||
$onlyActual = $request->get('onlyActual') === 'true';
|
||||
|
||||
return $this->getRecordService()->searchInAddressBook($q, $maxSize, $onlyActual);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -90,7 +90,7 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
$params['iconClass'] = $data['iconClass'];
|
||||
}
|
||||
if (isset($data['fullTextSearch'])) {
|
||||
$params['fullTestSearch'] = $data['fullTextSearch'];
|
||||
$params['fullTextSearch'] = $data['fullTextSearch'];
|
||||
}
|
||||
|
||||
$params['kanbanViewMode'] = !empty($data['kanbanViewMode']);
|
||||
@@ -130,10 +130,6 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
$name = $data['name'];
|
||||
$name = filter_var($name, \FILTER_SANITIZE_STRING);
|
||||
|
||||
if (!empty($data['sortDirection'])) {
|
||||
$data['asc'] = $data['sortDirection'] === 'asc';
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('entityManagerUtil')->update($name, $data);
|
||||
|
||||
if ($result) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -66,7 +66,7 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
if ($this->getConfig()->get('restrictedMode')) {
|
||||
if (!$this->getUser()->get('isSuperAdmin')) {
|
||||
if (!$this->getUser()->isSuperAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
if ($this->getConfig()->get('restrictedMode')) {
|
||||
if (!$this->getUser()->get('isSuperAdmin')) {
|
||||
if (!$this->getUser()->isSuperAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
@@ -94,25 +94,6 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
return true;
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionDelete($params, $data, $request)
|
||||
{
|
||||
@@ -120,7 +101,7 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
throw BadRequest();
|
||||
}
|
||||
if ($this->getConfig()->get('restrictedMode')) {
|
||||
if (!$this->getUser()->get('isSuperAdmin')) {
|
||||
if (!$this->getUser()->isSuperAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
@@ -129,22 +110,42 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
return true;
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforePatch()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeListLinked()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassDelete()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -47,17 +47,27 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
public function actionList($params, $data, $request)
|
||||
{
|
||||
$integrations = $this->getEntityManager()->getRepository('Integration')->find();
|
||||
$arr = array();
|
||||
|
||||
$list = [];
|
||||
foreach ($integrations as $entity) {
|
||||
if ($entity->get('enabled') && $this->getMetadata()->get('integrations.' . $entity->id .'.allowUserAccounts')) {
|
||||
$arr[] = array(
|
||||
|
||||
$userAccountAclScope = $this->getMetadata()->get(['integrations', $entity->id, 'userAccountAclScope']);
|
||||
|
||||
if ($userAccountAclScope) {
|
||||
if (!$this->getAcl()->checkScope($userAccountAclScope)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$list[] = [
|
||||
'id' => $entity->id
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
return array(
|
||||
'list' => $arr
|
||||
);
|
||||
return [
|
||||
'list' => $list
|
||||
];
|
||||
}
|
||||
|
||||
public function actionGetOAuth2Info($params, $data, $request)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -43,27 +43,27 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
public function beforePatch()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -93,9 +93,9 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
$attachment->set('contents', $contents);
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
|
||||
return array(
|
||||
return [
|
||||
'attachmentId' => $attachment->id
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public function actionRevert($params, $data, $request)
|
||||
@@ -175,7 +175,7 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
$timezone = $data->timezone;
|
||||
}
|
||||
|
||||
$importParams = array(
|
||||
$importParams = [
|
||||
'headerRow' => !empty($data->headerRow),
|
||||
'delimiter' => $data->delimiter,
|
||||
'textQualifier' => $data->textQualifier,
|
||||
@@ -188,8 +188,9 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
'defaultValues' => $data->defaultValues,
|
||||
'action' => $data->action,
|
||||
'skipDuplicateChecking' => !empty($data->skipDuplicateChecking),
|
||||
'idleMode' => !empty($data->idleMode)
|
||||
);
|
||||
'idleMode' => !empty($data->idleMode),
|
||||
'silentMode' => !empty($data->silentMode),
|
||||
];
|
||||
|
||||
if (property_exists($data, 'updateBy')) {
|
||||
$importParams['updateBy'] = $data->updateBy;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,24 +41,20 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionGetFolders($params, $data, $request)
|
||||
public function postActionGetFolders($params, $data, $request)
|
||||
{
|
||||
return $this->getRecordService()->getFolders(array(
|
||||
'host' => $request->get('host'),
|
||||
'port' => $request->get('port'),
|
||||
'ssl' => $request->get('ssl') === 'true',
|
||||
'username' => $request->get('username'),
|
||||
'password' => $request->get('password'),
|
||||
'id' => $request->get('id')
|
||||
));
|
||||
return $this->getRecordService()->getFolders([
|
||||
'host' => $data->host ?? null,
|
||||
'port' => $data->port ?? null,
|
||||
'ssl' => $data->ssl ?? false,
|
||||
'username' => $data->username ?? null,
|
||||
'password' => $data->password ?? null,
|
||||
'id' => $data->id ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionTestConnection($params, $data, $request)
|
||||
public function postActionTestConnection($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data->password)) {
|
||||
$inboundEmail = $this->getEntityManager()->getEntity('InboundEmail', $data->id);
|
||||
if (!$inboundEmail || !$inboundEmail->id) {
|
||||
@@ -69,5 +65,4 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
|
||||
return $this->getRecordService()->testConnection(get_object_vars($data));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,37 +41,37 @@ class Job extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
public function beforePatch()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
public function beforeListLinked()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,12 +35,24 @@ class LastViewed extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function getActionIndex($params, $data, $request)
|
||||
{
|
||||
$result = $this->getServiceFactory()->create('LastViewed')->get();
|
||||
$params = [];
|
||||
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
|
||||
$params['offset'] = $request->get('offset', 0);
|
||||
$params['maxSize'] = $request->get('maxSize');
|
||||
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', \Espo\Core\Controllers\Record::MAX_SIZE_LIMIT);
|
||||
if (empty($params['maxSize'])) {
|
||||
$params['maxSize'] = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($params['maxSize']) && $params['maxSize'] > $maxSizeLimit) {
|
||||
throw new Forbidden("Max size should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
$result = $this->getServiceFactory()->create('LastViewed')->getList($params);
|
||||
|
||||
return (object) [
|
||||
'total' => $result->total,
|
||||
'list' => $result->collection->getValueMapList()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -78,15 +78,18 @@ class Layout extends \Espo\Core\Controllers\Base
|
||||
return $this->actionUpdate($params, $data, $request);
|
||||
}
|
||||
|
||||
public function actionResetToDefault($params, $data, $request)
|
||||
public function postActionResetToDefault($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (empty($data->scope) || empty($data->name)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getContainer()->get('dataManager')->updateCacheTimestamp();
|
||||
|
||||
return $this->getContainer()->get('layout')->resetToDefault($data->scope, $data->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,17 +31,38 @@ namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
use \Espo\Core\Exceptions\NotFound;
|
||||
|
||||
class LeadCapture extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionLeadCapture($params, $data, $request)
|
||||
public function postActionLeadCapture($params, $data, $request, $response)
|
||||
{
|
||||
if (empty($params['apiKey'])) throw new BadRequest('No API key provided.');
|
||||
if (empty($data)) throw new BadRequest('No payload provided.');
|
||||
|
||||
$allowOrigin = $this->getConfig()->get('leadCaptureAllowOrigin', '*');
|
||||
$response->headers->set('Access-Control-Allow-Origin', $allowOrigin);
|
||||
|
||||
return $this->getRecordService()->leadCapture($params['apiKey'], $data);
|
||||
}
|
||||
|
||||
public function optionsActionLeadCapture($params, $data, $request, $response)
|
||||
{
|
||||
if (empty($params['apiKey'])) throw new BadRequest('No API key provided.');
|
||||
|
||||
if (!$this->getRecordService()->isApiKeyValid($params['apiKey'])) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$allowOrigin = $this->getConfig()->get('leadCaptureAllowOrigin', '*');
|
||||
|
||||
$response->headers->set('Access-Control-Allow-Headers', 'Content-Type, Accept');
|
||||
$response->headers->set('Access-Control-Allow-Origin', $allowOrigin);
|
||||
$response->headers->set('Access-Control-Allow-Methods', 'POST');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionGenerateNewApiKey($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,7 +35,7 @@ class Notification extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public static $defaultAction = 'list';
|
||||
|
||||
public function actionList($params, $data, $request)
|
||||
public function getActionList($params, $data, $request, $response)
|
||||
{
|
||||
$userId = $this->getUser()->id;
|
||||
|
||||
@@ -73,29 +73,28 @@ class Notification extends \Espo\Core\Controllers\Record
|
||||
return $this->getService('Notification')->markAllRead($userId);
|
||||
}
|
||||
|
||||
public function actionExport($params, $data, $request)
|
||||
public function beforeExport()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionMerge($params, $data, $request)
|
||||
public function beforeMerge()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -132,7 +132,7 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
|
||||
$entity->set('smtpEmailAddress', $user->get('emailAddress'));
|
||||
$entity->set('name', $user->get('name'));
|
||||
$entity->set('isPortalUser', $user->get('isPortalUser'));
|
||||
$entity->set('isPortalUser', $user->isPortal());
|
||||
|
||||
$entity->clear('smtpPassword');
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,24 +35,19 @@ use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class Settings extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
|
||||
protected function getConfigData()
|
||||
{
|
||||
if ($this->getUser()->id == 'system') {
|
||||
$data = $this->getConfig()->getData();
|
||||
} else {
|
||||
$data = $this->getConfig()->getData($this->getUser()->isAdmin());
|
||||
$data = $this->getServiceFactory()->create('Settings')->getConfigData();
|
||||
|
||||
$data->jsLibs = $this->getMetadata()->get(['app', 'jsLibs']);
|
||||
|
||||
unset($data->loginView);
|
||||
$loginView = $this->getMetadata()->get(['clientDefs', 'App', 'loginView']);
|
||||
if ($loginView) {
|
||||
$data->loginView = $loginView;
|
||||
}
|
||||
|
||||
$fieldDefs = $this->getMetadata()->get('entityDefs.Settings.fields');
|
||||
|
||||
foreach ($fieldDefs as $field => $d) {
|
||||
if ($d['type'] === 'password') {
|
||||
unset($data[$field]);
|
||||
}
|
||||
}
|
||||
|
||||
$data['jsLibs'] = $this->getMetadata()->get('app.jsLibs');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -76,23 +71,7 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (
|
||||
(isset($data->useCache) && $data->useCache !== $this->getConfig()->get('useCache'))
|
||||
||
|
||||
(isset($data->aclStrictMode) && $data->aclStrictMode !== $this->getConfig()->get('aclStrictMode'))
|
||||
) {
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
}
|
||||
|
||||
$this->getConfig()->setData($data, $this->getUser()->isAdmin());
|
||||
$result = $this->getConfig()->save();
|
||||
if ($result === false) {
|
||||
throw new Error('Cannot save settings');
|
||||
}
|
||||
|
||||
if (isset($data->defaultCurrency) || isset($data->baseCurrency) || isset($data->currencyRates)) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase([]);
|
||||
}
|
||||
$this->getServiceFactory()->create('Settings')->setConfigData($data);
|
||||
|
||||
return $this->getConfigData();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -49,24 +49,59 @@ class Stream extends \Espo\Core\Controllers\Base
|
||||
|
||||
$service = $this->getService('Stream');
|
||||
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = self::MAX_SIZE_LIMIT;
|
||||
$maxSize = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) {
|
||||
throw new Forbidden();
|
||||
if (!empty($maxSize) && $maxSize > $maxSizeLimit) {
|
||||
throw new Forbidden("Max size should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
$result = $service->find($scope, $id, array(
|
||||
$result = $service->find($scope, $id, [
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'after' => $after,
|
||||
'filter' => $filter
|
||||
));
|
||||
]);
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => $result['collection']->toArray()
|
||||
);
|
||||
return (object) [
|
||||
'total' => $result->total,
|
||||
'list' => $result->collection->getValueMapList()
|
||||
];
|
||||
}
|
||||
|
||||
public function getActionListPosts($params, $data, $request)
|
||||
{
|
||||
$scope = $params['scope'];
|
||||
$id = isset($params['id']) ? $params['id'] : null;
|
||||
|
||||
$offset = intval($request->get('offset'));
|
||||
$maxSize = intval($request->get('maxSize'));
|
||||
$after = $request->get('after');
|
||||
|
||||
$where = $request->get('where');
|
||||
|
||||
$service = $this->getService('Stream');
|
||||
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($maxSize) && $maxSize > $maxSizeLimit) {
|
||||
throw new Forbidden("Max size should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
$result = $service->find($scope, $id, [
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'after' => $after,
|
||||
'filter' => 'posts',
|
||||
'where' => $where
|
||||
]);
|
||||
|
||||
return (object) [
|
||||
'total' => $result->total,
|
||||
'list' => $result->collection->getValueMapList()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
122
application/Espo/Controllers/TemplateManager.php
Normal file
122
application/Espo/Controllers/TemplateManager.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use Espo\Core\Utils as Utils;
|
||||
use \Espo\Core\Exceptions\NotFound;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class TemplateManager extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function getActionGetTemplate($params, $data, $request)
|
||||
{
|
||||
$name = $request->get('name');
|
||||
if (empty($name)) throw new BadRequest();
|
||||
$scope = $request->get('scope');
|
||||
$module = null;
|
||||
$module = $this->getMetadata()->get(['app', 'templates', $name, 'module']);
|
||||
$hasSubject = !$this->getMetadata()->get(['app', 'templates', $name, 'noSubject']);
|
||||
|
||||
$templateFileManager = $this->getContainer()->get('templateFileManager');
|
||||
|
||||
$returnData = (object) [];
|
||||
$returnData->body = $templateFileManager->getTemplate($name, 'body', $scope, $module);
|
||||
|
||||
if ($hasSubject) {
|
||||
$returnData->subject = $templateFileManager->getTemplate($name, 'subject', $scope, $module);
|
||||
}
|
||||
|
||||
return $returnData;
|
||||
}
|
||||
|
||||
public function postActionSaveTemplate($params, $data)
|
||||
{
|
||||
$scope = null;
|
||||
if (empty($data->name)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!empty($data->scope)) {
|
||||
$scope = $data->scope;
|
||||
}
|
||||
|
||||
$templateFileManager = $this->getContainer()->get('templateFileManager');
|
||||
|
||||
if (isset($data->subject)) {
|
||||
$templateFileManager->saveTemplate($data->name, 'subject', $data->subject, $scope);
|
||||
}
|
||||
|
||||
if (isset($data->body)) {
|
||||
$templateFileManager->saveTemplate($data->name, 'body', $data->body, $scope);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionResetTemplate($params, $data)
|
||||
{
|
||||
$scope = null;
|
||||
if (empty($data->name)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!empty($data->scope)) {
|
||||
$scope = $data->scope;
|
||||
}
|
||||
|
||||
$module = null;
|
||||
$module = $this->getMetadata()->get(['app', 'templates', $data->name, 'module']);
|
||||
$hasSubject = !$this->getMetadata()->get(['app', 'templates', $data->name, 'noSubject']);
|
||||
|
||||
$templateFileManager = $this->getContainer()->get('templateFileManager');
|
||||
|
||||
if ($hasSubject) {
|
||||
$templateFileManager->resetTemplate($data->name, 'subject', $scope);
|
||||
}
|
||||
|
||||
$templateFileManager->resetTemplate($data->name, 'body', $scope);
|
||||
|
||||
$returnData = (object) [];
|
||||
$returnData->body = $templateFileManager->getTemplate($data->name, 'body', $scope, $module);
|
||||
|
||||
if ($hasSubject) {
|
||||
$returnData->subject = $templateFileManager->getTemplate($data->name, 'subject', $scope, $module);
|
||||
}
|
||||
|
||||
return $returnData;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -105,5 +105,21 @@ class User extends \Espo\Core\Controllers\Record
|
||||
|
||||
return $this->getService('User')->passwordChangeRequest($userName, $emailAddress, $url);
|
||||
}
|
||||
}
|
||||
|
||||
public function postActionGenerateNewApiKey($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
return $this->getRecordService()->generateNewApiKeyForEntity($data->id)->getValueMap();
|
||||
}
|
||||
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeRemoveLink($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -124,6 +124,11 @@ class Acl
|
||||
return $this->getAclManager()->getScopeForbiddenFieldList($this->getUser(), $scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function getScopeForbiddenLinkList($scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
return $this->getAclManager()->getScopeForbiddenLinkList($this->getUser(), $scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function checkUserPermission($target, $permissionType = 'userPermission')
|
||||
{
|
||||
return $this->getAclManager()->checkUserPermission($this->getUser(), $target, $permissionType);
|
||||
@@ -133,5 +138,19 @@ class Acl
|
||||
{
|
||||
return $this->getAclManager()->checkAssignmentPermission($this->getUser(), $target);
|
||||
}
|
||||
}
|
||||
|
||||
public function getScopeRestrictedFieldList($scope, $type)
|
||||
{
|
||||
return $this->getAclManager()->getScopeRestrictedFieldList($scope, $type);
|
||||
}
|
||||
|
||||
public function getScopeRestrictedAttributeList($scope, $type)
|
||||
{
|
||||
return $this->getAclManager()->getScopeRestrictedAttributeList($scope, $type);
|
||||
}
|
||||
|
||||
public function getScopeRestrictedLinkList($scope, $type)
|
||||
{
|
||||
return $this->getAclManager()->getScopeRestrictedLinkList($scope, $type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -36,18 +36,22 @@ use \Espo\ORM\Entity;
|
||||
|
||||
class Base implements Injectable
|
||||
{
|
||||
protected $dependencies = array(
|
||||
protected $dependencyList = [
|
||||
'config',
|
||||
'entityManager',
|
||||
'aclManager'
|
||||
);
|
||||
'aclManager',
|
||||
];
|
||||
|
||||
protected $dependencies = []; // for backward compatibility
|
||||
|
||||
protected $scope;
|
||||
|
||||
protected $injections = array();
|
||||
protected $injections = [];
|
||||
|
||||
protected $ownerUserIdAttribute = null;
|
||||
|
||||
protected $allowDeleteCreatedThresholdPeriod = '24 hours';
|
||||
|
||||
public function inject($name, $object)
|
||||
{
|
||||
$this->injections[$name] = $object;
|
||||
@@ -77,12 +81,12 @@ class Base implements Injectable
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencies[] = $name;
|
||||
$this->dependencyList[] = $name;
|
||||
}
|
||||
|
||||
public function getDependencyList()
|
||||
{
|
||||
return $this->dependencies;
|
||||
return array_merge($this->dependencyList, $this->dependencies);
|
||||
}
|
||||
|
||||
protected function getConfig()
|
||||
@@ -267,15 +271,26 @@ class Base implements Injectable
|
||||
&&
|
||||
$entity->has('createdById') && $entity->get('createdById') == $user->id
|
||||
) {
|
||||
$isDeletedAllowed = false;
|
||||
if (!$entity->has('assignedUserId')) {
|
||||
return true;
|
||||
$isDeletedAllowed = true;
|
||||
} else {
|
||||
if (!$entity->get('assignedUserId')) {
|
||||
return true;
|
||||
$isDeletedAllowed = true;
|
||||
} else if ($entity->get('assignedUserId') == $entity->get('createdById')) {
|
||||
$isDeletedAllowed = true;
|
||||
}
|
||||
if ($entity->get('assignedUserId') == $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($isDeletedAllowed) {
|
||||
$createdAt = $entity->get('createdAt');
|
||||
if ($createdAt) {
|
||||
$deleteThresholdPeriod = $this->getConfig()->get('aclAllowDeleteCreatedThresholdPeriod', $this->allowDeleteCreatedThresholdPeriod);
|
||||
if (\Espo\Core\Utils\DateTime::isAfterThreshold($createdAt, $deleteThresholdPeriod)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
175
application/Espo/Core/Acl/GlobalRestricton.php
Normal file
175
application/Espo/Core/Acl/GlobalRestricton.php
Normal file
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Acl;
|
||||
|
||||
class GlobalRestricton
|
||||
{
|
||||
protected $fieldTypeList = [
|
||||
'forbidden', // totally forbidden
|
||||
'internal', // reading forbidden, writing allowed
|
||||
'onlyAdmin', // forbidden for non admin users
|
||||
'readOnly', // read-only for all users
|
||||
'nonAdminReadOnly' // read-only for non-admin users
|
||||
];
|
||||
|
||||
protected $linkTypeList = [
|
||||
'forbidden', // totally forbidden
|
||||
'internal', // reading forbidden, writing allowed
|
||||
'onlyAdmin', // forbidden for non admin users
|
||||
'readOnly', // read-only for all users
|
||||
'nonAdminReadOnly' // read-only for non-admin users
|
||||
];
|
||||
|
||||
protected $cacheFilePath = 'data/cache/application/entityAcl.php';
|
||||
|
||||
private $metadata;
|
||||
|
||||
private $fileManager;
|
||||
|
||||
private $fieldManagerUtil;
|
||||
|
||||
private $data;
|
||||
|
||||
public function __construct(
|
||||
\Espo\Core\Utils\Metadata $metadata,
|
||||
\Espo\Core\Utils\File\Manager $fileManager,
|
||||
\Espo\Core\Utils\FieldManagerUtil $fieldManagerUtil
|
||||
)
|
||||
{
|
||||
$this->metadata = $metadata;
|
||||
$this->fileManager = $fileManager;
|
||||
$this->fieldManagerUtil = $fieldManagerUtil;
|
||||
|
||||
if (!file_exists($this->cacheFilePath)) {
|
||||
$this->buildCacheFile();
|
||||
}
|
||||
|
||||
$this->data = include($this->cacheFilePath);
|
||||
}
|
||||
|
||||
protected function buildCacheFile()
|
||||
{
|
||||
$scopeList = array_keys($this->getMetadata()->get(['entityDefs'], []));
|
||||
|
||||
$data = (object) [];
|
||||
|
||||
foreach ($scopeList as $scope) {
|
||||
$fieldList = array_keys($this->getMetadata()->get(['entityDefs', $scope, 'fields'], []));
|
||||
$linkList = array_keys($this->getMetadata()->get(['entityDefs', $scope, 'links'], []));
|
||||
|
||||
$isNotEmpty = false;
|
||||
|
||||
$scopeData = (object) [
|
||||
'fields' => (object) [],
|
||||
'attributes' => (object) [],
|
||||
'links' => (object) []
|
||||
];
|
||||
|
||||
foreach ($this->fieldTypeList as $type) {
|
||||
$resultFieldList = [];
|
||||
$resultAttributeList = [];
|
||||
|
||||
foreach ($fieldList as $field) {
|
||||
if ($this->getMetadata()->get(['entityAcl', $scope, 'fields', $field, $type])) {
|
||||
$isNotEmpty = true;
|
||||
$resultFieldList[] = $field;
|
||||
$fieldAttributeList = $this->getFieldManagerUtil()->getAttributeList($scope, $field);
|
||||
foreach ($fieldAttributeList as $attribute) {
|
||||
$resultAttributeList[] = $attribute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scopeData->fields->$type = $resultFieldList;
|
||||
$scopeData->attributes->$type = $resultAttributeList;
|
||||
}
|
||||
foreach ($this->linkTypeList as $type) {
|
||||
$resultLinkList = [];
|
||||
foreach ($linkList as $link) {
|
||||
if ($this->getMetadata()->get(['entityAcl', $scope, 'links', $link, $type])) {
|
||||
$isNotEmpty = true;
|
||||
$resultLinkList[] = $link;
|
||||
}
|
||||
}
|
||||
$scopeData->links->$type = $resultLinkList;
|
||||
}
|
||||
|
||||
if ($isNotEmpty) {
|
||||
$data->$scope = $scopeData;
|
||||
}
|
||||
}
|
||||
|
||||
$this->data = $data;
|
||||
|
||||
$this->getFileManager()->putPhpContents($this->cacheFilePath, $data, true);
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
{
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
protected function getFileManager()
|
||||
{
|
||||
return $this->fileManager;
|
||||
}
|
||||
|
||||
protected function getFieldManagerUtil()
|
||||
{
|
||||
return $this->fieldManagerUtil;
|
||||
}
|
||||
|
||||
public function getScopeRestrictedFieldList($scope, $type)
|
||||
{
|
||||
if (!property_exists($this->data, $scope)) return [];
|
||||
if (!property_exists($this->data->$scope, 'fields')) return [];
|
||||
if (!property_exists($this->data->$scope->fields, $type)) return [];
|
||||
|
||||
return $this->data->$scope->fields->$type;
|
||||
}
|
||||
|
||||
public function getScopeRestrictedAttributeList($scope, $type)
|
||||
{
|
||||
if (!property_exists($this->data, $scope)) return [];
|
||||
if (!property_exists($this->data->$scope, 'attributes')) return [];
|
||||
if (!property_exists($this->data->$scope->attributes, $type)) return [];
|
||||
|
||||
return $this->data->$scope->attributes->$type;
|
||||
}
|
||||
|
||||
public function getScopeRestrictedLinkList($scope, $type)
|
||||
{
|
||||
if (!property_exists($this->data, $scope)) return [];
|
||||
if (!property_exists($this->data->$scope, 'links')) return [];
|
||||
if (!property_exists($this->data->$scope->links, $type)) return [];
|
||||
|
||||
return $this->data->$scope->links->$type;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -182,6 +182,15 @@ class Table
|
||||
return 'no';
|
||||
}
|
||||
|
||||
public function getHighestLevel($action)
|
||||
{
|
||||
if (in_array($action, $this->booleanActionList)) {
|
||||
return 'yes';
|
||||
} else {
|
||||
return 'all';
|
||||
}
|
||||
}
|
||||
|
||||
private function load()
|
||||
{
|
||||
$valuePermissionLists = (object)[];
|
||||
@@ -554,7 +563,7 @@ class Table
|
||||
|
||||
protected function applyAdditional(&$table, &$fieldTable, &$valuePermissionLists)
|
||||
{
|
||||
if ($this->getUser()->get('isPortalUser')) {
|
||||
if ($this->getUser()->isPortal()) {
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
$table->$scope = false;
|
||||
unset($fieldTable->$scope);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,18 +41,26 @@ class AclManager
|
||||
|
||||
private $metadata;
|
||||
|
||||
private $implementationHashMap = array();
|
||||
private $implementationHashMap = [];
|
||||
|
||||
private $tableHashMap = array();
|
||||
private $tableHashMap = [];
|
||||
|
||||
protected $tableClassName = '\\Espo\\Core\\Acl\\Table';
|
||||
|
||||
protected $userAclClassName = '\\Espo\\Core\\Acl';
|
||||
|
||||
protected $globalRestricton;
|
||||
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->metadata = $container->get('metadata');
|
||||
|
||||
$this->globalRestricton = new \Espo\Core\Acl\GlobalRestricton(
|
||||
$container->get('metadata'),
|
||||
$container->get('fileManager'),
|
||||
$container->get('fieldManagerUtil')
|
||||
);
|
||||
}
|
||||
|
||||
protected function getContainer()
|
||||
@@ -85,8 +93,8 @@ class AclManager
|
||||
|
||||
if (class_exists($className)) {
|
||||
$acl = new $className($scope);
|
||||
$dependencies = $acl->getDependencyList();
|
||||
foreach ($dependencies as $name) {
|
||||
$dependencyList = $acl->getDependencyList();
|
||||
foreach ($dependencyList as $name) {
|
||||
$acl->inject($name, $this->getContainer()->get($name));
|
||||
}
|
||||
$this->implementationHashMap[$scope] = $acl;
|
||||
@@ -125,7 +133,7 @@ class AclManager
|
||||
public function getLevel(User $user, $scope, $action)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return 'all';
|
||||
return $this->getTable($user)->getHighestLevel($action);
|
||||
}
|
||||
return $this->getTable($user)->getLevel($scope, $action);
|
||||
}
|
||||
@@ -241,16 +249,80 @@ class AclManager
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getGlobalRestrictionTypeList(User $user, $action = 'read')
|
||||
{
|
||||
$typeList = ['forbidden'];
|
||||
|
||||
if ($action === 'read') {
|
||||
$typeList[] = 'internal';
|
||||
}
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$typeList[] = 'onlyAdmin';
|
||||
}
|
||||
|
||||
if ($action === 'edit') {
|
||||
$typeList[] = 'readOnly';
|
||||
if (!$user->isAdmin()) {
|
||||
$typeList[] = 'nonAdminReadOnly';
|
||||
}
|
||||
}
|
||||
|
||||
return $typeList;
|
||||
}
|
||||
|
||||
public function getScopeForbiddenAttributeList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
if ($user->isAdmin()) return [];
|
||||
return $this->getTable($user)->getScopeForbiddenAttributeList($scope, $action, $thresholdLevel);
|
||||
$list = [];
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$list = $this->getTable($user)->getScopeForbiddenAttributeList($scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
if ($thresholdLevel === 'no') {
|
||||
$list = array_merge(
|
||||
$list,
|
||||
$this->getScopeRestrictedAttributeList($scope, $this->getGlobalRestrictionTypeList($user, $action))
|
||||
);
|
||||
$list = array_values($list);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function getScopeForbiddenFieldList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
if ($user->isAdmin()) return [];
|
||||
return $this->getTable($user)->getScopeForbiddenFieldList($scope, $action, $thresholdLevel);
|
||||
$list = [];
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$list = $this->getTable($user)->getScopeForbiddenFieldList($scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
if ($thresholdLevel === 'no') {
|
||||
$list = array_merge(
|
||||
$list,
|
||||
$this->getScopeRestrictedFieldList($scope, $this->getGlobalRestrictionTypeList($user, $action))
|
||||
);
|
||||
$list = array_values($list);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
public function getScopeForbiddenLinkList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
$list = [];
|
||||
|
||||
if ($thresholdLevel === 'no') {
|
||||
$list = array_merge(
|
||||
$list,
|
||||
$this->getScopeRestrictedLinkList($scope, $this->getGlobalRestrictionTypeList($user, $action))
|
||||
);
|
||||
$list = array_values($list);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function checkUserPermission(User $user, $target, $permissionType = 'userPermission')
|
||||
@@ -294,4 +366,46 @@ class AclManager
|
||||
$acl = new $className($this, $user);
|
||||
return $acl;
|
||||
}
|
||||
|
||||
public function getScopeRestrictedFieldList($scope, $type)
|
||||
{
|
||||
if (is_array($type)) {
|
||||
$typeList = $type;
|
||||
$list = [];
|
||||
foreach ($typeList as $type) {
|
||||
$list = array_merge($list, $this->globalRestricton->getScopeRestrictedFieldList($scope, $type));
|
||||
}
|
||||
$list = array_values($list);
|
||||
return $list;
|
||||
}
|
||||
return $this->globalRestricton->getScopeRestrictedFieldList($scope, $type);
|
||||
}
|
||||
|
||||
public function getScopeRestrictedAttributeList($scope, $type)
|
||||
{
|
||||
if (is_array($type)) {
|
||||
$typeList = $type;
|
||||
$list = [];
|
||||
foreach ($typeList as $type) {
|
||||
$list = array_merge($list, $this->globalRestricton->getScopeRestrictedAttributeList($scope, $type));
|
||||
}
|
||||
$list = array_values($list);
|
||||
return $list;
|
||||
}
|
||||
return $this->globalRestricton->getScopeRestrictedAttributeList($scope, $type);
|
||||
}
|
||||
|
||||
public function getScopeRestrictedLinkList($scope, $type)
|
||||
{
|
||||
if (is_array($type)) {
|
||||
$typeList = $type;
|
||||
$list = [];
|
||||
foreach ($typeList as $type) {
|
||||
$list = array_merge($list, $this->globalRestricton->getScopeRestrictedLinkList($scope, $type));
|
||||
}
|
||||
$list = array_values($list);
|
||||
return $list;
|
||||
}
|
||||
return $this->globalRestricton->getScopeRestrictedLinkList($scope, $type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -99,7 +99,7 @@ class Application
|
||||
exit;
|
||||
}
|
||||
|
||||
public function runEntryPoint($entryPoint, $data = array(), $final = false)
|
||||
public function runEntryPoint($entryPoint, $data = [], $final = false)
|
||||
{
|
||||
if (empty($entryPoint)) {
|
||||
throw new \Error();
|
||||
@@ -133,7 +133,9 @@ class Application
|
||||
|
||||
$slim->run();
|
||||
} catch (\Exception $e) {
|
||||
$container->get('output')->processError($e->getMessage(), $e->getCode(), true, $e);
|
||||
try {
|
||||
$container->get('output')->processError($e->getMessage(), $e->getCode(), true, $e);
|
||||
} catch (\Slim\Exception\Stop $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +153,56 @@ class Application
|
||||
$cronManager->run();
|
||||
}
|
||||
|
||||
public function runDaemon()
|
||||
{
|
||||
$maxProcessNumber = $this->getConfig()->get('daemonMaxProcessNumber');
|
||||
$interval = $this->getConfig()->get('daemonInterval');
|
||||
$timeout = $this->getConfig()->get('daemonProcessTimeout');
|
||||
|
||||
$phpExecutablePath = $this->getConfig()->get('phpExecutablePath');
|
||||
if (!$phpExecutablePath) {
|
||||
$phpExecutablePath = (new \Symfony\Component\Process\PhpExecutableFinder)->find();
|
||||
}
|
||||
|
||||
if (!$maxProcessNumber || !$interval) {
|
||||
$GLOBALS['log']->error("Daemon config params are not set.");
|
||||
return;
|
||||
}
|
||||
|
||||
$processList = [];
|
||||
while (true) {
|
||||
$toSkip = false;
|
||||
$runningCount = 0;
|
||||
foreach ($processList as $i => $process) {
|
||||
if ($process->isRunning()) {
|
||||
$runningCount++;
|
||||
} else {
|
||||
unset($processList[$i]);
|
||||
}
|
||||
}
|
||||
$processList = array_values($processList);
|
||||
if (count($runningCount) >= $maxProcessNumber) {
|
||||
$toSkip = true;
|
||||
}
|
||||
if (!$toSkip) {
|
||||
$process = new \Symfony\Component\Process\Process([$phpExecutablePath, 'cron.php']);
|
||||
$process->setTimeout($timeout);
|
||||
$process->run();
|
||||
$processList[] = $process;
|
||||
}
|
||||
sleep($interval);
|
||||
}
|
||||
}
|
||||
|
||||
public function runJob($id)
|
||||
{
|
||||
$auth = $this->createAuth();
|
||||
$auth->useNoAuth();
|
||||
|
||||
$cronManager = new \Espo\Core\CronManager($this->container);
|
||||
$cronManager->runJobById($id);
|
||||
}
|
||||
|
||||
public function runRebuild()
|
||||
{
|
||||
$dataManager = $this->getContainer()->get('dataManager');
|
||||
@@ -163,6 +215,15 @@ class Application
|
||||
$dataManager->clearCache();
|
||||
}
|
||||
|
||||
public function runCommand(string $command)
|
||||
{
|
||||
$auth = $this->createAuth();
|
||||
$auth->useNoAuth();
|
||||
|
||||
$consoleCommandManager = $this->getContainer()->get('consoleCommandManager');
|
||||
return $consoleCommandManager->run($command);
|
||||
}
|
||||
|
||||
public function isInstalled()
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
@@ -203,7 +264,7 @@ class Application
|
||||
}
|
||||
|
||||
$routeOptions = call_user_func($route->getCallable());
|
||||
$routeKeys = is_array($routeOptions) ? array_keys($routeOptions) : array();
|
||||
$routeKeys = is_array($routeOptions) ? array_keys($routeOptions) : [];
|
||||
|
||||
if (!in_array('controller', $routeKeys, true)) {
|
||||
return $container->get('output')->render($routeOptions);
|
||||
@@ -234,7 +295,7 @@ class Application
|
||||
|
||||
try {
|
||||
$controllerManager = $this->getContainer()->get('controllerManager');
|
||||
$result = $controllerManager->process($controllerName, $actionName, $params, $data, $slim->request());
|
||||
$result = $controllerManager->process($controllerName, $actionName, $params, $data, $slim->request(), $slim->response());
|
||||
$container->get('output')->render($result);
|
||||
} catch (\Exception $e) {
|
||||
$container->get('output')->processError($e->getMessage(), $e->getCode(), false, $e);
|
||||
@@ -255,8 +316,6 @@ class Application
|
||||
protected function getRouteList()
|
||||
{
|
||||
$routes = new \Espo\Core\Utils\Route($this->getConfig(), $this->getMetadata(), $this->getContainer()->get('fileManager'));
|
||||
|
||||
|
||||
return $routes->getAll();
|
||||
}
|
||||
|
||||
@@ -266,12 +325,12 @@ class Application
|
||||
|
||||
foreach ($this->getRouteList() as $route) {
|
||||
$method = strtolower($route['method']);
|
||||
if (!in_array($method, $crudList)) {
|
||||
if (!in_array($method, $crudList) && $method !== 'options') {
|
||||
$GLOBALS['log']->error('Route: Method ['.$method.'] does not exist. Please check your route ['.$route['route'].']');
|
||||
continue;
|
||||
}
|
||||
|
||||
$currentRoute = $this->getSlim()->$method($route['route'], function() use ($route) { //todo change "use" for php 5.4
|
||||
$currentRoute = $this->getSlim()->$method($route['route'], function() use ($route) {
|
||||
return $route['params'];
|
||||
});
|
||||
|
||||
@@ -284,30 +343,7 @@ class Application
|
||||
protected function initAutoloads()
|
||||
{
|
||||
$autoload = new \Espo\Core\Utils\Autoload($this->getConfig(), $this->getMetadata(), $this->getContainer()->get('fileManager'));
|
||||
|
||||
try {
|
||||
$autoloadList = $autoload->getAll();
|
||||
} catch (\Exception $e) {} //bad permissions
|
||||
|
||||
if (empty($autoloadList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$namespacesPath = 'vendor/composer/autoload_namespaces.php';
|
||||
$existingNamespaces = file_exists($namespacesPath) ? include($namespacesPath) : array();
|
||||
if (!empty($existingNamespaces) && is_array($existingNamespaces)) {
|
||||
$existingNamespaces = array_keys($existingNamespaces);
|
||||
}
|
||||
|
||||
$classLoader = new \Composer\Autoload\ClassLoader();
|
||||
|
||||
foreach ($autoloadList as $prefix => $path) {
|
||||
if (!in_array($prefix, $existingNamespaces)) {
|
||||
$classLoader->add($prefix, $path);
|
||||
}
|
||||
}
|
||||
|
||||
$classLoader->register(true);
|
||||
$autoload->register();
|
||||
}
|
||||
|
||||
public function setBasePath($basePath)
|
||||
@@ -326,7 +362,9 @@ class Application
|
||||
return $_GET['portalId'];
|
||||
}
|
||||
if (!empty($_COOKIE['auth-token'])) {
|
||||
$token = $this->getContainer()->get('entityManager')->getRepository('AuthToken')->where(array('token' => $_COOKIE['auth-token']))->findOne();
|
||||
$token =
|
||||
$this->getContainer()->get('entityManager')
|
||||
->getRepository('AuthToken')->where(['token' => $_COOKIE['auth-token']])->findOne();
|
||||
|
||||
if ($token && $token->get('portalId')) {
|
||||
return $token->get('portalId');
|
||||
@@ -338,9 +376,9 @@ class Application
|
||||
public function setupSystemUser()
|
||||
{
|
||||
$user = $this->getContainer()->get('entityManager')->getEntity('User', 'system');
|
||||
$user->set('isAdmin', true);
|
||||
$user->set('isAdmin', true); // TODO remove in 5.7
|
||||
$user->set('type', 'system');
|
||||
$this->getContainer()->setUser($user);
|
||||
$this->getContainer()->get('entityManager')->setUser($user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
78
application/Espo/Core/Console/CommandManager.php
Normal file
78
application/Espo/Core/Console/CommandManager.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console;
|
||||
|
||||
class CommandManager
|
||||
{
|
||||
private $container;
|
||||
|
||||
public function __construct(\Espo\Core\Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function run(string $command)
|
||||
{
|
||||
$command = ucfirst(\Espo\Core\Utils\Util::hyphenToCamelCase($command));
|
||||
|
||||
$argumentList = [];
|
||||
$options = [];
|
||||
$flagList = [];
|
||||
|
||||
$skipIndex = 1;
|
||||
if (isset($_SERVER['argv'][0]) && $_SERVER['argv'][0] === 'command.php') {
|
||||
$skipIndex = 2;
|
||||
}
|
||||
|
||||
foreach ($_SERVER['argv'] as $i => $item) {
|
||||
if ($i < $skipIndex) continue;
|
||||
|
||||
if (strpos($item, '--') === 0 && strpos($item, '=') > 2) {
|
||||
list($name, $value) = explode('=', substr($item, 2));
|
||||
$name = \Espo\Core\Utils\Util::hyphenToCamelCase($name);
|
||||
$options[$name] = $value;
|
||||
} else if (strpos($item, '-') === 0) {
|
||||
$flagList[] = substr($item, 1);
|
||||
} else {
|
||||
$argumentList[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
$className = '\\Espo\\Core\\Console\\Commands\\' . $command;
|
||||
$className = $this->container->get('metadata')->get(['app', 'consoleCommands', $command, 'className'], $className);
|
||||
if (!class_exists($className)) {
|
||||
$msg = "Command '{$command}' does not exist.";
|
||||
echo $msg . "\n";
|
||||
throw new \Espo\Core\Exceptions\Error($msg);
|
||||
}
|
||||
$impl = new $className($this->container);
|
||||
return $impl->run($options, $flagList, $argumentList);
|
||||
}
|
||||
}
|
||||
87
application/Espo/Core/Console/Commands/AclCheck.php
Normal file
87
application/Espo/Core/Console/Commands/AclCheck.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class AclCheck extends Base
|
||||
{
|
||||
public function run($options)
|
||||
{
|
||||
$userId = $options['userId'] ?? null;
|
||||
$scope = $options['scope'] ?? null;
|
||||
$id = $options['id'] ?? null;
|
||||
$action = $options['action'] ?? null;
|
||||
|
||||
if (empty($userId)) return;
|
||||
if (empty($scope)) return;
|
||||
if (empty($id)) return;
|
||||
|
||||
$container = $this->getContainer();
|
||||
$entityManager = $container->get('entityManager');
|
||||
|
||||
$user = $entityManager->getEntity('User', $userId);
|
||||
if (!$user) return;
|
||||
|
||||
if ($user->isPortal()) {
|
||||
$portalIdList = $user->getLinkMultipleIdList('portals');
|
||||
foreach ($portalIdList as $portalId) {
|
||||
$application = new \Espo\Core\Portal\Application($portalId);
|
||||
$containerPortal = $application->getContainer();
|
||||
$entityManager = $containerPortal->get('entityManager');
|
||||
|
||||
$user = $entityManager->getEntity('User', $userId);
|
||||
if (!$user) return;
|
||||
|
||||
$result = $this->check($user, $scope, $id, $action, $containerPortal);
|
||||
if ($result) {
|
||||
return 'true';
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->check($user, $scope, $id, $action, $container)) {
|
||||
return 'true';
|
||||
}
|
||||
}
|
||||
|
||||
protected function check($user, $scope, $id, $action, $container)
|
||||
{
|
||||
$entityManager = $container->get('entityManager');
|
||||
|
||||
$entity = $entityManager->getEntity($scope, $id);
|
||||
if (!$entity) return;
|
||||
|
||||
$aclManager = $container->get('aclManager');
|
||||
|
||||
if ($aclManager->check($user, $entity, $action)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
56
application/Espo/Core/Console/Commands/AuthTokenCheck.php
Normal file
56
application/Espo/Core/Console/Commands/AuthTokenCheck.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class AuthTokenCheck extends Base
|
||||
{
|
||||
public function run($options, $flagList, $argumentList)
|
||||
{
|
||||
$token = $argumentList[0] ?? null;
|
||||
if (empty($token)) return;
|
||||
|
||||
$entityManager = $this->getContainer()->get('entityManager');
|
||||
|
||||
$authToken = $entityManager->getRepository('AuthToken')->where([
|
||||
'token' => $token,
|
||||
'isActive' => true,
|
||||
])->findOne();
|
||||
|
||||
if (!$authToken) return;
|
||||
if (!$authToken->get('userId')) return;
|
||||
|
||||
$userId = $authToken->get('userId');
|
||||
|
||||
$user = $entityManager->getEntity('User', $userId);
|
||||
if (!$user) return;
|
||||
|
||||
return $user->id;
|
||||
}
|
||||
}
|
||||
45
application/Espo/Core/Console/Commands/Base.php
Normal file
45
application/Espo/Core/Console/Commands/Base.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
abstract class Base
|
||||
{
|
||||
private $container;
|
||||
|
||||
public function __construct(\Espo\Core\Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
protected function getContainer()
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
}
|
||||
39
application/Espo/Core/Console/Commands/ClearCache.php
Normal file
39
application/Espo/Core/Console/Commands/ClearCache.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class ClearCache extends Base
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
echo "Cache has been cleared.\n";
|
||||
}
|
||||
}
|
||||
39
application/Espo/Core/Console/Commands/Rebuild.php
Normal file
39
application/Espo/Core/Console/Commands/Rebuild.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class Rebuild extends Base
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$this->getContainer()->get('dataManager')->rebuild();
|
||||
echo "Rebuild has been done.\n";
|
||||
}
|
||||
}
|
||||
68
application/Espo/Core/Console/Commands/RunJob.php
Normal file
68
application/Espo/Core/Console/Commands/RunJob.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class RunJob extends Base
|
||||
{
|
||||
public function run($options, $flags, $argumentList)
|
||||
{
|
||||
$jobName = $options['job'] ?? null;
|
||||
$targetId = $options['targetId'] ?? null;
|
||||
$targetType = $options['targetType'] ?? null;
|
||||
|
||||
if (!$jobName && count($argumentList)) {
|
||||
$jobName = $argumentList[0];
|
||||
}
|
||||
|
||||
if (!$jobName) echo "No job specified.\n";
|
||||
|
||||
$jobName = ucfirst(\Espo\Core\Utils\Util::hyphenToCamelCase($jobName));
|
||||
|
||||
$container = $this->getContainer();
|
||||
$entityManager = $container->get('entityManager');
|
||||
|
||||
$job = $entityManager->createEntity('Job', [
|
||||
'name' => $jobName,
|
||||
'job' => $jobName,
|
||||
'targetType' => $targetType,
|
||||
'targetId' => $targetId,
|
||||
]);
|
||||
|
||||
$cronManager = new \Espo\Core\CronManager($container);
|
||||
|
||||
$result = $cronManager->runJob($job);
|
||||
|
||||
if ($result) {
|
||||
echo "Job '{$jobName}' has been executed.\n";
|
||||
} else {
|
||||
echo "Job '{$jobName}' failed to execute.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
186
application/Espo/Core/Console/Commands/Upgrade.php
Normal file
186
application/Espo/Core/Console/Commands/Upgrade.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM 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.
|
||||
*
|
||||
* EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class Upgrade extends Base
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$infoData = $this->getVersionInfo();
|
||||
if (!$infoData) return;
|
||||
|
||||
$nextVersion = $infoData->nextVersion ?? null;
|
||||
$lastVersion = $infoData->lastVersion ?? null;
|
||||
|
||||
$fromVersion = $this->getConfig()->get('version');
|
||||
|
||||
fwrite(\STDOUT, "Current version is {$fromVersion}.\n");
|
||||
|
||||
if (!$nextVersion) {
|
||||
echo "There are no available upgrades.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(\STDOUT, "EspoCRM will be upgraded to version {$nextVersion} now. Enter [Y] to continue.\n");
|
||||
|
||||
if (!$this->confirm()) {
|
||||
echo "Upgrade canceled.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(\STDOUT, "Downloading...");
|
||||
|
||||
$upgradePackageFilePath = $this->downloadFile($infoData->nextPackage);
|
||||
if (!$upgradePackageFilePath) return;
|
||||
|
||||
fwrite(\STDOUT, "\n");
|
||||
|
||||
fwrite(\STDOUT, "Upgrading... This may take a while...");
|
||||
|
||||
$this->upgrade($upgradePackageFilePath);
|
||||
|
||||
fwrite(\STDOUT, "\n");
|
||||
|
||||
fwrite(\STDOUT, $resultText);
|
||||
|
||||
$this->getFileManager()->unlink($upgradePackageFilePath);
|
||||
|
||||
$app = new \Espo\Core\Application();
|
||||
$currentVerison = $app->getContainer()->get('config')->get('version');
|
||||
|
||||
fwrite(\STDOUT, "Upgrade is complete. Current version is {$currentVerison}.\n");
|
||||
|
||||
if ($lastVersion && $lastVersion !== $currentVerison && $fromVersion !== $currentVerison) {
|
||||
fwrite(\STDOUT, "Newer version is available. Run command again to upgrade.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($lastVersion && $lastVersion === $currentVerison) {
|
||||
fwrite(\STDOUT, "You have the latest version.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected function upgrade($filePath)
|
||||
{
|
||||
$app = new \Espo\Core\Application();
|
||||
$app->setupSystemUser();
|
||||
|
||||
$upgradeManager = new \Espo\Core\UpgradeManager($app->getContainer());
|
||||
|
||||
try {
|
||||
$fileData = file_get_contents($filePath);
|
||||
$fileData = 'data:application/zip;base64,' . base64_encode($fileData);
|
||||
|
||||
$upgradeId = $upgradeManager->upload($fileData);
|
||||
$upgradeManager->install(['id' => $upgradeId]);
|
||||
} catch (\Exception $e) {
|
||||
die("Error: " . $e->getMessage() . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
protected function confirm()
|
||||
{
|
||||
$fh = fopen('php://stdin', 'r');
|
||||
$inputLine = trim(fgets($fh));
|
||||
fclose($fh);
|
||||
if (strtolower($inputLine) !== 'y'){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getConfig()
|
||||
{
|
||||
return $this->getContainer()->get('config');
|
||||
}
|
||||
|
||||
protected function getFileManager()
|
||||
{
|
||||
return $this->getContainer()->get('fileManager');
|
||||
}
|
||||
|
||||
protected function getVersionInfo()
|
||||
{
|
||||
$url = 'https://s.espocrm.com/upgrade/next/';
|
||||
$url = $this->getConfig()->get('upgradeNextVersionUrl', $url);
|
||||
$url .= '?fromVersion=' . $this->getConfig()->get('version');
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, \CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, \CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, \CURLOPT_URL, $url);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
try {
|
||||
$data = json_decode($result);
|
||||
} catch (\Exception $e) {
|
||||
echo "Could not parse info about next version.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$data) {
|
||||
echo "Could not get info about next version.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function downloadFile($url)
|
||||
{
|
||||
$localFilePath = 'data/upload/upgrades/' . \Espo\Core\Utils\Util::generateId() . '.zip';
|
||||
$this->getFileManager()->putContents($localFilePath, '');
|
||||
|
||||
if (is_file($url)) {
|
||||
copy($url, $localFilePath);
|
||||
} else {
|
||||
$options = [
|
||||
CURLOPT_FILE => fopen($localFilePath, 'w'),
|
||||
CURLOPT_TIMEOUT => 3600,
|
||||
CURLOPT_URL => $url
|
||||
];
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, $options);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
if (!$this->getFileManager()->isFile($localFilePath)) {
|
||||
echo "\nCould not download upgrade file.\n";
|
||||
$this->getFileManager()->unlink($localFilePath);
|
||||
return;
|
||||
}
|
||||
|
||||
return realpath($localFilePath);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,17 +32,13 @@ namespace Espo\Core;
|
||||
class Container
|
||||
{
|
||||
|
||||
private $data = array();
|
||||
private $data = [];
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function get($name)
|
||||
public function get(string $name)
|
||||
{
|
||||
if (empty($this->data[$name])) {
|
||||
$this->load($name);
|
||||
@@ -67,7 +63,7 @@ class Container
|
||||
} else {
|
||||
|
||||
try {
|
||||
$className = $this->get('metadata')->get('app.loaders.' . ucfirst($name));
|
||||
$className = $this->get('metadata')->get(['app', 'loaders', ucfirst($name)]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
if (!isset($className) || !class_exists($className)) {
|
||||
@@ -86,10 +82,10 @@ class Container
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function getServiceClassName($name, $default)
|
||||
public function getServiceClassName(string $name, string $default)
|
||||
{
|
||||
$metadata = $this->get('metadata');
|
||||
$className = $metadata->get('app.serviceContainer.classNames.' . $name, $default);
|
||||
$className = $metadata->get(['app', 'serviceContainer', 'classNames', $name], $default);
|
||||
return $className;
|
||||
}
|
||||
|
||||
@@ -119,7 +115,7 @@ class Container
|
||||
$rotation = $config->get('logger.rotation', true);
|
||||
|
||||
$log = new \Espo\Core\Utils\Log('Espo');
|
||||
$levelCode = $log->getLevelCode($config->get('logger.level', 'WARNING'));
|
||||
$levelCode = $log::toMonologLevel($config->get('logger.level', 'WARNING'));
|
||||
|
||||
if ($rotation) {
|
||||
$maxFileNumber = $config->get('logger.maxFileNumber', 30);
|
||||
@@ -131,7 +127,7 @@ class Container
|
||||
|
||||
$errorHandler = new \Monolog\ErrorHandler($log);
|
||||
$errorHandler->registerExceptionHandler(null, false);
|
||||
$errorHandler->registerErrorHandler(array(), false);
|
||||
$errorHandler->registerErrorHandler([], false);
|
||||
|
||||
return $log;
|
||||
}
|
||||
@@ -176,15 +172,6 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadMailSender()
|
||||
{
|
||||
$className = $this->getServiceClassName('mailSender', '\\Espo\\Core\\Mail\\Sender');
|
||||
return new $className(
|
||||
$this->get('config'),
|
||||
$this->get('entityManager')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadDateTime()
|
||||
{
|
||||
return new \Espo\Core\Utils\DateTime(
|
||||
@@ -209,16 +196,10 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadSelectManagerFactory()
|
||||
protected function loadNotificatorFactory()
|
||||
{
|
||||
return new \Espo\Core\SelectManagerFactory(
|
||||
$this->get('entityManager'),
|
||||
$this->get('user'),
|
||||
$this->get('acl'),
|
||||
$this->get('aclManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('config'),
|
||||
$this->get('injectableFactory')
|
||||
return new \Espo\Core\NotificatorFactory(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
@@ -367,14 +348,6 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadClientManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\ClientManager(
|
||||
$this->get('config'),
|
||||
$this->get('themeManager')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadInjectableFactory()
|
||||
{
|
||||
return new \Espo\Core\InjectableFactory(
|
||||
@@ -387,4 +360,3 @@ class Container
|
||||
$this->set('user', $user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,12 +40,16 @@ class ControllerManager
|
||||
|
||||
private $container;
|
||||
|
||||
private $controllersHash = null;
|
||||
|
||||
public function __construct(\Espo\Core\Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
|
||||
$this->config = $this->container->get('config');
|
||||
$this->metadata = $this->container->get('metadata');
|
||||
|
||||
$this->controllersHash = (object) [];
|
||||
}
|
||||
|
||||
protected function getConfig()
|
||||
@@ -58,7 +62,7 @@ class ControllerManager
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
public function process($controllerName, $actionName, $params, $data, $request)
|
||||
protected function getControllerClassName($controllerName)
|
||||
{
|
||||
$customClassName = '\\Espo\\Custom\\Controllers\\' . Util::normilizeClassName($controllerName);
|
||||
if (class_exists($customClassName)) {
|
||||
@@ -72,27 +76,48 @@ class ControllerManager
|
||||
}
|
||||
}
|
||||
|
||||
if ($data && stristr($request->getContentType(), 'application/json')) {
|
||||
$data = json_decode($data);
|
||||
}
|
||||
|
||||
if (!class_exists($controllerClassName)) {
|
||||
throw new NotFound("Controller '$controllerName' is not found");
|
||||
}
|
||||
|
||||
$controller = new $controllerClassName($this->container, $request->getMethod());
|
||||
return $controllerClassName;
|
||||
}
|
||||
|
||||
public function createController($name)
|
||||
{
|
||||
$controllerClassName = $this->getControllerClassName($name);
|
||||
$controller = new $controllerClassName($this->container);
|
||||
|
||||
return $controller;
|
||||
}
|
||||
|
||||
public function getController($name)
|
||||
{
|
||||
if (!property_exists($this->controllersHash, $name)) {
|
||||
$this->controllersHash->$name = $this->createController($name);
|
||||
}
|
||||
return $this->controllersHash->$name;
|
||||
}
|
||||
|
||||
public function processRequest(\Espo\Core\Controllers\Base $controller, $actionName, $params, $data, $request, $response = null)
|
||||
{
|
||||
if ($data && stristr($request->getContentType(), 'application/json')) {
|
||||
$data = json_decode($data);
|
||||
}
|
||||
|
||||
if ($actionName == 'index') {
|
||||
$actionName = $controllerClassName::$defaultAction;
|
||||
$actionName = $controller::$defaultAction;
|
||||
}
|
||||
|
||||
$requestMethod = $request->getMethod();
|
||||
|
||||
$actionNameUcfirst = ucfirst($actionName);
|
||||
|
||||
$beforeMethodName = 'before' . $actionNameUcfirst;
|
||||
$actionMethodName = 'action' . $actionNameUcfirst;
|
||||
$afterMethodName = 'after' . $actionNameUcfirst;
|
||||
|
||||
$fullActionMethodName = strtolower($request->getMethod()) . ucfirst($actionMethodName);
|
||||
$fullActionMethodName = strtolower($requestMethod) . ucfirst($actionMethodName);
|
||||
|
||||
if (method_exists($controller, $fullActionMethodName)) {
|
||||
$primaryActionMethodName = $fullActionMethodName;
|
||||
@@ -101,24 +126,24 @@ class ControllerManager
|
||||
}
|
||||
|
||||
if (!method_exists($controller, $primaryActionMethodName)) {
|
||||
throw new NotFound("Action '$actionName' (".$request->getMethod().") does not exist in controller '$controllerName'");
|
||||
throw new NotFound("Action {$requestMethod} '{$actionName}' does not exist in controller '".$controller->getName()."'.");
|
||||
}
|
||||
|
||||
// TODO Remove in 5.1.0
|
||||
if ($data instanceof \stdClass) {
|
||||
if ($this->getMetadata()->get(['app', 'deprecatedControllerActions', $controllerName, $primaryActionMethodName])) {
|
||||
if ($this->getMetadata()->get(['app', 'deprecatedControllerActions', $controller->getName(), $primaryActionMethodName])) {
|
||||
$data = get_object_vars($data);
|
||||
}
|
||||
}
|
||||
|
||||
if (method_exists($controller, $beforeMethodName)) {
|
||||
$controller->$beforeMethodName($params, $data, $request);
|
||||
$controller->$beforeMethodName($params, $data, $request, $response);
|
||||
}
|
||||
|
||||
$result = $controller->$primaryActionMethodName($params, $data, $request);
|
||||
$result = $controller->$primaryActionMethodName($params, $data, $request, $response);
|
||||
|
||||
if (method_exists($controller, $afterMethodName)) {
|
||||
$controller->$afterMethodName($params, $data, $request);
|
||||
$controller->$afterMethodName($params, $data, $request, $response);
|
||||
}
|
||||
|
||||
if (is_array($result) || is_bool($result) || $result instanceof \StdClass) {
|
||||
@@ -127,4 +152,10 @@ class ControllerManager
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function process($controllerName, $actionName, $params, $data, $request, $response = null)
|
||||
{
|
||||
$controller = $this->getController($controllerName);
|
||||
return $this->processRequest($controller, $actionName, $params, $data, $request, $response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,18 +38,12 @@ abstract class Base
|
||||
|
||||
private $container;
|
||||
|
||||
private $requestMethod;
|
||||
|
||||
public static $defaultAction = 'index';
|
||||
|
||||
public function __construct(Container $container, $requestMethod = null)
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
|
||||
if (isset($requestMethod)) {
|
||||
$this->setRequestMethod($requestMethod);
|
||||
}
|
||||
|
||||
if (empty($this->name)) {
|
||||
$name = get_class($this);
|
||||
if (preg_match('@\\\\([\w]+)$@', $name, $matches)) {
|
||||
@@ -61,6 +55,11 @@ abstract class Base
|
||||
$this->checkControllerAccess();
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
return;
|
||||
@@ -71,21 +70,6 @@ abstract class Base
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get request method name (Uppercase)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getRequestMethod()
|
||||
{
|
||||
return $this->requestMethod;
|
||||
}
|
||||
|
||||
protected function setRequestMethod($requestMethod)
|
||||
{
|
||||
$this->requestMethod = strtoupper($requestMethod);
|
||||
}
|
||||
|
||||
protected function getUser()
|
||||
{
|
||||
return $this->container->get('user');
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -67,11 +67,9 @@ class Record extends Base
|
||||
public function actionRead($params, $data, $request)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$entity = $this->getRecordService()->readEntity($id);
|
||||
$entity = $this->getRecordService()->read($id);
|
||||
|
||||
if (empty($entity)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!$entity) throw new NotFound();
|
||||
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
@@ -83,6 +81,8 @@ class Record extends Base
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
if (!is_object($data)) throw new BadRequest();
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class Record extends Base
|
||||
|
||||
$service = $this->getRecordService();
|
||||
|
||||
if ($entity = $service->createEntity($data)) {
|
||||
if ($entity = $service->create($data)) {
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
@@ -102,6 +102,8 @@ class Record extends Base
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
if (!is_object($data)) throw new BadRequest();
|
||||
|
||||
if (!$request->isPut() && !$request->isPatch()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -112,7 +114,7 @@ class Record extends Base
|
||||
|
||||
$id = $params['id'];
|
||||
|
||||
if ($entity = $this->getRecordService()->updateEntity($id, $data)) {
|
||||
if ($entity = $this->getRecordService()->update($id, $data)) {
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
@@ -125,40 +127,30 @@ class Record extends Base
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$where = $request->get('where');
|
||||
$offset = $request->get('offset');
|
||||
$maxSize = $request->get('maxSize');
|
||||
$asc = $request->get('asc', 'true') === 'true';
|
||||
$sortBy = $request->get('sortBy');
|
||||
$q = $request->get('q');
|
||||
$textFilter = $request->get('textFilter');
|
||||
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($maxSize) && $maxSize > $maxSizeLimit) {
|
||||
throw new Forbidden("Max should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'where' => $where,
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'asc' => $asc,
|
||||
'sortBy' => $sortBy,
|
||||
'q' => $q,
|
||||
'textFilter' => $textFilter
|
||||
);
|
||||
|
||||
$params = [];
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$result = $this->getRecordService()->findEntities($params);
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($params['maxSize'])) {
|
||||
$params['maxSize'] = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($params['maxSize']) && $params['maxSize'] > $maxSizeLimit) {
|
||||
throw new Forbidden("Max size should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
);
|
||||
$result = $this->getRecordService()->find($params);
|
||||
|
||||
if (is_array($result)) {
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'total' => $result->total,
|
||||
'list' => isset($result->collection) ? $result->collection->getValueMapList() : $result->list
|
||||
];
|
||||
}
|
||||
|
||||
public function getActionListKanban($params, $data, $request)
|
||||
@@ -167,34 +159,17 @@ class Record extends Base
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$where = $request->get('where');
|
||||
$offset = $request->get('offset');
|
||||
$maxSize = $request->get('maxSize');
|
||||
$asc = $request->get('asc', 'true') === 'true';
|
||||
$sortBy = $request->get('sortBy');
|
||||
$q = $request->get('q');
|
||||
$textFilter = $request->get('textFilter');
|
||||
$params = [];
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = $maxSizeLimit;
|
||||
if (empty($params['maxSize'])) {
|
||||
$params['maxSize'] = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($maxSize) && $maxSize > $maxSizeLimit) {
|
||||
throw new Forbidden("Max should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
if (!empty($params['maxSize']) && $params['maxSize'] > $maxSizeLimit) {
|
||||
throw new Forbidden("Max size should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'where' => $where,
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'asc' => $asc,
|
||||
'sortBy' => $sortBy,
|
||||
'q' => $q,
|
||||
'textFilter' => $textFilter
|
||||
);
|
||||
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$result = $this->getRecordService()->getListKanban($params);
|
||||
|
||||
return (object) [
|
||||
@@ -206,19 +181,7 @@ class Record extends Base
|
||||
|
||||
protected function fetchListParamsFromRequest(&$params, $request, $data)
|
||||
{
|
||||
if ($request->get('primaryFilter')) {
|
||||
$params['primaryFilter'] = $request->get('primaryFilter');
|
||||
}
|
||||
if ($request->get('boolFilterList')) {
|
||||
$params['boolFilterList'] = $request->get('boolFilterList');
|
||||
}
|
||||
if ($request->get('filterList')) {
|
||||
$params['filterList'] = $request->get('filterList');
|
||||
}
|
||||
|
||||
if ($request->get('select')) {
|
||||
$params['select'] = explode(',', $request->get('select'));
|
||||
}
|
||||
\Espo\Core\Utils\ControllerUtil::fetchListParamsFromRequest($params, $request, $data);
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
@@ -226,40 +189,30 @@ class Record extends Base
|
||||
$id = $params['id'];
|
||||
$link = $params['link'];
|
||||
|
||||
$where = $request->get('where');
|
||||
$offset = $request->get('offset');
|
||||
$maxSize = $request->get('maxSize');
|
||||
$asc = $request->get('asc', 'true') === 'true';
|
||||
$sortBy = $request->get('sortBy');
|
||||
$q = $request->get('q');
|
||||
$textFilter = $request->get('textFilter');
|
||||
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($maxSize) && $maxSize > $maxSizeLimit) {
|
||||
throw new Forbidden("Max should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'where' => $where,
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'asc' => $asc,
|
||||
'sortBy' => $sortBy,
|
||||
'q' => $q,
|
||||
'textFilter' => $textFilter
|
||||
);
|
||||
|
||||
$params = [];
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$result = $this->getRecordService()->findLinkedEntities($id, $link, $params);
|
||||
$maxSizeLimit = $this->getConfig()->get('recordListMaxSizeLimit', self::MAX_SIZE_LIMIT);
|
||||
if (empty($params['maxSize'])) {
|
||||
$params['maxSize'] = $maxSizeLimit;
|
||||
}
|
||||
if (!empty($params['maxSize']) && $params['maxSize'] > $maxSizeLimit) {
|
||||
throw new Forbidden("Max size should should not exceed " . $maxSizeLimit . ". Use offset and limit.");
|
||||
}
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
);
|
||||
$result = $this->getRecordService()->findLinked($id, $link, $params);
|
||||
|
||||
if (is_array($result)) {
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
];
|
||||
}
|
||||
|
||||
return (object) [
|
||||
'total' => $result->total,
|
||||
'list' => isset($result->collection) ? $result->collection->getValueMapList() : $result->list
|
||||
];
|
||||
}
|
||||
|
||||
public function actionDelete($params, $data, $request)
|
||||
@@ -270,7 +223,7 @@ class Record extends Base
|
||||
|
||||
$id = $params['id'];
|
||||
|
||||
if ($this->getRecordService()->deleteEntity($id)) {
|
||||
if ($this->getRecordService()->delete($id)) {
|
||||
return true;
|
||||
}
|
||||
throw new Error();
|
||||
@@ -278,6 +231,8 @@ class Record extends Base
|
||||
|
||||
public function actionExport($params, $data, $request)
|
||||
{
|
||||
if (!is_object($data)) throw new BadRequest();
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -319,9 +274,9 @@ class Record extends Base
|
||||
$params['format'] = $data->format;
|
||||
}
|
||||
|
||||
return array(
|
||||
return [
|
||||
'id' => $this->getRecordService()->export($params)
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
@@ -337,6 +292,10 @@ class Record extends Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if ($this->getAcl()->get('massUpdatePermission') !== 'yes') {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
if (property_exists($data, 'where') && !empty($data->byWhere)) {
|
||||
$params['where'] = json_decode(json_encode($data->where), true);
|
||||
@@ -349,33 +308,26 @@ class Record extends Base
|
||||
|
||||
$attributes = $data->attributes;
|
||||
|
||||
$idsUpdated = $this->getRecordService()->massUpdate($attributes, $params);
|
||||
$idsUpdated = $this->getRecordService()->massUpdate($params, $attributes);
|
||||
|
||||
return $idsUpdated;
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
public function postActionMassDelete($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!$this->getAcl()->check($this->name, 'delete')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
if (property_exists($data, 'where') && !empty($data->byWhere)) {
|
||||
$where = json_decode(json_encode($data->where), true);
|
||||
$params['where'] = $where;
|
||||
if (property_exists($data, 'selectData')) {
|
||||
$params['selectData'] = json_decode(json_encode($data->selectData), true);
|
||||
$actionParams = $this->getMassActionParamsFromData($data);
|
||||
|
||||
if (array_key_exists('where', $actionParams)) {
|
||||
if ($this->getAcl()->get('massUpdatePermission') !== 'yes') {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massRemove($params);
|
||||
return $this->getRecordService()->massDelete($actionParams);
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
@@ -402,7 +354,7 @@ class Record extends Base
|
||||
$selectData = json_decode(json_encode($data->selectData), true);
|
||||
}
|
||||
|
||||
return $this->getRecordService()->linkEntityMass($id, $link, $where, $selectData);
|
||||
return $this->getRecordService()->massLink($id, $link, $where, $selectData);
|
||||
} else {
|
||||
$foreignIdList = array();
|
||||
if (isset($data->id)) {
|
||||
@@ -416,7 +368,7 @@ class Record extends Base
|
||||
|
||||
$result = false;
|
||||
foreach ($foreignIdList as $foreignId) {
|
||||
if ($this->getRecordService()->linkEntity($id, $link, $foreignId)) {
|
||||
if ($this->getRecordService()->link($id, $link, $foreignId)) {
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
@@ -453,7 +405,7 @@ class Record extends Base
|
||||
|
||||
$result = false;
|
||||
foreach ($foreignIdList as $foreignId) {
|
||||
if ($this->getRecordService()->unlinkEntity($id, $link, $foreignId)) {
|
||||
if ($this->getRecordService()->unlink($id, $link, $foreignId)) {
|
||||
$result = $result || true;
|
||||
}
|
||||
}
|
||||
@@ -549,4 +501,39 @@ class Record extends Base
|
||||
|
||||
return $this->getRecordService()->massUnfollow($params);
|
||||
}
|
||||
|
||||
protected function getMassActionParamsFromData($data)
|
||||
{
|
||||
$params = [];
|
||||
if (property_exists($data, 'where') && !empty($data->byWhere)) {
|
||||
$where = json_decode(json_encode($data->where), true);
|
||||
$params['where'] = $where;
|
||||
if (property_exists($data, 'selectData')) {
|
||||
$params['selectData'] = json_decode(json_encode($data->selectData), true);
|
||||
}
|
||||
}
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public function postActionMassRecalculateFormula($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
if (!$this->getAcl()->check($this->name, 'edit')) throw new Forbidden();
|
||||
|
||||
return $this->getRecordService()->massRecalculateFormula($this->getMassActionParamsFromData($data));
|
||||
}
|
||||
|
||||
public function postActionRestoreDeleted($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
|
||||
$id = $data->id ?? null;
|
||||
if (!$id) throw new Forbidden();
|
||||
|
||||
return $this->getRecordService()->restoreDeleted($id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,9 +28,12 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
use \PDO;
|
||||
use Espo\Core\Utils\Json;
|
||||
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class CronManager
|
||||
{
|
||||
@@ -48,8 +51,21 @@ class CronManager
|
||||
|
||||
private $cronScheduledJobUtil;
|
||||
|
||||
private $useProcessPool = false;
|
||||
|
||||
private $asSoonAsPossibleSchedulingList = [
|
||||
'*',
|
||||
'* *',
|
||||
'* * *',
|
||||
'* * * *',
|
||||
'* * * * *',
|
||||
'* * * * * *',
|
||||
];
|
||||
|
||||
const PENDING = 'Pending';
|
||||
|
||||
const READY = 'Ready';
|
||||
|
||||
const RUNNING = 'Running';
|
||||
|
||||
const SUCCESS = 'Success';
|
||||
@@ -70,6 +86,14 @@ class CronManager
|
||||
$this->scheduledJobUtil = $this->container->get('scheduledJob');
|
||||
$this->cronJobUtil = new \Espo\Core\Utils\Cron\Job($this->config, $this->entityManager);
|
||||
$this->cronScheduledJobUtil = new \Espo\Core\Utils\Cron\ScheduledJob($this->config, $this->entityManager);
|
||||
|
||||
if ($this->getConfig()->get('jobRunInParallel')) {
|
||||
if (\Spatie\Async\Pool::isSupported()) {
|
||||
$this->useProcessPool = true;
|
||||
} else {
|
||||
$GLOBALS['log']->warning("CronManager: useProcessPool requires pcntl and posix extensions.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getContainer()
|
||||
@@ -146,10 +170,18 @@ class CronManager
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function useProcessPool()
|
||||
{
|
||||
return $this->useProcessPool;
|
||||
}
|
||||
|
||||
public function setUseProcessPool($useProcessPool)
|
||||
{
|
||||
$this->useProcessPool = $useProcessPool;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run Cron
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
@@ -160,17 +192,39 @@ class CronManager
|
||||
|
||||
$this->setLastRunTime(time());
|
||||
|
||||
$this->getCronJobUtil()->markFailedJobs();
|
||||
$this->getCronJobUtil()->markJobsFailed();
|
||||
$this->getCronJobUtil()->updateFailedJobAttempts();
|
||||
$this->createJobsFromScheduledJobs();
|
||||
$this->getCronJobUtil()->removePendingJobDuplicates();
|
||||
|
||||
$pendingJobList = $this->getCronJobUtil()->getPendingJobList();
|
||||
$this->processPendingJobs();
|
||||
}
|
||||
|
||||
public function processPendingJobs($queue = null, $limit = null, $poolDisabled = false, $noLock = false)
|
||||
{
|
||||
if (is_null($limit)) {
|
||||
$limit = intval($this->getConfig()->get('jobMaxPortion', 0));
|
||||
}
|
||||
|
||||
$pendingJobList = $this->getCronJobUtil()->getPendingJobList($queue, $limit);
|
||||
|
||||
$useProcessPool = $this->useProcessPool();
|
||||
|
||||
if ($poolDisabled) {
|
||||
$useProcessPool = false;
|
||||
}
|
||||
|
||||
if ($useProcessPool) {
|
||||
$pool = \Spatie\Async\Pool::create()
|
||||
->autoload(getcwd() . '/vendor/autoload.php')
|
||||
->concurrency($this->getConfig()->get('jobPoolConcurrencyNumber'))
|
||||
->timeout($this->getConfig()->get('jobPeriodForActiveProcess'));
|
||||
}
|
||||
|
||||
foreach ($pendingJobList as $job) {
|
||||
$skip = false;
|
||||
$this->getEntityManager()->getPdo()->query('LOCK TABLES `job` WRITE');
|
||||
if ($this->getCronJobUtil()->isJobPending($job->id)) {
|
||||
if (!$noLock) $this->lockJobTable();
|
||||
if ($noLock || $this->getCronJobUtil()->isJobPending($job->id)) {
|
||||
if ($job->get('scheduledJobId')) {
|
||||
if ($this->getCronJobUtil()->isScheduledJobRunning($job->get('scheduledJobId'), $job->get('targetId'), $job->get('targetType'))) {
|
||||
$skip = true;
|
||||
@@ -181,43 +235,107 @@ class CronManager
|
||||
}
|
||||
|
||||
if ($skip) {
|
||||
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
|
||||
if (!$noLock) $this->unlockTables();
|
||||
continue;
|
||||
}
|
||||
|
||||
$job->set('status', self::RUNNING);
|
||||
$job->set('pid', $this->getCronJobUtil()->getPid());
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
|
||||
$job->set('startedAt', date('Y-m-d H:i:s'));
|
||||
|
||||
$isSuccess = true;
|
||||
$skipLog = false;
|
||||
|
||||
try {
|
||||
if ($job->get('scheduledJobId')) {
|
||||
$this->runScheduledJob($job);
|
||||
} else {
|
||||
$this->runService($job);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isSuccess = false;
|
||||
if ($e->getCode() === -1) {
|
||||
$job->set('attempts', 0);
|
||||
$skipLog = true;
|
||||
} else {
|
||||
$GLOBALS['log']->error('CronManager: Failed job running, job ['.$job->id.']. Error Details: '.$e->getMessage());
|
||||
}
|
||||
if ($useProcessPool) {
|
||||
$job->set('status', self::READY);
|
||||
} else {
|
||||
$job->set('status', self::RUNNING);
|
||||
$job->set('pid', \Espo\Core\Utils\System::getPid());
|
||||
}
|
||||
|
||||
$status = $isSuccess ? self::SUCCESS : self::FAILED;
|
||||
|
||||
$job->set('status', $status);
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
if (!$noLock) $this->unlockTables();
|
||||
|
||||
if ($job->get('scheduledJobId') && !$skipLog) {
|
||||
$this->getCronScheduledJobUtil()->addLogRecord($job->get('scheduledJobId'), $status, null, $job->get('targetId'), $job->get('targetType'));
|
||||
if ($useProcessPool) {
|
||||
$task = new \Espo\Core\Utils\Cron\JobTask($job->id);
|
||||
$pool->add($task);
|
||||
} else {
|
||||
$this->runJob($job);
|
||||
}
|
||||
}
|
||||
|
||||
if ($useProcessPool) {
|
||||
$pool->wait();
|
||||
}
|
||||
}
|
||||
|
||||
protected function lockJobTable()
|
||||
{
|
||||
$this->getEntityManager()->getPdo()->query('LOCK TABLES `job` WRITE');
|
||||
}
|
||||
|
||||
protected function unlockTables()
|
||||
{
|
||||
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
|
||||
}
|
||||
|
||||
public function runJobById($id)
|
||||
{
|
||||
if (empty($id)) throw new Error();
|
||||
|
||||
$job = $this->getEntityManager()->getEntity('Job', $id);
|
||||
|
||||
if (!$job) throw new Error("Job {$id} not found.");
|
||||
|
||||
if ($job->get('status') !== self::READY) {
|
||||
throw new Error("Can't run job {$id} with no status Ready.");
|
||||
}
|
||||
|
||||
if (!$job->get('startedAt')) {
|
||||
$job->set('startedAt', date('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
$job->set('status', self::RUNNING);
|
||||
$job->set('pid', \Espo\Core\Utils\System::getPid());
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
|
||||
$this->runJob($job);
|
||||
}
|
||||
|
||||
public function runJob(\Espo\Entities\Job $job)
|
||||
{
|
||||
$isSuccess = true;
|
||||
$skipLog = false;
|
||||
|
||||
try {
|
||||
if ($job->get('scheduledJobId')) {
|
||||
$this->runScheduledJob($job);
|
||||
} else if ($job->get('job')) {
|
||||
$this->runJobByName($job);
|
||||
} else {
|
||||
$this->runService($job);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$isSuccess = false;
|
||||
if ($e->getCode() === -1) {
|
||||
$job->set('attempts', 0);
|
||||
$skipLog = true;
|
||||
} else {
|
||||
$GLOBALS['log']->error('CronManager: Failed job running, job ['.$job->id.']. Error Details: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$status = $isSuccess ? self::SUCCESS : self::FAILED;
|
||||
|
||||
$job->set('status', $status);
|
||||
|
||||
if ($isSuccess) {
|
||||
$job->set('executedAt', date('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
|
||||
if ($job->get('scheduledJobId') && !$skipLog) {
|
||||
$this->getCronScheduledJobUtil()->addLogRecord($job->get('scheduledJobId'), $status, null, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
if ($isSuccess) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function runScheduledJob($job)
|
||||
@@ -225,18 +343,14 @@ class CronManager
|
||||
$jobName = $job->get('scheduledJobJob');
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($jobName);
|
||||
if ($className === false) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
if ($className === false) throw new Error("No class name for job {$jobName}.");
|
||||
|
||||
$jobClass = new $className($this->container);
|
||||
$method = 'run';
|
||||
if (!method_exists($jobClass, $method)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!method_exists($jobClass, $method)) throw new Error();
|
||||
|
||||
$data = null;
|
||||
|
||||
if ($job->get('data')) {
|
||||
$data = $job->get('data');
|
||||
}
|
||||
@@ -244,80 +358,78 @@ class CronManager
|
||||
$jobClass->$method($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Run Service
|
||||
*
|
||||
* @param array $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function runService($job)
|
||||
{
|
||||
$serviceName = $job->get('serviceName');
|
||||
|
||||
if (!$serviceName) {
|
||||
throw new Error('Job with empty serviceName.');
|
||||
throw new Error("Job with empty serviceName.");
|
||||
}
|
||||
|
||||
if (!$this->getServiceFactory()->checkExists($serviceName)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!$this->getServiceFactory()->checkExists($serviceName)) throw new Error();
|
||||
|
||||
$service = $this->getServiceFactory()->create($serviceName);
|
||||
|
||||
$methodNameDeprecated = $job->get('method');
|
||||
$methodName = $job->get('methodName');
|
||||
|
||||
$isDeprecated = false;
|
||||
if (!$methodName) {
|
||||
$isDeprecated = true;
|
||||
$methodName = $methodNameDeprecated;
|
||||
}
|
||||
if (!$methodName) throw new Error('Job with empty methodName.');
|
||||
|
||||
if (!$methodName) {
|
||||
throw new Error('Job with empty methodName.');
|
||||
}
|
||||
|
||||
if (!method_exists($service, $methodName)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!method_exists($service, $methodName)) throw new Error();
|
||||
|
||||
$data = $job->get('data');
|
||||
|
||||
if ($isDeprecated) {
|
||||
$data = Json::decode(Json::encode($data), true);
|
||||
}
|
||||
|
||||
$service->$methodName($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
protected function runJobByName($job)
|
||||
{
|
||||
$jobName = $job->get('job');
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($jobName);
|
||||
|
||||
if ($className === false) throw new Error("No class name for job {$jobName}.");
|
||||
|
||||
$jobClass = new $className($this->container);
|
||||
$method = 'run';
|
||||
if (!method_exists($jobClass, $method)) throw new Error();
|
||||
|
||||
$data = $job->get('data') ?: null;
|
||||
|
||||
$jobClass->$method($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
protected function createJobsFromScheduledJobs()
|
||||
{
|
||||
$activeScheduledJobList = $this->getCronScheduledJobUtil()->getActiveScheduledJobList();
|
||||
|
||||
$runningScheduledJobIdList = $this->getCronJobUtil()->getRunningScheduledJobIdList();
|
||||
|
||||
$createdJobIdList = array();
|
||||
$createdJobIdList = [];
|
||||
foreach ($activeScheduledJobList as $scheduledJob) {
|
||||
$scheduling = $scheduledJob->get('scheduling');
|
||||
$asSoonAsPossible = in_array($scheduling, $this->asSoonAsPossibleSchedulingList);
|
||||
|
||||
try {
|
||||
$cronExpression = \Cron\CronExpression::factory($scheduling);
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Scheduling string error - '. $e->getMessage() . '.');
|
||||
continue;
|
||||
if ($asSoonAsPossible) {
|
||||
$nextDate = date('Y-m-d H:i:s');
|
||||
} else {
|
||||
try {
|
||||
$cronExpression = \Cron\CronExpression::factory($scheduling);
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Scheduling string error - '. $e->getMessage() . '.');
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$nextDate = $cronExpression->getNextRunDate()->format('Y-m-d H:i:s');
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Unsupported CRON expression ['.$scheduling.']');
|
||||
continue;
|
||||
}
|
||||
|
||||
$existingJob = $this->getCronJobUtil()->getJobByScheduledJobIdOnMinute($scheduledJob->id, $nextDate);
|
||||
if ($existingJob) continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$nextDate = $cronExpression->getNextRunDate()->format('Y-m-d H:i:s');
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Unsupported CRON expression ['.$scheduling.']');
|
||||
continue;
|
||||
}
|
||||
|
||||
$existingJob = $this->getCronJobUtil()->getJobByScheduledJob($scheduledJob->id, $nextDate);
|
||||
if ($existingJob) continue;
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($scheduledJob->get('job'));
|
||||
if ($className) {
|
||||
if (method_exists($className, 'prepare')) {
|
||||
@@ -331,13 +443,25 @@ class CronManager
|
||||
continue;
|
||||
}
|
||||
|
||||
$pendingCount = $this->getCronJobUtil()->getPendingCountByScheduledJobId($scheduledJob->id);
|
||||
|
||||
if ($asSoonAsPossible) {
|
||||
if ($pendingCount > 0) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if ($pendingCount > 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$jobEntity = $this->getEntityManager()->getEntity('Job');
|
||||
$jobEntity->set(array(
|
||||
$jobEntity->set([
|
||||
'name' => $scheduledJob->get('name'),
|
||||
'status' => self::PENDING,
|
||||
'scheduledJobId' => $scheduledJob->id,
|
||||
'executeTime' => $nextDate
|
||||
));
|
||||
]);
|
||||
$this->getEntityManager()->saveEntity($jobEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -119,6 +119,7 @@ class DataManager
|
||||
$metadata->init(true);
|
||||
|
||||
$ormData = $this->getContainer()->get('ormMetadata')->getData(true);
|
||||
$this->getContainer()->get('entityManager')->setMetadata($ormData);
|
||||
|
||||
$this->updateCacheTimestamp();
|
||||
|
||||
@@ -130,18 +131,21 @@ class DataManager
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
$entityManager = $this->getContainer()->get('entityManager');
|
||||
|
||||
$jobs = $metadata->get(['entityDefs', 'ScheduledJob', 'jobs'], array());
|
||||
$jobs = $metadata->get(['entityDefs', 'ScheduledJob', 'jobs'], []);
|
||||
|
||||
$systemJobNameList = [];
|
||||
|
||||
foreach ($jobs as $jobName => $defs) {
|
||||
if ($jobName && !empty($defs['isSystem']) && !empty($defs['scheduling'])) {
|
||||
$systemJobNameList[] = $jobName;
|
||||
if (!$entityManager->getRepository('ScheduledJob')->where(array(
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling']
|
||||
))->findOne()) {
|
||||
$job = $entityManager->getRepository('ScheduledJob')->where(array(
|
||||
$job = $entityManager->getRepository('ScheduledJob')->where([
|
||||
'job' => $jobName
|
||||
))->findOne();
|
||||
])->findOne();
|
||||
if ($job) {
|
||||
$entityManager->removeEntity($job);
|
||||
}
|
||||
@@ -150,28 +154,34 @@ class DataManager
|
||||
$name = $defs['name'];
|
||||
}
|
||||
$job = $entityManager->getEntity('ScheduledJob');
|
||||
$job->set(array(
|
||||
$job->set([
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling'],
|
||||
'isInternal' => true,
|
||||
'name' => $name
|
||||
));
|
||||
]);
|
||||
$entityManager->saveEntity($job);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$internalScheduledJobList = $entityManager->getRepository('ScheduledJob')->where([
|
||||
'isInternal' => true
|
||||
])->find();
|
||||
foreach ($internalScheduledJobList as $scheduledJob) {
|
||||
$jobName = $scheduledJob->get('job');
|
||||
if (!in_array($jobName, $systemJobNameList)) {
|
||||
$entityManager->getRepository('ScheduledJob')->deleteFromDb($scheduledJob->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update cache timestamp
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function updateCacheTimestamp()
|
||||
{
|
||||
$this->getContainer()->get('config')->updateCacheTimestamp();
|
||||
$this->getContainer()->get('config')->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -193,6 +203,12 @@ class DataManager
|
||||
|
||||
$config->set('fullTextSearchMinLength', $fullTextSearchMinLength);
|
||||
|
||||
$cryptKey = $config->get('cryptKey');
|
||||
if (!$cryptKey) {
|
||||
$cryptKey = \Espo\Core\Utils\Util::generateKey();
|
||||
$config->set('cryptKey', $cryptKey);
|
||||
}
|
||||
|
||||
$config->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,14 +25,11 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Exceptions;
|
||||
|
||||
class BadRequest extends \Exception
|
||||
{
|
||||
protected $code = 400;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,13 +25,11 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Exceptions;
|
||||
|
||||
class Conflict extends \Exception
|
||||
{
|
||||
protected $code = 409;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,7 +25,7 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Exceptions;
|
||||
|
||||
@@ -33,5 +33,3 @@ class Error extends InternalServerError
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user