mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-03 20:17:02 +00:00
Compare commits
3097 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddc90a05d9 | ||
|
|
bbbadb1c32 | ||
|
|
8995835d8e | ||
|
|
df3c119f5f | ||
|
|
6a2ba73412 | ||
|
|
cbee8cc541 | ||
|
|
22f186af29 | ||
|
|
77ab385db8 | ||
|
|
13495ee32e | ||
|
|
254ce7d5d2 | ||
|
|
4e1053d037 | ||
|
|
2fcc6e168f | ||
|
|
96ea0ae690 | ||
|
|
aa66001981 | ||
|
|
173ff943a4 | ||
|
|
79ac73bb95 | ||
|
|
2143832c25 | ||
|
|
c656e36265 | ||
|
|
8564adca6a | ||
|
|
19c9922115 | ||
|
|
b22a6f204a | ||
|
|
daa0cf9fc9 | ||
|
|
6365aa04df | ||
|
|
ff20e077b1 | ||
|
|
1106aaf18e | ||
|
|
872ba225b4 | ||
|
|
95c15efa92 | ||
|
|
c179cec8a0 | ||
|
|
97f96396c5 | ||
|
|
e05cac1261 | ||
|
|
f9d8894f37 | ||
|
|
5bd5a76722 | ||
|
|
2fbb4f3725 | ||
|
|
61e1b18eb9 | ||
|
|
08c1710326 | ||
|
|
39d3baf1b5 | ||
|
|
fd4753d190 | ||
|
|
29745367f7 | ||
|
|
25bb4f08ba | ||
|
|
40a13c16eb | ||
|
|
8ad2c425bf | ||
|
|
2b6c9bc57e | ||
|
|
bebbee5abd | ||
|
|
99156499f1 | ||
|
|
9ad81581bb | ||
|
|
1b4cd1478b | ||
|
|
5fdf2e4403 | ||
|
|
319b523117 | ||
|
|
62823646b0 | ||
|
|
3c16758605 | ||
|
|
4705d2e38d | ||
|
|
05b405f76e | ||
|
|
f54b2788de | ||
|
|
6ac0c7b301 | ||
|
|
c44cc9906e | ||
|
|
ecd5671e1a | ||
|
|
c83f729eea | ||
|
|
10afd2dfef | ||
|
|
8229b8320f | ||
|
|
50493cf725 | ||
|
|
3937b80254 | ||
|
|
bcb7aaf13c | ||
|
|
f9d7ec7f47 | ||
|
|
b7d43edf22 | ||
|
|
0f0060f0f6 | ||
|
|
036bad3912 | ||
|
|
c9d675798b | ||
|
|
10703750f9 | ||
|
|
4d942851d3 | ||
|
|
1434c31b2f | ||
|
|
74405b2842 | ||
|
|
1070d18085 | ||
|
|
b729c13c7a | ||
|
|
1c99327bfd | ||
|
|
61279b0e59 | ||
|
|
31cb17a41d | ||
|
|
f9349d5545 | ||
|
|
c3703494eb | ||
|
|
d94ff7c4fa | ||
|
|
01e0bf4d6d | ||
|
|
ca5f1a47fd | ||
|
|
54af8ee7c6 | ||
|
|
8572b565f3 | ||
|
|
ea1cc1c65a | ||
|
|
4610c61bd4 | ||
|
|
02f04ea9c4 | ||
|
|
1ce4db6be4 | ||
|
|
888291a99d | ||
|
|
3f9773a4cf | ||
|
|
a223c721aa | ||
|
|
5bce57b1f8 | ||
|
|
3666c34845 | ||
|
|
0dceccac46 | ||
|
|
59a2644e0f | ||
|
|
6c33a7304d | ||
|
|
e89f01a525 | ||
|
|
7181b45461 | ||
|
|
b7ce52f476 | ||
|
|
d2a8cd961f | ||
|
|
c152dbf4bf | ||
|
|
594a111bc3 | ||
|
|
005be2fe5a | ||
|
|
8f194e6d9e | ||
|
|
e3a5cb464c | ||
|
|
779f0df83e | ||
|
|
086d9bdbb6 | ||
|
|
9dcaa46bc7 | ||
|
|
3bca95a4da | ||
|
|
be09935287 | ||
|
|
410c338da8 | ||
|
|
be0606ede6 | ||
|
|
f54a84420a | ||
|
|
6a0d1e3b8b | ||
|
|
33127cd1bb | ||
|
|
5cd03312e1 | ||
|
|
391c0dcaf8 | ||
|
|
0b7b9599d3 | ||
|
|
b45ff69376 | ||
|
|
1836d0a127 | ||
|
|
048e156e59 | ||
|
|
a85be60e30 | ||
|
|
90d5c9eca6 | ||
|
|
1c8f0c7d9c | ||
|
|
f8d1c9ce05 | ||
|
|
28052bac23 | ||
|
|
c361a940eb | ||
|
|
fbc1e936db | ||
|
|
84661f88fd | ||
|
|
10b4c88872 | ||
|
|
10ddc7d941 | ||
|
|
b1c63e2cb9 | ||
|
|
3f6544d03b | ||
|
|
a9f211dfd5 | ||
|
|
f2427abbf4 | ||
|
|
a6187f9838 | ||
|
|
384600ed95 | ||
|
|
6d06f03ef9 | ||
|
|
0829c714fd | ||
|
|
9e2251755f | ||
|
|
436f871be2 | ||
|
|
8d09f8e9b2 | ||
|
|
e4d43a6790 | ||
|
|
bb3d9d3466 | ||
|
|
bd208e259c | ||
|
|
1a1cfec3e5 | ||
|
|
1e95e98549 | ||
|
|
82056b5650 | ||
|
|
c0d118ee98 | ||
|
|
da13177292 | ||
|
|
4cc38ca564 | ||
|
|
fa945c981e | ||
|
|
63d76c6b71 | ||
|
|
9b749a8f67 | ||
|
|
1ce1d5c79a | ||
|
|
0c2dd73334 | ||
|
|
7331f14e0a | ||
|
|
d44f2fd7cd | ||
|
|
4da7eddc69 | ||
|
|
3ebe30a9c0 | ||
|
|
e959361df9 | ||
|
|
7773506361 | ||
|
|
9db652a501 | ||
|
|
27ebfd7f23 | ||
|
|
96f80e0008 | ||
|
|
5f3c208161 | ||
|
|
d402f33c74 | ||
|
|
879da4dca2 | ||
|
|
3e862790e6 | ||
|
|
425e36bff6 | ||
|
|
705ecbdf72 | ||
|
|
c658d67ac8 | ||
|
|
c46055b469 | ||
|
|
66e4b89d1a | ||
|
|
38b9f1d68c | ||
|
|
19b8a4e771 | ||
|
|
937ffea4ab | ||
|
|
1ae49a3d47 | ||
|
|
c76daf50db | ||
|
|
9e5c797243 | ||
|
|
662c4afcdf | ||
|
|
9b50b97e79 | ||
|
|
d00cefc37f | ||
|
|
1f94c13e25 | ||
|
|
75801ea717 | ||
|
|
b845f5086e | ||
|
|
8c8e6ec551 | ||
|
|
a4aecee18d | ||
|
|
3c0d445824 | ||
|
|
c36c6dc42d | ||
|
|
f7f8f14725 | ||
|
|
9402bf4baf | ||
|
|
12fcdcdb2d | ||
|
|
61735ed4aa | ||
|
|
3c65d252b6 | ||
|
|
6423859195 | ||
|
|
53df34d6f2 | ||
|
|
ed762c9be3 | ||
|
|
f05f14b12a | ||
|
|
183b5cb29b | ||
|
|
07193b1fb2 | ||
|
|
b24f8f538b | ||
|
|
a259174415 | ||
|
|
3d93c2a4b1 | ||
|
|
8c112791ef | ||
|
|
0ff4553c94 | ||
|
|
1e6094b5ee | ||
|
|
a646d97aec | ||
|
|
57f4980802 | ||
|
|
2477f5b696 | ||
|
|
6463422e81 | ||
|
|
3daf041698 | ||
|
|
933456ecdf | ||
|
|
ab18f72f69 | ||
|
|
28465cf2bf | ||
|
|
4cef5c547e | ||
|
|
057abf8024 | ||
|
|
20de5658e9 | ||
|
|
4a2ed2e0f7 | ||
|
|
3dc574bc48 | ||
|
|
d43a42b646 | ||
|
|
823c46a6df | ||
|
|
919c0bc8ae | ||
|
|
54d62a19cd | ||
|
|
18304fb710 | ||
|
|
cc1afbed5d | ||
|
|
a195acfee9 | ||
|
|
e22ec4c20b | ||
|
|
7c8f4f9db8 | ||
|
|
d28ff1e438 | ||
|
|
5af7499fdb | ||
|
|
6588d783cc | ||
|
|
f1b8279d50 | ||
|
|
252d31ffac | ||
|
|
8a98cca4fa | ||
|
|
0b8486c1a7 | ||
|
|
b0bd0664f9 | ||
|
|
286fd7e0ce | ||
|
|
42f5d28369 | ||
|
|
ea5d873cc3 | ||
|
|
ee8608469e | ||
|
|
f541625318 | ||
|
|
ee70fb8483 | ||
|
|
f79e093f52 | ||
|
|
254d9280b9 | ||
|
|
ddd9c765b8 | ||
|
|
080f204eed | ||
|
|
f30325849a | ||
|
|
8caa5b3e60 | ||
|
|
0daeed49c1 | ||
|
|
34540e12f3 | ||
|
|
b954a81630 | ||
|
|
56472d6746 | ||
|
|
2721649313 | ||
|
|
24d7de60ab | ||
|
|
441f9296ad | ||
|
|
3116a152e7 | ||
|
|
77784c4224 | ||
|
|
bf13c7ca8c | ||
|
|
26c779a2c5 | ||
|
|
1bfaf6c3ad | ||
|
|
69229ff6af | ||
|
|
719164524b | ||
|
|
5a67b17916 | ||
|
|
db4968b1ca | ||
|
|
e50f46e38a | ||
|
|
adc8988f6c | ||
|
|
a480ad9c11 | ||
|
|
d9be685f89 | ||
|
|
bd9db140de | ||
|
|
74c0204590 | ||
|
|
ce9d3299b1 | ||
|
|
8b27bc194d | ||
|
|
1a6b4a6683 | ||
|
|
2ae4d6e090 | ||
|
|
9467171c84 | ||
|
|
402db729b7 | ||
|
|
e16be12438 | ||
|
|
605912443d | ||
|
|
62acc14f4a | ||
|
|
017066a311 | ||
|
|
273b122ca8 | ||
|
|
ce2ec3dd6c | ||
|
|
fda22605cc | ||
|
|
1076fa6230 | ||
|
|
019af59c8a | ||
|
|
08bb644b58 | ||
|
|
6ec1273e61 | ||
|
|
ba5df9a4ae | ||
|
|
050d77ef12 | ||
|
|
f8ccaeab08 | ||
|
|
3c4c464e4a | ||
|
|
2a5730def9 | ||
|
|
48fe3e6b86 | ||
|
|
eecbc3aa2c | ||
|
|
e177f14446 | ||
|
|
493ab0396a | ||
|
|
c776150ce0 | ||
|
|
b6bca982bb | ||
|
|
aa8a243bf1 | ||
|
|
75da037656 | ||
|
|
56a06a5581 | ||
|
|
0af67bea3a | ||
|
|
08b8d899b7 | ||
|
|
cf07cb39c4 | ||
|
|
810d10c1c2 | ||
|
|
342bdcfaac | ||
|
|
d933dbb31a | ||
|
|
fe61364178 | ||
|
|
88c3c03f99 | ||
|
|
c21b16f5c7 | ||
|
|
2481a2504f | ||
|
|
dcb1e8040a | ||
|
|
0e1c611034 | ||
|
|
fccd9d642c | ||
|
|
849f1becc7 | ||
|
|
be6c4a63ed | ||
|
|
4e48483276 | ||
|
|
6817a54aa0 | ||
|
|
482f235dcc | ||
|
|
90b863c4ae | ||
|
|
8541a87d1f | ||
|
|
002adeb00e | ||
|
|
30e7d1ba7c | ||
|
|
0923f2e120 | ||
|
|
38a0c8e19f | ||
|
|
facf90d964 | ||
|
|
cca3482bc0 | ||
|
|
6178ca550b | ||
|
|
dc51e467d4 | ||
|
|
300827c1f0 | ||
|
|
aacf09a444 | ||
|
|
0123488828 | ||
|
|
a43b188f36 | ||
|
|
f0285ef8f2 | ||
|
|
70a0ffbf3d | ||
|
|
f2e6a4fc55 | ||
|
|
df5fd76ae2 | ||
|
|
f34d258b45 | ||
|
|
28c52763c8 | ||
|
|
ebe22fa7f0 | ||
|
|
160327e471 | ||
|
|
dd080dbff2 | ||
|
|
d509886cd1 | ||
|
|
239a8f0af8 | ||
|
|
c0565306c3 | ||
|
|
79d159511d | ||
|
|
e123fc7e6f | ||
|
|
52fa30f389 | ||
|
|
1d744d5abc | ||
|
|
2629c12ade | ||
|
|
8fb6b1a5a9 | ||
|
|
d4a23c9a4f | ||
|
|
05d0f982a7 | ||
|
|
e3c8a3fcda | ||
|
|
8cd56d2705 | ||
|
|
f94d1f3cd8 | ||
|
|
5f64b74fad | ||
|
|
b422cd6f52 | ||
|
|
17698409b9 | ||
|
|
fb0dabebe1 | ||
|
|
f81805fbf4 | ||
|
|
596c9d4996 | ||
|
|
a7530dcce9 | ||
|
|
55d59eea80 | ||
|
|
0c66a1fb7b | ||
|
|
ad7ca5d287 | ||
|
|
b34be4730d | ||
|
|
1c264055eb | ||
|
|
12f41baff5 | ||
|
|
9a9ad1baa7 | ||
|
|
46c31278e7 | ||
|
|
a08dc3d422 | ||
|
|
158a74f79b | ||
|
|
bacf85ccf8 | ||
|
|
ef683bd7fa | ||
|
|
20c233fb8c | ||
|
|
ac21313190 | ||
|
|
8ba6918139 | ||
|
|
5e357b460d | ||
|
|
d660abe1f6 | ||
|
|
fd9617ec8f | ||
|
|
48ccdaab5e | ||
|
|
52d9548333 | ||
|
|
4706d28560 | ||
|
|
033f5de85d | ||
|
|
6760f6f03d | ||
|
|
e1a7862194 | ||
|
|
8ef53d229d | ||
|
|
c6d215f87c | ||
|
|
dccaed124c | ||
|
|
ccfca4a61a | ||
|
|
417a05f24f | ||
|
|
7a85f7576d | ||
|
|
8407ab3a74 | ||
|
|
c120ebd3ca | ||
|
|
d0635484a2 | ||
|
|
d3c487a28a | ||
|
|
14f46a5d5d | ||
|
|
00a8ca8273 | ||
|
|
deec457728 | ||
|
|
5a5508a973 | ||
|
|
357b285346 | ||
|
|
f8444b9e67 | ||
|
|
e0a224e414 | ||
|
|
9dfb128e1d | ||
|
|
462d1f0274 | ||
|
|
2e3803eef1 | ||
|
|
42b186eb94 | ||
|
|
ccdee9ec09 | ||
|
|
05eeb82efd | ||
|
|
6eefe64f4c | ||
|
|
5b96b19735 | ||
|
|
3764d877ce | ||
|
|
30e713c161 | ||
|
|
da3a76e441 | ||
|
|
adff467b50 | ||
|
|
d59f05ad8b | ||
|
|
9c3d124f48 | ||
|
|
4404b0f02e | ||
|
|
77533fba72 | ||
|
|
62d36ed0c2 | ||
|
|
94ad0123c7 | ||
|
|
109842f0fe | ||
|
|
d931d65cd8 | ||
|
|
b7861a7cb1 | ||
|
|
a49ad3bb48 | ||
|
|
d94acf5b78 | ||
|
|
fd0e1d1460 | ||
|
|
2ed9d5487e | ||
|
|
5dc44cb701 | ||
|
|
9e07c383fe | ||
|
|
9e1ec2768b | ||
|
|
39674e8c7f | ||
|
|
5dca4b7061 | ||
|
|
5d3cb25d14 | ||
|
|
6e337affbb | ||
|
|
87ab8cc15f | ||
|
|
b654e5cebd | ||
|
|
11958f2abf | ||
|
|
2a329ba92d | ||
|
|
b22487ef70 | ||
|
|
bf03a2f540 | ||
|
|
ece51a6f9f | ||
|
|
915dbffe72 | ||
|
|
fda0d6df1f | ||
|
|
25891f9dc0 | ||
|
|
35902adbdc | ||
|
|
981d15ee55 | ||
|
|
adfec3441b | ||
|
|
a208aa051f | ||
|
|
9068302357 | ||
|
|
1bb0439f19 | ||
|
|
f28585e245 | ||
|
|
99cfeb25ee | ||
|
|
6b7da9a39e | ||
|
|
18bba7baec | ||
|
|
ec8ffbc090 | ||
|
|
60eb1ca236 | ||
|
|
5e3756313c | ||
|
|
d303d5a423 | ||
|
|
938415aa79 | ||
|
|
9033710e56 | ||
|
|
2fd77e4034 | ||
|
|
b733d8205e | ||
|
|
f725ad09d7 | ||
|
|
e9a53c5b25 | ||
|
|
43e94cfe68 | ||
|
|
07d713734f | ||
|
|
4f004b8402 | ||
|
|
b1f4131af9 | ||
|
|
1adb19f427 | ||
|
|
fce4a4b1d9 | ||
|
|
61f35bcb5e | ||
|
|
0db68917a1 | ||
|
|
9da8ab9bdb | ||
|
|
8d1724df84 | ||
|
|
cd88d59937 | ||
|
|
cab4f5ce64 | ||
|
|
62ab1f8d00 | ||
|
|
f0e1439c79 | ||
|
|
5060918087 | ||
|
|
bf6b058152 | ||
|
|
40b607a73f | ||
|
|
2bdbba0eff | ||
|
|
058d821a7c | ||
|
|
4575ff89ad | ||
|
|
608454fcf2 | ||
|
|
58c1bec2da | ||
|
|
e1ce16c399 | ||
|
|
2d3a748286 | ||
|
|
06834dd8bf | ||
|
|
e4c0f19b1c | ||
|
|
84faf7a782 | ||
|
|
61db675ab1 | ||
|
|
59e72796e3 | ||
|
|
76e61a6358 | ||
|
|
455eceefa1 | ||
|
|
834e979060 | ||
|
|
ece36c8711 | ||
|
|
9b999a1ec8 | ||
|
|
80c53e15e5 | ||
|
|
a37b6077c1 | ||
|
|
fabfa392b7 | ||
|
|
8ff717cfd5 | ||
|
|
eae042d730 | ||
|
|
f6fda22160 | ||
|
|
c120ecab1a | ||
|
|
6afcbe90a1 | ||
|
|
130bde63cf | ||
|
|
c76e8f96d9 | ||
|
|
7b92014249 | ||
|
|
33df80559d | ||
|
|
c0d9d1e514 | ||
|
|
ed2567913b | ||
|
|
9a7bd94ce1 | ||
|
|
036aea5c7f | ||
|
|
1bc1311113 | ||
|
|
135fe6f2e6 | ||
|
|
f366a1d0dd | ||
|
|
b4cda3b349 | ||
|
|
0e92ae792c | ||
|
|
cf4247321c | ||
|
|
994be85579 | ||
|
|
8cdaf1a534 | ||
|
|
f9996d3643 | ||
|
|
6b7bcca21b | ||
|
|
c7109906bc | ||
|
|
63583ad630 | ||
|
|
4d063194ed | ||
|
|
c579e08614 | ||
|
|
40414a0f17 | ||
|
|
5e1ee6f06f | ||
|
|
f885333310 | ||
|
|
72149851cf | ||
|
|
e2ce971b70 | ||
|
|
802bb9b1c2 | ||
|
|
30ce642d88 | ||
|
|
bc901fad0b | ||
|
|
dae251fb43 | ||
|
|
f98a916a55 | ||
|
|
a7fd14ef36 | ||
|
|
5ff2eb1945 | ||
|
|
a60e82591f | ||
|
|
2ae59a5820 | ||
|
|
1d46427d51 | ||
|
|
8bd7009c02 | ||
|
|
cc90d546a5 | ||
|
|
e916ff5a0b | ||
|
|
54fa8f4867 | ||
|
|
7d92ee7d7a | ||
|
|
884388d0df | ||
|
|
50b386388e | ||
|
|
f03c0d7c57 | ||
|
|
83a3552b21 | ||
|
|
1462f54a65 | ||
|
|
b7cd1657b0 | ||
|
|
9d1ae432d5 | ||
|
|
1e32df5a26 | ||
|
|
07128d04b0 | ||
|
|
8d0c1348b1 | ||
|
|
7bcacdbd27 | ||
|
|
65c3bb3291 | ||
|
|
a08fa65fae | ||
|
|
85d8c9795a | ||
|
|
9a17dbbd68 | ||
|
|
f83827886e | ||
|
|
8964e98873 | ||
|
|
63e17e91bd | ||
|
|
f95cbe4ed2 | ||
|
|
9ddd1dac3a | ||
|
|
5ff0e67392 | ||
|
|
a60a2885e1 | ||
|
|
7e9ddf0c14 | ||
|
|
5cb82cca42 | ||
|
|
02edc35d3a | ||
|
|
a30c17ed91 | ||
|
|
d2dfd7ddb0 | ||
|
|
2a35b9912c | ||
|
|
bc097db09f | ||
|
|
75eb49ced3 | ||
|
|
cd2e3eec08 | ||
|
|
d72884a0e4 | ||
|
|
315e35965c | ||
|
|
f2fb3fc077 | ||
|
|
f4d9e3fbc6 | ||
|
|
d44f8e7ab4 | ||
|
|
b0438991bf | ||
|
|
0a23a469e2 | ||
|
|
2900e8afb7 | ||
|
|
e3e25785c7 | ||
|
|
7c4e1393fe | ||
|
|
b06736351b | ||
|
|
9c5a8c63ce | ||
|
|
e8c171be92 | ||
|
|
1b7aa9e48c | ||
|
|
51fd3e681c | ||
|
|
484510f763 | ||
|
|
7fde7327fe | ||
|
|
2c8094bf28 | ||
|
|
256d30847e | ||
|
|
0bbfee8716 | ||
|
|
8d58e81d28 | ||
|
|
8fb80d12c9 | ||
|
|
2b5eed3a38 | ||
|
|
dccd5305e7 | ||
|
|
bbb418d2af | ||
|
|
a5bae56f8d | ||
|
|
aa3d2f8787 | ||
|
|
e9750e145f | ||
|
|
d0cdefd972 | ||
|
|
451aa7f5da | ||
|
|
43ee6ef8f6 | ||
|
|
c366e8decc | ||
|
|
8610c61c18 | ||
|
|
bee3a3b012 | ||
|
|
dc2d46ca21 | ||
|
|
1b5346e86d | ||
|
|
8bc633aed9 | ||
|
|
ee3dee0570 | ||
|
|
69048d8f89 | ||
|
|
427025c2ed | ||
|
|
6deb336115 | ||
|
|
a8be115d4b | ||
|
|
115ae82b17 | ||
|
|
e4b357e8d3 | ||
|
|
560a7b2465 | ||
|
|
acfe05297b | ||
|
|
16579ff1a8 | ||
|
|
2dcf81a516 | ||
|
|
44f379e3d2 | ||
|
|
9be406c0a2 | ||
|
|
a030c50780 | ||
|
|
c9ca3a497f | ||
|
|
71886cd91c | ||
|
|
e60d46b2ec | ||
|
|
9829ca8d28 | ||
|
|
28c4651599 | ||
|
|
14de81520b | ||
|
|
3a11d335a2 | ||
|
|
0d3554cc49 | ||
|
|
6b458f3b55 | ||
|
|
874885671b | ||
|
|
a75f4dacab | ||
|
|
8c5a455f08 | ||
|
|
1b12cd46b2 | ||
|
|
42581469da | ||
|
|
562fa03c6c | ||
|
|
7389acd87f | ||
|
|
8feca2783f | ||
|
|
a290f7aba9 | ||
|
|
eb11f9f757 | ||
|
|
2ace19face | ||
|
|
25b6a94fd6 | ||
|
|
d0768b3dce | ||
|
|
b4c27f50ea | ||
|
|
669cb10f10 | ||
|
|
e9c0cd6d53 | ||
|
|
06708a8b7e | ||
|
|
fba8ca7817 | ||
|
|
37cae817a7 | ||
|
|
7d847cf179 | ||
|
|
a32c560f60 | ||
|
|
a4d4e640a2 | ||
|
|
74093976db | ||
|
|
76f17e3f95 | ||
|
|
ab4ce21927 | ||
|
|
eb14dedb63 | ||
|
|
004dfc1687 | ||
|
|
62b4b92815 | ||
|
|
e429bde5b8 | ||
|
|
6c3ee8d462 | ||
|
|
43f1c0d889 | ||
|
|
2cd1bb8cdd | ||
|
|
3d8bbdd01d | ||
|
|
1e90153f75 | ||
|
|
61ef68d4ae | ||
|
|
517953a097 | ||
|
|
5ca757ac05 | ||
|
|
1e69075099 | ||
|
|
5e12a4b238 | ||
|
|
9ddbad0b50 | ||
|
|
6e444c3289 | ||
|
|
385f8733ab | ||
|
|
42c0c50e1b | ||
|
|
3c17a8982a | ||
|
|
e0abf85014 | ||
|
|
35db6e5cde | ||
|
|
7abdb854ea | ||
|
|
924e50d135 | ||
|
|
0f70f7a169 | ||
|
|
7d4683d130 | ||
|
|
8803e96bb7 | ||
|
|
3a4220878d | ||
|
|
21ee02d4ed | ||
|
|
fbecb09d45 | ||
|
|
bbbec3b54a | ||
|
|
d62f7f3628 | ||
|
|
fc07a06248 | ||
|
|
c32682b245 | ||
|
|
fc502a55b3 | ||
|
|
d580a3fa26 | ||
|
|
639686253b | ||
|
|
1274731a02 | ||
|
|
9ca51fcd94 | ||
|
|
8cabec8a3b | ||
|
|
967b6cfc81 | ||
|
|
416ae76a94 | ||
|
|
05cfe65d8e | ||
|
|
d7dd804822 | ||
|
|
aa56a20240 | ||
|
|
23b85d078b | ||
|
|
154dad7cb4 | ||
|
|
0a4c552602 | ||
|
|
ae479449fc | ||
|
|
f215196bcb | ||
|
|
79b688535b | ||
|
|
b5bd3ec514 | ||
|
|
696cab7f65 | ||
|
|
9f3122df29 | ||
|
|
2ef1d5becb | ||
|
|
f5b5d94b27 | ||
|
|
3a61e9b62d | ||
|
|
8ec70cc42f | ||
|
|
e336bfbc1d | ||
|
|
bdd8579e7b | ||
|
|
9b19e67eac | ||
|
|
62a4ea9080 | ||
|
|
8dc9076de3 | ||
|
|
4a72481a7d | ||
|
|
ad22d2bab6 | ||
|
|
d879d70b7d | ||
|
|
ec01288930 | ||
|
|
6bb03bb176 | ||
|
|
fd085f5fde | ||
|
|
6e0b34d9d5 | ||
|
|
a69cee274f | ||
|
|
63126a8371 | ||
|
|
2a2e7524e8 | ||
|
|
87f1a84e0d | ||
|
|
08b90e08cf | ||
|
|
e5dad4622f | ||
|
|
f6f2010670 | ||
|
|
fa8b77392a | ||
|
|
00476f082b | ||
|
|
60eefda570 | ||
|
|
7532ba06cd | ||
|
|
a86ba2b704 | ||
|
|
4d9bd89544 | ||
|
|
a6dc770afc | ||
|
|
a4deda924a | ||
|
|
f75511e723 | ||
|
|
b72c8bb212 | ||
|
|
62eb33d936 | ||
|
|
aa481dc14d | ||
|
|
b2276950ca | ||
|
|
1c032405fe | ||
|
|
2ae9b9239d | ||
|
|
b390cb921e | ||
|
|
fbee7df8da | ||
|
|
43559a0158 | ||
|
|
0409a6102e | ||
|
|
30985196b2 | ||
|
|
f289072486 | ||
|
|
d244192783 | ||
|
|
87bf131f8e | ||
|
|
ff1d010745 | ||
|
|
c0a72f3cbe | ||
|
|
14db1291b6 | ||
|
|
76ab6bde62 | ||
|
|
df92a6e110 | ||
|
|
0836dec4a6 | ||
|
|
6ae345a9e1 | ||
|
|
4c283747a4 | ||
|
|
a504bc8d4f | ||
|
|
f6fcfeae06 | ||
|
|
11376e3a09 | ||
|
|
86d1650ede | ||
|
|
3c1d2a4236 | ||
|
|
c80cfc9574 | ||
|
|
4e47f203fb | ||
|
|
42bbf92111 | ||
|
|
e4be63222a | ||
|
|
061ff019ea | ||
|
|
84b0b4a713 | ||
|
|
f9d4cdca51 | ||
|
|
b2ab2a9b01 | ||
|
|
b044566309 | ||
|
|
14e95414ab | ||
|
|
88836f2d3a | ||
|
|
d2aefab3e2 | ||
|
|
a62e91af6f | ||
|
|
cdf473fb2c | ||
|
|
4f1730d929 | ||
|
|
4a3a13414b | ||
|
|
939ead833c | ||
|
|
0946c8dba8 | ||
|
|
47e1687029 | ||
|
|
9230519d91 | ||
|
|
915ddab072 | ||
|
|
7293910d45 | ||
|
|
3cfae1964e | ||
|
|
e02fc8c9a2 | ||
|
|
53fb2513d4 | ||
|
|
ecc0d65ee4 | ||
|
|
c8dcc686c0 | ||
|
|
543a6447ae | ||
|
|
78939a7152 | ||
|
|
b6bcb75dcf | ||
|
|
81e841f784 | ||
|
|
3e64daae0c | ||
|
|
124acbc17d | ||
|
|
0060823de6 | ||
|
|
e60999ca5d | ||
|
|
aab28fcc5d | ||
|
|
452c5981a8 | ||
|
|
ebf43b64af | ||
|
|
dbd95a96fb | ||
|
|
8362ec825f | ||
|
|
e44d240f22 | ||
|
|
c04722c8d5 | ||
|
|
26a5e5fa33 | ||
|
|
5b3837af9f | ||
|
|
6a64d5fe0e | ||
|
|
4ceae087fa | ||
|
|
321d45dc86 | ||
|
|
066b2b3803 | ||
|
|
448387f29c | ||
|
|
64b6eb42cc | ||
|
|
c2f4e689e8 | ||
|
|
f0d2856f44 | ||
|
|
0465a03aee | ||
|
|
ef7eaa925f | ||
|
|
e4d0fbaf37 | ||
|
|
0bd2e65d93 | ||
|
|
4f98f39f2a | ||
|
|
230364b3f3 | ||
|
|
5fa591c84f | ||
|
|
f70ef6bb14 | ||
|
|
9586b725ad | ||
|
|
a96a306901 | ||
|
|
366c0ca069 | ||
|
|
a22f8ce76c | ||
|
|
96c97df1e0 | ||
|
|
d683425ee1 | ||
|
|
cd9690a45a | ||
|
|
81338e9120 | ||
|
|
51c279047f | ||
|
|
a095f1255e | ||
|
|
2675b1f8e3 | ||
|
|
f4d39051e3 | ||
|
|
d8f682393f | ||
|
|
e592227628 | ||
|
|
853e8dcebc | ||
|
|
cd77b5867a | ||
|
|
8d80e25d08 | ||
|
|
8b0ee19d6e | ||
|
|
817b853472 | ||
|
|
cbc0597852 | ||
|
|
642f12e894 | ||
|
|
7a0ed9ecf6 | ||
|
|
a7d7c6e8f0 | ||
|
|
14c747a26c | ||
|
|
f1d57bd0df | ||
|
|
fc2bc0c715 | ||
|
|
47268cd6e0 | ||
|
|
214e7e4953 | ||
|
|
8161f387aa | ||
|
|
8f7d395a81 | ||
|
|
df9320bb8c | ||
|
|
0075f42c58 | ||
|
|
e76a05a436 | ||
|
|
e8eeb98131 | ||
|
|
67d47d59d3 | ||
|
|
30ebcf6d76 | ||
|
|
468c1c5fc2 | ||
|
|
bf4a172cb5 | ||
|
|
55a4a836c6 | ||
|
|
2fe6f87b23 | ||
|
|
d0d9c91487 | ||
|
|
a3c7d8c0c2 | ||
|
|
e1b8565358 | ||
|
|
21b7ef1f21 | ||
|
|
547583a1bc | ||
|
|
1c513cfb6f | ||
|
|
ae9c69307d | ||
|
|
db5db54fcf | ||
|
|
34d28c1b34 | ||
|
|
92fa02514b | ||
|
|
5aad4489c1 | ||
|
|
acf990e621 | ||
|
|
4f211cf691 | ||
|
|
be467cbbc1 | ||
|
|
1293620bbd | ||
|
|
047c5d5f65 | ||
|
|
b66732bcd0 | ||
|
|
cc245b3de8 | ||
|
|
bb32b06063 | ||
|
|
f2f1fbddf3 | ||
|
|
ee3378f88b | ||
|
|
9f57e68252 | ||
|
|
70262f4e89 | ||
|
|
7305ff7792 | ||
|
|
b035f7aab4 | ||
|
|
401a9c4687 | ||
|
|
420645800e | ||
|
|
f4f33e3d1f | ||
|
|
7da0dfde7d | ||
|
|
9c77281942 | ||
|
|
b67f775404 | ||
|
|
ba844c4382 | ||
|
|
b8e526757a | ||
|
|
0797b71d95 | ||
|
|
17cef2461d | ||
|
|
cfec27eab8 | ||
|
|
0ae8f95313 | ||
|
|
3d2ff947e4 | ||
|
|
df5fead77c | ||
|
|
6081aca66c | ||
|
|
2e51e3f363 | ||
|
|
ea66bd16cb | ||
|
|
80e9ffe881 | ||
|
|
cc9cacc04b | ||
|
|
355ca2e7fe | ||
|
|
851cef40c4 | ||
|
|
4cde4a5885 | ||
|
|
c6d37b7195 | ||
|
|
618aa84555 | ||
|
|
82d53474d3 | ||
|
|
9d0d6d7475 | ||
|
|
f7923bdf52 | ||
|
|
e4598d5ebf | ||
|
|
fbe41afdca | ||
|
|
b94f702cc0 | ||
|
|
3951c8e35b | ||
|
|
a331edafe8 | ||
|
|
a82b3acc2b | ||
|
|
2637698641 | ||
|
|
ffeb600382 | ||
|
|
171ed885eb | ||
|
|
e3e05a07f3 | ||
|
|
5a990de0d6 | ||
|
|
3b11245525 | ||
|
|
94923d3ddf | ||
|
|
37a1a5246b | ||
|
|
428cfa3fe0 | ||
|
|
d08a100259 | ||
|
|
be567b9c0e | ||
|
|
748231b8f1 | ||
|
|
48b1fbe66e | ||
|
|
30fb116676 | ||
|
|
c6149cedcc | ||
|
|
5eb2b92397 | ||
|
|
26bbd6672f | ||
|
|
3cfacafb16 | ||
|
|
d3bc318307 | ||
|
|
405200d109 | ||
|
|
6dfb4dd989 | ||
|
|
763840e7fc | ||
|
|
a9f9a8ef7f | ||
|
|
2480ad34af | ||
|
|
e2f6e3324a | ||
|
|
ca7b5cab86 | ||
|
|
76471a6db1 | ||
|
|
dd8e51a1d9 | ||
|
|
83a6a8663d | ||
|
|
3c6fc62a8a | ||
|
|
5fff3bd09e | ||
|
|
9cbfb930a4 | ||
|
|
4015bf7d3b | ||
|
|
7a7dc9b2b7 | ||
|
|
0c993c069d | ||
|
|
d04035dd3f | ||
|
|
5e18528d02 | ||
|
|
68e42e9c5a | ||
|
|
495f8bf968 | ||
|
|
506a9a2e3f | ||
|
|
95992e918a | ||
|
|
cf53edf604 | ||
|
|
a581879a8e | ||
|
|
7581205800 | ||
|
|
4ed742fa4a | ||
|
|
d3cb258440 | ||
|
|
2d42c21c1a | ||
|
|
1e2700cde1 | ||
|
|
6c39a89636 | ||
|
|
e5f8883399 | ||
|
|
92b9a40891 | ||
|
|
7d45be983b | ||
|
|
63c60f3e6f | ||
|
|
badadbf469 | ||
|
|
c32b665c12 | ||
|
|
b37f60053d | ||
|
|
87d96b285b | ||
|
|
0ad12719f0 | ||
|
|
8ad80c7a1a | ||
|
|
7a17c78a51 | ||
|
|
05acdc4c5c | ||
|
|
0787252f36 | ||
|
|
c8089bfc32 | ||
|
|
1f38f5fd66 | ||
|
|
1fb1edb2fa | ||
|
|
9f5aa292ab | ||
|
|
92e61db752 | ||
|
|
67977a944c | ||
|
|
9b170483da | ||
|
|
71ecc3c59e | ||
|
|
04039f5bc3 | ||
|
|
94d0bccd96 | ||
|
|
72a12636b3 | ||
|
|
bfbc69fb25 | ||
|
|
206dc36a78 | ||
|
|
54a35674bc | ||
|
|
d73bf51fcb | ||
|
|
65f285e93f | ||
|
|
41f842e581 | ||
|
|
9879f749e4 | ||
|
|
b88686816b | ||
|
|
59219a8f55 | ||
|
|
08da60b1b0 | ||
|
|
6481f38f66 | ||
|
|
987b838856 | ||
|
|
4706c971d6 | ||
|
|
8ba79cce2a | ||
|
|
bfa1533ebf | ||
|
|
5db8069872 | ||
|
|
3a48b155e2 | ||
|
|
c5af04ec2b | ||
|
|
46692fd3dd | ||
|
|
4aa27ce269 | ||
|
|
db38756b88 | ||
|
|
62f0b6ad04 | ||
|
|
65e32d351b | ||
|
|
e7787b18a3 | ||
|
|
e77127e2d5 | ||
|
|
bc11e35d35 | ||
|
|
39940b3cc7 | ||
|
|
d2d7b6805e | ||
|
|
9df45f6564 | ||
|
|
a44a25f2e7 | ||
|
|
37827dfda1 | ||
|
|
827b69076a | ||
|
|
b5d830361a | ||
|
|
2ec595f8b0 | ||
|
|
9d61f22296 | ||
|
|
69a99667a3 | ||
|
|
2665df0f1e | ||
|
|
6d5fc0a082 | ||
|
|
41d12504ff | ||
|
|
20e069b5b2 | ||
|
|
5f0a065f4b | ||
|
|
f7c5e8773d | ||
|
|
990b38a4c6 | ||
|
|
d48571cb04 | ||
|
|
1e7bdaa991 | ||
|
|
52acd88e97 | ||
|
|
b265375148 | ||
|
|
fcd40af7c9 | ||
|
|
da1f339fd1 | ||
|
|
8d949fa1fc | ||
|
|
83f0d70291 | ||
|
|
d9504360d9 | ||
|
|
bcd21f6fd1 | ||
|
|
09c34ff006 | ||
|
|
dfc3f0a5d3 | ||
|
|
0a3f1dad50 | ||
|
|
3772e1e839 | ||
|
|
c4f5416adf | ||
|
|
fcdb9aca5d | ||
|
|
eaadcca1a9 | ||
|
|
f0bff56146 | ||
|
|
1760e8019b | ||
|
|
92e2177ed3 | ||
|
|
444b45a0c0 | ||
|
|
de72e6d6af | ||
|
|
32a8efad0e | ||
|
|
a35e149e13 | ||
|
|
f8523cf2b6 | ||
|
|
4e1df42f36 | ||
|
|
9a60ee9fe6 | ||
|
|
4cba0dac6e | ||
|
|
19f1ef75fd | ||
|
|
0561ba1f83 | ||
|
|
b29172ad18 | ||
|
|
312ced7e62 | ||
|
|
8f201944a4 | ||
|
|
6c9a350e43 | ||
|
|
a8881d146a | ||
|
|
6f1be59b4c | ||
|
|
5a15fcbbb5 | ||
|
|
40d1b7a654 | ||
|
|
9084e6b679 | ||
|
|
2f280151d4 | ||
|
|
ccb4fb13a9 | ||
|
|
b07c3b62cf | ||
|
|
d4805acef7 | ||
|
|
0637304a4f | ||
|
|
1454ac9299 | ||
|
|
8f9089f0a3 | ||
|
|
83ccec26ee | ||
|
|
db427c0bf1 | ||
|
|
0785ab9ee1 | ||
|
|
3882bddc8a | ||
|
|
767dcd1e9f | ||
|
|
7e997b224b | ||
|
|
1c11442aea | ||
|
|
7a08eea518 | ||
|
|
cb14ca4627 | ||
|
|
7a6a8bc707 | ||
|
|
157d63e2ed | ||
|
|
cc3ba89ab3 | ||
|
|
f9da876818 | ||
|
|
88135f93fe | ||
|
|
1148e391a6 | ||
|
|
f7c5706004 | ||
|
|
569a23759a | ||
|
|
3120afb55e | ||
|
|
4d565b853e | ||
|
|
e991241ad2 | ||
|
|
22e7756083 | ||
|
|
c65f537b8f | ||
|
|
f2e48df7ea | ||
|
|
935792fa9f | ||
|
|
3b4dc45984 | ||
|
|
fc747a94bd | ||
|
|
d9b1418f36 | ||
|
|
443016790a | ||
|
|
ca9253ecd5 | ||
|
|
ed8960d71f | ||
|
|
395b11474e | ||
|
|
71c2cb93cf | ||
|
|
615438f1dd | ||
|
|
dd14c94202 | ||
|
|
1c7fb79b33 | ||
|
|
0c8ac1539c | ||
|
|
c6c16cd488 | ||
|
|
86bd65556f | ||
|
|
a56502b814 | ||
|
|
24137df013 | ||
|
|
b945473422 | ||
|
|
d1fd6bfc8a | ||
|
|
ab7db9d084 | ||
|
|
c36007f216 | ||
|
|
1d8cc18411 | ||
|
|
0ec31c689d | ||
|
|
723fc52d1c | ||
|
|
8f15b098fb | ||
|
|
073aedc18b | ||
|
|
035abf03cb | ||
|
|
5808e85182 | ||
|
|
50dbc60a5c | ||
|
|
dbdc83c544 | ||
|
|
3551b3a8d4 | ||
|
|
1d743afd2a | ||
|
|
3240d3161b | ||
|
|
094bf69fab | ||
|
|
706226298a | ||
|
|
322bbb5d95 | ||
|
|
3d9bd3b646 | ||
|
|
5c12c6133f | ||
|
|
417367838c | ||
|
|
eb3480b514 | ||
|
|
6f1cc78329 | ||
|
|
a2faab036c | ||
|
|
a32441543c | ||
|
|
f4497402ca | ||
|
|
ef6548bc82 | ||
|
|
99ec7d43c5 | ||
|
|
f1bf0b3dee | ||
|
|
ec23cae38d | ||
|
|
771e3237cf | ||
|
|
ae72146d14 | ||
|
|
20d6865323 | ||
|
|
89e13b0bac | ||
|
|
8fa36ac14c | ||
|
|
e557782c64 | ||
|
|
7cc7f3fbcf | ||
|
|
3f293a6d23 | ||
|
|
309b09f6ce | ||
|
|
0b7e9f3d62 | ||
|
|
58c17ffd5c | ||
|
|
7d3ba23a9f | ||
|
|
ca2e4f5b37 | ||
|
|
d82174fec5 | ||
|
|
033c65b79b | ||
|
|
dbc8e5d9cc | ||
|
|
42407935d5 | ||
|
|
e7d558b0bf | ||
|
|
290b530b92 | ||
|
|
18726bdccd | ||
|
|
06b0498abb | ||
|
|
7a7627e931 | ||
|
|
c6038e9cee | ||
|
|
0e05596155 | ||
|
|
0ca212f911 | ||
|
|
94c2b9deda | ||
|
|
2016a1bb0d | ||
|
|
6841ba9c85 | ||
|
|
d5988f2c04 | ||
|
|
a56c9c3a46 | ||
|
|
9d0bbdcd4d | ||
|
|
4bfaac3414 | ||
|
|
d54c044fd9 | ||
|
|
1def66bb77 | ||
|
|
75041db2e9 | ||
|
|
356948cdf7 | ||
|
|
db92abf3ee | ||
|
|
d5d59abf13 | ||
|
|
69c1e3e8e0 | ||
|
|
963c4e3e2b | ||
|
|
cc4c735a27 | ||
|
|
175517a9dc | ||
|
|
9cb3548393 | ||
|
|
ac0dea317f | ||
|
|
839dfb9709 | ||
|
|
2c7a4098f3 | ||
|
|
0228396376 | ||
|
|
c5aa0eba48 | ||
|
|
ac4472975d | ||
|
|
379f5fbaaf | ||
|
|
af71408c52 | ||
|
|
b7a4fa1e7c | ||
|
|
92b6e45ef2 | ||
|
|
acf6f67627 | ||
|
|
017c34dcde | ||
|
|
f6e54918b2 | ||
|
|
75b3c33526 | ||
|
|
f784760735 | ||
|
|
a739b3a96e | ||
|
|
0a8e0f00c2 | ||
|
|
00c4cf4893 | ||
|
|
e8e9ea9e2f | ||
|
|
c9cdb6767b | ||
|
|
24f9c1c762 | ||
|
|
766a880799 | ||
|
|
07de0dbeb0 | ||
|
|
d1752f2ff0 | ||
|
|
ef27234ef8 | ||
|
|
685862f1de | ||
|
|
97621c45a8 | ||
|
|
b96d433796 | ||
|
|
03d784c284 | ||
|
|
02ef97724f | ||
|
|
93e2c65d30 | ||
|
|
d02bf65a55 | ||
|
|
fb2f566314 | ||
|
|
2227870854 | ||
|
|
b195509843 | ||
|
|
2100fa0606 | ||
|
|
3fe43bdfa3 | ||
|
|
26ad3d48af | ||
|
|
9c224fefb7 | ||
|
|
e4db873e43 | ||
|
|
f06d53b3d2 | ||
|
|
4ef706b716 | ||
|
|
09e364625d | ||
|
|
35f575ed7f | ||
|
|
7b0d46b37f | ||
|
|
b8be2c9e13 | ||
|
|
f05c763119 | ||
|
|
262b3bb3b3 | ||
|
|
f474137b91 | ||
|
|
7a18d88c50 | ||
|
|
d3ea71c726 | ||
|
|
8d1c9fe666 | ||
|
|
62ccfaa9c0 | ||
|
|
e6566bccdc | ||
|
|
14ed7282f3 | ||
|
|
b13145adce | ||
|
|
c0b169f7dd | ||
|
|
3cfca9845a | ||
|
|
afa8d07bb4 | ||
|
|
02434e0ca1 | ||
|
|
3d68c77ed4 | ||
|
|
11f76c507b | ||
|
|
a2e241966e | ||
|
|
c68f3eb44d | ||
|
|
6a1d8dcdca | ||
|
|
ba358e5847 | ||
|
|
5e174fd5a9 | ||
|
|
7bf7944360 | ||
|
|
9f72b074d5 | ||
|
|
9af2500292 | ||
|
|
59b7934aa2 | ||
|
|
8e9dea260e | ||
|
|
29ed6cb3b0 | ||
|
|
a7a61a993c | ||
|
|
68d1c0854b | ||
|
|
fdd6f01415 | ||
|
|
4670bb49e8 | ||
|
|
54a045e25a | ||
|
|
fcc18befc3 | ||
|
|
52ac9b1621 | ||
|
|
862b76f165 | ||
|
|
9bca545f01 | ||
|
|
80032f8ed7 | ||
|
|
a63a690307 | ||
|
|
5ed0b2ba6b | ||
|
|
24dc2716f7 | ||
|
|
bbe26618ac | ||
|
|
6f65d9e8d8 | ||
|
|
3f40896374 | ||
|
|
f1b0decbab | ||
|
|
8d8778b397 | ||
|
|
c2b60698bc | ||
|
|
68d3b422cc | ||
|
|
63ff4c1dca | ||
|
|
145420aaaa | ||
|
|
8987ec61fe | ||
|
|
34ee17b7f5 | ||
|
|
a93627d274 | ||
|
|
90fe18b660 | ||
|
|
2a0646d1dd | ||
|
|
6182376d1f | ||
|
|
52620e84cd | ||
|
|
66235f7e77 | ||
|
|
49b61dab53 | ||
|
|
4747113742 | ||
|
|
a10f2949a4 | ||
|
|
f26d7c6a62 | ||
|
|
2e0d8cfd43 | ||
|
|
666d8ab5ad | ||
|
|
db57c53652 | ||
|
|
bbcf9e00fa | ||
|
|
badf1aec6f | ||
|
|
19bb4514df | ||
|
|
778be7fea8 | ||
|
|
326970bcd4 | ||
|
|
9411bce8b0 | ||
|
|
244c1a426b | ||
|
|
b3f9ca8721 | ||
|
|
8c66a83054 | ||
|
|
df6a1f6613 | ||
|
|
1033a926fc | ||
|
|
d339c04177 | ||
|
|
edcf0aae84 | ||
|
|
20f97caab3 | ||
|
|
86be4e7352 | ||
|
|
697e271e66 | ||
|
|
5f74504da8 | ||
|
|
fb3d46d389 | ||
|
|
875971fb6e | ||
|
|
1939a58f17 | ||
|
|
40b3374fdd | ||
|
|
c564b1b75a | ||
|
|
c28e73ce3f | ||
|
|
788a6bfdc3 | ||
|
|
15d1f79115 | ||
|
|
bf699d88f7 | ||
|
|
d7f8e4e050 | ||
|
|
3872d7897a | ||
|
|
17a1f6ce63 | ||
|
|
eaa155eff7 | ||
|
|
13fba6d71c | ||
|
|
0d423aa349 | ||
|
|
2fca224ba4 | ||
|
|
574f85df46 | ||
|
|
b7176983e2 | ||
|
|
e8f19ff0dc | ||
|
|
d3cb4607ea | ||
|
|
8ae0696f07 | ||
|
|
299c3c13fc | ||
|
|
a79a8bcef6 | ||
|
|
2a0dd46b5e | ||
|
|
6c287bc2e2 | ||
|
|
7add59ffcb | ||
|
|
9747c43988 | ||
|
|
8b9a0f1437 | ||
|
|
1315ca007c | ||
|
|
e753d767fc | ||
|
|
db893859c2 | ||
|
|
16af3d2ad8 | ||
|
|
f334080fe6 | ||
|
|
b2acfbed98 | ||
|
|
2aca6ca28a | ||
|
|
c96040edec | ||
|
|
e0ebb44e64 | ||
|
|
ee1af88f8d | ||
|
|
1659e583ea | ||
|
|
6f0575d798 | ||
|
|
ba05c45f47 | ||
|
|
353caf29b3 | ||
|
|
7600d473bb | ||
|
|
c9ff48245e | ||
|
|
4ed4a94209 | ||
|
|
c88e01fe75 | ||
|
|
9e46edce79 | ||
|
|
bae5c67839 | ||
|
|
635d5d9c6c | ||
|
|
65be8c385f | ||
|
|
c3d44e2472 | ||
|
|
4a781ed5f4 | ||
|
|
d9995512a1 | ||
|
|
6ed2466785 | ||
|
|
724c74b488 | ||
|
|
67887c5ba4 | ||
|
|
ea2a0068ed | ||
|
|
0bfdea5976 | ||
|
|
305ebc293f | ||
|
|
f17f74672e | ||
|
|
fcaf184b13 | ||
|
|
efe653f1f6 | ||
|
|
c1022bf8f3 | ||
|
|
0f4c3988f8 | ||
|
|
498b7b5679 | ||
|
|
ca445a3cb7 | ||
|
|
8a293749e0 | ||
|
|
5c034279e8 | ||
|
|
9460943ad2 | ||
|
|
5eaeabe231 | ||
|
|
2202b00600 | ||
|
|
68ba5a5c4a | ||
|
|
e80b490152 | ||
|
|
380937b644 | ||
|
|
ac72305101 | ||
|
|
a41779b0bb | ||
|
|
86cdbf24b7 | ||
|
|
5d7bc98088 | ||
|
|
1359e8eb2f | ||
|
|
f3a7003444 | ||
|
|
624f76b1a0 | ||
|
|
484ffa071c | ||
|
|
850fb3cb15 | ||
|
|
40075ed2e3 | ||
|
|
f68bb4b491 | ||
|
|
473e1109b4 | ||
|
|
c4b8b90ff5 | ||
|
|
70b4017353 | ||
|
|
e6f7bf4d6c | ||
|
|
69385519d7 | ||
|
|
235ee7c383 | ||
|
|
a6dba9f09a | ||
|
|
f1352430b9 | ||
|
|
b9b63a8a7c | ||
|
|
5358bf4a43 | ||
|
|
1c7a7d8147 | ||
|
|
ca055e8ca9 | ||
|
|
081c058229 | ||
|
|
a5c941b1b2 | ||
|
|
d43e63b89e | ||
|
|
102886e23d | ||
|
|
3b8b9e392e | ||
|
|
226152135d | ||
|
|
7f6a5b626e | ||
|
|
c5fa26ffcb | ||
|
|
7b2bbcfd05 | ||
|
|
e5b336d4f3 | ||
|
|
2d786d9660 | ||
|
|
a587efddde | ||
|
|
81dd2bc800 | ||
|
|
b1273176a9 | ||
|
|
46beb8b6b7 | ||
|
|
264efa2e8d | ||
|
|
f538f05ec3 | ||
|
|
069a50c717 | ||
|
|
08f1329868 | ||
|
|
e48043c2e8 | ||
|
|
024aeb6d01 | ||
|
|
c79ef63c4d | ||
|
|
54798b94c9 | ||
|
|
f70f22c503 | ||
|
|
33adc65dac | ||
|
|
a6541f6f21 | ||
|
|
0b44fee0e5 | ||
|
|
d03aec270e | ||
|
|
08bca7daf7 | ||
|
|
d5cb1f5c1b | ||
|
|
68b16d3de9 | ||
|
|
daffa60cd4 | ||
|
|
25cb6cdfb3 | ||
|
|
7afecc4cdd | ||
|
|
0e9373cf5e | ||
|
|
7992b78d4e | ||
|
|
fed5e6ded7 | ||
|
|
82ddd2e562 | ||
|
|
1470cea4ed | ||
|
|
43e8929368 | ||
|
|
6db3600a4b | ||
|
|
9b2324755b | ||
|
|
dc77b3c73e | ||
|
|
7627afb7d2 | ||
|
|
e68ad81d57 | ||
|
|
73b84d720a | ||
|
|
0743582ef6 | ||
|
|
f73d26fcf3 | ||
|
|
b1dd9f30fb | ||
|
|
27071695cb | ||
|
|
1f551b6052 | ||
|
|
947ebbb6f5 | ||
|
|
3a706cad86 | ||
|
|
8cb1709966 | ||
|
|
7533fc337e | ||
|
|
601f908992 | ||
|
|
ff72489f39 | ||
|
|
db442e0769 | ||
|
|
189bbd784d | ||
|
|
2940de57b6 | ||
|
|
cceb9eccc3 | ||
|
|
410ba24bef | ||
|
|
292e90e6b7 | ||
|
|
3f9b229a9e | ||
|
|
05c2270f36 | ||
|
|
f22fdd6724 | ||
|
|
8059669a21 | ||
|
|
28a8ad927a | ||
|
|
6f7d27a5fd | ||
|
|
d89a173a41 | ||
|
|
ba5fef320e | ||
|
|
a7982acc8f | ||
|
|
17742fccf1 | ||
|
|
7a2b563cd4 | ||
|
|
549984d1ed | ||
|
|
d9256074fe | ||
|
|
97be52a0bc | ||
|
|
26a4d24492 | ||
|
|
03dad5a178 | ||
|
|
4c0453d0e3 | ||
|
|
1299853961 | ||
|
|
e6d792ef5a | ||
|
|
e8e8d0d7b2 | ||
|
|
cec0c7b374 | ||
|
|
fd73a0b8a5 | ||
|
|
120ff8543e | ||
|
|
7b8fa73474 | ||
|
|
85164758ce | ||
|
|
8a38568617 | ||
|
|
0c9e795dfd | ||
|
|
ee1a50aa16 | ||
|
|
a13b6af04a | ||
|
|
f847535aea | ||
|
|
b1b03c6dc1 | ||
|
|
eeb10c6bce | ||
|
|
05241cefa5 | ||
|
|
1861e2cd87 | ||
|
|
8a17cbe23c | ||
|
|
484458c2ba | ||
|
|
c62cc15159 | ||
|
|
17f8b09782 | ||
|
|
9fd05672ae | ||
|
|
69d96450da | ||
|
|
7393040c12 | ||
|
|
9097e644d4 | ||
|
|
837b1691d1 | ||
|
|
2cdec34062 | ||
|
|
a33e10e92d | ||
|
|
86631117a2 | ||
|
|
05dfcf7511 | ||
|
|
3e1582bd6b | ||
|
|
743f348fcf | ||
|
|
2b2ac2a76d | ||
|
|
a7d2d41b0f | ||
|
|
6ef0081ace | ||
|
|
4f3304d55f | ||
|
|
47b6093752 | ||
|
|
ea8d930e56 | ||
|
|
79f3d86384 | ||
|
|
fff201b7cd | ||
|
|
1ad454ce0b | ||
|
|
e090fe699b | ||
|
|
f677b5614b | ||
|
|
f7b240e6a9 | ||
|
|
ea3a60aaf7 | ||
|
|
6a7cfa58ae | ||
|
|
482f0cc314 | ||
|
|
28ada61f3d | ||
|
|
7057210e90 | ||
|
|
8c5bc59c45 | ||
|
|
b7370ff238 | ||
|
|
fb36f769d9 | ||
|
|
f07b728851 | ||
|
|
7d4ada7ec2 | ||
|
|
1c31a6689f | ||
|
|
a839144796 | ||
|
|
87cbe603d2 | ||
|
|
ec96916013 | ||
|
|
2c811a4faa | ||
|
|
6e089c1e25 | ||
|
|
2e203341b7 | ||
|
|
5bea143bf0 | ||
|
|
732494e251 | ||
|
|
39e1303cbe | ||
|
|
62c3549004 | ||
|
|
9bcc942f0f | ||
|
|
e34ee34d7b | ||
|
|
dedef4b36f | ||
|
|
e6f6e0fcf1 | ||
|
|
11a9e2ab9c | ||
|
|
9077542f61 | ||
|
|
cb6faaa769 | ||
|
|
a209d5aaaf | ||
|
|
767cdc75ee | ||
|
|
3eef0e088a | ||
|
|
1e5ef6a070 | ||
|
|
a2edc3cf4e | ||
|
|
9a5dc7b4d1 | ||
|
|
7b0fd40d3e | ||
|
|
169df31cab | ||
|
|
44b0ba2f33 | ||
|
|
8d70956607 | ||
|
|
5ad20c8666 | ||
|
|
790d4a88b5 | ||
|
|
b72ac42068 | ||
|
|
0a379be049 | ||
|
|
e0e08a1c17 | ||
|
|
0d825120bb | ||
|
|
7b81b66b76 | ||
|
|
d39f4e2533 | ||
|
|
598a2f9f05 | ||
|
|
ce9089b838 | ||
|
|
45b06fc154 | ||
|
|
f44177a994 | ||
|
|
d91b13a7c1 | ||
|
|
bd1894322c | ||
|
|
90874535ea | ||
|
|
8c919dbca4 | ||
|
|
05223c5272 | ||
|
|
afee6d564b | ||
|
|
b4e879a369 | ||
|
|
de4d96e260 | ||
|
|
89056f61c2 | ||
|
|
afac29151c | ||
|
|
e54430fb1b | ||
|
|
7d8736b98c | ||
|
|
216e9419d4 | ||
|
|
359fdd4dab | ||
|
|
2044a87630 | ||
|
|
171feed28e | ||
|
|
92dbbbd390 | ||
|
|
3166cb862e | ||
|
|
b606cb2e04 | ||
|
|
724ef00d52 | ||
|
|
0b7857b495 | ||
|
|
a150eb7f0e | ||
|
|
4cb21a4fdb | ||
|
|
46e13b0269 | ||
|
|
d4d5138991 | ||
|
|
9fd00d9f0a | ||
|
|
9361938285 | ||
|
|
cb054b2f2b | ||
|
|
f8ff6e6cf5 | ||
|
|
918c1b2114 | ||
|
|
2026bcb021 | ||
|
|
ce5393155a | ||
|
|
6f4b752b10 | ||
|
|
2a5a453517 | ||
|
|
191bba7afc | ||
|
|
f50d2ef9e3 | ||
|
|
1ad744d151 | ||
|
|
ba0f86c8d4 | ||
|
|
372c84bfa3 | ||
|
|
6ec18950e4 | ||
|
|
6c3168a356 | ||
|
|
109ee17a47 | ||
|
|
21702b3c34 | ||
|
|
159a2ee99d | ||
|
|
d6151d33b4 | ||
|
|
2217e03fa8 | ||
|
|
794c7eb523 | ||
|
|
98f61c0c4b | ||
|
|
5f5a450d95 | ||
|
|
0ba9679a75 | ||
|
|
85e60d4e32 | ||
|
|
a074b8a214 | ||
|
|
ac593c1d3d | ||
|
|
170e62bc8b | ||
|
|
5d19ae42dc | ||
|
|
9f3fdd01bf | ||
|
|
65e94e237d | ||
|
|
7935bc59fe | ||
|
|
f49677b5c0 | ||
|
|
b69f829a3e | ||
|
|
13dfc90a1b | ||
|
|
6d49d39480 | ||
|
|
f473ea9cea | ||
|
|
db8536ac55 | ||
|
|
e402745a86 | ||
|
|
abcaaddc2f | ||
|
|
3ac375c95c | ||
|
|
56f65e0fc0 | ||
|
|
471df0034e | ||
|
|
a1b3be9ef3 | ||
|
|
c4f70482ac | ||
|
|
31a8fa387d | ||
|
|
a0d6cb9be4 | ||
|
|
4586d26bd6 | ||
|
|
1609adc766 | ||
|
|
aa0a9cf708 | ||
|
|
d7dfe5fea4 | ||
|
|
340ed5acec | ||
|
|
7ec3e38e6d | ||
|
|
879bf13809 | ||
|
|
4edf4ef9ea | ||
|
|
b44bbaffa2 | ||
|
|
4b24491fe4 | ||
|
|
96458ab26a | ||
|
|
4c562cb603 | ||
|
|
494227324a | ||
|
|
8eb2be46ca | ||
|
|
6d4b3f24cb | ||
|
|
a26436d3de | ||
|
|
cd7571387c | ||
|
|
741f7f65c2 | ||
|
|
1b3496edd9 | ||
|
|
356da4e70d | ||
|
|
cd6da3ba87 | ||
|
|
ba0a79cc9b | ||
|
|
f3deffb3f6 | ||
|
|
c76823f9ee | ||
|
|
8398cc4364 | ||
|
|
6ddda814c0 | ||
|
|
5b777d3f1e | ||
|
|
4f19109ba1 | ||
|
|
76ffa2def9 | ||
|
|
2fdc0a3a93 | ||
|
|
7f3b874061 | ||
|
|
d9315763a6 | ||
|
|
c732f30e40 | ||
|
|
793cb4b878 | ||
|
|
85c476c548 | ||
|
|
0dcc8d08d1 | ||
|
|
da7635f68f | ||
|
|
2fc66f14f3 | ||
|
|
6623d9fa8b | ||
|
|
774984a5a4 | ||
|
|
30dec6bc02 | ||
|
|
3e56a1117d | ||
|
|
c28d680bf4 | ||
|
|
89aa2950fa | ||
|
|
d1c13bf03f | ||
|
|
5dc79086b7 | ||
|
|
406d241bc8 | ||
|
|
021760d75f | ||
|
|
77bae5a5e2 | ||
|
|
d2cacdc8d9 | ||
|
|
30097c32b5 | ||
|
|
c114e08541 | ||
|
|
bf660e81ae | ||
|
|
cf9c4ec0b1 | ||
|
|
7649f4d680 | ||
|
|
9d238d270e | ||
|
|
b89a128292 | ||
|
|
ac2e244b11 | ||
|
|
76551a59fe | ||
|
|
61c1732b9c | ||
|
|
c54c4e9a17 | ||
|
|
9bc7cefbc5 | ||
|
|
9a918e5d97 | ||
|
|
5f578298b4 | ||
|
|
cf63b1c779 | ||
|
|
85992dde1a | ||
|
|
17dac5bde8 | ||
|
|
3887acfbf8 | ||
|
|
ad5a0b2060 | ||
|
|
bb2ddb3d1d | ||
|
|
6a6e0adb57 | ||
|
|
4fa8d9b919 | ||
|
|
908d2f69d3 | ||
|
|
4c3c0db2c5 | ||
|
|
fb4db584c2 | ||
|
|
fcf645e73f | ||
|
|
fac5704c9e | ||
|
|
a3548bc194 | ||
|
|
055a7daad5 | ||
|
|
e4a8bc38df | ||
|
|
86bd451b05 | ||
|
|
1101510817 | ||
|
|
01d8dddeac | ||
|
|
ee2a8d2a39 | ||
|
|
d8894d6645 | ||
|
|
07daf6f5a0 | ||
|
|
496ede69ac | ||
|
|
6068cbf3cc | ||
|
|
7264fce1dd | ||
|
|
a8a1acdbd0 | ||
|
|
059c43f840 | ||
|
|
a5cb393447 | ||
|
|
0b98c7beb5 | ||
|
|
be735e572e | ||
|
|
807dcb7901 | ||
|
|
19241aca7a | ||
|
|
05e1145084 | ||
|
|
22972b32b4 | ||
|
|
0d89218031 | ||
|
|
baa0dd91d0 | ||
|
|
09c11b2d7a | ||
|
|
bb26bc1eab | ||
|
|
26a60fb68b | ||
|
|
3cebf73464 | ||
|
|
9e8550b572 | ||
|
|
cb8b6654e7 | ||
|
|
8969866aec | ||
|
|
91ba7dfaf0 | ||
|
|
deb4dad643 | ||
|
|
720635d7a3 | ||
|
|
e5e082c48b | ||
|
|
d8b2a13c20 | ||
|
|
535607e089 | ||
|
|
20f15e749e | ||
|
|
d14faee83d | ||
|
|
a53ccb66c5 | ||
|
|
90bc01e467 | ||
|
|
399ac5348a | ||
|
|
61c8a125c3 | ||
|
|
84f261752f | ||
|
|
ec37ea62a2 | ||
|
|
6736f15f61 | ||
|
|
bc64e7ffe4 | ||
|
|
1e51006786 | ||
|
|
7357054517 | ||
|
|
b25ff943e4 | ||
|
|
4446bc520b | ||
|
|
924d55de6e | ||
|
|
eab9705e08 | ||
|
|
25ccc9f685 | ||
|
|
62894366e6 | ||
|
|
d06c3f82c3 | ||
|
|
a0fd9e05e8 | ||
|
|
dd3e52f230 | ||
|
|
af60f82322 | ||
|
|
2e8e466a22 | ||
|
|
a3ad4130af | ||
|
|
37f718f26e | ||
|
|
c7e46ecc03 | ||
|
|
1e368757ec | ||
|
|
54122e6ea2 | ||
|
|
9e3096b674 | ||
|
|
f0dbe8b78b | ||
|
|
ab89b3c91b | ||
|
|
54e0ee08e6 | ||
|
|
803e06c019 | ||
|
|
2057fd7357 | ||
|
|
2561660cf4 | ||
|
|
e382c59556 | ||
|
|
a003efe7c9 | ||
|
|
1975d16f3a | ||
|
|
da74c37ab1 | ||
|
|
3df9c7eb02 | ||
|
|
5951ac930a | ||
|
|
7160c0a65b | ||
|
|
19a9b5c91e | ||
|
|
b6d1f26af0 | ||
|
|
6094c69fc1 | ||
|
|
a11c6a23c4 | ||
|
|
52afd6f11c | ||
|
|
0c10657351 | ||
|
|
36ade17f67 | ||
|
|
469e35d8a0 | ||
|
|
39219b6b78 | ||
|
|
977b8fa8e9 | ||
|
|
7e0604409a | ||
|
|
83f78cc02c | ||
|
|
c21ec8d5f2 | ||
|
|
41c566e227 | ||
|
|
ae82ebbf74 | ||
|
|
177018daae | ||
|
|
003e884056 | ||
|
|
5f481fa2dd | ||
|
|
f425584822 | ||
|
|
8c1142481d | ||
|
|
569b995a94 | ||
|
|
d20a26680a | ||
|
|
472e1ece5a | ||
|
|
84c56256f7 | ||
|
|
632467a9a6 | ||
|
|
d2faec45bb | ||
|
|
480772e022 | ||
|
|
e7bd4c1790 | ||
|
|
5910b28362 | ||
|
|
a3c32d8389 | ||
|
|
e2b0bba6e6 | ||
|
|
4813657568 | ||
|
|
2989181723 | ||
|
|
5df8d833d5 | ||
|
|
449fc4cddc | ||
|
|
fb87926318 | ||
|
|
623d94b77f | ||
|
|
74ad0cab35 | ||
|
|
4f81706b92 | ||
|
|
4e61bd6048 | ||
|
|
252ae4e18f | ||
|
|
3249c07bcd | ||
|
|
3def2ef0da | ||
|
|
cb0321aa20 | ||
|
|
1096f719ae | ||
|
|
9bfe12587f | ||
|
|
91d4b26c1c | ||
|
|
ef317064b4 | ||
|
|
fa3b4f3ac2 | ||
|
|
052c489bf7 | ||
|
|
f3402e2c4e | ||
|
|
34a3cd9ce5 | ||
|
|
4d5f3bcbfe | ||
|
|
339e1dc897 | ||
|
|
c4e617f18e | ||
|
|
89bc329ea6 | ||
|
|
eee49b215e | ||
|
|
d9a8b83268 | ||
|
|
def7abe3ba | ||
|
|
75e64b3836 | ||
|
|
efb106c597 | ||
|
|
5e1087c6b4 | ||
|
|
5f8800defa | ||
|
|
445c0b3834 | ||
|
|
61c1e5ab6c | ||
|
|
2502cad0c1 | ||
|
|
76032493b9 | ||
|
|
0a3a6b3773 | ||
|
|
014d47d017 | ||
|
|
8bd7734ae3 | ||
|
|
7aa2ba917f | ||
|
|
96f0ce2381 | ||
|
|
f1eb5b9862 | ||
|
|
45cb5a6e38 | ||
|
|
4131ea54ae | ||
|
|
3806affe1b | ||
|
|
6ea3a03de3 | ||
|
|
5b25e8b7e6 | ||
|
|
60c96ba5f7 | ||
|
|
9732852891 | ||
|
|
326b46a6e6 | ||
|
|
29924ea3b1 | ||
|
|
434506699b | ||
|
|
eeaaaf7af1 | ||
|
|
3f5dab0680 | ||
|
|
dd69658f2a | ||
|
|
3c2d998a30 | ||
|
|
a0ead9d774 | ||
|
|
4460a105a8 | ||
|
|
c6b369587d | ||
|
|
8c19ad5f7f | ||
|
|
1824e0d0a6 | ||
|
|
404bb0c3cd | ||
|
|
7fd6b16cf3 | ||
|
|
47abd1ab52 | ||
|
|
5c8d728ac5 | ||
|
|
2706bc461e | ||
|
|
91f52e4f42 | ||
|
|
5538dd45d3 | ||
|
|
105205a9aa | ||
|
|
e3547717a0 | ||
|
|
1714e0e9a0 | ||
|
|
afdd15ac44 | ||
|
|
09097dba4a | ||
|
|
01a8fbd5b1 | ||
|
|
f2d5eed7e3 | ||
|
|
cfae3cde1d | ||
|
|
87a0c1b293 | ||
|
|
486c8c8f37 | ||
|
|
ea99ca3d38 | ||
|
|
2069a25f30 | ||
|
|
baf3493044 | ||
|
|
543a12a475 | ||
|
|
a73f97744a | ||
|
|
ae135ab678 | ||
|
|
96366548a3 | ||
|
|
54cdd5180d | ||
|
|
0a5ce2a4d4 | ||
|
|
a4e1ccc4bb | ||
|
|
55c632979e | ||
|
|
b1208a449e | ||
|
|
9e2b329beb | ||
|
|
10d329094c | ||
|
|
38f44b3e5f | ||
|
|
c99a1261d5 | ||
|
|
4e2e344892 | ||
|
|
e0128bf54f | ||
|
|
a683e6bdf8 | ||
|
|
bc64effb14 | ||
|
|
6b0a280e2c | ||
|
|
ddf25e02e3 | ||
|
|
967d5a6387 | ||
|
|
a5137b85af | ||
|
|
1ed79fedf0 | ||
|
|
8a8cb08b99 | ||
|
|
b49aaa69cc | ||
|
|
015357d551 | ||
|
|
5419d76080 | ||
|
|
21e1422994 | ||
|
|
dafb076659 | ||
|
|
491f3d27ff | ||
|
|
3be58d5d09 | ||
|
|
8aeb23a985 | ||
|
|
fa99040232 | ||
|
|
2e928f2442 | ||
|
|
8ebb35c0d5 | ||
|
|
7d17bee201 | ||
|
|
5c345fb4d9 | ||
|
|
d2cd098ab0 | ||
|
|
f4a88df067 | ||
|
|
8f4917eb24 | ||
|
|
a9310b108a | ||
|
|
8c638dffd4 | ||
|
|
0151273a75 | ||
|
|
b10dc8128c | ||
|
|
476d36c9c5 | ||
|
|
64087defd0 | ||
|
|
807b7bc349 | ||
|
|
3018c345fa | ||
|
|
8f35c59943 | ||
|
|
348332f7ca | ||
|
|
9ebd992222 | ||
|
|
9597ea0dbd | ||
|
|
23fb6c6e1f | ||
|
|
ddb5033de8 | ||
|
|
43a49e3c31 | ||
|
|
5a06ee50d8 | ||
|
|
c02f65ef81 | ||
|
|
dbb9b20b7f | ||
|
|
3bfd540f53 | ||
|
|
a971f7357f | ||
|
|
4918f8f985 | ||
|
|
988388ed16 | ||
|
|
f1de9deb80 | ||
|
|
2642a6ea6e | ||
|
|
74b82c92d8 | ||
|
|
ded3d112b2 | ||
|
|
c9e7f02b23 | ||
|
|
c7fb864e04 | ||
|
|
16d300445c | ||
|
|
edc24621a6 | ||
|
|
17b48c0e4c | ||
|
|
771d58f425 | ||
|
|
fd76459077 | ||
|
|
1955dff68e | ||
|
|
730b5fb8a9 | ||
|
|
c1a115e2b0 | ||
|
|
7773e41ad4 | ||
|
|
304bbb62ad | ||
|
|
7b439ace04 | ||
|
|
d9ef87fb90 | ||
|
|
2333b7a1ef | ||
|
|
1a00932c63 | ||
|
|
1f09015c86 | ||
|
|
5d79d8520f | ||
|
|
dde044d8c5 | ||
|
|
aeeb84b626 | ||
|
|
ccb9022e16 | ||
|
|
a9e783b5f1 | ||
|
|
46190df6ff | ||
|
|
1eb258cab7 | ||
|
|
a3836b0091 | ||
|
|
7fbc9fbac8 | ||
|
|
d0b5e2188b | ||
|
|
dfa2d6be89 | ||
|
|
276941197f | ||
|
|
20569e4252 | ||
|
|
3b7f99daa1 | ||
|
|
5ee30d9f3f | ||
|
|
3cde7fa5e3 | ||
|
|
aecb9bbdf4 | ||
|
|
1a95e14ee8 | ||
|
|
83aa07b918 | ||
|
|
4f8eea59fe | ||
|
|
248280e086 | ||
|
|
02b465ab8c | ||
|
|
c9d26dc1d8 | ||
|
|
389b158134 | ||
|
|
312af9befb | ||
|
|
b7f22bf687 | ||
|
|
f062ac255a | ||
|
|
dd8082244c | ||
|
|
25ff7e17c1 | ||
|
|
f4b3071a92 | ||
|
|
0c7b182215 | ||
|
|
2223a1ecf4 | ||
|
|
3a24784980 | ||
|
|
f86564a580 | ||
|
|
58897949eb | ||
|
|
2dee859b2a | ||
|
|
b1dbd173ad | ||
|
|
a9fc290627 | ||
|
|
12794968fc | ||
|
|
1b4cbb91ee | ||
|
|
62f1362cf6 | ||
|
|
49031d0b33 | ||
|
|
22fea07b0a | ||
|
|
81692371ec | ||
|
|
a96314f0f0 | ||
|
|
a92c294255 | ||
|
|
7c554a605e | ||
|
|
57eeec63c1 | ||
|
|
bd158008b2 | ||
|
|
c0ae8d5cdd | ||
|
|
78347920aa | ||
|
|
c88e662a30 | ||
|
|
5ae57ff5f6 | ||
|
|
7c74c85a66 | ||
|
|
07fc2123e7 | ||
|
|
afdb47b601 | ||
|
|
5ea437afbb | ||
|
|
c7041546c4 | ||
|
|
1d2fd21a06 | ||
|
|
27624ead8d | ||
|
|
fefc003984 | ||
|
|
70d3bf9fff | ||
|
|
4a64c4b648 | ||
|
|
15c980e57f | ||
|
|
9d8fc5b8ea | ||
|
|
8184221d2b | ||
|
|
5786983d8b | ||
|
|
1e1468ab68 | ||
|
|
e3f0177759 | ||
|
|
f1fc6160fe | ||
|
|
38d4a39014 | ||
|
|
566d0c1aa0 | ||
|
|
ce752b32fd | ||
|
|
a61553d08b | ||
|
|
daacb026d8 | ||
|
|
0ae637fba2 | ||
|
|
b81fd66b85 | ||
|
|
071e94ac97 | ||
|
|
a98465f30e | ||
|
|
e949a0bae6 | ||
|
|
f7f9e2fda0 | ||
|
|
80a0571b0c | ||
|
|
d91897a922 | ||
|
|
05180ece92 | ||
|
|
ee8e960ce4 | ||
|
|
5b4a8666cd | ||
|
|
7240757a28 | ||
|
|
2a8baa2f34 | ||
|
|
0c44e0d101 | ||
|
|
63ab5b77f3 | ||
|
|
300198c9fa | ||
|
|
340af18beb | ||
|
|
8862fd279e | ||
|
|
83cff1bc42 | ||
|
|
a75534e32a | ||
|
|
462eb8792c | ||
|
|
19f29c0401 | ||
|
|
27657260fc | ||
|
|
c17fb9ab1e | ||
|
|
bd6eafd291 | ||
|
|
a63306603a | ||
|
|
d3b1114b1e | ||
|
|
87340e29e8 | ||
|
|
4f1f8d9301 | ||
|
|
664b294471 | ||
|
|
7774c12ab2 | ||
|
|
6592dfc4da | ||
|
|
e823ecc178 | ||
|
|
74d5a737db | ||
|
|
bf9799af66 | ||
|
|
fc9b67672f | ||
|
|
6e8342511f | ||
|
|
da2cebd765 | ||
|
|
ef19dc3330 | ||
|
|
2f73a2d19b | ||
|
|
fab257eb97 | ||
|
|
850c3fd696 | ||
|
|
a619738652 | ||
|
|
395c575f78 | ||
|
|
ecf8256b14 | ||
|
|
2d6d6a2b19 | ||
|
|
ee404fa400 | ||
|
|
10fc546369 | ||
|
|
0ea0c09007 | ||
|
|
85b2dbac11 | ||
|
|
d69f994f4c | ||
|
|
12a368054a | ||
|
|
7a2a9de174 | ||
|
|
0e14f2b987 | ||
|
|
a50d97adf5 | ||
|
|
62e9138cf1 | ||
|
|
657e7f0e37 | ||
|
|
66d648c7d4 | ||
|
|
08dd77a6b6 | ||
|
|
037f0d4db1 | ||
|
|
19ff591105 | ||
|
|
7d2655f757 | ||
|
|
7b1a1be366 | ||
|
|
1fc3ae72b5 | ||
|
|
991b864881 | ||
|
|
f95fa96ae1 | ||
|
|
e33cdf268a | ||
|
|
dcae13f4dc | ||
|
|
96ac275970 | ||
|
|
e58a4c4bbf | ||
|
|
c35985e658 | ||
|
|
4bc5a89ac2 | ||
|
|
b7e14d60cc | ||
|
|
7164a71d88 | ||
|
|
6bedd86e08 | ||
|
|
d39e99cbdd | ||
|
|
ab3134f44a | ||
|
|
5aaca9921c | ||
|
|
9223e43b7c | ||
|
|
3766dd16e7 | ||
|
|
e53aff0031 | ||
|
|
4a40f1fba7 | ||
|
|
8432e9dcc8 | ||
|
|
04e9bd9de3 | ||
|
|
ed8ed591f7 | ||
|
|
34ff0218b9 | ||
|
|
2f6c928077 | ||
|
|
eff0152f44 | ||
|
|
a3188ce694 | ||
|
|
4bf81be56f | ||
|
|
7c22960f42 | ||
|
|
3d6f90ad93 | ||
|
|
a02aebeed2 | ||
|
|
d06afd4def | ||
|
|
88e148fca8 | ||
|
|
2d00ef314f | ||
|
|
0b6a29a035 | ||
|
|
5feb0eb7c7 | ||
|
|
48cb718fbe | ||
|
|
13ad6ec0d0 | ||
|
|
9cfdb3a00b | ||
|
|
b560254df2 | ||
|
|
101ed19073 | ||
|
|
65868fd26a | ||
|
|
d2e5b26765 | ||
|
|
2cac1ea608 | ||
|
|
9d37e68e24 | ||
|
|
290a1c5b31 | ||
|
|
ff924f666f | ||
|
|
8c5eb9c913 | ||
|
|
25e72fa6a5 | ||
|
|
76602aede1 | ||
|
|
77411702a7 | ||
|
|
1aeee24d97 | ||
|
|
d8cd0d31db | ||
|
|
e72557bb59 | ||
|
|
84e587fcaf | ||
|
|
f8e75dccdf | ||
|
|
b6eca1db17 | ||
|
|
6ff414ffcd | ||
|
|
b54c9a797d | ||
|
|
7acbf3084d | ||
|
|
87847446a8 | ||
|
|
59f250b386 | ||
|
|
f93ce594d0 | ||
|
|
c41f4e51e5 | ||
|
|
6efd355864 | ||
|
|
7ee2ee9d35 | ||
|
|
737215c599 | ||
|
|
ced0c25a08 | ||
|
|
5e810d2aa3 | ||
|
|
c9e27dd190 | ||
|
|
1f8a14aca0 | ||
|
|
f518ae59c0 | ||
|
|
c5866f3d86 | ||
|
|
4d4bde46f8 | ||
|
|
cb89ad59af | ||
|
|
092b5024fe | ||
|
|
8221f7182b | ||
|
|
ecee739b1a | ||
|
|
702b47296c | ||
|
|
517edf2ced | ||
|
|
219c28313c | ||
|
|
656bba1d3f | ||
|
|
311d92202b | ||
|
|
05cb2ee272 | ||
|
|
f896a2d71a | ||
|
|
dd6704ace5 | ||
|
|
1dc4d44a65 | ||
|
|
bfb28ea178 | ||
|
|
ec6f3a22f2 | ||
|
|
5a0c7c330c | ||
|
|
f64df5af87 | ||
|
|
d4dc7a4051 | ||
|
|
d676f85c8f | ||
|
|
ab382f2387 | ||
|
|
206219c738 | ||
|
|
37d1c707cb | ||
|
|
93af1c9bfc | ||
|
|
a021c4c8d5 | ||
|
|
a125244cdf | ||
|
|
1cfd251c4c | ||
|
|
d2f4f312e5 | ||
|
|
c468b061d9 | ||
|
|
7bf945f0b6 | ||
|
|
fecbb26cbf | ||
|
|
a5ae33ab81 | ||
|
|
c6fa0e464e | ||
|
|
38bae6238a | ||
|
|
79de4c874f | ||
|
|
814748ec61 | ||
|
|
1f0ad0cbec | ||
|
|
7224f566d6 | ||
|
|
eefb01ec4f | ||
|
|
24d46ed81d | ||
|
|
37c749faf8 | ||
|
|
4306a3131e | ||
|
|
8fa95fcce3 | ||
|
|
b7c41ce640 | ||
|
|
a21be94ed3 | ||
|
|
9d59edcae2 | ||
|
|
deaa26a355 | ||
|
|
25d6fb6d82 | ||
|
|
c1bcc44f04 | ||
|
|
fdf8183385 | ||
|
|
db40426f00 | ||
|
|
eb92e648a0 | ||
|
|
5df26c324f | ||
|
|
c36a064fdc | ||
|
|
a28baa6a75 | ||
|
|
27aed29ddf | ||
|
|
744fb176cc | ||
|
|
5f8a0736e4 | ||
|
|
7fb179e769 | ||
|
|
48239c53ca | ||
|
|
4e18afb80f | ||
|
|
e9d3d7c807 | ||
|
|
60923197e5 | ||
|
|
a9f7c90323 | ||
|
|
cc723095c2 | ||
|
|
373b77f83f | ||
|
|
68ab589f3e | ||
|
|
23ccbb226f | ||
|
|
48edf2a2b5 | ||
|
|
082c65ef05 | ||
|
|
6553d8ec6c | ||
|
|
c54b6fcc7c | ||
|
|
655ee740e0 | ||
|
|
b02f77b8f9 | ||
|
|
351c46af06 | ||
|
|
d3db25d98a | ||
|
|
ef1fe1bd1d | ||
|
|
6c2cd93826 | ||
|
|
4859f54f42 | ||
|
|
749c2dc1e9 | ||
|
|
3d13026084 | ||
|
|
6cf66aa88e | ||
|
|
d10ef7038b | ||
|
|
cda612810d | ||
|
|
a7aaac513d | ||
|
|
329dbdf408 | ||
|
|
007f705904 | ||
|
|
36cddbe0cf | ||
|
|
e9409ccf72 | ||
|
|
b5a1ede962 | ||
|
|
2dc6951ef9 | ||
|
|
66f686c013 | ||
|
|
937aab2b1c | ||
|
|
43bee97055 | ||
|
|
a31f5ea87a | ||
|
|
0c4d5f3405 | ||
|
|
4e70ea0586 | ||
|
|
7736f6cd76 | ||
|
|
2db6eaa344 | ||
|
|
38b6cbda0e | ||
|
|
9292f18b5b | ||
|
|
193cf2438a | ||
|
|
155e0e3841 | ||
|
|
019c03ed2f | ||
|
|
316e54df92 | ||
|
|
40691ae899 | ||
|
|
ab8ba168ac | ||
|
|
b066d91cf5 | ||
|
|
2833581cde | ||
|
|
279c8b3188 | ||
|
|
eca6408415 | ||
|
|
35cfb1a480 | ||
|
|
30f3d4ab5e | ||
|
|
7e5424e40a | ||
|
|
82612326bf | ||
|
|
da2e5c835a | ||
|
|
af8eb51c76 | ||
|
|
7253e257f1 | ||
|
|
37e93edf25 | ||
|
|
36a56f050f | ||
|
|
31c2d1360d | ||
|
|
4addc48339 | ||
|
|
a7267bc920 | ||
|
|
93e94f40c3 | ||
|
|
bd75790c29 | ||
|
|
f1cffcae38 | ||
|
|
9111bce47a | ||
|
|
73ec161ac4 | ||
|
|
495a07639e | ||
|
|
044223e70e | ||
|
|
42c9250995 | ||
|
|
8b4a1d96fd | ||
|
|
fff06d7e92 | ||
|
|
726adc550c | ||
|
|
f5bde670f6 | ||
|
|
050873dd3a | ||
|
|
d3886c1c94 | ||
|
|
84f03cf3f9 | ||
|
|
f8953d56f4 | ||
|
|
ebbf14160b | ||
|
|
4df0a09de0 | ||
|
|
c485aa9a62 | ||
|
|
ae474022b9 | ||
|
|
f994cdf7c4 | ||
|
|
7ff514e5a7 | ||
|
|
344403de54 | ||
|
|
836243d170 | ||
|
|
0dc9129d79 | ||
|
|
61c9d07ad8 | ||
|
|
a238295ba8 | ||
|
|
dbabd0dd45 | ||
|
|
f87ff8db8a | ||
|
|
60d121f1e1 | ||
|
|
1497abff07 | ||
|
|
935ba7d4e4 | ||
|
|
fba79cde8f | ||
|
|
ce79d14a29 | ||
|
|
14b2083226 | ||
|
|
779a841817 | ||
|
|
3647523150 | ||
|
|
eb5b941fe6 | ||
|
|
c542d99536 | ||
|
|
918031a9c6 | ||
|
|
163e0cac2a | ||
|
|
95096dd8fd | ||
|
|
67bd98bf4b | ||
|
|
ac434c00d6 | ||
|
|
0fb8330ecf | ||
|
|
3f969cee5b | ||
|
|
ea5f6300f3 | ||
|
|
0d5e75db23 | ||
|
|
7d667a1d1b | ||
|
|
610922c8e0 | ||
|
|
36e0882542 | ||
|
|
b9979e87af | ||
|
|
bcd38dd853 | ||
|
|
b018580c0b | ||
|
|
38a7f42a1e | ||
|
|
1387d856ba | ||
|
|
f2bbc872d6 | ||
|
|
c74e7b416e | ||
|
|
f008688c14 | ||
|
|
dff0d5a992 | ||
|
|
6fe6f8960f | ||
|
|
0b0184098d | ||
|
|
647515d21a | ||
|
|
2ee944ef7b | ||
|
|
f4d2325b8b | ||
|
|
c0904125eb | ||
|
|
7dad30ad0c | ||
|
|
d6acb6dfdc | ||
|
|
b6da94fe2e | ||
|
|
dc5e292a02 | ||
|
|
4bf938107d | ||
|
|
ec7d49cdbc | ||
|
|
3c73062b91 | ||
|
|
5122f112d1 | ||
|
|
5e20fa6717 | ||
|
|
d4599d9377 | ||
|
|
adb9ce4d7e | ||
|
|
e777413a7b | ||
|
|
2cb0ac6221 | ||
|
|
8f7fafb990 | ||
|
|
158c911787 | ||
|
|
aa67575ecb | ||
|
|
81cf82c99f | ||
|
|
e638bf2eec | ||
|
|
6c9d1dbb3d | ||
|
|
fbb034ef92 | ||
|
|
335601d6b8 | ||
|
|
f6ad51ca74 | ||
|
|
e119f8b008 | ||
|
|
5af0eeff3b | ||
|
|
f685feb312 | ||
|
|
c78254a8fa | ||
|
|
9c3758b92c | ||
|
|
4ca2a7fa1a | ||
|
|
d6814b1601 | ||
|
|
55e5a21dcd | ||
|
|
792f422f76 | ||
|
|
8cac546087 | ||
|
|
0cfe91d960 | ||
|
|
4dea1762e8 | ||
|
|
b1a9b8d8b1 | ||
|
|
6787acce61 | ||
|
|
eb0adf7c28 | ||
|
|
783cccaa1b | ||
|
|
36a0a22996 | ||
|
|
a3f3357b2e | ||
|
|
cbbfa44174 | ||
|
|
812d2ec9bc | ||
|
|
b51ba96bb7 | ||
|
|
4c60cf79f6 | ||
|
|
8451949805 | ||
|
|
af5750cdf6 | ||
|
|
1a4dfd6f67 | ||
|
|
6aa800d453 | ||
|
|
82aa3b9508 | ||
|
|
6910a113da | ||
|
|
bd20aaa577 | ||
|
|
0aef3c0b04 | ||
|
|
2f97010b54 | ||
|
|
5bcdad2996 | ||
|
|
1e8a8d94c2 | ||
|
|
9aeefd7685 | ||
|
|
f72385471c | ||
|
|
f7a542560a | ||
|
|
400f43447d | ||
|
|
866593a831 | ||
|
|
c90cdc62fb | ||
|
|
d5c93f21b5 | ||
|
|
b58d78a29e | ||
|
|
f5b41eb78b | ||
|
|
c2a7d90944 | ||
|
|
b2a4ec238c | ||
|
|
df69584c7d | ||
|
|
574da55be7 | ||
|
|
52b808b902 | ||
|
|
714c7b0a33 | ||
|
|
3d774e3afa | ||
|
|
c91db1699b | ||
|
|
2b5695d8dc | ||
|
|
b562fc33bd | ||
|
|
425414b8f3 | ||
|
|
3b363d5ee3 | ||
|
|
4fc3b9a99e | ||
|
|
ab2b9bafeb | ||
|
|
e99fc6302f | ||
|
|
82996a807f | ||
|
|
86b31b1f26 | ||
|
|
19c9b38f82 | ||
|
|
b1d0d1cd27 | ||
|
|
c916011530 | ||
|
|
5db6327272 | ||
|
|
3c5fe4c778 | ||
|
|
f6f3f05aa5 | ||
|
|
10f34564d0 | ||
|
|
216ec2329d | ||
|
|
c3cb4619cf | ||
|
|
fcf2929b5b | ||
|
|
15c10ca553 | ||
|
|
9bb417ab38 | ||
|
|
5b110ee7b2 | ||
|
|
f3951966f3 | ||
|
|
f580f0ba60 | ||
|
|
a9e4ad3833 | ||
|
|
3e6c88eb27 | ||
|
|
7c4ef3f00f | ||
|
|
762d7f71c6 | ||
|
|
50cc658c20 | ||
|
|
21a59cb198 | ||
|
|
38ba3461be | ||
|
|
f70ee27809 | ||
|
|
674c1588d9 | ||
|
|
e9eb5402cc | ||
|
|
7f746a72bb | ||
|
|
bde6a810c4 | ||
|
|
ff3e7d1c5b | ||
|
|
7ecb63189a | ||
|
|
eb1e16d6bd | ||
|
|
f17b5d7244 | ||
|
|
a5b44e9fdf | ||
|
|
734219dbd4 | ||
|
|
45c351ab39 | ||
|
|
74aa55a8aa | ||
|
|
64b3a88ba0 | ||
|
|
08ff00f602 | ||
|
|
0d9853311a | ||
|
|
b1d17f9e84 | ||
|
|
3a6041a8df | ||
|
|
023171f19e | ||
|
|
546fed83c8 | ||
|
|
6b37ce80fd | ||
|
|
a98c8b3bcd | ||
|
|
7bd3dd26cf | ||
|
|
fe7684b46c | ||
|
|
ea5dcfe630 | ||
|
|
ad5f29338b | ||
|
|
89d2b26613 | ||
|
|
7206dc38bc | ||
|
|
4b9ff21743 | ||
|
|
fbe7910349 | ||
|
|
7b098095cb | ||
|
|
7966be90e7 | ||
|
|
b64db89307 | ||
|
|
cb9b7c3e72 | ||
|
|
a268962c15 | ||
|
|
36c1b56916 | ||
|
|
39a2e30e3f | ||
|
|
b91d237f0b | ||
|
|
f7a0a0daa0 | ||
|
|
4f270d003b | ||
|
|
e3ebc8c2e2 | ||
|
|
c31c5618dd | ||
|
|
341d5f8d7c | ||
|
|
04d2bd69c1 | ||
|
|
47efa792ee | ||
|
|
a71c6789bc | ||
|
|
3a41aad935 | ||
|
|
fad56c1c0a | ||
|
|
d6ad7f16c1 | ||
|
|
ae89a9216d | ||
|
|
6927c82a0f | ||
|
|
e06b553653 | ||
|
|
e9a63c0c36 | ||
|
|
582c23ecf4 | ||
|
|
d86ff1e905 | ||
|
|
773bca8448 | ||
|
|
a6258cd334 | ||
|
|
1cdf88ef9b | ||
|
|
58ffbad422 | ||
|
|
aafcd5767e | ||
|
|
2bfac8352b | ||
|
|
954eff0c94 | ||
|
|
9692076ba8 | ||
|
|
5ae64989eb | ||
|
|
3fd34fc48d | ||
|
|
94c207677f | ||
|
|
39188f0b3a | ||
|
|
7665ec2730 | ||
|
|
bc57ac3065 | ||
|
|
6cf62736bb | ||
|
|
d5e78c1a7a | ||
|
|
4a0aa1bca0 | ||
|
|
2d06e8a801 | ||
|
|
25b1479c23 | ||
|
|
09ab17f18b | ||
|
|
be438a2f18 | ||
|
|
c9f91bb8da | ||
|
|
cd01178151 | ||
|
|
3e8ed72246 | ||
|
|
c500520130 | ||
|
|
0fc2eb6817 | ||
|
|
4db2f49233 | ||
|
|
8215c44be9 | ||
|
|
dbee926a94 | ||
|
|
d85e13cae0 | ||
|
|
370eee8d9d | ||
|
|
98f317cb1c | ||
|
|
3ec9613b0e | ||
|
|
8e27d50d5c | ||
|
|
fc50991317 | ||
|
|
52382bb958 | ||
|
|
66fdd40659 | ||
|
|
f0f402a8b3 | ||
|
|
591cbf4484 | ||
|
|
44d813bf5b | ||
|
|
fceff4ad7f | ||
|
|
f47b41928e | ||
|
|
c559a97953 | ||
|
|
d1d64c84b0 | ||
|
|
cb1f32ec3a | ||
|
|
e76116810f | ||
|
|
974b69eed0 | ||
|
|
bb379c7a0e | ||
|
|
5664ede648 | ||
|
|
881a3db412 | ||
|
|
b74f1cc5d6 | ||
|
|
265ec60614 | ||
|
|
d79d716612 | ||
|
|
aa61f322bc | ||
|
|
c8d2f08c13 | ||
|
|
920b6e2eba | ||
|
|
6e7908de52 | ||
|
|
10de6aedbd | ||
|
|
ce0efed7b8 | ||
|
|
204b9aa49d | ||
|
|
ae1db7990e | ||
|
|
18f13acfa9 | ||
|
|
a15b247952 | ||
|
|
2e457e1f6f | ||
|
|
e0375a52f9 | ||
|
|
351a70015a | ||
|
|
8faa001a56 | ||
|
|
182fc8b65e | ||
|
|
49b581dafd | ||
|
|
1319c54365 | ||
|
|
c9db2687f5 | ||
|
|
21252a6eb7 | ||
|
|
1054050542 | ||
|
|
90e2d7ef0b | ||
|
|
de9c1e7a20 | ||
|
|
08b5f09c55 | ||
|
|
23a0ed86e0 | ||
|
|
0ca7da454b | ||
|
|
ffc22673f7 | ||
|
|
1faa75c303 | ||
|
|
8136eed152 | ||
|
|
13dc6f0d76 | ||
|
|
dd55141422 | ||
|
|
d3bcadce13 | ||
|
|
99533a5416 | ||
|
|
4a288434bc | ||
|
|
9218bce3e4 | ||
|
|
b566413b78 | ||
|
|
f624b441e4 | ||
|
|
ebe7834092 | ||
|
|
9c8f54fd24 | ||
|
|
4a20d74258 | ||
|
|
f47915d077 | ||
|
|
eb2305712a | ||
|
|
f75414a5d2 | ||
|
|
a88cb05897 | ||
|
|
2435ae67c9 | ||
|
|
4c49be5203 | ||
|
|
2d8a1dad80 | ||
|
|
a15b009133 | ||
|
|
25d2033b7c | ||
|
|
9abeb6aec8 | ||
|
|
c509eeae49 | ||
|
|
2a4b0dbcb4 | ||
|
|
e45a863e8d | ||
|
|
2ca40a6b4e | ||
|
|
c4819e29e0 | ||
|
|
176fae228c | ||
|
|
c0242a18e3 | ||
|
|
7a953c9a47 | ||
|
|
27cc0d812e | ||
|
|
2a1df998eb | ||
|
|
78573b85b5 | ||
|
|
7a433c1890 | ||
|
|
de26d87400 | ||
|
|
07da707503 | ||
|
|
b473b19b45 | ||
|
|
6c291999f4 | ||
|
|
2e92d0d3a5 | ||
|
|
2ac5695e45 | ||
|
|
0af4ab54f9 | ||
|
|
8da92966de | ||
|
|
bc3dfc7ff9 | ||
|
|
e81d5707f2 | ||
|
|
4cb42f8762 | ||
|
|
1d2e3aff89 | ||
|
|
e36c8d6053 | ||
|
|
4ea1d50caf | ||
|
|
a50361126f | ||
|
|
865a8e2abc | ||
|
|
037ef7ea78 | ||
|
|
5783f4e708 | ||
|
|
9991dd350f | ||
|
|
557a48ec6a | ||
|
|
d5fa18975e | ||
|
|
23ee06e123 | ||
|
|
e47eab0ce7 | ||
|
|
17ae5b6b5a | ||
|
|
fa29bf3309 | ||
|
|
e839e505c8 | ||
|
|
7dc9c3e6b6 | ||
|
|
684585278d | ||
|
|
e303be8155 | ||
|
|
f1285f0615 | ||
|
|
3fd1974d86 | ||
|
|
d48716e65a | ||
|
|
a0432051f4 | ||
|
|
076c3aa65b | ||
|
|
92abd16032 | ||
|
|
e6632066a6 | ||
|
|
e2deaf57dd | ||
|
|
0530d9deb8 | ||
|
|
b57ccf0c6a | ||
|
|
9ea9cf693d | ||
|
|
3460931fba | ||
|
|
b743d113cc | ||
|
|
f810371e70 | ||
|
|
bc525f3047 | ||
|
|
6809181adf | ||
|
|
2c71a28421 | ||
|
|
82162e4fe6 | ||
|
|
03454bc309 | ||
|
|
d975501f29 | ||
|
|
761356adda | ||
|
|
824835a28c | ||
|
|
252ce15973 | ||
|
|
7f25dba917 | ||
|
|
b5d4b8aa5a | ||
|
|
39a136295a | ||
|
|
6d674c007e | ||
|
|
31f380a03a | ||
|
|
7e23960196 | ||
|
|
d3b9f2479b | ||
|
|
c211842b52 | ||
|
|
3e11c0cfc1 | ||
|
|
6747440b00 | ||
|
|
dc1c4b1e78 | ||
|
|
26f2fba3ac | ||
|
|
eb481c689b | ||
|
|
88c3984d35 | ||
|
|
4eae088973 | ||
|
|
60ae0fb365 | ||
|
|
ab36f41fc3 | ||
|
|
98de243e37 | ||
|
|
0c6ccabbeb | ||
|
|
a66e6111cb | ||
|
|
caf5c8806a | ||
|
|
0154dfd6a1 | ||
|
|
e545e68877 | ||
|
|
fa24c2b7fe | ||
|
|
df2b7d9659 | ||
|
|
cc395232ff | ||
|
|
47afb83536 | ||
|
|
02d1b50b59 | ||
|
|
bd86eb08fa | ||
|
|
b3c1a45b72 | ||
|
|
15678e59e2 | ||
|
|
6fe379bab3 | ||
|
|
39ecb2fd37 | ||
|
|
988c0059ff | ||
|
|
61ff31b3b7 | ||
|
|
7c1a098b89 | ||
|
|
f843593843 | ||
|
|
c34eb915bc | ||
|
|
9508432294 | ||
|
|
0959962269 | ||
|
|
e39a91bde6 | ||
|
|
51f5dbe25c | ||
|
|
6fd5c6cbe7 | ||
|
|
6622b09eaa | ||
|
|
9bb9f066cd | ||
|
|
03110b47df | ||
|
|
034e532e05 | ||
|
|
c306af8b4c | ||
|
|
bd4a784676 | ||
|
|
4ca0a9dc5f | ||
|
|
c6816b01b5 | ||
|
|
bc7583ccb4 | ||
|
|
318e43aca3 | ||
|
|
ea992f727b | ||
|
|
5bdb16f98c | ||
|
|
faa06993e6 | ||
|
|
f6e0d017b2 | ||
|
|
8ea56a74b0 | ||
|
|
d4c9666f85 | ||
|
|
5f376304ce | ||
|
|
dbb29f25ab | ||
|
|
da059b2589 | ||
|
|
fee64fd5ac | ||
|
|
85de9f7a6f | ||
|
|
5beb7641af | ||
|
|
249852c3d7 | ||
|
|
223d07579b | ||
|
|
74fb359740 | ||
|
|
f7ffadc76f | ||
|
|
fc03141dee | ||
|
|
8d29014811 | ||
|
|
7dcbbcb98d | ||
|
|
60b9200247 | ||
|
|
fa4d1d70d5 | ||
|
|
de6cc1f9bb | ||
|
|
5fb6abe0e1 | ||
|
|
94073b8aad | ||
|
|
0e83e21aa0 | ||
|
|
63bbf72942 | ||
|
|
dbaa41b161 | ||
|
|
ed673dbe0d | ||
|
|
d54ccb0c9e | ||
|
|
b29cbec3a1 | ||
|
|
edc967c118 | ||
|
|
e80681da22 | ||
|
|
03ec9c9378 | ||
|
|
6c54306cd6 | ||
|
|
db49af84f4 | ||
|
|
79a29531e9 | ||
|
|
c3de7f022e | ||
|
|
59a3111596 | ||
|
|
cf8dfadbdf | ||
|
|
e500b2c906 | ||
|
|
0d9417cc3e | ||
|
|
eb57d70182 | ||
|
|
215b572d70 | ||
|
|
bc72f7f3e6 | ||
|
|
b449473f10 | ||
|
|
6f23362bfd | ||
|
|
074d2cc119 | ||
|
|
725cd224c1 | ||
|
|
2baee2398b | ||
|
|
1a8f8875fd | ||
|
|
9cecea8317 | ||
|
|
05ac6ea0b8 | ||
|
|
cce8186ccf | ||
|
|
b143d1a30e | ||
|
|
4c5f2e6b40 | ||
|
|
6bc2c7a576 | ||
|
|
2412c7521b | ||
|
|
c964897c59 | ||
|
|
6abdc001e5 | ||
|
|
83943d1daa | ||
|
|
eedd54d10a | ||
|
|
c8a3736816 | ||
|
|
e727196424 | ||
|
|
d0f715863c | ||
|
|
ae94113370 | ||
|
|
3fbe4970b2 | ||
|
|
54e6e3bf39 | ||
|
|
f2a7d3ae86 | ||
|
|
3799dd739b | ||
|
|
3161419682 | ||
|
|
bdc277e557 | ||
|
|
a515cd29a0 | ||
|
|
770a2b83f0 | ||
|
|
f9df8a757d | ||
|
|
6d17017c2d | ||
|
|
9fea9d46fb | ||
|
|
3925d83b68 | ||
|
|
ca23f1d58e | ||
|
|
4492293464 | ||
|
|
cd0a32846c | ||
|
|
f5d0a80626 | ||
|
|
1b0fdad357 | ||
|
|
9ea5e3f4d0 | ||
|
|
79416d7ac5 | ||
|
|
52c6ecbcb6 | ||
|
|
f6732e72d2 | ||
|
|
bbf2128c8a | ||
|
|
d5ba8058e4 | ||
|
|
926e243aa3 | ||
|
|
ed7d24bc8f | ||
|
|
4f4069c3d7 | ||
|
|
9426a09a40 | ||
|
|
bfd9b40a5b | ||
|
|
e94da5c189 | ||
|
|
36847497fc | ||
|
|
0bb52a11ea | ||
|
|
9f7043a85d | ||
|
|
eafb8bd2cb | ||
|
|
63eeea7b26 | ||
|
|
eac2372e00 | ||
|
|
d9e972684c | ||
|
|
aaa9d1a7b4 | ||
|
|
df9a778ba0 | ||
|
|
68612cf9d1 | ||
|
|
26b72ea73d | ||
|
|
e8c570f5df | ||
|
|
abbf601325 | ||
|
|
1cd73e2f50 | ||
|
|
4b49bf280b | ||
|
|
48302fae95 | ||
|
|
c525698427 | ||
|
|
64738979e3 | ||
|
|
bed7434cd0 | ||
|
|
95f23863d4 | ||
|
|
1406527755 | ||
|
|
78395407e3 | ||
|
|
26e5c802b6 | ||
|
|
2f5f64e53c | ||
|
|
a1c95fe0e9 | ||
|
|
eb17c54dd6 | ||
|
|
f3207a271a | ||
|
|
ea76104b80 | ||
|
|
3d5be39d46 | ||
|
|
1678bb070e | ||
|
|
470a49d6cd | ||
|
|
bb11a26816 | ||
|
|
06e6b19c40 | ||
|
|
f085bf5e58 | ||
|
|
2437388bf0 | ||
|
|
fb70c9dce6 | ||
|
|
30384a713e | ||
|
|
cc26345db6 | ||
|
|
f29534531d | ||
|
|
00a2eae74e | ||
|
|
283cac586d | ||
|
|
ca33cab247 | ||
|
|
52fb9f8b0a | ||
|
|
10fee4d974 | ||
|
|
6edf6ae9f2 | ||
|
|
58e0ee5721 | ||
|
|
6354c72334 | ||
|
|
f93e6c03c9 | ||
|
|
ef5fec4282 | ||
|
|
6dc13f229e | ||
|
|
f148bb0089 | ||
|
|
9b9a472dd5 | ||
|
|
f965acf384 | ||
|
|
f7e3fb3e15 | ||
|
|
a8396df545 | ||
|
|
3cd91ba15e | ||
|
|
2433f0d626 | ||
|
|
c0b5661ef4 | ||
|
|
ff81306e90 | ||
|
|
d51e38bb6e | ||
|
|
5c1ae72bc6 | ||
|
|
b1ada57d93 | ||
|
|
e7afe68868 | ||
|
|
f6f58c679d | ||
|
|
4b4f8d2cc4 | ||
|
|
7dc230d731 | ||
|
|
db7e33fa61 | ||
|
|
e4d6b13d27 | ||
|
|
3177945146 | ||
|
|
ef9c5da2d6 | ||
|
|
18423c0ba1 | ||
|
|
f629cb3af6 | ||
|
|
d081d6b2d9 | ||
|
|
ab3dfe4bf6 | ||
|
|
a472e6d348 | ||
|
|
fa014bb232 | ||
|
|
bdee4068c0 | ||
|
|
025e7134fc | ||
|
|
a388638a91 | ||
|
|
e7b8283fdc | ||
|
|
d7172f8ebe | ||
|
|
bc0ea9ab3a | ||
|
|
838f8ba3b3 | ||
|
|
4da13a55cf | ||
|
|
8489bca8c0 | ||
|
|
d620b36dd1 | ||
|
|
89b5daebee | ||
|
|
fdea3231e9 | ||
|
|
882b74a31f | ||
|
|
181a680296 | ||
|
|
d7d93e6a79 | ||
|
|
d6ee607b9d | ||
|
|
75f26e3ecc | ||
|
|
e959bcb369 | ||
|
|
c9eea8796f | ||
|
|
8d44e0b1ad | ||
|
|
947f47ef25 | ||
|
|
27e5df5367 | ||
|
|
b7b64d7b32 | ||
|
|
4f9a6a0dd0 | ||
|
|
bb5543fc81 | ||
|
|
8b1ffaac3f | ||
|
|
0961ceb203 | ||
|
|
96ca44f91b | ||
|
|
869bf46070 | ||
|
|
af039971a6 | ||
|
|
5b614691fd | ||
|
|
39295d2d6f | ||
|
|
51952a9283 | ||
|
|
e88ffc1270 | ||
|
|
c7fccac10c | ||
|
|
cdb4b4e7bd | ||
|
|
3fa6ac5042 | ||
|
|
47e52b6670 | ||
|
|
461eb480f1 | ||
|
|
b73cbef3d4 | ||
|
|
c6abb0a531 | ||
|
|
7227122fd8 | ||
|
|
cf3228466d | ||
|
|
4452db65ed | ||
|
|
635f0d4891 | ||
|
|
3da60c1ada | ||
|
|
7187156390 | ||
|
|
b764fd8da2 | ||
|
|
da6d590cc1 | ||
|
|
3b265056c2 | ||
|
|
7fe08f1669 | ||
|
|
dc0a616ec8 | ||
|
|
7dc43e5ccc | ||
|
|
9a78cf2389 | ||
|
|
b0e050ceac | ||
|
|
90f06fc532 | ||
|
|
6d3d922290 | ||
|
|
3c2bc8871e | ||
|
|
16399bf71d | ||
|
|
abf963099c | ||
|
|
b7ab6953cd | ||
|
|
1628821cdd | ||
|
|
fbf98e9754 | ||
|
|
b4ec610fc2 | ||
|
|
e2a63729b6 | ||
|
|
b72924c126 | ||
|
|
115bcc626a | ||
|
|
083e248f21 | ||
|
|
df422f6365 | ||
|
|
47a2fee51d | ||
|
|
3fabdc1d44 | ||
|
|
4b0be0137c | ||
|
|
7fdb40b44e | ||
|
|
929eeddce7 | ||
|
|
ea5d27a87f | ||
|
|
0da898a242 | ||
|
|
4a14cb0e8c | ||
|
|
509c7f3989 | ||
|
|
38514941b8 | ||
|
|
3212f59cf2 | ||
|
|
ad25e13cf0 | ||
|
|
fadd4ffe42 | ||
|
|
7a3e36c092 | ||
|
|
730e8143e7 | ||
|
|
a401c4cd4c | ||
|
|
51bf1343c8 | ||
|
|
343986bf83 | ||
|
|
d0b3ab57de | ||
|
|
d79993ba11 | ||
|
|
6ca6f45b58 | ||
|
|
d3b50c077b | ||
|
|
2c4ba8c1b5 | ||
|
|
a8e00dda0b | ||
|
|
7b88c008de | ||
|
|
2c251133af | ||
|
|
c079b256f0 | ||
|
|
6a9abab7ea | ||
|
|
f59c217053 | ||
|
|
57008f834a | ||
|
|
7b90e74b97 | ||
|
|
da62759130 | ||
|
|
7cfae284ae | ||
|
|
d946eed86a | ||
|
|
030e4ac7ab | ||
|
|
2e04fd5a3b | ||
|
|
6174245b22 | ||
|
|
9b9d3d9634 | ||
|
|
f98d5a4ee9 | ||
|
|
c653d731cc | ||
|
|
f4582ac3a6 | ||
|
|
5bb7842585 | ||
|
|
e13a722dca | ||
|
|
dba325aa61 | ||
|
|
59dccbedbd | ||
|
|
df32edf85f | ||
|
|
0385513f0e | ||
|
|
710fdebbec | ||
|
|
7b707716f9 | ||
|
|
8cdb2df433 |
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -6,14 +6,12 @@
|
||||
/data/config.php
|
||||
/build
|
||||
/node_modules
|
||||
/client
|
||||
/test.php
|
||||
/main.html
|
||||
/frontend/client/css/espo.css
|
||||
/frontend/client/css/espo-vertical.css
|
||||
/frontend/client/css/sakura.css
|
||||
/frontend/client/css/sakura-vertical.css
|
||||
/tests/testData/cache/*
|
||||
|
||||
/tests/unit/testData/cache/*
|
||||
!/tests/unit/testData/cache/.data
|
||||
/tests/integration/config.php
|
||||
composer.phar
|
||||
vendor/
|
||||
/custom/Espo/Custom/*
|
||||
9
CONTRIBUTING.md
Normal file
9
CONTRIBUTING.md
Normal file
@@ -0,0 +1,9 @@
|
||||
## Pull Requests
|
||||
|
||||
Before we can merge your pull request you need to accept our CLA [here](https://github.com/espocrm/cla). It's very simple to do.
|
||||
|
||||
[Code Style Guidelines](https://github.com/espocrm/espocrm/wiki/Code-Style-Guidelines).
|
||||
|
||||
## Issues
|
||||
|
||||
We don't provide developer help or any kind of support on github. Please use our [forum](https://forum.espocrm.com) for this.
|
||||
136
Gruntfile.js
136
Gruntfile.js
@@ -2,7 +2,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -23,6 +23,7 @@ module.exports = function (grunt) {
|
||||
var jsFilesToMinify = [
|
||||
'client/lib/jquery-2.1.4.min.js',
|
||||
'client/lib/underscore-min.js',
|
||||
'client/lib/es6-promise.min.js',
|
||||
'client/lib/backbone-min.js',
|
||||
'client/lib/handlebars.js',
|
||||
'client/lib/base64.js',
|
||||
@@ -33,13 +34,73 @@ module.exports = function (grunt) {
|
||||
'client/lib/jquery.autocomplete.js',
|
||||
'client/lib/bootstrap.min.js',
|
||||
'client/lib/bootstrap-datepicker.js',
|
||||
'client/lib/bull.min.js',
|
||||
'client/lib/bull.js',
|
||||
'client/lib/marked.min.js',
|
||||
|
||||
'client/src/namespace.js',
|
||||
'client/src/exceptions.js',
|
||||
'client/src/loader.js',
|
||||
'client/src/utils.js'
|
||||
'client/src/utils.js',
|
||||
|
||||
'client/src/acl.js',
|
||||
'client/src/model.js',
|
||||
'client/src/model-offline.js',
|
||||
'client/src/ajax.js',
|
||||
'client/src/controller.js',
|
||||
|
||||
'client/src/ui.js',
|
||||
'client/src/acl-manager.js',
|
||||
'client/src/cache.js',
|
||||
'client/src/storage.js',
|
||||
'client/src/models/settings.js',
|
||||
'client/src/language.js',
|
||||
'client/src/metadata.js',
|
||||
'client/src/field-manager.js',
|
||||
'client/src/models/user.js',
|
||||
'client/src/models/preferences.js',
|
||||
'client/src/model-factory.js',
|
||||
'client/src/collection-factory.js',
|
||||
'client/src/pre-loader.js',
|
||||
'client/src/controllers/base.js',
|
||||
'client/src/router.js',
|
||||
'client/src/date-time.js',
|
||||
'client/src/layout-manager.js',
|
||||
'client/src/theme-manager.js',
|
||||
'client/src/session-storage.js',
|
||||
'client/src/view-helper.js',
|
||||
|
||||
'client/src/app.js'
|
||||
];
|
||||
|
||||
function camelCaseToHyphen (string){
|
||||
if (string == null) {
|
||||
return string;
|
||||
}
|
||||
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
}
|
||||
|
||||
var fs = require('fs');
|
||||
|
||||
var themeList = [];
|
||||
fs.readdirSync('application/Espo/Resources/metadata/themes').forEach(function (file) {
|
||||
themeList.push(file.substr(0, file.length - 5));
|
||||
});
|
||||
|
||||
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';
|
||||
var o = {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: files
|
||||
};
|
||||
lessData[theme] = o;
|
||||
});
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
@@ -58,62 +119,20 @@ module.exports = function (grunt) {
|
||||
start: ['build/*'],
|
||||
final: ['build/tmp'],
|
||||
},
|
||||
less: {
|
||||
espo: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'frontend/client/css/espo.css': 'frontend/less/espo/main.less',
|
||||
},
|
||||
},
|
||||
sakura: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'frontend/client/css/sakura.css': 'frontend/less/sakura/main.less',
|
||||
},
|
||||
},
|
||||
espoVertical: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'frontend/client/css/espo-vertical.css': 'frontend/less/espo-vertical/main.less',
|
||||
},
|
||||
},
|
||||
sakuraVertical: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'frontend/client/css/sakura-vertical.css': 'frontend/less/sakura-vertical/main.less',
|
||||
},
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
minify: {
|
||||
files: {
|
||||
'build/tmp/client/css/espo.css': [
|
||||
'frontend/client/css/espo.css',
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
less: lessData,
|
||||
uglify: {
|
||||
options: {
|
||||
mangle: false,
|
||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
|
||||
},
|
||||
'build/tmp/client/espo.min.js': jsFilesToMinify.map(function (item) {
|
||||
return 'frontend/' + item;
|
||||
return '' + item;
|
||||
})
|
||||
},
|
||||
copy: {
|
||||
frontendFolders: {
|
||||
expand: true,
|
||||
cwd: 'frontend/client',
|
||||
cwd: 'client',
|
||||
src: [
|
||||
'src/**',
|
||||
'res/**',
|
||||
@@ -127,14 +146,10 @@ module.exports = function (grunt) {
|
||||
],
|
||||
dest: 'build/tmp/client',
|
||||
},
|
||||
frontendHtml: {
|
||||
src: 'frontend/html/reset.html',
|
||||
dest: 'build/tmp/reset.html'
|
||||
},
|
||||
frontendLib: {
|
||||
expand: true,
|
||||
dot: true,
|
||||
cwd: 'frontend/client/lib',
|
||||
cwd: 'client/lib',
|
||||
src: '**',
|
||||
dest: 'build/tmp/client/lib/',
|
||||
},
|
||||
@@ -147,7 +162,9 @@ module.exports = function (grunt) {
|
||||
'custom/**',
|
||||
'data/.data',
|
||||
'install/**',
|
||||
'portal/**',
|
||||
'vendor/**',
|
||||
'html/**',
|
||||
'bootstrap.php',
|
||||
'cron.php',
|
||||
'rebuild.php',
|
||||
@@ -195,8 +212,11 @@ module.exports = function (grunt) {
|
||||
},
|
||||
src: [
|
||||
'build/EspoCRM-<%= pkg.version %>/install',
|
||||
'build/EspoCRM-<%= pkg.version %>/portal',
|
||||
'build/EspoCRM-<%= pkg.version %>/api',
|
||||
'build/EspoCRM-<%= pkg.version %>/api/v1',
|
||||
'build/EspoCRM-<%= pkg.version %>/api/v1/portal-access',
|
||||
'build/EspoCRM-<%= pkg.version %>',
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -212,8 +232,12 @@ module.exports = function (grunt) {
|
||||
},
|
||||
files: [
|
||||
{
|
||||
src: 'frontend/html/main.html',
|
||||
dest: 'build/tmp/main.html'
|
||||
src: 'build/tmp/html/main.html',
|
||||
dest: 'build/tmp/html/main.html'
|
||||
},
|
||||
{
|
||||
src: 'build/tmp/html/portal.html',
|
||||
dest: 'build/tmp/html/portal.html'
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -261,10 +285,8 @@ module.exports = function (grunt) {
|
||||
'clean:start',
|
||||
'mkdir:tmp',
|
||||
'less',
|
||||
'cssmin',
|
||||
'uglify',
|
||||
'copy:frontendFolders',
|
||||
'copy:frontendHtml',
|
||||
'copy:frontendLib',
|
||||
'copy:backend',
|
||||
'replace',
|
||||
|
||||
16
README.md
16
README.md
@@ -8,14 +8,18 @@ Download the latest release from our [website](http://www.espocrm.com).
|
||||
|
||||
### Requirements
|
||||
|
||||
* PHP 5.4 or above (with pdo, json, gd, mcrypt extensions);
|
||||
* MySQL 5.1 or above.
|
||||
* PHP 5.6 or above (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.5.3 or above.
|
||||
|
||||
For more information about server configuration see [this article](http://blog.espocrm.com/administration/server-configuration-for-espocrm/).
|
||||
For more information about server configuration see [this article](https://www.espocrm.com/documentation/administration/server-configuration/).
|
||||
|
||||
### Documentation
|
||||
|
||||
Documentation for administrators, users and developers is available [here](https://www.espocrm.com/documentation/).
|
||||
|
||||
### How to report bug
|
||||
|
||||
Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our [forum](http://forum.espocrm.com/bug-reports?routestring=forum/bug-reports).
|
||||
Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our [forum](http://forum.espocrm.com/forum/bug-reports).
|
||||
|
||||
### How to get started (for developers)
|
||||
|
||||
@@ -26,9 +30,9 @@ Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our
|
||||
|
||||
Never update composer dependencies if you are going to contribute code back.
|
||||
|
||||
Now you can build.
|
||||
Now you can build. Build will create compiled css files.
|
||||
|
||||
If your repository is accessible via a web server then you can run EspoCRM by url `http://PROJECT_URL/frontend`. To compose a proper config.php and populate database you can run install by opening `http(s)://{YOUR_CRM_URL}/install` location in a browser. Also you need to run build before to have compiled css.
|
||||
To compose a proper config.php and populate database you can run install by opening `http(s)://{YOUR_CRM_URL}/install` location in a browser. Then open `data/config.php` file and add `isDeveloperMode => true`.
|
||||
|
||||
### How to build
|
||||
|
||||
|
||||
0
api/v1/.htaccess
Executable file → Normal file
0
api/v1/.htaccess
Executable file → Normal file
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
12
api/v1/portal-access/.htaccess
Normal file
12
api/v1/portal-access/.htaccess
Normal file
@@ -0,0 +1,12 @@
|
||||
RewriteEngine On
|
||||
|
||||
# Some hosts may require you to use the `RewriteBase` directive.
|
||||
# If you need to use the `RewriteBase` directive, it should be the
|
||||
# absolute physical path to the directory that contains this htaccess file.
|
||||
#
|
||||
# RewriteBase /
|
||||
|
||||
RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [QSA,L]
|
||||
39
api/v1/portal-access/index.php
Normal file
39
api/v1/portal-access/index.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
************************************************************************/
|
||||
|
||||
require_once('../../../bootstrap.php');
|
||||
|
||||
if (!empty($_GET['portalId'])) {
|
||||
$portalId = $_GET['portalId'];
|
||||
} else {
|
||||
$portalId = explode('/', $_SERVER['REQUEST_URI'])[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
|
||||
}
|
||||
|
||||
$app = new \Espo\Core\Portal\Application($portalId);
|
||||
$app->run();
|
||||
15
api/v1/portal-access/web.config
Normal file
15
api/v1/portal-access/web.config
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="rule 1G" stopProcessing="true">
|
||||
<match url="^" />
|
||||
<action type="Rewrite" url="index.php" appendQueryString="true" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
|
||||
</configuration>
|
||||
0
api/v1/web.config
Executable file → Normal file
0
api/v1/web.config
Executable file → Normal file
42
application/Espo/Acl/ActionHistoryRecord.php
Normal file
42
application/Espo/Acl/ActionHistoryRecord.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 ActionHistoryRecord extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
return $entity->get('userId') === $user->id;
|
||||
}
|
||||
}
|
||||
|
||||
93
application/Espo/Acl/Attachment.php
Normal file
93
application/Espo/Acl/Attachment.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 Attachment extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($entity->get('parentType') === 'Settings') {
|
||||
return true;
|
||||
}
|
||||
|
||||
$parent = null;
|
||||
$hasParent = false;
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$hasParent = true;
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
} else if ($entity->get('relatedId') && $entity->get('relatedType')) {
|
||||
$hasParent = true;
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('relatedType'), $entity->get('relatedId'));
|
||||
}
|
||||
|
||||
if ($hasParent) {
|
||||
if ($parent) {
|
||||
if ($parent->getEntityType() === 'Note') {
|
||||
if ($parent->get('parentId') && $parent->get('parentType')) {
|
||||
$parentOfParent = $this->getEntityManager()->getEntity($parent->get('parentType'), $parent->get('parentId'));
|
||||
if ($parentOfParent && $this->getAclManager()->checkEntity($user, $parentOfParent)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($this->getAclManager()->checkEntity($user, $parent)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->checkEntity($user, $entity, $data, 'read')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -29,13 +29,13 @@
|
||||
|
||||
namespace Espo\Acl;
|
||||
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Email extends \Espo\Core\Acl\Base
|
||||
{
|
||||
|
||||
public function checkEntityRead(User $user, Entity $entity, $data)
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($this->checkEntity($user, $entity, $data, 'read')) {
|
||||
return true;
|
||||
@@ -44,8 +44,8 @@ class Email extends \Espo\Core\Acl\Base
|
||||
if ($data === false) {
|
||||
return false;
|
||||
}
|
||||
if (is_array($data)) {
|
||||
if (empty($data['read']) || $data['read'] == 'no') {
|
||||
if (is_object($data)) {
|
||||
if ($data->read === false || $data->read === 'no') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -60,20 +60,62 @@ class Email extends \Espo\Core\Acl\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($entity->has('assignedUserId')) {
|
||||
if ($user->id === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
if ($user->id === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($entity->hasLinkMultipleId('assignedUsers', $user->id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkEntityDelete(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($data->delete === 'own') {
|
||||
if ($user->id === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$assignedUserIdList = $entity->getLinkMultipleIdList('assignedUsers');
|
||||
if (count($assignedUserIdList) === 1 && $entity->hasLinkMultipleId('assignedUsers', $user->id)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->checkEntity($user, $entity, $data, 'delete')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data->edit !== 'no' || $data->create !== 'no') {
|
||||
if ($entity->get('createdById') === $user->id) {
|
||||
if ($entity->get('status') !== 'Sent' && $entity->get('status') !== 'Archived') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
63
application/Espo/Acl/EmailAddress.php
Normal file
63
application/Espo/Acl/EmailAddress.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 EmailAddress extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkEditInEntity(EntityUser $user, Entity $entity, Entity $excludeEntity)
|
||||
{
|
||||
$id = $entity->id;
|
||||
|
||||
$isFobidden = false;
|
||||
|
||||
$repository = $this->getEntityManager()->getRepository('EmailAddress');
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$entityWithSameAddressList = $repository->getEntityListByAddressId($id, $excludeEntity);
|
||||
foreach ($entityWithSameAddressList as $e) {
|
||||
if (!$this->getAclManager()->check($user, $e, 'edit')) {
|
||||
$isFobidden = true;
|
||||
if (
|
||||
$e->get('isPortalUser') && $excludeEntity->getEntityType() === 'Contact' &&
|
||||
$e->get('contactId') === $excludeEntity->id
|
||||
) {
|
||||
$isFobidden = false;
|
||||
}
|
||||
if ($isFobidden) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return !$isFobidden;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
namespace Espo\Acl;
|
||||
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class EmailFilter extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($entity->has('parentId') && $entity->has('parentType')) {
|
||||
$parentType = $entity->get('parentType');
|
||||
@@ -42,11 +42,14 @@ class EmailFilter extends \Espo\Core\Acl\Base
|
||||
if (!$parentType || !$parentId) return;
|
||||
|
||||
$parent = $this->getEntityManager()->getEntity($parentType, $parentId);
|
||||
|
||||
if ($parent->getEntityType() === 'User') {
|
||||
return $parent->id === $user->id;
|
||||
}
|
||||
if ($parent && $parent->has('assignedUserId') && $parent->get('assignedUserId') === $user->id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
45
application/Espo/Acl/Note.php
Normal file
45
application/Espo/Acl/Note.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 Note extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($entity->get('type') === 'Post' && $user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
45
application/Espo/Acl/Notification.php
Normal file
45
application/Espo/Acl/Notification.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 Notification extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('userId')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
63
application/Espo/Acl/PhoneNumber.php
Normal file
63
application/Espo/Acl/PhoneNumber.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 PhoneNumber extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkEditInEntity(EntityUser $user, Entity $entity, Entity $excludeEntity)
|
||||
{
|
||||
$id = $entity->id;
|
||||
|
||||
$isFobidden = false;
|
||||
|
||||
$repository = $this->getEntityManager()->getRepository('PhoneNumber');
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$entityWithSameNumberList = $repository->getEntityListByPhoneNumberId($id, $excludeEntity);
|
||||
foreach ($entityWithSameNumberList as $e) {
|
||||
if (!$this->getAclManager()->check($user, $e, 'edit')) {
|
||||
$isFobidden = true;
|
||||
if (
|
||||
$e->get('isPortalUser') && $excludeEntity->getEntityType() === 'Contact' &&
|
||||
$e->get('contactId') === $excludeEntity->id
|
||||
) {
|
||||
$isFobidden = false;
|
||||
}
|
||||
if ($isFobidden) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !$isFobidden;
|
||||
}
|
||||
}
|
||||
61
application/Espo/Acl/ScheduledJob.php
Normal file
61
application/Espo/Acl/ScheduledJob.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 ScheduledJob extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'read');
|
||||
}
|
||||
|
||||
public function checkEntityEdit(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'edit');
|
||||
}
|
||||
|
||||
public function checkEntityDelete(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'delete');
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->get('isInternal')) return false;
|
||||
return $this->checkEntity($user, $entity, $data, 'create');
|
||||
}
|
||||
}
|
||||
|
||||
41
application/Espo/Acl/Team.php
Normal file
41
application/Espo/Acl/Team.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\ORM\Entity;
|
||||
|
||||
class Team extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkInTeam(\Espo\Entities\User $user, Entity $entity)
|
||||
{
|
||||
$userTeamIdList = $user->getLinkMultipleIdList('teams');
|
||||
return in_array($entity->id, $userTeamIdList);
|
||||
}
|
||||
}
|
||||
73
application/Espo/Acl/User.php
Normal file
73
application/Espo/Acl/User.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\ORM\Entity;
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
|
||||
class User extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(\Espo\Entities\User $user, Entity $entity)
|
||||
{
|
||||
return $user->id === $entity->id;
|
||||
}
|
||||
|
||||
public function checkEntityCreate(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if (!$user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
return $this->checkEntity($user, $entity, $data, 'create');
|
||||
}
|
||||
|
||||
public function checkEntityDelete(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->id === 'system') {
|
||||
return false;
|
||||
}
|
||||
if (!$user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
return parent::checkEntityDelete($user, $entity, $data);
|
||||
}
|
||||
|
||||
public function checkEntityEdit(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($entity->id === 'system') {
|
||||
return false;
|
||||
}
|
||||
if (!$user->isAdmin()) {
|
||||
if ($user->id !== $entity->id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $this->checkEntity($user, $entity, $data, 'edit');
|
||||
}
|
||||
}
|
||||
93
application/Espo/AclPortal/Attachment.php
Normal file
93
application/Espo/AclPortal/Attachment.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Attachment extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($entity->get('parentType') === 'Settings') {
|
||||
return true;
|
||||
}
|
||||
|
||||
$parent = null;
|
||||
$hasParent = false;
|
||||
if ($entity->get('parentId') && $entity->get('parentType')) {
|
||||
$hasParent = true;
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
|
||||
} else if ($entity->get('relatedId') && $entity->get('relatedType')) {
|
||||
$hasParent = true;
|
||||
$parent = $this->getEntityManager()->getEntity($entity->get('relatedType'), $entity->get('relatedId'));
|
||||
}
|
||||
|
||||
if ($hasParent) {
|
||||
if ($parent) {
|
||||
if ($parent->getEntityType() === 'Note') {
|
||||
if ($parent->get('parentId') && $parent->get('parentType')) {
|
||||
$parentOfParent = $this->getEntityManager()->getEntity($parent->get('parentType'), $parent->get('parentId'));
|
||||
if ($parentOfParent && $this->getAclManager()->checkEntity($user, $parentOfParent)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($this->getAclManager()->checkEntity($user, $parent)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->checkEntity($user, $entity, $data, 'read')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
71
application/Espo/AclPortal/Email.php
Normal file
71
application/Espo/AclPortal/Email.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Email extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($this->checkEntity($user, $entity, $data, 'read')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data === false) {
|
||||
return false;
|
||||
}
|
||||
if (is_object($data)) {
|
||||
if ($data->read === false || $data->read === 'no') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$entity->has('usersIds')) {
|
||||
$entity->loadLinkMultipleField('users');
|
||||
}
|
||||
$userIdList = $entity->get('usersIds');
|
||||
if (is_array($userIdList) && in_array($user->id, $userIdList)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
56
application/Espo/AclPortal/EmailAddress.php
Normal file
56
application/Espo/AclPortal/EmailAddress.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class EmailAddress extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkEditInEntity(EntityUser $user, Entity $entity, Entity $excludeEntity)
|
||||
{
|
||||
$id = $entity->id;
|
||||
|
||||
$isFobidden = false;
|
||||
|
||||
$repository = $this->getEntityManager()->getRepository('EmailAddress');
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$entityWithSameAddressList = $repository->getEntityListByAddressId($id, $excludeEntity);
|
||||
foreach ($entityWithSameAddressList as $e) {
|
||||
if (!$this->getAclManager()->check($user, $e, 'edit')) {
|
||||
$isFobidden = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return !$isFobidden;
|
||||
}
|
||||
}
|
||||
45
application/Espo/AclPortal/Note.php
Normal file
45
application/Espo/AclPortal/Note.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Note extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($entity->get('type') === 'Post' && $user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
45
application/Espo/AclPortal/Notification.php
Normal file
45
application/Espo/AclPortal/Notification.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Notification extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('userId')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
57
application/Espo/AclPortal/PhoneNumber.php
Normal file
57
application/Espo/AclPortal/PhoneNumber.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class PhoneNumber extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkEditInEntity(EntityUser $user, Entity $entity, Entity $excludeEntity)
|
||||
{
|
||||
$id = $entity->id;
|
||||
|
||||
$isFobidden = false;
|
||||
|
||||
$repository = $this->getEntityManager()->getRepository('PhoneNumber');
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
$entityWithSameNumberList = $repository->getEntityListByPhoneNumberId($id, $excludeEntity);
|
||||
foreach ($entityWithSameNumberList as $e) {
|
||||
if (!$this->getAclManager()->check($user, $e, 'edit')) {
|
||||
$isFobidden = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !$isFobidden;
|
||||
}
|
||||
}
|
||||
41
application/Espo/AclPortal/User.php
Normal file
41
application/Espo/AclPortal/User.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class User extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkIsOwner(\Espo\Entities\User $user, Entity $entity)
|
||||
{
|
||||
return $user->id === $entity->id;
|
||||
}
|
||||
}
|
||||
|
||||
71
application/Espo/Controllers/ActionHistoryRecord.php
Normal file
71
application/Espo/Controllers/ActionHistoryRecord.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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;
|
||||
|
||||
class ActionHistoryRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassDelete($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -53,7 +53,7 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function postActionClearCache($params, $data)
|
||||
public function postActionClearCache($params)
|
||||
{
|
||||
$result = $this->getContainer()->get('dataManager')->clearCache();
|
||||
return $result;
|
||||
@@ -63,7 +63,7 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
$scheduledJob = $this->getContainer()->get('scheduledJob');
|
||||
|
||||
return $scheduledJob->getAllNamesOnly();
|
||||
return $scheduledJob->getAvailableList();
|
||||
}
|
||||
|
||||
public function postActionUploadUpgradePackage($params, $data)
|
||||
@@ -93,15 +93,19 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
|
||||
$upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer());
|
||||
$upgradeManager->install($data);
|
||||
$upgradeManager->install(get_object_vars($data));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function actionCronMessage($params, $data)
|
||||
public function actionCronMessage($params)
|
||||
{
|
||||
return $this->getContainer()->get('scheduledJob')->getSetupMessage();
|
||||
}
|
||||
|
||||
public function actionAdminNotificationList($params)
|
||||
{
|
||||
$adminNotificationManager = new \Espo\Core\Utils\AdminNotificationManager($this->getContainer());
|
||||
return $adminNotificationManager->getNotificationList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -35,31 +35,16 @@ class App extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function actionUser()
|
||||
{
|
||||
$preferences = $this->getPreferences()->toArray();
|
||||
unset($preferences['smtpPassword']);
|
||||
|
||||
$user = $this->getUser();
|
||||
if (!$user->has('teamsIds')) {
|
||||
$user->loadLinkMultipleField('teams');
|
||||
}
|
||||
|
||||
return array(
|
||||
'user' => $user->toArray(),
|
||||
'acl' => $this->getAcl()->getMap(),
|
||||
'preferences' => $preferences,
|
||||
'token' => $this->getUser()->get('token')
|
||||
);
|
||||
return $this->getServiceFactory()->create('App')->getUserData();
|
||||
}
|
||||
|
||||
public function postActionDestroyAuthToken($params, $data)
|
||||
{
|
||||
$token = $data['token'];
|
||||
if (empty($token)) {
|
||||
if (empty($data->token)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$auth = new \Espo\Core\Utils\Auth($this->getContainer());
|
||||
return $auth->destroyAuthToken($token);
|
||||
return $auth->destroyAuthToken($data->token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -35,23 +35,4 @@ use \Espo\Core\Exceptions\BadRequest;
|
||||
class Attachment extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
|
||||
public function actionUpload($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
list($prefix, $contents) = explode(',', $data);
|
||||
$contents = base64_decode($contents);
|
||||
|
||||
$attachment = $this->getEntityManager()->getEntity('Attachment');
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
$this->getContainer()->get('fileManager')->putContents('data/upload/' . $attachment->id, $contents);
|
||||
|
||||
return array(
|
||||
'attachmentId' => $attachment->id
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
67
application/Espo/Controllers/AuthLogRecord.php
Normal file
67
application/Espo/Controllers/AuthLogRecord.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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;
|
||||
|
||||
class AuthLogRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -40,34 +40,58 @@ class AuthToken extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
$dataAr = get_object_vars($data);
|
||||
|
||||
if (
|
||||
is_object($data)
|
||||
&&
|
||||
isset($data->isActive)
|
||||
&&
|
||||
$data->isActive === false
|
||||
&&
|
||||
count(array_keys($dataAr)) === 1
|
||||
) {
|
||||
return parent::actionUpdate($params, $data, $request);
|
||||
}
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
if (empty($data->attributes)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$attributes = $data->attributes;
|
||||
|
||||
if (
|
||||
is_object($attributes)
|
||||
&&
|
||||
isset($attributes->isActive)
|
||||
&&
|
||||
$attributes->isActive === false
|
||||
&&
|
||||
count(array_keys(get_object_vars($attributes))) === 1
|
||||
) {
|
||||
return parent::actionMassUpdate($params, $data, $request);
|
||||
}
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data)
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
55
application/Espo/Controllers/DataPrivacy.php
Normal file
55
application/Espo/Controllers/DataPrivacy.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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 DataPrivacy extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if ($this->getAcl()->get('dataPrivacyPermission') === 'no') {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function postActionErase($params, $data)
|
||||
{
|
||||
if (empty($data->entityType) || empty($data->id) || empty($data->fieldList) || !is_array($data->fieldList)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getServiceFactory()->create('DataPrivacy')->erase($data->entityType, $data->id, $data->fieldList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -32,12 +32,16 @@ namespace Espo\Controllers;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\NotFound;
|
||||
|
||||
class Email extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionGetCopiedAttachments($params, $data, $request)
|
||||
public function postActionGetCopiedAttachments($params, $data, $request)
|
||||
{
|
||||
$id = $request->get('id');
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$id = $data->id;
|
||||
|
||||
return $this->getRecordService()->getCopiedAttachments($id);
|
||||
}
|
||||
@@ -48,54 +52,93 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
if ($data['type'] == 'preferences') {
|
||||
if (!$this->getUser()->isAdmin() && $data['id'] != $this->getUser()->id) {
|
||||
if (!$this->getAcl()->checkScope('Email')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (is_null($data->password)) {
|
||||
if ($data->type == 'preferences') {
|
||||
if (!$this->getUser()->isAdmin() && $data->id !== $this->getUser()->id) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
$preferences = $this->getEntityManager()->getEntity('Preferences', $data['id']);
|
||||
$preferences = $this->getEntityManager()->getEntity('Preferences', $data->id);
|
||||
if (!$preferences) {
|
||||
throw new Error();
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$data['password'] = $this->getContainer()->get('crypt')->decrypt($preferences->get('smtpPassword'));
|
||||
if (is_null($data->password)) {
|
||||
$data->password = $this->getContainer()->get('crypt')->decrypt($preferences->get('smtpPassword'));
|
||||
}
|
||||
} else if ($data->type == 'emailAccount') {
|
||||
if (!$this->getAcl()->checkScope('EmailAccount')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
if (!empty($data->id)) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data->id);
|
||||
if (!$emailAccount) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
if ($emailAccount->get('assigniedUserId') !== $this->getUser()->id) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
if (is_null($data->password)) {
|
||||
$data->password = $this->getContainer()->get('crypt')->decrypt($emailAccount->get('smtpPassword'));
|
||||
}
|
||||
}
|
||||
} else if ($data->type == 'inboundEmail') {
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
if (!empty($data->id)) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('InboundEmail', $data->id);
|
||||
if (!$emailAccount) {
|
||||
throw new NotFound();
|
||||
}
|
||||
if (is_null($data->password)) {
|
||||
$data->password = $this->getContainer()->get('crypt')->decrypt($emailAccount->get('smtpPassword'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
$data['password'] = $this->getConfig()->get('smtpPassword');
|
||||
if (is_null($data->password)) {
|
||||
$data->password = $this->getConfig()->get('smtpPassword');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getRecordService()->sendTestEmail($data);
|
||||
return $this->getRecordService()->sendTestEmail(get_object_vars($data));
|
||||
}
|
||||
|
||||
public function postActionMarkAsRead($params, $data, $request)
|
||||
{
|
||||
if (!empty($data['ids'])) {
|
||||
$ids = $data['ids'];
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data['id'])) {
|
||||
$ids = [$data['id']];
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
return $this->getRecordService()->markAsReadByIdList($ids);
|
||||
return $this->getRecordService()->markAsReadByIdList($idList);
|
||||
}
|
||||
|
||||
public function postActionMarkAsNotRead($params, $data, $request)
|
||||
{
|
||||
if (!empty($data['ids'])) {
|
||||
$ids = $data['ids'];
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data['id'])) {
|
||||
$ids = [$data['id']];
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
return $this->getRecordService()->markAsNotReadByIdList($ids);
|
||||
return $this->getRecordService()->markAsNotReadByIdList($idList);
|
||||
}
|
||||
|
||||
public function postActionMarkAllAsRead($params, $data, $request)
|
||||
@@ -105,58 +148,90 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
|
||||
public function postActionMarkAsImportant($params, $data, $request)
|
||||
{
|
||||
if (!empty($data['ids'])) {
|
||||
$ids = $data['ids'];
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data['id'])) {
|
||||
$ids = [$data['id']];
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
return $this->getRecordService()->markAsImportantByIdList($ids);
|
||||
return $this->getRecordService()->markAsImportantByIdList($idList);
|
||||
}
|
||||
|
||||
public function postActionMarkAsNotImportant($params, $data, $request)
|
||||
{
|
||||
if (!empty($data['ids'])) {
|
||||
$ids = $data['ids'];
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data['id'])) {
|
||||
$ids = [$data['id']];
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
return $this->getRecordService()->markAsNotImportantByIdList($ids);
|
||||
return $this->getRecordService()->markAsNotImportantByIdList($idList);
|
||||
}
|
||||
|
||||
public function postActionMoveToTrash($params, $data)
|
||||
{
|
||||
if (!empty($data['ids'])) {
|
||||
$ids = $data['ids'];
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data['id'])) {
|
||||
$ids = [$data['id']];
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
return $this->getRecordService()->moveToTrashByIdList($ids);
|
||||
return $this->getRecordService()->moveToTrashByIdList($idList);
|
||||
}
|
||||
|
||||
public function postActionRetrieveFromTrash($params, $data)
|
||||
{
|
||||
if (!empty($data['ids'])) {
|
||||
$ids = $data['ids'];
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data['id'])) {
|
||||
$ids = [$data['id']];
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
return $this->getRecordService()->retrieveFromTrashByIdList($ids);
|
||||
return $this->getRecordService()->retrieveFromTrashByIdList($idList);
|
||||
}
|
||||
|
||||
public function getActionGetFoldersNotReadCounts(&$params, $request, $data)
|
||||
{
|
||||
return $this->getRecordService()->getFoldersNotReadCounts();
|
||||
}
|
||||
|
||||
protected function fetchListParamsFromRequest(&$params, $request, $data)
|
||||
{
|
||||
parent::fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$folderId = $request->get('folderId');
|
||||
if ($folderId) {
|
||||
$params['folderId'] = $request->get('folderId');
|
||||
}
|
||||
}
|
||||
|
||||
public function postActionMoveToFolder($params, $data)
|
||||
{
|
||||
if (!empty($data->ids)) {
|
||||
$idList = $data->ids;
|
||||
} else {
|
||||
if (!empty($data->id)) {
|
||||
$idList = [$data->id];
|
||||
} else {
|
||||
throw new BadRequest();
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data->folderId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getRecordService()->moveToFolderByIdList($idList, $data->folderId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -59,9 +59,9 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data['id']);
|
||||
if (!$emailAccount) {
|
||||
if (is_null($data->password)) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data->id);
|
||||
if (!$emailAccount || !$emailAccount->id) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
@@ -69,10 +69,10 @@ class EmailAccount extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$data['password'] = $this->getContainer()->get('crypt')->decrypt($emailAccount->get('password'));
|
||||
$data->password = $this->getContainer()->get('crypt')->decrypt($emailAccount->get('password'));
|
||||
}
|
||||
|
||||
return $this->getRecordService()->testConnection($data);
|
||||
return $this->getRecordService()->testConnection(get_object_vars($data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -25,14 +25,22 @@
|
||||
*
|
||||
* 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 EmailAddress extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionSearchInAddressBook($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->checkScope('Email')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
if (!$this->getAcl()->checkScope('Email', 'create')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
$q = $request->get('q');
|
||||
$limit = intval($request->get('limit'));
|
||||
if (empty($limit) || $limit > 30) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
62
application/Espo/Controllers/EmailFolder.php
Normal file
62
application/Espo/Controllers/EmailFolder.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\BadRequest;
|
||||
|
||||
class EmailFolder extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionMoveUp($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveUp($data->id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionMoveDown($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveDown($data->id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getActionListAll()
|
||||
{
|
||||
return $this->getRecordService()->listAll();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -25,7 +25,7 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
@@ -34,17 +34,19 @@ use \Espo\Core\Exceptions\Error;
|
||||
class EmailTemplate extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionParse($params, $data, $request)
|
||||
{
|
||||
{
|
||||
$id = $request->get('id');
|
||||
$emailAddress = $request->get('emailAddress');
|
||||
if (empty($id)) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
|
||||
return $this->getRecordService()->parse($id, array(
|
||||
'emailAddress' => $request->get('emailAddress'),
|
||||
'parentType' => $request->get('parentType'),
|
||||
'parentId' => $request->get('parentId'),
|
||||
'relatedType' => $request->get('relatedType'),
|
||||
'relatedId' => $request->get('relatedId')
|
||||
), true);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -44,6 +44,8 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionCreateEntity($params, $data, $request)
|
||||
{
|
||||
$data = get_object_vars($data);
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -69,20 +71,40 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
if (!empty($data['stream'])) {
|
||||
$params['stream'] = $data['stream'];
|
||||
}
|
||||
if (!empty($data['disabled'])) {
|
||||
$params['disabled'] = $data['disabled'];
|
||||
}
|
||||
if (!empty($data['sortBy'])) {
|
||||
$params['sortBy'] = $data['sortBy'];
|
||||
}
|
||||
if (!empty($data['sortDirection'])) {
|
||||
$params['asc'] = $data['sortDirection'] === 'asc';
|
||||
}
|
||||
if (isset($data['textFilterFields']) && is_array($data['textFilterFields'])) {
|
||||
$params['textFilterFields'] = $data['textFilterFields'];
|
||||
}
|
||||
if (!empty($data['color'])) {
|
||||
$params['color'] = $data['color'];
|
||||
}
|
||||
if (!empty($data['iconClass'])) {
|
||||
$params['iconClass'] = $data['iconClass'];
|
||||
}
|
||||
|
||||
$params['kanbanViewMode'] = !empty($data['kanbanViewMode']);
|
||||
if (!empty($data['kanbanStatusIgnoreList'])) {
|
||||
$params['kanbanStatusIgnoreList'] = $data['kanbanStatusIgnoreList'];
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('entityManagerUtil')->create($name, $type, $params);
|
||||
|
||||
if ($result) {
|
||||
$tabList = $this->getConfig()->get('tabList', []);
|
||||
$tabList[] = $name;
|
||||
$this->getConfig()->set('tabList', $tabList);
|
||||
$this->getConfig()->save();
|
||||
|
||||
if (!in_array($name, $tabList)) {
|
||||
$tabList[] = $name;
|
||||
$this->getConfig()->set('tabList', $tabList);
|
||||
$this->getConfig()->save();
|
||||
}
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuild();
|
||||
} else {
|
||||
@@ -94,6 +116,8 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionUpdateEntity($params, $data, $request)
|
||||
{
|
||||
$data = get_object_vars($data);
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -120,6 +144,8 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionRemoveEntity($params, $data, $request)
|
||||
{
|
||||
$data = get_object_vars($data);
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -151,6 +177,8 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
$data = get_object_vars($data);
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -189,6 +217,13 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
$params['linkMultipleFieldForeign'] = $data['linkMultipleFieldForeign'];
|
||||
}
|
||||
|
||||
if (array_key_exists('audited', $data)) {
|
||||
$params['audited'] = $data['audited'];
|
||||
}
|
||||
if (array_key_exists('auditedForeign', $data)) {
|
||||
$params['auditedForeign'] = $data['auditedForeign'];
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('entityManagerUtil')->createLink($params);
|
||||
|
||||
if ($result) {
|
||||
@@ -202,6 +237,8 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionUpdateLink($params, $data, $request)
|
||||
{
|
||||
$data = get_object_vars($data);
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -219,7 +256,9 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
$params = array();
|
||||
foreach ($paramList as $item) {
|
||||
$params[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
|
||||
if (array_key_exists($item, $data)) {
|
||||
$params[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($additionalParamList as $item) {
|
||||
@@ -233,6 +272,13 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
$params['linkMultipleFieldForeign'] = $data['linkMultipleFieldForeign'];
|
||||
}
|
||||
|
||||
if (array_key_exists('audited', $data)) {
|
||||
$params['audited'] = $data['audited'];
|
||||
}
|
||||
if (array_key_exists('auditedForeign', $data)) {
|
||||
$params['auditedForeign'] = $data['auditedForeign'];
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('entityManagerUtil')->updateLink($params);
|
||||
|
||||
if ($result) {
|
||||
@@ -246,6 +292,8 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
$data = get_object_vars($data);
|
||||
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -269,5 +317,34 @@ class EntityManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function postActionFormula($params, $data, $request)
|
||||
{
|
||||
if (empty($data->scope)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!property_exists($data, 'data')) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$formulaData = get_object_vars($data->data);
|
||||
|
||||
$this->getContainer()->get('entityManagerUtil')->setFormulaData($data->scope, $formulaData);
|
||||
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionResetToDefault($params, $data, $request)
|
||||
{
|
||||
if (empty($data->scope)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getContainer()->get('entityManagerUtil')->resetToDefaults($data->scope);
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -73,7 +73,7 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
|
||||
$manager = new \Espo\Core\ExtensionManager($this->getContainer());
|
||||
|
||||
$manager->install($data);
|
||||
$manager->install(get_object_vars($data));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -90,21 +90,21 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
|
||||
$manager = new \Espo\Core\ExtensionManager($this->getContainer());
|
||||
$manager->uninstall($data);
|
||||
$manager->uninstall(get_object_vars($data));
|
||||
return true;
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data)
|
||||
public function actionPatch($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
@@ -139,14 +139,13 @@ class Extension extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data)
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data)
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,13 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public static $defaultAction = 'list';
|
||||
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getAcl()->checkScope('ExternalAccount')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function actionList($params, $data, $request)
|
||||
{
|
||||
$integrations = $this->getEntityManager()->getRepository('Integration')->find();
|
||||
@@ -58,7 +65,6 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
$id = $request->get('id');
|
||||
list($integration, $userId) = explode('__', $id);
|
||||
|
||||
|
||||
if ($this->getUser()->id != $userId) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
@@ -102,8 +108,8 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (isset($data['enabled']) && !$data['enabled']) {
|
||||
$data['data'] = null;
|
||||
if (isset($data->enabled) && !$data->enabled) {
|
||||
$data->data = null;
|
||||
}
|
||||
|
||||
$entity = $this->getEntityManager()->getEntity('ExternalAccount', $params['id']);
|
||||
@@ -119,8 +125,8 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
throw new Error('Bad HTTP method type.');
|
||||
}
|
||||
|
||||
$id = $data['id'];
|
||||
$code = $data['code'];
|
||||
$id = $data->id;
|
||||
$code = $data->code;
|
||||
|
||||
list($integration, $userId) = explode('__', $id);
|
||||
|
||||
@@ -132,4 +138,3 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
|
||||
return $service->authorizationCode($integration, $userId, $code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -29,9 +29,10 @@
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error,
|
||||
\Espo\Core\Exceptions\Forbidden,
|
||||
\Espo\Core\Exceptions\NotFound;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class FieldManager extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
@@ -44,38 +45,51 @@ class FieldManager extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionRead($params, $data)
|
||||
{
|
||||
$data = $this->getContainer()->get('fieldManager')->read($params['name'], $params['scope']);
|
||||
if (empty($params['scope']) || empty($params['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$data = $this->getContainer()->get('fieldManager')->read($params['scope'], $params['name']);
|
||||
|
||||
if (!isset($data)) {
|
||||
throw new NotFound();
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
public function postActionCreate($params, $data)
|
||||
{
|
||||
if (empty($data['name'])) {
|
||||
throw new Error("Field 'name' cannnot be empty");
|
||||
if (empty($params['scope']) || empty($data->name)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$fieldManager = $this->getContainer()->get('fieldManager');
|
||||
$fieldManager->create($data['name'], $data, $params['scope']);
|
||||
$fieldManager->create($params['scope'], $data->name, get_object_vars($data));
|
||||
|
||||
try {
|
||||
$this->getContainer()->get('dataManager')->rebuild($params['scope']);
|
||||
} catch (Error $e) {
|
||||
$fieldManager->delete($data['name'], $params['scope']);
|
||||
$fieldManager->delete($params['scope'], $data->name);
|
||||
throw new Error($e->getMessage());
|
||||
}
|
||||
|
||||
return $fieldManager->read($data['name'], $params['scope']);
|
||||
return $fieldManager->read($params['scope'], $data->name);
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function patchActionUpdate($params, $data)
|
||||
{
|
||||
return $this->putActionUpdate($params, $data);
|
||||
}
|
||||
|
||||
public function putActionUpdate($params, $data)
|
||||
{
|
||||
if (empty($params['scope']) || empty($params['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$fieldManager = $this->getContainer()->get('fieldManager');
|
||||
$fieldManager->update($params['name'], $data, $params['scope']);
|
||||
$fieldManager->update($params['scope'], $params['name'], get_object_vars($data));
|
||||
|
||||
if ($fieldManager->isChanged()) {
|
||||
$this->getContainer()->get('dataManager')->rebuild($params['scope']);
|
||||
@@ -83,17 +97,32 @@ class FieldManager extends \Espo\Core\Controllers\Base
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
}
|
||||
|
||||
return $fieldManager->read($params['name'], $params['scope']);
|
||||
return $fieldManager->read($params['scope'], $params['name']);
|
||||
}
|
||||
|
||||
public function actionDelete($params, $data)
|
||||
public function deleteActionDelete($params, $data)
|
||||
{
|
||||
$res = $this->getContainer()->get('fieldManager')->delete($params['name'], $params['scope']);
|
||||
if (empty($params['scope']) || empty($params['name'])) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$result = $this->getContainer()->get('fieldManager')->delete($params['scope'], $params['name']);
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuildMetadata();
|
||||
|
||||
return $res;
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
public function postActionResetToDefault($params, $data)
|
||||
{
|
||||
if (empty($data->scope) || empty($data->name)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getContainer()->get('fieldManager')->resetToDefault($data->scope, $data->name);
|
||||
|
||||
$this->getContainer()->get('dataManager')->rebuildMetadata();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,9 +31,11 @@ namespace Espo\Controllers;
|
||||
|
||||
class I18n extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
|
||||
public function actionRead($params, $data)
|
||||
public function actionRead($params, $data, $request)
|
||||
{
|
||||
if ($request->get('default')) {
|
||||
return $this->getContainer()->get('defaultLanguage')->getAll();
|
||||
}
|
||||
return $this->getContainer()->get('language')->getAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -43,12 +43,12 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data)
|
||||
public function actionPatch($params, $data, $request)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -58,19 +58,19 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data)
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data)
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
protected function getFileManager()
|
||||
protected function getFileStorageManager()
|
||||
{
|
||||
return $this->getContainer()->get('fileManager');
|
||||
return $this->getContainer()->get('fileStorageManager');
|
||||
}
|
||||
|
||||
protected function getEntityManager()
|
||||
@@ -92,7 +92,7 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
$attachment->set('name', 'import-file.csv');
|
||||
$this->getEntityManager()->saveEntity($attachment);
|
||||
|
||||
$this->getFileManager()->putContents('data/upload/' . $attachment->id, $contents);
|
||||
$this->getFileStorageManager()->putContents($attachment, $contents);
|
||||
|
||||
return array(
|
||||
'attachmentId' => $attachment->id
|
||||
@@ -101,24 +101,24 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
|
||||
public function actionRevert($params, $data, $request)
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getService('Import')->revert($data['id']);
|
||||
return $this->getService('Import')->revert($data->id);
|
||||
}
|
||||
|
||||
public function actionRemoveDuplicates($params, $data, $request)
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getService('Import')->removeDuplicates($data['id']);
|
||||
return $this->getService('Import')->removeDuplicates($data->id);
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data, $request)
|
||||
@@ -127,39 +127,90 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$importParams = array(
|
||||
'headerRow' => $data['headerRow'],
|
||||
'fieldDelimiter' => $data['fieldDelimiter'],
|
||||
'textQualifier' => $data['textQualifier'],
|
||||
'dateFormat' => $data['dateFormat'],
|
||||
'timeFormat' => $data['timeFormat'],
|
||||
'personNameFormat' => $data['personNameFormat'],
|
||||
'decimalMark' => $data['decimalMark'],
|
||||
'currency' => $data['currency'],
|
||||
'defaultValues' => $data['defaultValues'],
|
||||
'action' => $data['action'],
|
||||
);
|
||||
|
||||
if (array_key_exists('updateBy', $data)) {
|
||||
$importParams['updateBy'] = $data['updateBy'];
|
||||
if (!isset($data->fieldDelimiter)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$attachmentId = $data['attachmentId'];
|
||||
if (!isset($data->textQualifier)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->check($data['entityType'], 'edit')) {
|
||||
if (!isset($data->dateFormat)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->timeFormat)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->personNameFormat)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->decimalMark)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->defaultValues)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->action)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->attachmentId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->entityType)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!isset($data->fields)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$timezone = 'UTC';
|
||||
if (isset($data->timezone)) {
|
||||
$timezone = $data->timezone;
|
||||
}
|
||||
|
||||
$importParams = array(
|
||||
'headerRow' => !empty($data->headerRow),
|
||||
'fieldDelimiter' => $data->fieldDelimiter,
|
||||
'textQualifier' => $data->textQualifier,
|
||||
'dateFormat' => $data->dateFormat,
|
||||
'timeFormat' => $data->timeFormat,
|
||||
'timezone' => $timezone,
|
||||
'personNameFormat' => $data->personNameFormat,
|
||||
'decimalMark' => $data->decimalMark,
|
||||
'currency' => $data->currency,
|
||||
'defaultValues' => $data->defaultValues,
|
||||
'action' => $data->action,
|
||||
'skipDuplicateChecking' => !empty($data->skipDuplicateChecking),
|
||||
'idleMode' => !empty($data->idleMode)
|
||||
);
|
||||
|
||||
if (property_exists($data, 'updateBy')) {
|
||||
$importParams['updateBy'] = $data->updateBy;
|
||||
}
|
||||
|
||||
$attachmentId = $data->attachmentId;
|
||||
|
||||
if (!$this->getAcl()->check($data->entityType, 'edit')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getService('Import')->import($data['entityType'], $data['fields'], $attachmentId, $importParams);
|
||||
return $this->getService('Import')->import($data->entityType, $data->fields, $attachmentId, $importParams);
|
||||
}
|
||||
|
||||
public function postActionUnmarkAsDuplicate($params, $data)
|
||||
{
|
||||
if (empty($data['id']) || empty($data['entityType']) || empty($data['entityId'])) {
|
||||
if (empty($data->id) || empty($data->entityType) || empty($data->entityId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$this->getService('Import')->unmarkAsDuplicate($data['id'], $data['entityType'], $data['entityId']);
|
||||
$this->getService('Import')->unmarkAsDuplicate($data->id, $data->entityType, $data->entityId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -59,15 +59,15 @@ class InboundEmail extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
$inboundEmail = $this->getEntityManager()->getEntity('InboundEmail', $data['id']);
|
||||
if (!$inboundEmail) {
|
||||
if (is_null($data->password)) {
|
||||
$inboundEmail = $this->getEntityManager()->getEntity('InboundEmail', $data->id);
|
||||
if (!$inboundEmail || !$inboundEmail->id) {
|
||||
throw new Error();
|
||||
}
|
||||
$data['password'] = $this->getContainer()->get('crypt')->decrypt($inboundEmail->get('password'));
|
||||
$data->password = $this->getContainer()->get('crypt')->decrypt($inboundEmail->get('password'));
|
||||
}
|
||||
|
||||
return $this->getRecordService()->testConnection($data);
|
||||
return $this->getRecordService()->testConnection(get_object_vars($data));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -67,6 +67,18 @@ class Integration extends \Espo\Core\Controllers\Record
|
||||
$entity->set($data);
|
||||
$this->getEntityManager()->saveEntity($entity);
|
||||
|
||||
$integrationsConfigData = $this->getConfig()->get('integrations');
|
||||
|
||||
if (!$integrationsConfigData || !($integrationsConfigData instanceof \StdClass)) {
|
||||
$integrationsConfigData = (object)[];
|
||||
}
|
||||
$integrationName = $params['id'];
|
||||
|
||||
$integrationsConfigData->$integrationName = $entity->get('enabled');
|
||||
$this->getConfig()->set('integrations', $integrationsConfigData);
|
||||
|
||||
$this->getConfig()->save();
|
||||
|
||||
return $entity->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -41,17 +41,17 @@ class Job extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
|
||||
public function actionCreate($params, $data)
|
||||
public function actionCreate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionUpdate($params, $data)
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data)
|
||||
public function actionPatch($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
@@ -66,14 +66,13 @@ class Job extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data)
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data)
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
78
application/Espo/Controllers/LabelManager.php
Normal file
78
application/Espo/Controllers/LabelManager.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use Espo\Core\Utils as Utils;
|
||||
use \Espo\Core\Exceptions\NotFound;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class LabelManager extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
|
||||
public function postActionGetScopeList($params)
|
||||
{
|
||||
$labelManager = $this->getContainer()->get('injectableFactory')->createByClassName('\\Espo\\Core\\Utils\\LabelManager');
|
||||
|
||||
return $labelManager->getScopeList();
|
||||
}
|
||||
|
||||
public function postActionGetScopeData($params, $data, $request)
|
||||
{
|
||||
if (empty($data->scope) || empty($data->language)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$labelManager = $this->getContainer()->get('injectableFactory')->createByClassName('\\Espo\\Core\\Utils\\LabelManager');
|
||||
return $labelManager->getScopeData($data->language, $data->scope);
|
||||
}
|
||||
|
||||
public function postActionSaveLabels($params, $data)
|
||||
{
|
||||
if (empty($data->scope) || empty($data->language) || !isset($data->labels)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$labels = get_object_vars($data->labels);
|
||||
|
||||
$labelManager = $this->getContainer()->get('injectableFactory')->createByClassName('\\Espo\\Core\\Utils\\LabelManager');
|
||||
$returnData = $labelManager->saveLabels($data->language, $data->scope, $labels);
|
||||
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
|
||||
return $returnData;
|
||||
}
|
||||
}
|
||||
46
application/Espo/Controllers/LastViewed.php
Normal file
46
application/Espo/Controllers/LastViewed.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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;
|
||||
|
||||
class LastViewed extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function getActionIndex($params, $data, $request)
|
||||
{
|
||||
$result = $this->getServiceFactory()->create('LastViewed')->get();
|
||||
|
||||
return [
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -48,6 +48,10 @@ class Layout extends \Espo\Core\Controllers\Base
|
||||
|
||||
public function actionUpdate($params, $data, $request)
|
||||
{
|
||||
if (is_object($data)) {
|
||||
$data = get_object_vars($data);
|
||||
}
|
||||
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
@@ -79,10 +83,10 @@ class Layout extends \Espo\Core\Controllers\Base
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data['scope']) || empty($data['name'])) {
|
||||
if (empty($data->scope) || empty($data->name)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getContainer()->get('layout')->resetToDefault($data['scope'], $data['name']);
|
||||
return $this->getContainer()->get('layout')->resetToDefault($data->scope, $data->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -25,15 +25,27 @@
|
||||
*
|
||||
* 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 Metadata extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
|
||||
public function actionRead($params, $data)
|
||||
{
|
||||
return $this->getMetadata()->getAll(true);
|
||||
return $this->getMetadata()->getAllForFrontend();
|
||||
}
|
||||
|
||||
public function getActionGet($params, $data, $request)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new \Forbidden();
|
||||
}
|
||||
$key = $request->get('key');
|
||||
|
||||
return $this->getMetadata()->get($key, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -25,7 +25,7 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,23 +31,26 @@ namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Notification extends \Espo\Core\Controllers\Base
|
||||
class Notification extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public static $defaultAction = 'list';
|
||||
|
||||
public function actionList($params, $data, $request)
|
||||
{
|
||||
$scope = $params['scope'];
|
||||
$id = $params['id'];
|
||||
|
||||
$userId = $this->getUser()->id;
|
||||
|
||||
$offset = intval($request->get('offset'));
|
||||
$maxSize = intval($request->get('maxSize'));
|
||||
$after = $request->get('after');
|
||||
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = self::MAX_SIZE_LIMIT;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'after' => $after
|
||||
);
|
||||
|
||||
$result = $this->getService('Notification')->getList($userId, $params);
|
||||
@@ -69,5 +72,30 @@ class Notification extends \Espo\Core\Controllers\Base
|
||||
$userId = $this->getUser()->id;
|
||||
return $this->getService('Notification')->markAllRead($userId);
|
||||
}
|
||||
|
||||
public function actionExport($params, $data, $request)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionMassUpdate($params, $data, $request)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionRemoveLink($params, $data, $request)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function actionMerge($params, $data, $request)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
43
application/Espo/Controllers/Portal.php
Normal file
43
application/Espo/Controllers/Portal.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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;
|
||||
|
||||
class Portal extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkControllerAccess()
|
||||
{
|
||||
$portalPermission = $this->getAcl()->get('portalPermission');
|
||||
if (!$portalPermission || $portalPermission === 'no') {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
application/Espo/Controllers/PortalRole.php
Normal file
34
application/Espo/Controllers/PortalRole.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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;
|
||||
|
||||
class PortalRole extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -88,8 +88,16 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (array_key_exists('smtpPassword', $data)) {
|
||||
$data['smtpPassword'] = $this->getCrypt()->encrypt($data['smtpPassword']);
|
||||
if ($this->getAcl()->getLevel('Preferences', 'read') === 'no') {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
foreach ($this->getAcl()->getScopeForbiddenAttributeList('Preferences', 'edit') as $attribute) {
|
||||
unset($data->$attribute);
|
||||
}
|
||||
|
||||
if (property_exists($data, 'smtpPassword')) {
|
||||
$data->smtpPassword = $this->getCrypt()->encrypt($data->smtpPassword);
|
||||
}
|
||||
|
||||
$user = $this->getEntityManager()->getEntity('User', $userId);
|
||||
@@ -105,7 +113,7 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
|
||||
$entity->clear('smtpPassword');
|
||||
|
||||
return $entity->toArray();
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
throw new Error();
|
||||
}
|
||||
@@ -124,10 +132,15 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
|
||||
$entity->set('smtpEmailAddress', $user->get('emailAddress'));
|
||||
$entity->set('name', $user->get('name'));
|
||||
$entity->set('isPortalUser', $user->get('isPortalUser'));
|
||||
|
||||
$entity->clear('smtpPassword');
|
||||
|
||||
return $entity->toArray();
|
||||
foreach ($this->getAcl()->getScopeForbiddenAttributeList('Preferences', 'read') as $attribute) {
|
||||
$entity->clear($attribute);
|
||||
}
|
||||
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -38,4 +38,3 @@ class ScheduledJob extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -28,6 +28,7 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
use \Espo\Core\Exceptions\Forbidden;
|
||||
use \Espo\Core\Exceptions\BadRequest;
|
||||
@@ -36,15 +37,22 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
protected function getConfigData()
|
||||
{
|
||||
$data = $this->getConfig()->getData($this->getUser()->isAdmin());
|
||||
if ($this->getUser()->id == 'system') {
|
||||
$data = $this->getConfig()->getData();
|
||||
} else {
|
||||
$data = $this->getConfig()->getData($this->getUser()->isAdmin());
|
||||
}
|
||||
|
||||
$fieldDefs = $this->getMetadata()->get('entityDefs.Settings.fields');
|
||||
|
||||
foreach ($fieldDefs as $field => $d) {
|
||||
if ($d['type'] == 'password') {
|
||||
if ($d['type'] === 'password') {
|
||||
unset($data[$field]);
|
||||
}
|
||||
}
|
||||
|
||||
$data['jsLibs'] = $this->getMetadata()->get('app.jsLibs');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -68,7 +76,11 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (isset($data['useCache']) && $data['useCache'] != $this->getConfig()->get('useCache')) {
|
||||
if (
|
||||
(isset($data->useCache) && $data->useCache !== $this->getConfig()->get('useCache'))
|
||||
||
|
||||
(isset($data->aclStrictMode) && $data->aclStrictMode !== $this->getConfig()->get('aclStrictMode'))
|
||||
) {
|
||||
$this->getContainer()->get('dataManager')->clearCache();
|
||||
}
|
||||
|
||||
@@ -78,12 +90,31 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
throw new Error('Cannot save settings');
|
||||
}
|
||||
|
||||
/** Rebuild for Currency Settings */
|
||||
if (isset($data['baseCurrency']) || isset($data['currencyRates'])) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase(array());
|
||||
if (isset($data->defaultCurrency) || isset($data->baseCurrency) || isset($data->currencyRates)) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase([]);
|
||||
}
|
||||
/** END Rebuild for Currency Settings */
|
||||
|
||||
return $this->getConfigData();
|
||||
}
|
||||
|
||||
public function postActionTestLdapConnection($params, $data)
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (!isset($data->password)) {
|
||||
$data->password = $this->getConfig()->get('ldapPassword');
|
||||
}
|
||||
|
||||
$data = get_object_vars($data);
|
||||
|
||||
$ldapUtils = new \Espo\Core\Utils\Authentication\LDAP\Utils();
|
||||
$options = $ldapUtils->normalizeOptions($data);
|
||||
|
||||
$ldapClient = new \Espo\Core\Utils\Authentication\LDAP\Client($options);
|
||||
$ldapClient->bind(); //an exception if no connection
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -31,6 +31,4 @@ namespace Espo\Controllers;
|
||||
|
||||
class Team extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -35,4 +35,3 @@ class Template extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -55,28 +55,22 @@ class User extends \Espo\Core\Controllers\Record
|
||||
return $this->getAclManager()->getMap($user);
|
||||
}
|
||||
|
||||
public function actionChangeOwnPassword($params, $data, $request)
|
||||
public function postActionChangeOwnPassword($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
if (!property_exists($data, 'password') || !property_exists($data, 'currentPassword')) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!array_key_exists('password', $data) || !array_key_exists('currentPassword', $data)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getService('User')->changePassword($this->getUser()->id, $data['password'], true, $data['currentPassword']);
|
||||
return $this->getService('User')->changePassword($this->getUser()->id, $data->password, true, $data->currentPassword);
|
||||
}
|
||||
|
||||
public function actionChangePasswordByRequest($params, $data, $request)
|
||||
public function postActionChangePasswordByRequest($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data['requestId']) || empty($data['password'])) {
|
||||
if (empty($data->requestId) || empty($data->password)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$p = $this->getEntityManager()->getRepository('PasswordChangeRequest')->where(array(
|
||||
'requestId' => $data['requestId']
|
||||
'requestId' => $data->requestId
|
||||
))->findOne();
|
||||
|
||||
if (!$p) {
|
||||
@@ -89,23 +83,27 @@ class User extends \Espo\Core\Controllers\Record
|
||||
|
||||
$this->getEntityManager()->removeEntity($p);
|
||||
|
||||
return $this->getService('User')->changePassword($userId, $data['password']);
|
||||
if ($this->getService('User')->changePassword($userId, $data->password)) {
|
||||
return array(
|
||||
'url' => $p->get('url')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function actionPasswordChangeRequest($params, $data, $request)
|
||||
public function postActionPasswordChangeRequest($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (empty($data['userName']) || empty($data['emailAddress'])) {
|
||||
if (empty($data->userName) || empty($data->emailAddress)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$userName = $data['userName'];
|
||||
$emailAddress = $data['emailAddress'];
|
||||
$userName = $data->userName;
|
||||
$emailAddress = $data->emailAddress;
|
||||
$url = null;
|
||||
if (!empty($data->url)) {
|
||||
$url = $data->url;
|
||||
}
|
||||
|
||||
return $this->getService('User')->passwordChangeRequest($userName, $emailAddress);
|
||||
return $this->getService('User')->passwordChangeRequest($userName, $emailAddress, $url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -69,6 +69,11 @@ class Acl
|
||||
return $this->getAclManager()->get($this->getUser(), $permission);
|
||||
}
|
||||
|
||||
public function checkReadNo($scope)
|
||||
{
|
||||
return $this->getAclManager()->checkReadNo($this->getUser(), $scope);
|
||||
}
|
||||
|
||||
public function checkReadOnlyTeam($scope)
|
||||
{
|
||||
return $this->getAclManager()->checkReadOnlyTeam($this->getUser(), $scope);
|
||||
@@ -79,19 +84,54 @@ class Acl
|
||||
return $this->getAclManager()->checkReadOnlyOwn($this->getUser(), $scope);
|
||||
}
|
||||
|
||||
public function check($subject, $action = null, $isOwner = null, $inTeam = null)
|
||||
public function check($subject, $action = null)
|
||||
{
|
||||
return $this->getAclManager()->check($this->getUser(), $subject, $action, $isOwner, $inTeam) ;
|
||||
return $this->getAclManager()->check($this->getUser(), $subject, $action);
|
||||
}
|
||||
|
||||
public function checkScope($scope, $action = null, $isOwner = null, $inTeam = null, $entity = null)
|
||||
public function checkScope($scope, $action = null)
|
||||
{
|
||||
return $this->getAclManager()->checkScope($this->getUser(), $scope, $action, $isOwner, $inTeam, $entity) ;
|
||||
return $this->getAclManager()->checkScope($this->getUser(), $scope, $action);
|
||||
}
|
||||
|
||||
public function checkPermission($permission, User $entity)
|
||||
public function checkEntity(Entity $entity, $action = 'read')
|
||||
{
|
||||
return $this->getAclManager()->checkPermission($this->getUser(), $permission, $entity);
|
||||
return $this->getAclManager()->checkEntity($this->getUser(), $entity, $action);
|
||||
}
|
||||
|
||||
public function checkUser($permission, User $entity)
|
||||
{
|
||||
return $this->getAclManager()->checkUser($this->getUser(), $permission, $entity);
|
||||
}
|
||||
|
||||
public function checkIsOwner(Entity $entity)
|
||||
{
|
||||
return $this->getAclManager()->checkIsOwner($this->getUser(), $entity);
|
||||
}
|
||||
|
||||
public function checkInTeam(Entity $entity)
|
||||
{
|
||||
return $this->getAclManager()->checkInTeam($this->getUser(), $entity);
|
||||
}
|
||||
|
||||
public function getScopeForbiddenAttributeList($scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
return $this->getAclManager()->getScopeForbiddenAttributeList($this->getUser(), $scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function getScopeForbiddenFieldList($scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
return $this->getAclManager()->getScopeForbiddenFieldList($this->getUser(), $scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function checkUserPermission($target, $permissionType = 'userPermission')
|
||||
{
|
||||
return $this->getAclManager()->checkUserPermission($this->getUser(), $target, $permissionType);
|
||||
}
|
||||
|
||||
public function checkAssignmentPermission($target)
|
||||
{
|
||||
return $this->getAclManager()->checkAssignmentPermission($this->getUser(), $target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -42,6 +42,8 @@ class Base implements Injectable
|
||||
'aclManager'
|
||||
);
|
||||
|
||||
protected $scope;
|
||||
|
||||
protected $injections = array();
|
||||
|
||||
public function inject($name, $object)
|
||||
@@ -49,9 +51,10 @@ class Base implements Injectable
|
||||
$this->injections[$name] = $object;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
public function __construct($scope)
|
||||
{
|
||||
$this->init();
|
||||
$this->scope = $scope;
|
||||
}
|
||||
|
||||
protected function init()
|
||||
@@ -63,6 +66,13 @@ class Base implements Injectable
|
||||
return $this->injections[$name];
|
||||
}
|
||||
|
||||
protected function addDependencyList(array $list)
|
||||
{
|
||||
foreach ($list as $item) {
|
||||
$this->addDependency($item);
|
||||
}
|
||||
}
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencies[] = $name;
|
||||
@@ -90,27 +100,42 @@ class Base implements Injectable
|
||||
|
||||
public function checkReadOnlyTeam(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_array($data) || !isset($data['read'])) {
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
return false;
|
||||
}
|
||||
return $data['read'] === 'team';
|
||||
return $data->read === 'team';
|
||||
}
|
||||
|
||||
public function checkReadNo(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
return false;
|
||||
}
|
||||
return $data->read === 'no';
|
||||
}
|
||||
|
||||
public function checkReadOnlyOwn(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_array($data) || !isset($data['read'])) {
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
return false;
|
||||
}
|
||||
return $data['read'] === 'own';
|
||||
return $data->read === 'own';
|
||||
}
|
||||
|
||||
public function checkEntity(User $user, Entity $entity, $data, $action)
|
||||
{
|
||||
return $this->checkScope($user, $data, $entity->getEntityType(), $action, null, null, $entity);
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
return $this->checkScope($user, $data, $action, $entity);
|
||||
}
|
||||
|
||||
public function checkScope(User $user, $data, $scope, $action = null, $isOwner = null, $inTeam = null, Entity $entity = null)
|
||||
public function checkScope(User $user, $data, $action = null, Entity $entity = null, $entityAccessData = array())
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_null($data)) {
|
||||
return false;
|
||||
}
|
||||
@@ -120,83 +145,103 @@ class Base implements Injectable
|
||||
if ($data === true) {
|
||||
return true;
|
||||
}
|
||||
if (is_string($data)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is_null($action)) {
|
||||
if (array_key_exists($action, $data)) {
|
||||
$value = $data[$action];
|
||||
$isOwner = null;
|
||||
if (isset($entityAccessData['isOwner'])) {
|
||||
$isOwner = $entityAccessData['isOwner'];
|
||||
}
|
||||
$inTeam = null;
|
||||
if (isset($entityAccessData['inTeam'])) {
|
||||
$inTeam = $entityAccessData['inTeam'];
|
||||
}
|
||||
|
||||
if ($value === 'all' || $value === true) {
|
||||
return true;
|
||||
}
|
||||
if (is_null($action)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$value || $value === 'no') {
|
||||
return false;
|
||||
}
|
||||
if (!isset($data->$action)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_null($isOwner)) {
|
||||
if ($entity) {
|
||||
$isOwner = $this->checkIsOwner($user, $entity);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$value = $data->$action;
|
||||
|
||||
if ($isOwner) {
|
||||
if ($value === 'own' || $value === 'team') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (is_null($inTeam) && $entity) {
|
||||
$inTeam = $this->checkInTeam($user, $entity);
|
||||
}
|
||||
if ($value === 'all' || $value === 'yes' || $value === true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($inTeam) {
|
||||
if ($value === 'team') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if (!$value || $value === 'no') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_null($isOwner)) {
|
||||
if ($entity) {
|
||||
$isOwner = $this->checkIsOwner($user, $entity);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
if ($isOwner) {
|
||||
if ($value === 'own' || $value === 'team') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (is_null($inTeam) && $entity) {
|
||||
$inTeam = $this->checkInTeam($user, $entity);
|
||||
}
|
||||
|
||||
if ($inTeam) {
|
||||
if ($value === 'team') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
{
|
||||
if ($entity->has('assignedUserId')) {
|
||||
if ($user->id === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
if ($entity->hasAttribute('assignedUserId')) {
|
||||
if ($entity->has('assignedUserId')) {
|
||||
if ($user->id === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if ($entity->hasAttribute('createdById')) {
|
||||
if ($entity->has('createdById')) {
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasLinkMultipleField('assignedUsers')) {
|
||||
if ($entity->hasLinkMultipleId('assignedUsers', $user->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkInTeam(User $user, Entity $entity)
|
||||
{
|
||||
$userTeamIds = $user->get('teamsIds');
|
||||
$userTeamIdList = $user->getLinkMultipleIdList('teams');
|
||||
|
||||
if (!$entity->hasRelation('teams') || !$entity->hasField('teamsIds')) {
|
||||
if (!$entity->hasRelation('teams') || !$entity->hasAttribute('teamsIds')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$entity->has('teamsIds')) {
|
||||
$entity->loadLinkMultipleField('teams');
|
||||
}
|
||||
$entityTeamIdList = $entity->getLinkMultipleIdList('teams');
|
||||
|
||||
$teamIds = $entity->get('teamsIds');
|
||||
|
||||
if (empty($teamIds)) {
|
||||
if (empty($entityTeamIdList)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($userTeamIds as $id) {
|
||||
if (in_array($id, $teamIds)) {
|
||||
foreach ($userTeamIdList as $id) {
|
||||
if (in_array($id, $entityTeamIdList)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -205,27 +250,36 @@ class Base implements Injectable
|
||||
|
||||
public function checkEntityDelete(User $user, Entity $entity, $data)
|
||||
{
|
||||
$result = $this->checkEntity($user, $entity, $data, 'delete');
|
||||
if (!$result) {
|
||||
if (is_array($data)) {
|
||||
if ($data['edit'] != 'no') {
|
||||
if ($entity->has('createdById') && $entity->get('createdById') == $user->id) {
|
||||
if (!$entity->has('assignedUserId')) {
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->checkEntity($user, $entity, $data, 'delete')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_object($data)) {
|
||||
if ($data->edit !== 'no' || $data->create !== 'no') {
|
||||
if (
|
||||
$this->getConfig()->get('aclAllowDeleteCreated')
|
||||
&&
|
||||
$entity->has('createdById') && $entity->get('createdById') == $user->id
|
||||
) {
|
||||
if (!$entity->has('assignedUserId')) {
|
||||
return true;
|
||||
} else {
|
||||
if (!$entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
if ($entity->get('assignedUserId') == $entity->get('createdById')) {
|
||||
return true;
|
||||
} else {
|
||||
if (!$entity->get('assignedUserId')) {
|
||||
return true;
|
||||
}
|
||||
if ($entity->get('assignedUserId') == $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -32,54 +32,116 @@ namespace Espo\Core\Acl;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
use \Espo\Entities\User;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\Utils\Metadata;
|
||||
use \Espo\Core\Utils\FieldManagerUtil;
|
||||
use \Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
class Table
|
||||
{
|
||||
private $data = array(
|
||||
'table' => array()
|
||||
);
|
||||
protected $type = 'acl';
|
||||
|
||||
private $cacheFile;
|
||||
protected $defaultAclType = 'recordAllTeamOwnNo';
|
||||
|
||||
private $actionList = ['read', 'edit', 'delete'];
|
||||
private $data = null;
|
||||
|
||||
private $levelList = ['all', 'team', 'own', 'no'];
|
||||
protected $cacheFilePath;
|
||||
|
||||
protected $fileManager;
|
||||
protected $actionList = ['read', 'stream', 'edit', 'delete', 'create'];
|
||||
|
||||
protected $metadata;
|
||||
protected $booleanActionList = ['create'];
|
||||
|
||||
public function __construct(\Espo\Entities\User $user, $config = null, $fileManager = null, $metadata = null)
|
||||
protected $levelList = ['yes', 'all', 'team', 'own', 'no'];
|
||||
|
||||
protected $fieldActionList = ['read', 'edit'];
|
||||
|
||||
protected $fieldLevelList = ['yes', 'no'];
|
||||
|
||||
protected $valuePermissionHighestLevels = array();
|
||||
|
||||
protected $valuePermissionList = [];
|
||||
|
||||
private $fileManager;
|
||||
|
||||
private $metadata;
|
||||
|
||||
private $fieldManager;
|
||||
|
||||
protected $forbiddenAttributesCache = array();
|
||||
|
||||
protected $forbiddenFieldsCache = array();
|
||||
|
||||
protected $isStrictModeForced = false;
|
||||
|
||||
protected $isStrictMode = false;
|
||||
|
||||
public function __construct(User $user, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManagerUtil $fieldManager = null)
|
||||
{
|
||||
$this->data = (object) [
|
||||
'table' => (object) [],
|
||||
'fieldTable' => (object) [],
|
||||
'fieldTableQuickAccess' => (object) [],
|
||||
];
|
||||
|
||||
if ($this->isStrictModeForced) {
|
||||
$this->isStrictMode = true;
|
||||
} else {
|
||||
$this->isStrictMode = $config->get('aclStrictMode', false);
|
||||
}
|
||||
|
||||
$this->user = $user;
|
||||
|
||||
$this->metadata = $metadata;
|
||||
|
||||
if (!$this->user->isFetched()) {
|
||||
throw new Error();
|
||||
if ($fieldManager) {
|
||||
$this->fieldManager = $fieldManager;
|
||||
}
|
||||
|
||||
$this->user->loadLinkMultipleField('teams');
|
||||
if (!$this->user->isFetched()) {
|
||||
throw new Error('User must be fetched before ACL check.');
|
||||
}
|
||||
|
||||
if ($fileManager) {
|
||||
$this->fileManager = $fileManager;
|
||||
}
|
||||
$this->valuePermissionList = $this->metadata->get(['app', $this->type, 'valuePermissionList'], []);
|
||||
$this->valuePermissionHighestLevels = $this->metadata->get(['app', $this->type, 'valuePermissionHighestLevels'], array());
|
||||
|
||||
$this->cacheFile = 'data/cache/application/acl/' . $user->id . '.php';
|
||||
$this->initCacheFilePath();
|
||||
|
||||
if ($config && $config->get('useCache') && file_exists($this->cacheFile)) {
|
||||
$cached = include $this->cacheFile;
|
||||
if ($config && $config->get('useCache') && file_exists($this->cacheFilePath)) {
|
||||
$cached = include $this->cacheFilePath;
|
||||
$this->data = $cached;
|
||||
$this->initSolid();
|
||||
} else {
|
||||
$this->load();
|
||||
$this->initSolid();
|
||||
if ($config && $fileManager && $config->get('useCache')) {
|
||||
$this->buildCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function initCacheFilePath()
|
||||
{
|
||||
$this->cacheFilePath = 'data/cache/application/acl/' . $this->getUser()->id . '.php';
|
||||
}
|
||||
|
||||
protected function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
{
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
protected function getFieldManager()
|
||||
{
|
||||
return $this->fieldManager;
|
||||
}
|
||||
|
||||
public function getMap()
|
||||
{
|
||||
return $this->data;
|
||||
@@ -87,8 +149,8 @@ class Table
|
||||
|
||||
public function getScopeData($scope)
|
||||
{
|
||||
if (array_key_exists($scope, $this->data['table'])) {
|
||||
$data = $this->data['table'][$scope];
|
||||
if (isset($this->data->table->$scope)) {
|
||||
$data = $this->data->table->$scope;
|
||||
if (is_string($data)) {
|
||||
$data = $this->getScopeData($data);
|
||||
return $data;
|
||||
@@ -104,66 +166,406 @@ class Table
|
||||
return null;
|
||||
}
|
||||
|
||||
if (array_key_exists($permission, $this->data)) {
|
||||
return $this->data[$permission];
|
||||
if (isset($this->data->$permission)) {
|
||||
return $this->data->$permission;
|
||||
}
|
||||
return null;
|
||||
return 'no';
|
||||
}
|
||||
|
||||
public function getLevel($scope, $action)
|
||||
{
|
||||
if (array_key_exists($scope, $this->data['table'])) {
|
||||
if (array_key_exists($action, $this->data['table'][$scope])) {
|
||||
return $this->data['table'][$scope][$action];
|
||||
if (isset($this->data->table->$scope)) {
|
||||
if (isset($this->data->table->$scope->$action)) {
|
||||
return $this->data->table->$scope->$action;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return 'no';
|
||||
}
|
||||
|
||||
private function load()
|
||||
{
|
||||
$aclTables = [];
|
||||
$assignmentPermissionList = [];
|
||||
$userPermissionList = [];
|
||||
|
||||
$userRoles = $this->user->get('roles');
|
||||
|
||||
foreach ($userRoles as $role) {
|
||||
$aclTables[] = $role->get('data');
|
||||
$assignmentPermissionList[] = $role->get('assignmentPermission');
|
||||
$userPermissionList[] = $role->get('userPermission');
|
||||
$valuePermissionLists = (object)[];
|
||||
foreach ($this->valuePermissionList as $permission) {
|
||||
$valuePermissionLists->$permission = [];
|
||||
}
|
||||
|
||||
$teams = $this->user->get('teams');
|
||||
foreach ($teams as $team) {
|
||||
$teamRoles = $team->get('roles');
|
||||
foreach ($teamRoles as $role) {
|
||||
$aclTables[] = $role->get('data');
|
||||
$assignmentPermissionList[] = $role->get('assignmentPermission');
|
||||
$userPermissionList[] = $role->get('userPermission');
|
||||
$aclTableList = [];
|
||||
$fieldTableList = [];
|
||||
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
$roleList = $this->getRoleList();
|
||||
|
||||
foreach ($roleList as $role) {
|
||||
$aclTableList[] = $role->get('data');
|
||||
$fieldTableList[] = $role->get('fieldData');
|
||||
foreach ($this->valuePermissionList as $permission) {
|
||||
$valuePermissionLists->{$permission}[] = $role->get($permission);
|
||||
}
|
||||
}
|
||||
|
||||
$aclTable = $this->mergeTableList($aclTableList);
|
||||
$fieldTable = $this->mergeFieldTableList($fieldTableList);
|
||||
|
||||
$this->applyDefault($aclTable, $fieldTable);
|
||||
$this->applyDisabled($aclTable, $fieldTable);
|
||||
$this->applyMandatory($aclTable, $fieldTable);
|
||||
$this->applyAdditional($aclTable, $fieldTable, $valuePermissionLists);
|
||||
$this->applyReadOnlyFields($fieldTable);
|
||||
} else {
|
||||
$aclTable = (object) [];
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
if ($this->metadata->get("scopes.{$scope}.{$this->type}") === 'boolean') {
|
||||
$aclTable->$scope = true;
|
||||
} else {
|
||||
if ($this->metadata->get("scopes.{$scope}.entity")) {
|
||||
$aclTable->$scope = (object) [];
|
||||
foreach ($this->actionList as $action) {
|
||||
$aclTable->$scope->$action = 'all';
|
||||
if (in_array($action, $this->booleanActionList)) {
|
||||
$aclTable->$scope->$action = 'yes';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$fieldTable = (object) [];
|
||||
}
|
||||
|
||||
foreach ($aclTable as $scope => $data) {
|
||||
if (is_string($data)) {
|
||||
if (isset($aclTable->$data)) {
|
||||
$aclTable->$scope = $aclTable->$data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['table'] = $this->merge($aclTables);
|
||||
$this->data->table = $aclTable;
|
||||
$this->data->fieldTable = $fieldTable;
|
||||
|
||||
$this->data['assignmentPermission'] = $this->mergeValues($assignmentPermissionList, $this->metadata->get('app.acl.valueDefaults.assignmentPermission', 'all'));
|
||||
$this->data['userPermission'] = $this->mergeValues($userPermissionList, $this->metadata->get('app.acl.valueDefaults.userPermission', 'no'));
|
||||
$this->fillFieldTableQuickAccess();
|
||||
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
$permissionsDefaultsGroupName = 'permissionsDefaults';
|
||||
if ($this->isStrictMode) {
|
||||
$permissionsDefaultsGroupName = 'permissionsStrictDefaults';
|
||||
}
|
||||
foreach ($this->valuePermissionList as $permission) {
|
||||
$this->data->$permission = $this->mergeValueList($valuePermissionLists->$permission, $this->metadata->get(['app', $this->type, $permissionsDefaultsGroupName, $permission, 'yes']));
|
||||
if ($this->metadata->get('app.'.$this->type.'.mandatory.' . $permission)) {
|
||||
$this->data->$permission = $this->metadata->get('app.'.$this->type.'.mandatory.' . $permission);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
foreach ($this->valuePermissionList as $permission) {
|
||||
if (isset($this->valuePermissionHighestLevels[$permission])) {
|
||||
$this->data->$permission = $this->valuePermissionHighestLevels[$permission];
|
||||
continue;
|
||||
}
|
||||
$this->data->$permission = 'all';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function initSolid()
|
||||
protected function getRoleList()
|
||||
{
|
||||
if (!$this->metadata) {
|
||||
$roleList = [];
|
||||
|
||||
$userRoleList = $this->getUser()->get('roles');
|
||||
if (!(is_array($userRoleList) || $userRoleList instanceof \Traversable)) {
|
||||
throw new Error();
|
||||
}
|
||||
foreach ($userRoleList as $role) {
|
||||
$roleList[] = $role;
|
||||
}
|
||||
|
||||
$teamList = $this->getUser()->get('teams');
|
||||
if (!(is_array($teamList) || $teamList instanceof \Traversable)) {
|
||||
throw new Error();
|
||||
}
|
||||
foreach ($teamList as $team) {
|
||||
$teamRoleList = $team->get('roles');
|
||||
foreach ($teamRoleList as $role) {
|
||||
$roleList[] = $role;
|
||||
}
|
||||
}
|
||||
|
||||
return $roleList;
|
||||
}
|
||||
|
||||
public function getScopeForbiddenAttributeList($scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
$key = $scope . '_'. $action . '_' . $thresholdLevel;
|
||||
if (isset($this->forbiddenAttributesCache[$key])) {
|
||||
return $this->forbiddenAttributesCache[$key];
|
||||
}
|
||||
|
||||
$fieldTableQuickAccess = $this->data->fieldTableQuickAccess;
|
||||
|
||||
if (!isset($fieldTableQuickAccess->$scope) || !isset($fieldTableQuickAccess->$scope->attributes) || !isset($fieldTableQuickAccess->$scope->attributes->$action)) {
|
||||
$this->forbiddenAttributesCache[$key] = [];
|
||||
return [];
|
||||
}
|
||||
|
||||
$levelList = [];
|
||||
foreach ($this->fieldLevelList as $level) {
|
||||
if (array_search($level, $this->fieldLevelList) >= array_search($thresholdLevel, $this->fieldLevelList)) {
|
||||
$levelList[] = $level;
|
||||
}
|
||||
}
|
||||
|
||||
$attributeList = [];
|
||||
|
||||
foreach ($levelList as $level) {
|
||||
if (!isset($fieldTableQuickAccess->$scope->attributes->$action->$level)) continue;
|
||||
foreach ($fieldTableQuickAccess->$scope->attributes->$action->$level as $attribute) {
|
||||
if (in_array($attribute, $attributeList)) continue;
|
||||
$attributeList[] = $attribute;
|
||||
}
|
||||
}
|
||||
|
||||
$this->forbiddenAttributesCache[$key] = $attributeList;
|
||||
|
||||
return $attributeList;
|
||||
}
|
||||
|
||||
public function getScopeForbiddenFieldList($scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
$key = $scope . '_'. $action . '_' . $thresholdLevel;
|
||||
if (isset($this->forbiddenFieldsCache[$key])) {
|
||||
return $this->forbiddenFieldsCache[$key];
|
||||
}
|
||||
|
||||
$fieldTableQuickAccess = $this->data->fieldTableQuickAccess;
|
||||
|
||||
if (!isset($fieldTableQuickAccess->$scope) || !isset($fieldTableQuickAccess->$scope->fields) || !isset($fieldTableQuickAccess->$scope->fields->$action)) {
|
||||
$this->forbiddenFieldsCache[$key] = [];
|
||||
return [];
|
||||
}
|
||||
|
||||
$levelList = [];
|
||||
foreach ($this->fieldLevelList as $level) {
|
||||
if (array_search($level, $this->fieldLevelList) >= array_search($thresholdLevel, $this->fieldLevelList)) {
|
||||
$levelList[] = $level;
|
||||
}
|
||||
}
|
||||
|
||||
$fieldList = [];
|
||||
|
||||
foreach ($levelList as $level) {
|
||||
if (!isset($fieldTableQuickAccess->$scope->fields->$action->$level)) continue;
|
||||
foreach ($fieldTableQuickAccess->$scope->fields->$action->$level as $field) {
|
||||
if (in_array($field, $fieldList)) continue;
|
||||
$fieldList[] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
$this->forbiddenFieldsCache[$key] = $fieldList;
|
||||
|
||||
return $fieldList;
|
||||
}
|
||||
|
||||
protected function fillFieldTableQuickAccess()
|
||||
{
|
||||
$fieldTable = $this->data->fieldTable;
|
||||
|
||||
$fieldTableQuickAccess = (object) [];
|
||||
|
||||
foreach (get_object_vars($fieldTable) as $scope => $scopeData) {
|
||||
$fieldTableQuickAccess->$scope = (object) [
|
||||
'attributes' => (object) [],
|
||||
'fields' => (object) []
|
||||
];
|
||||
|
||||
foreach ($this->fieldActionList as $action) {
|
||||
$fieldTableQuickAccess->$scope->attributes->$action = (object) [];
|
||||
$fieldTableQuickAccess->$scope->fields->$action = (object) [];
|
||||
foreach ($this->fieldLevelList as $level) {
|
||||
$fieldTableQuickAccess->$scope->attributes->$action->$level = [];
|
||||
$fieldTableQuickAccess->$scope->fields->$action->$level = [];
|
||||
}
|
||||
}
|
||||
|
||||
foreach (get_object_vars($scopeData) as $field => $fieldData) {
|
||||
$attributeList = $this->getFieldManager()->getAttributeList($scope, $field);
|
||||
|
||||
foreach ($this->fieldActionList as $action) {
|
||||
if (!isset($fieldData->$action)) continue;
|
||||
foreach ($this->fieldLevelList as $level) {
|
||||
if ($fieldData->$action === $level) {
|
||||
$fieldTableQuickAccess->$scope->fields->$action->{$level}[] = $field;
|
||||
foreach ($attributeList as $attribute) {
|
||||
$fieldTableQuickAccess->$scope->attributes->$action->{$level}[] = $attribute;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->data->fieldTableQuickAccess = $fieldTableQuickAccess;
|
||||
}
|
||||
|
||||
protected function applyDefault(&$table, &$fieldTable)
|
||||
{
|
||||
if ($this->getUser()->isAdmin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = $this->metadata->get('app.acl.solid', array());
|
||||
$defaultsGroupName = 'default';
|
||||
if ($this->isStrictMode) {
|
||||
$defaultsGroupName = 'strictDefault';
|
||||
}
|
||||
|
||||
foreach ($data as $entityType => $item) {
|
||||
$this->data['table'][$entityType] = $item;
|
||||
$data = $this->metadata->get(['app', $this->type, $defaultsGroupName, 'scopeLevel'], []);
|
||||
|
||||
foreach ($data as $scope => $item) {
|
||||
if (isset($table->$scope)) continue;
|
||||
$value = $item;
|
||||
if (is_array($item)) {
|
||||
$value = (object) $item;
|
||||
}
|
||||
$table->$scope = $value;
|
||||
}
|
||||
|
||||
$defaultFieldData = $this->metadata->get(['app', $this->type, $defaultsGroupName, 'fieldLevel'], []);
|
||||
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
if (isset($table->$scope) && $table->$scope === false) continue;
|
||||
if (!$this->getMetadata()->get('scopes.' . $scope . '.entity')) continue;
|
||||
|
||||
$fieldList = array_keys($this->getMetadata()->get("entityDefs.{$scope}.fields", []));
|
||||
|
||||
$defaultScopeFieldData = $this->metadata->get('app.'.$this->type.'.'.$defaultsGroupName.'.scopeFieldLevel.' . $scope, []);
|
||||
|
||||
foreach (array_merge($defaultFieldData, $defaultScopeFieldData) as $field => $f) {
|
||||
if (!in_array($field, $fieldList)) continue;
|
||||
if (!isset($fieldTable->$scope)) {
|
||||
$fieldTable->$scope = (object) [];
|
||||
}
|
||||
if (isset($fieldTable->$scope->$field)) continue;
|
||||
$fieldTable->$scope->$field = (object) [];
|
||||
foreach ($this->fieldActionList as $action) {
|
||||
$level = 'no';
|
||||
if ($f === true) {
|
||||
$level = 'yes';
|
||||
} else {
|
||||
if (is_array($f) && isset($f[$action])) {
|
||||
$level = $f[$action];
|
||||
}
|
||||
}
|
||||
$fieldTable->$scope->$field->$action = $level;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getScopeWithAclList() as $scope) {
|
||||
if (!isset($table->$scope)) {
|
||||
$aclType = $this->metadata->get('scopes.' . $scope . '.' . $this->type);
|
||||
if ($aclType === true) {
|
||||
$aclType = $this->defaultAclType;
|
||||
}
|
||||
if (!empty($aclType)) {
|
||||
$paramDefaultsName = 'scopeLevelTypesDefaults';
|
||||
if ($this->isStrictMode) {
|
||||
$paramDefaultsName = 'scopeLevelTypesStrictDefaults';
|
||||
}
|
||||
$defaultValue = $this->metadata->get(['app', $this->type, $paramDefaultsName, $aclType], $this->metadata->get(['app', $this->type, $paramDefaultsName, 'record']));
|
||||
if (is_array($defaultValue)) {
|
||||
$defaultValue = (object) $defaultValue;
|
||||
}
|
||||
$table->$scope = $defaultValue;
|
||||
|
||||
if (is_object($table->$scope)) {
|
||||
$actionList = $this->getMetadata()->get(['scopes', $scope, $this->type . 'ActionList']);
|
||||
if ($actionList) {
|
||||
foreach (get_object_vars($table->$scope) as $action => $level) {
|
||||
if (!in_array($action, $actionList)) {
|
||||
unset($table->$scope->$action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function mergeValues(array $list, $defaultValue)
|
||||
protected function applyMandatory(&$table, &$fieldTable)
|
||||
{
|
||||
if ($this->getUser()->isAdmin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = $this->metadata->get('app.'.$this->type.'.mandatory.scopeLevel', array());
|
||||
|
||||
foreach ($data as $scope => $item) {
|
||||
$value = $item;
|
||||
if (is_array($item)) {
|
||||
$value = (object) $item;
|
||||
}
|
||||
$table->$scope = $value;
|
||||
}
|
||||
|
||||
$mandatoryFieldData = $this->metadata->get('app.'.$this->type.'.mandatory.fieldLevel', array());
|
||||
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
if (isset($table->$scope) && $table->$scope === false) continue;
|
||||
if (!$this->getMetadata()->get('scopes.' . $scope . '.entity')) continue;
|
||||
|
||||
$fieldList = array_keys($this->getMetadata()->get("entityDefs.{$scope}.fields", []));
|
||||
|
||||
$mandatoryScopeFieldData = $this->metadata->get('app.'.$this->type.'.mandatory.scopeFieldLevel.' . $scope, array());
|
||||
|
||||
foreach (array_merge($mandatoryFieldData, $mandatoryScopeFieldData) as $field => $f) {
|
||||
if (!in_array($field, $fieldList)) continue;
|
||||
if (!isset($fieldTable->$scope)) {
|
||||
$fieldTable->$scope = (object) [];
|
||||
}
|
||||
$fieldTable->$scope->$field = (object) [];
|
||||
foreach ($this->fieldActionList as $action) {
|
||||
$level = 'no';
|
||||
if ($f === true) {
|
||||
$level = 'yes';
|
||||
} else {
|
||||
if (is_array($f) && isset($f[$action])) {
|
||||
$level = $f[$action];
|
||||
}
|
||||
}
|
||||
$fieldTable->$scope->$field->$action = $level;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyDisabled(&$table, &$fieldTable)
|
||||
{
|
||||
if ($this->getUser()->isAdmin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
if ($this->getMetadata()->get('scopes.' . $scope . '.disabled')) {
|
||||
$table->$scope = false;
|
||||
unset($fieldTable->$scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyAdditional(&$table, &$fieldTable, &$valuePermissionLists)
|
||||
{
|
||||
if ($this->getUser()->get('isPortalUser')) {
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
$table->$scope = false;
|
||||
unset($fieldTable->$scope);
|
||||
}
|
||||
foreach ($this->valuePermissionList as $permission) {
|
||||
$valuePermissionLists->{$permission}[] = 'no';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function mergeValueList(array $list, $defaultValue)
|
||||
{
|
||||
$result = null;
|
||||
foreach ($list as $level) {
|
||||
@@ -183,51 +585,76 @@ class Table
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getScopeList()
|
||||
protected function getScopeWithAclList()
|
||||
{
|
||||
$scopeList = [];
|
||||
$scopes = $this->metadata->get('scopes');
|
||||
foreach ($scopes as $scope => $d) {
|
||||
if (!empty($d['acl'])) {
|
||||
$scopeList[] = $scope;
|
||||
}
|
||||
if (empty($d['acl'])) continue;
|
||||
$scopeList[] = $scope;
|
||||
}
|
||||
return $scopeList;
|
||||
}
|
||||
|
||||
private function merge($tables)
|
||||
protected function getScopeList()
|
||||
{
|
||||
$data = array();
|
||||
$scopeList = $this->getScopeList();
|
||||
$scopeList = [];
|
||||
$scopes = $this->metadata->get('scopes');
|
||||
foreach ($scopes as $scope => $d) {
|
||||
$scopeList[] = $scope;
|
||||
}
|
||||
return $scopeList;
|
||||
}
|
||||
|
||||
foreach ($tables as $table) {
|
||||
private function mergeTableList(array $tableList)
|
||||
{
|
||||
$data = (object) [];
|
||||
$scopeList = $this->getScopeWithAclList();
|
||||
|
||||
foreach ($tableList as $table) {
|
||||
foreach ($scopeList as $scope) {
|
||||
if (!isset($table->$scope)) {
|
||||
continue;
|
||||
}
|
||||
if (!isset($table->$scope)) continue;
|
||||
|
||||
$row = $table->$scope;
|
||||
|
||||
if ($row == false) {
|
||||
if (!isset($data[$scope])) {
|
||||
$data[$scope] = false;
|
||||
if (!isset($data->$scope)) {
|
||||
$data->$scope = false;
|
||||
}
|
||||
} else if ($row === true) {
|
||||
$data[$scope] = true;
|
||||
$data->$scope = true;
|
||||
} else {
|
||||
if (!isset($data[$scope])) {
|
||||
$data[$scope] = array();
|
||||
if (!isset($data->$scope)) {
|
||||
$data->$scope = (object) [];
|
||||
}
|
||||
if ($data[$scope] == false) {
|
||||
$data[$scope] = array();
|
||||
if ($data->$scope === false) {
|
||||
$data->$scope = (object) [];
|
||||
}
|
||||
|
||||
if (is_array($row) || $row instanceof \stdClass) {
|
||||
foreach ($row as $action => $level) {
|
||||
if (!isset($data[$scope][$action])) {
|
||||
$data[$scope][$action] = $level;
|
||||
if (!is_object($row)) continue;
|
||||
|
||||
$actionList = $this->getMetadata()->get(['scopes', $scope, $this->type . 'ActionList'], $this->actionList);
|
||||
|
||||
foreach ($actionList as $i => $action) {
|
||||
if (isset($row->$action)) {
|
||||
$level = $row->$action;
|
||||
if (!isset($data->$scope->$action)) {
|
||||
$data->$scope->$action = $level;
|
||||
} else {
|
||||
if (array_search($data[$scope][$action], $this->levelList) > array_search($level, $this->levelList)) {
|
||||
$data[$scope][$action] = $level;
|
||||
if (array_search($data->$scope->$action, $this->levelList) > array_search($level, $this->levelList)) {
|
||||
$data->$scope->$action = $level;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($i > 0) {
|
||||
// TODO remove it
|
||||
$previousAction = $this->actionList[$i - 1];
|
||||
if (in_array($action, $this->booleanActionList)) {
|
||||
$data->$scope->$action = 'yes';
|
||||
} else {
|
||||
if ($action === 'stream' && isset($data->$scope->$previousAction)) {
|
||||
$data->$scope->$action = $data->$scope->$previousAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,24 +663,80 @@ class Table
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($scopeList as $scope) {
|
||||
if (!array_key_exists($scope, $data)) {
|
||||
$aclType = $this->metadata->get('scopes.' . $scope . '.acl');
|
||||
if ($aclType === true) {
|
||||
$aclType = 'recordAllTeamOwnNo';
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function mergeFieldTableList(array $tableList)
|
||||
{
|
||||
$data = (object) [];
|
||||
$scopeList = $this->getScopeWithAclList();
|
||||
|
||||
foreach ($tableList as $table) {
|
||||
foreach ($scopeList as $scope) {
|
||||
if (!isset($table->$scope)) continue;
|
||||
|
||||
if (!isset($data->$scope)) {
|
||||
$data->$scope = (object) [];
|
||||
}
|
||||
if (!empty($aclType)) {
|
||||
$data[$scope] = $this->metadata->get('app.acl.defaults.' . $aclType, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_object($table->$scope)) continue;
|
||||
|
||||
$fieldList = array_keys($this->getMetadata()->get("entityDefs.{$scope}.fields", []));
|
||||
|
||||
foreach (get_object_vars($table->$scope) as $field => $row) {
|
||||
if (!is_object($row)) continue;
|
||||
|
||||
if (!in_array($field, $fieldList)) continue;
|
||||
|
||||
if (!isset($data->$scope->$field)) {
|
||||
$data->$scope->$field = (object) [];
|
||||
}
|
||||
|
||||
foreach ($this->fieldActionList as $i => $action) {
|
||||
if (!isset($row->$action)) continue;
|
||||
|
||||
$level = $row->$action;
|
||||
if (!isset($data->$scope->$field->$action)) {
|
||||
$data->$scope->$field->$action = $level;
|
||||
} else {
|
||||
if (array_search($data->$scope->$field->$action, $this->fieldLevelList) > array_search($level, $this->fieldLevelList)) {
|
||||
$data->$scope->$field->$action = $level;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildCache()
|
||||
{
|
||||
$contents = '<' . '?'. 'php return ' . var_export($this->data, true) . ';';
|
||||
$this->fileManager->putContents($this->cacheFile, $contents);
|
||||
$this->fileManager->putPhpContents($this->cacheFilePath, $this->data, true);
|
||||
}
|
||||
|
||||
protected function applyReadOnlyFields(&$fieldTable)
|
||||
{
|
||||
// TODO Enable in 5.4.0
|
||||
return;
|
||||
$scopeList = $this->getScopeWithAclList();
|
||||
foreach ($scopeList as $scope) {
|
||||
if (!property_exists($fieldTable, $scope)) continue;
|
||||
$fieldList = array_keys($this->getMetadata()->get(['entityDefs', $scope, 'fields'], []));
|
||||
foreach ($fieldList as $field) {
|
||||
if ($this->getMetadata()->get(['entityDefs', $scope, 'fields', $field, 'readOnly'])) {
|
||||
if (property_exists($fieldTable->$scope, $field)) {
|
||||
$fieldTable->$scope->$field->edit = 'no';
|
||||
} else {
|
||||
$fieldTable->$scope->$field = (object) [];
|
||||
foreach ($this->fieldActionList as $action) {
|
||||
$fieldTable->$scope->$field->$action = 'yes';
|
||||
}
|
||||
$fieldTable->$scope->$field->edit = 'no';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -45,6 +45,10 @@ class AclManager
|
||||
|
||||
private $tableHashMap = array();
|
||||
|
||||
protected $tableClassName = '\\Espo\\Core\\Acl\\Table';
|
||||
|
||||
protected $userAclClassName = '\\Espo\\Core\\Acl';
|
||||
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
@@ -56,6 +60,11 @@ class AclManager
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
{
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
public function getImplementation($scope)
|
||||
{
|
||||
if (empty($this->implementationHashMap[$scope])) {
|
||||
@@ -75,10 +84,10 @@ class AclManager
|
||||
}
|
||||
|
||||
if (class_exists($className)) {
|
||||
$acl = new $className();
|
||||
$acl = new $className($scope);
|
||||
$dependencies = $acl->getDependencyList();
|
||||
foreach ($dependencies as $name) {
|
||||
$acl->inject($name, $this->container->get($name));
|
||||
$acl->inject($name, $this->getContainer()->get($name));
|
||||
}
|
||||
$this->implementationHashMap[$scope] = $acl;
|
||||
} else {
|
||||
@@ -91,14 +100,18 @@ class AclManager
|
||||
|
||||
protected function getTable(User $user)
|
||||
{
|
||||
$key = spl_object_hash($user);
|
||||
$key = $user->id;
|
||||
if (empty($key)) {
|
||||
$key = spl_object_hash($user);
|
||||
}
|
||||
|
||||
if (empty($this->tableHashMap[$key])) {
|
||||
$config = $this->getContainer()->get('config');
|
||||
$fileManager = $this->getContainer()->get('fileManager');
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
$fieldManager = $this->getContainer()->get('fieldManagerUtil');
|
||||
|
||||
$this->tableHashMap[$key] = new \Espo\Core\Acl\Table($user, $config, $fileManager, $metadata);
|
||||
$this->tableHashMap[$key] = new $this->tableClassName($user, $config, $fileManager, $metadata, $fieldManager);
|
||||
}
|
||||
|
||||
return $this->tableHashMap[$key];
|
||||
@@ -119,12 +132,18 @@ class AclManager
|
||||
|
||||
public function get(User $user, $permission)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
return $this->getTable($user)->get($permission);
|
||||
}
|
||||
|
||||
public function checkReadNo(User $user, $scope)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return false;
|
||||
}
|
||||
$data = $this->getTable($user)->getScopeData($scope);
|
||||
return $this->getImplementation($scope)->checkReadNo($user, $data);
|
||||
}
|
||||
|
||||
public function checkReadOnlyTeam(User $user, $scope)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
@@ -143,49 +162,51 @@ class AclManager
|
||||
return $this->getImplementation($scope)->checkReadOnlyOwn($user, $data);
|
||||
}
|
||||
|
||||
public function check(User $user, $subject, $action = null, $isOwner = null, $inTeam = null)
|
||||
public function check(User $user, $subject, $action = null)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
if (is_string($subject)) {
|
||||
return $this->checkScope($user, $subject, $action, $isOwner, $inTeam);
|
||||
return $this->checkScope($user, $subject, $action);
|
||||
} else {
|
||||
$entity = $subject;
|
||||
if ($entity instanceof Entity) {
|
||||
$entityType = $entity->getEntityType();
|
||||
|
||||
$impl = $this->getImplementation($entityType);
|
||||
$methodName = 'checkEntity' . ucfirst($action);
|
||||
if (method_exists($impl, $methodName)) {
|
||||
$data = $this->getTable($user)->getScopeData($entityType);
|
||||
return $impl->$methodName($user, $entity, $data);
|
||||
}
|
||||
|
||||
return $this->checkEntity($user, $entity, $action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function checkEntity(User $user, Entity $entity, $action)
|
||||
public function checkEntity(User $user, Entity $entity, $action = 'read')
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
$data = $this->getTable($user)->getScopeData($entity->getEntityType());
|
||||
return $this->getImplementation($entity->getEntityType())->checkEntity($user, $entity, $data, $action);
|
||||
}
|
||||
$scope = $entity->getEntityType();
|
||||
|
||||
public function checkScope(User $user, $scope, $action = null, $isOwner = null, $inTeam = null, $entity = null)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
$data = $this->getTable($user)->getScopeData($scope);
|
||||
return $this->getImplementation($scope)->checkScope($user, $data, $scope, $action, $isOwner, $inTeam, $entity);
|
||||
|
||||
$impl = $this->getImplementation($scope);
|
||||
|
||||
$methodName = 'checkEntity' . ucfirst($action);
|
||||
if (method_exists($impl, $methodName)) {
|
||||
return $impl->$methodName($user, $entity, $data);
|
||||
}
|
||||
|
||||
return $impl->checkEntity($user, $entity, $data, $action);
|
||||
}
|
||||
|
||||
public function checkPermission(User $user, $permission, User $entity)
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
{
|
||||
return $this->getImplementation($entity->getEntityType())->checkIsOwner($user, $entity);
|
||||
}
|
||||
|
||||
public function checkInTeam(User $user, Entity $entity)
|
||||
{
|
||||
return $this->getImplementation($entity->getEntityType())->checkInTeam($user, $entity);
|
||||
}
|
||||
|
||||
public function checkScope(User $user, $scope, $action = null)
|
||||
{
|
||||
$data = $this->getTable($user)->getScopeData($scope);
|
||||
return $this->getImplementation($scope)->checkScope($user, $data, $action);
|
||||
}
|
||||
|
||||
public function checkUser(User $user, $permission, User $entity)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
@@ -213,5 +234,58 @@ class AclManager
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getScopeForbiddenAttributeList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
if ($user->isAdmin()) return [];
|
||||
return $this->getTable($user)->getScopeForbiddenAttributeList($scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function getScopeForbiddenFieldList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
|
||||
{
|
||||
if ($user->isAdmin()) return [];
|
||||
return $this->getTable($user)->getScopeForbiddenFieldList($scope, $action, $thresholdLevel);
|
||||
}
|
||||
|
||||
public function checkUserPermission(User $user, $target, $permissionType = 'userPermission')
|
||||
{
|
||||
$permission = $this->get($user, $permissionType);
|
||||
|
||||
if (is_object($target)) {
|
||||
$userId = $target->id;
|
||||
} else {
|
||||
$userId = $target;
|
||||
}
|
||||
|
||||
if ($user->id === $userId) return true;
|
||||
|
||||
if ($permission === 'no') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($permission === 'yes') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($permission === 'team') {
|
||||
$teamIdList = $user->getLinkMultipleIdList('teams');
|
||||
if (!$this->getContainer()->get('entityManager')->getRepository('User')->checkBelongsToAnyOfTeams($userId, $teamIdList)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkAssignmentPermission(User $user, $target)
|
||||
{
|
||||
return $this->checkUserPermission($user, $target, 'assignmentPermission');
|
||||
}
|
||||
|
||||
public function createUserAcl(User $user)
|
||||
{
|
||||
$className = $this->userAclClassName;
|
||||
$acl = new $className($this, $user);
|
||||
return $acl;
|
||||
}
|
||||
}
|
||||
|
||||
212
application/Espo/Core/AclPortal/Base.php
Normal file
212
application/Espo/Core/AclPortal/Base.php
Normal file
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Base extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkScope(User $user, $data, $action = null, Entity $entity = null, $entityAccessData = array())
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_null($data)) {
|
||||
return false;
|
||||
}
|
||||
if ($data === false) {
|
||||
return false;
|
||||
}
|
||||
if ($data === true) {
|
||||
return true;
|
||||
}
|
||||
if (is_string($data)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$isOwner = null;
|
||||
if (isset($entityAccessData['isOwner'])) {
|
||||
$isOwner = $entityAccessData['isOwner'];
|
||||
}
|
||||
$inAccount = null;
|
||||
if (isset($entityAccessData['inAccount'])) {
|
||||
$inAccount = $entityAccessData['inAccount'];
|
||||
}
|
||||
$isOwnContact = null;
|
||||
if (isset($entityAccessData['isOwnContact'])) {
|
||||
$isOwnContact = $entityAccessData['isOwnContact'];
|
||||
}
|
||||
|
||||
if (is_null($action)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isset($data->$action)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $data->$action;
|
||||
|
||||
if ($value === 'all' || $value === 'yes' || $value === true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$value || $value === 'no') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_null($isOwner)) {
|
||||
if ($entity) {
|
||||
$isOwner = $this->checkIsOwner($user, $entity);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($isOwner) {
|
||||
if ($value === 'own' || $value === 'account' || $value === 'contact') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($value === 'account') {
|
||||
if (is_null($inAccount) && $entity) {
|
||||
$inAccount = $this->checkInAccount($user, $entity);
|
||||
}
|
||||
if ($inAccount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($value === 'contact') {
|
||||
if (is_null($isOwnContact) && $entity) {
|
||||
$isOwnContact = $this->checkIsOwnContact($user, $entity);
|
||||
}
|
||||
if ($isOwnContact) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public function checkReadOnlyAccount(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
return false;
|
||||
}
|
||||
return $data->read === 'account';
|
||||
}
|
||||
|
||||
public function checkReadOnlyContact(User $user, $data)
|
||||
{
|
||||
if (empty($data) || !is_object($data) || !isset($data->read)) {
|
||||
return false;
|
||||
}
|
||||
return $data->read === 'contact';
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
{
|
||||
if ($entity->hasAttribute('createdById')) {
|
||||
if ($entity->has('createdById')) {
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkInAccount(User $user, Entity $entity)
|
||||
{
|
||||
$accountIdList = $user->getLinkMultipleIdList('accounts');
|
||||
if (count($accountIdList)) {
|
||||
if ($entity->hasAttribute('accountId')) {
|
||||
if (in_array($entity->get('accountId'), $accountIdList)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasRelation('accounts')) {
|
||||
$repository = $this->getEntityManager()->getRepository($entity->getEntityType());
|
||||
foreach ($accountIdList as $accountId) {
|
||||
if ($repository->isRelated($entity, 'accounts', $accountId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasAttribute('parentId') && $entity->hasRelation('parent')) {
|
||||
if ($entity->get('parentType') === 'Account') {
|
||||
if (in_array($entity->get('parentId'), $accountIdList)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwnContact(User $user, Entity $entity)
|
||||
{
|
||||
$contactId = $user->get('contactId');
|
||||
if ($contactId) {
|
||||
if ($entity->hasAttribute('contactId')) {
|
||||
if ($entity->get('contactId') === $contactId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasRelation('contacts')) {
|
||||
$repository = $this->getEntityManager()->getRepository($entity->getEntityType());
|
||||
if ($repository->isRelated($entity, 'contacts', $contactId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->hasAttribute('parentId') && $entity->hasRelation('parent')) {
|
||||
if ($entity->get('parentType') === 'Contact') {
|
||||
if ($entity->get('parentId') === $contactId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
135
application/Espo/Core/AclPortal/Table.php
Normal file
135
application/Espo/Core/AclPortal/Table.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\AclPortal;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\Entities\Portal;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\Utils\Metadata;
|
||||
use \Espo\Core\Utils\FieldManagerUtil;
|
||||
use \Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
class Table extends \Espo\Core\Acl\Table
|
||||
{
|
||||
protected $type = 'aclPortal';
|
||||
|
||||
protected $portal;
|
||||
|
||||
protected $defaultAclType = 'recordAllOwnNo';
|
||||
|
||||
protected $levelList = ['yes', 'all', 'account', 'contact', 'own', 'no'];
|
||||
|
||||
protected $isStrictModeForced = true;
|
||||
|
||||
public function __construct(User $user, Portal $portal, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManagerUtil $fieldManager = null)
|
||||
{
|
||||
if (empty($portal)) {
|
||||
throw new Error("No portal was passed to AclPortal\\Table constructor.");
|
||||
}
|
||||
$this->portal = $portal;
|
||||
parent::__construct($user, $config, $fileManager, $metadata, $fieldManager);
|
||||
}
|
||||
|
||||
protected function getPortal()
|
||||
{
|
||||
return $this->portal;
|
||||
}
|
||||
|
||||
protected function initCacheFilePath()
|
||||
{
|
||||
$this->cacheFilePath = 'data/cache/application/acl-portal/'.$this->getPortal()->id.'/' . $this->getUser()->id . '.php';
|
||||
}
|
||||
|
||||
protected function getRoleList()
|
||||
{
|
||||
$roleList = [];
|
||||
|
||||
$userRoleList = $this->getUser()->get('portalRoles');
|
||||
if (!(is_array($userRoleList) || $userRoleList instanceof \Traversable)) {
|
||||
throw new Error();
|
||||
}
|
||||
foreach ($userRoleList as $role) {
|
||||
$roleList[] = $role;
|
||||
}
|
||||
|
||||
$portalRoleList = $this->getPortal()->get('portalRoles');
|
||||
if (!(is_array($portalRoleList) || $portalRoleList instanceof \Traversable)) {
|
||||
throw new Error();
|
||||
}
|
||||
foreach ($portalRoleList as $role) {
|
||||
$roleList[] = $role;
|
||||
}
|
||||
|
||||
return $roleList;
|
||||
}
|
||||
|
||||
protected function getScopeWithAclList()
|
||||
{
|
||||
$scopeList = [];
|
||||
$scopes = $this->getMetadata()->get('scopes');
|
||||
foreach ($scopes as $scope => $d) {
|
||||
if (empty($d['acl'])) continue;
|
||||
if (empty($d['aclPortal'])) continue;
|
||||
$scopeList[] = $scope;
|
||||
}
|
||||
return $scopeList;
|
||||
}
|
||||
|
||||
protected function applyDefault(&$table, &$fieldTable)
|
||||
{
|
||||
parent::applyDefault($table, $fieldTable);
|
||||
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
if (!isset($table->$scope)) {
|
||||
$table->$scope = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyDisabled(&$table, &$fieldTable)
|
||||
{
|
||||
foreach ($this->getScopeList() as $scope) {
|
||||
$d = $this->getMetadata()->get('scopes.' . $scope);
|
||||
if (!empty($d['disabled']) || !empty($d['portalDisabled'])) {
|
||||
$table->$scope = false;
|
||||
unset($fieldTable->$scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyAdditional(&$table, &$fieldTable, &$valuePermissionLists)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -33,26 +33,28 @@ class Application
|
||||
{
|
||||
private $metadata;
|
||||
|
||||
private $container;
|
||||
protected $container;
|
||||
|
||||
private $slim;
|
||||
|
||||
private $auth;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->container = new Container();
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
$GLOBALS['log'] = $this->container->get('log');
|
||||
$this->initContainer();
|
||||
|
||||
$GLOBALS['log'] = $this->getContainer()->get('log');
|
||||
|
||||
$this->initAutoloads();
|
||||
}
|
||||
|
||||
protected function initContainer()
|
||||
{
|
||||
$this->container = new Container();
|
||||
}
|
||||
|
||||
public function getSlim()
|
||||
{
|
||||
if (empty($this->slim)) {
|
||||
@@ -69,12 +71,9 @@ class Application
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
protected function getAuth()
|
||||
protected function createAuth()
|
||||
{
|
||||
if (empty($this->auth)) {
|
||||
$this->auth = new \Espo\Core\Utils\Auth($this->container);
|
||||
}
|
||||
return $this->auth;
|
||||
return new \Espo\Core\Utils\Auth($this->container);
|
||||
}
|
||||
|
||||
public function getContainer()
|
||||
@@ -91,19 +90,11 @@ class Application
|
||||
|
||||
public function runClient()
|
||||
{
|
||||
$config = $this->getContainer()->get('config');
|
||||
$themeManager = $this->getContainer()->get('themeManager');
|
||||
|
||||
$html = file_get_contents('main.html');
|
||||
$html = str_replace('{{cacheTimestamp}}', $config->get('cacheTimestamp', 0), $html);
|
||||
$html = str_replace('{{useCache}}', $config->get('useCache') ? 'true' : 'false' , $html);
|
||||
$html = str_replace('{{stylesheet}}', $themeManager->getStylesheet(), $html);
|
||||
$html = str_replace('{{runScript}}', 'app.start();' , $html);
|
||||
echo $html;
|
||||
$this->getContainer()->get('clientManager')->display();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function runEntryPoint($entryPoint)
|
||||
public function runEntryPoint($entryPoint, $data = array(), $final = false)
|
||||
{
|
||||
if (empty($entryPoint)) {
|
||||
throw new \Error();
|
||||
@@ -112,18 +103,27 @@ class Application
|
||||
$slim = $this->getSlim();
|
||||
$container = $this->getContainer();
|
||||
|
||||
$slim->get('/', function() {});
|
||||
$slim->post('/', function() {});
|
||||
$slim->any('.*', function() {});
|
||||
|
||||
$entryPointManager = new \Espo\Core\EntryPointManager($container);
|
||||
|
||||
try {
|
||||
$auth = $this->getAuth();
|
||||
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $entryPointManager->checkAuthRequired($entryPoint), true);
|
||||
$authRequired = $entryPointManager->checkAuthRequired($entryPoint);
|
||||
$authNotStrict = $entryPointManager->checkNotStrictAuth($entryPoint);
|
||||
if ($authRequired && !$authNotStrict) {
|
||||
if (!$final && $portalId = $this->detectedPortalId()) {
|
||||
$app = new \Espo\Core\Portal\Application($portalId);
|
||||
$app->setBasePath($this->getBasePath());
|
||||
$app->runEntryPoint($entryPoint, $data, true);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$auth = new \Espo\Core\Utils\Auth($this->container, $authNotStrict);
|
||||
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $authRequired, true);
|
||||
$slim->add($apiAuth);
|
||||
|
||||
$slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container) {
|
||||
$entryPointManager->run($entryPoint);
|
||||
$slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container, $data) {
|
||||
$entryPointManager->run($entryPoint, $data);
|
||||
});
|
||||
|
||||
$slim->run();
|
||||
@@ -134,8 +134,8 @@ class Application
|
||||
|
||||
public function runCron()
|
||||
{
|
||||
$auth = $this->getAuth();
|
||||
$auth->useNoAuth(true);
|
||||
$auth = $this->createAuth();
|
||||
$auth->useNoAuth();
|
||||
|
||||
$cronManager = new \Espo\Core\CronManager($this->container);
|
||||
$cronManager->run();
|
||||
@@ -164,20 +164,25 @@ class Application
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function createApiAuth($auth)
|
||||
{
|
||||
return new \Espo\Core\Utils\Api\Auth($auth);
|
||||
}
|
||||
|
||||
protected function routeHooks()
|
||||
{
|
||||
$container = $this->getContainer();
|
||||
$slim = $this->getSlim();
|
||||
|
||||
try {
|
||||
$auth = $this->getAuth();
|
||||
$auth = $this->createAuth();
|
||||
} catch (\Exception $e) {
|
||||
$container->get('output')->processError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
|
||||
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth);
|
||||
$this->getSlim()->add($apiAuth);
|
||||
$apiAuth = $this->createApiAuth($auth);
|
||||
|
||||
$this->getSlim()->add($apiAuth);
|
||||
$this->getSlim()->hook('slim.before.dispatch', function () use ($slim, $container) {
|
||||
|
||||
$route = $slim->router()->getCurrentRoute();
|
||||
@@ -218,7 +223,7 @@ class Application
|
||||
}
|
||||
|
||||
try {
|
||||
$controllerManager = new \Espo\Core\ControllerManager($container);
|
||||
$controllerManager = $this->getContainer()->get('controllerManager');
|
||||
$result = $controllerManager->process($controllerName, $actionName, $params, $data, $slim->request());
|
||||
$container->get('output')->render($result);
|
||||
} catch (\Exception $e) {
|
||||
@@ -237,13 +242,19 @@ class Application
|
||||
});
|
||||
}
|
||||
|
||||
protected function initRoutes()
|
||||
protected function getRouteList()
|
||||
{
|
||||
$routes = new \Espo\Core\Utils\Route($this->getContainer()->get('config'), $this->getMetadata(), $this->getContainer()->get('fileManager'));
|
||||
$crudList = array_keys( $this->getContainer()->get('config')->get('crud') );
|
||||
|
||||
foreach ($routes->getAll() as $route) {
|
||||
|
||||
return $routes->getAll();
|
||||
}
|
||||
|
||||
protected function initRoutes()
|
||||
{
|
||||
$crudList = array_keys($this->getContainer()->get('config')->get('crud'));
|
||||
|
||||
foreach ($this->getRouteList() as $route) {
|
||||
$method = strtolower($route['method']);
|
||||
if (!in_array($method, $crudList)) {
|
||||
$GLOBALS['log']->error('Route: Method ['.$method.'] does not exist. Please check your route ['.$route['route'].']');
|
||||
@@ -288,5 +299,38 @@ class Application
|
||||
|
||||
$classLoader->register(true);
|
||||
}
|
||||
|
||||
public function setBasePath($basePath)
|
||||
{
|
||||
$this->getContainer()->get('clientManager')->setBasePath($basePath);
|
||||
}
|
||||
|
||||
public function getBasePath()
|
||||
{
|
||||
return $this->getContainer()->get('clientManager')->getBasePath();
|
||||
}
|
||||
|
||||
public function detectedPortalId()
|
||||
{
|
||||
if (!empty($_GET['portalId'])) {
|
||||
return $_GET['portalId'];
|
||||
}
|
||||
if (!empty($_COOKIE['auth-token'])) {
|
||||
$token = $this->getContainer()->get('entityManager')->getRepository('AuthToken')->where(array('token' => $_COOKIE['auth-token']))->findOne();
|
||||
|
||||
if ($token && $token->get('portalId')) {
|
||||
return $token->get('portalId');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function setupSystemUser()
|
||||
{
|
||||
$user = $this->getContainer()->get('entityManager')->getEntity('User', 'system');
|
||||
$user->set('isAdmin', true);
|
||||
$this->getContainer()->setUser($user);
|
||||
$this->getContainer()->get('entityManager')->setUser($user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -28,6 +28,7 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
class Container
|
||||
{
|
||||
|
||||
@@ -39,7 +40,6 @@ class Container
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function get($name)
|
||||
@@ -47,7 +47,15 @@ class Container
|
||||
if (empty($this->data[$name])) {
|
||||
$this->load($name);
|
||||
}
|
||||
return $this->data[$name];
|
||||
if (isset($this->data[$name])) {
|
||||
return $this->data[$name];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function set($name, $obj)
|
||||
{
|
||||
$this->data[$name] = $obj;
|
||||
}
|
||||
|
||||
private function load($name)
|
||||
@@ -85,6 +93,24 @@ class Container
|
||||
return $className;
|
||||
}
|
||||
|
||||
protected function loadContainer()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function loadSlim()
|
||||
{
|
||||
return new \Espo\Core\Utils\Api\Slim();
|
||||
}
|
||||
|
||||
protected function loadFileStorageManager()
|
||||
{
|
||||
return new \Espo\Core\FileStorage\Manager(
|
||||
$this->get('metadata')->get(['app', 'fileStorage', 'implementationClassNameMap']),
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadLog()
|
||||
{
|
||||
$config = $this->get('config');
|
||||
@@ -110,58 +136,56 @@ class Container
|
||||
return $log;
|
||||
}
|
||||
|
||||
protected function loadContainer()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function loadSlim()
|
||||
{
|
||||
return new \Espo\Core\Utils\Api\Slim();
|
||||
}
|
||||
|
||||
private function loadFileManager()
|
||||
protected function loadFileManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\File\Manager(
|
||||
$this->get('config')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadPreferences()
|
||||
protected function loadControllerManager()
|
||||
{
|
||||
return new \Espo\Core\ControllerManager(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadPreferences()
|
||||
{
|
||||
return $this->get('entityManager')->getEntity('Preferences', $this->get('user')->id);
|
||||
}
|
||||
|
||||
private function loadConfig()
|
||||
protected function loadConfig()
|
||||
{
|
||||
return new \Espo\Core\Utils\Config(
|
||||
new \Espo\Core\Utils\File\Manager()
|
||||
);
|
||||
}
|
||||
|
||||
private function loadHookManager()
|
||||
protected function loadHookManager()
|
||||
{
|
||||
return new \Espo\Core\HookManager(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
private function loadOutput()
|
||||
protected function loadOutput()
|
||||
{
|
||||
return new \Espo\Core\Utils\Api\Output(
|
||||
$this->get('slim')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadMailSender()
|
||||
protected function loadMailSender()
|
||||
{
|
||||
$className = $this->getServiceClassName('mailSernder', '\\Espo\\Core\\Mail\\Sender');
|
||||
return new $className(
|
||||
$this->get('config')
|
||||
$this->get('config'),
|
||||
$this->get('entityManager')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadDateTime()
|
||||
protected function loadDateTime()
|
||||
{
|
||||
return new \Espo\Core\Utils\DateTime(
|
||||
$this->get('config')->get('dateFormat'),
|
||||
@@ -170,48 +194,52 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
private function loadNumber()
|
||||
protected function loadNumber()
|
||||
{
|
||||
return new \Espo\Core\Utils\Number(
|
||||
return new \Espo\Core\Utils\NumberUtil(
|
||||
$this->get('config')->get('decimalMark'),
|
||||
$this->get('config')->get('thousandSeparator')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadServiceFactory()
|
||||
protected function loadServiceFactory()
|
||||
{
|
||||
return new \Espo\Core\ServiceFactory(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
private function loadSelectManagerFactory()
|
||||
protected function loadSelectManagerFactory()
|
||||
{
|
||||
return new \Espo\Core\SelectManagerFactory(
|
||||
$this->get('entityManager'),
|
||||
$this->get('user'),
|
||||
$this->get('acl'),
|
||||
$this->get('metadata')
|
||||
$this->get('aclManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('config'),
|
||||
$this->get('injectableFactory')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadMetadata()
|
||||
protected function loadMetadata()
|
||||
{
|
||||
return new \Espo\Core\Utils\Metadata(
|
||||
$this->get('config'),
|
||||
$this->get('fileManager')
|
||||
$this->get('fileManager'),
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadLayout()
|
||||
protected function loadLayout()
|
||||
{
|
||||
return new \Espo\Core\Utils\Layout(
|
||||
$this->get('fileManager'),
|
||||
$this->get('metadata')
|
||||
$this->get('metadata'),
|
||||
$this->get('user')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadAclManager()
|
||||
protected function loadAclManager()
|
||||
{
|
||||
$className = $this->getServiceClassName('acl', '\\Espo\\Core\\AclManager');
|
||||
return new $className(
|
||||
@@ -219,7 +247,7 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
private function loadAcl()
|
||||
protected function loadAcl()
|
||||
{
|
||||
$className = $this->getServiceClassName('acl', '\\Espo\\Core\\Acl');
|
||||
return new $className(
|
||||
@@ -228,18 +256,28 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
private function loadSchema()
|
||||
protected function loadSchema()
|
||||
{
|
||||
return new \Espo\Core\Utils\Database\Schema\Schema(
|
||||
$this->get('config'),
|
||||
$this->get('metadata'),
|
||||
$this->get('fileManager'),
|
||||
$this->get('entityManager'),
|
||||
$this->get('classParser')
|
||||
$this->get('classParser'),
|
||||
$this->get('ormMetadata')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadClassParser()
|
||||
protected function loadOrmMetadata()
|
||||
{
|
||||
return new \Espo\Core\Utils\Metadata\OrmMetadata(
|
||||
$this->get('metadata'),
|
||||
$this->get('fileManager'),
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadClassParser()
|
||||
{
|
||||
return new \Espo\Core\Utils\File\ClassParser(
|
||||
$this->get('fileManager'),
|
||||
@@ -248,46 +286,72 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
private function loadLanguage()
|
||||
protected function loadLanguage()
|
||||
{
|
||||
return new \Espo\Core\Utils\Language(
|
||||
\Espo\Core\Utils\Language::detectLanguage($this->get('config'), $this->get('preferences')),
|
||||
$this->get('fileManager'),
|
||||
$this->get('config'),
|
||||
$this->get('metadata'),
|
||||
$this->get('preferences')
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadCrypt()
|
||||
protected function loadBaseLanguage()
|
||||
{
|
||||
return new \Espo\Core\Utils\Language(
|
||||
'en_US',
|
||||
$this->get('fileManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadDefaultLanguage()
|
||||
{
|
||||
return new \Espo\Core\Utils\Language(
|
||||
\Espo\Core\Utils\Language::detectLanguage($this->get('config')),
|
||||
$this->get('fileManager'),
|
||||
$this->get('metadata'),
|
||||
$this->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadCrypt()
|
||||
{
|
||||
return new \Espo\Core\Utils\Crypt(
|
||||
$this->get('config')
|
||||
);
|
||||
}
|
||||
|
||||
private function loadScheduledJob()
|
||||
protected function loadScheduledJob()
|
||||
{
|
||||
return new \Espo\Core\Utils\ScheduledJob(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
private function loadDataManager()
|
||||
protected function loadDataManager()
|
||||
{
|
||||
return new \Espo\Core\DataManager(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
private function loadFieldManager()
|
||||
protected function loadFieldManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\FieldManager(
|
||||
$this->get('metadata'),
|
||||
$this->get('language')
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
private function loadThemeManager()
|
||||
protected function loadFieldManagerUtil()
|
||||
{
|
||||
return new \Espo\Core\Utils\FieldManagerUtil(
|
||||
$this->get('metadata')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadThemeManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\ThemeManager(
|
||||
$this->get('config'),
|
||||
@@ -295,9 +359,24 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
public function setUser($user)
|
||||
protected function loadClientManager()
|
||||
{
|
||||
$this->data['user'] = $user;
|
||||
return new \Espo\Core\Utils\ClientManager(
|
||||
$this->get('config'),
|
||||
$this->get('themeManager')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadInjectableFactory()
|
||||
{
|
||||
return new \Espo\Core\InjectableFactory(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
public function setUser(\Espo\Entities\User $user)
|
||||
{
|
||||
$this->set('user', $user);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -60,9 +60,9 @@ class ControllerManager
|
||||
|
||||
public function process($controllerName, $actionName, $params, $data, $request)
|
||||
{
|
||||
$customeClassName = '\\Espo\\Custom\\Controllers\\' . Util::normilizeClassName($controllerName);
|
||||
if (class_exists($customeClassName)) {
|
||||
$controllerClassName = $customeClassName;
|
||||
$customClassName = '\\Espo\\Custom\\Controllers\\' . Util::normilizeClassName($controllerName);
|
||||
if (class_exists($customClassName)) {
|
||||
$controllerClassName = $customClassName;
|
||||
} else {
|
||||
$moduleName = $this->metadata->getScopeModuleName($controllerName);
|
||||
if ($moduleName) {
|
||||
@@ -76,11 +76,6 @@ class ControllerManager
|
||||
$data = json_decode($data);
|
||||
}
|
||||
|
||||
|
||||
if ($data instanceof \stdClass) {
|
||||
$data = get_object_vars($data);
|
||||
}
|
||||
|
||||
if (!class_exists($controllerClassName)) {
|
||||
throw new NotFound("Controller '$controllerName' is not found");
|
||||
}
|
||||
@@ -109,6 +104,13 @@ class ControllerManager
|
||||
throw new NotFound("Action '$actionName' (".$request->getMethod().") does not exist in controller '$controllerName'");
|
||||
}
|
||||
|
||||
// TODO Remove in 5.1.0
|
||||
if ($data instanceof \stdClass) {
|
||||
if ($this->getMetadata()->get(['app', 'deprecatedControllerActions', $controllerName, $primaryActionMethodName])) {
|
||||
$data = get_object_vars($data);
|
||||
}
|
||||
}
|
||||
|
||||
if (method_exists($controller, $beforeMethodName)) {
|
||||
$controller->$beforeMethodName($params, $data, $request);
|
||||
}
|
||||
@@ -119,12 +121,10 @@ class ControllerManager
|
||||
$controller->$afterMethodName($params, $data, $request);
|
||||
}
|
||||
|
||||
if (is_array($result) || is_bool($result)) {
|
||||
if (is_array($result) || is_bool($result) || $result instanceof \StdClass) {
|
||||
return \Espo\Core\Utils\Json::encode($result);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -64,16 +64,16 @@ class Record extends Base
|
||||
return $service;
|
||||
}
|
||||
|
||||
public function actionRead($params)
|
||||
public function actionRead($params, $data, $request)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$entity = $this->getRecordService()->getEntity($id);
|
||||
$entity = $this->getRecordService()->readEntity($id);
|
||||
|
||||
if (empty($entity)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
return $entity->toArray();
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
public function actionPatch($params, $data, $request)
|
||||
@@ -87,14 +87,14 @@ class Record extends Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->check($this->name, 'edit')) {
|
||||
if (!$this->getAcl()->check($this->name, 'create')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$service = $this->getRecordService();
|
||||
|
||||
if ($entity = $service->createEntity($data)) {
|
||||
return $entity->toArray();
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
throw new Error();
|
||||
@@ -113,7 +113,7 @@ class Record extends Base
|
||||
$id = $params['id'];
|
||||
|
||||
if ($entity = $this->getRecordService()->updateEntity($id, $data)) {
|
||||
return $entity->toArray();
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
throw new Error();
|
||||
@@ -128,12 +128,10 @@ class Record extends Base
|
||||
$where = $request->get('where');
|
||||
$offset = $request->get('offset');
|
||||
$maxSize = $request->get('maxSize');
|
||||
$asc = $request->get('asc') === 'true';
|
||||
$asc = $request->get('asc', 'true') === 'true';
|
||||
$sortBy = $request->get('sortBy');
|
||||
$q = $request->get('q');
|
||||
$primaryFilter = $request->get('primaryFilter');
|
||||
$textFilter = $request->get('textFilter');
|
||||
$boolFilterList = $request->get('boolFilterList');
|
||||
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = self::MAX_SIZE_LIMIT;
|
||||
@@ -151,19 +149,70 @@ class Record extends Base
|
||||
'q' => $q,
|
||||
'textFilter' => $textFilter
|
||||
);
|
||||
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$result = $this->getRecordService()->findEntities($params);
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
);
|
||||
}
|
||||
|
||||
public function getActionListKanban($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->check($this->name, 'read')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$where = $request->get('where');
|
||||
$offset = $request->get('offset');
|
||||
$maxSize = $request->get('maxSize');
|
||||
$asc = $request->get('asc', 'true') === 'true';
|
||||
$sortBy = $request->get('sortBy');
|
||||
$q = $request->get('q');
|
||||
$textFilter = $request->get('textFilter');
|
||||
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = self::MAX_SIZE_LIMIT;
|
||||
}
|
||||
if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) {
|
||||
throw new Forbidden("Max should should not exceed " . self::MAX_SIZE_LIMIT . ". Use pagination (offset, limit).");
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'where' => $where,
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
'asc' => $asc,
|
||||
'sortBy' => $sortBy,
|
||||
'q' => $q,
|
||||
'textFilter' => $textFilter
|
||||
);
|
||||
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$result = $this->getRecordService()->getListKanban($params);
|
||||
|
||||
return (object) [
|
||||
'total' => $result->total,
|
||||
'list' => $result->collection->getValueMapList(),
|
||||
'additionalData' => $result->additionalData
|
||||
];
|
||||
}
|
||||
|
||||
protected function fetchListParamsFromRequest(&$params, $request, $data)
|
||||
{
|
||||
if ($request->get('primaryFilter')) {
|
||||
$params['primaryFilter'] = $request->get('primaryFilter');
|
||||
}
|
||||
if ($request->get('boolFilterList')) {
|
||||
$params['boolFilterList'] = $request->get('boolFilterList');
|
||||
}
|
||||
|
||||
$result = $this->getRecordService()->findEntities($params);
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
|
||||
);
|
||||
if ($request->get('filterList')) {
|
||||
$params['filterList'] = $request->get('filterList');
|
||||
}
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
@@ -174,7 +223,7 @@ class Record extends Base
|
||||
$where = $request->get('where');
|
||||
$offset = $request->get('offset');
|
||||
$maxSize = $request->get('maxSize');
|
||||
$asc = $request->get('asc') === 'true';
|
||||
$asc = $request->get('asc', 'true') === 'true';
|
||||
$sortBy = $request->get('sortBy');
|
||||
$q = $request->get('q');
|
||||
$textFilter = $request->get('textFilter');
|
||||
@@ -195,18 +244,14 @@ class Record extends Base
|
||||
'q' => $q,
|
||||
'textFilter' => $textFilter
|
||||
);
|
||||
if ($request->get('primaryFilter')) {
|
||||
$params['primaryFilter'] = $request->get('primaryFilter');
|
||||
}
|
||||
if ($request->get('boolFilterList')) {
|
||||
$params['boolFilterList'] = $request->get('boolFilterList');
|
||||
}
|
||||
|
||||
$this->fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$result = $this->getRecordService()->findLinkedEntities($id, $link, $params);
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
);
|
||||
}
|
||||
|
||||
@@ -226,25 +271,47 @@ class Record extends Base
|
||||
|
||||
public function actionExport($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if ($this->getConfig()->get('exportDisabled') && !$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if ($this->getAcl()->get('exportPermission') !== 'yes' && !$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->check($this->name, 'read')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$ids = $request->get('ids');
|
||||
$where = $request->get('where');
|
||||
$byWhere = $request->get('byWhere');
|
||||
$ids = isset($data->ids) ? $data->ids : null;
|
||||
$where = isset($data->where) ? json_decode(json_encode($data->where), true) : null;
|
||||
$byWhere = isset($data->byWhere) ? $data->byWhere : false;
|
||||
$selectData = isset($data->selectData) ? json_decode(json_encode($data->selectData), true) : null;
|
||||
|
||||
$params = array();
|
||||
if ($byWhere) {
|
||||
$params['selectData'] = $selectData;
|
||||
$params['where'] = $where;
|
||||
} else {
|
||||
$params['ids'] = $ids;
|
||||
}
|
||||
|
||||
if (isset($data->attributeList)) {
|
||||
$params['attributeList'] = $data->attributeList;
|
||||
}
|
||||
|
||||
if (isset($data->fieldList)) {
|
||||
$params['fieldList'] = $data->fieldList;
|
||||
}
|
||||
|
||||
if (isset($data->format)) {
|
||||
$params['format'] = $data->format;
|
||||
}
|
||||
|
||||
return array(
|
||||
'id' => $this->getRecordService()->export($params)
|
||||
);
|
||||
@@ -259,18 +326,21 @@ class Record extends Base
|
||||
if (!$this->getAcl()->check($this->name, 'edit')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
if (empty($data['attributes'])) {
|
||||
if (empty($data->attributes)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
if (array_key_exists('where', $data) && !empty($data['byWhere'])) {
|
||||
$params['where'] = json_decode(json_encode($data['where']), true);
|
||||
} else if (array_key_exists('ids', $data)) {
|
||||
$params['ids'] = $data['ids'];
|
||||
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;
|
||||
}
|
||||
|
||||
$attributes = $data['attributes'];
|
||||
$attributes = $data->attributes;
|
||||
|
||||
$idsUpdated = $this->getRecordService()->massUpdate($attributes, $params);
|
||||
|
||||
@@ -287,18 +357,18 @@ class Record extends Base
|
||||
}
|
||||
|
||||
$params = array();
|
||||
if (array_key_exists('where', $data) && !empty($data['byWhere'])) {
|
||||
$where = json_decode(json_encode($data['where']), true);
|
||||
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 (array_key_exists('ids', $data)) {
|
||||
$where = json_decode(json_encode($data['where']), true);
|
||||
$params['ids'] = $data['ids'];
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
$idsRemoved = $this->getRecordService()->massRemove($params);
|
||||
|
||||
return $idsRemoved;
|
||||
return $this->getRecordService()->massRemove($params);
|
||||
}
|
||||
|
||||
public function actionCreateLink($params, $data, $request)
|
||||
@@ -314,25 +384,31 @@ class Record extends Base
|
||||
$id = $params['id'];
|
||||
$link = $params['link'];
|
||||
|
||||
if (!empty($data['massRelate'])) {
|
||||
if (!is_array($data['where'])) {
|
||||
if (!empty($data->massRelate)) {
|
||||
if (!is_array($data->where)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$where = json_decode(json_encode($data['where']), true);
|
||||
return $this->getRecordService()->linkEntityMass($id, $link, $where);
|
||||
} else {
|
||||
$foreignIds = array();
|
||||
if (isset($data['id'])) {
|
||||
$foreignIds[] = $data['id'];
|
||||
$where = json_decode(json_encode($data->where), true);
|
||||
|
||||
$selectData = null;
|
||||
if (isset($data->selectData) && is_array($data->selectData)) {
|
||||
$selectData = json_decode(json_encode($data->selectData), true);
|
||||
}
|
||||
if (isset($data['ids']) && is_array($data['ids'])) {
|
||||
foreach ($data['ids'] as $foreignId) {
|
||||
$foreignIds[] = $foreignId;
|
||||
|
||||
return $this->getRecordService()->linkEntityMass($id, $link, $where, $selectData);
|
||||
} else {
|
||||
$foreignIdList = array();
|
||||
if (isset($data->id)) {
|
||||
$foreignIdList[] = $data->id;
|
||||
}
|
||||
if (isset($data->ids) && is_array($data->ids)) {
|
||||
foreach ($data->ids as $foreignId) {
|
||||
$foreignIdList[] = $foreignId;
|
||||
}
|
||||
}
|
||||
|
||||
$result = false;
|
||||
foreach ($foreignIds as $foreignId) {
|
||||
foreach ($foreignIdList as $foreignId) {
|
||||
if ($this->getRecordService()->linkEntity($id, $link, $foreignId)) {
|
||||
$result = true;
|
||||
}
|
||||
@@ -358,18 +434,18 @@ class Record extends Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$foreignIds = array();
|
||||
if (isset($data['id'])) {
|
||||
$foreignIds[] = $data['id'];
|
||||
$foreignIdList = [];
|
||||
if (isset($data->id)) {
|
||||
$foreignIdList[] = $data->id;
|
||||
}
|
||||
if (isset($data['ids']) && is_array($data['ids'])) {
|
||||
foreach ($data['ids'] as $foreignId) {
|
||||
$foreignIds[] = $foreignId;
|
||||
if (isset($data->ids) && is_array($data->ids)) {
|
||||
foreach ($data->ids as $foreignId) {
|
||||
$foreignIdList[] = $foreignId;
|
||||
}
|
||||
}
|
||||
|
||||
$result = false;
|
||||
foreach ($foreignIds as $foreignId) {
|
||||
foreach ($foreignIdList as $foreignId) {
|
||||
if ($this->getRecordService()->unlinkEntity($id, $link, $foreignId)) {
|
||||
$result = $result || true;
|
||||
}
|
||||
@@ -386,7 +462,7 @@ class Record extends Base
|
||||
if (!$request->isPut()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (!$this->getAcl()->check($this->name, 'read')) {
|
||||
if (!$this->getAcl()->check($this->name, 'stream')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
$id = $params['id'];
|
||||
@@ -411,17 +487,59 @@ class Record extends Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (empty($data['targetId']) || empty($data['sourceIds']) || !is_array($data['sourceIds'])) {
|
||||
if (empty($data->targetId) || empty($data->sourceIds) || !is_array($data->sourceIds) || !($data->attributes instanceof \StdClass)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$targetId = $data['targetId'];
|
||||
$sourceIds = $data['sourceIds'];
|
||||
$targetId = $data->targetId;
|
||||
$sourceIds = $data->sourceIds;
|
||||
$attributes = $data->attributes;
|
||||
|
||||
if (!$this->getAcl()->check($this->name, 'edit')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->merge($targetId, $sourceIds);
|
||||
return $this->getRecordService()->merge($targetId, $sourceIds, $attributes);
|
||||
}
|
||||
|
||||
public function postActionGetDuplicateAttributes($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->check($this->name, 'create')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
if (!$this->getAcl()->check($this->name, 'read')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->getDuplicateAttributes($data->id);
|
||||
}
|
||||
|
||||
public function postActionMassFollow($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->check($this->name, 'stream')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massFollow($params);
|
||||
}
|
||||
|
||||
public function postActionMassUnfollow($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->check($this->name, 'stream')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (property_exists($data, 'ids')) {
|
||||
$params['ids'] = $data->ids;
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massUnfollow($params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -37,7 +37,6 @@ use \Espo\Core\Utils\Util;
|
||||
|
||||
class RecordTree extends Record
|
||||
{
|
||||
|
||||
public static $defaultAction = 'list';
|
||||
|
||||
protected $defaultRecordServiceName = 'RecordTree';
|
||||
@@ -51,14 +50,26 @@ class RecordTree extends Record
|
||||
$where = $request->get('where');
|
||||
$parentId = $request->get('parentId');
|
||||
$maxDepth = $request->get('maxDepth');
|
||||
$onlyNotEmpty = $request->get('onlyNotEmpty');
|
||||
|
||||
$collection = $this->getRecordService()->getTree($parentId, array(
|
||||
'where' => $where
|
||||
'where' => $where,
|
||||
'onlyNotEmpty' => $onlyNotEmpty
|
||||
), 0, $maxDepth);
|
||||
return array(
|
||||
'list' => $collection->toArray(),
|
||||
'path' => $this->getRecordService()->getTreeItemPath($parentId)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function getActionLastChildrenIdList($params, $data, $request)
|
||||
{
|
||||
if (!$this->getAcl()->check($this->name, 'read')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$parentId = $request->get('parentId');
|
||||
|
||||
return $this->getRecordService()->getLastChildrenIdList($parentId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -35,15 +35,25 @@ use Espo\Core\Exceptions\NotFound;
|
||||
class CronManager
|
||||
{
|
||||
private $container;
|
||||
|
||||
private $config;
|
||||
|
||||
private $fileManager;
|
||||
|
||||
private $entityManager;
|
||||
|
||||
private $scheduledJobUtil;
|
||||
|
||||
private $cronJobUtil;
|
||||
|
||||
private $cronScheduledJobUtil;
|
||||
|
||||
const PENDING = 'Pending';
|
||||
|
||||
const RUNNING = 'Running';
|
||||
|
||||
const SUCCESS = 'Success';
|
||||
|
||||
const FAILED = 'Failed';
|
||||
|
||||
protected $lastRunTime = 'data/cache/application/cronLastRunTime.php';
|
||||
@@ -58,8 +68,8 @@ class CronManager
|
||||
$this->serviceFactory = $this->container->get('serviceFactory');
|
||||
|
||||
$this->scheduledJobUtil = $this->container->get('scheduledJob');
|
||||
$this->cronJob = new \Espo\Core\Utils\Cron\Job($this->config, $this->entityManager);
|
||||
$this->cronScheduledJob = new \Espo\Core\Utils\Cron\ScheduledJob($this->config, $this->entityManager);
|
||||
$this->cronJobUtil = new \Espo\Core\Utils\Cron\Job($this->config, $this->entityManager);
|
||||
$this->cronScheduledJobUtil = new \Espo\Core\Utils\Cron\ScheduledJob($this->config, $this->entityManager);
|
||||
}
|
||||
|
||||
protected function getContainer()
|
||||
@@ -92,23 +102,24 @@ class CronManager
|
||||
return $this->scheduledJobUtil;
|
||||
}
|
||||
|
||||
protected function getCronJob()
|
||||
protected function getCronJobUtil()
|
||||
{
|
||||
return $this->cronJob;
|
||||
return $this->cronJobUtil;
|
||||
}
|
||||
|
||||
protected function getCronScheduledJob()
|
||||
protected function getCronScheduledJobUtil()
|
||||
{
|
||||
return $this->cronScheduledJob;
|
||||
return $this->cronScheduledJobUtil;
|
||||
}
|
||||
|
||||
protected function getLastRunTime()
|
||||
{
|
||||
$lastRunData = $this->getFileManager()->getPhpContents($this->lastRunTime);
|
||||
|
||||
$lastRunTime = time() - intval($this->getConfig()->get('cron.minExecutionTime')) - 1;
|
||||
if (is_array($lastRunData) && !empty($lastRunData['time'])) {
|
||||
$lastRunTime = $lastRunData['time'];
|
||||
} else {
|
||||
$lastRunTime = time() - intval($this->getConfig()->get('cronMinInterval', 0)) - 1;
|
||||
}
|
||||
|
||||
return $lastRunTime;
|
||||
@@ -126,9 +137,9 @@ class CronManager
|
||||
{
|
||||
$currentTime = time();
|
||||
$lastRunTime = $this->getLastRunTime();
|
||||
$minTime = $this->getConfig()->get('cron.minExecutionTime');
|
||||
$cronMinInterval = $this->getConfig()->get('cronMinInterval', 0);
|
||||
|
||||
if ($currentTime > ($lastRunTime + $minTime) ) {
|
||||
if ($currentTime > ($lastRunTime + $cronMinInterval)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -149,63 +160,69 @@ class CronManager
|
||||
|
||||
$this->setLastRunTime(time());
|
||||
|
||||
$entityManager = $this->getEntityManager();
|
||||
|
||||
$cronJob = $this->getCronJob();
|
||||
$cronScheduledJob = $this->getCronScheduledJob();
|
||||
|
||||
//Check scheduled jobs and create related jobs
|
||||
$this->getCronJobUtil()->markFailedJobs();
|
||||
$this->getCronJobUtil()->updateFailedJobAttempts();
|
||||
$this->createJobsFromScheduledJobs();
|
||||
$this->getCronJobUtil()->removePendingJobDuplicates();
|
||||
|
||||
$pendingJobs = $cronJob->getPendingJobs();
|
||||
$pendingJobList = $this->getCronJobUtil()->getPendingJobList();
|
||||
|
||||
foreach ($pendingJobs as $job) {
|
||||
foreach ($pendingJobList as $job) {
|
||||
$skip = false;
|
||||
$this->getEntityManager()->getPdo()->query('LOCK TABLES `job` WRITE');
|
||||
if ($this->getCronJobUtil()->isJobPending($job->id)) {
|
||||
if ($job->get('scheduledJobId')) {
|
||||
if ($this->getCronJobUtil()->isScheduledJobRunning($job->get('scheduledJobId'), $job->get('targetId'), $job->get('targetType'))) {
|
||||
$skip = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$skip = true;
|
||||
}
|
||||
|
||||
$jobEntity = $entityManager->getEntity('Job', $job['id']);
|
||||
|
||||
if (!isset($jobEntity)) {
|
||||
$GLOBALS['log']->error('CronManager: empty Job entity ['.$job['id'].'].');
|
||||
if ($skip) {
|
||||
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
|
||||
continue;
|
||||
}
|
||||
|
||||
$jobEntity->set('status', self::RUNNING);
|
||||
$entityManager->saveEntity($jobEntity);
|
||||
$job->set('status', self::RUNNING);
|
||||
$job->set('pid', $this->getCronJobUtil()->getPid());
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
|
||||
|
||||
$isSuccess = true;
|
||||
$skipLog = false;
|
||||
|
||||
try {
|
||||
if (!empty($job['scheduled_job_id'])) {
|
||||
if ($job->get('scheduledJobId')) {
|
||||
$this->runScheduledJob($job);
|
||||
} else {
|
||||
$this->runService($job);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$isSuccess = false;
|
||||
$GLOBALS['log']->error('CronManager: Failed job running, job ['.$job['id'].']. Error Details: '.$e->getMessage());
|
||||
if ($e->getCode() === -1) {
|
||||
$job->set('attempts', 0);
|
||||
$skipLog = true;
|
||||
} else {
|
||||
$GLOBALS['log']->error('CronManager: Failed job running, job ['.$job->id.']. Error Details: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$status = $isSuccess ? self::SUCCESS : self::FAILED;
|
||||
|
||||
$jobEntity->set('status', $status);
|
||||
$entityManager->saveEntity($jobEntity);
|
||||
$job->set('status', $status);
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
|
||||
//set status in the schedulerJobLog
|
||||
if (!empty($job['scheduled_job_id'])) {
|
||||
$cronScheduledJob->addLogRecord($job['scheduled_job_id'], $status);
|
||||
if ($job->get('scheduledJobId') && !$skipLog) {
|
||||
$this->getCronScheduledJobUtil()->addLogRecord($job->get('scheduledJobId'), $status, null, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run Scheduled Job
|
||||
*
|
||||
* @param array $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function runScheduledJob(array $job)
|
||||
protected function runScheduledJob($job)
|
||||
{
|
||||
$jobName = $job['method'];
|
||||
$jobName = $job->get('scheduledJobJob');
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($jobName);
|
||||
if ($className === false) {
|
||||
@@ -213,12 +230,18 @@ class CronManager
|
||||
}
|
||||
|
||||
$jobClass = new $className($this->container);
|
||||
$method = $this->getScheduledJobUtil()->getMethodName();
|
||||
$method = 'run';
|
||||
if (!method_exists($jobClass, $method)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$jobClass->$method();
|
||||
$data = null;
|
||||
|
||||
if ($job->get('data')) {
|
||||
$data = $job->get('data');
|
||||
}
|
||||
|
||||
$jobClass->$method($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -228,85 +251,94 @@ class CronManager
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function runService(array $job)
|
||||
protected function runService($job)
|
||||
{
|
||||
$serviceName = $job['service_name'];
|
||||
$serviceName = $job->get('serviceName');
|
||||
|
||||
if (!$serviceName) {
|
||||
throw new Error('Job with empty serviceName.');
|
||||
}
|
||||
|
||||
if (!$this->getServiceFactory()->checkExists($serviceName)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$service = $this->getServiceFactory()->create($serviceName);
|
||||
$serviceMethod = $job['method'];
|
||||
|
||||
if (!method_exists($service, $serviceMethod)) {
|
||||
$methodNameDeprecated = $job->get('method');
|
||||
$methodName = $job->get('methodName');
|
||||
|
||||
$isDeprecated = false;
|
||||
if (!$methodName) {
|
||||
$isDeprecated = true;
|
||||
$methodName = $methodNameDeprecated;
|
||||
}
|
||||
|
||||
if (!$methodName) {
|
||||
throw new Error('Job with empty methodName.');
|
||||
}
|
||||
|
||||
if (!method_exists($service, $methodName)) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$data = $job['data'];
|
||||
if (Json::isJSON($data)) {
|
||||
$data = Json::decode($data, true);
|
||||
$data = $job->get('data');
|
||||
|
||||
if ($isDeprecated) {
|
||||
$data = Json::decode(Json::encode($data), true);
|
||||
}
|
||||
|
||||
$service->$serviceMethod($data);
|
||||
$service->$methodName($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check scheduled jobs and create related jobs
|
||||
*
|
||||
* @return array List of created Jobs
|
||||
*/
|
||||
protected function createJobsFromScheduledJobs()
|
||||
{
|
||||
$entityManager = $this->getEntityManager();
|
||||
$activeScheduledJobList = $this->getCronScheduledJobUtil()->getActiveScheduledJobList();
|
||||
|
||||
$activeScheduledJobs = $this->getCronScheduledJob()->getActiveJobs();
|
||||
$runningScheduledJobIdList = $this->getCronJobUtil()->getRunningScheduledJobIdList();
|
||||
|
||||
$cronJob = $this->getCronJob();
|
||||
$runningScheduledJobs = $cronJob->getActiveJobs('scheduled_job_id', self::RUNNING, PDO::FETCH_COLUMN);
|
||||
|
||||
$createdJobs = array();
|
||||
foreach ($activeScheduledJobs as $scheduledJob) {
|
||||
|
||||
if (in_array($scheduledJob['id'], $runningScheduledJobs)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$scheduling = $scheduledJob['scheduling'];
|
||||
|
||||
$cronExpression = \Cron\CronExpression::factory($scheduling);
|
||||
$createdJobIdList = array();
|
||||
foreach ($activeScheduledJobList as $scheduledJob) {
|
||||
$scheduling = $scheduledJob->get('scheduling');
|
||||
|
||||
try {
|
||||
$prevDate = $cronExpression->getPreviousRunDate()->format('Y-m-d H:i:s');
|
||||
$cronExpression = \Cron\CronExpression::factory($scheduling);
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager: ScheduledJob ['.$scheduledJob['id'].']: CronExpression - Impossible CRON expression ['.$scheduling.']');
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Scheduling string error - '. $e->getMessage() . '.');
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($cronExpression->isDue()) {
|
||||
$prevDate = date('Y-m-d H:i:s');
|
||||
try {
|
||||
$nextDate = $cronExpression->getNextRunDate()->format('Y-m-d H:i:s');
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Unsupported CRON expression ['.$scheduling.']');
|
||||
continue;
|
||||
}
|
||||
|
||||
$existsJob = $cronJob->getJobByScheduledJob($scheduledJob['id'], $prevDate);
|
||||
$existingJob = $this->getCronJobUtil()->getJobByScheduledJob($scheduledJob->id, $nextDate);
|
||||
if ($existingJob) continue;
|
||||
|
||||
if (!isset($existsJob) || empty($existsJob)) {
|
||||
//create a new job
|
||||
$jobEntity = $entityManager->getEntity('Job');
|
||||
$jobEntity->set(array(
|
||||
'name' => $scheduledJob['name'],
|
||||
'status' => self::PENDING,
|
||||
'scheduledJobId' => $scheduledJob['id'],
|
||||
'executeTime' => $prevDate,
|
||||
'method' => $scheduledJob['job'],
|
||||
));
|
||||
$jobEntityId = $entityManager->saveEntity($jobEntity);
|
||||
if (!empty($jobEntityId)) {
|
||||
$createdJobs[] = $jobEntityId;
|
||||
$className = $this->getScheduledJobUtil()->get($scheduledJob->get('job'));
|
||||
if ($className) {
|
||||
if (method_exists($className, 'prepare')) {
|
||||
$implementation = new $className($this->container);
|
||||
$implementation->prepare($scheduledJob, $nextDate);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $createdJobs;
|
||||
if (in_array($scheduledJob->id, $runningScheduledJobIdList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$jobEntity = $this->getEntityManager()->getEntity('Job');
|
||||
$jobEntity->set(array(
|
||||
'name' => $scheduledJob->get('name'),
|
||||
'status' => self::PENDING,
|
||||
'scheduledJobId' => $scheduledJob->id,
|
||||
'executeTime' => $nextDate
|
||||
));
|
||||
$this->getEntityManager()->saveEntity($jobEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -28,6 +28,7 @@
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core;
|
||||
|
||||
class DataManager
|
||||
{
|
||||
private $container;
|
||||
@@ -58,6 +59,8 @@ class DataManager
|
||||
|
||||
$result &= $this->rebuildDatabase($entityList);
|
||||
|
||||
$this->rebuildScheduledJobs();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -113,11 +116,49 @@ class DataManager
|
||||
|
||||
$metadata->init(true);
|
||||
|
||||
$ormMeta = $metadata->getOrmMetadata(true);
|
||||
$ormData = $this->getContainer()->get('ormMetadata')->getData(true);
|
||||
|
||||
$this->updateCacheTimestamp();
|
||||
|
||||
return empty($ormMeta) ? false : true;
|
||||
return empty($ormData) ? false : true;
|
||||
}
|
||||
|
||||
public function rebuildScheduledJobs()
|
||||
{
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
$entityManager = $this->getContainer()->get('entityManager');
|
||||
|
||||
$jobs = $metadata->get(['entityDefs', 'ScheduledJob', 'jobs'], array());
|
||||
|
||||
foreach ($jobs as $jobName => $defs) {
|
||||
if ($jobName && !empty($defs['isSystem']) && !empty($defs['scheduling'])) {
|
||||
if (!$entityManager->getRepository('ScheduledJob')->where(array(
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling']
|
||||
))->findOne()) {
|
||||
$job = $entityManager->getRepository('ScheduledJob')->where(array(
|
||||
'job' => $jobName
|
||||
))->findOne();
|
||||
if ($job) {
|
||||
$entityManager->removeEntity($job);
|
||||
}
|
||||
$name = $jobName;
|
||||
if (!empty($defs['name'])) {
|
||||
$name = $defs['name'];
|
||||
}
|
||||
$job = $entityManager->getEntity('ScheduledJob');
|
||||
$job->set(array(
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling'],
|
||||
'isInternal' => true,
|
||||
'name' => $name
|
||||
));
|
||||
$entityManager->saveEntity($job);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -81,7 +81,16 @@ class EntryPointManager
|
||||
return $className::$authRequired;
|
||||
}
|
||||
|
||||
public function run($name)
|
||||
public function checkNotStrictAuth($name)
|
||||
{
|
||||
$className = $this->getClassName($name);
|
||||
if (!$className) {
|
||||
throw new NotFound();
|
||||
}
|
||||
return $className::$notStrictAuth;
|
||||
}
|
||||
|
||||
public function run($name, $data = array())
|
||||
{
|
||||
$className = $this->getClassName($name);
|
||||
if (!$className) {
|
||||
@@ -89,7 +98,7 @@ class EntryPointManager
|
||||
}
|
||||
$entryPoint = new $className($this->container);
|
||||
|
||||
$entryPoint->run();
|
||||
$entryPoint->run($data);
|
||||
}
|
||||
|
||||
protected function getClassName($name)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -39,6 +39,8 @@ abstract class Base
|
||||
|
||||
public static $authRequired = true;
|
||||
|
||||
public static $notStrictAuth = false;
|
||||
|
||||
protected function getContainer()
|
||||
{
|
||||
return $this->container;
|
||||
@@ -94,12 +96,15 @@ abstract class Base
|
||||
return $this->getContainer()->get('language');
|
||||
}
|
||||
|
||||
protected function getClientManager()
|
||||
{
|
||||
return $this->getContainer()->get('clientManager');
|
||||
}
|
||||
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
abstract public function run();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
98
application/Espo/Core/Export/Csv.php
Normal file
98
application/Espo/Core/Export/Csv.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\Export;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
use \Espo\Core\ORM\Entity;
|
||||
|
||||
class Csv extends \Espo\Core\Injectable
|
||||
{
|
||||
protected $dependencyList = [
|
||||
'config',
|
||||
'preferences',
|
||||
'metadata'
|
||||
];
|
||||
|
||||
public function loadAdditionalFields(Entity $entity, $fieldList)
|
||||
{
|
||||
foreach ($fieldList as $field) {
|
||||
if ($this->getInjection('metadata')->get(['entityDefs', $entity->getEntityType(), 'fields', $field, 'type']) === 'linkMultiple') {
|
||||
if (!$entity->has($field . 'Ids')) {
|
||||
$entity->loadLinkMultipleField($field);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function process($entityType, $params, $dataList)
|
||||
{
|
||||
if (!is_array($params['attributeList'])) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
$dataList = $this->prepareDataList($dataList);
|
||||
|
||||
$attributeList = $params['attributeList'];
|
||||
|
||||
$delimiter = $this->getInjection('preferences')->get('exportDelimiter');
|
||||
if (empty($delimiter)) {
|
||||
$delimiter = $this->getInjection('config')->get('exportDelimiter', ';');
|
||||
}
|
||||
|
||||
$fp = fopen('php://temp', 'w');
|
||||
fputcsv($fp, $attributeList, $delimiter);
|
||||
foreach ($dataList as $row) {
|
||||
fputcsv($fp, $row, $delimiter);
|
||||
}
|
||||
rewind($fp);
|
||||
$csv = stream_get_contents($fp);
|
||||
fclose($fp);
|
||||
|
||||
return $csv;
|
||||
}
|
||||
|
||||
protected function prepareDataList($dataList)
|
||||
{
|
||||
$prepareDataList = [];
|
||||
foreach ($dataList as $row) {
|
||||
$preparedRow = [];
|
||||
foreach ($row as $item) {
|
||||
if (is_array($item) || is_object($item)) {
|
||||
$item = \Espo\Core\Utils\Json::encode($item);
|
||||
}
|
||||
$preparedRow[] = $item;
|
||||
}
|
||||
$prepareDataList[] = $preparedRow;
|
||||
}
|
||||
|
||||
return $prepareDataList;
|
||||
}
|
||||
}
|
||||
606
application/Espo/Core/Export/Xlsx.php
Normal file
606
application/Espo/Core/Export/Xlsx.php
Normal file
@@ -0,0 +1,606 @@
|
||||
<?php
|
||||
/************************************************************************
|
||||
* 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
|
||||
*
|
||||
* 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\Export;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Xlsx extends \Espo\Core\Injectable
|
||||
{
|
||||
protected $dependencyList = [
|
||||
'language',
|
||||
'metadata',
|
||||
'config',
|
||||
'dateTime',
|
||||
'entityManager',
|
||||
'fileStorageManager',
|
||||
'fileManager'
|
||||
];
|
||||
|
||||
protected function getConfig()
|
||||
{
|
||||
return $this->getInjection('config');
|
||||
}
|
||||
|
||||
protected function getMetadata()
|
||||
{
|
||||
return $this->getInjection('metadata');
|
||||
}
|
||||
|
||||
protected function getEntityManager()
|
||||
{
|
||||
return $this->getInjection('entityManager');
|
||||
}
|
||||
|
||||
public function loadAdditionalFields(Entity $entity, $fieldList)
|
||||
{
|
||||
foreach ($entity->getRelationList() as $link) {
|
||||
if ($entity->getRelationType($link) === 'belongsToParent') {
|
||||
if (in_array($link, $fieldList)) {
|
||||
$parent = $entity->get($link);
|
||||
if ($parent instanceof Entity) {
|
||||
$entity->set($link . 'Name', $parent->get('name'));
|
||||
}
|
||||
}
|
||||
} else if ($entity->getRelationType($link) === 'belongsTo' && $entity->getRelationParam($link, 'noJoin') && $entity->hasField($link . 'Name')) {
|
||||
if (in_array($link, $fieldList)) {
|
||||
$related = $entity->get($link);
|
||||
if ($related instanceof Entity) {
|
||||
$entity->set($link . 'Name', $related->get('name'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($fieldList as $field) {
|
||||
if ($this->getMetadata()->get(['entityDefs', $entity->getEntityType(), 'fields', $field, 'type']) === 'linkMultiple') {
|
||||
if (!$entity->has($field . 'Ids')) {
|
||||
$entity->loadLinkMultipleField($field);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function filterFieldList($entityType, $fieldList, $exportAllFields)
|
||||
{
|
||||
if ($exportAllFields) {
|
||||
foreach ($fieldList as $i => $field) {
|
||||
$type = $this->getMetadata()->get(['entityDefs', $entityType, 'fields', $field, 'type']);
|
||||
if (in_array($type, ['linkMultiple', 'attachmentMultiple'])) {
|
||||
unset($fieldList[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array_values($fieldList);
|
||||
}
|
||||
|
||||
public function addAdditionalAttributes($entityType, &$attributeList, $fieldList)
|
||||
{
|
||||
$linkList = [];
|
||||
|
||||
if (!in_array('id', $attributeList)) {
|
||||
$attributeList[] = 'id';
|
||||
}
|
||||
|
||||
$linkDefs = $this->getMetadata()->get(['entityDefs', $entityType, 'links']);
|
||||
if (is_array($linkDefs)) {
|
||||
foreach ($linkDefs as $link => $defs) {
|
||||
if (empty($defs['type'])) continue;
|
||||
if ($defs['type'] === 'belongsToParent') {
|
||||
$linkList[] = $link;
|
||||
} else if ($defs['type'] === 'belongsTo' && !empty($defs['noJoin'])) {
|
||||
if ($this->getMetadata()->get(['entityDefs', $entityType, 'fields', $link])) {
|
||||
$linkList[] = $link;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($linkList as $item) {
|
||||
if (in_array($item, $fieldList) && !in_array($item . 'Name', $attributeList)) {
|
||||
$attributeList[] = $item . 'Name';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fieldList as $field) {
|
||||
$type = $this->getMetadata()->get(['entityDefs', $entityType, 'fields', $field, 'type']);
|
||||
if ($type === 'currencyConverted') {
|
||||
if (!in_array($field, $attributeList)) {
|
||||
$attributeList[] = $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function process($entityType, $params, $dataList)
|
||||
{
|
||||
if (!is_array($params['fieldList'])) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
$phpExcel = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||
$sheet = $phpExcel->setActiveSheetIndex(0);
|
||||
|
||||
if (isset($params['exportName'])) {
|
||||
$exportName = $params['exportName'];
|
||||
} else {
|
||||
$exportName = $this->getInjection('language')->translate($entityType, 'scopeNamesPlural');
|
||||
}
|
||||
|
||||
$sheetName = mb_substr($exportName, 0, 30, 'utf-8');
|
||||
$badCharList = ['*', ':', '/', '\\', '?', '[', ']'];
|
||||
foreach ($badCharList as $badChar) {
|
||||
$sheetName = str_replace($badCharList, ' ', $sheetName);
|
||||
}
|
||||
$sheetName = str_replace('\'', '', $sheetName);
|
||||
|
||||
$sheet->setTitle($sheetName);
|
||||
|
||||
$fieldList = $params['fieldList'];
|
||||
|
||||
$titleStyle = array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 12
|
||||
)
|
||||
);
|
||||
$dateStyle = array(
|
||||
'font' => array(
|
||||
'size' => 12
|
||||
)
|
||||
);
|
||||
|
||||
$now = new \DateTime();
|
||||
$now->setTimezone(new \DateTimeZone($this->getInjection('config')->get('timeZone', 'UTC')));
|
||||
|
||||
$sheet->setCellValue('A1', $exportName);
|
||||
$sheet->setCellValue('B1', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($now->format('Y-m-d H:i:s'))));
|
||||
|
||||
$sheet->getStyle('A1')->applyFromArray($titleStyle);
|
||||
$sheet->getStyle('B1')->applyFromArray($dateStyle);
|
||||
|
||||
$sheet->getStyle('B1')->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateTimeFormat());
|
||||
|
||||
$azRange = range('A', 'Z');
|
||||
$azRangeCopied = $azRange;
|
||||
foreach ($azRangeCopied as $i => $char1) {
|
||||
foreach ($azRangeCopied as $j => $char2) {
|
||||
$azRange[] = $char1 . $char2;
|
||||
if ($i * count($azRangeCopied) + $j === count($fieldList)) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rowNumber = 3;
|
||||
|
||||
$linkColList = [];
|
||||
|
||||
$lastIndex = 0;
|
||||
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
|
||||
$defs = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name]);
|
||||
|
||||
if (!$defs) {
|
||||
$defs['type'] = 'base';
|
||||
}
|
||||
|
||||
$label = $name;
|
||||
if (strpos($name, '_') !== false) {
|
||||
list($linkName, $foreignField) = explode('_', $name);
|
||||
$foreignScope = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'links', $linkName, 'entity']);
|
||||
if ($foreignScope) {
|
||||
$label = $this->getInjection('language')->translate($linkName, 'links', $entityType) . '.' . $this->getInjection('language')->translate($foreignField, 'fields', $foreignScope);
|
||||
}
|
||||
} else {
|
||||
$label = $this->getInjection('language')->translate($name, 'fields', $entityType);
|
||||
}
|
||||
|
||||
$sheet->setCellValue($col . $rowNumber, $label);
|
||||
$sheet->getColumnDimension($col)->setAutoSize(true);
|
||||
if (in_array($defs['type'], ['phone', 'email', 'url', 'link', 'linkParent'])) {
|
||||
$linkColList[] = $col;
|
||||
} else if ($name == 'name') {
|
||||
$linkColList[] = $col;
|
||||
}
|
||||
$lastIndex = $i;
|
||||
}
|
||||
|
||||
$col = $azRange[$i];
|
||||
|
||||
$headerStyle = array(
|
||||
'font' => array(
|
||||
'bold' => true,
|
||||
'size' => 12
|
||||
)
|
||||
);
|
||||
|
||||
$sheet->getStyle("A$rowNumber:$col$rowNumber")->applyFromArray($headerStyle);
|
||||
$sheet->setAutoFilter("A$rowNumber:$col$rowNumber");
|
||||
|
||||
$typesCache = array();
|
||||
|
||||
$rowNumber++;
|
||||
foreach ($dataList as $row) {
|
||||
$i = 0;
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
|
||||
$defs = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name]);
|
||||
if (!$defs) {
|
||||
$defs = array();
|
||||
$defs['type'] = 'base';
|
||||
}
|
||||
|
||||
$type = $defs['type'];
|
||||
$foreignField = $name;
|
||||
$linkName = null;
|
||||
if (strpos($name, '_') !== false) {
|
||||
list($linkName, $foreignField) = explode('_', $name);
|
||||
$foreignScope = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'links', $linkName, 'entity']);
|
||||
if ($foreignScope) {
|
||||
$type = $this->getInjection('metadata')->get(['entityDefs', $foreignScope, 'fields', $foreignField, 'type'], $type);
|
||||
}
|
||||
}
|
||||
if ($type === 'foreign') {
|
||||
$linkName = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name, 'link']);
|
||||
$foreignField = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'fields', $name, 'field']);
|
||||
$foreignScope = $this->getInjection('metadata')->get(['entityDefs', $entityType, 'links', $linkName, 'entity']);
|
||||
if ($foreignScope) {
|
||||
$type = $this->getInjection('metadata')->get(['entityDefs', $foreignScope, 'fields', $foreignField, 'type'], $type);
|
||||
}
|
||||
}
|
||||
$typesCache[$name] = $type;
|
||||
|
||||
$link = null;
|
||||
if ($type == 'link') {
|
||||
if (array_key_exists($name.'Name', $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name.'Name']);
|
||||
}
|
||||
} else if ($type == 'linkParent') {
|
||||
if (array_key_exists($name.'Name', $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name.'Name']);
|
||||
}
|
||||
} else if ($type == 'int') {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ?: 0);
|
||||
} else if ($type == 'float') {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ?: 0);
|
||||
} else if ($type == 'currency') {
|
||||
if (array_key_exists($name.'Currency', $row) && array_key_exists($name, $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ? $row[$name] : '');
|
||||
$currency = $row[$name . 'Currency'];
|
||||
$currencySymbol = $this->getMetadata()->get(['app', 'currency', 'symbolMap', $currency], '');
|
||||
|
||||
$sheet->getStyle("$col$rowNumber")
|
||||
->getNumberFormat()
|
||||
->setFormatCode('[$'.$currencySymbol.'-409]#,##0.00;-[$'.$currencySymbol.'-409]#,##0.00');
|
||||
}
|
||||
} else if ($type == 'currencyConverted') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$currency = $this->getConfig()->get('defaultCurrency');
|
||||
$currencySymbol = $this->getMetadata()->get(['app', 'currency', 'symbolMap', $currency], '');
|
||||
|
||||
$sheet->getStyle("$col$rowNumber")
|
||||
->getNumberFormat()
|
||||
->setFormatCode('[$'.$currencySymbol.'-409]#,##0.00;-[$'.$currencySymbol.'-409]#,##0.00');
|
||||
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name] ? $row[$name] : '');
|
||||
}
|
||||
} else if ($type == 'personName') {
|
||||
if (!empty($row['name'])) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row['name']);
|
||||
} else {
|
||||
$personName = '';
|
||||
if (!empty($row['firstName'])) {
|
||||
$personName .= $row['firstName'];
|
||||
}
|
||||
if (!empty($row['lastName'])) {
|
||||
if (!empty($row['firstName'])) {
|
||||
$personName .= ' ';
|
||||
}
|
||||
$personName .= $row['lastName'];
|
||||
}
|
||||
$sheet->setCellValue("$col$rowNumber", $personName);
|
||||
}
|
||||
} else if ($type == 'date') {
|
||||
if (isset($row[$name])) {
|
||||
$sheet->setCellValue("$col$rowNumber", \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($row[$name])));
|
||||
}
|
||||
} else if ($type == 'datetime' || $type == 'datetimeOptional') {
|
||||
$value = null;
|
||||
if ($type == 'datetimeOptional') {
|
||||
if (isset($row[$name . 'Date']) && $row[$name . 'Date']) {
|
||||
$value = $row[$name . 'Date'];
|
||||
}
|
||||
}
|
||||
if (!$value) {
|
||||
if (isset($row[$name])) {
|
||||
$value = $row[$name];
|
||||
}
|
||||
}
|
||||
if ($value && strlen($value) > 11) {
|
||||
try {
|
||||
$timeZone = $this->getInjection('config')->get('timeZone');
|
||||
$dt = new \DateTime($value);
|
||||
$dt->setTimezone(new \DateTimeZone($timeZone));
|
||||
$value = $dt->format($this->getInjection('dateTime')->getInternalDateTimeFormat());
|
||||
} catch (\Exception $e) {
|
||||
$value = '';
|
||||
}
|
||||
}
|
||||
if ($value) {
|
||||
$sheet->setCellValue("$col$rowNumber", \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($value)));
|
||||
}
|
||||
} else if ($type == 'image') {
|
||||
if (isset($row[$name . 'Id']) && $row[$name . 'Id']) {
|
||||
$attachment = $this->getEntityManager()->getEntity('Attachment', $row[$name . 'Id']);
|
||||
|
||||
if ($attachment) {
|
||||
$objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
|
||||
$filePath = $this->getInjection('fileStorageManager')->getLocalFilePath($attachment);
|
||||
|
||||
if ($filePath && file_exists($filePath)) {
|
||||
$objDrawing->setPath($filePath);
|
||||
$objDrawing->setHeight(100);
|
||||
$objDrawing->setCoordinates("$col$rowNumber");
|
||||
$objDrawing->setWorksheet($sheet);
|
||||
$sheet->getRowDimension($rowNumber)->setRowHeight(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($type == 'file') {
|
||||
if (array_key_exists($name.'Name', $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name.'Name']);
|
||||
}
|
||||
} else if ($type == 'enum') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
if ($linkName) {
|
||||
$value = $this->getInjection('language')->translateOption($row[$name], $foreignField, $foreignScope);
|
||||
} else {
|
||||
$value = $this->getInjection('language')->translateOption($row[$name], $name, $entityType);
|
||||
}
|
||||
$sheet->setCellValue("$col$rowNumber", $value);
|
||||
}
|
||||
} else if ($type == 'linkMultiple') {
|
||||
if (array_key_exists($name . 'Ids', $row) && array_key_exists($name . 'Names', $row)) {
|
||||
$nameList = [];
|
||||
foreach ($row[$name . 'Ids'] as $relatedId) {
|
||||
$relatedName = $relatedId;
|
||||
if (property_exists($row[$name . 'Names'], $relatedId)) {
|
||||
$relatedName = $row[$name . 'Names']->$relatedId;
|
||||
}
|
||||
$nameList[] = $relatedName;
|
||||
}
|
||||
$sheet->setCellValue("$col$rowNumber", implode(', ', $nameList));
|
||||
}
|
||||
} else if ($type == 'address') {
|
||||
$value = '';
|
||||
if (!empty($row[$name . 'Street'])) {
|
||||
$value = $value .= $row[$name.'Street'];
|
||||
}
|
||||
if (!empty($row[$name.'City']) || !empty($row[$name.'State']) || !empty($row[$name.'PostalCode'])) {
|
||||
if ($value) {
|
||||
$value .= "\n";
|
||||
}
|
||||
if (!empty($row[$name.'City'])) {
|
||||
$value .= $row[$name.'City'];
|
||||
if (
|
||||
!empty($row[$name.'State']) || !empty($row[$name.'PostalCode'])
|
||||
) {
|
||||
$value .= ', ';
|
||||
}
|
||||
}
|
||||
if (!empty($row[$name.'State'])) {
|
||||
$value .= $row[$name.'State'];
|
||||
if (!empty($row[$name.'PostalCode'])) {
|
||||
$value .= ' ';
|
||||
}
|
||||
}
|
||||
if (!empty($row[$name.'PostalCode'])) {
|
||||
$value .= $row[$name.'PostalCode'];
|
||||
}
|
||||
}
|
||||
if (!empty($row[$name.'Country'])) {
|
||||
if ($value) {
|
||||
$value .= "\n";
|
||||
}
|
||||
$value .= $row[$name.'Country'];
|
||||
}
|
||||
$sheet->setCellValue("$col$rowNumber", $value);
|
||||
} else if ($type == 'duration') {
|
||||
if (!empty($row[$name])) {
|
||||
$seconds = intval($row[$name]);
|
||||
|
||||
$days = intval(floor($seconds / 86400));
|
||||
$seconds = $seconds - $days * 86400;
|
||||
$hours = intval(floor($seconds / 3600));
|
||||
$seconds = $seconds - $hours * 3600;
|
||||
$minutes = intval(floor($seconds / 60));
|
||||
|
||||
$value = '';
|
||||
if ($days) {
|
||||
$value .= (string) $days . $this->getInjection('language')->translate('d', 'durationUnits');
|
||||
if ($minutes || $hours) {
|
||||
$value .= ' ';
|
||||
}
|
||||
}
|
||||
if ($hours) {
|
||||
$value .= (string) $hours . $this->getInjection('language')->translate('h', 'durationUnits');
|
||||
if ($minutes) {
|
||||
$value .= ' ';
|
||||
}
|
||||
}
|
||||
if ($minutes) {
|
||||
$value .= (string) $minutes . $this->getInjection('language')->translate('m', 'durationUnits');
|
||||
}
|
||||
|
||||
$sheet->setCellValue("$col$rowNumber", $value);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$link = false;
|
||||
|
||||
$foreignLink = null;
|
||||
$isForeign = false;
|
||||
if (strpos($name, '_')) {
|
||||
$isForeign = true;
|
||||
list($foreignLink, $foreignField) = explode('_', $name);
|
||||
}
|
||||
|
||||
if ($name == 'name') {
|
||||
if (array_key_exists('id', $row)) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/#".$entityType . "/view/" . $row['id'];
|
||||
}
|
||||
} else if ($type == 'url') {
|
||||
if (array_key_exists($name, $row) && filter_var($row[$name], FILTER_VALIDATE_URL)) {
|
||||
$link = $row[$name];
|
||||
}
|
||||
} else if ($type == 'link') {
|
||||
if (array_key_exists($name.'Id', $row)) {
|
||||
$foreignEntity = null;
|
||||
if (!$isForeign) {
|
||||
$foreignEntity = $this->getMetadata()->get(['entityDefs', $entityType, 'links', $name, 'entity']);
|
||||
} else {
|
||||
$foreignEntity1 = $this->getMetadata()->get(['entityDefs', $entityType, 'links', $foreignLink, 'entity']);
|
||||
$foreignEntity = $this->getMetadata()->get(['entityDefs', $foreignEntity1, 'links', $foreignField, 'entity']);
|
||||
}
|
||||
if ($foreignEntity) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/#" . $foreignEntity. "/view/". $row[$name.'Id'];
|
||||
}
|
||||
}
|
||||
} else if ($type == 'file') {
|
||||
if (array_key_exists($name.'Id', $row)) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/?entryPoint=download&id=" . $row[$name.'Id'];
|
||||
}
|
||||
} else if ($type == 'linkParent') {
|
||||
if (array_key_exists($name.'Id', $row) && array_key_exists($name.'Type', $row)) {
|
||||
$link = $this->getConfig()->getSiteUrl() . "/#".$row[$name.'Type']."/view/". $row[$name.'Id'];
|
||||
}
|
||||
} else if ($type == 'phone') {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$link = "tel:".$row[$name];
|
||||
}
|
||||
} else if ($type == 'email' && array_key_exists($name, $row)) {
|
||||
if (array_key_exists($name, $row)) {
|
||||
$link = "mailto:".$row[$name];
|
||||
}
|
||||
}
|
||||
if ($link) {
|
||||
$sheet->getCell("$col$rowNumber")->getHyperlink()->setUrl($link);
|
||||
$sheet->getCell("$col$rowNumber")->getHyperlink()->setTooltip($link);
|
||||
}
|
||||
}
|
||||
$rowNumber++;
|
||||
}
|
||||
|
||||
$sheet->getStyle("A2:A$rowNumber")
|
||||
->getNumberFormat()
|
||||
->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_TEXT);
|
||||
|
||||
$startingRowNumber = 4;
|
||||
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
if (!array_key_exists($name, $typesCache)) {
|
||||
break;
|
||||
}
|
||||
$type = $typesCache[$name];
|
||||
|
||||
switch ($type) {
|
||||
case 'currency':
|
||||
case 'currencyConverted': {
|
||||
|
||||
} break;
|
||||
case 'int': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode('0');
|
||||
} break;
|
||||
case 'float': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1);
|
||||
} break;
|
||||
case 'date': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateFormat());
|
||||
} break;
|
||||
case 'datetime': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateTimeFormat());
|
||||
} break;
|
||||
case 'datetimeOptional': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode($this->getInjection('dateTime')->getDateTimeFormat());
|
||||
} break;
|
||||
default: {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode('@');
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
$linkStyle = [
|
||||
'font' => [
|
||||
'color' => ['rgb' => '345b7c'],
|
||||
'underline' => 'single'
|
||||
]
|
||||
];
|
||||
foreach ($linkColList as $linkColumn) {
|
||||
$sheet->getStyle($linkColumn.$startingRowNumber.':'.$linkColumn.$rowNumber)->applyFromArray($linkStyle);
|
||||
}
|
||||
|
||||
$objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($phpExcel, 'Xlsx');
|
||||
|
||||
if (!$this->getInjection('fileManager')->isDir('data/cache/')) {
|
||||
$this->getInjection('fileManager')->mkdir('data/cache/');
|
||||
}
|
||||
$tempFileName = 'data/cache/' . 'export_' . substr(md5(rand()), 0, 7);
|
||||
|
||||
$objWriter->save($tempFileName);
|
||||
$fp = fopen($tempFileName, 'r');
|
||||
$xlsx = stream_get_contents($fp);
|
||||
$this->getInjection('fileManager')->unlink($tempFileName);
|
||||
|
||||
return $xlsx;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
@@ -42,6 +42,11 @@ class ExtensionManager extends Upgrades\Base
|
||||
'after' => 'AfterInstall',
|
||||
'beforeUninstall' => 'BeforeUninstall',
|
||||
'afterUninstall' => 'AfterUninstall',
|
||||
),
|
||||
|
||||
'customDirNames' => array(
|
||||
'before' => 'beforeInstallFiles',
|
||||
'after' => 'afterInstallFiles',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user