mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-03 20:27:01 +00:00
Compare commits
1622 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62b4b92815 | ||
|
|
6c3ee8d462 | ||
|
|
43f1c0d889 | ||
|
|
2cd1bb8cdd | ||
|
|
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 |
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
|
||||
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -8,13 +8,10 @@
|
||||
/node_modules
|
||||
/test.php
|
||||
/main.html
|
||||
/client/css/espo.css
|
||||
/client/css/espo-vertical.css
|
||||
/client/css/sakura.css
|
||||
/client/css/sakura-vertical.css
|
||||
/client/css/violet.css
|
||||
/client/css/violet-vertical.css
|
||||
/tests/testData/cache/*
|
||||
|
||||
/tests/unit/testData/cache/*
|
||||
!/tests/unit/testData/cache/.data
|
||||
/tests/integration/config.php
|
||||
composer.phar
|
||||
vendor/
|
||||
/custom/Espo/Custom/*
|
||||
@@ -1,3 +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).
|
||||
[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](http://forum.espocrm.com/) for this.
|
||||
|
||||
97
Gruntfile.js
97
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
|
||||
@@ -41,6 +41,35 @@ module.exports = function (grunt) {
|
||||
'client/src/utils.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'),
|
||||
|
||||
@@ -59,65 +88,7 @@ module.exports = function (grunt) {
|
||||
start: ['build/*'],
|
||||
final: ['build/tmp'],
|
||||
},
|
||||
less: {
|
||||
espo: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'client/css/espo.css': 'frontend/less/espo/main.less',
|
||||
}
|
||||
},
|
||||
espoVertical: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'client/css/espo-vertical.css': 'frontend/less/espo-vertical/main.less',
|
||||
}
|
||||
},
|
||||
sakura: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'client/css/sakura.css': 'frontend/less/sakura/main.less',
|
||||
}
|
||||
},
|
||||
sakuraVertical: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'client/css/sakura-vertical.css': 'frontend/less/sakura-vertical/main.less',
|
||||
}
|
||||
},
|
||||
violet: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'client/css/violet.css': 'frontend/less/violet/main.less',
|
||||
}
|
||||
},
|
||||
violetVertical: {
|
||||
options: {
|
||||
yuicompress: true,
|
||||
},
|
||||
files: {
|
||||
'client/css/violet-vertical.css': 'frontend/less/violet-vertical/main.less',
|
||||
}
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
minify: {
|
||||
files: {
|
||||
'build/tmp/client/css/espo.css': [
|
||||
'client/css/espo.css',
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
less: lessData,
|
||||
uglify: {
|
||||
options: {
|
||||
mangle: false,
|
||||
@@ -144,10 +115,6 @@ module.exports = function (grunt) {
|
||||
],
|
||||
dest: 'build/tmp/client',
|
||||
},
|
||||
frontendHtml: {
|
||||
src: 'frontend/reset.html',
|
||||
dest: 'build/tmp/reset.html'
|
||||
},
|
||||
frontendLib: {
|
||||
expand: true,
|
||||
dot: true,
|
||||
@@ -287,10 +254,8 @@ module.exports = function (grunt) {
|
||||
'clean:start',
|
||||
'mkdir:tmp',
|
||||
'less',
|
||||
'cssmin',
|
||||
'uglify',
|
||||
'copy:frontendFolders',
|
||||
'copy:frontendHtml',
|
||||
'copy:frontendLib',
|
||||
'copy:backend',
|
||||
'replace',
|
||||
|
||||
10
README.md
10
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);
|
||||
* PHP 5.6 or above (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
|
||||
* MySQL 5.1 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)
|
||||
|
||||
|
||||
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
|
||||
|
||||
0
api/v1/portal-access/.htaccess
Executable file → Normal file
0
api/v1/portal-access/.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
|
||||
|
||||
0
api/v1/portal-access/web.config
Executable file → Normal file
0
api/v1/portal-access/web.config
Executable file → Normal file
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 Attachment extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkEntityRead(User $user, Entity $entity, $data)
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
@@ -82,7 +82,7 @@ class Attachment extends \Espo\Core\Acl\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
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
|
||||
@@ -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;
|
||||
@@ -60,7 +60,7 @@ class Email extends \Espo\Core\Acl\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('assignedUserId')) {
|
||||
return true;
|
||||
@@ -76,5 +76,46 @@ class Email extends \Espo\Core\Acl\Base
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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 Notification extends \Espo\Core\Acl\Base
|
||||
{
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('userId')) {
|
||||
return true;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
namespace Espo\AclPortal;
|
||||
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Attachment extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkEntityRead(User $user, Entity $entity, $data)
|
||||
public function checkEntityRead(EntityUser $user, Entity $entity, $data)
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
@@ -82,7 +82,7 @@ class Attachment extends \Espo\Core\AclPortal\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
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
|
||||
@@ -29,13 +29,13 @@
|
||||
|
||||
namespace Espo\AclPortal;
|
||||
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Email extends \Espo\Core\AclPortal\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;
|
||||
@@ -60,7 +60,7 @@ class Email extends \Espo\Core\AclPortal\Base
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('createdById')) {
|
||||
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
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
namespace Espo\AclPortal;
|
||||
|
||||
use \Espo\Entities\User;
|
||||
use \Espo\Entities\User as EntityUser;
|
||||
use \Espo\ORM\Entity;
|
||||
|
||||
class Notification extends \Espo\Core\AclPortal\Base
|
||||
{
|
||||
public function checkIsOwner(User $user, Entity $entity)
|
||||
public function checkIsOwner(EntityUser $user, Entity $entity)
|
||||
{
|
||||
if ($user->id === $entity->get('userId')) {
|
||||
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
|
||||
|
||||
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,48 +35,16 @@ class App extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
public function actionUser()
|
||||
{
|
||||
$preferences = $this->getPreferences()->getValues();
|
||||
unset($preferences['smtpPassword']);
|
||||
|
||||
$user = $this->getUser();
|
||||
if (!$user->has('teamsIds')) {
|
||||
$user->loadLinkMultipleField('teams');
|
||||
}
|
||||
if ($user->get('isPortalUser')) {
|
||||
$user->loadAccountField();
|
||||
$user->loadLinkMultipleField('accounts');
|
||||
}
|
||||
|
||||
$userData = $user->getValues();
|
||||
|
||||
$emailAddressList = [];
|
||||
foreach ($user->get('emailAddresses') as $emailAddress) {
|
||||
if ($emailAddress->get('invalid')) continue;
|
||||
if ($user->get('emailAddrses') === $emailAddress->get('name')) continue;
|
||||
$emailAddressList[] = $emailAddress->get('name');
|
||||
}
|
||||
if ($user->get('emailAddrses')) {
|
||||
array_unshift($emailAddressList, $user->get('emailAddrses'));
|
||||
}
|
||||
$userData['emailAddressList'] = $emailAddressList;
|
||||
|
||||
return array(
|
||||
'user' => $userData,
|
||||
'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
|
||||
@@ -34,27 +34,5 @@ use \Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
class Attachment extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionUpload($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (!$this->getAcl()->checkScope('Attachment', 'create')) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,10 +38,10 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionGetCopiedAttachments($params, $data, $request)
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$id = $data['id'];
|
||||
$id = $data->id;
|
||||
|
||||
return $this->getRecordService()->getCopiedAttachments($id);
|
||||
}
|
||||
@@ -56,25 +56,25 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
if ($data['type'] == 'preferences') {
|
||||
if (!$this->getUser()->isAdmin() && $data['id'] !== $this->getUser()->id) {
|
||||
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 NotFound();
|
||||
}
|
||||
|
||||
if (is_null($data['password'])) {
|
||||
$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') {
|
||||
} 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 (!empty($data->id)) {
|
||||
$emailAccount = $this->getEntityManager()->getEntity('EmailAccount', $data->id);
|
||||
if (!$emailAccount) {
|
||||
throw new NotFound();
|
||||
}
|
||||
@@ -83,49 +83,62 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
if (is_null($data['password'])) {
|
||||
$data['password'] = $this->getContainer()->get('crypt')->decrypt($emailAccount->get('smtpPassword'));
|
||||
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();
|
||||
}
|
||||
if (is_null($data['password'])) {
|
||||
$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)
|
||||
@@ -135,58 +148,58 @@ 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)
|
||||
@@ -206,20 +219,19 @@ class Email extends \Espo\Core\Controllers\Record
|
||||
|
||||
public function postActionMoveToFolder($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();
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data['folderId'])) {
|
||||
if (empty($data->folderId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getRecordService()->moveToFolderByIdList($ids, $data['folderId']);
|
||||
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
|
||||
|
||||
@@ -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
|
||||
@@ -35,22 +35,22 @@ class EmailFolder extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionMoveUp($params, $data, $request)
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveUp($data['id']);
|
||||
$this->getRecordService()->moveUp($data->id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionMoveDown($params, $data, $request)
|
||||
{
|
||||
if (empty($data['id'])) {
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveDown($data['id']);
|
||||
$this->getRecordService()->moveDown($data->id);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -60,4 +60,3 @@ class EmailFolder extends \Espo\Core\Controllers\Record
|
||||
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();
|
||||
}
|
||||
@@ -103,6 +105,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();
|
||||
}
|
||||
@@ -129,6 +133,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();
|
||||
}
|
||||
@@ -160,6 +166,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();
|
||||
}
|
||||
@@ -198,6 +206,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) {
|
||||
@@ -211,6 +226,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();
|
||||
}
|
||||
@@ -242,6 +259,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) {
|
||||
@@ -255,6 +279,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();
|
||||
}
|
||||
@@ -278,5 +304,22 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -65,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();
|
||||
}
|
||||
@@ -109,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']);
|
||||
@@ -126,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);
|
||||
|
||||
@@ -139,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,46 @@ 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 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 +92,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,8 +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
|
||||
@@ -68,9 +68,9 @@ class Import extends \Espo\Core\Controllers\Record
|
||||
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
|
||||
@@ -76,4 +76,3 @@ class Job extends \Espo\Core\Controllers\Record
|
||||
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
|
||||
|
||||
@@ -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,6 +43,10 @@ class Notification extends \Espo\Core\Controllers\Record
|
||||
$maxSize = intval($request->get('maxSize'));
|
||||
$after = $request->get('after');
|
||||
|
||||
if (empty($maxSize)) {
|
||||
$maxSize = self::MAX_SIZE_LIMIT;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'offset' => $offset,
|
||||
'maxSize' => $maxSize,
|
||||
|
||||
@@ -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
|
||||
@@ -93,11 +93,11 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
|
||||
foreach ($this->getAcl()->getScopeForbiddenAttributeList('Preferences', 'edit') as $attribute) {
|
||||
unset($data[$attribute]);
|
||||
unset($data->$attribute);
|
||||
}
|
||||
|
||||
if (array_key_exists('smtpPassword', $data)) {
|
||||
$data['smtpPassword'] = $this->getCrypt()->encrypt($data['smtpPassword']);
|
||||
if (property_exists($data, 'smtpPassword')) {
|
||||
$data->smtpPassword = $this->getCrypt()->encrypt($data->smtpPassword);
|
||||
}
|
||||
|
||||
$user = $this->getEntityManager()->getEntity('User', $userId);
|
||||
@@ -113,7 +113,7 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
|
||||
$entity->clear('smtpPassword');
|
||||
|
||||
return $entity->toArray();
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
throw new Error();
|
||||
}
|
||||
@@ -140,7 +140,7 @@ class Preferences extends \Espo\Core\Controllers\Base
|
||||
$entity->clear($attribute);
|
||||
}
|
||||
|
||||
return $entity->toArray();
|
||||
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
|
||||
@@ -37,12 +37,16 @@ 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]);
|
||||
}
|
||||
}
|
||||
@@ -72,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();
|
||||
}
|
||||
|
||||
@@ -83,8 +91,8 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
}
|
||||
|
||||
/** Rebuild for Currency Settings */
|
||||
if (isset($data['baseCurrency']) || isset($data['currencyRates'])) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase(array());
|
||||
if (isset($data->baseCurrency) || isset($data->currencyRates)) {
|
||||
$this->getContainer()->get('dataManager')->rebuildDatabase([]);
|
||||
}
|
||||
/** END Rebuild for Currency Settings */
|
||||
|
||||
@@ -97,10 +105,12 @@ class Settings extends \Espo\Core\Controllers\Base
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
if (!isset($data['password'])) {
|
||||
$data['password'] = $this->getConfig()->get('ldapPassword');
|
||||
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);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -57,20 +57,20 @@ class User extends \Espo\Core\Controllers\Record
|
||||
|
||||
public function postActionChangeOwnPassword($params, $data, $request)
|
||||
{
|
||||
if (!array_key_exists('password', $data) || !array_key_exists('currentPassword', $data)) {
|
||||
if (!property_exists($data, 'password') || !property_exists($data, 'currentPassword')) {
|
||||
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 postActionChangePasswordByRequest($params, $data, $request)
|
||||
{
|
||||
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) {
|
||||
@@ -83,7 +83,7 @@ class User extends \Espo\Core\Controllers\Record
|
||||
|
||||
$this->getEntityManager()->removeEntity($p);
|
||||
|
||||
if ($this->getService('User')->changePassword($userId, $data['password'])) {
|
||||
if ($this->getService('User')->changePassword($userId, $data->password)) {
|
||||
return array(
|
||||
'url' => $p->get('url')
|
||||
);
|
||||
@@ -92,15 +92,15 @@ class User extends \Espo\Core\Controllers\Record
|
||||
|
||||
public function postActionPasswordChangeRequest($params, $data, $request)
|
||||
{
|
||||
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'];
|
||||
if (!empty($data->url)) {
|
||||
$url = $data->url;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -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
|
||||
@@ -106,6 +106,14 @@ class Base implements Injectable
|
||||
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_object($data) || !isset($data->read)) {
|
||||
@@ -155,7 +163,7 @@ class Base implements Injectable
|
||||
}
|
||||
|
||||
if (!isset($data->$action)) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $data->$action;
|
||||
@@ -252,7 +260,11 @@ class Base implements Injectable
|
||||
|
||||
if (is_object($data)) {
|
||||
if ($data->edit !== 'no' || $data->create !== 'no') {
|
||||
if ($entity->has('createdById') && $entity->get('createdById') == $user->id) {
|
||||
if (
|
||||
$this->getConfig()->get('aclAllowDeleteCreated')
|
||||
&&
|
||||
$entity->has('createdById') && $entity->get('createdById') == $user->id
|
||||
) {
|
||||
if (!$entity->has('assignedUserId')) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -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
|
||||
@@ -36,7 +36,7 @@ use \Espo\Entities\User;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\Utils\Metadata;
|
||||
use \Espo\Core\Utils\FieldManager;
|
||||
use \Espo\Core\Utils\FieldManagerUtil;
|
||||
use \Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
class Table
|
||||
@@ -59,13 +59,9 @@ class Table
|
||||
|
||||
protected $fieldLevelList = ['yes', 'no'];
|
||||
|
||||
protected $valuePermissionList = ['assignmentPermission', 'userPermission', 'portalPermission'];
|
||||
protected $valuePermissionHighestLevels = array();
|
||||
|
||||
protected $valuePrtmissionHighestLevels = array(
|
||||
'assignmentPermission' => 'all',
|
||||
'userPermission' => 'all',
|
||||
'portalPermission' => 'yes'
|
||||
);
|
||||
protected $valuePermissionList = [];
|
||||
|
||||
private $fileManager;
|
||||
|
||||
@@ -77,7 +73,9 @@ class Table
|
||||
|
||||
protected $forbiddenFieldsCache = array();
|
||||
|
||||
public function __construct(User $user, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManager $fieldManager = null)
|
||||
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) [],
|
||||
@@ -85,6 +83,8 @@ class Table
|
||||
'fieldTableQuickAccess' => (object) [],
|
||||
];
|
||||
|
||||
$this->isStrictMode = $config->get('aclStrictMode', false);
|
||||
|
||||
$this->user = $user;
|
||||
|
||||
$this->metadata = $metadata;
|
||||
@@ -100,7 +100,8 @@ class Table
|
||||
if ($fileManager) {
|
||||
$this->fileManager = $fileManager;
|
||||
}
|
||||
$this->valuePermissionList = $this->metadata->get('app.' . $this->type . '.defs.valuePermissionList', $this->valuePermissionList);
|
||||
$this->valuePermissionList = $this->metadata->get(['app', $this->type, 'valuePermissionList'], []);
|
||||
$this->valuePermissionHighestLevels = $this->metadata->get(['app', $this->type, 'valuePermissionHighestLevels'], array());
|
||||
|
||||
$this->initCacheFilePath();
|
||||
|
||||
@@ -135,11 +136,6 @@ class Table
|
||||
return $this->fieldManager;
|
||||
}
|
||||
|
||||
protected function getConfig()
|
||||
{
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
public function getMap()
|
||||
{
|
||||
return $this->data;
|
||||
@@ -177,7 +173,7 @@ class Table
|
||||
return $this->data->table->$scope->$action;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return 'no';
|
||||
}
|
||||
|
||||
private function load()
|
||||
@@ -242,8 +238,12 @@ class Table
|
||||
$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.'.default.' . $permission, 'yes'));
|
||||
$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);
|
||||
}
|
||||
@@ -251,8 +251,8 @@ class Table
|
||||
|
||||
} else {
|
||||
foreach ($this->valuePermissionList as $permission) {
|
||||
if (isset($this->valuePrtmissionHighestLevels[$permission])) {
|
||||
$this->data->$permission = $this->valuePrtmissionHighestLevels[$permission];
|
||||
if (isset($this->valuePermissionHighestLevels[$permission])) {
|
||||
$this->data->$permission = $this->valuePermissionHighestLevels[$permission];
|
||||
continue;
|
||||
}
|
||||
$this->data->$permission = 'all';
|
||||
@@ -454,11 +454,26 @@ class Table
|
||||
$aclType = $this->defaultAclType;
|
||||
}
|
||||
if (!empty($aclType)) {
|
||||
$defaultValue = $this->metadata->get('app.'.$this->type.'.scopeLevelTypesDefaults.' . $aclType, $this->metadata->get('app.'.$this->type.'.scopeLevelTypesDefaults.record'));
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -606,7 +621,9 @@ class Table
|
||||
|
||||
if (!is_object($row)) continue;
|
||||
|
||||
foreach ($this->actionList as $i => $action) {
|
||||
$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)) {
|
||||
@@ -623,7 +640,7 @@ class Table
|
||||
if (in_array($action, $this->booleanActionList)) {
|
||||
$data->$scope->$action = 'yes';
|
||||
} else {
|
||||
if (isset($data->$scope->$previousAction)) {
|
||||
if ($action === 'stream' && isset($data->$scope->$previousAction)) {
|
||||
$data->$scope->$action = $data->$scope->$previousAction;
|
||||
}
|
||||
}
|
||||
@@ -684,11 +701,12 @@ class Table
|
||||
|
||||
private function buildCache()
|
||||
{
|
||||
$contents = '<' . '?'. 'php return ' . $this->varExport($this->data) . ';';
|
||||
$this->fileManager->putContents($this->cacheFilePath, $contents);
|
||||
$this->fileManager->putPhpContents($this->cacheFilePath, $this->data, true);
|
||||
/*$contents = '<' . '?'. 'php return ' . $this->varExport($this->data) . ';';
|
||||
$this->fileManager->putContents($this->cacheFilePath, $contents);*/
|
||||
}
|
||||
|
||||
private function varExport($variable)
|
||||
/*private function varExport($variable)
|
||||
{
|
||||
if ($variable instanceof \StdClass) {
|
||||
$result = '(object) ' . $this->varExport(get_object_vars($variable), true);
|
||||
@@ -703,6 +721,6 @@ class Table
|
||||
}
|
||||
|
||||
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
|
||||
@@ -107,7 +107,7 @@ class AclManager
|
||||
$config = $this->getContainer()->get('config');
|
||||
$fileManager = $this->getContainer()->get('fileManager');
|
||||
$metadata = $this->getContainer()->get('metadata');
|
||||
$fieldManager = $this->getContainer()->get('fieldManager');
|
||||
$fieldManager = $this->getContainer()->get('fieldManagerUtil');
|
||||
|
||||
$this->tableHashMap[$key] = new $this->tableClassName($user, $config, $fileManager, $metadata, $fieldManager);
|
||||
}
|
||||
@@ -133,6 +133,15 @@ class AclManager
|
||||
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()) {
|
||||
|
||||
@@ -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
|
||||
@@ -71,7 +71,7 @@ class Base extends \Espo\Core\Acl\Base
|
||||
}
|
||||
|
||||
if (!isset($data->$action)) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $data->$action;
|
||||
|
||||
@@ -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,7 @@ use \Espo\Entities\Portal;
|
||||
|
||||
use \Espo\Core\Utils\Config;
|
||||
use \Espo\Core\Utils\Metadata;
|
||||
use \Espo\Core\Utils\FieldManager;
|
||||
use \Espo\Core\Utils\FieldManagerUtil;
|
||||
use \Espo\Core\Utils\File\Manager as FileManager;
|
||||
|
||||
class Table extends \Espo\Core\Acl\Table
|
||||
@@ -50,9 +50,7 @@ class Table extends \Espo\Core\Acl\Table
|
||||
|
||||
protected $levelList = ['yes', 'all', 'account', 'contact', 'own', 'no'];
|
||||
|
||||
protected $valuePermissionList = [];
|
||||
|
||||
public function __construct(User $user, Portal $portal, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManager $fieldManager = null)
|
||||
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.");
|
||||
|
||||
@@ -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
|
||||
@@ -134,7 +134,7 @@ class Application
|
||||
public function runCron()
|
||||
{
|
||||
$auth = $this->createAuth();
|
||||
$auth->useNoAuth(true);
|
||||
$auth->useNoAuth();
|
||||
|
||||
$cronManager = new \Espo\Core\CronManager($this->container);
|
||||
$cronManager->run();
|
||||
@@ -222,7 +222,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) {
|
||||
@@ -327,6 +327,7 @@ class Application
|
||||
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
|
||||
@@ -93,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');
|
||||
@@ -118,16 +136,6 @@ class Container
|
||||
return $log;
|
||||
}
|
||||
|
||||
protected function loadContainer()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function loadSlim()
|
||||
{
|
||||
return new \Espo\Core\Utils\Api\Slim();
|
||||
}
|
||||
|
||||
protected function loadFileManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\File\Manager(
|
||||
@@ -135,6 +143,13 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadControllerManager()
|
||||
{
|
||||
return new \Espo\Core\ControllerManager(
|
||||
$this
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadPreferences()
|
||||
{
|
||||
return $this->get('entityManager')->getEntity('Preferences', $this->get('user')->id);
|
||||
@@ -181,7 +196,7 @@ class Container
|
||||
|
||||
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')
|
||||
);
|
||||
@@ -209,8 +224,8 @@ class Container
|
||||
protected function loadMetadata()
|
||||
{
|
||||
return new \Espo\Core\Utils\Metadata(
|
||||
$this->get('config'),
|
||||
$this->get('fileManager')
|
||||
$this->get('fileManager'),
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -247,7 +262,17 @@ class Container
|
||||
$this->get('metadata'),
|
||||
$this->get('fileManager'),
|
||||
$this->get('entityManager'),
|
||||
$this->get('classParser')
|
||||
$this->get('classParser'),
|
||||
$this->get('ormMetadata')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadOrmMetadata()
|
||||
{
|
||||
return new \Espo\Core\Utils\Metadata\OrmMetadata(
|
||||
$this->get('metadata'),
|
||||
$this->get('fileManager'),
|
||||
$this->get('config')->get('useCache')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -263,10 +288,20 @@ class Container
|
||||
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')
|
||||
);
|
||||
}
|
||||
|
||||
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')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -300,6 +335,13 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadFieldManagerUtil()
|
||||
{
|
||||
return new \Espo\Core\Utils\FieldManagerUtil(
|
||||
$this->get('metadata')
|
||||
);
|
||||
}
|
||||
|
||||
protected function loadThemeManager()
|
||||
{
|
||||
return new \Espo\Core\Utils\ThemeManager(
|
||||
@@ -316,6 +358,13 @@ class Container
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -125,6 +127,4 @@ class ControllerManager
|
||||
|
||||
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
|
||||
@@ -67,13 +67,13 @@ class Record extends Base
|
||||
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)
|
||||
@@ -94,7 +94,7 @@ class Record extends Base
|
||||
$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();
|
||||
@@ -156,7 +156,7 @@ class Record extends Base
|
||||
|
||||
return array(
|
||||
'total' => $result['total'],
|
||||
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
|
||||
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
|
||||
);
|
||||
}
|
||||
|
||||
@@ -168,6 +168,9 @@ class Record extends Base
|
||||
if ($request->get('boolFilterList')) {
|
||||
$params['boolFilterList'] = $request->get('boolFilterList');
|
||||
}
|
||||
if ($request->get('filterList')) {
|
||||
$params['filterList'] = $request->get('filterList');
|
||||
}
|
||||
}
|
||||
|
||||
public function actionListLinked($params, $data, $request)
|
||||
@@ -206,7 +209,7 @@ class Record extends Base
|
||||
|
||||
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 +229,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 +284,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,17 +315,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)) {
|
||||
$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)
|
||||
@@ -313,19 +342,25 @@ 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);
|
||||
$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);
|
||||
}
|
||||
|
||||
return $this->getRecordService()->linkEntityMass($id, $link, $where, $selectData);
|
||||
} else {
|
||||
$foreignIdList = array();
|
||||
if (isset($data['id'])) {
|
||||
$foreignIdList[] = $data['id'];
|
||||
if (isset($data->id)) {
|
||||
$foreignIdList[] = $data->id;
|
||||
}
|
||||
if (isset($data['ids']) && is_array($data['ids'])) {
|
||||
foreach ($data['ids'] as $foreignId) {
|
||||
if (isset($data->ids) && is_array($data->ids)) {
|
||||
foreach ($data->ids as $foreignId) {
|
||||
$foreignIdList[] = $foreignId;
|
||||
}
|
||||
}
|
||||
@@ -357,18 +392,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;
|
||||
}
|
||||
@@ -410,12 +445,12 @@ class Record extends Base
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (empty($data['targetId']) || empty($data['sourceIds']) || !is_array($data['sourceIds']) || !($data['attributes'] instanceof \StdClass)) {
|
||||
if (empty($data->targetId) || empty($data->sourceIds) || !is_array($data->sourceIds) || !($data->attributes instanceof \StdClass)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$targetId = $data['targetId'];
|
||||
$sourceIds = $data['sourceIds'];
|
||||
$attributes = get_object_vars($data['attributes']);
|
||||
$targetId = $data->targetId;
|
||||
$sourceIds = $data->sourceIds;
|
||||
$attributes = $data->attributes;
|
||||
|
||||
if (!$this->getAcl()->check($this->name, 'edit')) {
|
||||
throw new Forbidden();
|
||||
@@ -423,5 +458,46 @@ class Record extends Base
|
||||
|
||||
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
|
||||
@@ -61,5 +61,15 @@ class RecordTree extends Record
|
||||
'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
|
||||
@@ -44,6 +44,10 @@ class CronManager
|
||||
|
||||
private $scheduledJobUtil;
|
||||
|
||||
private $cronJobUtil;
|
||||
|
||||
private $cronScheduledJobUtil;
|
||||
|
||||
const PENDING = 'Pending';
|
||||
|
||||
const RUNNING = 'Running';
|
||||
@@ -64,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()
|
||||
@@ -98,14 +102,14 @@ 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()
|
||||
@@ -155,58 +159,44 @@ class CronManager
|
||||
|
||||
$this->setLastRunTime(time());
|
||||
|
||||
$this->getCronJob()->markFailedJobs();
|
||||
$this->getCronJob()->updateFailedJobAttempts();
|
||||
$this->getCronJobUtil()->markFailedJobs();
|
||||
$this->getCronJobUtil()->updateFailedJobAttempts();
|
||||
$this->createJobsFromScheduledJobs();
|
||||
$this->getCronJob()->removePendingJobDuplicates();
|
||||
$this->getCronJobUtil()->removePendingJobDuplicates();
|
||||
|
||||
$pendingJobList = $this->getCronJob()->getPendingJobList();
|
||||
$pendingJobList = $this->getCronJobUtil()->getPendingJobList();
|
||||
|
||||
foreach ($pendingJobList as $job) {
|
||||
$jobEntity = $this->getEntityManager()->getEntity('Job', $job['id']);
|
||||
|
||||
if (!isset($jobEntity)) {
|
||||
$GLOBALS['log']->error('CronManager: empty Job entity ['.$job['id'].'].');
|
||||
continue;
|
||||
}
|
||||
|
||||
$jobEntity->set('status', self::RUNNING);
|
||||
$this->getEntityManager()->saveEntity($jobEntity);
|
||||
$job->set('status', self::RUNNING);
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
|
||||
$isSuccess = true;
|
||||
|
||||
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());
|
||||
$GLOBALS['log']->error('CronManager: Failed job running, job ['.$job->id.']. Error Details: '.$e->getMessage());
|
||||
}
|
||||
|
||||
$status = $isSuccess ? self::SUCCESS : self::FAILED;
|
||||
|
||||
$jobEntity->set('status', $status);
|
||||
$this->getEntityManager()->saveEntity($jobEntity);
|
||||
$job->set('status', $status);
|
||||
$this->getEntityManager()->saveEntity($job);
|
||||
|
||||
if (!empty($job['scheduled_job_id'])) {
|
||||
$this->getCronScheduledJob()->addLogRecord($job['scheduled_job_id'], $status, null, $job['target_id'], $job['target_type']);
|
||||
if ($job->get('scheduledJobId')) {
|
||||
$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) {
|
||||
@@ -220,14 +210,12 @@ class CronManager
|
||||
}
|
||||
|
||||
$data = null;
|
||||
if (!empty($job['data'])) {
|
||||
$data = $job['data'];
|
||||
if (Json::isJSON($data)) {
|
||||
$data = Json::decode($data, true);
|
||||
}
|
||||
|
||||
if ($job->get('data')) {
|
||||
$data = $job->get('data');
|
||||
}
|
||||
|
||||
$jobClass->$method($data, $job['target_id'], $job['target_type']);
|
||||
$jobClass->$method($data, $job->get('targetId'), $job->get('targetType'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,92 +225,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, $job['target_id'], $job['target_type']);
|
||||
$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()
|
||||
{
|
||||
$activeScheduledJobList = $this->getCronScheduledJob()->getActiveScheduledJobList();
|
||||
$activeScheduledJobList = $this->getCronScheduledJobUtil()->getActiveScheduledJobList();
|
||||
|
||||
$runningScheduledJobIdList = $this->getCronJob()->getRunningScheduledJobIdList();
|
||||
$runningScheduledJobIdList = $this->getCronJobUtil()->getRunningScheduledJobIdList();
|
||||
|
||||
$createdJobIdList = array();
|
||||
foreach ($activeScheduledJobList as $scheduledJob) {
|
||||
$scheduling = $scheduledJob['scheduling'];
|
||||
$scheduling = $scheduledJob->get('scheduling');
|
||||
|
||||
try {
|
||||
$cronExpression = \Cron\CronExpression::factory($scheduling);
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob['id'].']): Scheduling string error - '. $e->getMessage() . '.');
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Scheduling string error - '. $e->getMessage() . '.');
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$previousDate = $cronExpression->getPreviousRunDate()->format('Y-m-d H:i:s');
|
||||
$nextDate = $cronExpression->getNextRunDate()->format('Y-m-d H:i:s');
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob['id'].']): Unsupported CRON expression ['.$scheduling.']');
|
||||
$GLOBALS['log']->error('CronManager (ScheduledJob ['.$scheduledJob->id.']): Unsupported CRON expression ['.$scheduling.']');
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($cronExpression->isDue()) {
|
||||
$previousDate = date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$existingJob = $this->getCronJob()->getJobByScheduledJob($scheduledJob['id'], $previousDate);
|
||||
$existingJob = $this->getCronJobUtil()->getJobByScheduledJob($scheduledJob->id, $nextDate);
|
||||
if ($existingJob) continue;
|
||||
|
||||
$className = $this->getScheduledJobUtil()->get($scheduledJob['job']);
|
||||
$className = $this->getScheduledJobUtil()->get($scheduledJob->get('job'));
|
||||
if ($className) {
|
||||
if (method_exists($className, 'prepare')) {
|
||||
$implementation = new $className($this->container);
|
||||
$implementation->prepare($scheduledJob, $previousDate);
|
||||
$implementation->prepare($scheduledJob, $nextDate);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($scheduledJob['id'], $runningScheduledJobIdList)) {
|
||||
if (in_array($scheduledJob->id, $runningScheduledJobIdList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$jobEntity = $this->getEntityManager()->getEntity('Job');
|
||||
$jobEntity->set(array(
|
||||
'name' => $scheduledJob['name'],
|
||||
'name' => $scheduledJob->get('name'),
|
||||
'status' => self::PENDING,
|
||||
'scheduledJobId' => $scheduledJob['id'],
|
||||
'executeTime' => $previousDate,
|
||||
'method' => $scheduledJob['job']
|
||||
'scheduledJobId' => $scheduledJob->id,
|
||||
'executeTime' => $nextDate
|
||||
));
|
||||
$this->getEntityManager()->saveEntity($jobEntity);
|
||||
|
||||
$createdJobIdList[] = $jobEntity->id;
|
||||
}
|
||||
|
||||
return $createdJobIdList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,45 @@ 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);
|
||||
}
|
||||
$job = $entityManager->getEntity('ScheduledJob');
|
||||
$job->set(array(
|
||||
'job' => $jobName,
|
||||
'status' => 'Active',
|
||||
'scheduling' => $defs['scheduling'],
|
||||
'isInternal' => true,
|
||||
'name' => $jobName
|
||||
));
|
||||
$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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
65
application/Espo/Core/Export/Csv.php
Normal file
65
application/Espo/Core/Export/Csv.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?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;
|
||||
|
||||
class Csv extends \Espo\Core\Injectable
|
||||
{
|
||||
protected $dependencyList = [
|
||||
'config',
|
||||
'preferences'
|
||||
];
|
||||
|
||||
public function process($entityType, $params, $dataList)
|
||||
{
|
||||
if (!is_array($params['attributeList'])) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
485
application/Espo/Core/Export/Xlsx.php
Normal file
485
application/Espo/Core/Export/Xlsx.php
Normal file
@@ -0,0 +1,485 @@
|
||||
<?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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 \PHPExcel();
|
||||
$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
|
||||
)
|
||||
);
|
||||
|
||||
$sheet->setCellValue('A1', $exportName);
|
||||
|
||||
$sheet->setCellValue('B1', \PHPExcel_Shared_Date::PHPToExcel(strtotime(date('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 == '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('baseCurrency');
|
||||
$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", \PHPExcel_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", \PHPExcel_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 \PHPExcel_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 (array_key_exists($name, $row)) {
|
||||
$sheet->setCellValue("$col$rowNumber", $row[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$link = false;
|
||||
|
||||
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 = $this->getMetadata()->get(['entityDefs', $entityType, 'links', $name, '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(\PHPExcel_Style_NumberFormat::FORMAT_TEXT);
|
||||
|
||||
$startingRowNumber = 4;
|
||||
|
||||
foreach ($fieldList as $i => $name) {
|
||||
$col = $azRange[$i];
|
||||
$type = $typesCache[$name];
|
||||
|
||||
switch ($type) {
|
||||
case 'currency':
|
||||
case 'currencyConverted': {
|
||||
|
||||
} break;
|
||||
case 'int': {
|
||||
$sheet->getStyle($col.$startingRowNumber.':'.$col.$rowNumber)
|
||||
->getNumberFormat()
|
||||
->setFormatCode('0');
|
||||
} 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 = \PHPExcel_IOFactory::createWriter($phpExcel, 'Excel2007');
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
115
application/Espo/Core/FileStorage/Manager.php
Normal file
115
application/Espo/Core/FileStorage/Manager.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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\FileStorage;
|
||||
|
||||
use \Espo\Entities\Attachment;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Manager
|
||||
{
|
||||
private $implementations = array();
|
||||
|
||||
private $implementationClassNameMap = array();
|
||||
|
||||
private $container;
|
||||
|
||||
public function __construct(array $implementationClassNameMap, $container)
|
||||
{
|
||||
$this->implementationClassNameMap = $implementationClassNameMap;
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
private function getImplementation($storage = null)
|
||||
{
|
||||
if (!$storage) {
|
||||
$storage = 'EspoUploadDir';
|
||||
}
|
||||
|
||||
if (array_key_exists($storage, $this->implementations)) {
|
||||
return $this->implementations[$storage];
|
||||
}
|
||||
|
||||
if (!array_key_exists($storage, $this->implementationClassNameMap)) {
|
||||
throw new Error("FileStorageManager: Unknown storage '{$storage}'");
|
||||
}
|
||||
$className = $this->implementationClassNameMap[$storage];
|
||||
|
||||
$implementation = new $className();
|
||||
foreach ($implementation->getDependencyList() as $dependencyName) {
|
||||
$implementation->inject($dependencyName, $this->container->get($dependencyName));
|
||||
}
|
||||
$this->implementations[$storage] = $implementation;
|
||||
|
||||
return $implementation;
|
||||
}
|
||||
|
||||
public function isFile(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->isFile($attachment);
|
||||
}
|
||||
|
||||
public function getContents(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->getContents($attachment);
|
||||
}
|
||||
|
||||
public function putContents(Attachment $attachment, $contents)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->putContents($attachment, $contents);
|
||||
}
|
||||
|
||||
public function unlink(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->unlink($attachment);
|
||||
}
|
||||
|
||||
public function getLocalFilePath(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->getLocalFilePath($attachment);
|
||||
}
|
||||
|
||||
public function hasDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->hasDownloadUrl($attachment);
|
||||
}
|
||||
|
||||
public function getDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
$implementation = $this->getImplementation($attachment->get('storage'));
|
||||
return $implementation->getDownloadUrl($attachment);
|
||||
}
|
||||
}
|
||||
89
application/Espo/Core/FileStorage/Storages/Base.php
Normal file
89
application/Espo/Core/FileStorage/Storages/Base.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?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\FileStorage\Storages;
|
||||
|
||||
use \Espo\Core\Interfaces\Injectable;
|
||||
|
||||
abstract class Base implements Injectable
|
||||
{
|
||||
protected $dependencyList = [];
|
||||
|
||||
protected $injections = array();
|
||||
|
||||
public function inject($name, $object)
|
||||
{
|
||||
$this->injections[$name] = $object;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
}
|
||||
|
||||
protected function init()
|
||||
{
|
||||
}
|
||||
|
||||
protected function getInjection($name)
|
||||
{
|
||||
return $this->injections[$name];
|
||||
}
|
||||
|
||||
protected function addDependency($name)
|
||||
{
|
||||
$this->dependencyList[] = $name;
|
||||
}
|
||||
|
||||
protected function addDependencyList(array $list)
|
||||
{
|
||||
foreach ($list as $item) {
|
||||
$this->addDependency($item);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDependencyList()
|
||||
{
|
||||
return $this->dependencyList;
|
||||
}
|
||||
|
||||
abstract public function hasDownloadUrl(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function getDownloadUrl(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function unlink(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function getContents(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function isFile(\Espo\Entities\Attachment $attachment);
|
||||
|
||||
abstract public function putContents(\Espo\Entities\Attachment $attachment, $contents);
|
||||
|
||||
abstract public function getLocalFilePath(\Espo\Entities\Attachment $attachment);
|
||||
}
|
||||
85
application/Espo/Core/FileStorage/Storages/EspoUploadDir.php
Normal file
85
application/Espo/Core/FileStorage/Storages/EspoUploadDir.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?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\FileStorage\Storages;
|
||||
|
||||
use \Espo\Entities\Attachment;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class EspoUploadDir extends Base
|
||||
{
|
||||
protected $dependencyList = ['fileManager'];
|
||||
|
||||
protected function getFileManager()
|
||||
{
|
||||
return $this->getInjection('fileManager');
|
||||
}
|
||||
|
||||
public function unlink(Attachment $attachment)
|
||||
{
|
||||
return $this->getFileManager()->unlink($this->getFilePath($attachment));
|
||||
}
|
||||
|
||||
public function isFile(Attachment $attachment)
|
||||
{
|
||||
return $this->getFileManager()->isFile($this->getFilePath($attachment));
|
||||
}
|
||||
|
||||
public function getContents(Attachment $attachment)
|
||||
{
|
||||
return $this->getFileManager()->getContents($this->getFilePath($attachment));
|
||||
}
|
||||
|
||||
public function putContents(Attachment $attachment, $contents)
|
||||
{
|
||||
return $this->getFileManager()->putContents($this->getFilePath($attachment), $contents);
|
||||
}
|
||||
|
||||
public function getLocalFilePath(Attachment $attachment)
|
||||
{
|
||||
return $this->getFilePath($attachment);
|
||||
}
|
||||
|
||||
protected function getFilePath(Attachment $attachment)
|
||||
{
|
||||
$sourceId = $attachment->getSourceId();
|
||||
return 'data/upload/' . $sourceId;
|
||||
}
|
||||
|
||||
public function getDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function hasDownloadUrl(Attachment $attachment)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
92
application/Espo/Core/Formula/AttributeFetcher.php
Normal file
92
application/Espo/Core/Formula/AttributeFetcher.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?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\Formula;
|
||||
|
||||
use \Espo\ORM\Entity;
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class AttributeFetcher
|
||||
{
|
||||
private $relatedEntitiesCacheMap = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function fetch(Entity $entity, $attribute, $getFetchedAttribute = false)
|
||||
{
|
||||
if (!is_string($attribute)) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
if (strpos($attribute, '.') !== false) {
|
||||
$arr = explode('.', $attribute);
|
||||
|
||||
$key = $this->buildKey($entity, $arr[0]);
|
||||
if (!array_key_exists($key, $this->relatedEntitiesCacheMap)) {
|
||||
$this->relatedEntitiesCacheMap[$key] = $entity->get($arr[0]);
|
||||
}
|
||||
$relatedEntity = $this->relatedEntitiesCacheMap[$key];
|
||||
if ($relatedEntity && ($relatedEntity instanceof Entity) && count($arr) > 0) {
|
||||
return $this->fetch($relatedEntity, $arr[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
$methodName = 'get';
|
||||
if ($getFetchedAttribute) {
|
||||
$methodName = 'getFetched';
|
||||
}
|
||||
|
||||
if ($entity->getAttributeParam($attribute, 'isParentName') && $methodName == 'get') {
|
||||
$relationName = $entity->getAttributeParam($attribute, 'relation');
|
||||
if ($parent = $entity->get($relationName)) {
|
||||
return $parent->get('name');
|
||||
}
|
||||
} else if ($entity->getAttributeParam($attribute, 'isLinkMultipleIdList') && $methodName == 'get') {
|
||||
$relationName = $entity->getAttributeParam($attribute, 'relation');
|
||||
if (!$entity->has($attribute)) {
|
||||
$entity->loadLinkMultipleField($relationName);
|
||||
}
|
||||
}
|
||||
|
||||
return $entity->$methodName($attribute);
|
||||
}
|
||||
|
||||
public function resetRuntimeCache()
|
||||
{
|
||||
$this->relatedEntitiesCacheMap = array();
|
||||
}
|
||||
|
||||
protected function buildKey(Entity $entity, $link)
|
||||
{
|
||||
return spl_object_hash($entity) . '-' . $link;
|
||||
}
|
||||
}
|
||||
66
application/Espo/Core/Formula/Evaluator.php
Normal file
66
application/Espo/Core/Formula/Evaluator.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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\Formula;
|
||||
|
||||
use \Espo\Core\Exceptions\Error;
|
||||
|
||||
class Evaluator
|
||||
{
|
||||
private $functionFactory;
|
||||
|
||||
private $formula;
|
||||
|
||||
private $parser;
|
||||
|
||||
private $parsedHash;
|
||||
|
||||
public function __construct($container = null, array $functionClassNameMap = array(), array $parsedHash = array())
|
||||
{
|
||||
$this->functionFactory = new \Espo\Core\Formula\FunctionFactory($container, $functionClassNameMap);
|
||||
$this->formula = new \Espo\Core\Formula\Formula($this->functionFactory);
|
||||
$this->parser = new \Espo\Core\Formula\Parser();
|
||||
$this->parsedHash = array();
|
||||
}
|
||||
|
||||
public function process($expression, $entity = null, $variables = null)
|
||||
{
|
||||
if (!array_key_exists($expression, $this->parsedHash)) {
|
||||
$item = $this->parser->parse($expression);
|
||||
$this->parsedHash[$expression] = $item;
|
||||
} else {
|
||||
$item = $this->parsedHash[$expression];
|
||||
}
|
||||
|
||||
if (!$item || !($item instanceof \StdClass)) {
|
||||
throw new Error();
|
||||
}
|
||||
return $this->formula->process($item, $entity, $variables);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user