mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-06 20:57:00 +00:00
Compare commits
1037 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
896d42df43 | ||
|
|
1905be823d | ||
|
|
6347992b6e | ||
|
|
b695d7c148 | ||
|
|
9b75cdc2ac | ||
|
|
da80ed0130 | ||
|
|
e8a23de848 | ||
|
|
cb431a03df | ||
|
|
4979fb7326 | ||
|
|
aaae51bb37 | ||
|
|
4d860e3764 | ||
|
|
e73ba5c734 | ||
|
|
cca561f2c3 | ||
|
|
87c5089a8e | ||
|
|
a0819e8cdc | ||
|
|
ac505d9875 | ||
|
|
750f7ceb53 | ||
|
|
5be2a73801 | ||
|
|
5976fd5738 | ||
|
|
e6f09ed32a | ||
|
|
e2efb62a6a | ||
|
|
8ecfc75fac | ||
|
|
2c16a5bff7 | ||
|
|
47d049ab93 | ||
|
|
51ce0780fd | ||
|
|
a01e394a56 | ||
|
|
752b683494 | ||
|
|
2281d982f2 | ||
|
|
ad03cf92fc | ||
|
|
16ccf59d3f | ||
|
|
9e09f89927 | ||
|
|
53886ec684 | ||
|
|
fbc3e2cea9 | ||
|
|
2a7a4714ed | ||
|
|
19749aeca2 | ||
|
|
ee1dd28bc7 | ||
|
|
c1b0a3849d | ||
|
|
d721036226 | ||
|
|
9cce13af65 | ||
|
|
176abf90ad | ||
|
|
0bdeec10b6 | ||
|
|
29bd26a096 | ||
|
|
758e831cd5 | ||
|
|
95eea88a89 | ||
|
|
4c435b4d4b | ||
|
|
120f9fd07e | ||
|
|
7ca7a1ad18 | ||
|
|
f8dcd40905 | ||
|
|
039c67c6ca | ||
|
|
908d0ad3c4 | ||
|
|
1a70fdfd41 | ||
|
|
dc5c572a9f | ||
|
|
96be15c33b | ||
|
|
79793ebff6 | ||
|
|
d38c79c4ba | ||
|
|
ba02164d0b | ||
|
|
0cdbe89f5c | ||
|
|
46d8ec757f | ||
|
|
f4930b0a1f | ||
|
|
e03dc3b738 | ||
|
|
bfb7d88b79 | ||
|
|
2f3f2a0247 | ||
|
|
08f64eb209 | ||
|
|
15371a6a0f | ||
|
|
68ea55144d | ||
|
|
ec7e35e654 | ||
|
|
7e5a7546f2 | ||
|
|
86f67bd315 | ||
|
|
ca8cdd6008 | ||
|
|
5a60c5941a | ||
|
|
5487bd7598 | ||
|
|
ea8c4d348d | ||
|
|
a56a6b01f4 | ||
|
|
bfe91a37e8 | ||
|
|
ecd61eb4e9 | ||
|
|
ffd05882f2 | ||
|
|
f8eb7679fd | ||
|
|
68fa506f32 | ||
|
|
c1e4ca4850 | ||
|
|
31a507cd4a | ||
|
|
58a89146c9 | ||
|
|
d70461db9f | ||
|
|
bddd310ac7 | ||
|
|
f46bc47bba | ||
|
|
579e134303 | ||
|
|
b92fd15ece | ||
|
|
4ef307e8e7 | ||
|
|
58fca25b3e | ||
|
|
efaf1fab79 | ||
|
|
e6beedbffd | ||
|
|
d718151dbe | ||
|
|
cb79354078 | ||
|
|
94d2873669 | ||
|
|
46b269fa0e | ||
|
|
43a233a4ba | ||
|
|
7cc33bd684 | ||
|
|
0937c83746 | ||
|
|
0ae81328b4 | ||
|
|
68a7130e85 | ||
|
|
da41370c29 | ||
|
|
836ffff49f | ||
|
|
350819033d | ||
|
|
5c47b6c653 | ||
|
|
f37fd5e013 | ||
|
|
100b44791d | ||
|
|
cf7f8260c9 | ||
|
|
bc06e39f90 | ||
|
|
42a8f8b438 | ||
|
|
6b04536c3a | ||
|
|
4ff8514925 | ||
|
|
30b4b8d501 | ||
|
|
23d78e1e46 | ||
|
|
65ca47b878 | ||
|
|
a2ac9c2d4c | ||
|
|
87048ce9af | ||
|
|
846c8040a3 | ||
|
|
f993d676fc | ||
|
|
00d04e0157 | ||
|
|
461034f9cc | ||
|
|
16b61d9484 | ||
|
|
afbd3919b7 | ||
|
|
ec1887e726 | ||
|
|
b9fc41d5cd | ||
|
|
216e1061d2 | ||
|
|
934b7a9369 | ||
|
|
6b62841fba | ||
|
|
644f653bdd | ||
|
|
bdfe6b5e23 | ||
|
|
01e0d51c0a | ||
|
|
6acd18b4c6 | ||
|
|
9ac36cd5da | ||
|
|
cbc581ad9f | ||
|
|
9845ed2db3 | ||
|
|
87e95dc791 | ||
|
|
51ca68531a | ||
|
|
eb78b921a7 | ||
|
|
1d6bedcfad | ||
|
|
36ca2daee0 | ||
|
|
f000fb6f29 | ||
|
|
170ff67ea8 | ||
|
|
d196347b22 | ||
|
|
b2d7cfa187 | ||
|
|
2c3f6baaac | ||
|
|
0060f70586 | ||
|
|
22fd7cb6b3 | ||
|
|
9d7246832d | ||
|
|
03eb8db555 | ||
|
|
3f2364cd8d | ||
|
|
f1c0ccf97d | ||
|
|
ceddfd8486 | ||
|
|
eaed64fe6a | ||
|
|
69d88f9b76 | ||
|
|
1e51f1b97c | ||
|
|
ef7e620b8b | ||
|
|
99c2f30394 | ||
|
|
ccc231a06e | ||
|
|
b4aa1392d5 | ||
|
|
4aec7251a6 | ||
|
|
5ff9e42887 | ||
|
|
a9d4046337 | ||
|
|
b1e8266d89 | ||
|
|
1a4b891b05 | ||
|
|
0191188eba | ||
|
|
833cd4f5ee | ||
|
|
bea8f4d4bd | ||
|
|
d59874801d | ||
|
|
2ffae46291 | ||
|
|
48b79dfdb1 | ||
|
|
52bdfc128c | ||
|
|
c9adeecd1b | ||
|
|
4bfdbcc207 | ||
|
|
0a4b261529 | ||
|
|
dc6a7f241e | ||
|
|
da39015a7c | ||
|
|
8ba1907b45 | ||
|
|
eea3efeb95 | ||
|
|
991e3f8cc3 | ||
|
|
25a09f5ec3 | ||
|
|
86413517e6 | ||
|
|
747d581f9a | ||
|
|
1d4030b29e | ||
|
|
80fa7407d4 | ||
|
|
495e700373 | ||
|
|
5c583a697d | ||
|
|
24b935c789 | ||
|
|
df0da5e51b | ||
|
|
485dfd32fd | ||
|
|
51a6b304f2 | ||
|
|
93e467af79 | ||
|
|
c5eb6c560b | ||
|
|
dd1a74b4c0 | ||
|
|
5fa73b2581 | ||
|
|
f70e1bd38e | ||
|
|
5dd845327e | ||
|
|
bc84a9be51 | ||
|
|
39442377a3 | ||
|
|
b9126d2c0f | ||
|
|
1f982031ca | ||
|
|
3961dcaad4 | ||
|
|
a91c63c6a9 | ||
|
|
7f328927ba | ||
|
|
8491a54248 | ||
|
|
79bc6a9aea | ||
|
|
d899e8d3df | ||
|
|
3ef6de205f | ||
|
|
fa02291a1a | ||
|
|
5096870635 | ||
|
|
7cb086d5c9 | ||
|
|
9e9a72af91 | ||
|
|
62f2c9658a | ||
|
|
4015e2f254 | ||
|
|
aa51a58da5 | ||
|
|
a12ee989f6 | ||
|
|
ab137263dc | ||
|
|
77e02fd66f | ||
|
|
0d1466afac | ||
|
|
4f4db967f8 | ||
|
|
6beaa730ea | ||
|
|
31a84a6e53 | ||
|
|
761e7b7b72 | ||
|
|
b0547325ca | ||
|
|
914f90214a | ||
|
|
be2d936be9 | ||
|
|
1f48e3d005 | ||
|
|
50f7165963 | ||
|
|
55453b95ab | ||
|
|
27d7e6e522 | ||
|
|
abca847e5a | ||
|
|
6d28fab610 | ||
|
|
a8b315b35d | ||
|
|
206e3e787e | ||
|
|
26ab145380 | ||
|
|
5518d71bbe | ||
|
|
4fbfd1e123 | ||
|
|
099e0745f5 | ||
|
|
ef0c9e86a9 | ||
|
|
ca39deb818 | ||
|
|
0cc88a395f | ||
|
|
706cb66021 | ||
|
|
a33d49b151 | ||
|
|
71bb9d7d18 | ||
|
|
0ef26a7929 | ||
|
|
d77e56ec5d | ||
|
|
45f9e2af59 | ||
|
|
cc89b69f18 | ||
|
|
d39376398a | ||
|
|
1016b61835 | ||
|
|
5a2c027f17 | ||
|
|
c030f375bf | ||
|
|
8d7d5527a1 | ||
|
|
91915ccf44 | ||
|
|
d92bf08160 | ||
|
|
46f3846d36 | ||
|
|
841b0f4ebf | ||
|
|
5c4e4613e7 | ||
|
|
8b800d7757 | ||
|
|
670df99eda | ||
|
|
e3b42ab084 | ||
|
|
dcd0f6f56b | ||
|
|
f7cab7d42d | ||
|
|
3778e2640e | ||
|
|
b399a8dd78 | ||
|
|
6a45db8e1c | ||
|
|
6c89147b2c | ||
|
|
dff3321540 | ||
|
|
9592e68c30 | ||
|
|
5ebd680d64 | ||
|
|
603ac2b985 | ||
|
|
6efff8e9d0 | ||
|
|
a8a46976de | ||
|
|
cd3a2bbc80 | ||
|
|
bb2259232e | ||
|
|
fdc9a98c1d | ||
|
|
761df3c562 | ||
|
|
11bd9c7d8f | ||
|
|
bf24bfda43 | ||
|
|
389dda2866 | ||
|
|
86026f8f7e | ||
|
|
c0e82c6c00 | ||
|
|
57e733754a | ||
|
|
ceb67c5b95 | ||
|
|
a164c33829 | ||
|
|
120d090215 | ||
|
|
a5139255f2 | ||
|
|
f5d5c4e75e | ||
|
|
fca55da02f | ||
|
|
0a5a82fb38 | ||
|
|
b53378a1d3 | ||
|
|
ceb436971d | ||
|
|
9522446955 | ||
|
|
3eedeef605 | ||
|
|
07f49c56ff | ||
|
|
5031b17e8a | ||
|
|
42642de0e6 | ||
|
|
b4c5596b54 | ||
|
|
cbb5aaa6dd | ||
|
|
2383194f07 | ||
|
|
21cbf390fd | ||
|
|
db2c7f2c7b | ||
|
|
e7994caf72 | ||
|
|
f775f0467b | ||
|
|
fd5c7763bc | ||
|
|
d34c8d1918 | ||
|
|
40d62c4213 | ||
|
|
a12031f7bc | ||
|
|
15b04590af | ||
|
|
2e75c2815e | ||
|
|
8677229785 | ||
|
|
71193a9071 | ||
|
|
cefc0e9bdf | ||
|
|
cf41312a01 | ||
|
|
457b79f0a0 | ||
|
|
d3f4131353 | ||
|
|
b07ef24eea | ||
|
|
8fd430b784 | ||
|
|
593bf44b29 | ||
|
|
1578ed8d8f | ||
|
|
ef17859145 | ||
|
|
3e8d2f8037 | ||
|
|
9077c00386 | ||
|
|
7212e0ed20 | ||
|
|
db92247b65 | ||
|
|
daf86f89da | ||
|
|
4ffe89bb4a | ||
|
|
19e769d107 | ||
|
|
8cc4ffdd80 | ||
|
|
8f6b418f03 | ||
|
|
00e6b710f3 | ||
|
|
d5ee58cbbc | ||
|
|
3ffebd2d8d | ||
|
|
1fd96cc423 | ||
|
|
bcadb93f66 | ||
|
|
ba28639f11 | ||
|
|
60bca1635e | ||
|
|
908caa7009 | ||
|
|
896e1f7119 | ||
|
|
07b42b48a3 | ||
|
|
196488f92d | ||
|
|
5c811b1861 | ||
|
|
7300bec9c7 | ||
|
|
ffbfe1ca5a | ||
|
|
7150f49634 | ||
|
|
316ca559bd | ||
|
|
17c2204dd3 | ||
|
|
17728b76f1 | ||
|
|
b0920bf63f | ||
|
|
2731e6cb8e | ||
|
|
bbc3e9c196 | ||
|
|
4e4186ebf2 | ||
|
|
1e9648256f | ||
|
|
3166bc92b9 | ||
|
|
52c8b3c312 | ||
|
|
08c381cc90 | ||
|
|
919242910d | ||
|
|
03d68032bf | ||
|
|
5e4c076b87 | ||
|
|
b150d84932 | ||
|
|
f5a709fd56 | ||
|
|
b1cab62b95 | ||
|
|
b5bef88a8d | ||
|
|
0e8b9e950b | ||
|
|
3e021cd3aa | ||
|
|
98022fdb79 | ||
|
|
687187c69c | ||
|
|
17ca4fa69e | ||
|
|
3546ade6ab | ||
|
|
78c5ec8a0c | ||
|
|
d9e2acbf92 | ||
|
|
fb5034b276 | ||
|
|
1898ccbd6b | ||
|
|
a635bc246a | ||
|
|
642b63d68e | ||
|
|
d7ed77396c | ||
|
|
205ad80e51 | ||
|
|
8592a411ee | ||
|
|
61d78e8f76 | ||
|
|
bad19eea2e | ||
|
|
16ffca9590 | ||
|
|
846e3eb01a | ||
|
|
feeda48844 | ||
|
|
9e4c555ab1 | ||
|
|
dbf20bfff6 | ||
|
|
9449d8364b | ||
|
|
03131507bc | ||
|
|
0b0a1943d0 | ||
|
|
4d5899ef55 | ||
|
|
93ddee9eee | ||
|
|
90e435f495 | ||
|
|
7da39f4228 | ||
|
|
b7025bf834 | ||
|
|
bc4dbacafb | ||
|
|
80c2a69d39 | ||
|
|
36e59d3d61 | ||
|
|
37f8247bbf | ||
|
|
ead8f77267 | ||
|
|
b465d88531 | ||
|
|
a2e37e05a6 | ||
|
|
518e57e316 | ||
|
|
258d2f03f2 | ||
|
|
1b212b27d7 | ||
|
|
2e927fd4dc | ||
|
|
cbc58e2ebf | ||
|
|
a2fd0dc985 | ||
|
|
a89a399b87 | ||
|
|
bb018f6a0f | ||
|
|
6e01ac50c8 | ||
|
|
50c5f5974d | ||
|
|
fce940a291 | ||
|
|
e08459d1c6 | ||
|
|
5b6889d554 | ||
|
|
80babbca13 | ||
|
|
7208966e1d | ||
|
|
48c1a5d6d3 | ||
|
|
930f45b93a | ||
|
|
992fad8102 | ||
|
|
420662132c | ||
|
|
d54e77a63f | ||
|
|
0b60fbbb59 | ||
|
|
0f94a7b65e | ||
|
|
f8bbc0918c | ||
|
|
6e5b4b1483 | ||
|
|
15130fbe28 | ||
|
|
27f0d9fb86 | ||
|
|
ecf7dc54e0 | ||
|
|
0598e82196 | ||
|
|
32abc4b554 | ||
|
|
d499719c08 | ||
|
|
c105af939f | ||
|
|
444245d2e1 | ||
|
|
63aaa2fbb0 | ||
|
|
3da9c3da8d | ||
|
|
381524203b | ||
|
|
347a8aa660 | ||
|
|
4a83eb125d | ||
|
|
bfddc4ba90 | ||
|
|
932e5ce461 | ||
|
|
fb45af1048 | ||
|
|
5aa154459d | ||
|
|
41139f52c8 | ||
|
|
e5a0774e3e | ||
|
|
0f020bb3ba | ||
|
|
c3d1c773e0 | ||
|
|
38dd599b1e | ||
|
|
701cc2a6d7 | ||
|
|
fc9e06d7aa | ||
|
|
ba10c9278f | ||
|
|
2a0b645a2d | ||
|
|
c324b63917 | ||
|
|
da425df98f | ||
|
|
005356d6c3 | ||
|
|
0d1cc3dac9 | ||
|
|
19ae21d6b3 | ||
|
|
4d1a2ae4df | ||
|
|
a7d8d9b0e0 | ||
|
|
98922f0b84 | ||
|
|
5784c79f9f | ||
|
|
b027b36b54 | ||
|
|
91100974c3 | ||
|
|
1f6300e3a4 | ||
|
|
94b15991ac | ||
|
|
3b976b6d26 | ||
|
|
90a18de806 | ||
|
|
0e5ff9f64a | ||
|
|
3fed1a5ae8 | ||
|
|
3b414d1077 | ||
|
|
4cb67cd4df | ||
|
|
be632b485d | ||
|
|
7edf109743 | ||
|
|
ad8ee0e8ed | ||
|
|
9b9f1e84d5 | ||
|
|
fba89354b2 | ||
|
|
45b3ec5cde | ||
|
|
095f82df1c | ||
|
|
008a37701f | ||
|
|
f563194445 | ||
|
|
38360e7e78 | ||
|
|
c30b907aa0 | ||
|
|
7ec559ea42 | ||
|
|
91aeacbf35 | ||
|
|
223304bc63 | ||
|
|
a4910e5a84 | ||
|
|
34f5d9d5b1 | ||
|
|
be62327509 | ||
|
|
9832bb54f9 | ||
|
|
09b0d68786 | ||
|
|
99da14b29b | ||
|
|
e4102aa1f7 | ||
|
|
00f63b87a3 | ||
|
|
692940047e | ||
|
|
cdf8a43b28 | ||
|
|
d24ad99f26 | ||
|
|
b9b62e9f85 | ||
|
|
e3d53056d1 | ||
|
|
75e8cf538a | ||
|
|
80c2944f0e | ||
|
|
b3f58b8002 | ||
|
|
83634706c2 | ||
|
|
44b96270a3 | ||
|
|
ecffd310b7 | ||
|
|
8d2238e04a | ||
|
|
d6f0bc063e | ||
|
|
4bec0b4795 | ||
|
|
a90182a7b1 | ||
|
|
cf44d4f154 | ||
|
|
231720a9a0 | ||
|
|
26ab4abdec | ||
|
|
daab13b78a | ||
|
|
27946bcbac | ||
|
|
ee636131f5 | ||
|
|
71f5205c28 | ||
|
|
f9b46b3b95 | ||
|
|
5d6e1319c0 | ||
|
|
cdbf680788 | ||
|
|
8118e27bd8 | ||
|
|
5006e2e4fa | ||
|
|
6b85fb95a2 | ||
|
|
395fda2c5a | ||
|
|
9408a1637d | ||
|
|
09de0e3664 | ||
|
|
e8b3582040 | ||
|
|
3bff5e3fb7 | ||
|
|
e886293495 | ||
|
|
56d57c3fee | ||
|
|
03ade6eabc | ||
|
|
732ed8924d | ||
|
|
87051573d8 | ||
|
|
bd66449507 | ||
|
|
e899a82840 | ||
|
|
aba0c21f71 | ||
|
|
03838cfae8 | ||
|
|
61772b8e40 | ||
|
|
b445de322c | ||
|
|
db2b8b63be | ||
|
|
d355db6bb1 | ||
|
|
a529edc4b2 | ||
|
|
d1effdae81 | ||
|
|
a7b959a1d9 | ||
|
|
951f026f8f | ||
|
|
1c8506eee4 | ||
|
|
22f309e02a | ||
|
|
4d9d9e4569 | ||
|
|
9e1cbc5fc0 | ||
|
|
6ba2733492 | ||
|
|
35d0ebe974 | ||
|
|
5e8efcd269 | ||
|
|
2440eb5e95 | ||
|
|
b8d2f9de30 | ||
|
|
7a2ff40776 | ||
|
|
56fff07662 | ||
|
|
434b4f880f | ||
|
|
f596d12e02 | ||
|
|
c4be84af32 | ||
|
|
a2b2118f9f | ||
|
|
7fee372f3d | ||
|
|
e3fe496321 | ||
|
|
5c890d3e0e | ||
|
|
496d132c23 | ||
|
|
68fb2d45e1 | ||
|
|
e44b0d2c22 | ||
|
|
5e87a410c8 | ||
|
|
6f34b040cf | ||
|
|
0d0ad8b581 | ||
|
|
a3eac057fc | ||
|
|
489b3a7629 | ||
|
|
45aff4a7b7 | ||
|
|
4653caef47 | ||
|
|
1d9b988206 | ||
|
|
ebedd6d722 | ||
|
|
b0311d1610 | ||
|
|
158573f63e | ||
|
|
93172f42b7 | ||
|
|
b3476fe3dd | ||
|
|
1f85781c68 | ||
|
|
595548acf0 | ||
|
|
a32fffb36d | ||
|
|
3de5961c86 | ||
|
|
1b4727917b | ||
|
|
499cf36edf | ||
|
|
bb1856a47e | ||
|
|
0226a6a4f7 | ||
|
|
6c9a542b9c | ||
|
|
59ae933886 | ||
|
|
b22464c02f | ||
|
|
4615781af8 | ||
|
|
ce0efea447 | ||
|
|
378a2c6902 | ||
|
|
ab3fc73a18 | ||
|
|
b3c56acd15 | ||
|
|
2c9b60dbec | ||
|
|
620a18cd72 | ||
|
|
ba832b8ad9 | ||
|
|
bcfffd3527 | ||
|
|
022da56bf4 | ||
|
|
12549e2587 | ||
|
|
57ab075d2f | ||
|
|
1510322708 | ||
|
|
22c06c88dd | ||
|
|
7a4b20269d | ||
|
|
79d76d8147 | ||
|
|
2bf2e4ef3d | ||
|
|
61ec16ae12 | ||
|
|
8415307221 | ||
|
|
6da466f9c4 | ||
|
|
210ac2ef2a | ||
|
|
988f8090f2 | ||
|
|
e2db825fc2 | ||
|
|
cc9ed3f365 | ||
|
|
0763b71396 | ||
|
|
af2158f647 | ||
|
|
4ad636a767 | ||
|
|
dffb484fff | ||
|
|
6582917daf | ||
|
|
7bd109eca6 | ||
|
|
c0d85864ce | ||
|
|
7007d58609 | ||
|
|
23a54a0fa4 | ||
|
|
491a66ac4c | ||
|
|
e5c3bfb528 | ||
|
|
f807bdee42 | ||
|
|
67b3462361 | ||
|
|
cd1eccd998 | ||
|
|
63b108b18b | ||
|
|
3907e2d84a | ||
|
|
4deeac9513 | ||
|
|
4c11bf663b | ||
|
|
d8649cb305 | ||
|
|
eff2a022bf | ||
|
|
ad61b457d8 | ||
|
|
22c3c92792 | ||
|
|
5919016aad | ||
|
|
14c12a2528 | ||
|
|
bca1f08f05 | ||
|
|
2ce656731d | ||
|
|
6d7fb4939d | ||
|
|
3cb8deab2c | ||
|
|
b501007d44 | ||
|
|
70f7312f20 | ||
|
|
b7b5b1b3cb | ||
|
|
44001d9764 | ||
|
|
5dcfbf00d2 | ||
|
|
8ca52259cd | ||
|
|
f4753f773f | ||
|
|
0f3f9a827b | ||
|
|
a90745aded | ||
|
|
96a1ab6ad6 | ||
|
|
f49b6a072c | ||
|
|
146ca6ae2a | ||
|
|
b775e16c1f | ||
|
|
043df4bc73 | ||
|
|
7d660f5127 | ||
|
|
71064cd6ee | ||
|
|
93f2f962e2 | ||
|
|
8eb7f932fc | ||
|
|
d2fb6edde1 | ||
|
|
ed59886897 | ||
|
|
07b6c64640 | ||
|
|
420e5fa3a5 | ||
|
|
3e12428e54 | ||
|
|
4d2a2e9b20 | ||
|
|
5650a00ab1 | ||
|
|
2eb42a3313 | ||
|
|
84d4d4f11b | ||
|
|
b6a9182838 | ||
|
|
a6593f574e | ||
|
|
d277df1e49 | ||
|
|
5721f6d737 | ||
|
|
a07b7530df | ||
|
|
bff4e859cd | ||
|
|
0944d47c47 | ||
|
|
d725cce8a7 | ||
|
|
a730f47ceb | ||
|
|
8e3d743023 | ||
|
|
cdb2b8a8a8 | ||
|
|
a453be93be | ||
|
|
3cef36da3e | ||
|
|
691343c9b2 | ||
|
|
2453fe9ea5 | ||
|
|
c0594b80e9 | ||
|
|
5239df2b95 | ||
|
|
0f1ac3af10 | ||
|
|
d5f42a46b3 | ||
|
|
0ae6fdbac2 | ||
|
|
f214aaba2a | ||
|
|
67a4208b3b | ||
|
|
5991bb948b | ||
|
|
50bfa1ae99 | ||
|
|
409f19bb29 | ||
|
|
c631dd7a0f | ||
|
|
db74afcfb4 | ||
|
|
ac6bdcc30a | ||
|
|
2556f89637 | ||
|
|
3ec25d5a97 | ||
|
|
c9bdd8231b | ||
|
|
9d372155fb | ||
|
|
4ebdcf3637 | ||
|
|
150e41a26d | ||
|
|
79c4a8351d | ||
|
|
0f6c340793 | ||
|
|
c7fe7ac014 | ||
|
|
a0939c714c | ||
|
|
d57098dd50 | ||
|
|
4b521d1481 | ||
|
|
919cea0703 | ||
|
|
6aa372c955 | ||
|
|
0e873fea52 | ||
|
|
44003e8130 | ||
|
|
2a4bd851ab | ||
|
|
cb5fdfba85 | ||
|
|
8973959910 | ||
|
|
383f411739 | ||
|
|
c500b30484 | ||
|
|
91fec4ff95 | ||
|
|
5266e8eeba | ||
|
|
d96bf13526 | ||
|
|
bf017ccc8a | ||
|
|
c1ca41942f | ||
|
|
8c8e44b6f5 | ||
|
|
f95824404a | ||
|
|
4eecc5462b | ||
|
|
3a96cbae9b | ||
|
|
77f3d81f27 | ||
|
|
7343e08abb | ||
|
|
3b7b6e9ed7 | ||
|
|
70a9fd95a2 | ||
|
|
c0e64583e5 | ||
|
|
211f6bdc42 | ||
|
|
f07440f9ef | ||
|
|
7f37cd40eb | ||
|
|
b0d7b33dbc | ||
|
|
35905aad1b | ||
|
|
62b27475fb | ||
|
|
0985df234f | ||
|
|
a05650a41a | ||
|
|
0c0744714e | ||
|
|
cd60933525 | ||
|
|
2d3deafcc6 | ||
|
|
25508b932e | ||
|
|
05d3610f5f | ||
|
|
5b0ef914c2 | ||
|
|
35f2ccecf5 | ||
|
|
122d759687 | ||
|
|
a2c94c692a | ||
|
|
e197c6e491 | ||
|
|
62ff80c1bf | ||
|
|
3a7cccbda2 | ||
|
|
3bab92239a | ||
|
|
cc0b12097d | ||
|
|
fe09d91bf0 | ||
|
|
593ed7c5e0 | ||
|
|
e161b0da19 | ||
|
|
31a2ef63ec | ||
|
|
facc26a795 | ||
|
|
fb4a4f2340 | ||
|
|
42cab04edd | ||
|
|
247521ba37 | ||
|
|
9f932462a8 | ||
|
|
3f7c42a05e | ||
|
|
3ca502ba6e | ||
|
|
8afe22f637 | ||
|
|
a615eed985 | ||
|
|
df56679c4e | ||
|
|
23b2e87127 | ||
|
|
9391c68ad0 | ||
|
|
8a15278af2 | ||
|
|
8f2c12cba7 | ||
|
|
842c028fb5 | ||
|
|
27aae16634 | ||
|
|
0206da6d4f | ||
|
|
687f308b40 | ||
|
|
20eced4373 | ||
|
|
7d0c793e47 | ||
|
|
ead21ea2ee | ||
|
|
45ef1a4de5 | ||
|
|
28b866830e | ||
|
|
4d68e35f3b | ||
|
|
12a2069fcf | ||
|
|
b87d2459cc | ||
|
|
7c1c25577c | ||
|
|
9d6e0ba54b | ||
|
|
bd3c6867b5 | ||
|
|
28c4b8ea05 | ||
|
|
7a90e30243 | ||
|
|
f482c41e6c | ||
|
|
06ffafba10 | ||
|
|
2a07124d52 | ||
|
|
65247b1c69 | ||
|
|
10e4b7e5b6 | ||
|
|
ff3e6c34ba | ||
|
|
19700cfa00 | ||
|
|
d0de9e5bb9 | ||
|
|
9861653378 | ||
|
|
0a4525b75e | ||
|
|
1c45cadcf8 | ||
|
|
83ced0d58f | ||
|
|
6ee224ffbc | ||
|
|
a060f0732b | ||
|
|
4e2a824b1d | ||
|
|
85c4848614 | ||
|
|
a5ca838b7a | ||
|
|
1127f4b28c | ||
|
|
e68ff3c391 | ||
|
|
c257da0e70 | ||
|
|
7669ac90ae | ||
|
|
5e7ddcad1c | ||
|
|
1cf773216d | ||
|
|
da3283f2ba | ||
|
|
18d6a6767b | ||
|
|
f8fd222e25 | ||
|
|
fd7819f76a | ||
|
|
48cfedb777 | ||
|
|
9220ad8baa | ||
|
|
6207c8f547 | ||
|
|
b9e1660f92 | ||
|
|
8863e7da9b | ||
|
|
3b1462ac1a | ||
|
|
937503ab8b | ||
|
|
b3edfba0da | ||
|
|
01a1d26a52 | ||
|
|
4662fc47e9 | ||
|
|
5b543d778d | ||
|
|
798f56650d | ||
|
|
864c96fe56 | ||
|
|
4d5eecd680 | ||
|
|
db2216adb7 | ||
|
|
ae056f4a22 | ||
|
|
5178c2fbd0 | ||
|
|
4bedaef9a8 | ||
|
|
42d4de77ae | ||
|
|
3e0a8f0af1 | ||
|
|
33e29e20a2 | ||
|
|
d2a1e8f771 | ||
|
|
3a68ebcbf4 | ||
|
|
f496f386ee | ||
|
|
9e641e65ed | ||
|
|
d34bc6d7d2 | ||
|
|
7581169f87 | ||
|
|
7c53701df5 | ||
|
|
d273523c46 | ||
|
|
df6745ff79 | ||
|
|
9327b418bf | ||
|
|
5430fed1d1 | ||
|
|
10285cf3d3 | ||
|
|
c8bed9af32 | ||
|
|
7499703d77 | ||
|
|
4e1f421dc1 | ||
|
|
4ab2a0749c | ||
|
|
530ac9da18 | ||
|
|
4069d38978 | ||
|
|
4070b38190 | ||
|
|
718f3ddc9f | ||
|
|
e4be18ac51 | ||
|
|
fa63270530 | ||
|
|
54286984e9 | ||
|
|
523e4d2900 | ||
|
|
79af0d2cc7 | ||
|
|
4152ee10ea | ||
|
|
c41b92d15a | ||
|
|
5af9679751 | ||
|
|
c51fcf0cb6 | ||
|
|
41d4735502 | ||
|
|
7c3964c6f5 | ||
|
|
df744ba263 | ||
|
|
380b3dde0a | ||
|
|
4c696c8b21 | ||
|
|
95f9206880 | ||
|
|
e00557885f | ||
|
|
9aaab7d726 | ||
|
|
ab9f78d33f | ||
|
|
ac57f6a39a | ||
|
|
49077225c6 | ||
|
|
f3a13739c0 | ||
|
|
ae4d37498a | ||
|
|
25a607952c | ||
|
|
51cfbb0779 | ||
|
|
15c97e5d12 | ||
|
|
4847bc019a | ||
|
|
094f6e2f50 | ||
|
|
6cc19a52f1 | ||
|
|
f0237005c0 | ||
|
|
3aa31a830c | ||
|
|
c61513cf84 | ||
|
|
d10b6dd9b3 | ||
|
|
b466f91f8a | ||
|
|
7081440121 | ||
|
|
5042f58e30 | ||
|
|
beb51081d3 | ||
|
|
1997da4343 | ||
|
|
0b3f3e67dd | ||
|
|
e9d7b92a6e | ||
|
|
334d5609b0 | ||
|
|
6e31c591bd | ||
|
|
d125d8f067 | ||
|
|
49b55236d0 | ||
|
|
093001bf95 | ||
|
|
3445f87e0c | ||
|
|
8d3ba52501 | ||
|
|
82a7590a2a | ||
|
|
773df7aedd | ||
|
|
424ca82b15 | ||
|
|
e5df6ad7bf | ||
|
|
d81f8f7bed | ||
|
|
7203b652fa | ||
|
|
5d5268c2c7 | ||
|
|
b568e96407 | ||
|
|
1dda881422 | ||
|
|
17d2791d40 | ||
|
|
9469b66c61 | ||
|
|
bbc16b942e | ||
|
|
2cb235f49c | ||
|
|
e2a7a439d2 | ||
|
|
2c19ebf570 | ||
|
|
19d799ac5e | ||
|
|
e89a0955ea | ||
|
|
fc6dfd1994 | ||
|
|
3fa33b6706 | ||
|
|
939daa616b | ||
|
|
fd22f50de2 | ||
|
|
48ca9259af | ||
|
|
c49d3d4c30 | ||
|
|
246b0c2a37 | ||
|
|
33f446401b | ||
|
|
9c677463f2 | ||
|
|
786e267e93 | ||
|
|
c782743a24 | ||
|
|
b2c4c76fba | ||
|
|
5a6660b60d | ||
|
|
f5d324eb48 | ||
|
|
901e0967fc | ||
|
|
1cfacc3813 | ||
|
|
8f1c7d5d54 | ||
|
|
3427c1b0bd | ||
|
|
4a12d44971 | ||
|
|
d833d43a8b | ||
|
|
64a3b851b6 | ||
|
|
2a0ceceb2f | ||
|
|
7250e0e5c4 | ||
|
|
40161fdc3c | ||
|
|
cb815d7dea | ||
|
|
fffe4aacc1 | ||
|
|
985c12c918 | ||
|
|
87bbf61c66 | ||
|
|
8f204de057 | ||
|
|
419b08070a | ||
|
|
ba1d4d7b72 | ||
|
|
a48b5df28e | ||
|
|
07bbc42df5 | ||
|
|
14e77571c0 | ||
|
|
71a35878c1 | ||
|
|
7dc74f0767 | ||
|
|
784d12f3ca | ||
|
|
cdf9700ff0 | ||
|
|
05f926b33b | ||
|
|
b05f2acc34 | ||
|
|
67b52d1f42 | ||
|
|
6391c3ca08 | ||
|
|
fc59a1efa1 | ||
|
|
e215e39e5d | ||
|
|
33e1f48717 | ||
|
|
94f61e5aff | ||
|
|
41b25a43ba | ||
|
|
09e617ee78 | ||
|
|
f5f8b2f66a | ||
|
|
45b9b41557 | ||
|
|
e0a1b983e3 | ||
|
|
4d2b339112 | ||
|
|
b1a66e4a20 | ||
|
|
1e44f82b38 | ||
|
|
487f428c7f | ||
|
|
f5fa51854d | ||
|
|
3f15295293 | ||
|
|
de72c2b055 | ||
|
|
8f93507fec | ||
|
|
2afaf8b446 | ||
|
|
33e0a1b228 | ||
|
|
4b7dd1fd22 | ||
|
|
6f7ef14482 | ||
|
|
097a115595 | ||
|
|
cd78458d19 | ||
|
|
b69d706cc4 | ||
|
|
8286d7b621 | ||
|
|
d899c55f4f | ||
|
|
0a954e171d | ||
|
|
89d2c38257 | ||
|
|
d7829e7801 | ||
|
|
3d4f6055e4 | ||
|
|
383ae3fe3e | ||
|
|
47cbd18c88 | ||
|
|
d5779878c7 | ||
|
|
c65cabffd5 | ||
|
|
fe90a62239 | ||
|
|
13ae33266f | ||
|
|
399b689bcd | ||
|
|
1219e7be12 | ||
|
|
10f67ab360 | ||
|
|
ce1f755612 | ||
|
|
fa943d1166 | ||
|
|
dc09f91e35 | ||
|
|
34b8fa2728 | ||
|
|
02f7bebf67 | ||
|
|
4ffc384764 | ||
|
|
e1ef2b34ea | ||
|
|
d5a83a8819 | ||
|
|
661f499f67 | ||
|
|
a073beeea7 | ||
|
|
07f6bf7a7a | ||
|
|
0cfbb269f2 | ||
|
|
f3791e5fb4 | ||
|
|
37d8b0d3bd | ||
|
|
4ae383033a | ||
|
|
ea71675701 | ||
|
|
1178d01baa | ||
|
|
ace53f9494 | ||
|
|
3c17ff2da9 | ||
|
|
163991a36b | ||
|
|
291721c1d0 | ||
|
|
d96301d544 | ||
|
|
54d9674055 | ||
|
|
4a5a07649a | ||
|
|
cfdb65fad8 | ||
|
|
16544a4a70 | ||
|
|
02939d0840 | ||
|
|
bf331c7020 | ||
|
|
e80b55572b | ||
|
|
51c29f0a6e | ||
|
|
056191db82 | ||
|
|
9ace150efa | ||
|
|
79ae89d172 | ||
|
|
bb703e2060 | ||
|
|
972d9019e1 | ||
|
|
c99566410a | ||
|
|
9c56a14fb0 | ||
|
|
b95e58317b | ||
|
|
6fd9d6e15c | ||
|
|
518b9fa2ba | ||
|
|
c113b7bd88 | ||
|
|
fb0a302f62 | ||
|
|
43127379cd |
64
.github/workflows/test-integration.yml
vendored
Normal file
64
.github/workflows/test-integration.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: Test Integration
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test on PHP ${{ matrix.php-versions }}
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
TEST_DATABASE_HOST: '127.0.0.1'
|
||||
TEST_DATABASE_PORT: '8888'
|
||||
TEST_DATABASE_NAME: integration_test
|
||||
TEST_DATABASE_USER: root
|
||||
TEST_DATABASE_PASSWORD: password
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQ_USER: root
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
MYSQL_DATABASE: integration_test
|
||||
ports:
|
||||
- '8888:3306'
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.1']
|
||||
branches: ['master']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ matrix.branches }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: Setup PHP with Composer
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: composer:v2
|
||||
ini-values: memory_limit=1024M
|
||||
|
||||
- name: Start MySQL service
|
||||
run: sudo systemctl start mysql
|
||||
|
||||
- name: Create DB table
|
||||
run: mysql -h 127.0.0.1 --port 8888 -u root -ppassword -e 'CREATE DATABASE IF NOT EXISTS integration_test;'
|
||||
|
||||
- name: NPM install
|
||||
run: npm install
|
||||
|
||||
- name: Build
|
||||
run: grunt test
|
||||
|
||||
- name: Integration testing
|
||||
run: vendor/bin/phpunit tests/integration
|
||||
48
.github/workflows/test.yml
vendored
Normal file
48
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'fix'
|
||||
paths:
|
||||
- '**.php'
|
||||
- '**.json'
|
||||
- '**.yml'
|
||||
- 'composer.lock'
|
||||
- 'phpstan.neon'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.php'
|
||||
- '**.json'
|
||||
- '**.yml'
|
||||
- 'composer.lock'
|
||||
- 'phpstan.neon'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test on PHP ${{ matrix.php-versions }}
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP with Composer
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: composer:v2
|
||||
ini-values: memory_limit=1024M
|
||||
|
||||
- name: Composer install
|
||||
run: composer install
|
||||
|
||||
- name: Static analysis
|
||||
run: vendor/bin/phpstan
|
||||
|
||||
- name: Unit testing
|
||||
run: vendor/bin/phpunit tests/unit
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -23,3 +23,7 @@
|
||||
!/custom/Espo/Custom/.htaccess
|
||||
!/custom/Espo/Modules/.htaccess
|
||||
/install/config.php
|
||||
|
||||
client/css/espo/*
|
||||
client/lib/*
|
||||
client/modules/crm/lib/*
|
||||
|
||||
223
Gruntfile.js
223
Gruntfile.js
@@ -2,7 +2,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -20,12 +20,13 @@
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* * `grunt` - full build
|
||||
* * `grunt dev` - build only items needed for development (takes less time)
|
||||
* * `grunt offline` - build but skip *composer install*
|
||||
* * `grant release` - full build plus upgrade packages`
|
||||
* * `grant test` - build for tests running
|
||||
* * `grant run-tests` - build and run unit and integration tests
|
||||
* * `grunt` - full build;
|
||||
* * `grunt dev` - build only items needed for development (takes less time);
|
||||
* * `grunt offline` - build but skip *composer install*;
|
||||
* * `grunt internal` - build only libs and css;
|
||||
* * `grunt release` - full build plus upgrade packages`;
|
||||
* * `grunt test` - build for tests running;
|
||||
* * `grunt run-tests` - build and run unit and integration tests.
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
@@ -95,7 +96,12 @@ module.exports = grunt => {
|
||||
},
|
||||
|
||||
clean: {
|
||||
start: ['build/EspoCRM-*'],
|
||||
start: [
|
||||
'build/EspoCRM-*',
|
||||
'client/lib/*',
|
||||
'client/modules/crm/lib/*',
|
||||
'client/css/espo/*',
|
||||
],
|
||||
final: ['build/tmp'],
|
||||
release: ['build/EspoCRM-' + pkg.version],
|
||||
beforeFinal: {
|
||||
@@ -110,6 +116,7 @@ module.exports = grunt => {
|
||||
'build/tmp/client/custom/*',
|
||||
'!build/tmp/client/custom/modules',
|
||||
'build/tmp/client/custom/modules/*',
|
||||
'!build/tmp/client/custom/modules/dummy.txt',
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -135,7 +142,7 @@ module.exports = grunt => {
|
||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
|
||||
},
|
||||
files: {
|
||||
'build/tmp/client/espo.min.js': jsFilesToBundle,
|
||||
'client/lib/espo.min.js': jsFilesToBundle,
|
||||
},
|
||||
},
|
||||
lib: {
|
||||
@@ -147,7 +154,7 @@ module.exports = grunt => {
|
||||
options: {
|
||||
mode: true,
|
||||
},
|
||||
frontendFolders: {
|
||||
frontend: {
|
||||
expand: true,
|
||||
cwd: 'client',
|
||||
src: [
|
||||
@@ -160,19 +167,13 @@ module.exports = grunt => {
|
||||
'css/**',
|
||||
'sounds/**',
|
||||
'custom/**',
|
||||
'lib/**',
|
||||
],
|
||||
dest: 'build/tmp/client',
|
||||
},
|
||||
frontendLib: {
|
||||
files: jsFilesToCopy,
|
||||
},
|
||||
frontendCommitedLib: {
|
||||
expand: true,
|
||||
dot: true,
|
||||
cwd: 'client/lib',
|
||||
src: '**',
|
||||
dest: 'build/tmp/client/lib/',
|
||||
},
|
||||
backend: {
|
||||
expand: true,
|
||||
dot: true,
|
||||
@@ -211,60 +212,6 @@ module.exports = grunt => {
|
||||
},
|
||||
},
|
||||
|
||||
chmod: {
|
||||
php: {
|
||||
options: {
|
||||
mode: '644'
|
||||
},
|
||||
src: [
|
||||
'build/EspoCRM-<%= pkg.version %>/**/*.php',
|
||||
'build/EspoCRM-<%= pkg.version %>/**/*.json',
|
||||
'build/EspoCRM-<%= pkg.version %>/**/*.config',
|
||||
'build/EspoCRM-<%= pkg.version %>/**/.htaccess',
|
||||
'build/EspoCRM-<%= pkg.version %>/client/**/*.js',
|
||||
'build/EspoCRM-<%= pkg.version %>/client/**/*.css',
|
||||
'build/EspoCRM-<%= pkg.version %>/client/**/*.tpl',
|
||||
'build/EspoCRM-<%= pkg.version %>/**/*.html',
|
||||
'build/EspoCRM-<%= pkg.version %>/**/*.txt',
|
||||
],
|
||||
},
|
||||
folders: {
|
||||
options: {
|
||||
mode: '755'
|
||||
},
|
||||
src: [
|
||||
'build/EspoCRM-<%= pkg.version %>/public/install',
|
||||
'build/EspoCRM-<%= pkg.version %>/public/portal',
|
||||
'build/EspoCRM-<%= pkg.version %>/public/api',
|
||||
'build/EspoCRM-<%= pkg.version %>/public/api/v1',
|
||||
'build/EspoCRM-<%= pkg.version %>/public/api/v1/portal-access',
|
||||
'build/EspoCRM-<%= pkg.version %>',
|
||||
],
|
||||
},
|
||||
foldersWritable: {
|
||||
options: {
|
||||
mode: '775'
|
||||
},
|
||||
src: [
|
||||
'build/EspoCRM-<%= pkg.version %>/data',
|
||||
'build/EspoCRM-<%= pkg.version %>/custom',
|
||||
'build/EspoCRM-<%= pkg.version %>/custom/Espo',
|
||||
'build/EspoCRM-<%= pkg.version %>/custom/Espo/Custom',
|
||||
'build/EspoCRM-<%= pkg.version %>/client/custom',
|
||||
'build/EspoCRM-<%= pkg.version %>/client/modules',
|
||||
'build/EspoCRM-<%= pkg.version %>/application/Espo/Modules',
|
||||
]
|
||||
},
|
||||
executable: {
|
||||
options: {
|
||||
mode: '754'
|
||||
},
|
||||
src: [
|
||||
'build/EspoCRM-<%= pkg.version %>/bin/*',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
replace: {
|
||||
version: {
|
||||
options: {
|
||||
@@ -304,14 +251,106 @@ module.exports = grunt => {
|
||||
|
||||
grunt.registerTask('chmod-folders', () => {
|
||||
cp.execSync(
|
||||
"find . -type d -exec chmod 755 {} + ",
|
||||
"find . -type d -exec chmod 755 {} +",
|
||||
{
|
||||
stdio: 'ignore',
|
||||
cwd: 'build/EspoCRM-' + pkg.version,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
grunt.registerTask('chmod-multiple', () => {
|
||||
let dirPath = 'build/EspoCRM-' + pkg.version;
|
||||
|
||||
let fileList = [
|
||||
{
|
||||
name: '*.php',
|
||||
},
|
||||
{
|
||||
name: '*.json',
|
||||
},
|
||||
{
|
||||
name: '*.config',
|
||||
},
|
||||
{
|
||||
name: '.htaccess',
|
||||
},
|
||||
{
|
||||
name: '*.html',
|
||||
},
|
||||
{
|
||||
name: '*.txt',
|
||||
},
|
||||
{
|
||||
name: '*.js',
|
||||
folder: 'client',
|
||||
},
|
||||
{
|
||||
name: '*.css',
|
||||
folder: 'client',
|
||||
},
|
||||
{
|
||||
name: '*.tpl',
|
||||
folder: 'client',
|
||||
},
|
||||
];
|
||||
|
||||
let dirReadableList = [
|
||||
'public/install',
|
||||
'public/portal',
|
||||
'public/api',
|
||||
'public/api/v1',
|
||||
'public/api/v1/portal-access',
|
||||
'.',
|
||||
];
|
||||
|
||||
let dirWritableList = [
|
||||
'data',
|
||||
'custom',
|
||||
'custom/Espo',
|
||||
'custom/Espo/Custom',
|
||||
'client/custom',
|
||||
'client/modules',
|
||||
'application/Espo/Modules',
|
||||
];
|
||||
|
||||
fileList.forEach(item => {
|
||||
let path = item.folder || '.';
|
||||
let name = item.name;
|
||||
|
||||
cp.execSync(
|
||||
`find ${path} -type f -iname "${name}" -exec chmod 644 {} +`,
|
||||
{
|
||||
cwd: dirPath,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
dirReadableList.forEach(item => {
|
||||
cp.execSync(
|
||||
`chmod 755 ${item}`,
|
||||
{
|
||||
cwd: dirPath,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
dirWritableList.forEach(item => {
|
||||
cp.execSync(
|
||||
`chmod 775 ${item}`,
|
||||
{
|
||||
cwd: dirPath,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
cp.execSync(
|
||||
`find bin -type f -exec chmod 754 {} +`,
|
||||
{
|
||||
cwd: dirPath,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
grunt.registerTask('composer-install', () => {
|
||||
cp.execSync("composer install --no-dev", {stdio: 'ignore'});
|
||||
});
|
||||
@@ -332,6 +371,10 @@ module.exports = grunt => {
|
||||
cp.execSync("vendor/bin/phpunit ./tests/integration", {stdio: 'inherit'});
|
||||
});
|
||||
|
||||
grunt.registerTask('set-config-params', () => {
|
||||
cp.execSync("composer run-script setConfigParams", {stdio: 'ignore'});
|
||||
});
|
||||
|
||||
grunt.registerTask('zip', () => {
|
||||
const archiver = require('archiver');
|
||||
|
||||
@@ -366,43 +409,43 @@ module.exports = grunt => {
|
||||
});
|
||||
|
||||
grunt.registerTask('npm-install', () => {
|
||||
cp.execSync("npm install", {stdio: 'ignore'});
|
||||
cp.execSync("npm ci", {stdio: 'ignore'});
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-mkdir');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify-es');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-replace');
|
||||
grunt.loadNpmTasks('grunt-chmod');
|
||||
|
||||
grunt.registerTask('internal', [
|
||||
'less',
|
||||
'cssmin',
|
||||
'uglify:bundle',
|
||||
'copy:frontendLib',
|
||||
'uglify:lib',
|
||||
]);
|
||||
|
||||
grunt.registerTask('offline', [
|
||||
'clean:start',
|
||||
'mkdir:tmp',
|
||||
'less',
|
||||
'cssmin',
|
||||
'uglify:bundle',
|
||||
'copy:frontendFolders',
|
||||
'copy:frontendLib',
|
||||
'copy:frontendCommitedLib',
|
||||
'internal',
|
||||
'copy:frontend',
|
||||
'copy:backend',
|
||||
'uglify:lib',
|
||||
'replace',
|
||||
'clean:beforeFinal',
|
||||
'copy:final',
|
||||
'chmod-folders',
|
||||
'chmod:php',
|
||||
'chmod:folders',
|
||||
'chmod:foldersWritable',
|
||||
'chmod:executable',
|
||||
'chmod-multiple',
|
||||
'clean:final',
|
||||
]);
|
||||
|
||||
grunt.registerTask('build', [
|
||||
'composer-install',
|
||||
'npm-install',
|
||||
'set-config-params',
|
||||
'offline',
|
||||
]);
|
||||
|
||||
@@ -486,10 +529,10 @@ function getCopyLibDataList() {
|
||||
let minify = item.minify;
|
||||
|
||||
if (item.files) {
|
||||
item.files.forEach(item => {
|
||||
item.files.forEach(item => {
|
||||
list.push({
|
||||
src: item.src,
|
||||
dest: 'build/tmp/' + (item.dest || 'client/lib/' + item.src.split('/').pop()),
|
||||
dest: item.dest || 'client/lib/' + item.src.split('/').pop(),
|
||||
minify: minify,
|
||||
});
|
||||
});
|
||||
@@ -503,7 +546,7 @@ function getCopyLibDataList() {
|
||||
|
||||
list.push({
|
||||
src: item.src,
|
||||
dest: 'build/tmp/' + (item.dest || 'client/lib/' + item.src.split('/').pop()),
|
||||
dest: item.dest || 'client/lib/' + item.src.split('/').pop(),
|
||||
minify: minify,
|
||||
});
|
||||
});
|
||||
|
||||
18
README.md
18
README.md
@@ -1,6 +1,8 @@
|
||||
## EspoCRM
|
||||
|
||||
[EspoCRM is an Open Source CRM](https://www.espocrm.com) (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships regardless of the type. People, companies or opportunities - all in an easy and intuitive interface.
|
||||
[](#espocrm)
|
||||
|
||||
[EspoCRM is an Open Source CRM](https://www.espocrm.com) (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships regardless of the type. People, companies or opportunities – all in an easy and intuitive interface.
|
||||
|
||||
It's a web application with a frontend designed as a single page application and REST API backend written in PHP.
|
||||
|
||||
@@ -8,22 +10,22 @@ It's a web application with a frontend designed as a single page application and
|
||||
|
||||
### Requirements
|
||||
|
||||
* PHP 7.3 and later (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* PHP 7.4 and later (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.7 (and later), or MariaDB 10.1 (and later).
|
||||
|
||||
For more information about server configuration see [this article](https://docs.espocrm.com/administration/server-configuration/).
|
||||
|
||||
### Documentation
|
||||
|
||||
Documentation for administrators, users and developers is available [here](https://docs.espocrm.com).
|
||||
The documentation for administrators, users and developers is available [here](https://docs.espocrm.com).
|
||||
|
||||
### How to report a bug
|
||||
### Bug reporting
|
||||
|
||||
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
|
||||
### Installing the stable version
|
||||
|
||||
[Download](https://www.espocrm.com/download/) the latest version. See the [instructions](https://docs.espocrm.com/administration/installation/) about installation.
|
||||
See the [instructions](https://docs.espocrm.com/administration/installation/) about installation.
|
||||
|
||||
### Development
|
||||
|
||||
@@ -31,13 +33,13 @@ Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our
|
||||
* [Running tests](https://docs.espocrm.com/development/tests)
|
||||
* [Making translation](https://docs.espocrm.com/development/translation)
|
||||
|
||||
### How to contribute
|
||||
### Contributing
|
||||
|
||||
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;
|
||||
* *fix* – 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.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\ActionHistoryRecord>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -32,6 +32,7 @@ namespace Espo\Classes\Acl\Attachment;
|
||||
use Espo\Entities\{
|
||||
User,
|
||||
Note,
|
||||
Attachment,
|
||||
};
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
@@ -45,6 +46,9 @@ use Espo\Core\{
|
||||
Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<Attachment>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
@@ -65,26 +69,29 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
|
||||
public function checkEntityRead(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var Attachment $entity */
|
||||
|
||||
if ($entity->get('parentType') === 'Settings') {
|
||||
// Allow the logo.
|
||||
return true;
|
||||
}
|
||||
|
||||
$parent = null;
|
||||
|
||||
$hasParent = false;
|
||||
$parentType = $entity->get('parentType');
|
||||
$parentId = $entity->get('parentId');
|
||||
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$hasParent = true;
|
||||
$relatedType = $entity->get('relatedType');
|
||||
$relatedId = $entity->get('relatedId');
|
||||
|
||||
$parent = $this->entityManager->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
if ($parentId && $parentType) {
|
||||
$parent = $this->entityManager->getEntityById($parentType, $parentId);
|
||||
}
|
||||
else if ($entity->get('relatedId') && $entity->get('relatedType')) {
|
||||
$hasParent = true;
|
||||
|
||||
$parent = $this->entityManager->getEntity($entity->get('relatedType'), $entity->get('relatedId'));
|
||||
else if ($relatedId && $relatedType) {
|
||||
$parent = $this->entityManager->getEntityById($relatedType, $relatedId);
|
||||
}
|
||||
|
||||
if (!$parent || !$hasParent) {
|
||||
if (!$parent) {
|
||||
if ($this->defaultAccessChecker->checkEntityRead($user, $entity, $data)) {
|
||||
return true;
|
||||
}
|
||||
@@ -93,6 +100,7 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
}
|
||||
|
||||
if ($parent->getEntityType() === 'Note') {
|
||||
/** @var Note $parent */
|
||||
$result = $this->checkEntityReadNoteParent($user, $parent);
|
||||
|
||||
if ($result !== null) {
|
||||
@@ -100,6 +108,16 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
}
|
||||
}
|
||||
else if ($this->aclManager->checkEntity($user, $parent)) {
|
||||
if (
|
||||
$entity->getTargetField() &&
|
||||
in_array(
|
||||
$entity->getTargetField(),
|
||||
$this->aclManager->getScopeForbiddenFieldList($user, $parent->getEntityType())
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,8 +132,8 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
if ($note->getTargetType() === Note::TARGET_TEAMS) {
|
||||
$intersect = array_intersect(
|
||||
$note->getLinkMultipleIdList('teams'),
|
||||
$user->getLinkMultipleIdList('teams')
|
||||
$note->getLinkMultipleIdList('teams') ?? [],
|
||||
$user->getLinkMultipleIdList('teams') ?? []
|
||||
);
|
||||
|
||||
if (count($intersect)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Attachment>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
private const ATTR_CREATED_BY_ID = 'createdById';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -38,6 +38,9 @@ use Espo\Core\{
|
||||
Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<\Espo\Entities\AuthToken>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,6 +30,7 @@
|
||||
namespace Espo\Classes\Acl\Email;
|
||||
|
||||
use Espo\Entities\User;
|
||||
use Espo\Entities\Email;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
@@ -41,6 +42,9 @@ use Espo\Core\{
|
||||
Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDSChecker<\Espo\Entities\Email>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDSChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
@@ -52,6 +56,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
public function checkEntityRead(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var Email $entity */
|
||||
|
||||
if ($this->defaultAccessChecker->checkEntityRead($user, $entity, $data)) {
|
||||
return true;
|
||||
}
|
||||
@@ -79,6 +85,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
public function checkEntityDelete(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var Email $entity */
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
@@ -96,6 +104,7 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @var string[] */
|
||||
$assignedUserIdList = $entity->getLinkMultipleIdList('assignedUsers');
|
||||
|
||||
if (
|
||||
@@ -126,4 +135,37 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityEdit(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var Email $entity */
|
||||
|
||||
if (
|
||||
$entity->getStatus() === Email::STATUS_DRAFT &&
|
||||
$entity->getCreatedBy() &&
|
||||
$entity->getCreatedBy()->getId() === $user->getId()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->defaultAccessChecker->checkEntityEdit($user, $entity, $data);
|
||||
}
|
||||
|
||||
public function checkEdit(User $user, ScopeData $data): bool
|
||||
{
|
||||
if ($data->getCreate() === Table::LEVEL_YES) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->defaultAccessChecker->checkEdit($user, $data);
|
||||
}
|
||||
|
||||
public function checkDelete(User $user, ScopeData $data): bool
|
||||
{
|
||||
if ($data->getCreate() === Table::LEVEL_YES) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->defaultAccessChecker->checkDelete($user, $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,6 +30,7 @@
|
||||
namespace Espo\Classes\Acl\Email;
|
||||
|
||||
use Espo\Entities\User;
|
||||
use Espo\Entities\Email;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
@@ -39,6 +40,10 @@ use Espo\Core\{
|
||||
Acl\OwnershipTeamChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Email>
|
||||
* @implements OwnershipTeamChecker<\Espo\Entities\Email>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker, OwnershipTeamChecker
|
||||
{
|
||||
private $defaultOwnershipChecker;
|
||||
@@ -50,6 +55,8 @@ class OwnershipChecker implements OwnershipOwnChecker, OwnershipTeamChecker
|
||||
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
{
|
||||
/** @var Email $entity */
|
||||
|
||||
if ($user->getId() === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -38,6 +38,9 @@ use Espo\Core\{
|
||||
ORM\EntityManager,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\EmailFilter>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -39,6 +39,10 @@ use Espo\Core\{
|
||||
Acl\AccessEntityDeleteChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityReadChecker<\Espo\Entities\Import>
|
||||
* @implements AccessEntityDeleteChecker<\Espo\Entities\Import>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityReadChecker, AccessEntityDeleteChecker
|
||||
{
|
||||
public function check(User $user, ScopeData $data): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -46,6 +46,9 @@ use Espo\Core\{
|
||||
use DateTime;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<\Espo\Entities\Note>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,11 +37,13 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Note>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
{
|
||||
|
||||
if ($entity->get('type') === 'Post' && $user->getId() === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Notification>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,6 +40,9 @@ use Espo\Core\{
|
||||
AclManager,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<\Espo\Entities\Portal>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,6 +40,9 @@ use Espo\Core\{
|
||||
Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<\Espo\Entities\ScheduledJob>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,10 +37,14 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Team>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
{
|
||||
/** @var string[] */
|
||||
$userTeamIdList = $user->getLinkMultipleIdList('teams');
|
||||
|
||||
return in_array($entity->getId(), $userTeamIdList);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -42,6 +42,9 @@ use Espo\Core\{
|
||||
AclManager,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDSChecker<User>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDSChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
@@ -62,6 +65,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var User $entity */
|
||||
|
||||
if ($entity->isSuperAdmin() && !$user->isSuperAdmin()) {
|
||||
return false;
|
||||
}
|
||||
@@ -71,6 +76,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
public function checkEntityRead(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var User $entity */
|
||||
|
||||
if ($entity->isPortal()) {
|
||||
if ($this->aclManager->getPermissionLevel($user, 'portal') === Table::LEVEL_YES) {
|
||||
return true;
|
||||
@@ -88,6 +95,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
public function checkEntityEdit(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var User $entity */
|
||||
|
||||
if ($entity->isSystem()) {
|
||||
return false;
|
||||
}
|
||||
@@ -107,6 +116,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
public function checkEntityDelete(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var User $entity */
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
@@ -124,6 +135,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
|
||||
public function checkEntityStream(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var User $entity */
|
||||
|
||||
return $this->aclManager->checkUserPermission($user, $entity, 'user');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,14 +30,18 @@
|
||||
namespace Espo\Classes\Acl\User;
|
||||
|
||||
use Espo\Entities\User;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
Acl\OwnershipTeamChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\User>
|
||||
* @implements OwnershipTeamChecker<\Espo\Entities\User>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker, OwnershipTeamChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
@@ -47,9 +51,11 @@ class OwnershipChecker implements OwnershipOwnChecker, OwnershipTeamChecker
|
||||
|
||||
public function checkTeam(User $user, Entity $entity): bool
|
||||
{
|
||||
assert($entity instanceof CoreEntity);
|
||||
|
||||
$intersect = array_intersect(
|
||||
$user->getLinkMultipleIdList('teams'),
|
||||
$entity->getLinkMultipleIdList('teams')
|
||||
$user->getLinkMultipleIdList('teams') ?? [],
|
||||
$entity->getLinkMultipleIdList('teams') ?? []
|
||||
);
|
||||
|
||||
if (count($intersect)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,6 +40,9 @@ use Espo\Core\{
|
||||
Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<\Espo\Entities\Webhook>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,13 +30,13 @@
|
||||
namespace Espo\Classes\Acl\Webhook;
|
||||
|
||||
use Espo\Entities\User;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
use Espo\Core\Acl\OwnershipOwnChecker;
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Webhook>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -32,6 +32,7 @@ namespace Espo\Classes\AclPortal\Attachment;
|
||||
use Espo\Entities\{
|
||||
User,
|
||||
Note,
|
||||
Attachment,
|
||||
};
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
@@ -45,6 +46,9 @@ use Espo\Core\{
|
||||
Portal\Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<Attachment>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
@@ -67,25 +71,29 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
|
||||
public function checkEntityRead(User $user, Entity $entity, ScopeData $data): bool
|
||||
{
|
||||
/** @var Attachment $entity */
|
||||
|
||||
if ($entity->get('parentType') === 'Settings') {
|
||||
// Allow the logo.
|
||||
return true;
|
||||
}
|
||||
|
||||
$parent = null;
|
||||
$hasParent = false;
|
||||
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$hasParent = true;
|
||||
$parentType = $entity->get('parentType');
|
||||
$parentId = $entity->get('parentId');
|
||||
|
||||
$parent = $this->entityManager->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
$relatedType = $entity->get('relatedType');
|
||||
$relatedId = $entity->get('relatedId');
|
||||
|
||||
if ($parentId && $parentType) {
|
||||
$parent = $this->entityManager->getEntityById($parentType, $parentId);
|
||||
}
|
||||
else if ($entity->get('relatedId') && $entity->get('relatedType')) {
|
||||
$hasParent = true;
|
||||
|
||||
$parent = $this->entityManager->getEntity($entity->get('relatedType'), $entity->get('relatedId'));
|
||||
else if ($relatedId && $relatedType) {
|
||||
$parent = $this->entityManager->getEntityById($relatedType, $relatedId);
|
||||
}
|
||||
|
||||
if (!$hasParent) {
|
||||
if (!$parent) {
|
||||
if ($entity->get('createdById') === $user->getId()) {
|
||||
return true;
|
||||
}
|
||||
@@ -94,6 +102,7 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
}
|
||||
|
||||
if ($parent->getEntityType() === 'Note') {
|
||||
/** @var Note $parent */
|
||||
$result = $this->checkEntityReadNoteParent($user, $parent);
|
||||
|
||||
if ($result !== null) {
|
||||
@@ -101,6 +110,16 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
}
|
||||
}
|
||||
else if ($this->aclManager->checkEntity($user, $parent)) {
|
||||
if (
|
||||
$entity->getTargetField() &&
|
||||
in_array(
|
||||
$entity->getTargetField(),
|
||||
$this->aclManager->getScopeForbiddenFieldList($user, $parent->getEntityType())
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -119,8 +138,8 @@ class AccessChecker implements AccessEntityCREDChecker
|
||||
|
||||
if ($note->getTargetType() === Note::TARGET_PORTALS) {
|
||||
$intersect = array_intersect(
|
||||
$note->getLinkMultipleIdList('portals'),
|
||||
$user->getLinkMultipleIdList('portals')
|
||||
$note->getLinkMultipleIdList('portals') ?? [],
|
||||
$user->getLinkMultipleIdList('portals') ?? []
|
||||
);
|
||||
|
||||
if (count($intersect)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Attachment>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
private const ATTR_CREATED_BY_ID = 'createdById';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -33,8 +33,9 @@ use Espo\Entities\User;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\Core\{
|
||||
Portal\AclManager,
|
||||
Acl\Table,
|
||||
Acl\ScopeData,
|
||||
Acl\AccessEntityCREDSChecker,
|
||||
@@ -42,20 +43,19 @@ use Espo\Core\{
|
||||
Portal\Acl\Traits\DefaultAccessCheckerDependency,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDSChecker<\Espo\Entities\Email>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDSChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
private $defaultAccessChecker;
|
||||
|
||||
private $aclManager;
|
||||
|
||||
public function __construct(
|
||||
DefaultAccessChecker $defaultAccessChecker,
|
||||
AclManager $aclManager
|
||||
DefaultAccessChecker $defaultAccessChecker
|
||||
) {
|
||||
$this->defaultAccessChecker = $defaultAccessChecker;
|
||||
$this->aclManager = $aclManager;
|
||||
}
|
||||
|
||||
public function checkEntityRead(User $user, Entity $entity, ScopeData $data): bool
|
||||
@@ -72,6 +72,8 @@ class AccessChecker implements AccessEntityCREDSChecker
|
||||
return false;
|
||||
}
|
||||
|
||||
assert($entity instanceof CoreEntity);
|
||||
|
||||
$userIdList = $entity->getLinkMultipleIdLIst('users');
|
||||
|
||||
if (is_array($userIdList) && in_array($user->getId(), $userIdList)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Email>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -46,6 +46,9 @@ use Espo\Core\{
|
||||
use DateTime;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* @implements AccessEntityCREDChecker<\Espo\Entities\Note>
|
||||
*/
|
||||
class AccessChecker implements AccessEntityCREDChecker
|
||||
{
|
||||
use DefaultAccessCheckerDependency;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Note>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\Notification>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,9 @@ use Espo\Core\{
|
||||
Acl\OwnershipOwnChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements OwnershipOwnChecker<\Espo\Entities\User>
|
||||
*/
|
||||
class OwnershipChecker implements OwnershipOwnChecker
|
||||
{
|
||||
public function checkOwn(User $user, Entity $entity): bool
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -69,7 +69,7 @@ class Binding
|
||||
$keyList = $data->getContextKeyList($context);
|
||||
|
||||
foreach ($keyList as $key) {
|
||||
$result .= $this->printItem($key, $data->getContext($context, $key), true);
|
||||
$result .= $this->printItem($key, $data->getContext($context, $key));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -63,10 +63,11 @@ class Container
|
||||
'user',
|
||||
];
|
||||
|
||||
/** @var string[] */
|
||||
$fileList = scandir('application/Espo/Core/Loaders');
|
||||
|
||||
if (file_exists('custom/Espo/Custom/Core/Loaders')) {
|
||||
$fileList = array_merge($fileList, scandir('custom/Espo/Custom/Core/Loaders'));
|
||||
$fileList = array_merge($fileList, scandir('custom/Espo/Custom/Core/Loaders') ?: []);
|
||||
}
|
||||
|
||||
foreach ($fileList as $file) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,9 +40,11 @@ use Espo\Core\{
|
||||
*/
|
||||
class TemplateEntityTypeList
|
||||
{
|
||||
protected $acl;
|
||||
protected $selectBuilderFactory;
|
||||
protected $entityManager;
|
||||
private $acl;
|
||||
|
||||
private $selectBuilderFactory;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
public function __construct(Acl $acl, SelectBuilderFactory $selectBuilderFactory, EntityManager $entityManager)
|
||||
{
|
||||
@@ -51,7 +53,10 @@ class TemplateEntityTypeList
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function get() : array
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function get(): array
|
||||
{
|
||||
if (!$this->acl->checkScope('Template')) {
|
||||
return [];
|
||||
@@ -69,7 +74,7 @@ class TemplateEntityTypeList
|
||||
->build();
|
||||
|
||||
$templateCollection = $this->entityManager
|
||||
->getRepository('Template')
|
||||
->getRDBRepository('Template')
|
||||
->clone($query)
|
||||
->find();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -35,7 +35,7 @@ use Espo\Services\Stream as StreamService;
|
||||
use Espo\Core\Notification\AssignmentNotificator;
|
||||
use Espo\Core\Notification\AssignmentNotificator\Params;
|
||||
use Espo\Core\Notification\UserEnabledChecker;
|
||||
use Espo\Core\ServiceFactory;
|
||||
use Espo\Core\InjectableFactory;
|
||||
use Espo\Core\AclManager;
|
||||
|
||||
use Espo\ORM\EntityManager;
|
||||
@@ -43,6 +43,10 @@ use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Entities\User;
|
||||
use Espo\Entities\Notification;
|
||||
use Espo\Entities\Email as EmailEntity;
|
||||
|
||||
use Espo\Repositories\Email as EmailRepository;
|
||||
use Espo\Repositories\EmailAddress as EmailAddressRepository;
|
||||
|
||||
use DateTime;
|
||||
use Exception;
|
||||
@@ -51,13 +55,13 @@ class Email implements AssignmentNotificator
|
||||
{
|
||||
private const DAYS_THRESHOLD = 2;
|
||||
|
||||
private $streamService = null;
|
||||
private ?StreamService $streamService = null;
|
||||
|
||||
private $user;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
private $serviceFactory;
|
||||
private $injectableFactory;
|
||||
|
||||
private $aclManager;
|
||||
|
||||
@@ -67,19 +71,30 @@ class Email implements AssignmentNotificator
|
||||
User $user,
|
||||
EntityManager $entityManager,
|
||||
UserEnabledChecker $userChecker,
|
||||
ServiceFactory $serviceFactory,
|
||||
InjectableFactory $injectableFactory,
|
||||
AclManager $aclManager
|
||||
) {
|
||||
$this->user = $user;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->userChecker = $userChecker;
|
||||
$this->serviceFactory = $serviceFactory;
|
||||
$this->injectableFactory = $injectableFactory;
|
||||
$this->aclManager = $aclManager;
|
||||
}
|
||||
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
if (!in_array($entity->get('status'), ['Archived', 'Sent', 'Being Imported'])) {
|
||||
/** @var EmailEntity $entity */
|
||||
|
||||
if (
|
||||
!in_array(
|
||||
$entity->get('status'),
|
||||
[
|
||||
EmailEntity::STATUS_ARCHIVED,
|
||||
EmailEntity::STATUS_SENT,
|
||||
EmailEntity::STATUS_BEING_IMPORTED,
|
||||
]
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -107,10 +122,6 @@ class Email implements AssignmentNotificator
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$dt) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($dt->diff(new DateTime())->days > self::DAYS_THRESHOLD) {
|
||||
return;
|
||||
}
|
||||
@@ -138,12 +149,17 @@ class Email implements AssignmentNotificator
|
||||
'emailName' => $entity->get('name'),
|
||||
];
|
||||
|
||||
/** @var EmailRepository $emailRepository */
|
||||
$emailRepository = $this->entityManager->getRepository('Email');
|
||||
/** @var EmailAddressRepository $emailAddressRepository */
|
||||
$emailAddressRepository = $this->entityManager->getRepository('EmailAddress');
|
||||
|
||||
if (!$entity->has('from')) {
|
||||
$this->entityManager->getRepository('Email')->loadFromField($entity);
|
||||
$emailRepository->loadFromField($entity);
|
||||
}
|
||||
|
||||
if (!$entity->has('to')) {
|
||||
$this->entityManager->getRepository('Email')->loadToField($entity);
|
||||
$emailRepository->loadToField($entity);
|
||||
}
|
||||
|
||||
$person = null;
|
||||
@@ -151,9 +167,7 @@ class Email implements AssignmentNotificator
|
||||
$from = $entity->get('from');
|
||||
|
||||
if ($from) {
|
||||
$person = $this->entityManager
|
||||
->getRepository('EmailAddress')
|
||||
->getEntityByAddress($from, null, ['User', 'Contact', 'Lead']);
|
||||
$person = $emailAddressRepository->getEntityByAddress($from, null, ['User', 'Contact', 'Lead']);
|
||||
|
||||
if ($person) {
|
||||
$data['personEntityType'] = $person->getEntityType();
|
||||
@@ -165,7 +179,7 @@ class Email implements AssignmentNotificator
|
||||
$userIdFrom = null;
|
||||
|
||||
if ($person && $person->getEntityType() === 'User') {
|
||||
$userIdFrom = $person->id;
|
||||
$userIdFrom = $person->getId();
|
||||
}
|
||||
|
||||
if (empty($data['personEntityId'])) {
|
||||
@@ -178,14 +192,19 @@ class Email implements AssignmentNotificator
|
||||
|
||||
$parent = null;
|
||||
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$parent = $this->entityManager->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
$parentId = $entity->get('parentId');
|
||||
$parentType = $entity->get('parentType');
|
||||
|
||||
if ($parentType && $parentId) {
|
||||
$parent = $this->entityManager->getEntityById($parentType, $parentId);
|
||||
}
|
||||
|
||||
$account = null;
|
||||
|
||||
if ($entity->get('accountId')) {
|
||||
$account = $this->entityManager->getEntity('Account', $entity->get('accountId'));
|
||||
$accountId = $entity->get('accountId');
|
||||
|
||||
if ($accountId) {
|
||||
$account = $this->entityManager->getEntityById('Account', $accountId);
|
||||
}
|
||||
|
||||
foreach ($userIdList as $userId) {
|
||||
@@ -214,7 +233,7 @@ class Email implements AssignmentNotificator
|
||||
if ($folderId) {
|
||||
if (
|
||||
$this->entityManager
|
||||
->getRepository('EmailFolder')
|
||||
->getRDBRepository('EmailFolder')
|
||||
->where([
|
||||
'id' => $folderId,
|
||||
'skipNotifications' => true,
|
||||
@@ -226,6 +245,7 @@ class Email implements AssignmentNotificator
|
||||
}
|
||||
}
|
||||
|
||||
/** @var User|null $user */
|
||||
$user = $this->entityManager->getEntity('User', $userId);
|
||||
|
||||
if (!$user) {
|
||||
@@ -241,7 +261,7 @@ class Email implements AssignmentNotificator
|
||||
}
|
||||
|
||||
$isArchivedOrBeingImported =
|
||||
$entity->get('status') === 'Archived' ||
|
||||
$entity->get('status') === EmailEntity::STATUS_ARCHIVED ||
|
||||
$params->getOption('isBeingImported');
|
||||
|
||||
if (
|
||||
@@ -261,7 +281,7 @@ class Email implements AssignmentNotificator
|
||||
}
|
||||
|
||||
$existing = $this->entityManager
|
||||
->getRepository(Notification::ENTITY_TYPE)
|
||||
->getRDBRepository(Notification::ENTITY_TYPE)
|
||||
->where([
|
||||
'type' => Notification::TYPE_EMAIL_RECEIVED,
|
||||
'userId' => $userId,
|
||||
@@ -288,7 +308,7 @@ class Email implements AssignmentNotificator
|
||||
private function getStreamService(): StreamService
|
||||
{
|
||||
if (empty($this->streamService)) {
|
||||
$this->streamService = $this->serviceFactory->create('Stream');
|
||||
$this->streamService = $this->injectableFactory->create(StreamService::class);
|
||||
}
|
||||
|
||||
return $this->streamService;
|
||||
|
||||
73
application/Espo/Classes/Cleanup/Exports.php
Normal file
73
application/Espo/Classes/Cleanup/Exports.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\Cleanup;
|
||||
|
||||
use Espo\Core\Cleanup\Cleanup;
|
||||
use Espo\Core\Utils\Config;
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use Espo\Core\Field\DateTime;
|
||||
|
||||
use Espo\Entities\Export;
|
||||
|
||||
class Exports implements Cleanup
|
||||
{
|
||||
private $config;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
private string $cleanupPeriod = '2 days';
|
||||
|
||||
public function __construct(Config $config, EntityManager $entityManager)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function process(): void
|
||||
{
|
||||
$period = '-' . $this->config->get('cleanupExportsPeriod', $this->cleanupPeriod);
|
||||
|
||||
$before = DateTime::createNow()
|
||||
->modify($period)
|
||||
->getString();
|
||||
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from(Export::ENTITY_TYPE)
|
||||
->where([
|
||||
'createdAt<' => $before,
|
||||
])
|
||||
->build();
|
||||
|
||||
$this->entityManager->getQueryExecutor()->execute($delete);
|
||||
}
|
||||
}
|
||||
71
application/Espo/Classes/Cleanup/MassActions.php
Normal file
71
application/Espo/Classes/Cleanup/MassActions.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\Cleanup;
|
||||
|
||||
use Espo\Core\Cleanup\Cleanup;
|
||||
use Espo\Core\Utils\Config;
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use Espo\Core\Field\DateTime;
|
||||
|
||||
class MassActions implements Cleanup
|
||||
{
|
||||
private $config;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
private string $cleanupPeriod = '14 days';
|
||||
|
||||
public function __construct(Config $config, EntityManager $entityManager)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function process(): void
|
||||
{
|
||||
$period = '-' . $this->config->get('cleanupMassActionsPeriod', $this->cleanupPeriod);
|
||||
|
||||
$before = DateTime::createNow()
|
||||
->modify($period)
|
||||
->getString();
|
||||
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from('MassAction')
|
||||
->where([
|
||||
'createdAt<' => $before,
|
||||
])
|
||||
->build();
|
||||
|
||||
$this->entityManager->getQueryExecutor()->execute($delete);
|
||||
}
|
||||
}
|
||||
73
application/Espo/Classes/Cleanup/PasswordChangeRequests.php
Normal file
73
application/Espo/Classes/Cleanup/PasswordChangeRequests.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\Cleanup;
|
||||
|
||||
use Espo\Core\Cleanup\Cleanup;
|
||||
use Espo\Core\Utils\Config;
|
||||
use Espo\Core\Field\DateTime;
|
||||
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use Espo\Entities\PasswordChangeRequest;
|
||||
|
||||
class PasswordChangeRequests implements Cleanup
|
||||
{
|
||||
private Config $config;
|
||||
|
||||
private EntityManager $entityManager;
|
||||
|
||||
private string $cleanupPeriod = '30 days';
|
||||
|
||||
public function __construct(Config $config, EntityManager $entityManager)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function process(): void
|
||||
{
|
||||
$period = '-' . $this->config->get('cleanupPasswordChangeRequestsPeriod', $this->cleanupPeriod);
|
||||
|
||||
$before = DateTime::createNow()
|
||||
->modify($period)
|
||||
->getString();
|
||||
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from(PasswordChangeRequest::ENTITY_TYPE)
|
||||
->where([
|
||||
'createdAt<' => $before,
|
||||
])
|
||||
->build();
|
||||
|
||||
$this->entityManager->getQueryExecutor()->execute($delete);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -41,7 +41,7 @@ class Reminders implements Cleanup
|
||||
|
||||
private $entityManager;
|
||||
|
||||
private $cleanupRemindersPeriod = '15 days';
|
||||
private string $cleanupRemindersPeriod = '15 days';
|
||||
|
||||
public function __construct(Config $config, EntityManager $entityManager)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,7 +37,7 @@ use DateTime;
|
||||
|
||||
class WebhookQueue implements Cleanup
|
||||
{
|
||||
private $cleanupWebhookQueuePeriod = '10 days';
|
||||
private string $cleanupWebhookQueuePeriod = '10 days';
|
||||
|
||||
private $config;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,6 +31,8 @@ namespace Espo\Classes\ConsoleCommands;
|
||||
|
||||
use Espo\Tools\Import\Service;
|
||||
|
||||
use Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
use Espo\Core\{
|
||||
Console\Command,
|
||||
Console\Command\Params,
|
||||
@@ -41,11 +43,14 @@ use Throwable;
|
||||
|
||||
class Import implements Command
|
||||
{
|
||||
private $service;
|
||||
private Service $service;
|
||||
|
||||
public function __construct(Service $service)
|
||||
private FileManager $fileManager;
|
||||
|
||||
public function __construct(Service $service, FileManager $fileManager)
|
||||
{
|
||||
$this->service = $service;
|
||||
$this->fileManager = $fileManager;
|
||||
}
|
||||
|
||||
public function run(Params $params, IO $io) : void
|
||||
@@ -64,13 +69,13 @@ class Import implements Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (!file_exists($filePath)) {
|
||||
if (!$this->fileManager->isFile($filePath)) {
|
||||
$io->writeLine("File not found.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$contents = file_get_contents($filePath);
|
||||
$contents = $this->fileManager->getContents($filePath);
|
||||
|
||||
try {
|
||||
$result = $this->service->importContentsWithParamsId($contents, $paramsId);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -33,32 +33,32 @@ use Espo\Core\Utils\Metadata;
|
||||
|
||||
class DefaultSidePanelType
|
||||
{
|
||||
protected $metadata;
|
||||
private $metadata;
|
||||
|
||||
public function __construct(Metadata $metadata)
|
||||
{
|
||||
$this->metadata = $metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \stdClass[]
|
||||
*/
|
||||
public function get(string $scope): array
|
||||
{
|
||||
$list = [];
|
||||
|
||||
if (
|
||||
$this->metadata->get(['entityDefs', $scope, 'fields', 'assignedUser', 'type']) === 'link'
|
||||
&&
|
||||
$this->metadata->get(['entityDefs', $scope, 'fields', 'assignedUser', 'type']) === 'link' &&
|
||||
$this->metadata->get(['entityDefs', $scope, 'links', 'assignedUser', 'entity']) === 'User'
|
||||
||
|
||||
$this->metadata->get(['entityDefs', $scope, 'fields', 'assignedUsers', 'type']) === 'linkMultiple'
|
||||
&&
|
||||
$this->metadata->get(['entityDefs', $scope, 'fields', 'assignedUsers', 'type']) === 'linkMultiple' &&
|
||||
$this->metadata->get(['entityDefs', $scope, 'links', 'assignedUsers', 'entity']) === 'User'
|
||||
) {
|
||||
$list[] = (object) ['name' => ':assignedUser'];
|
||||
}
|
||||
|
||||
if (
|
||||
$this->metadata->get(['entityDefs', $scope, 'fields', 'teams', 'type']) === 'linkMultiple'
|
||||
&&
|
||||
$this->metadata->get(['entityDefs', $scope, 'fields', 'teams', 'type']) === 'linkMultiple' &&
|
||||
$this->metadata->get(['entityDefs', $scope, 'links', 'teams', 'entity']) === 'Team'
|
||||
) {
|
||||
$list[] = (object) ['name' => 'teams'];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,6 +30,8 @@
|
||||
namespace Espo\Classes\DuplicateWhereBuilders;
|
||||
|
||||
use Espo\Core\Duplicate\WhereBuilder;
|
||||
use Espo\Core\Field\EmailAddressGroup;
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\ORM\{
|
||||
Query\Part\Condition as Cond,
|
||||
@@ -38,10 +40,15 @@ use Espo\ORM\{
|
||||
Entity,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements WhereBuilder<CoreEntity>
|
||||
*/
|
||||
class Company implements WhereBuilder
|
||||
{
|
||||
public function build(Entity $entity): ?WhereItem
|
||||
{
|
||||
assert($entity instanceof CoreEntity);
|
||||
|
||||
$orBuilder = OrGroup::createBuilder();
|
||||
|
||||
$toCheck = false;
|
||||
@@ -84,10 +91,13 @@ class Company implements WhereBuilder
|
||||
return $orBuilder->build();
|
||||
}
|
||||
|
||||
private function getEmailAddressList(Entity $entity): array
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
private function getEmailAddressList(CoreEntity $entity): array
|
||||
{
|
||||
if ($entity->get('emailAddressData')) {
|
||||
/* @var $eaGroup EmailAddressGroup */
|
||||
/** @var EmailAddressGroup $eaGroup */
|
||||
$eaGroup = $entity->getValueObject('emailAddress');
|
||||
|
||||
return $eaGroup->getAddressList();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
namespace Espo\Classes\DuplicateWhereBuilders;
|
||||
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\Core\{
|
||||
Duplicate\WhereBuilder,
|
||||
Field\EmailAddressGroup,
|
||||
@@ -41,10 +43,15 @@ use Espo\ORM\{
|
||||
Entity,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements WhereBuilder<CoreEntity>
|
||||
*/
|
||||
class Person implements WhereBuilder
|
||||
{
|
||||
public function build(Entity $entity): ?WhereItem
|
||||
{
|
||||
assert($entity instanceof CoreEntity);
|
||||
|
||||
$orBuilder = OrGroup::createBuilder();
|
||||
|
||||
$toCheck = false;
|
||||
@@ -93,10 +100,13 @@ class Person implements WhereBuilder
|
||||
return $orBuilder->build();
|
||||
}
|
||||
|
||||
private function getEmailAddressList(Entity $entity): array
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
private function getEmailAddressList(CoreEntity $entity): array
|
||||
{
|
||||
if ($entity->get('emailAddressData')) {
|
||||
/* @var $eaGroup EmailAddressGroup */
|
||||
/** @var EmailAddressGroup $eaGroup */
|
||||
$eaGroup = $entity->getValueObject('emailAddress');
|
||||
|
||||
return $eaGroup->getAddressList();
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\FieldDuplicators;
|
||||
|
||||
use Espo\Core\Record\Duplicator\FieldDuplicator;
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use Espo\Repositories\Attachment as AttachmentRepository;
|
||||
use Espo\Entities\Attachment;
|
||||
|
||||
use stdClass;
|
||||
|
||||
class AttachmentMultiple implements FieldDuplicator
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
public function __construct(EntityManager $entityManager)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function duplicate(Entity $entity, string $field): stdClass
|
||||
{
|
||||
$valueMap = (object) [];
|
||||
|
||||
/** @var \Espo\ORM\Collection<Attachment> $attachmentList */
|
||||
$attachmentList = $this->entityManager
|
||||
->getRDBRepository($entity->getEntityType())
|
||||
->getRelation($entity, $field)
|
||||
->find();
|
||||
|
||||
if (is_countable($attachmentList) && !count($attachmentList)) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
$idList = [];
|
||||
$nameHash = (object) [];
|
||||
$typeHash = (object) [];
|
||||
|
||||
/** @var AttachmentRepository $attachmentRepository */
|
||||
$attachmentRepository = $this->entityManager->getRepository(Attachment::ENTITY_TYPE);
|
||||
|
||||
foreach ($attachmentList as $attachment) {
|
||||
$copiedAttachment = $attachmentRepository->getCopiedAttachment($attachment);
|
||||
|
||||
$copiedAttachment->set('field', $field);
|
||||
|
||||
$this->entityManager->saveEntity($copiedAttachment);
|
||||
|
||||
$idList[] = $copiedAttachment->getId();
|
||||
|
||||
$nameHash->{$copiedAttachment->getId()} = $copiedAttachment->getName();
|
||||
$typeHash->{$copiedAttachment->getId()} = $copiedAttachment->getType();
|
||||
}
|
||||
|
||||
$valueMap->{$field . 'Ids'} = $idList;
|
||||
$valueMap->{$field . 'Names'} = $nameHash;
|
||||
$valueMap->{$field . 'Types'} = $typeHash;
|
||||
|
||||
return $valueMap;
|
||||
}
|
||||
}
|
||||
75
application/Espo/Classes/FieldDuplicators/File.php
Normal file
75
application/Espo/Classes/FieldDuplicators/File.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\FieldDuplicators;
|
||||
|
||||
use Espo\Core\Record\Duplicator\FieldDuplicator;
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use Espo\Repositories\Attachment as AttachmentRepository;
|
||||
use Espo\Entities\Attachment;
|
||||
|
||||
use stdClass;
|
||||
|
||||
class File implements FieldDuplicator
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
public function __construct(EntityManager $entityManager)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function duplicate(Entity $entity, string $field): stdClass
|
||||
{
|
||||
$valueMap = (object) [];
|
||||
|
||||
/** @var Attachment|null $attachment */
|
||||
$attachment = $this->entityManager
|
||||
->getRDBRepository($entity->getEntityType())
|
||||
->getRelation($entity, $field)
|
||||
->findOne();
|
||||
|
||||
if (!$attachment) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
/** @var AttachmentRepository $attachmentRepository */
|
||||
$attachmentRepository = $this->entityManager->getRepository(Attachment::ENTITY_TYPE);
|
||||
|
||||
$copiedAttachment = $attachmentRepository->getCopiedAttachment($attachment);
|
||||
|
||||
$idAttribute = $field . 'Id';
|
||||
|
||||
$valueMap->$idAttribute = $copiedAttachment->getId();
|
||||
|
||||
return $valueMap;
|
||||
}
|
||||
}
|
||||
82
application/Espo/Classes/FieldDuplicators/LinkMultiple.php
Normal file
82
application/Espo/Classes/FieldDuplicators/LinkMultiple.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\FieldDuplicators;
|
||||
|
||||
use Espo\Core\Record\Duplicator\FieldDuplicator;
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use stdClass;
|
||||
|
||||
class LinkMultiple implements FieldDuplicator
|
||||
{
|
||||
private EntityManager $entityManager;
|
||||
|
||||
public function __construct(EntityManager $entityManager)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function duplicate(Entity $entity, string $field): stdClass
|
||||
{
|
||||
$valueMap = (object) [];
|
||||
|
||||
$entityDefs = $this->entityManager
|
||||
->getDefs()
|
||||
->getEntity($entity->getEntityType());
|
||||
|
||||
if (!$entity->hasRelation($field)) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
$relationDefs = $entityDefs->getRelation($field);
|
||||
|
||||
if (
|
||||
!$relationDefs->hasForeignEntityType() ||
|
||||
!$relationDefs->hasForeignRelationName()
|
||||
) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
$foreignRelationType = $this->entityManager
|
||||
->getDefs()
|
||||
->getEntity($relationDefs->getForeignEntityType())
|
||||
->getRelation($relationDefs->getForeignRelationName())
|
||||
->getType();
|
||||
|
||||
if ($foreignRelationType !== Entity::HAS_MANY) {
|
||||
$valueMap->{$field . 'Ids'} = [];
|
||||
$valueMap->{$field . 'Names'} = (object) [];
|
||||
$valueMap->{$field . 'Columns'} = (object) [];
|
||||
}
|
||||
|
||||
return $valueMap;
|
||||
}
|
||||
}
|
||||
117
application/Espo/Classes/FieldDuplicators/Wysiwyg.php
Normal file
117
application/Espo/Classes/FieldDuplicators/Wysiwyg.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\FieldDuplicators;
|
||||
|
||||
use Espo\Core\Record\Duplicator\FieldDuplicator;
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\ORM\EntityManager;
|
||||
|
||||
use Espo\Repositories\Attachment as AttachmentRepository;
|
||||
use Espo\Entities\Attachment;
|
||||
|
||||
use stdClass;
|
||||
|
||||
class Wysiwyg implements FieldDuplicator
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
public function __construct(EntityManager $entityManager)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function duplicate(Entity $entity, string $field): stdClass
|
||||
{
|
||||
$valueMap = (object) [];
|
||||
|
||||
$contents = $entity->get($field);
|
||||
|
||||
if (!$contents) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
$matches = [];
|
||||
|
||||
$matchResult = preg_match_all("/\?entryPoint=attachment&id=([^&=\"']+)/", $contents, $matches);
|
||||
|
||||
if (
|
||||
!$matchResult ||
|
||||
empty($matches[1]) ||
|
||||
!is_array($matches[1])
|
||||
) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
$attachmentIdList = $matches[1];
|
||||
|
||||
/** @var Attachment[] $attachmentList */
|
||||
$attachmentList = [];
|
||||
|
||||
foreach ($attachmentIdList as $id) {
|
||||
/** @var Attachment|null $attachment */
|
||||
$attachment = $this->entityManager->getEntity(Attachment::ENTITY_TYPE, $id);
|
||||
|
||||
if (!$attachment) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$attachmentList[] = $attachment;
|
||||
}
|
||||
|
||||
if (!count($attachmentList)) {
|
||||
return $valueMap;
|
||||
}
|
||||
|
||||
/** @var AttachmentRepository $attachmentRepository */
|
||||
$attachmentRepository = $this->entityManager->getRepository(Attachment::ENTITY_TYPE);
|
||||
|
||||
foreach ($attachmentList as $attachment) {
|
||||
$copiedAttachment = $attachmentRepository->getCopiedAttachment($attachment);
|
||||
|
||||
$copiedAttachment->set([
|
||||
'relatedId' => null,
|
||||
'relatedType' => $entity->getEntityType(),
|
||||
'field' => $field,
|
||||
]);
|
||||
|
||||
$this->entityManager->saveEntity($copiedAttachment);
|
||||
|
||||
$contents = str_replace(
|
||||
'?entryPoint=attachment&id=' . $attachment->getId(),
|
||||
'?entryPoint=attachment&id=' . $copiedAttachment->getId(),
|
||||
$contents
|
||||
);
|
||||
}
|
||||
|
||||
$valueMap->$field = $contents;
|
||||
|
||||
return $valueMap;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -39,6 +39,9 @@ use Espo\Core\{
|
||||
|
||||
use Espo\Repositories\Email as EmailRepository;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Email>
|
||||
*/
|
||||
class AddressDataLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
@@ -50,7 +53,7 @@ class AddressDataLoader implements Loader
|
||||
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
/* @var $repository EmailRepository */
|
||||
/** @var EmailRepository $repository */
|
||||
$repository = $this->entityManager->getRepository('Email');
|
||||
|
||||
$repository->loadFromField($entity);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -47,13 +47,20 @@ use ICal\ICal;
|
||||
use ICal\Event;
|
||||
|
||||
use Throwable;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Email>
|
||||
*/
|
||||
class IcsDataLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
private $log;
|
||||
|
||||
/**
|
||||
* @var array<string,string>
|
||||
*/
|
||||
private $entityTypeLinkMap = [
|
||||
'User' => 'users',
|
||||
'Contact' => 'contacts',
|
||||
@@ -114,7 +121,7 @@ class IcsDataLoader implements Loader
|
||||
return;
|
||||
}
|
||||
|
||||
/* @var $emailAddressRepository EmailAddressRepository */
|
||||
/** @var EmailAddressRepository $emailAddressRepository */
|
||||
$emailAddressRepository = $this->entityManager->getRepository(EmailAddress::ENTITY_TYPE);
|
||||
|
||||
$attendeeEmailAddressList = $espoEvent->getAttendeeEmailAddressList();
|
||||
@@ -168,7 +175,7 @@ class IcsDataLoader implements Loader
|
||||
}
|
||||
}
|
||||
|
||||
private function loadCreatedEvent(Entity $entity, EspoEvent $espoEvent, object $eventData): void
|
||||
private function loadCreatedEvent(Entity $entity, EspoEvent $espoEvent, stdClass $eventData): void
|
||||
{
|
||||
$emailSameEvent = $this->entityManager
|
||||
->getRDBRepository(Email::ENTITY_TYPE)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,6 +31,8 @@ namespace Espo\Classes\FieldProcessing\Email;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Repositories\EmailAddress as EmailAddressRepository;
|
||||
|
||||
use Espo\Core\{
|
||||
FieldProcessing\Loader,
|
||||
FieldProcessing\Loader\Params,
|
||||
@@ -40,12 +42,18 @@ use Espo\Core\{
|
||||
use Espo\Entities\Email;
|
||||
use Espo\Entities\User;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Email>
|
||||
*/
|
||||
class StringDataLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @var array<string,string>
|
||||
*/
|
||||
private $fromEmailAddressNameCache = [];
|
||||
|
||||
public function __construct(EntityManager $entityManager, User $user)
|
||||
@@ -56,6 +64,8 @@ class StringDataLoader implements Loader
|
||||
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
/** @var Email $entity */
|
||||
|
||||
$userEmailAdddressIdList = [];
|
||||
|
||||
$emailAddressCollection = $this->entityManager
|
||||
@@ -84,9 +94,7 @@ class StringDataLoader implements Loader
|
||||
$list = [];
|
||||
|
||||
foreach ($idList as $emailAddressId) {
|
||||
$person = $this->entityManager
|
||||
->getRepository('EmailAddress')
|
||||
->getEntityByAddressId($emailAddressId, null, true);
|
||||
$person = $this->getEmailAddressRepository()->getEntityByAddressId($emailAddressId, null, true);
|
||||
|
||||
$list[] = $person ? $person->get('name') : $names->$emailAddressId;
|
||||
}
|
||||
@@ -96,6 +104,7 @@ class StringDataLoader implements Loader
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var ?string */
|
||||
$fromEmailAddressId = $entity->get('fromEmailAddressId');
|
||||
|
||||
if (!$fromEmailAddressId) {
|
||||
@@ -103,9 +112,7 @@ class StringDataLoader implements Loader
|
||||
}
|
||||
|
||||
if (!array_key_exists($fromEmailAddressId, $this->fromEmailAddressNameCache)) {
|
||||
$person = $this->entityManager
|
||||
->getRepository('EmailAddress')
|
||||
->getEntityByAddressId($fromEmailAddressId, null, true);
|
||||
$person = $this->getEmailAddressRepository()->getEntityByAddressId($fromEmailAddressId, null, true);
|
||||
|
||||
$fromName = $person ? $person->get('name') : null;
|
||||
|
||||
@@ -119,4 +126,10 @@ class StringDataLoader implements Loader
|
||||
|
||||
$entity->set('personStringData', $fromName);
|
||||
}
|
||||
|
||||
private function getEmailAddressRepository(): EmailAddressRepository
|
||||
{
|
||||
/** @var EmailAddressRepository */
|
||||
return $this->entityManager->getRepository('EmailAddress');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -39,6 +39,9 @@ use Espo\Core\{
|
||||
|
||||
use Espo\Entities\User;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Email>
|
||||
*/
|
||||
class UserColumnsLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
@@ -54,7 +57,7 @@ class UserColumnsLoader implements Loader
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
$emailUser = $this->entityManager
|
||||
->getRepository('EmailUser')
|
||||
->getRDBRepository('EmailUser')
|
||||
->select(['isRead', 'isImportant', 'inTrash'])
|
||||
->where([
|
||||
'deleted' => false,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -39,6 +39,9 @@ use Espo\Core\{
|
||||
|
||||
use Espo\Repositories\Import as ImportRepository;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Import>
|
||||
*/
|
||||
class CountsLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
@@ -50,7 +53,7 @@ class CountsLoader implements Loader
|
||||
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
/* @var $repository ImportRepository */
|
||||
/** @var ImportRepository $repository */
|
||||
$repository = $this->entityManager->getRepository('Import');
|
||||
|
||||
$importedCount = $repository->countResultRecords($entity, 'imported');
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -38,11 +38,14 @@ use Espo\Core\{
|
||||
|
||||
use Espo\Entities\Note;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Note>
|
||||
*/
|
||||
class AttachmentsLoader implements Loader
|
||||
{
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
/* @var $entity Note */
|
||||
/** @var Note $entity */
|
||||
$entity->loadAttachments();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,12 +31,18 @@ namespace Espo\Classes\FieldProcessing\Portal;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Repositories\Portal as PortalRepository;
|
||||
use Espo\Entities\Portal;
|
||||
|
||||
use Espo\Core\{
|
||||
FieldProcessing\Loader,
|
||||
FieldProcessing\Loader\Params,
|
||||
ORM\EntityManager,
|
||||
};
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\Portal>
|
||||
*/
|
||||
class UrlLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
@@ -48,8 +54,14 @@ class UrlLoader implements Loader
|
||||
|
||||
public function process(Entity $entity, Params $params): void
|
||||
{
|
||||
$this->entityManager
|
||||
->getRepository('Portal')
|
||||
->loadUrlField($entity);
|
||||
/** @var Portal $entity */
|
||||
|
||||
$this->getPortalRepository()->loadUrlField($entity);
|
||||
}
|
||||
|
||||
private function getPortalRepository(): PortalRepository
|
||||
{
|
||||
/** @var PortalRepository */
|
||||
return $this->entityManager->getRepository('Portal');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -42,6 +42,9 @@ use Espo\Core\{
|
||||
use DateTime;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* @implements Loader<\Espo\Entities\User>
|
||||
*/
|
||||
class LastAccessLoader implements Loader
|
||||
{
|
||||
private $entityManager;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii 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\Classes\FieldValidators\Email;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
class EmailAddresses
|
||||
{
|
||||
public function checkRequired(Entity $entity, string $field): bool
|
||||
{
|
||||
if ($entity->get('status') === 'Draft') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->isNotEmpty($entity, $field);
|
||||
}
|
||||
|
||||
private function isNotEmpty(Entity $entity, string $field): bool
|
||||
{
|
||||
return $entity->has($field) && $entity->get($field) !== '' && $entity->get($field) !== null;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -38,6 +38,9 @@ class IntType
|
||||
return $this->isNotEmpty($entity, $field);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $validationValue
|
||||
*/
|
||||
public function checkMax(Entity $entity, string $field, $validationValue): bool
|
||||
{
|
||||
if (!$this->isNotEmpty($entity, $field)) {
|
||||
@@ -51,6 +54,9 @@ class IntType
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $validationValue
|
||||
*/
|
||||
public function checkMin(Entity $entity, string $field, $validationValue): bool
|
||||
{
|
||||
if (!$this->isNotEmpty($entity, $field)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,11 +30,19 @@
|
||||
namespace Espo\Classes\FieldValidators;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
class LinkMultipleType
|
||||
{
|
||||
public function checkRequired(Entity $entity, string $field): bool
|
||||
{
|
||||
return count($entity->getLinkMultipleIdList($field)) > 0;
|
||||
if (!$entity instanceof CoreEntity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var string[] */
|
||||
$idList = $entity->getLinkMultipleIdList($field);
|
||||
|
||||
return count($idList) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -93,7 +93,7 @@ class CheckEmailAccounts implements Preparator
|
||||
continue;
|
||||
}
|
||||
|
||||
$jobEntity = $this->entityManager->getEntity(JobEntity::ENTITY_TYPE);
|
||||
$jobEntity = $this->entityManager->getNewEntity(JobEntity::ENTITY_TYPE);
|
||||
|
||||
$jobEntity->set([
|
||||
'name' => $data->getName(),
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -91,7 +91,7 @@ class CheckInboundEmails implements Preparator
|
||||
continue;
|
||||
}
|
||||
|
||||
$jobEntity = $this->entityManager->getEntity(JobEntity::ENTITY_TYPE);
|
||||
$jobEntity = $this->entityManager->getNewEntity(JobEntity::ENTITY_TYPE);
|
||||
|
||||
$jobEntity->set([
|
||||
'name' => $data->getName(),
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -83,7 +83,7 @@ class AuthTokenControl implements JobDataLess
|
||||
}
|
||||
|
||||
$tokenList = $this->entityManager
|
||||
->getRepository('AuthToken')
|
||||
->getRDBRepository('AuthToken')
|
||||
->where($whereClause)
|
||||
->limit(0, 500)
|
||||
->find();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,13 +31,9 @@ namespace Espo\Classes\Jobs;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
use Espo\Services\EmailAccount as Service;
|
||||
|
||||
use Espo\Core\{
|
||||
Job\Job,
|
||||
Job\Job\Data,
|
||||
ORM\EntityManager,
|
||||
};
|
||||
use Espo\Core\Mail\Account\PersonalAccount\Service;
|
||||
use Espo\Core\Job\Job;
|
||||
use Espo\Core\Job\Job\Data;
|
||||
|
||||
use Throwable;
|
||||
|
||||
@@ -45,12 +41,9 @@ class CheckEmailAccounts implements Job
|
||||
{
|
||||
private $service;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
public function __construct(Service $service, EntityManager $entityManager)
|
||||
public function __construct(Service $service)
|
||||
{
|
||||
$this->service = $service;
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function run(Data $data): void
|
||||
@@ -61,22 +54,12 @@ class CheckEmailAccounts implements Job
|
||||
throw new Error("No target.");
|
||||
}
|
||||
|
||||
$entity = $this->entityManager->getEntity('EmailAccount', $targetId);
|
||||
|
||||
if (!$entity) {
|
||||
throw new Error("Job CheckEmailAccounts '{$targetId}': EmailAccount does not exist.", -1);
|
||||
}
|
||||
|
||||
if ($entity->get('status') !== 'Active') {
|
||||
throw new Error("Job CheckEmailAccounts '{$targetId}': EmailAccount is not active.", -1);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->service->fetchFromMailServer($entity);
|
||||
$this->service->fetch($targetId);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
throw new Error(
|
||||
'Job CheckEmailAccounts ' . $entity->getId() . ': [' . $e->getCode() . '] ' .$e->getMessage()
|
||||
'Job CheckEmailAccounts ' . $targetId . ': [' . $e->getCode() . '] ' .$e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,14 +30,9 @@
|
||||
namespace Espo\Classes\Jobs;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
use Espo\Services\InboundEmail as Service;
|
||||
|
||||
use Espo\Core\{
|
||||
Job\Job,
|
||||
Job\Job\Data,
|
||||
ORM\EntityManager,
|
||||
};
|
||||
use Espo\Core\Mail\Account\GroupAccount\Service;
|
||||
use Espo\Core\Job\Job;
|
||||
use Espo\Core\Job\Job\Data;
|
||||
|
||||
use Throwable;
|
||||
|
||||
@@ -45,12 +40,9 @@ class CheckInboundEmails implements Job
|
||||
{
|
||||
private $service;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
public function __construct(Service $service, EntityManager $entityManager)
|
||||
public function __construct(Service $service)
|
||||
{
|
||||
$this->service = $service;
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function run(Data $data): void
|
||||
@@ -61,22 +53,12 @@ class CheckInboundEmails implements Job
|
||||
throw new Error("No target.");
|
||||
}
|
||||
|
||||
$entity = $this->entityManager->getEntity('InboundEmail', $targetId);
|
||||
|
||||
if (!$entity) {
|
||||
throw new Error("Job CheckInboundEmails '{$targetId}': InboundEmail does not exist.", -1);
|
||||
}
|
||||
|
||||
if ($entity->get('status') !== 'Active') {
|
||||
throw new Error("Job CheckInboundEmails '{$targetId}': InboundEmail is not active.", -1);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->service->fetchFromMailServer($entity);
|
||||
$this->service->fetch($targetId);
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
throw new Error(
|
||||
'Job CheckInboundEmails ' . $entity->getId() . ': [' . $e->getCode() . '] ' .$e->getMessage()
|
||||
'Job CheckInboundEmails ' . $targetId . ': [' . $e->getCode() . '] ' .$e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,7 +40,8 @@ class CheckNewExtensionVersion extends CheckNewVersion
|
||||
return;
|
||||
}
|
||||
|
||||
$job = $this->entityManager->getEntity('Job');
|
||||
$job = $this->entityManager->getNewEntity('Job');
|
||||
|
||||
$job->set([
|
||||
'name' => 'Check for new versions of installed extensions (job)',
|
||||
'serviceName' => 'AdminNotifications',
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,8 +40,14 @@ use DateTimeZone;
|
||||
|
||||
class CheckNewVersion implements JobDataLess
|
||||
{
|
||||
/**
|
||||
* @var Config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var EntityManager
|
||||
*/
|
||||
protected $entityManager;
|
||||
|
||||
public function __construct(Config $config, EntityManager $entityManager)
|
||||
@@ -56,7 +62,7 @@ class CheckNewVersion implements JobDataLess
|
||||
return;
|
||||
}
|
||||
|
||||
$job = $this->entityManager->getEntity('Job');
|
||||
$job = $this->entityManager->getNewEntity('Job');
|
||||
|
||||
$job->set([
|
||||
'name' => 'Check for New Version (job)',
|
||||
@@ -70,7 +76,7 @@ class CheckNewVersion implements JobDataLess
|
||||
return;
|
||||
}
|
||||
|
||||
protected function getRunTime()
|
||||
protected function getRunTime(): string
|
||||
{
|
||||
$hour = rand(0, 4);
|
||||
$minute = rand(0, 59);
|
||||
@@ -93,7 +99,7 @@ class CheckNewVersion implements JobDataLess
|
||||
* For backward compatibility.
|
||||
* @deprecated
|
||||
*/
|
||||
protected function getEntityManager()
|
||||
protected function getEntityManager() /** @phpstan-ignore-line */
|
||||
{
|
||||
return $this->entityManager;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -30,6 +30,8 @@
|
||||
namespace Espo\Classes\Jobs;
|
||||
|
||||
use Espo\Core\Record\ServiceContainer;
|
||||
use Espo\ORM\Repository\RDBRepository;
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\Core\{
|
||||
Utils\Config,
|
||||
@@ -51,23 +53,23 @@ use Throwable;
|
||||
|
||||
class Cleanup implements JobDataLess
|
||||
{
|
||||
private $cleanupJobPeriod = '10 days';
|
||||
private string $cleanupJobPeriod = '10 days';
|
||||
|
||||
private $cleanupActionHistoryPeriod = '15 days';
|
||||
private string $cleanupActionHistoryPeriod = '15 days';
|
||||
|
||||
private $cleanupAuthTokenPeriod = '1 month';
|
||||
private string $cleanupAuthTokenPeriod = '1 month';
|
||||
|
||||
private $cleanupAuthLogPeriod = '2 months';
|
||||
private string $cleanupAuthLogPeriod = '2 months';
|
||||
|
||||
private $cleanupNotificationsPeriod = '2 months';
|
||||
private string $cleanupNotificationsPeriod = '2 months';
|
||||
|
||||
private $cleanupAttachmentsPeriod = '15 days';
|
||||
private string $cleanupAttachmentsPeriod = '15 days';
|
||||
|
||||
private $cleanupAttachmentsFromPeriod = '3 months';
|
||||
private string $cleanupAttachmentsFromPeriod = '3 months';
|
||||
|
||||
private $cleanupBackupPeriod = '2 month';
|
||||
private string $cleanupBackupPeriod = '2 month';
|
||||
|
||||
private $cleanupDeletedRecordsPeriod = '3 months';
|
||||
private string $cleanupDeletedRecordsPeriod = '3 months';
|
||||
|
||||
private $config;
|
||||
|
||||
@@ -132,9 +134,12 @@ class Cleanup implements JobDataLess
|
||||
|
||||
foreach ($items as $name => $item) {
|
||||
try {
|
||||
/** @var class-string<\Espo\Core\Cleanup\Cleanup> */
|
||||
$className = $item['className'];
|
||||
|
||||
$injectableFactory->create($className)->process();
|
||||
$obj = $injectableFactory->create($className);
|
||||
|
||||
$obj->process();
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
$this->log->error("Cleanup: {$name}: " . $e->getMessage());
|
||||
@@ -183,14 +188,16 @@ class Cleanup implements JobDataLess
|
||||
|
||||
private function cleanupScheduledJobLog(): void
|
||||
{
|
||||
$scheduledJobList = $this->entityManager->getRepository('ScheduledJob')
|
||||
$scheduledJobList = $this->entityManager
|
||||
->getRDBRepository('ScheduledJob')
|
||||
->select(['id'])
|
||||
->find();
|
||||
|
||||
foreach ($scheduledJobList as $scheduledJob) {
|
||||
$scheduledJobId = $scheduledJob->get('id');
|
||||
|
||||
$ignoreLogRecordList = $this->entityManager->getRepository('ScheduledJobLogRecord')
|
||||
$ignoreLogRecordList = $this->entityManager
|
||||
->getRDBRepository('ScheduledJobLogRecord')
|
||||
->select(['id'])
|
||||
->where([
|
||||
'scheduledJobId' => $scheduledJobId,
|
||||
@@ -199,11 +206,16 @@ class Cleanup implements JobDataLess
|
||||
->limit(0, 10)
|
||||
->find();
|
||||
|
||||
if (!is_countable($ignoreLogRecordList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!count($ignoreLogRecordList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ignoreIdList = [];
|
||||
|
||||
foreach ($ignoreLogRecordList as $logRecord) {
|
||||
$ignoreIdList[] = $logRecord->get('id');
|
||||
}
|
||||
@@ -300,7 +312,7 @@ class Cleanup implements JobDataLess
|
||||
$datetime->modify($period);
|
||||
|
||||
$collection = $this->entityManager
|
||||
->getRepository('Attachment')
|
||||
->getRDBRepository('Attachment')
|
||||
->where([
|
||||
'OR' => [
|
||||
[
|
||||
@@ -329,7 +341,7 @@ class Cleanup implements JobDataLess
|
||||
]);
|
||||
|
||||
$collection = $this->entityManager
|
||||
->getRepository('Attachment')
|
||||
->getRDBRepository('Attachment')
|
||||
->clone($orphanQueryBuilder->build())
|
||||
->limit(0, 5000)
|
||||
->find();
|
||||
@@ -345,6 +357,7 @@ class Cleanup implements JobDataLess
|
||||
|
||||
$datetimeFrom->modify($fromPeriod);
|
||||
|
||||
/** @var string[] */
|
||||
$scopeList = array_keys($this->metadata->get(['scopes']));
|
||||
|
||||
foreach ($scopeList as $scope) {
|
||||
@@ -398,7 +411,8 @@ class Cleanup implements JobDataLess
|
||||
continue;
|
||||
}
|
||||
|
||||
$query = $this->entityManager->getQueryBuilder()
|
||||
$query = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->select()
|
||||
->from($scope)
|
||||
->withDeleted()
|
||||
@@ -415,16 +429,16 @@ class Cleanup implements JobDataLess
|
||||
|
||||
foreach ($deletedEntityList as $deletedEntity) {
|
||||
$attachmentToRemoveList = $this->entityManager
|
||||
->getRepository('Attachment')
|
||||
->getRDBRepository('Attachment')
|
||||
->where([
|
||||
'OR' => [
|
||||
[
|
||||
'relatedType' => $scope,
|
||||
'relatedId' => $deletedEntity->id,
|
||||
'relatedId' => $deletedEntity->getId(),
|
||||
],
|
||||
[
|
||||
'parentType' => $scope,
|
||||
'parentId' => $deletedEntity->id,
|
||||
'parentId' => $deletedEntity->getId(),
|
||||
]
|
||||
]
|
||||
])
|
||||
@@ -436,7 +450,9 @@ class Cleanup implements JobDataLess
|
||||
}
|
||||
}
|
||||
|
||||
$delete = $this->entityManager->getQueryBuilder()->delete()
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from('Attachment')
|
||||
->where([
|
||||
'deleted' => true,
|
||||
@@ -451,14 +467,15 @@ class Cleanup implements JobDataLess
|
||||
{
|
||||
$dateBefore = date('Y-m-d H:i:s', time() - 3600 * 24 * 20);
|
||||
|
||||
$query = $this->entityManager->getQueryBuilder()
|
||||
$query = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->select()
|
||||
->from('Email')
|
||||
->withDeleted()
|
||||
->build();
|
||||
|
||||
$emailList = $this->entityManager
|
||||
->getRepository('Email')
|
||||
->getRDBRepository('Email')
|
||||
->clone($query)
|
||||
->select(['id'])
|
||||
->where([
|
||||
@@ -471,7 +488,7 @@ class Cleanup implements JobDataLess
|
||||
$id = $email->get('id');
|
||||
|
||||
$attachments = $this->entityManager
|
||||
->getRepository('Attachment')
|
||||
->getRDBRepository('Attachment')
|
||||
->where([
|
||||
'parentId' => $id,
|
||||
'parentType' => 'Email'
|
||||
@@ -482,7 +499,9 @@ class Cleanup implements JobDataLess
|
||||
$this->entityManager->removeEntity($attachment);
|
||||
}
|
||||
|
||||
$delete = $this->entityManager->getQueryBuilder()->delete()
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from('Email')
|
||||
->where([
|
||||
'deleted' => true,
|
||||
@@ -492,7 +511,9 @@ class Cleanup implements JobDataLess
|
||||
|
||||
$this->entityManager->getQueryExecutor()->execute($delete);
|
||||
|
||||
$delete = $this->entityManager->getQueryBuilder()->delete()
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from('EmailUser')
|
||||
->where([
|
||||
'emailId' => $id,
|
||||
@@ -510,14 +531,17 @@ class Cleanup implements JobDataLess
|
||||
$datetime = new DateTime();
|
||||
$datetime->modify($period);
|
||||
|
||||
$notificationList = $this->entityManager->getRepository('Notification')
|
||||
$notificationList = $this->entityManager
|
||||
->getRDBRepository('Notification')
|
||||
->where([
|
||||
'DATE:createdAt<' => $datetime->format('Y-m-d'),
|
||||
])
|
||||
->find();
|
||||
|
||||
foreach ($notificationList as $notification) {
|
||||
$this->entityManager->getRepository('Notification')->deleteFromDb($notification->get('id'));
|
||||
$this->entityManager
|
||||
->getRDBRepository('Notification')
|
||||
->deleteFromDb($notification->get('id'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,8 +551,10 @@ class Cleanup implements JobDataLess
|
||||
|
||||
$datetime = new DateTime('-' . $this->cleanupBackupPeriod);
|
||||
|
||||
if (file_exists($path)) {
|
||||
$fileManager = $this->fileManager;
|
||||
$fileManager = $this->fileManager;
|
||||
|
||||
if ($fileManager->exists($path)) {
|
||||
/** @var string[] */
|
||||
$fileList = $fileManager->getFileList($path, false, '', false);
|
||||
|
||||
foreach ($fileList as $dirName) {
|
||||
@@ -553,7 +579,15 @@ class Cleanup implements JobDataLess
|
||||
|
||||
$repository = $this->entityManager->getRepository($scope);
|
||||
|
||||
$repository->deleteFromDb($entity->id);
|
||||
if (!$repository instanceof RDBRepository) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$entity instanceof CoreEntity) {
|
||||
return;
|
||||
}
|
||||
|
||||
$repository->deleteFromDb($entity->getId());
|
||||
|
||||
$query = $this->entityManager->getQueryComposer();
|
||||
|
||||
@@ -576,7 +610,7 @@ class Cleanup implements JobDataLess
|
||||
}
|
||||
|
||||
$where = [
|
||||
$midKey => $entity->id,
|
||||
$midKey => $entity->getId(),
|
||||
];
|
||||
|
||||
$conditions = $entity->getRelationParam($relation, 'conditions') ?? [];
|
||||
@@ -585,17 +619,15 @@ class Cleanup implements JobDataLess
|
||||
$where[$key] = $value;
|
||||
}
|
||||
|
||||
if (empty($where)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$relationEntityType = ucfirst($relationName);
|
||||
|
||||
if (!$this->entityManager->hasRepository($relationEntityType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$delete = $this->entityManager->getQueryBuilder()->delete()
|
||||
$delete = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->delete()
|
||||
->from($relationEntityType)
|
||||
->where($where)
|
||||
->build();
|
||||
@@ -607,24 +639,25 @@ class Cleanup implements JobDataLess
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->entityManager->getQueryBuilder()
|
||||
$query = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->select()
|
||||
->from('Note')
|
||||
->withDeleted()
|
||||
->build();
|
||||
|
||||
$noteList = $this->entityManager
|
||||
->getRepository('Note')
|
||||
->getRDBRepository('Note')
|
||||
->clone($query)
|
||||
->where([
|
||||
'OR' => [
|
||||
[
|
||||
'relatedType' => $scope,
|
||||
'relatedId' => $entity->id,
|
||||
'relatedId' => $entity->getId(),
|
||||
],
|
||||
[
|
||||
'parentType' => $scope,
|
||||
'parentId' => $entity->id,
|
||||
'parentId' => $entity->getId(),
|
||||
]
|
||||
]
|
||||
])
|
||||
@@ -640,29 +673,33 @@ class Cleanup implements JobDataLess
|
||||
|
||||
if ($scope === 'Note') {
|
||||
$attachmentList = $this->entityManager
|
||||
->getRepository('Attachment')
|
||||
->getRDBRepository('Attachment')
|
||||
->where([
|
||||
'parentId' => $entity->id,
|
||||
'parentId' => $entity->getId(),
|
||||
'parentType' => 'Note',
|
||||
])
|
||||
->find();
|
||||
|
||||
foreach ($attachmentList as $attachment) {
|
||||
$this->entityManager->removeEntity($attachment);
|
||||
$this->entityManager->getRepository('Attachment')->deleteFromDb($attachment->id);
|
||||
$this->entityManager
|
||||
->getRDBRepository('Attachment')
|
||||
->deleteFromDb($attachment->getId());
|
||||
}
|
||||
}
|
||||
|
||||
$arrayValueList = $this->entityManager
|
||||
->getRepository('ArrayValue')
|
||||
->getRDBRepository('ArrayValue')
|
||||
->where([
|
||||
'entityType' => $entity->getEntityType(),
|
||||
'entityId' => $entity->id,
|
||||
'entityId' => $entity->getId(),
|
||||
])
|
||||
->find();
|
||||
|
||||
foreach ($arrayValueList as $arrayValue) {
|
||||
$this->entityManager->getRepository('ArrayValue')->deleteFromDb($arrayValue->id);
|
||||
$this->entityManager
|
||||
->getRDBRepository('ArrayValue')
|
||||
->deleteFromDb($arrayValue->getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,6 +713,7 @@ class Cleanup implements JobDataLess
|
||||
|
||||
$datetime = new DateTime($period);
|
||||
|
||||
/** @var string[] */
|
||||
$scopeList = array_keys($this->metadata->get(['scopes']));
|
||||
|
||||
foreach ($scopeList as $scope) {
|
||||
@@ -693,24 +731,12 @@ class Cleanup implements JobDataLess
|
||||
|
||||
$repository = $this->entityManager->getRepository($scope);
|
||||
|
||||
if (!$repository) {
|
||||
if (!$repository instanceof RDBRepository) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!method_exists($repository, 'find')) continue;
|
||||
if (!method_exists($repository, 'clone')) continue;
|
||||
if (!method_exists($repository, 'where')) continue;
|
||||
if (!method_exists($repository, 'select')) continue;
|
||||
if (!method_exists($repository, 'deleteFromDb')) continue;
|
||||
|
||||
$hasCleanupMethod = false;
|
||||
|
||||
$service = $this->recordServiceContainer->get($scope);
|
||||
|
||||
if (method_exists($service, 'cleanup')) {
|
||||
$hasCleanupMethod = true;
|
||||
}
|
||||
|
||||
$whereClause = [
|
||||
'deleted' => 1,
|
||||
];
|
||||
@@ -722,7 +748,8 @@ class Cleanup implements JobDataLess
|
||||
$whereClause['createdAt<'] = $datetime->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$query = $this->entityManager->getQueryBuilder()
|
||||
$query = $this->entityManager
|
||||
->getQueryBuilder()
|
||||
->select()
|
||||
->from($scope)
|
||||
->withDeleted()
|
||||
@@ -735,9 +762,9 @@ class Cleanup implements JobDataLess
|
||||
->find();
|
||||
|
||||
foreach ($deletedEntityList as $entity) {
|
||||
if ($hasCleanupMethod) {
|
||||
if (method_exists($service, 'cleanup')) {
|
||||
try {
|
||||
$service->cleanup($entity->id);
|
||||
$service->cleanup($entity->getId());
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
$this->log->error("Cleanup job: Cleanup scope {$scope}: " . $e->getMessage());
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -48,15 +48,15 @@ use Espo\{
|
||||
|
||||
class MassDelete implements MassAction
|
||||
{
|
||||
protected $massDeleteOriginal;
|
||||
private $massDeleteOriginal;
|
||||
|
||||
protected $queryBuilder;
|
||||
private $queryBuilder;
|
||||
|
||||
protected $entityManager;
|
||||
private $entityManager;
|
||||
|
||||
protected $acl;
|
||||
private $acl;
|
||||
|
||||
protected $user;
|
||||
private $user;
|
||||
|
||||
public function __construct(
|
||||
MassDeleteOriginal $massDeleteOriginal,
|
||||
@@ -87,14 +87,14 @@ class MassDelete implements MassAction
|
||||
$query = $this->queryBuilder->build($params);
|
||||
|
||||
$collection = $this->entityManager
|
||||
->getRepository('User')
|
||||
->getRDBRepository('User')
|
||||
->clone($query)
|
||||
->sth()
|
||||
->select(['id'])
|
||||
->find();
|
||||
|
||||
foreach ($collection as $entity) {
|
||||
$this->checkEntity($entity, $data);
|
||||
$this->checkEntity($entity);
|
||||
}
|
||||
|
||||
return $this->massDeleteOriginal->process($params, $data);
|
||||
@@ -102,11 +102,11 @@ class MassDelete implements MassAction
|
||||
|
||||
protected function checkEntity(Entity $entity): void
|
||||
{
|
||||
if ($entity->id === 'system') {
|
||||
if ($entity->getId() === 'system') {
|
||||
throw new Forbidden("Can't delete 'system' user.");
|
||||
}
|
||||
|
||||
if ($entity->id === $this->user->id) {
|
||||
if ($entity->getId() === $this->user->getId()) {
|
||||
throw new Forbidden("Can't delete own user.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -50,19 +50,19 @@ use Espo\{
|
||||
|
||||
class MassUpdate implements MassAction
|
||||
{
|
||||
protected $massUpdateOriginal;
|
||||
private $massUpdateOriginal;
|
||||
|
||||
protected $queryBuilder;
|
||||
private $queryBuilder;
|
||||
|
||||
protected $entityManager;
|
||||
private $entityManager;
|
||||
|
||||
protected $acl;
|
||||
private $acl;
|
||||
|
||||
protected $user;
|
||||
private $user;
|
||||
|
||||
protected $fileManager;
|
||||
private $fileManager;
|
||||
|
||||
protected $dataManager;
|
||||
private $dataManager;
|
||||
|
||||
public function __construct(
|
||||
MassUpdateOriginal $massUpdateOriginal,
|
||||
@@ -108,7 +108,7 @@ class MassUpdate implements MassAction
|
||||
$query = $this->queryBuilder->build($params);
|
||||
|
||||
$collection = $this->entityManager
|
||||
->getRepository('User')
|
||||
->getRDBRepository('User')
|
||||
->clone($query)
|
||||
->sth()
|
||||
->select(['id'])
|
||||
@@ -127,11 +127,11 @@ class MassUpdate implements MassAction
|
||||
|
||||
protected function checkEntity(Entity $entity, Data $data): void
|
||||
{
|
||||
if ($entity->id === 'system') {
|
||||
if ($entity->getId() === 'system') {
|
||||
throw new Forbidden("Can't update 'system' user.");
|
||||
}
|
||||
|
||||
if ($entity->id === $this->user->id) {
|
||||
if ($entity->getId() === $this->user->getId()) {
|
||||
if ($data->has('isActive')) {
|
||||
throw new Forbidden("Can't change 'isActive' field for own user.");
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Copyright (C) 2014-2022 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -36,6 +36,9 @@ use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Entities\User;
|
||||
|
||||
/**
|
||||
* @implements LinkHook<\Espo\Entities\Team>
|
||||
*/
|
||||
class BeforeLinkUserCheck implements LinkHook
|
||||
{
|
||||
public function process(Entity $entity, string $link, Entity $foreignEntity): void
|
||||
@@ -44,6 +47,8 @@ class BeforeLinkUserCheck implements LinkHook
|
||||
return;
|
||||
}
|
||||
|
||||
assert($foreignEntity instanceof User);
|
||||
|
||||
$this->processUserCheck($foreignEntity);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user