mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-06 18:57:01 +00:00
Compare commits
1194 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
814f79d53b | ||
|
|
0d6482374e | ||
|
|
427e3d466a | ||
|
|
ae72768f8c | ||
|
|
bd4e92d892 | ||
|
|
afc17ac54c | ||
|
|
52dda066cd | ||
|
|
29bec8fcd6 | ||
|
|
5c4fd344e4 | ||
|
|
e936ad907b | ||
|
|
bc59dab9ec | ||
|
|
48652e35ee | ||
|
|
381a51b836 | ||
|
|
a9f36a352d | ||
|
|
6c8a0bbb66 | ||
|
|
b21b69eed5 | ||
|
|
ef0d3febd8 | ||
|
|
2d6db7570c | ||
|
|
a7804742e7 | ||
|
|
09301e9d7c | ||
|
|
5d10da3b78 | ||
|
|
dcc4cce872 | ||
|
|
02fbc20838 | ||
|
|
6641075043 | ||
|
|
6624b178c0 | ||
|
|
4ec6708cb4 | ||
|
|
f9752eab02 | ||
|
|
3de816e03a | ||
|
|
b854ebab43 | ||
|
|
ffab7c3e6b | ||
|
|
b6e09ec75a | ||
|
|
083c768af9 | ||
|
|
fd052c1cdb | ||
|
|
41e0e29500 | ||
|
|
3cbd918507 | ||
|
|
94c9db2fde | ||
|
|
da29d6149b | ||
|
|
abd887363f | ||
|
|
8e2fe95e0c | ||
|
|
75e5349475 | ||
|
|
9a081d784e | ||
|
|
960446f9fa | ||
|
|
7cac38f39d | ||
|
|
98e69436d9 | ||
|
|
415eff0486 | ||
|
|
850f6ad41e | ||
|
|
a5433ec82a | ||
|
|
9b2ac56563 | ||
|
|
43fed19d07 | ||
|
|
2f93dfd653 | ||
|
|
c752e8fc91 | ||
|
|
00230f50d6 | ||
|
|
3b880de16d | ||
|
|
6acba3efb8 | ||
|
|
57843f5f86 | ||
|
|
73b00190f7 | ||
|
|
20ede11bdd | ||
|
|
9d485624a8 | ||
|
|
3fe4bc34ef | ||
|
|
a38fd487f4 | ||
|
|
91506a8ca6 | ||
|
|
d01748a24c | ||
|
|
a3f7f4e2d2 | ||
|
|
2df476d734 | ||
|
|
bf5fe492b3 | ||
|
|
87036f83e1 | ||
|
|
cf65e40b35 | ||
|
|
5fe98cbbbc | ||
|
|
1b94573502 | ||
|
|
d28638136a | ||
|
|
ca05495e9e | ||
|
|
c572d0110f | ||
|
|
3057f749c4 | ||
|
|
62c865bdc3 | ||
|
|
7e2bd60382 | ||
|
|
84434fa14a | ||
|
|
1c1b8b3985 | ||
|
|
ea15452db4 | ||
|
|
b39d2b34e2 | ||
|
|
e6d79e0847 | ||
|
|
1f334c2690 | ||
|
|
6cfd5db8ac | ||
|
|
3478aa772c | ||
|
|
f2c769a062 | ||
|
|
6e1d905db9 | ||
|
|
882eeffdd5 | ||
|
|
1e4e8b3fcf | ||
|
|
4b25456acd | ||
|
|
68615ba8bb | ||
|
|
8bafcded50 | ||
|
|
2e7dca6540 | ||
|
|
d25b4a4e3a | ||
|
|
fbf6b39dae | ||
|
|
60bb06c6af | ||
|
|
a169aca4f0 | ||
|
|
3e83e97197 | ||
|
|
70cdbe6020 | ||
|
|
36d089cfe7 | ||
|
|
0ea1be6307 | ||
|
|
73cebf7e5f | ||
|
|
bbd943eb93 | ||
|
|
2a891c01e7 | ||
|
|
c6b1bb9c57 | ||
|
|
03d06a5919 | ||
|
|
c02f39cf93 | ||
|
|
d064d3ea1c | ||
|
|
670cbc4971 | ||
|
|
2eedc93d27 | ||
|
|
8e80153a1a | ||
|
|
a80f1f4662 | ||
|
|
0602074554 | ||
|
|
8f49f25057 | ||
|
|
374d827edd | ||
|
|
6648e9ba02 | ||
|
|
45773c5fce | ||
|
|
c9336b882c | ||
|
|
b39d220f82 | ||
|
|
064d63abed | ||
|
|
104fc41895 | ||
|
|
b0fc7ffd0a | ||
|
|
ce2861b337 | ||
|
|
ccb5baf025 | ||
|
|
ff227c9813 | ||
|
|
a3a60713ef | ||
|
|
5bae4c7968 | ||
|
|
57e7556424 | ||
|
|
de7e573dbe | ||
|
|
27579a0111 | ||
|
|
9933e2bff2 | ||
|
|
061aeaeecc | ||
|
|
07eb8daee2 | ||
|
|
1d0fdbd73b | ||
|
|
f9a9f60ad4 | ||
|
|
21bf0953e6 | ||
|
|
a6b31c48af | ||
|
|
62ac499867 | ||
|
|
d7d0e79e4b | ||
|
|
4667d62ad5 | ||
|
|
017ac9c547 | ||
|
|
b73db26a41 | ||
|
|
3634872a33 | ||
|
|
cbe6711a83 | ||
|
|
bcad4a9e88 | ||
|
|
4b6e6928c6 | ||
|
|
fe32fd86c5 | ||
|
|
b704730e18 | ||
|
|
11562ff515 | ||
|
|
bf3abeaa1d | ||
|
|
3731a5558b | ||
|
|
66e15a4404 | ||
|
|
23dc2f09a2 | ||
|
|
925702516c | ||
|
|
5bcea44ecb | ||
|
|
054f3851be | ||
|
|
fffa95a206 | ||
|
|
9d9e13a07d | ||
|
|
afeff90096 | ||
|
|
fffb214e5d | ||
|
|
acb8f95929 | ||
|
|
3323e947b6 | ||
|
|
efc4bf2a89 | ||
|
|
47618a3555 | ||
|
|
e89694c8b9 | ||
|
|
69c6b2db1c | ||
|
|
89818b2eea | ||
|
|
806461750a | ||
|
|
8ac7a855cc | ||
|
|
e85f7a533f | ||
|
|
b58561e46f | ||
|
|
21909f985b | ||
|
|
a1c0269443 | ||
|
|
96bdd54782 | ||
|
|
8d68305e38 | ||
|
|
554d105aac | ||
|
|
f3681e8ad7 | ||
|
|
d088225542 | ||
|
|
e4be1156db | ||
|
|
76599130cf | ||
|
|
e9208602f6 | ||
|
|
e2f57d4869 | ||
|
|
98dd4bc51c | ||
|
|
cb4356c689 | ||
|
|
99e8642ef6 | ||
|
|
e5575ee673 | ||
|
|
e1d7733848 | ||
|
|
b08f7de0cb | ||
|
|
d83f02010a | ||
|
|
02b66272bb | ||
|
|
4ef3b2975e | ||
|
|
88bc592fcd | ||
|
|
2fe1d892c5 | ||
|
|
9c2a125365 | ||
|
|
d21e61bdf5 | ||
|
|
a2e6bb6fd9 | ||
|
|
381f4886a9 | ||
|
|
ab538e1901 | ||
|
|
506200901d | ||
|
|
764b0c6705 | ||
|
|
34209c0811 | ||
|
|
0e3b94e1bb | ||
|
|
fd95fa73ce | ||
|
|
3f056c8472 | ||
|
|
ef48999614 | ||
|
|
087ab2b954 | ||
|
|
e79e75c0d5 | ||
|
|
cb37ee88b2 | ||
|
|
9ead5dad66 | ||
|
|
4b39626b83 | ||
|
|
2b5b7eb601 | ||
|
|
0785e2a059 | ||
|
|
2187073e2b | ||
|
|
3c36e81502 | ||
|
|
fe6b6bc869 | ||
|
|
d9cdcfa332 | ||
|
|
0db2dbc0f3 | ||
|
|
e319ead6a7 | ||
|
|
0dae38943f | ||
|
|
f9e4ae7b71 | ||
|
|
2f4f4dc023 | ||
|
|
f8bafa5221 | ||
|
|
00a0cb1394 | ||
|
|
3a37f8421d | ||
|
|
2dbde4e2c8 | ||
|
|
98084e9314 | ||
|
|
2946969e3a | ||
|
|
75c3891654 | ||
|
|
c0866c8fea | ||
|
|
5d3a785a49 | ||
|
|
4bcf88dcee | ||
|
|
889f976c5f | ||
|
|
022d9a42ec | ||
|
|
ac80f67533 | ||
|
|
1ffbf63731 | ||
|
|
83fa22852a | ||
|
|
7ffd8a54a1 | ||
|
|
739cb5e98f | ||
|
|
f5e1b7175e | ||
|
|
81cb2aaeb8 | ||
|
|
bc54bafc3a | ||
|
|
fe635064d5 | ||
|
|
01ba132a62 | ||
|
|
ac318bb302 | ||
|
|
4b31173355 | ||
|
|
34cd265fc1 | ||
|
|
22f19c0ac9 | ||
|
|
93f8ef9daa | ||
|
|
81ffbc8e6d | ||
|
|
061dda1a1e | ||
|
|
c83a24794d | ||
|
|
5ab6d25e82 | ||
|
|
36aab22272 | ||
|
|
a21d5dba9f | ||
|
|
bb8e543509 | ||
|
|
b93112aaff | ||
|
|
c303ec9479 | ||
|
|
76f10fefa3 | ||
|
|
becd564420 | ||
|
|
c4f3c1dbd1 | ||
|
|
f4d1b4a5b8 | ||
|
|
045264d95f | ||
|
|
797fab769f | ||
|
|
41d8605e17 | ||
|
|
18bcaf7e6e | ||
|
|
13a2ba47e7 | ||
|
|
1ef60781a0 | ||
|
|
64dfad8cc1 | ||
|
|
9862c6d960 | ||
|
|
1cfa5ce2b3 | ||
|
|
4a09baef3a | ||
|
|
5893243ae3 | ||
|
|
4c598d19b5 | ||
|
|
dbc5a47d79 | ||
|
|
0fda920610 | ||
|
|
a6a6ce6722 | ||
|
|
4db421a75f | ||
|
|
3f6cfe3749 | ||
|
|
ec9653ff48 | ||
|
|
24c19f12e5 | ||
|
|
172bba9de5 | ||
|
|
7d4227c98d | ||
|
|
4e64ebb346 | ||
|
|
1102e9f1e8 | ||
|
|
f5f16a7eb3 | ||
|
|
7901df4221 | ||
|
|
41b114684e | ||
|
|
03788be209 | ||
|
|
685226c4d4 | ||
|
|
f8d9548ed5 | ||
|
|
49798c8f7f | ||
|
|
ab4e85ea45 | ||
|
|
7d7d2d4276 | ||
|
|
607ee9a080 | ||
|
|
3f3b65ad90 | ||
|
|
354866a809 | ||
|
|
58cda4f31a | ||
|
|
454c388d10 | ||
|
|
e0125fa8f9 | ||
|
|
540c594b1c | ||
|
|
025ac8fe34 | ||
|
|
6d18cac9a9 | ||
|
|
f555ee9f9d | ||
|
|
5ac2e9b516 | ||
|
|
2cc8c3710f | ||
|
|
72d93cbae4 | ||
|
|
e30838cf27 | ||
|
|
790355fb63 | ||
|
|
371fbf9864 | ||
|
|
6e157db23d | ||
|
|
85c3d6c4e5 | ||
|
|
d947236bcc | ||
|
|
98343cb099 | ||
|
|
e3ac8c3f67 | ||
|
|
2087894c3a | ||
|
|
5c00a7ad43 | ||
|
|
fe0dcc5342 | ||
|
|
f05381cc43 | ||
|
|
a9a30d7237 | ||
|
|
5312c1d141 | ||
|
|
a97d516c4f | ||
|
|
16c24abb55 | ||
|
|
ed897e9b97 | ||
|
|
b4b222c1d7 | ||
|
|
a68d711249 | ||
|
|
d6834f7f97 | ||
|
|
20818659e8 | ||
|
|
1c668ce983 | ||
|
|
a9dacd74c6 | ||
|
|
b7c9ddc4e6 | ||
|
|
d5ee599f9f | ||
|
|
252d6bccd3 | ||
|
|
742f4e21b5 | ||
|
|
78fc80a619 | ||
|
|
5a30c6a229 | ||
|
|
e74fdce568 | ||
|
|
20139a88af | ||
|
|
3d1f632a73 | ||
|
|
9e459e1287 | ||
|
|
7b9cf6c039 | ||
|
|
1cebef107e | ||
|
|
47fe232c78 | ||
|
|
2c458a69a1 | ||
|
|
54a290121e | ||
|
|
11420dc0af | ||
|
|
957680a3d0 | ||
|
|
3c6e19f4c0 | ||
|
|
4253915eed | ||
|
|
da34789020 | ||
|
|
cc057af59a | ||
|
|
ebaa3ed958 | ||
|
|
307c045c0e | ||
|
|
8e09b81cf0 | ||
|
|
f40aeb0830 | ||
|
|
135b56001c | ||
|
|
cc97454c58 | ||
|
|
9d3e3e282f | ||
|
|
1bcd54dfe1 | ||
|
|
727f3a4707 | ||
|
|
d5473f9985 | ||
|
|
85c06f7ca3 | ||
|
|
1d4d9882b6 | ||
|
|
e633984f7e | ||
|
|
2dabecbae3 | ||
|
|
1a4e40d0cd | ||
|
|
6ea5ed4f55 | ||
|
|
c0800a4d16 | ||
|
|
85c62c0789 | ||
|
|
551e82ad8b | ||
|
|
7f4328499b | ||
|
|
de4d794d72 | ||
|
|
e2e374301a | ||
|
|
7a919dedfd | ||
|
|
06c8cbac52 | ||
|
|
f54ad3ab0d | ||
|
|
197fb26beb | ||
|
|
9e4582af17 | ||
|
|
b399c4444d | ||
|
|
b7e9e69f35 | ||
|
|
105b6444ed | ||
|
|
3559ff9f4e | ||
|
|
4be2962567 | ||
|
|
1cce748af5 | ||
|
|
64d3e3b5dd | ||
|
|
2e0233a239 | ||
|
|
5b4bd88907 | ||
|
|
6176ead935 | ||
|
|
46ddf3b127 | ||
|
|
2944e64de5 | ||
|
|
372cf20145 | ||
|
|
de68227d49 | ||
|
|
633cc12650 | ||
|
|
202d799436 | ||
|
|
f14d12853b | ||
|
|
a98f7f5068 | ||
|
|
ebe249bd6b | ||
|
|
7957296479 | ||
|
|
b7eac5ba42 | ||
|
|
14cab0dbde | ||
|
|
5db39d14e7 | ||
|
|
cf473d6f16 | ||
|
|
a082ea6acc | ||
|
|
f770074be2 | ||
|
|
106e7726ba | ||
|
|
ed0ca19ed5 | ||
|
|
e680be54ad | ||
|
|
3224795368 | ||
|
|
ec5bd78a33 | ||
|
|
d0c5d2aace | ||
|
|
f8d0688f2f | ||
|
|
2b2b2b9faa | ||
|
|
ed4ce1a36e | ||
|
|
a6d7f91a58 | ||
|
|
f6f6c2b2ac | ||
|
|
8c628df639 | ||
|
|
ffd3f762ce | ||
|
|
24628a8487 | ||
|
|
573d147dad | ||
|
|
4ab767e95b | ||
|
|
18b64238ee | ||
|
|
65ded811b4 | ||
|
|
57f454693a | ||
|
|
b6409b5cba | ||
|
|
e6a83f7d19 | ||
|
|
c39e1d140f | ||
|
|
1c69f1ca95 | ||
|
|
a21c071349 | ||
|
|
d8d8e68914 | ||
|
|
741a6d5dab | ||
|
|
0c0a602330 | ||
|
|
7d13018eba | ||
|
|
44c65c0117 | ||
|
|
e9e758c4b3 | ||
|
|
7e7acb8d28 | ||
|
|
4b28687c37 | ||
|
|
1ab897db28 | ||
|
|
1a990850ca | ||
|
|
36e360e167 | ||
|
|
9ffdb1a1f0 | ||
|
|
64b15f9282 | ||
|
|
e8ebe51f1c | ||
|
|
ec2a7d2f48 | ||
|
|
6782e7c15c | ||
|
|
3c73e3e8cf | ||
|
|
321306c42d | ||
|
|
4ab7d19776 | ||
|
|
92864d9133 | ||
|
|
34e33bd13a | ||
|
|
49fa22fa3d | ||
|
|
10fcd79155 | ||
|
|
00598170af | ||
|
|
ac5b2f38d4 | ||
|
|
82d486a2b4 | ||
|
|
6cdc8f2823 | ||
|
|
d611ebfc86 | ||
|
|
599a7c6080 | ||
|
|
4c21f1192d | ||
|
|
63e78baf21 | ||
|
|
fa2c689a34 | ||
|
|
a53b440b8b | ||
|
|
8189832af2 | ||
|
|
135f869e1a | ||
|
|
2d56525a25 | ||
|
|
9e78276f3d | ||
|
|
03773dd929 | ||
|
|
5b8dba68f3 | ||
|
|
f63c75e18d | ||
|
|
6dd0bd8b90 | ||
|
|
94e86f875a | ||
|
|
b582b20003 | ||
|
|
e58e82eea1 | ||
|
|
dddc4feda8 | ||
|
|
a65421a268 | ||
|
|
b6696dcc26 | ||
|
|
4e3d8fb98f | ||
|
|
e0aaff932e | ||
|
|
bd61c12ea2 | ||
|
|
17ea760851 | ||
|
|
f3d11aede3 | ||
|
|
8053d65f33 | ||
|
|
01809d2cc3 | ||
|
|
ac8e3d1a69 | ||
|
|
b669ccf733 | ||
|
|
8c42c6bf0b | ||
|
|
97bdd22795 | ||
|
|
0f3cd7913c | ||
|
|
502cfc8d76 | ||
|
|
010f757452 | ||
|
|
4230f768e5 | ||
|
|
4197f30ad5 | ||
|
|
b4eecbd0af | ||
|
|
6560c0e0bd | ||
|
|
d31e826305 | ||
|
|
a9f2fe8590 | ||
|
|
28a62a2581 | ||
|
|
0d4b548160 | ||
|
|
2240819930 | ||
|
|
deff6bad36 | ||
|
|
f2bc80b7d9 | ||
|
|
b5b5cac0ac | ||
|
|
308f30510b | ||
|
|
574513a9c8 | ||
|
|
f37bc7d46b | ||
|
|
9f5db434df | ||
|
|
1c8abd6e36 | ||
|
|
c95fcd6fbd | ||
|
|
e6009366e8 | ||
|
|
286502d872 | ||
|
|
0749bdc006 | ||
|
|
72ef137dbe | ||
|
|
f624bdef5c | ||
|
|
9730680e41 | ||
|
|
5d857f6a86 | ||
|
|
44947f8844 | ||
|
|
c59fa40615 | ||
|
|
4dc08dd37c | ||
|
|
e76c7564dc | ||
|
|
802bac82f0 | ||
|
|
172af61b6b | ||
|
|
e6bdaa1c86 | ||
|
|
c64cc13e4c | ||
|
|
30be62eabe | ||
|
|
1c1703b349 | ||
|
|
6916f3242c | ||
|
|
d2630a5c3f | ||
|
|
3e02776fcd | ||
|
|
376bfe63e0 | ||
|
|
950a3b4703 | ||
|
|
2f5ffb7421 | ||
|
|
043ef8ef3e | ||
|
|
a959a2deaf | ||
|
|
65a3f4e5f3 | ||
|
|
97355ad024 | ||
|
|
99300d2d61 | ||
|
|
e070d9d9f1 | ||
|
|
77a884c951 | ||
|
|
6a2974845a | ||
|
|
0095cfd68c | ||
|
|
22f0e5b399 | ||
|
|
1abc853bc5 | ||
|
|
6f9dc66104 | ||
|
|
d9094238c1 | ||
|
|
25ea320042 | ||
|
|
8f9bb79978 | ||
|
|
405a5c29df | ||
|
|
4f2a2b290b | ||
|
|
fd5218c10b | ||
|
|
73ab4aa42e | ||
|
|
66a60b1257 | ||
|
|
c975954944 | ||
|
|
86799ed742 | ||
|
|
0c143eb8a1 | ||
|
|
1da6eca3be | ||
|
|
a462158582 | ||
|
|
152b8991d3 | ||
|
|
5adcf013d7 | ||
|
|
9d6401cbd3 | ||
|
|
9f178bb467 | ||
|
|
f3b2cc9bcb | ||
|
|
b18a8c1b2b | ||
|
|
30dd7e560b | ||
|
|
ca35a4df75 | ||
|
|
fe0a6d1a8b | ||
|
|
f9223087df | ||
|
|
f3980ef9a1 | ||
|
|
93553d18fc | ||
|
|
e35561093d | ||
|
|
b0742aa0c6 | ||
|
|
efad2b142a | ||
|
|
362f895e72 | ||
|
|
224b73eb89 | ||
|
|
c4cf45e7f8 | ||
|
|
cb45e57a99 | ||
|
|
e7f62f79ef | ||
|
|
6fb21ccd77 | ||
|
|
f55d814cbb | ||
|
|
8fa22a6c7d | ||
|
|
b86ca3a4ec | ||
|
|
ab51e70ff4 | ||
|
|
0bde83c0e7 | ||
|
|
589754851c | ||
|
|
253930ba6d | ||
|
|
09c19bbba5 | ||
|
|
ac96ebffa5 | ||
|
|
f01715452f | ||
|
|
875b01dcd6 | ||
|
|
61def7e332 | ||
|
|
86b24ff618 | ||
|
|
1d29d74204 | ||
|
|
2cf820e181 | ||
|
|
bf8ab4dec2 | ||
|
|
7b772bde3c | ||
|
|
16bad37dc5 | ||
|
|
76b8009323 | ||
|
|
d67f806ec8 | ||
|
|
72bed367e4 | ||
|
|
fe2a4f91ee | ||
|
|
471dd1ab49 | ||
|
|
8efc395ca1 | ||
|
|
dfbad82ba8 | ||
|
|
84938d88fc | ||
|
|
ed5f66729d | ||
|
|
ee5218c46d | ||
|
|
6758d71e2e | ||
|
|
1eec3d88cf | ||
|
|
34f1c196f1 | ||
|
|
a87e2fb5db | ||
|
|
cecafa5e28 | ||
|
|
a0e5f2d8ec | ||
|
|
47080f9b78 | ||
|
|
07fa53d0c2 | ||
|
|
dd15767263 | ||
|
|
a698085196 | ||
|
|
2d4e1a94a4 | ||
|
|
dad49b9ac8 | ||
|
|
c5c1abaeff | ||
|
|
eb4f933753 | ||
|
|
931f27cb70 | ||
|
|
e6e00d4c7f | ||
|
|
3cf48129c6 | ||
|
|
b50bf02e90 | ||
|
|
431e3428b3 | ||
|
|
6d2e056b10 | ||
|
|
1cbfacc864 | ||
|
|
f2b51d321f | ||
|
|
0fe0b8906c | ||
|
|
0876f03fe4 | ||
|
|
dd239af810 | ||
|
|
5f2fae940c | ||
|
|
02f94875b1 | ||
|
|
52536f9803 | ||
|
|
7f963bd9f3 | ||
|
|
fcfbd478ca | ||
|
|
d7164dd588 | ||
|
|
d20b2768e1 | ||
|
|
68301c52c1 | ||
|
|
57aa9fa817 | ||
|
|
910291796b | ||
|
|
e4a661721f | ||
|
|
4068a20b8e | ||
|
|
c3be6db4f3 | ||
|
|
80678c97f0 | ||
|
|
711d20f874 | ||
|
|
7f299e1aa2 | ||
|
|
ab612a3f32 | ||
|
|
c0c244adc6 | ||
|
|
46a985076e | ||
|
|
7f82fab69b | ||
|
|
12ed1b3383 | ||
|
|
eab279dd12 | ||
|
|
e59a927faa | ||
|
|
1c1cb13c4d | ||
|
|
45a37eabe2 | ||
|
|
bbe6d81aa2 | ||
|
|
5d19b1bb72 | ||
|
|
866f05fea5 | ||
|
|
bd22554756 | ||
|
|
703e170773 | ||
|
|
698f70a358 | ||
|
|
a226242e69 | ||
|
|
1438f8aa10 | ||
|
|
79564bab81 | ||
|
|
5c7dd0b536 | ||
|
|
7e340b8b78 | ||
|
|
a026dc577c | ||
|
|
ed6c56629e | ||
|
|
97574707e5 | ||
|
|
3170571cb9 | ||
|
|
942726eb74 | ||
|
|
e1eb3f804e | ||
|
|
2133a1390c | ||
|
|
7fab959a2f | ||
|
|
88f64ab82f | ||
|
|
1563d63051 | ||
|
|
82026658e2 | ||
|
|
26eec19a62 | ||
|
|
f548db2783 | ||
|
|
2da689e7e9 | ||
|
|
8afb4804c3 | ||
|
|
56b8902969 | ||
|
|
95cee6c845 | ||
|
|
dc58bcbd91 | ||
|
|
8d3698e6a3 | ||
|
|
c04526dc11 | ||
|
|
6a0d622344 | ||
|
|
74797e0768 | ||
|
|
6fd0851dc9 | ||
|
|
41e2773781 | ||
|
|
bf03412bf0 | ||
|
|
6b25aa1274 | ||
|
|
634acdd770 | ||
|
|
f2f01adfc9 | ||
|
|
9cd2d1d21f | ||
|
|
fa144847e5 | ||
|
|
17138f715b | ||
|
|
0babd05bff | ||
|
|
c5f14e55c5 | ||
|
|
e48c067b05 | ||
|
|
03918c8ada | ||
|
|
80c7008a6c | ||
|
|
3d143cd3f0 | ||
|
|
365264b393 | ||
|
|
492670eb7d | ||
|
|
3b4aea4966 | ||
|
|
cb77bc9085 | ||
|
|
691aff990b | ||
|
|
0f6ca667d9 | ||
|
|
ba41229a83 | ||
|
|
7c9d28098b | ||
|
|
eccf9e4d85 | ||
|
|
96dffc0b74 | ||
|
|
308d0bfc0c | ||
|
|
f9dcf2db7d | ||
|
|
88798f2b86 | ||
|
|
28ecdc46b6 | ||
|
|
6a30031f49 | ||
|
|
d4f23e391f | ||
|
|
79b7463886 | ||
|
|
eddae25d7f | ||
|
|
5e9c85fc06 | ||
|
|
b44adb34ec | ||
|
|
f0f6cac84a | ||
|
|
17e87f58c3 | ||
|
|
273698e2fc | ||
|
|
66f88e0e8e | ||
|
|
de945008fb | ||
|
|
5f91505b8e | ||
|
|
6a25c283ec | ||
|
|
74fa9289a7 | ||
|
|
ab4b975912 | ||
|
|
2260089301 | ||
|
|
9dd35f1e32 | ||
|
|
6b90cee851 | ||
|
|
6da132c034 | ||
|
|
bc966a8ea8 | ||
|
|
6eab0c9b75 | ||
|
|
cf253fae8a | ||
|
|
c0eaa8fb50 | ||
|
|
a4889de80a | ||
|
|
acac599f6b | ||
|
|
1436ffa53f | ||
|
|
c68a3dd0a6 | ||
|
|
29c42022ef | ||
|
|
dd814c1b5e | ||
|
|
7fc2c71f58 | ||
|
|
e6a3d3c982 | ||
|
|
46380ee9ff | ||
|
|
1fa3908888 | ||
|
|
914e6a1789 | ||
|
|
9a1d073072 | ||
|
|
3712caf7b1 | ||
|
|
a770e18bb2 | ||
|
|
5dc0cfb666 | ||
|
|
e4ab02c77a | ||
|
|
a0f729cd8d | ||
|
|
d544b1c264 | ||
|
|
d8549cbebe | ||
|
|
4ae4734dbf | ||
|
|
cc72de7121 | ||
|
|
29bf2c2e40 | ||
|
|
e31771c8a9 | ||
|
|
b938942c78 | ||
|
|
262bc6d44d | ||
|
|
acd8d23c6c | ||
|
|
940bb8f9b1 | ||
|
|
27d22d4c9c | ||
|
|
4024055755 | ||
|
|
441c046fbd | ||
|
|
649fd579e2 | ||
|
|
c08478e156 | ||
|
|
389327ae63 | ||
|
|
122ee3e259 | ||
|
|
ef5f048343 | ||
|
|
9f56efada1 | ||
|
|
c3553b1fb1 | ||
|
|
1eebfefc79 | ||
|
|
f7391c04d4 | ||
|
|
90537515fa | ||
|
|
1da3d093be | ||
|
|
c923134b97 | ||
|
|
8eb11787de | ||
|
|
727062cf9e | ||
|
|
4054b9497d | ||
|
|
4ea7154c9e | ||
|
|
a35f12dffb | ||
|
|
8b6022bada | ||
|
|
1bbbac2cc7 | ||
|
|
ca632f6467 | ||
|
|
256d9555b4 | ||
|
|
7db73f0688 | ||
|
|
b9d6650298 | ||
|
|
f17d4922dd | ||
|
|
6a1b6cc922 | ||
|
|
3ec088d485 | ||
|
|
b11cb0059e | ||
|
|
989e5d1845 | ||
|
|
f8d0c4e3f9 | ||
|
|
3af1850600 | ||
|
|
f8c0a4d2e5 | ||
|
|
c0c28c912e | ||
|
|
ad55c66e77 | ||
|
|
d276b1a5e1 | ||
|
|
e899781cb5 | ||
|
|
5dd014f835 | ||
|
|
136bad46ce | ||
|
|
bd09d2a2cb | ||
|
|
2b2428021f | ||
|
|
a9537f210a | ||
|
|
3993bb5c27 | ||
|
|
0c35b59ac1 | ||
|
|
f68effefe6 | ||
|
|
45f1b4c427 | ||
|
|
9c0a53728b | ||
|
|
84c4fb4468 | ||
|
|
da2310a011 | ||
|
|
96fe58bafc | ||
|
|
da5328f725 | ||
|
|
e741502528 | ||
|
|
25988d7c3d | ||
|
|
61b68a5b41 | ||
|
|
7b6626d8eb | ||
|
|
f864bc8fec | ||
|
|
5c5277b54a | ||
|
|
7eff19547c | ||
|
|
05b6bcbab2 | ||
|
|
7640279a6b | ||
|
|
2447117b03 | ||
|
|
334b96807c | ||
|
|
3dcba630fe | ||
|
|
d43f78b5d2 | ||
|
|
d197391668 | ||
|
|
50fe25eab3 | ||
|
|
4192964217 | ||
|
|
247b42474d | ||
|
|
5e3a4359f8 | ||
|
|
5a051d1c45 | ||
|
|
fd63de7706 | ||
|
|
08d5edd991 | ||
|
|
7074467fc2 | ||
|
|
e61aecd0ff | ||
|
|
dbf1145c53 | ||
|
|
d34b74297e | ||
|
|
e8ce1b1592 | ||
|
|
663c5df115 | ||
|
|
62c24bbad0 | ||
|
|
2e07791d43 | ||
|
|
bc397f9dcf | ||
|
|
e91184064c | ||
|
|
abe9ef19ca | ||
|
|
18d3e357f7 | ||
|
|
4c02636027 | ||
|
|
98d47bc832 | ||
|
|
a990cc771d | ||
|
|
3a8fa432de | ||
|
|
d41c7e2298 | ||
|
|
636906de6f | ||
|
|
9323bb07a7 | ||
|
|
bfc5f27e30 | ||
|
|
aeee88602c | ||
|
|
251a2e46a8 | ||
|
|
87ab67dd4c | ||
|
|
75e537e428 | ||
|
|
383605b597 | ||
|
|
9a18ce2868 | ||
|
|
79a99e042f | ||
|
|
ce6627282c | ||
|
|
775e66f1ed | ||
|
|
d09ad3a7b7 | ||
|
|
429a334d35 | ||
|
|
978784c267 | ||
|
|
18736600ef | ||
|
|
94ee8c6491 | ||
|
|
225704d1f7 | ||
|
|
ffb56703c6 | ||
|
|
8694d1e924 | ||
|
|
2408d086a0 | ||
|
|
09f4b0b494 | ||
|
|
6c55a35445 | ||
|
|
97a572cf96 | ||
|
|
de78c92808 | ||
|
|
e38f967b1b | ||
|
|
a07fe944c5 | ||
|
|
32e32ddc51 | ||
|
|
042780b4a1 | ||
|
|
70ad78a398 | ||
|
|
805027bb8c | ||
|
|
9453c93966 | ||
|
|
b74d2d8bba | ||
|
|
b709892311 | ||
|
|
aba8b21d66 | ||
|
|
abd2801ac8 | ||
|
|
ee7ce8221d | ||
|
|
89079362b6 | ||
|
|
79fe419f13 | ||
|
|
b4a528c05e | ||
|
|
60c375dbca | ||
|
|
c7dfcfe426 | ||
|
|
0456dbfa42 | ||
|
|
c806e0ad8d | ||
|
|
a8acafdb69 | ||
|
|
208a7f8620 | ||
|
|
31ed07648e | ||
|
|
bf08bddec3 | ||
|
|
8d4ae8950a | ||
|
|
c95d7e5548 | ||
|
|
c90ac7cc6a | ||
|
|
0678ba47de | ||
|
|
60f43d40e4 | ||
|
|
43e6332bd8 | ||
|
|
9142783564 | ||
|
|
d3b0e9ed5d | ||
|
|
0721bd5c27 | ||
|
|
1d5e9c67f0 | ||
|
|
20ad921cb2 | ||
|
|
aeee20ab42 | ||
|
|
26c1df6168 | ||
|
|
b037423621 | ||
|
|
8e040a83d0 | ||
|
|
a450342e93 | ||
|
|
d4c0331f41 | ||
|
|
5f74ca9504 | ||
|
|
141a6f218b | ||
|
|
0bb3464e81 | ||
|
|
e5dfc1af82 | ||
|
|
5b130dd876 | ||
|
|
196422de87 | ||
|
|
2a5bcf0bdd | ||
|
|
638908acb8 | ||
|
|
f7ffcafb27 | ||
|
|
cca4aa7f6f | ||
|
|
ec60f2b0f3 | ||
|
|
5f595bd86f | ||
|
|
13909fc1bd | ||
|
|
a589d369bc | ||
|
|
5ac88a7b1a | ||
|
|
e3f1baacbe | ||
|
|
bc09e9a797 | ||
|
|
f93eb3a5b3 | ||
|
|
6922e942ba | ||
|
|
6397650183 | ||
|
|
6fd89db736 | ||
|
|
d6071bd894 | ||
|
|
5c1d088744 | ||
|
|
4bc01767c8 | ||
|
|
acb532db89 | ||
|
|
8c9ccde962 | ||
|
|
c1958d76b1 | ||
|
|
a804f17934 | ||
|
|
8fb05d4fe3 | ||
|
|
ee9d0355d4 | ||
|
|
139b58ce6d | ||
|
|
4a8eff32cb | ||
|
|
6c6d1a7f53 | ||
|
|
a59825a79b | ||
|
|
81bb4a43f5 | ||
|
|
184369af9c | ||
|
|
d492ca15da | ||
|
|
5a17c923f0 | ||
|
|
dfcaa60e04 | ||
|
|
f3317793cb | ||
|
|
41a3e7eaa3 | ||
|
|
4357e331ad | ||
|
|
49fe1a75db | ||
|
|
68dfa92425 | ||
|
|
987fd7f922 | ||
|
|
449f0d6237 | ||
|
|
dcbdf94023 | ||
|
|
6e7150cef2 | ||
|
|
949209d708 | ||
|
|
0aab014af1 | ||
|
|
a5941e472e | ||
|
|
9a18a461be | ||
|
|
95bbba4607 | ||
|
|
d8efe74126 | ||
|
|
dafe9d8274 | ||
|
|
505862efad | ||
|
|
3e3616bc36 | ||
|
|
f72c16a604 | ||
|
|
d1be813d05 | ||
|
|
17cdecf45c | ||
|
|
0906e79211 | ||
|
|
4acb5ee4c8 | ||
|
|
0bce33e92a | ||
|
|
929fa2f620 | ||
|
|
fb66c5ec60 | ||
|
|
54850f62a8 | ||
|
|
ea0e38277d | ||
|
|
e099fd43dd | ||
|
|
d90efae709 | ||
|
|
2131232e14 | ||
|
|
c823e9e06f | ||
|
|
d325d92f89 | ||
|
|
84143cd096 | ||
|
|
d7f5993665 | ||
|
|
88ddd5546a | ||
|
|
25d6ca3fea | ||
|
|
3709523836 | ||
|
|
0e17079b03 | ||
|
|
2752924d16 | ||
|
|
7c1144fa2c | ||
|
|
6008f1abb2 | ||
|
|
d4f200171f | ||
|
|
2dd8d8b442 | ||
|
|
d5dc0fa2e6 | ||
|
|
8cb9568334 | ||
|
|
4cc33fc06e | ||
|
|
73c94b861e | ||
|
|
7b0fde72b8 | ||
|
|
564d7dd567 | ||
|
|
3f21bd618c | ||
|
|
ed1f803647 | ||
|
|
4b03f3aba9 | ||
|
|
7b7fa5aa24 | ||
|
|
15a1c68ede | ||
|
|
9e252298cf | ||
|
|
89d4a04d85 | ||
|
|
1cd0c5d925 | ||
|
|
43ab711254 | ||
|
|
c671e47a5d | ||
|
|
983988c9e1 | ||
|
|
790a206e0a | ||
|
|
f5759c3327 | ||
|
|
a15a2f4ee5 | ||
|
|
2e4dc5a2ea | ||
|
|
9b78cf401b | ||
|
|
ed64c93aa0 | ||
|
|
618792b541 | ||
|
|
1bbba0e9b3 | ||
|
|
3a8300f172 | ||
|
|
6e40357e3f | ||
|
|
20a767b452 | ||
|
|
ff96f18adb | ||
|
|
a768181a75 | ||
|
|
edb52e253b | ||
|
|
ee52b8d4d9 | ||
|
|
7154fa0f4a | ||
|
|
7e54239710 | ||
|
|
a54be505d4 | ||
|
|
3efa23fb71 | ||
|
|
2254257250 | ||
|
|
18f4f057eb | ||
|
|
246f2186a5 | ||
|
|
ed6c248bbe | ||
|
|
c22b1c0e9d | ||
|
|
5087b19135 | ||
|
|
26175c8795 | ||
|
|
4400c9bfa8 | ||
|
|
f99cac5d4c | ||
|
|
d81d66ea5d | ||
|
|
00d6e2a58c | ||
|
|
e48fa00893 | ||
|
|
98bf4594b4 | ||
|
|
2e38270083 | ||
|
|
9e578f4edd | ||
|
|
2186673b2a | ||
|
|
4080c8c877 | ||
|
|
8af40f2444 | ||
|
|
6619abb02b | ||
|
|
9806e092df | ||
|
|
f1d8af128d | ||
|
|
84e5fb33c0 | ||
|
|
a42afcf6e4 | ||
|
|
3d16450dd8 | ||
|
|
ad9edb2b43 | ||
|
|
0b1671e1a3 | ||
|
|
7361488270 | ||
|
|
f75e6f6ad0 | ||
|
|
dd3a075c24 | ||
|
|
263949134c | ||
|
|
ebf7c78199 | ||
|
|
68634edc0d | ||
|
|
c7be90e1ad | ||
|
|
6fa3d8c769 | ||
|
|
42e2f247e1 | ||
|
|
005b9c0a8a | ||
|
|
137e559d2e | ||
|
|
f20b7d6577 | ||
|
|
4b22936d66 | ||
|
|
b47d738e94 | ||
|
|
200f70c813 | ||
|
|
a0535c8127 | ||
|
|
750d15134f | ||
|
|
43e398e078 | ||
|
|
e1965e6ad9 | ||
|
|
79d69dcb32 | ||
|
|
e21ac44427 | ||
|
|
0211e4fa86 | ||
|
|
dba0579b92 | ||
|
|
8524095e75 | ||
|
|
6d2a6feae2 | ||
|
|
1898065da5 | ||
|
|
e76ee39840 | ||
|
|
1b484b1c25 | ||
|
|
a8dcaffd19 | ||
|
|
5b960b476c | ||
|
|
bd13f01718 | ||
|
|
6bb717d8a9 | ||
|
|
828440785e | ||
|
|
55d6d3620d | ||
|
|
09d7d578b6 | ||
|
|
807991ea7d | ||
|
|
8b59919829 | ||
|
|
13d8351166 | ||
|
|
dfd527ae68 | ||
|
|
40d2c95df4 | ||
|
|
57ef395ad2 | ||
|
|
8b68db4c75 | ||
|
|
38d9085acf | ||
|
|
659cd2c92b | ||
|
|
df3a449a72 | ||
|
|
c7b47b1e6c | ||
|
|
f2a090169f | ||
|
|
3acd3a5209 | ||
|
|
1887d25497 | ||
|
|
6d4ac8e10e | ||
|
|
57d47ca1d4 | ||
|
|
fe1922586e | ||
|
|
ddaef1a827 | ||
|
|
e327457af7 | ||
|
|
fc184d42f7 | ||
|
|
c0e9d3b347 | ||
|
|
757757af2b | ||
|
|
5803e3bc85 | ||
|
|
442e62d76c | ||
|
|
086e9a926f | ||
|
|
90a341de2f | ||
|
|
d4ea6d146a | ||
|
|
af991b4008 | ||
|
|
c17017be9b | ||
|
|
e9fcca84db | ||
|
|
6aa7fa589e | ||
|
|
5a07b0a8be | ||
|
|
d9363e7486 | ||
|
|
7aab1b611a | ||
|
|
64be22f08e | ||
|
|
83a13b83d3 | ||
|
|
abbf3e8a4f | ||
|
|
971265eb6b | ||
|
|
f14a699c08 | ||
|
|
2aea0350eb | ||
|
|
18a556bce0 | ||
|
|
783adab8a5 | ||
|
|
1a802b5822 | ||
|
|
99bf56d031 | ||
|
|
34135f0e17 | ||
|
|
c22f23a1c4 | ||
|
|
5ef8588ad1 | ||
|
|
cef5e09a58 | ||
|
|
6933c599ad | ||
|
|
10f6a202af | ||
|
|
47bd030293 | ||
|
|
86cb201539 | ||
|
|
619856ad58 | ||
|
|
b539273351 | ||
|
|
dc4c4c3742 | ||
|
|
78e81a5e7d | ||
|
|
ae18ce444c | ||
|
|
d1b35594e7 | ||
|
|
79befe9508 | ||
|
|
cc75457e50 | ||
|
|
0fa58aaee6 | ||
|
|
a3f3f7cdaa | ||
|
|
30dc174d30 | ||
|
|
400198f7a3 | ||
|
|
347d3d7fef | ||
|
|
716af071b8 | ||
|
|
43f8bbc360 | ||
|
|
1ff76bf1a0 | ||
|
|
6da9662110 | ||
|
|
8d13668595 | ||
|
|
62dcc1f55b | ||
|
|
efb0c354a5 | ||
|
|
09c9faba9c | ||
|
|
c9a6bd2d64 | ||
|
|
5d32485fc5 | ||
|
|
b4aa93a185 | ||
|
|
a0fddbec27 | ||
|
|
533faad8c2 | ||
|
|
3a24a45ade | ||
|
|
643501b25d | ||
|
|
3c5abf88e7 | ||
|
|
bec6011c8e | ||
|
|
efc8b02d11 | ||
|
|
1c64b7bd54 | ||
|
|
1f6b7ce6ab | ||
|
|
0b518c4eb8 | ||
|
|
5c5c3113bc | ||
|
|
26b7420a2d | ||
|
|
c0d04f5870 | ||
|
|
53f3a18245 | ||
|
|
4b01bdb0d8 | ||
|
|
4222b0be1d | ||
|
|
3b99ca74ab | ||
|
|
42641396c6 | ||
|
|
04326171e7 | ||
|
|
d90d450bef |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -6,6 +6,7 @@
|
||||
/data/config.php
|
||||
/build
|
||||
/node_modules
|
||||
npm-debug.log
|
||||
/test.php
|
||||
/main.html
|
||||
|
||||
@@ -14,4 +15,5 @@
|
||||
/tests/integration/config.php
|
||||
composer.phar
|
||||
vendor/
|
||||
/custom/Espo/Custom/*
|
||||
/custom/Espo/Custom/*
|
||||
/install/config.php
|
||||
@@ -9,16 +9,13 @@ DirectoryIndex index.php index.html
|
||||
|
||||
# PROTECTED DIRECTORIES
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^/?(data|api)/ - [F]
|
||||
RewriteRule ^/?(api|client)/ - [F]
|
||||
|
||||
RewriteRule ^/?data/config\.php$ - [F]
|
||||
RewriteRule ^/?data/logs/ - [F]
|
||||
RewriteRule ^/?data/cache/ - [F]
|
||||
RewriteRule ^/?data/upload/ - [F]
|
||||
RewriteRule ^/?data/\.backup/ - [F]
|
||||
RewriteRule ^/?data/ - [F]
|
||||
RewriteRule ^/?application/ - [F]
|
||||
RewriteRule ^/?custom/ - [F]
|
||||
RewriteRule ^/?vendor/ - [F]
|
||||
RewriteRule ^/?client/?$ - [F]
|
||||
#END PROTECTED DIRECTORIES
|
||||
|
||||
RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
|
||||
|
||||
47
Gruntfile.js
47
Gruntfile.js
@@ -2,8 +2,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,13 +30,15 @@ module.exports = function (grunt) {
|
||||
'client/lib/jquery-ui.min.js',
|
||||
'client/lib/jquery.ui.touch-punch.min.js',
|
||||
'client/lib/moment.min.js',
|
||||
'client/lib/moment-timezone-with-data.min.js',
|
||||
'client/lib/moment-timezone.min.js',
|
||||
'client/lib/moment-timezone-data.js',
|
||||
'client/lib/jquery.timepicker.min.js',
|
||||
'client/lib/jquery.autocomplete.js',
|
||||
'client/lib/bootstrap.min.js',
|
||||
'client/lib/bootstrap-datepicker.js',
|
||||
'client/lib/bull.js',
|
||||
'client/lib/marked.min.js',
|
||||
'client/lib/autobahn.js',
|
||||
|
||||
'client/src/namespace.js',
|
||||
'client/src/exceptions.js',
|
||||
@@ -87,12 +89,16 @@ module.exports = function (grunt) {
|
||||
themeList.push(file.substr(0, file.length - 5));
|
||||
});
|
||||
|
||||
var cssminFilesData = {};
|
||||
var lessData = {};
|
||||
themeList.forEach(function (theme) {
|
||||
var name = camelCaseToHyphen(theme);
|
||||
var files = {};
|
||||
files['client/css/espo/'+name+'.css'] = 'frontend/less/'+name+'/main.less';
|
||||
files['client/css/espo/'+name+'-iframe.css'] = 'frontend/less/'+name+'/iframe/main.less';
|
||||
|
||||
cssminFilesData['client/css/espo/'+name+'.css'] = 'client/css/espo/'+name+'.css';
|
||||
cssminFilesData['client/css/espo/'+name+'-iframe.css'] = 'client/css/espo/'+name+'-iframe.css';
|
||||
var o = {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
@@ -117,16 +123,22 @@ module.exports = function (grunt) {
|
||||
}
|
||||
},
|
||||
clean: {
|
||||
start: ['build/*'],
|
||||
start: ['build/EspoCRM-*'],
|
||||
final: ['build/tmp'],
|
||||
beforeFinal: {
|
||||
src: ['build/tmp/custom/Espo/Custom/*', '!build/tmp/custom/Espo/Custom/.htaccess']
|
||||
src: ['build/tmp/custom/Espo/Custom/*', '!build/tmp/custom/Espo/Custom/.htaccess', 'build/tmp/install/config.php']
|
||||
}
|
||||
},
|
||||
less: lessData,
|
||||
cssmin: {
|
||||
themes: {
|
||||
files: cssminFilesData
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
mangle: false,
|
||||
sourceMap: true,
|
||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
|
||||
},
|
||||
'build/tmp/client/espo.min.js': jsFilesToMinify.map(function (item) {
|
||||
@@ -176,6 +188,9 @@ module.exports = function (grunt) {
|
||||
'clear_cache.php',
|
||||
'upgrade.php',
|
||||
'extension.php',
|
||||
'websocket.php',
|
||||
'command.php',
|
||||
'oauth-callback.php',
|
||||
'index.php',
|
||||
'LICENSE.txt',
|
||||
'.htaccess',
|
||||
@@ -226,26 +241,6 @@ module.exports = function (grunt) {
|
||||
}
|
||||
},
|
||||
replace: {
|
||||
timestamp: {
|
||||
options: {
|
||||
patterns: [
|
||||
{
|
||||
match: 'timestamp',
|
||||
replacement: '<%= new Date().getTime() %>'
|
||||
}
|
||||
]
|
||||
},
|
||||
files: [
|
||||
{
|
||||
src: 'build/tmp/html/main.html',
|
||||
dest: 'build/tmp/html/main.html'
|
||||
},
|
||||
{
|
||||
src: 'build/tmp/html/portal.html',
|
||||
dest: 'build/tmp/html/portal.html'
|
||||
}
|
||||
]
|
||||
},
|
||||
version: {
|
||||
options: {
|
||||
patterns: [
|
||||
@@ -290,6 +285,7 @@ module.exports = function (grunt) {
|
||||
'clean:start',
|
||||
'mkdir:tmp',
|
||||
'less',
|
||||
'cssmin',
|
||||
'uglify',
|
||||
'copy:frontendFolders',
|
||||
'copy:frontendLib',
|
||||
@@ -300,5 +296,4 @@ module.exports = function (grunt) {
|
||||
'chmod',
|
||||
'clean:final'
|
||||
]);
|
||||
|
||||
};
|
||||
|
||||
11
README.md
11
README.md
@@ -8,8 +8,8 @@ Download the latest release from our [website](http://www.espocrm.com).
|
||||
|
||||
### Requirements
|
||||
|
||||
* PHP 5.6 or above (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.5.3 or above, or MariaDB.
|
||||
* PHP 7.1 or above (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.6.0 or above, or MariaDB.
|
||||
|
||||
For more information about server configuration see [this article](https://www.espocrm.com/documentation/administration/server-configuration/).
|
||||
|
||||
@@ -54,9 +54,9 @@ Before we can merge your pull request you need to accept our CLA [here](https://
|
||||
|
||||
Branches:
|
||||
|
||||
* hotfix/* – an upcoming maintenance release; fixes should be pushed to this branch;
|
||||
* master – an upcoming minor or major release; new features should be pushed to this branch;
|
||||
* stable – a last stable release.
|
||||
* hotfix/* – upcoming maintenance release; fixes should be pushed to this branch;
|
||||
* master – develop branch; new features should be pushed to this branch;
|
||||
* stable – last stable release.
|
||||
|
||||
### How to make a translation
|
||||
|
||||
@@ -76,4 +76,3 @@ Json files will be created in build directory grouped by folders.
|
||||
### License
|
||||
|
||||
EspoCRM is published under the GNU GPLv3 [license](https://raw.githubusercontent.com/espocrm/espocrm/master/LICENSE.txt).
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,6 +46,21 @@ class Note extends \Espo\Core\Acl\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
if ($parent) {
|
||||
if ($this->getAclManager()->checkEntity($user, $parent, 'stream')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkEntityEdit(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
73
application/Espo/Acl/Webhook.php
Normal file
73
application/Espo/Acl/Webhook.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Acl;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Webhook extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
return $user->id === $entity->get('userId') && $user->isApi();
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) return true;
|
||||
if (!$data) return false;
|
||||
if ($user->isApi() && $user->id === $entity->get('userId')) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) return true;
|
||||
if (!$data) return false;
|
||||
if ($user->isApi() && $user->id === $entity->get('userId')) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityDelete(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) return true;
|
||||
if (!$data) return false;
|
||||
if ($user->isApi() && $user->id === $entity->get('userId')) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityEdit(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) return true;
|
||||
if (!$data) return false;
|
||||
if ($user->isApi() && $user->id === $entity->get('userId')) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,5 +41,26 @@ class Note extends \Espo\Core\AclPortal\Base
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('type') !== 'Post') return false;
|
||||
|
||||
if ($entity->get('type') === 'Post' && $entity->get('targetType')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$entity->get('parentId') || !$entity->get('parentType')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
if ($parent) {
|
||||
if ($this->getAclManager()->checkEntity($user, $parent, 'stream')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -33,39 +33,43 @@ use \Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class ActionHistoryRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
public function beforeListLinked()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
public function beforeMassDelete()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassConvertCurrency()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,27 +40,32 @@ class AuthLogRecord extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassConvertCurrency()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -80,17 +80,22 @@ class AuthToken extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassConvertCurrency()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
67
application/Espo/Controllers/DashboardTemplate.php
Normal file
67
application/Espo/Controllers/DashboardTemplate.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class DashboardTemplate extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function postActionDeployToUsers($params, $data)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (empty($data->userIdList)) throw new BadRequest();
|
||||
|
||||
return $this->getServiceFactory()->create('DashboardTemplate')->deployToUsers(
|
||||
$data->id,
|
||||
$data->userIdList,
|
||||
!empty($data->append)
|
||||
);
|
||||
}
|
||||
|
||||
public function postActionDeployToTeam($params, $data)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (empty($data->teamId)) throw new BadRequest();
|
||||
|
||||
return $this->getServiceFactory()->create('DashboardTemplate')->deployToTeam(
|
||||
$data->id,
|
||||
$data->teamId,
|
||||
!empty($data->append)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,12 +46,8 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
return $this->getRecordService()->getCopiedAttachments($id);
|
||||
}
|
||||
|
||||
public function actionSendTestEmail($params, $data, $request)
|
||||
public function postActionSendTestEmail($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->checkScope('Email')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -34,16 +34,18 @@ use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionGetFolders($params, $data, $request)
|
||||
public function postActionGetFolders($params, $data)
|
||||
{
|
||||
return $this->getRecordService()->getFolders(array(
|
||||
'host' => $request->get('host'),
|
||||
'port' => $request->get('port'),
|
||||
'ssl' => $request->get('ssl') === 'true',
|
||||
'username' => $request->get('username'),
|
||||
'password' => $request->get('password'),
|
||||
'id' => $request->get('id')
|
||||
));
|
||||
return $this->getRecordService()->getFolders([
|
||||
'host' => $data->host ?? null,
|
||||
'port' => $data->port ?? null,
|
||||
'ssl' => $data->ssl ?? false,
|
||||
'username' => $data->username ?? null,
|
||||
'password' => $data->password ?? null,
|
||||
'id' => $data->id ?? null,
|
||||
'emailAddress' => $data->emailAddress ?? null,
|
||||
'userId' => $data->userId ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function checkControllerAccess()
|
||||
@@ -53,12 +55,8 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionTestConnection($params, $data, $request)
|
||||
public function postActionTestConnection($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data->password)) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data->id);
|
||||
if (!$emailAccount || !$emailAccount->id) {
|
||||
@@ -75,4 +73,3 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
return $this->getRecordService()->testConnection(get_object_vars($data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -92,6 +92,9 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
if (isset($data['fullTextSearch'])) {
|
||||
$params['fullTextSearch'] = $data['fullTextSearch'];
|
||||
}
|
||||
if (isset($data['countDisabled'])) {
|
||||
$params['countDisabled'] = $data['countDisabled'];
|
||||
}
|
||||
|
||||
$params['kanbanViewMode'] = !empty($data['kanbanViewMode']);
|
||||
if (!empty($data['kanbanStatusIgnoreList'])) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -94,25 +94,6 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
return true;
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionDelete($params, $data, $request)
|
||||
{
|
||||
@@ -129,22 +110,42 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
return true;
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforePatch()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeListLinked()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeMassDelete()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -47,17 +47,27 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
public function actionList($params, $data, $request)
|
||||
{
|
||||
$integrations = $this->getEntityManager()->getRepository('Integration')->find();
|
||||
$arr = array();
|
||||
|
||||
$list = [];
|
||||
foreach ($integrations as $entity) {
|
||||
if ($entity->get('enabled') && $this->getMetadata()->get('integrations.' . $entity->id .'.allowUserAccounts')) {
|
||||
$arr[] = array(
|
||||
|
||||
$userAccountAclScope = $this->getMetadata()->get(['integrations', $entity->id, 'userAccountAclScope']);
|
||||
|
||||
if ($userAccountAclScope) {
|
||||
if (!$this->getAcl()->checkScope($userAccountAclScope)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$list[] = [
|
||||
'id' => $entity->id
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
return array(
|
||||
'list' => $arr
|
||||
);
|
||||
return [
|
||||
'list' => $list
|
||||
];
|
||||
}
|
||||
|
||||
public function actionGetOAuth2Info($params, $data, $request)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -121,6 +121,8 @@ class FieldManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
$this->getContainer()->get('fieldManager')->resetToDefault($data->scope, $data->name);
|
||||
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuildMetadata();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -33,9 +33,13 @@ class I18n extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function actionRead($params, $data, $request)
|
||||
{
|
||||
if ($request->get('default')) {
|
||||
$default = $request->get('default') === 'true';
|
||||
|
||||
return $this->getServiceFactory()->create('Language')->getDataForFrontend($default);
|
||||
|
||||
/*if ($request->get('default')) {
|
||||
return $this->getContainer()->get('defaultLanguage')->getAll();
|
||||
}
|
||||
return $this->getContainer()->get('language')->getAll();
|
||||
return $this->getContainer()->get('language')->getAll();*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -43,27 +43,27 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
public function beforePatch()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -93,9 +93,9 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
$attachment->set('contents', $contents);
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
|
||||
return array(
|
||||
return [
|
||||
'attachmentId' => $attachment->id
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public function actionRevert($params, $data, $request)
|
||||
@@ -175,7 +175,7 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
$timezone = $data->timezone;
|
||||
}
|
||||
|
||||
$importParams = array(
|
||||
$importParams = [
|
||||
'headerRow' => !empty($data->headerRow),
|
||||
'delimiter' => $data->delimiter,
|
||||
'textQualifier' => $data->textQualifier,
|
||||
@@ -188,8 +188,9 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
'defaultValues' => $data->defaultValues,
|
||||
'action' => $data->action,
|
||||
'skipDuplicateChecking' => !empty($data->skipDuplicateChecking),
|
||||
'idleMode' => !empty($data->idleMode)
|
||||
);
|
||||
'idleMode' => !empty($data->idleMode),
|
||||
'silentMode' => !empty($data->silentMode),
|
||||
];
|
||||
|
||||
if (property_exists($data, 'updateBy')) {
|
||||
$importParams['updateBy'] = $data->updateBy;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,24 +41,20 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionGetFolders($params, $data, $request)
|
||||
public function postActionGetFolders($params, $data, $request)
|
||||
{
|
||||
return $this->getRecordService()->getFolders(array(
|
||||
'host' => $request->get('host'),
|
||||
'port' => $request->get('port'),
|
||||
'ssl' => $request->get('ssl') === 'true',
|
||||
'username' => $request->get('username'),
|
||||
'password' => $request->get('password'),
|
||||
'id' => $request->get('id')
|
||||
));
|
||||
return $this->getRecordService()->getFolders([
|
||||
'host' => $data->host ?? null,
|
||||
'port' => $data->port ?? null,
|
||||
'ssl' => $data->ssl ?? false,
|
||||
'username' => $data->username ?? null,
|
||||
'password' => $data->password ?? null,
|
||||
'id' => $data->id ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionTestConnection($params, $data, $request)
|
||||
public function postActionTestConnection($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data->password)) {
|
||||
$inboundEmail = $this->getEntityManager()->getEntity('InboundEmail', $data->id);
|
||||
if (!$inboundEmail || !$inboundEmail->id) {
|
||||
@@ -69,5 +65,4 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
|
||||
return $this->getRecordService()->testConnection(get_object_vars($data));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,37 +41,37 @@ class Job extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
public function beforeCreate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
public function beforeUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
public function beforePatch()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
public function beforeListLinked()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -39,11 +39,7 @@ class Layout extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function actionRead($params, $data)
|
||||
{
|
||||
$data = $this->getContainer()->get('layout')->get($params['scope'], $params['name']);
|
||||
if (empty($data)) {
|
||||
throw new NotFound("Layout " . $params['scope'] . ":" . $params['name'] . ' is not found.');
|
||||
}
|
||||
return $data;
|
||||
return $this->getServiceFactory()->create('Layout')->getForFrontend($params['scope'], $params['name']);
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -69,4 +69,11 @@ class LeadCapture extends \Espo\Core\Controllers\Record
|
||||
|
||||
return $this->getRecordService()->generateNewApiKeyForEntity($data->id)->getValueMap();
|
||||
}
|
||||
|
||||
public function getActionSmtpAccountDataList()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
|
||||
return $this->getServiceFactory()->create('LeadCapture')->getSmtpAccountDataList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -36,7 +36,7 @@ class Metadata extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionRead($params, $data)
|
||||
{
|
||||
return $this->getMetadata()->getAllForFrontend();
|
||||
return $this->getServiceFactory()->create('Metadata')->getDataForFrontend();
|
||||
}
|
||||
|
||||
public function getActionGet($params, $data, $request)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,7 +35,7 @@ class Notification extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public static $defaultAction = 'list';
|
||||
|
||||
public function actionList($params, $data, $request)
|
||||
public function getActionList($params, $data, $request, $response)
|
||||
{
|
||||
$userId = $this->getUser()->id;
|
||||
|
||||
@@ -73,29 +73,28 @@ class Notification extends \Espo\Core\Controllers\Record
|
||||
return $this->getService('Notification')->markAllRead($userId);
|
||||
}
|
||||
|
||||
public function actionExport($params, $data, $request)
|
||||
public function beforeExport()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
public function beforeMassUpdate()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function beforeRemoveLink()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionMerge($params, $data, $request)
|
||||
public function beforeMerge()
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,10 +25,12 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class ScheduledJob extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,10 +25,12 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class ScheduledJobLogRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
@@ -38,4 +40,3 @@ class ScheduledJobLogRecord extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -29,18 +29,22 @@
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class Settings extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
|
||||
protected function getConfigData()
|
||||
{
|
||||
$data = $this->getServiceFactory()->create('Settings')->getConfigData();
|
||||
|
||||
$data->jsLibs = $this->getMetadata()->get('app.jsLibs');
|
||||
$data->jsLibs = $this->getMetadata()->get(['app', 'jsLibs']);
|
||||
|
||||
unset($data->loginView);
|
||||
$loginView = $this->getMetadata()->get(['clientDefs', 'App', 'loginView']);
|
||||
if ($loginView) {
|
||||
$data->loginView = $loginView;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,6 +46,7 @@ class Stream extends \Espo\Core\Controllers\Base
|
||||
$maxSize = intval($request->get('maxSize'));
|
||||
$after = $request->get('after');
|
||||
$filter = $request->get('filter');
|
||||
$skipOwn = $request->get('skipOwn') === 'true';
|
||||
|
||||
$service = $this->getService('Stream');
|
||||
|
||||
@@ -61,7 +62,8 @@ class Stream extends \Espo\Core\Controllers\Base
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'after' => $after,
|
||||
'filter' => $filter
|
||||
'filter' => $filter,
|
||||
'skipOwn' => $skipOwn,
|
||||
]);
|
||||
|
||||
return (object) [
|
||||
@@ -96,7 +98,7 @@ class Stream extends \Espo\Core\Controllers\Base
|
||||
'maxSize' => $maxSize,
|
||||
'after' => $after,
|
||||
'filter' => 'posts',
|
||||
'where' => $where
|
||||
'where' => $where,
|
||||
]);
|
||||
|
||||
return (object) [
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -69,24 +69,28 @@ class User extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$p = $this->getEntityManager()->getRepository('PasswordChangeRequest')->where(array(
|
||||
'requestId' => $data->requestId
|
||||
))->findOne();
|
||||
if ($this->getConfig()->get('passwordRecoveryDisabled')) {
|
||||
throw new Forbidden("Password recovery disabled");
|
||||
}
|
||||
|
||||
if (!$p) {
|
||||
$request = $this->getEntityManager()->getRepository('PasswordChangeRequest')->where([
|
||||
'requestId' => $data->requestId
|
||||
])->findOne();
|
||||
|
||||
if (!$request) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
$userId = $p->get('userId');
|
||||
|
||||
$userId = $request->get('userId');
|
||||
if (!$userId) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
$this->getEntityManager()->removeEntity($p);
|
||||
|
||||
if ($this->getService('User')->changePassword($userId, $data->password)) {
|
||||
return array(
|
||||
'url' => $p->get('url')
|
||||
);
|
||||
$this->getEntityManager()->removeEntity($request);
|
||||
return [
|
||||
'url' => $request->get('url')
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,17 +110,28 @@ class User extends \Espo\Core\Controllers\Record
|
||||
return $this->getService('User')->passwordChangeRequest($userName, $emailAddress, $url);
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
public function postActionGenerateNewApiKey($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
|
||||
return parent::actionCreateLink($params, $data, $request);
|
||||
return $this->getRecordService()->generateNewApiKeyForEntity($data->id)->getValueMap();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
public function postActionGenerateNewPassword($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
$this->getRecordService()->generateNewPasswordForUser($data->id);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function beforeCreateLink()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
}
|
||||
|
||||
return parent::actionRemoveLink($params, $data, $request);
|
||||
public function beforeRemoveLink($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
77
application/Espo/Controllers/UserSecurity.php
Normal file
77
application/Espo/Controllers/UserSecurity.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\NotFound;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class UserSecurity extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin() && !$this->getUser()->isRegular()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function getActionRead($params, $data, $request)
|
||||
{
|
||||
$id = $params['id'] ?? null;
|
||||
|
||||
if (!$id) throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin() && $id !== $this->getUser()->id) throw new Forbidden();
|
||||
|
||||
return $this->getService('UserSecurity')->read($id);
|
||||
}
|
||||
|
||||
public function postActionGenerate2FAData($params, $data)
|
||||
{
|
||||
$data = $data ?? (object) [];
|
||||
$id = $data->id;
|
||||
|
||||
if (!$id) throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin() && $id !== $this->getUser()->id) throw new Forbidden();
|
||||
|
||||
return $this->getService('UserSecurity')->generate2FAData($id, $data);
|
||||
}
|
||||
|
||||
public function putActionUpdate($params, $data)
|
||||
{
|
||||
$id = $params['id'] ?? null;
|
||||
$data = $data ?? (object) [];
|
||||
|
||||
if (!$id) throw new BadRequest();
|
||||
if (!$this->getUser()->isAdmin() && $id !== $this->getUser()->id) throw new Forbidden();
|
||||
|
||||
return $this->getService('UserSecurity')->update($id, $data);
|
||||
}
|
||||
}
|
||||
50
application/Espo/Controllers/Webhook.php
Normal file
50
application/Espo/Controllers/Webhook.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
|
||||
class Webhook extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin() && !$this->getUser()->isApi()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request, $response = null)
|
||||
{
|
||||
$result = parent::actionCreate($params, $data, $request, $response);
|
||||
if ($response) $response->setStatus(201);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -124,6 +124,11 @@ class Acl
|
||||
return $this->getAclManager()->getScopeForbiddenFieldList($this->getUser(), $scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function getScopeForbiddenLinkList($scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
return $this->getAclManager()->getScopeForbiddenLinkList($this->getUser(), $scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function checkUserPermission($target, $permissionType = 'userPermission')
|
||||
{
|
||||
return $this->getAclManager()->checkUserPermission($this->getUser(), $target, $permissionType);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -36,15 +36,17 @@ use \Espo\ORM\Entity;
|
||||
|
||||
class Base implements Injectable
|
||||
{
|
||||
protected $dependencies = array(
|
||||
protected $dependencyList = [
|
||||
'config',
|
||||
'entityManager',
|
||||
'aclManager'
|
||||
);
|
||||
'aclManager',
|
||||
];
|
||||
|
||||
protected $dependencies = []; // for backward compatibility
|
||||
|
||||
protected $scope;
|
||||
|
||||
protected $injections = array();
|
||||
protected $injections = [];
|
||||
|
||||
protected $ownerUserIdAttribute = null;
|
||||
|
||||
@@ -79,12 +81,12 @@ class Base implements Injectable
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencies[] = $name;
|
||||
$this->dependencyList[] = $name;
|
||||
}
|
||||
|
||||
public function getDependencyList()
|
||||
{
|
||||
return $this->dependencies;
|
||||
return array_merge($this->dependencyList, $this->dependencies);
|
||||
}
|
||||
|
||||
protected function getConfig()
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -60,21 +60,45 @@ class GlobalRestricton
|
||||
public function __construct(
|
||||
\Espo\Core\Utils\Metadata $metadata,
|
||||
\Espo\Core\Utils\File\Manager $fileManager,
|
||||
\Espo\Core\Utils\FieldManagerUtil $fieldManagerUtil
|
||||
\Espo\Core\Utils\FieldManagerUtil $fieldManagerUtil,
|
||||
bool $useCache = true
|
||||
)
|
||||
{
|
||||
$this->metadata = $metadata;
|
||||
$this->fileManager = $fileManager;
|
||||
$this->fieldManagerUtil = $fieldManagerUtil;
|
||||
|
||||
if (!file_exists($this->cacheFilePath)) {
|
||||
$this->buildCacheFile();
|
||||
$isFromCache = false;
|
||||
|
||||
if ($useCache) {
|
||||
if (file_exists($this->cacheFilePath)) {
|
||||
$this->data = include($this->cacheFilePath);
|
||||
$isFromCache = true;
|
||||
|
||||
if (!($this->data instanceof \StdClass)) {
|
||||
$GLOBALS['log']->error("ACL GlobalRestricton: Bad data fetched from cache.");
|
||||
$this->data = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->data = include($this->cacheFilePath);
|
||||
if (!$this->data) {
|
||||
$this->buildData();
|
||||
}
|
||||
|
||||
if ($useCache) {
|
||||
if (!$isFromCache) {
|
||||
$this->storeCacheFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function buildCacheFile()
|
||||
protected function storeCacheFile()
|
||||
{
|
||||
$this->getFileManager()->putPhpContents($this->cacheFilePath, $this->data, true);
|
||||
}
|
||||
|
||||
protected function buildData()
|
||||
{
|
||||
$scopeList = array_keys($this->getMetadata()->get(['entityDefs'], []));
|
||||
|
||||
@@ -127,8 +151,6 @@ class GlobalRestricton
|
||||
}
|
||||
|
||||
$this->data = $data;
|
||||
|
||||
$this->getFileManager()->putPhpContents($this->cacheFilePath, $data, true);
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -88,7 +88,7 @@ class Table
|
||||
if ($this->isStrictModeForced) {
|
||||
$this->isStrictMode = true;
|
||||
} else {
|
||||
$this->isStrictMode = $config->get('aclStrictMode', false);
|
||||
$this->isStrictMode = $config->get('aclStrictMode', true);
|
||||
}
|
||||
|
||||
$this->user = $user;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,9 +41,9 @@ class AclManager
|
||||
|
||||
private $metadata;
|
||||
|
||||
private $implementationHashMap = array();
|
||||
private $implementationHashMap = [];
|
||||
|
||||
private $tableHashMap = array();
|
||||
private $tableHashMap = [];
|
||||
|
||||
protected $tableClassName = '\\Espo\\Core\\Acl\\Table';
|
||||
|
||||
@@ -59,7 +59,8 @@ class AclManager
|
||||
$this->globalRestricton = new \Espo\Core\Acl\GlobalRestricton(
|
||||
$container->get('metadata'),
|
||||
$container->get('fileManager'),
|
||||
$container->get('fieldManagerUtil')
|
||||
$container->get('fieldManagerUtil'),
|
||||
$container->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,8 +94,8 @@ class AclManager
|
||||
|
||||
if (class_exists($className)) {
|
||||
$acl = new $className($scope);
|
||||
$dependencies = $acl->getDependencyList();
|
||||
foreach ($dependencies as $name) {
|
||||
$dependencyList = $acl->getDependencyList();
|
||||
foreach ($dependencyList as $name) {
|
||||
$acl->inject($name, $this->getContainer()->get($name));
|
||||
}
|
||||
$this->implementationHashMap[$scope] = $acl;
|
||||
@@ -309,6 +310,22 @@ class AclManager
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
public function getScopeForbiddenLinkList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
$list = [];
|
||||
|
||||
if ($thresholdLevel === 'no') {
|
||||
$list = array_merge(
|
||||
$list,
|
||||
$this->getScopeRestrictedLinkList($scope, $this->getGlobalRestrictionTypeList($user, $action))
|
||||
);
|
||||
$list = array_values($list);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function checkUserPermission(User $user, $target, $permissionType = 'userPermission')
|
||||
{
|
||||
$permission = $this->get($user, $permissionType);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -104,6 +104,13 @@ class Base extends \Espo\Core\Acl\Base
|
||||
}
|
||||
if ($inAccount) {
|
||||
return true;
|
||||
} else {
|
||||
if (is_null($isOwnContact) && $entity) {
|
||||
$isOwnContact = $this->checkIsOwnContact($user, $entity);
|
||||
}
|
||||
if ($isOwnContact) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +124,6 @@ class Base extends \Espo\Core\Acl\Base
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public function checkReadOnlyAccount(User $user, $data)
|
||||
@@ -152,13 +158,13 @@ class Base extends \Espo\Core\Acl\Base
|
||||
{
|
||||
$accountIdList = $user->getLinkMultipleIdList('accounts');
|
||||
if (count($accountIdList)) {
|
||||
if ($entity->hasAttribute('accountId')) {
|
||||
if ($entity->hasAttribute('accountId') && $entity->getRelationParam('account', 'entity') === 'Account') {
|
||||
if (in_array($entity->get('accountId'), $accountIdList)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasRelation('accounts')) {
|
||||
if ($entity->hasRelation('accounts') && $entity->getRelationParam('accounts', 'entity') === 'Account') {
|
||||
$repository = $this->getEntityManager()->getRepository($entity->getEntityType());
|
||||
foreach ($accountIdList as $accountId) {
|
||||
if ($repository->isRelated($entity, 'accounts', $accountId)) {
|
||||
@@ -183,13 +189,13 @@ class Base extends \Espo\Core\Acl\Base
|
||||
{
|
||||
$contactId = $user->get('contactId');
|
||||
if ($contactId) {
|
||||
if ($entity->hasAttribute('contactId')) {
|
||||
if ($entity->hasAttribute('contactId') && $entity->getRelationParam('contact', 'entity') === 'Contact') {
|
||||
if ($entity->get('contactId') === $contactId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasRelation('contacts')) {
|
||||
if ($entity->hasRelation('contacts') && $entity->getRelationParam('contacts', 'entity') === 'Contact') {
|
||||
$repository = $this->getEntityManager()->getRepository($entity->getEntityType());
|
||||
if ($repository->isRelated($entity, 'contacts', $contactId)) {
|
||||
return true;
|
||||
@@ -207,6 +213,4 @@ class Base extends \Espo\Core\Acl\Base
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -99,7 +99,7 @@ class Application
|
||||
exit;
|
||||
}
|
||||
|
||||
public function runEntryPoint($entryPoint, $data = array(), $final = false)
|
||||
public function runEntryPoint($entryPoint, $data = [], $final = false)
|
||||
{
|
||||
if (empty($entryPoint)) {
|
||||
throw new \Error();
|
||||
@@ -133,7 +133,9 @@ class Application
|
||||
|
||||
$slim->run();
|
||||
} catch (\Exception $e) {
|
||||
$container->get('output')->processError($e->getMessage(), $e->getCode(), true, $e);
|
||||
try {
|
||||
$container->get('output')->processError($e->getMessage(), $e->getCode(), true, $e);
|
||||
} catch (\Slim\Exception\Stop $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +159,11 @@ class Application
|
||||
$interval = $this->getConfig()->get('daemonInterval');
|
||||
$timeout = $this->getConfig()->get('daemonProcessTimeout');
|
||||
|
||||
$phpExecutablePath = $this->getConfig()->get('phpExecutablePath');
|
||||
if (!$phpExecutablePath) {
|
||||
$phpExecutablePath = (new \Symfony\Component\Process\PhpExecutableFinder)->find();
|
||||
}
|
||||
|
||||
if (!$maxProcessNumber || !$interval) {
|
||||
$GLOBALS['log']->error("Daemon config params are not set.");
|
||||
return;
|
||||
@@ -169,18 +176,19 @@ class Application
|
||||
foreach ($processList as $i => $process) {
|
||||
if ($process->isRunning()) {
|
||||
$runningCount++;
|
||||
} else if ($process->isRunning()) {
|
||||
} else {
|
||||
unset($processList[$i]);
|
||||
}
|
||||
}
|
||||
$processList = array_values($processList);
|
||||
if (count($runningCount) >= $maxProcessNumber) {
|
||||
if ($runningCount >= $maxProcessNumber) {
|
||||
$toSkip = true;
|
||||
}
|
||||
if (!$toSkip) {
|
||||
$process = new \Symfony\Component\Process\Process(['php', 'cron.php']);
|
||||
$process = new \Symfony\Component\Process\Process([$phpExecutablePath, 'cron.php']);
|
||||
$process->setTimeout($timeout);
|
||||
$process->run();
|
||||
$processList[] = $process;
|
||||
}
|
||||
sleep($interval);
|
||||
}
|
||||
@@ -207,6 +215,15 @@ class Application
|
||||
$dataManager->clearCache();
|
||||
}
|
||||
|
||||
public function runCommand(string $command)
|
||||
{
|
||||
$auth = $this->createAuth();
|
||||
$auth->useNoAuth();
|
||||
|
||||
$consoleCommandManager = $this->getContainer()->get('consoleCommandManager');
|
||||
return $consoleCommandManager->run($command);
|
||||
}
|
||||
|
||||
public function isInstalled()
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
@@ -247,7 +264,7 @@ class Application
|
||||
}
|
||||
|
||||
$routeOptions = call_user_func($route->getCallable());
|
||||
$routeKeys = is_array($routeOptions) ? array_keys($routeOptions) : array();
|
||||
$routeKeys = is_array($routeOptions) ? array_keys($routeOptions) : [];
|
||||
|
||||
if (!in_array('controller', $routeKeys, true)) {
|
||||
return $container->get('output')->render($routeOptions);
|
||||
@@ -299,8 +316,6 @@ class Application
|
||||
protected function getRouteList()
|
||||
{
|
||||
$routes = new \Espo\Core\Utils\Route($this->getConfig(), $this->getMetadata(), $this->getContainer()->get('fileManager'));
|
||||
|
||||
|
||||
return $routes->getAll();
|
||||
}
|
||||
|
||||
@@ -315,7 +330,7 @@ class Application
|
||||
continue;
|
||||
}
|
||||
|
||||
$currentRoute = $this->getSlim()->$method($route['route'], function() use ($route) { //todo change "use" for php 5.4
|
||||
$currentRoute = $this->getSlim()->$method($route['route'], function() use ($route) {
|
||||
return $route['params'];
|
||||
});
|
||||
|
||||
@@ -328,30 +343,7 @@ class Application
|
||||
protected function initAutoloads()
|
||||
{
|
||||
$autoload = new \Espo\Core\Utils\Autoload($this->getConfig(), $this->getMetadata(), $this->getContainer()->get('fileManager'));
|
||||
|
||||
try {
|
||||
$autoloadList = $autoload->getAll();
|
||||
} catch (\Exception $e) {} //bad permissions
|
||||
|
||||
if (empty($autoloadList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$namespacesPath = 'vendor/composer/autoload_namespaces.php';
|
||||
$existingNamespaces = file_exists($namespacesPath) ? include($namespacesPath) : array();
|
||||
if (!empty($existingNamespaces) && is_array($existingNamespaces)) {
|
||||
$existingNamespaces = array_keys($existingNamespaces);
|
||||
}
|
||||
|
||||
$classLoader = new \Composer\Autoload\ClassLoader();
|
||||
|
||||
foreach ($autoloadList as $prefix => $path) {
|
||||
if (!in_array($prefix, $existingNamespaces)) {
|
||||
$classLoader->add($prefix, $path);
|
||||
}
|
||||
}
|
||||
|
||||
$classLoader->register(true);
|
||||
$autoload->register();
|
||||
}
|
||||
|
||||
public function setBasePath($basePath)
|
||||
@@ -370,7 +362,9 @@ class Application
|
||||
return $_GET['portalId'];
|
||||
}
|
||||
if (!empty($_COOKIE['auth-token'])) {
|
||||
$token = $this->getContainer()->get('entityManager')->getRepository('AuthToken')->where(array('token' => $_COOKIE['auth-token']))->findOne();
|
||||
$token =
|
||||
$this->getContainer()->get('entityManager')
|
||||
->getRepository('AuthToken')->where(['token' => $_COOKIE['auth-token']])->findOne();
|
||||
|
||||
if ($token && $token->get('portalId')) {
|
||||
return $token->get('portalId');
|
||||
|
||||
78
application/Espo/Core/Console/CommandManager.php
Normal file
78
application/Espo/Core/Console/CommandManager.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console;
|
||||
|
||||
class CommandManager
|
||||
{
|
||||
private $container;
|
||||
|
||||
public function __construct(\Espo\Core\Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function run(string $command)
|
||||
{
|
||||
$command = ucfirst(\Espo\Core\Utils\Util::hyphenToCamelCase($command));
|
||||
|
||||
$argumentList = [];
|
||||
$options = [];
|
||||
$flagList = [];
|
||||
|
||||
$skipIndex = 1;
|
||||
if (isset($_SERVER['argv'][0]) && $_SERVER['argv'][0] === 'command.php') {
|
||||
$skipIndex = 2;
|
||||
}
|
||||
|
||||
foreach ($_SERVER['argv'] as $i => $item) {
|
||||
if ($i < $skipIndex) continue;
|
||||
|
||||
if (strpos($item, '--') === 0 && strpos($item, '=') > 2) {
|
||||
list($name, $value) = explode('=', substr($item, 2));
|
||||
$name = \Espo\Core\Utils\Util::hyphenToCamelCase($name);
|
||||
$options[$name] = $value;
|
||||
} else if (strpos($item, '-') === 0) {
|
||||
$flagList[] = substr($item, 1);
|
||||
} else {
|
||||
$argumentList[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
$className = '\\Espo\\Core\\Console\\Commands\\' . $command;
|
||||
$className = $this->container->get('metadata')->get(['app', 'consoleCommands', $command, 'className'], $className);
|
||||
if (!class_exists($className)) {
|
||||
$msg = "Command '{$command}' does not exist.";
|
||||
echo $msg . "\n";
|
||||
throw new \Espo\Core\Exceptions\Error($msg);
|
||||
}
|
||||
$impl = new $className($this->container);
|
||||
return $impl->run($options, $flagList, $argumentList);
|
||||
}
|
||||
}
|
||||
87
application/Espo/Core/Console/Commands/AclCheck.php
Normal file
87
application/Espo/Core/Console/Commands/AclCheck.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class AclCheck extends Base
|
||||
{
|
||||
public function run($options)
|
||||
{
|
||||
$userId = $options['userId'] ?? null;
|
||||
$scope = $options['scope'] ?? null;
|
||||
$id = $options['id'] ?? null;
|
||||
$action = $options['action'] ?? null;
|
||||
|
||||
if (empty($userId)) return;
|
||||
if (empty($scope)) return;
|
||||
if (empty($id)) return;
|
||||
|
||||
$container = $this->getContainer();
|
||||
$entityManager = $container->get('entityManager');
|
||||
|
||||
$user = $entityManager->getEntity('User', $userId);
|
||||
if (!$user) return;
|
||||
|
||||
if ($user->isPortal()) {
|
||||
$portalIdList = $user->getLinkMultipleIdList('portals');
|
||||
foreach ($portalIdList as $portalId) {
|
||||
$application = new \Espo\Core\Portal\Application($portalId);
|
||||
$containerPortal = $application->getContainer();
|
||||
$entityManager = $containerPortal->get('entityManager');
|
||||
|
||||
$user = $entityManager->getEntity('User', $userId);
|
||||
if (!$user) return;
|
||||
|
||||
$result = $this->check($user, $scope, $id, $action, $containerPortal);
|
||||
if ($result) {
|
||||
return 'true';
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->check($user, $scope, $id, $action, $container)) {
|
||||
return 'true';
|
||||
}
|
||||
}
|
||||
|
||||
protected function check($user, $scope, $id, $action, $container)
|
||||
{
|
||||
$entityManager = $container->get('entityManager');
|
||||
|
||||
$entity = $entityManager->getEntity($scope, $id);
|
||||
if (!$entity) return;
|
||||
|
||||
$aclManager = $container->get('aclManager');
|
||||
|
||||
if ($aclManager->check($user, $entity, $action)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
56
application/Espo/Core/Console/Commands/AuthTokenCheck.php
Normal file
56
application/Espo/Core/Console/Commands/AuthTokenCheck.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class AuthTokenCheck extends Base
|
||||
{
|
||||
public function run($options, $flagList, $argumentList)
|
||||
{
|
||||
$token = $argumentList[0] ?? null;
|
||||
if (empty($token)) return;
|
||||
|
||||
$entityManager = $this->getContainer()->get('entityManager');
|
||||
|
||||
$authToken = $entityManager->getRepository('AuthToken')->where([
|
||||
'token' => $token,
|
||||
'isActive' => true,
|
||||
])->findOne();
|
||||
|
||||
if (!$authToken) return;
|
||||
if (!$authToken->get('userId')) return;
|
||||
|
||||
$userId = $authToken->get('userId');
|
||||
|
||||
$user = $entityManager->getEntity('User', $userId);
|
||||
if (!$user) return;
|
||||
|
||||
return $user->id;
|
||||
}
|
||||
}
|
||||
45
application/Espo/Core/Console/Commands/Base.php
Normal file
45
application/Espo/Core/Console/Commands/Base.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
abstract class Base
|
||||
{
|
||||
private $container;
|
||||
|
||||
public function __construct(\Espo\Core\Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
protected function getContainer()
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
}
|
||||
39
application/Espo/Core/Console/Commands/ClearCache.php
Normal file
39
application/Espo/Core/Console/Commands/ClearCache.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class ClearCache extends Base
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
echo "Cache has been cleared.\n";
|
||||
}
|
||||
}
|
||||
39
application/Espo/Core/Console/Commands/Rebuild.php
Normal file
39
application/Espo/Core/Console/Commands/Rebuild.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class Rebuild extends Base
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$this->getContainer()->get('dataManager')->rebuild();
|
||||
echo "Rebuild has been done.\n";
|
||||
}
|
||||
}
|
||||
68
application/Espo/Core/Console/Commands/RunJob.php
Normal file
68
application/Espo/Core/Console/Commands/RunJob.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class RunJob extends Base
|
||||
{
|
||||
public function run($options, $flags, $argumentList)
|
||||
{
|
||||
$jobName = $options['job'] ?? null;
|
||||
$targetId = $options['targetId'] ?? null;
|
||||
$targetType = $options['targetType'] ?? null;
|
||||
|
||||
if (!$jobName && count($argumentList)) {
|
||||
$jobName = $argumentList[0];
|
||||
}
|
||||
|
||||
if (!$jobName) echo "No job specified.\n";
|
||||
|
||||
$jobName = ucfirst(\Espo\Core\Utils\Util::hyphenToCamelCase($jobName));
|
||||
|
||||
$container = $this->getContainer();
|
||||
$entityManager = $container->get('entityManager');
|
||||
|
||||
$job = $entityManager->createEntity('Job', [
|
||||
'name' => $jobName,
|
||||
'job' => $jobName,
|
||||
'targetType' => $targetType,
|
||||
'targetId' => $targetId,
|
||||
]);
|
||||
|
||||
$cronManager = new \Espo\Core\CronManager($container);
|
||||
|
||||
$result = $cronManager->runJob($job);
|
||||
|
||||
if ($result) {
|
||||
echo "Job '{$jobName}' has been executed.\n";
|
||||
} else {
|
||||
echo "Job '{$jobName}' failed to execute.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
406
application/Espo/Core/Console/Commands/Upgrade.php
Normal file
406
application/Espo/Core/Console/Commands/Upgrade.php
Normal file
@@ -0,0 +1,406 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
class Upgrade extends Base
|
||||
{
|
||||
protected $upgradeManager;
|
||||
|
||||
protected $upgradeStepList = [
|
||||
'copyBefore',
|
||||
'rebuild',
|
||||
'beforeUpgradeScript',
|
||||
'rebuild',
|
||||
'copy',
|
||||
'rebuild',
|
||||
'copyAfter',
|
||||
'rebuild',
|
||||
'afterUpgradeScript',
|
||||
'rebuild',
|
||||
];
|
||||
|
||||
public function run($options, $flagList, $argumentList)
|
||||
{
|
||||
$params = $this->normalizeParams($options, $flagList, $argumentList);
|
||||
|
||||
switch ($params['mode']) {
|
||||
case 'local':
|
||||
$this->runLocalUpgrade($params);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'remote':
|
||||
$this->runRemoteUpgrade($params);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize params. Permitted options and flags and $arguments:
|
||||
* -y - without confirmation
|
||||
* -s - single process
|
||||
* --file="EspoCRM-upgrade.zip"
|
||||
* --step="beforeUpgradeScript"
|
||||
* @param array $options
|
||||
* @param array $flagList
|
||||
* @param array $argumentList
|
||||
* @return array
|
||||
*/
|
||||
protected function normalizeParams($options, $flagList, $argumentList)
|
||||
{
|
||||
$params = [
|
||||
'mode' => 'remote',
|
||||
'skipConfirmation' => false,
|
||||
'singleProcess' => false,
|
||||
];
|
||||
|
||||
if (!empty($options['file'])) {
|
||||
$params['mode'] = 'local';
|
||||
$params['file'] = $options['file'];
|
||||
}
|
||||
|
||||
if (in_array('y', $flagList)) {
|
||||
$params['skipConfirmation'] = true;
|
||||
}
|
||||
|
||||
if (in_array('s', $flagList)) {
|
||||
$params['singleProcess'] = true;
|
||||
}
|
||||
|
||||
if (!empty($options['step'])) {
|
||||
$params['step'] = $options['step'];
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
protected function runLocalUpgrade(array $params)
|
||||
{
|
||||
if (empty($params['file']) || !file_exists($params['file'])) {
|
||||
echo "Upgrade package is not found.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
$packageFile = $params['file'];
|
||||
$fromVersion = $this->getConfig()->get('version');
|
||||
|
||||
fwrite(\STDOUT, "Current version is {$fromVersion}.\n");
|
||||
|
||||
$upgradeId = $this->upload($packageFile);
|
||||
$manifest = $this->getUpgradeManager()->getManifestById($upgradeId);
|
||||
$nextVersion = $manifest['version'];
|
||||
|
||||
if (!$params['skipConfirmation']) {
|
||||
fwrite(\STDOUT, "EspoCRM will be upgraded to version {$nextVersion} now. Enter [Y] to continue.\n");
|
||||
|
||||
if (!$this->confirm()) {
|
||||
echo "Upgrade canceled.\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fwrite(\STDOUT, "Upgrading... This may take a while...");
|
||||
|
||||
try {
|
||||
$this->runUpgradeProcess($upgradeId, $params);
|
||||
} catch (\Exception $e) {
|
||||
fwrite(\STDOUT, "\n");
|
||||
fwrite(\STDOUT, $e->getMessage() . "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(\STDOUT, "\n");
|
||||
|
||||
$app = new \Espo\Core\Application();
|
||||
$currentVerison = $app->getContainer()->get('config')->get('version');
|
||||
|
||||
fwrite(\STDOUT, "Upgrade is complete. Current version is {$currentVerison}.\n");
|
||||
|
||||
$infoData = $this->getVersionInfo();
|
||||
$lastVersion = $infoData->lastVersion ?? null;
|
||||
|
||||
if ($lastVersion && $lastVersion !== $currentVerison && $fromVersion !== $currentVerison) {
|
||||
fwrite(\STDOUT, "Newer version is available.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($lastVersion && $lastVersion === $currentVerison) {
|
||||
fwrite(\STDOUT, "You have the latest version.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected function runRemoteUpgrade(array $params)
|
||||
{
|
||||
$infoData = $this->getVersionInfo();
|
||||
if (!$infoData) return;
|
||||
|
||||
$nextVersion = $infoData->nextVersion ?? null;
|
||||
$lastVersion = $infoData->lastVersion ?? null;
|
||||
|
||||
$fromVersion = $this->getConfig()->get('version');
|
||||
|
||||
fwrite(\STDOUT, "Current version is {$fromVersion}.\n");
|
||||
|
||||
if (!$nextVersion) {
|
||||
echo "There are no available upgrades.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$params['skipConfirmation']) {
|
||||
fwrite(\STDOUT, "EspoCRM will be upgraded to version {$nextVersion} now. Enter [Y] to continue.\n");
|
||||
|
||||
if (!$this->confirm()) {
|
||||
echo "Upgrade canceled.\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fwrite(\STDOUT, "Downloading...");
|
||||
|
||||
$upgradePackageFilePath = $this->downloadFile($infoData->nextPackage);
|
||||
if (!$upgradePackageFilePath) return;
|
||||
|
||||
fwrite(\STDOUT, "\n");
|
||||
|
||||
fwrite(\STDOUT, "Upgrading... This may take a while...");
|
||||
|
||||
$upgradeId = $this->upload($upgradePackageFilePath);
|
||||
|
||||
try {
|
||||
$this->runUpgradeProcess($upgradeId, $params);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
|
||||
$this->getFileManager()->unlink($upgradePackageFilePath);
|
||||
|
||||
fwrite(\STDOUT, "\n");
|
||||
|
||||
if (!empty($error)) {
|
||||
echo $error;
|
||||
return;
|
||||
}
|
||||
|
||||
$app = new \Espo\Core\Application();
|
||||
$currentVerison = $app->getContainer()->get('config')->get('version');
|
||||
|
||||
fwrite(\STDOUT, "Upgrade is complete. Current version is {$currentVerison}.\n");
|
||||
|
||||
if ($lastVersion && $lastVersion !== $currentVerison && $fromVersion !== $currentVerison) {
|
||||
fwrite(\STDOUT, "Newer version is available. Run command again to upgrade.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($lastVersion && $lastVersion === $currentVerison) {
|
||||
fwrite(\STDOUT, "You have the latest version.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected function upload($filePath)
|
||||
{
|
||||
try {
|
||||
$fileData = file_get_contents($filePath);
|
||||
$fileData = 'data:application/zip;base64,' . base64_encode($fileData);
|
||||
$upgradeId = $this->getUpgradeManager()->upload($fileData);
|
||||
} catch (\Exception $e) {
|
||||
die("Error: " . $e->getMessage() . "\n");
|
||||
}
|
||||
|
||||
return $upgradeId;
|
||||
}
|
||||
|
||||
protected function runUpgradeProcess($upgradeId, array $params = [])
|
||||
{
|
||||
$useSingleProcess = array_key_exists('singleProcess', $params) ? $params['singleProcess'] : false;
|
||||
|
||||
$stepList = !empty($params['step']) ? [$params['step']] : $this->upgradeStepList;
|
||||
array_unshift($stepList, 'init');
|
||||
array_push($stepList, 'finalize');
|
||||
|
||||
if (!$useSingleProcess && $this->isShellEnabled()) {
|
||||
return $this->runSteps($upgradeId, $stepList);
|
||||
}
|
||||
|
||||
return $this->runStepsInSingleProcess($upgradeId, $stepList);
|
||||
}
|
||||
|
||||
protected function runStepsInSingleProcess($upgradeId, array $stepList)
|
||||
{
|
||||
$GLOBALS['log']->debug('Installation process ['.$upgradeId.']: Single process mode.');
|
||||
|
||||
try {
|
||||
foreach ($stepList as $stepName) {
|
||||
$upgradeManager = $this->getUpgradeManager(true);
|
||||
$upgradeManager->runInstallStep($stepName, ['id' => $upgradeId]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('Upgrade Error: ' . $e->getMessage());
|
||||
throw new Error($e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function runSteps($upgradeId, array $stepList)
|
||||
{
|
||||
$phpExecutablePath = $this->getPhpExecutablePath();
|
||||
|
||||
foreach ($stepList as $stepName) {
|
||||
$command = $phpExecutablePath . " command.php upgrade-step --step=". ucfirst($stepName) ." --id=". $upgradeId;
|
||||
|
||||
$shellResult = shell_exec($command);
|
||||
if ($shellResult !== 'true') {
|
||||
$GLOBALS['log']->error('Upgrade Error: ' . $shellResult);
|
||||
throw new Error($shellResult);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function confirm()
|
||||
{
|
||||
$fh = fopen('php://stdin', 'r');
|
||||
$inputLine = trim(fgets($fh));
|
||||
fclose($fh);
|
||||
if (strtolower($inputLine) !== 'y'){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getConfig()
|
||||
{
|
||||
return $this->getContainer()->get('config');
|
||||
}
|
||||
|
||||
protected function getFileManager()
|
||||
{
|
||||
return $this->getContainer()->get('fileManager');
|
||||
}
|
||||
|
||||
protected function getUpgradeManager($reload = false)
|
||||
{
|
||||
if (!$this->upgradeManager || $reload) {
|
||||
$app = new \Espo\Core\Application();
|
||||
$app->setupSystemUser();
|
||||
|
||||
$this->upgradeManager = new \Espo\Core\UpgradeManager($app->getContainer());
|
||||
}
|
||||
|
||||
return $this->upgradeManager;
|
||||
}
|
||||
|
||||
protected function getPhpExecutablePath()
|
||||
{
|
||||
$phpExecutablePath = $this->getConfig()->get('phpExecutablePath');
|
||||
|
||||
if (!$phpExecutablePath) {
|
||||
$phpExecutablePath = (new \Symfony\Component\Process\PhpExecutableFinder)->find();
|
||||
}
|
||||
|
||||
return $phpExecutablePath;
|
||||
}
|
||||
|
||||
protected function getVersionInfo()
|
||||
{
|
||||
$url = 'https://s.espocrm.com/upgrade/next/';
|
||||
$url = $this->getConfig()->get('upgradeNextVersionUrl', $url);
|
||||
$url .= '?fromVersion=' . $this->getConfig()->get('version');
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, \CURLOPT_SSL_VERIFYPEER, true);
|
||||
curl_setopt($ch, \CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, \CURLOPT_URL, $url);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
try {
|
||||
$data = json_decode($result);
|
||||
} catch (\Exception $e) {
|
||||
echo "Could not parse info about next version.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$data) {
|
||||
echo "Could not get info about next version.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function downloadFile($url)
|
||||
{
|
||||
$localFilePath = 'data/upload/upgrades/' . \Espo\Core\Utils\Util::generateId() . '.zip';
|
||||
$this->getFileManager()->putContents($localFilePath, '');
|
||||
|
||||
if (is_file($url)) {
|
||||
copy($url, $localFilePath);
|
||||
} else {
|
||||
$options = [
|
||||
CURLOPT_FILE => fopen($localFilePath, 'w'),
|
||||
CURLOPT_TIMEOUT => 3600,
|
||||
CURLOPT_URL => $url
|
||||
];
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, $options);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
if (!$this->getFileManager()->isFile($localFilePath)) {
|
||||
echo "\nCould not download upgrade file.\n";
|
||||
$this->getFileManager()->unlink($localFilePath);
|
||||
return;
|
||||
}
|
||||
|
||||
return realpath($localFilePath);
|
||||
}
|
||||
|
||||
protected function isShellEnabled()
|
||||
{
|
||||
if (!function_exists('exec') || !is_callable('shell_exec')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = shell_exec("echo test");
|
||||
if (empty($result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
71
application/Espo/Core/Console/Commands/UpgradeStep.php
Normal file
71
application/Espo/Core/Console/Commands/UpgradeStep.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
|
||||
class UpgradeStep extends Base
|
||||
{
|
||||
public function run($options, $flagList, $argumentList)
|
||||
{
|
||||
if (empty($options['step'])) {
|
||||
echo "Step is not specified.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($options['id'])) {
|
||||
echo "Upgrade ID is not specified.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
$stepName = $options['step'];
|
||||
$upgradeId = $options['id'];
|
||||
|
||||
return $this->runUpgradeStep($stepName, ['id' => $upgradeId]);
|
||||
}
|
||||
|
||||
protected function runUpgradeStep($stepName, array $params)
|
||||
{
|
||||
$app = new \Espo\Core\Application();
|
||||
$app->setupSystemUser();
|
||||
|
||||
$upgradeManager = new \Espo\Core\UpgradeManager($app->getContainer());
|
||||
|
||||
try {
|
||||
$result = $upgradeManager->runInstallStep($stepName, $params); // throw Exception on error
|
||||
} catch (\Exception $e) {
|
||||
die("Error: " . $e->getMessage() . "\n");
|
||||
}
|
||||
|
||||
if (is_bool($result)) {
|
||||
$result = $result ? "true" : "false";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -34,15 +34,11 @@ class Container
|
||||
|
||||
private $data = [];
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function get($name)
|
||||
public function get(string $name)
|
||||
{
|
||||
if (empty($this->data[$name])) {
|
||||
$this->load($name);
|
||||
@@ -67,7 +63,7 @@ class Container
|
||||
} else {
|
||||
|
||||
try {
|
||||
$className = $this->get('metadata')->get('app.loaders.' . ucfirst($name));
|
||||
$className = $this->get('metadata')->get(['app', 'loaders', ucfirst($name)]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
if (!isset($className) || !class_exists($className)) {
|
||||
@@ -86,10 +82,10 @@ class Container
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function getServiceClassName($name, $default)
|
||||
public function getServiceClassName(string $name, string $default)
|
||||
{
|
||||
$metadata = $this->get('metadata');
|
||||
$className = $metadata->get('app.serviceContainer.classNames.' . $name, $default);
|
||||
$className = $metadata->get(['app', 'serviceContainer', 'classNames', $name], $default);
|
||||
return $className;
|
||||
}
|
||||
|
||||
@@ -119,7 +115,7 @@ class Container
|
||||
$rotation = $config->get('logger.rotation', true);
|
||||
|
||||
$log = new \Espo\Core\Utils\Log('Espo');
|
||||
$levelCode = $log->getLevelCode($config->get('logger.level', 'WARNING'));
|
||||
$levelCode = $log::toMonologLevel($config->get('logger.level', 'WARNING'));
|
||||
|
||||
if ($rotation) {
|
||||
$maxFileNumber = $config->get('logger.maxFileNumber', 30);
|
||||
@@ -131,7 +127,7 @@ class Container
|
||||
|
||||
$errorHandler = new \Monolog\ErrorHandler($log);
|
||||
$errorHandler->registerExceptionHandler(null, false);
|
||||
$errorHandler->registerErrorHandler(array(), false);
|
||||
$errorHandler->registerErrorHandler([], false);
|
||||
|
||||
return $log;
|
||||
}
|
||||
@@ -176,15 +172,6 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadMailSender()
|
||||
{
|
||||
$className = $this->getServiceClassName('mailSender', '\\Espo\\Core\\Mail\\Sender');
|
||||
return new $className(
|
||||
$this->get('config'),
|
||||
$this->get('entityManager')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadDateTime()
|
||||
{
|
||||
return new \Espo\Core\Utils\DateTime(
|
||||
@@ -209,19 +196,6 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadSelectManagerFactory()
|
||||
{
|
||||
return new \Espo\Core\SelectManagerFactory(
|
||||
$this->get('entityManager'),
|
||||
$this->get('user'),
|
||||
$this->get('acl'),
|
||||
$this->get('aclManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('config'),
|
||||
$this->get('injectableFactory')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadNotificatorFactory()
|
||||
{
|
||||
return new \Espo\Core\NotificatorFactory(
|
||||
@@ -317,7 +291,7 @@ class Container
|
||||
'en_US',
|
||||
$this->get('fileManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('useCache')
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -327,7 +301,7 @@ class Container
|
||||
\Espo\Core\Utils\Language::detectLanguage($this->get('config')),
|
||||
$this->get('fileManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('useCache')
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -374,15 +348,6 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadClientManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\ClientManager(
|
||||
$this->get('config'),
|
||||
$this->get('themeManager'),
|
||||
$this->get('metadata')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadInjectableFactory()
|
||||
{
|
||||
return new \Espo\Core\InjectableFactory(
|
||||
@@ -395,4 +360,3 @@ class Container
|
||||
$this->set('user', $user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -69,9 +69,7 @@ class Record extends Base
|
||||
$id = $params['id'];
|
||||
$entity = $this->getRecordService()->read($id);
|
||||
|
||||
if (empty($entity)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!$entity) throw new NotFound();
|
||||
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
@@ -142,9 +140,16 @@ class Record extends Base
|
||||
|
||||
$result = $this->getRecordService()->find($params);
|
||||
|
||||
if (is_array($result)) {
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
'total' => $result->total,
|
||||
'list' => isset($result->collection) ? $result->collection->getValueMapList() : $result->list
|
||||
];
|
||||
}
|
||||
|
||||
@@ -197,10 +202,17 @@ class Record extends Base
|
||||
|
||||
$result = $this->getRecordService()->findLinked($id, $link, $params);
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
);
|
||||
if (is_array($result)) {
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
];
|
||||
}
|
||||
|
||||
return (object) [
|
||||
'total' => $result->total,
|
||||
'list' => isset($result->collection) ? $result->collection->getValueMapList() : $result->list
|
||||
];
|
||||
}
|
||||
|
||||
public function actionDelete($params, $data, $request)
|
||||
@@ -296,33 +308,26 @@ class Record extends Base
|
||||
|
||||
$attributes = $data->attributes;
|
||||
|
||||
$idsUpdated = $this->getRecordService()->massUpdate($attributes, $params);
|
||||
$idsUpdated = $this->getRecordService()->massUpdate($params, $attributes);
|
||||
|
||||
return $idsUpdated;
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
public function postActionMassDelete($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!$this->getAcl()->check($this->name, 'delete')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
if (property_exists($data, 'where') && !empty($data->byWhere)) {
|
||||
$where = json_decode(json_encode($data->where), true);
|
||||
$params['where'] = $where;
|
||||
if (property_exists($data, 'selectData')) {
|
||||
$params['selectData'] = json_decode(json_encode($data->selectData), true);
|
||||
$actionParams = $this->getMassActionParamsFromData($data);
|
||||
|
||||
if (array_key_exists('where', $actionParams)) {
|
||||
if ($this->getAcl()->get('massUpdatePermission') !== 'yes') {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massDelete($params);
|
||||
return $this->getRecordService()->massDelete($actionParams);
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
@@ -496,4 +501,85 @@ class Record extends Base
|
||||
|
||||
return $this->getRecordService()->massUnfollow($params);
|
||||
}
|
||||
|
||||
protected function getMassActionParamsFromData($data)
|
||||
{
|
||||
$params = [];
|
||||
if (property_exists($data, 'where') && !empty($data->byWhere)) {
|
||||
$where = json_decode(json_encode($data->where), true);
|
||||
$params['where'] = $where;
|
||||
if (property_exists($data, 'selectData')) {
|
||||
$params['selectData'] = json_decode(json_encode($data->selectData), true);
|
||||
}
|
||||
}
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public function postActionMassRecalculateFormula($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
if (!$this->getAcl()->check($this->name, 'edit')) throw new Forbidden();
|
||||
|
||||
return $this->getRecordService()->massRecalculateFormula($this->getMassActionParamsFromData($data));
|
||||
}
|
||||
|
||||
public function postActionRestoreDeleted($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
|
||||
$id = $data->id ?? null;
|
||||
if (!$id) throw new Forbidden();
|
||||
|
||||
return $this->getRecordService()->restoreDeleted($id);
|
||||
}
|
||||
|
||||
public function postActionMassConvertCurrency($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->checkScope($this->name, 'edit')) throw new Forbidden();
|
||||
if ($this->getAcl()->get('massUpdatePermission') !== 'yes') throw new Forbidden();
|
||||
|
||||
$fieldList = $data->fieldList ?? null;
|
||||
if (!empty($data->field)) {
|
||||
if (!is_array($fieldList)) $fieldList = [];
|
||||
$fieldList[] = $data->field;
|
||||
}
|
||||
|
||||
$params = [];
|
||||
if (property_exists($data, 'where') && !empty($data->byWhere)) {
|
||||
$params['where'] = json_decode(json_encode($data->where), true);
|
||||
if (property_exists($data, 'selectData')) {
|
||||
$params['selectData'] = json_decode(json_encode($data->selectData), true);
|
||||
}
|
||||
} else if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
if (empty($data->currencyRates)) throw new BadRequest();
|
||||
if (empty($data->targetCurrency)) throw new BadRequest();
|
||||
if (empty($data->baseCurrency)) throw new BadRequest();
|
||||
|
||||
return $this->getRecordService()->massConvertCurrency($params, $data->targetCurrency, $data->baseCurrency, $data->currencyRates, $fieldList);
|
||||
}
|
||||
|
||||
public function postActionConvertCurrency($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->checkScope($this->name, 'edit')) throw new Forbidden();
|
||||
|
||||
$fieldList = $data->fieldList ?? null;
|
||||
if (!empty($data->field)) {
|
||||
if (!is_array($fieldList)) $fieldList = [];
|
||||
$fieldList[] = $data->field;
|
||||
}
|
||||
|
||||
if (empty($data->id)) throw new BadRequest();
|
||||
if (empty($data->currencyRates)) throw new BadRequest();
|
||||
if (empty($data->targetCurrency)) throw new BadRequest();
|
||||
if (empty($data->baseCurrency)) throw new BadRequest();
|
||||
|
||||
return $this->getRecordService()->convertCurrency($data->id, $data->targetCurrency, $data->baseCurrency, $data->currencyRates, $fieldList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -59,7 +59,7 @@ class CronManager
|
||||
'* * *',
|
||||
'* * * *',
|
||||
'* * * * *',
|
||||
'* * * * * *'
|
||||
'* * * * * *',
|
||||
];
|
||||
|
||||
const PENDING = 'Pending';
|
||||
@@ -182,8 +182,6 @@ class CronManager
|
||||
|
||||
/**
|
||||
* Run Cron
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
@@ -299,7 +297,7 @@ class CronManager
|
||||
$this->runJob($job);
|
||||
}
|
||||
|
||||
public function runJob($job)
|
||||
public function runJob(\Espo\Entities\Job $job)
|
||||
{
|
||||
$isSuccess = true;
|
||||
$skipLog = false;
|
||||
@@ -307,10 +305,12 @@ class CronManager
|
||||
try {
|
||||
if ($job->get('scheduledJobId')) {
|
||||
$this->runScheduledJob($job);
|
||||
} else if ($job->get('job')) {
|
||||
$this->runJobByName($job);
|
||||
} else {
|
||||
$this->runService($job);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
$isSuccess = false;
|
||||
if ($e->getCode() === -1) {
|
||||
$job->set('attempts', 0);
|
||||
@@ -333,6 +333,9 @@ class CronManager
|
||||
if ($job->get('scheduledJobId') && !$skipLog) {
|
||||
$this->getCronScheduledJobUtil()->addLogRecord($job->get('scheduledJobId'), $status, null, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
if ($isSuccess) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function runScheduledJob($job)
|
||||
@@ -340,18 +343,14 @@ class CronManager
|
||||
$jobName = $job->get('scheduledJobJob');
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($jobName);
|
||||
if ($className === false) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
if ($className === false) throw new Error("No class name for job {$jobName}.");
|
||||
|
||||
$jobClass = new $className($this->container);
|
||||
$method = 'run';
|
||||
if (!method_exists($jobClass, $method)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!method_exists($jobClass, $method)) throw new Error();
|
||||
|
||||
$data = null;
|
||||
|
||||
if ($job->get('data')) {
|
||||
$data = $job->get('data');
|
||||
}
|
||||
@@ -359,43 +358,47 @@ class CronManager
|
||||
$jobClass->$method($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Run Service
|
||||
*
|
||||
* @param array $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function runService($job)
|
||||
{
|
||||
$serviceName = $job->get('serviceName');
|
||||
|
||||
if (!$serviceName) {
|
||||
throw new Error('Job with empty serviceName.');
|
||||
throw new Error("Job with empty serviceName.");
|
||||
}
|
||||
|
||||
if (!$this->getServiceFactory()->checkExists($serviceName)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!$this->getServiceFactory()->checkExists($serviceName)) throw new Error();
|
||||
|
||||
$service = $this->getServiceFactory()->create($serviceName);
|
||||
|
||||
$methodNameDeprecated = $job->get('method');
|
||||
$methodName = $job->get('methodName');
|
||||
|
||||
if (!$methodName) {
|
||||
throw new Error('Job with empty methodName.');
|
||||
}
|
||||
if (!$methodName) throw new Error('Job with empty methodName.');
|
||||
|
||||
if (!method_exists($service, $methodName)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!method_exists($service, $methodName)) throw new Error();
|
||||
|
||||
$data = $job->get('data');
|
||||
|
||||
$service->$methodName($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
protected function runJobByName($job)
|
||||
{
|
||||
$jobName = $job->get('job');
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($jobName);
|
||||
|
||||
if ($className === false) throw new Error("No class name for job {$jobName}.");
|
||||
|
||||
$jobClass = new $className($this->container);
|
||||
$method = 'run';
|
||||
if (!method_exists($jobClass, $method)) throw new Error();
|
||||
|
||||
$data = $job->get('data') ?: null;
|
||||
|
||||
$jobClass->$method($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
protected function createJobsFromScheduledJobs()
|
||||
{
|
||||
$activeScheduledJobList = $this->getCronScheduledJobUtil()->getActiveScheduledJobList();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -119,6 +119,7 @@ class DataManager
|
||||
$metadata->init(true);
|
||||
|
||||
$ormData = $this->getContainer()->get('ormMetadata')->getData(true);
|
||||
$this->getContainer()->get('entityManager')->setMetadata($ormData);
|
||||
|
||||
$this->updateCacheTimestamp();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: https://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user