Compare commits

...

450 Commits
3.3.0 ... 3.6.2

Author SHA1 Message Date
yuri
725a2be959 fix resize 3 2015-08-28 14:30:17 +03:00
yuri
08b576105c fix nav resize 2 2015-08-28 14:24:27 +03:00
yuri
0e19fe087b fix email restricted appearance 2015-08-27 17:12:42 +03:00
yuri
44ddf9b400 fix acl manager 2015-08-27 15:29:30 +03:00
yuri
9509d00fd4 readOnlyDisabled option 2015-08-27 12:16:53 +03:00
yuri
70eb562400 fix user limit 2015-08-27 12:04:10 +03:00
yuri
6f89a01c50 convert lead improvements 2015-08-27 10:29:07 +03:00
yuri
2d85106a1f dont error 500 if try to follow entity w/o stream 2015-08-27 10:10:41 +03:00
yuri
a9cad90a02 hack issue with user theme and not rendered css 2015-08-26 12:07:53 +03:00
yuri
597d83c6f7 version 2015-08-25 16:18:16 +03:00
yuri
cbc3c3e921 fix theme 2015-08-25 16:17:03 +03:00
yuri
cdcaf7cd24 fix auth tokens 2015-08-24 14:49:53 +03:00
yuri
ce782ab8bd de_DE 2015-08-24 12:10:18 +03:00
yuri
8d179aa719 version 2015-08-20 15:36:41 +03:00
yuri
6688e19789 fix integration 2015-08-20 15:23:52 +03:00
yuri
1db8b94ea7 remove sticked panel 2015-08-20 14:40:16 +03:00
yuri
63a61349ea job name 3 2015-08-20 13:28:37 +03:00
yuri
811066a201 job name 2015-08-20 13:27:47 +03:00
yuri
0b547c26a2 fix jobs 2015-08-20 13:17:30 +03:00
yuri
15497b96d1 change colors 2015-08-20 12:11:14 +03:00
yuri
9c3cf0b8dd rename theme 2015-08-20 12:00:30 +03:00
yuri
eeaff7ac9d css fix 2015-08-20 11:54:35 +03:00
yuri
17e48c4e9f fix create 2015-08-20 11:02:23 +03:00
yuri
4a878c73be lang 2015-08-20 10:49:59 +03:00
yuri
f05e41afb6 global search margin 2015-08-18 15:27:24 +03:00
yuri
ba8e63c40b fix user 2015-08-18 12:47:42 +03:00
yuri
5d6b9b4785 fix email import 2015-08-18 12:32:45 +03:00
yuri
06c0a59632 fix hookManager 2 2015-08-18 11:19:03 +03:00
yuri
f6df48278c fix hookManager 2015-08-18 11:14:51 +03:00
yuri
8207684193 fix grantfile 2015-08-18 10:45:07 +03:00
yuri
49ac186f80 disable isReturn 2015-08-17 17:48:25 +03:00
yuri
4325e1591c return to list and edit attributes fix 2015-08-17 17:43:05 +03:00
yuri
16eb1e0b6d back button 2015-08-17 17:25:32 +03:00
yuri
68668acf57 fix calendar dashlet 2015-08-17 15:42:48 +03:00
yuri
5e5e82d6b6 lang 2015-08-17 15:35:19 +03:00
yuri
8e23ef59a3 lang 2015-08-17 15:34:44 +03:00
yuri
0213064217 fix preset filters dropdown 2015-08-17 12:55:06 +03:00
yuri
d360cbcb4b fix restrictedMode check 2015-08-17 11:22:06 +03:00
yuri
d1dea478f7 fix email notifications 2015-08-17 10:54:03 +03:00
yuri
778e7b335e request check fixes 2015-08-14 16:54:50 +03:00
yuri
5fc502c6a2 fix install css 2015-08-14 16:40:27 +03:00
yuri
ba5bd60931 fix xss in link multiple with role 2015-08-14 16:28:50 +03:00
yuri
dfb72bb3e1 lang change 2015-08-14 15:04:20 +03:00
yuri
c4880b77e6 layout reset to default 2015-08-14 15:02:32 +03:00
yuri
8aab9d17b1 controller action changes 2015-08-14 13:33:17 +03:00
yuri
205beb068c fix layouts 2015-08-14 12:26:55 +03:00
yuri
80cf2f2e10 fix mavbar css 2015-08-14 12:25:13 +03:00
yuri
5982b27b90 last 7 days filter 2015-08-14 12:12:38 +03:00
yuri
d696ca3013 returnUrl for list-edit 2015-08-14 11:46:16 +03:00
yuri
9d10218487 cleanup 2015-08-14 11:42:14 +03:00
yuri
b41ef6094a returnUrl for quick edit 2015-08-14 11:40:21 +03:00
yuri
9a9a69ace4 improve navbar for mobile view 2015-08-14 11:28:48 +03:00
yuri
1000139d01 dont fit modal height if window height is small 2015-08-14 09:47:10 +03:00
yuri
129984f4c6 unique joins 2015-08-13 17:42:03 +03:00
yuri
d665bc54e0 fix acl 2015-08-13 17:28:21 +03:00
yuri
69b027698d acl global search 2015-08-13 17:24:49 +03:00
yuri
6ffff16f06 global search pagination 2015-08-13 17:22:29 +03:00
yuri
79393f16d3 importove global search 2015-08-13 17:15:07 +03:00
yuri
5821a06f9e fix case 2015-08-13 15:02:28 +03:00
yuri
3eb4cf27f2 case - contact many-to-many 2015-08-13 14:54:31 +03:00
yuri
94c345c386 -sticked 2015-08-13 12:56:33 +03:00
yuri
6fe7853eb7 added new noification type message 2015-08-13 09:44:55 +03:00
yuri
c45ea08ab2 cleanup 2015-08-12 17:56:06 +03:00
yuri
04d41e9c86 fix iinsert image 2015-08-12 17:55:19 +03:00
yuri
2850cffc6a audited param 2015-08-12 16:28:12 +03:00
yuri
0cdc15ecaf rel panels filx 2015-08-12 15:13:22 +03:00
yuri
ee85ee369b select document filter 2015-08-12 15:08:57 +03:00
yuri
738e56cc63 field manager change 2015-08-12 14:43:11 +03:00
yuri
6b38e1561b fix pre 2015-08-11 16:55:22 +03:00
yuri
a56d8b7d1c default layoutSmall change 2015-08-11 16:53:37 +03:00
yuri
db6e5ee778 remove sticked from history panel 2015-08-11 15:46:03 +03:00
yuri
a0bf1af3d3 mass update for emails 2015-08-11 12:23:44 +03:00
yuri
5b47178162 createDisabled 2 2015-08-11 12:13:57 +03:00
yuri
3f0684c1ea createDisabled 2015-08-11 12:07:19 +03:00
yuri
d2bc49755d email address autocomplete 2 2015-08-11 11:52:07 +03:00
yuri
0502c1768b auto complete search by email address 2015-08-11 11:49:14 +03:00
yuri
cf7d21db32 keep emails unread 2015-08-11 11:15:16 +03:00
yuri
977fb47efb version 2015-08-10 17:03:31 +03:00
yuri
6c7a3adcdd email fix 2015-08-10 16:45:47 +03:00
yuri
3b22e08840 fix users activities 2015-08-10 16:34:18 +03:00
yuri
8d79524c62 extension.php 2015-08-10 15:37:32 +03:00
yuri
3c70f28dc0 ability to use standartizized view name 2015-08-10 15:00:50 +03:00
yuri
79b37e7047 dashlet row actions 2015-08-10 14:56:06 +03:00
yuri
3050d8b5b5 account history fix 2015-08-10 13:57:44 +03:00
yuri
231a40e4a8 notification entityRemoved 2015-08-10 13:45:01 +03:00
yuri
1f1c87513b set defaults 2015-08-10 12:26:51 +03:00
yuri
910822334e group email accounts 2015-08-10 10:56:51 +03:00
yuri
af02d721c3 try catch getMessage 2015-08-10 10:45:08 +03:00
yuri
faf7cb9acd lang 2015-08-10 10:33:56 +03:00
yuri
73869d5674 fix link multiple 2015-08-07 17:05:13 +03:00
yuri
f60732170e ability to disable field param in entity manager 2015-08-07 16:00:54 +03:00
yuri
aecf04a4f8 fix theme and user change 2015-08-07 15:41:06 +03:00
yuri
7a383912c8 system notification 2015-08-07 15:30:50 +03:00
yuri
21c288badf fix theme 2015-08-07 13:26:29 +03:00
yuri
65492ea1dc lead convertion follow 2015-08-07 12:08:58 +03:00
yuri
7fd10104cc task dashlet dont show deferred 2015-08-07 11:39:59 +03:00
yuri
ad85c6fa3f lang 2015-08-07 11:18:14 +03:00
yuri
e32bf06e4d lang typo 2015-08-07 10:56:26 +03:00
yuri
f363d77cb7 max size error message 2015-08-06 17:21:40 +03:00
yuri
8986b6f426 campaign budget 2015-08-06 16:24:48 +03:00
yuri
8b35c064c8 sacura vertical theme 2015-08-06 15:05:49 +03:00
yuri
da5ea180ab fix login 2015-08-06 14:55:33 +03:00
yuri
3aca557420 fix enum 2015-08-06 13:10:42 +03:00
yuri
ea723742c7 theme change 2015-08-06 12:55:32 +03:00
yuri
d85675f540 vertical theme 2015-08-06 12:21:00 +03:00
yuri
9b4aeb8e4c vertival theme dev 2015-08-05 18:23:20 +03:00
yuri
2c539b1fe6 jobs link 2015-08-05 16:05:33 +03:00
yuri
5f31e7e148 modal change var names 2015-08-05 15:53:25 +03:00
yuri
cc9227910f jobs 2015-08-05 15:49:23 +03:00
yuri
85d8dfe885 change diff 2015-08-05 14:06:33 +03:00
yuri
563179bec7 vertical theme mobile 2015-08-05 13:18:33 +03:00
yuri
386ada05d6 cleanup 2015-08-05 13:02:57 +03:00
yuri
70c2992282 theme in preferences 2015-08-05 12:35:57 +03:00
yuri
36d6483a51 ability to create custom note types 2015-08-05 10:36:27 +03:00
yuri
01039b9881 attachment multiple field 2015-08-05 10:25:45 +03:00
yuri
bbd1297302 attachment block 2015-08-05 09:38:41 +03:00
yuri
88c0d8810c css changes 2015-08-05 09:35:19 +03:00
yuri
b365bc17db fix record.base 2015-08-05 09:35:12 +03:00
yuri
3f24e64988 fix enum translation 2015-08-04 17:25:23 +03:00
yuri
7a5ce2f4ee fix theme 2015-08-04 17:11:37 +03:00
yuri
a410fb903a theme fixes 2015-08-04 16:21:27 +03:00
yuri
ba4004d720 theme fix 2015-08-04 16:07:51 +03:00
yuri
cdc980c2b6 theme fixes 2015-08-04 15:53:38 +03:00
yuri
3578cc9523 vertical theme 2015-08-04 15:49:35 +03:00
yuri
09ff1d1e5a mobile view collapse fix 2015-08-04 11:29:34 +03:00
yuri
8e4a6ef183 stick panels 2015-08-04 11:13:02 +03:00
yuri
0d111a6bd8 Opportunity listForAccount 2015-08-04 11:08:41 +03:00
yuri
3e503852db translate links 2015-08-04 10:55:23 +03:00
yuri
d3fe435115 theme changes 2015-08-04 09:51:07 +03:00
yuri
e6a0080c0e vertical theme 2015-08-03 17:06:12 +03:00
yuri
b8ddb72d3b color change 2015-08-03 14:45:49 +03:00
yuri
58953ca009 show total count 2015-08-03 14:43:21 +03:00
yuri
d4e98155d0 gitignore 2015-08-03 12:28:21 +03:00
yuri
86fabe3352 email: get rid of assigned user 2015-08-03 12:00:06 +03:00
yuri
c5ccf8e6da Enum is Sorted 2015-08-03 11:43:49 +03:00
yuri
b7e0a0de23 Merge branch 'hotfix/3.5.3' 2015-08-03 11:12:34 +03:00
yuri
9c2a18f0aa indestry options added 2015-08-03 11:11:50 +03:00
yuri
aa95f2cf88 change currency field 2015-08-03 11:00:27 +03:00
yuri
8dd7f262a2 color change 2015-07-31 17:22:46 +03:00
yuri
b76feba080 remove css 2015-07-31 17:18:57 +03:00
yuri
1b5aea85ba themes 2015-07-31 17:18:24 +03:00
yuri
c89c7f5e0e stylesheet 2015-07-31 11:25:58 +03:00
yuri
bcaaf539be remove fields from settings 2015-07-31 11:23:06 +03:00
yuri
48f0988373 stylesheet 2015-07-31 11:17:22 +03:00
yuri
a0c0d37bfd navbar fix 2015-07-31 10:44:03 +03:00
yuri
9c696fe8d6 navbar fix 2015-07-31 10:43:38 +03:00
yuri
224e3475d8 Merge branch 'hotfix/3.5.3' 2015-07-30 17:05:29 +03:00
yuri
841c5f85bd fix email import 2015-07-30 14:38:23 +03:00
yuri
6745419a4f install lang fix 2015-07-30 11:40:21 +03:00
yuri
6bf9bb875a email address search improvement 2015-07-30 11:12:49 +03:00
yuri
d6e1322775 Merge branch 'hotfix/3.5.3' 2015-07-30 10:07:41 +03:00
yuri
bb0e97160c fix task layout 2015-07-30 10:00:48 +03:00
yuri
8124ceea6b email import fix 2015-07-29 16:48:53 +03:00
yuri
b5cb0c0881 email import fix 2015-07-29 16:43:46 +03:00
yuri
8747ccc105 show error message reason 2015-07-29 15:06:03 +03:00
yuri
8b0147484c userLimit 2015-07-29 13:56:18 +03:00
yuri
233037a1eb adminPanelIframeUrl 2015-07-29 11:16:19 +03:00
yuri
11446ef857 dashlet actions 2015-07-29 10:21:04 +03:00
Taras Machyshyn
4403131235 Merge branch 'hotfix/3.5.3' 2015-07-29 09:47:43 +03:00
Taras Machyshyn
9dde3d0645 Fixed a bug for module orders 2015-07-29 09:46:49 +03:00
yuri
2fcf00ef4f Merge branch 'stable' 2015-07-28 17:52:43 +03:00
yuri
1139cb242b fix dashboard 2015-07-28 17:13:33 +03:00
yuri
796e1894ac added test 2015-07-28 16:03:05 +03:00
yuri
8d15bdab3c fix call layout 2015-07-28 15:11:00 +03:00
yuri
e94564b5e7 Merge branch 'hotfix/3.5.2' 2015-07-28 14:38:49 +03:00
yuri
67b56345e6 fix email iOS 2015-07-28 14:36:25 +03:00
yuri
9ac2fe1534 version 2015-07-27 16:39:00 +03:00
yuri
08cf619807 fix attachment acl and bad requests 2015-07-27 16:37:11 +03:00
yuri
380aad2f4d fix import phone 2015-07-27 12:28:33 +03:00
yuri
d3a8e57fdf fix loader 2015-07-27 11:58:35 +03:00
yuri
c6542c0698 restrictedMode 2015-07-27 11:02:42 +03:00
yuri
f74959ab00 fix user layout 2015-07-27 10:48:42 +03:00
yuri
2bb28ac270 Merge branch 'stable' 2015-07-24 17:04:59 +03:00
yuri
faf3350aab vesrion 2015-07-24 16:56:28 +03:00
yuri
9fc4e0b06e fix import 2015-07-24 14:58:00 +03:00
yuri
4c3ecf0b3a fix target list 2015-07-24 14:13:43 +03:00
yuri
b1a345963d fix email address field 2015-07-24 12:49:44 +03:00
yuri
ca64d7c8ec Merge branch 'hotfix/3.5.1' 2015-07-23 16:10:25 +03:00
yuri
f62db8b943 fix list 2015-07-23 16:09:51 +03:00
yuri
ce2a2a03a3 list changes 2015-07-23 14:50:15 +03:00
yuri
d947223b9b fix wysiwyg 2015-07-23 14:41:51 +03:00
yuri
b1aea34137 de_DE 2015-07-23 10:45:25 +03:00
yuri
ae6d03ce2b update summernote 2015-07-22 14:50:42 +03:00
yuri
fa4b459d58 update jquery 2015-07-22 10:52:58 +03:00
yuri
372a8d0d69 upgrade link change 2015-07-21 12:18:25 +03:00
yuri
bd413a75a0 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-07-20 14:37:42 +03:00
Taras Machyshyn
9bb0d123d3 Improved russian translation 2015-07-20 12:20:41 +03:00
yuri
59240fb090 entity list editable 2015-07-20 10:42:41 +03:00
yuri
598852484b change email to contact 2015-07-17 16:49:17 +03:00
yuri
18548c515e email address to contact change 2015-07-17 16:43:44 +03:00
yuri
6190017919 cleanup 2015-07-17 12:53:15 +03:00
yuri
e49cbcad3f search select text 2015-07-17 11:48:19 +03:00
yuri
2a22b94b95 bull update 2015-07-17 11:41:29 +03:00
yuri
739374de59 improve email address 2015-07-17 11:02:36 +03:00
yuri
03b8041acb email to contact 2 2015-07-16 17:59:26 +03:00
yuri
a31df6f2af from email to contact 2015-07-16 17:15:19 +03:00
yuri
64317389a8 clearnup 2015-07-16 15:51:58 +03:00
yuri
ab4552d064 fix task panel tabs 2015-07-16 11:46:00 +03:00
yuri
20281f8cbb cleanup 2015-07-16 11:35:55 +03:00
yuri
fb7db0f91d fix confirm leaveout 2015-07-15 15:19:02 +03:00
yuri
b3b0e9254f task attachments 2015-07-14 16:49:00 +03:00
yuri
03ffc7727d template fields 2015-07-14 13:04:34 +03:00
yuri
59a4f88eeb Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-07-13 17:38:45 +03:00
yuri
d504ab8f54 fix email template 2015-07-13 17:38:26 +03:00
Taras Machyshyn
627c167ef7 Added title tranlation for Integration Entity 2015-07-13 17:10:45 +03:00
yuri
656c9b1eee pdf font 2015-07-13 16:57:03 +03:00
yuri
92f319a2d9 template 2015-07-13 15:22:48 +03:00
yuri
da1f96595f entity manager fix 2015-07-13 11:25:36 +03:00
yuri
21568efa2c hide template entity 2015-07-13 10:07:14 +03:00
yuri
8a75a5a71b es_ES fix 2015-07-13 10:05:37 +03:00
yuri
012e4d609d fix select related 2015-07-13 10:03:42 +03:00
yuri
5e66d2e2c1 fix save issue 2015-07-10 18:37:58 +03:00
yuri
49ae22e048 public load addition fields 2015-07-10 17:31:42 +03:00
yuri
5d92d14125 fix 2015-07-10 17:19:58 +03:00
yuri
b6d52d3c97 template 2015-07-10 17:19:14 +03:00
yuri
7e2d445db8 pdf 2015-07-10 15:59:15 +03:00
yuri
2325ad695f cleanup 2015-07-10 15:55:59 +03:00
yuri
c499b06baa Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-07-10 15:48:35 +03:00
yuri
a03a512846 remove pdf from lead 2015-07-10 15:48:20 +03:00
yuri
1e6062bd10 update timezone 2015-07-10 14:51:34 +03:00
yuri
2c90558785 fix category loop 2015-07-10 14:40:29 +03:00
Taras Machyshyn
f6071bad41 Merge branch 'hotfix/3.4.3' 2015-07-10 12:44:43 +03:00
Taras Machyshyn
a09120f39e Merge branch 'hotfix/3.4.3' of ssh://172.20.0.1/var/git/espo/backend into hotfix/3.4.3 2015-07-10 12:42:40 +03:00
Taras Machyshyn
8fb7cbdfcf Espo installation, message error fixes 2015-07-10 12:42:09 +03:00
yuri
3e8da12410 pdf 2015-07-10 12:01:23 +03:00
yuri
d60213e93f pdf 2015-07-10 11:45:32 +03:00
yuri
0864f7d604 pdf 2015-07-09 17:57:16 +03:00
yuri
6fb2112e40 pdf 2015-07-09 17:18:27 +03:00
yuri
65bb063c2c fix email template 2015-07-09 16:06:31 +03:00
yuri
75b2c91baa object 2015-07-09 15:49:01 +03:00
yuri
530be71fdd acl: no access if scope is not in acl table 2015-07-09 15:17:07 +03:00
yuri
c064b8fa80 template 2015-07-09 14:55:34 +03:00
yuri
b2b0ed82e5 test addition 2015-07-09 11:33:36 +03:00
yuri
71a5e1ab22 number 2015-07-09 11:30:56 +03:00
yuri
371b140056 htmlizer\ 2015-07-08 15:40:52 +03:00
yuri
5555383b1e template fix 2015-07-07 16:40:46 +03:00
yuri
ffe824e405 remove sent storing from layout 2015-07-07 14:57:42 +03:00
yuri
6586785415 imap sent storing 2015-07-07 13:55:02 +03:00
yuri
8a2554ef28 fix preferences layout 2015-07-07 12:15:28 +03:00
yuri
ec2ddc429a version 2015-07-06 10:55:37 +03:00
yuri
1754b8e7b9 fix layouts 2015-07-03 11:16:40 +03:00
yuri
2e20b24d04 fix layouts 2015-07-03 11:14:39 +03:00
yuri
5da3df3cd2 format number fields 2015-07-03 11:02:04 +03:00
yuri
61d428a4a5 int field none 2015-07-03 10:46:45 +03:00
yuri
a941f0c5da fix wysiwyg 2015-07-03 10:01:26 +03:00
yuri
199d0a956a detail small 2 columns 2015-07-02 17:25:38 +03:00
yuri
105ec0f441 rename delete 2015-07-02 16:52:50 +03:00
yuri
062effd39a fix imap 2015-07-02 15:57:04 +03:00
yuri
3ac5c71736 update zend 2015-07-02 15:34:12 +03:00
yuri
97d7796f9d improve password change 2015-07-02 15:10:01 +03:00
yuri
8cd4fe5891 stream filter 2015-07-02 12:32:14 +03:00
yuri
77df445c03 signature with template 2015-07-02 10:18:16 +03:00
yuri
a510bb4ea0 ddefine 2015-07-01 16:12:24 +03:00
yuri
48883211ee email templates link 2015-07-01 15:58:29 +03:00
yuri
8b77f181da define 2015-07-01 15:51:58 +03:00
yuri
88dbc988ca minified js change 2015-07-01 15:07:44 +03:00
yuri
0ecd387ef8 version 2015-07-01 14:54:56 +03:00
yuri
2c4cc20005 fix shared email 2015-07-01 12:48:04 +03:00
yuri
b25c115913 define 2015-07-01 10:34:12 +03:00
yuri
e46921ac33 define 2015-06-30 17:10:19 +03:00
yuri
dab213ea01 define 2015-06-30 17:01:59 +03:00
yuri
7f058b8591 define 2015-06-30 16:48:49 +03:00
yuri
76cf945d40 define 2015-06-30 14:44:09 +03:00
yuri
c5850d18da define changes 2015-06-30 14:39:50 +03:00
yuri
645cdc440c define 2015-06-30 11:41:59 +03:00
yuri
6e910e002e define 2015-06-30 11:26:14 +03:00
yuri
cc4de320fd define 2015-06-30 11:14:42 +03:00
yuri
7565492666 define 2015-06-29 16:21:45 +03:00
yuri
878d74bfa5 fix tests 2015-06-29 12:42:48 +03:00
yuri
ee2d8b3f00 Merge branch 'hotfix/3.4.3' 2015-06-26 15:31:31 +03:00
yuri
ebd35638b2 create/select relation panel hooks 2015-06-26 15:31:02 +03:00
yuri
6372c7a22e panel events fix 2015-06-26 15:25:34 +03:00
yuri
a404f7f196 Merge branch 'hotfix/3.4.3' 2015-06-24 12:38:20 +03:00
yuri
0013ca382a fix translateOption 2015-06-24 12:38:11 +03:00
yuri
a9c904afa7 Merge branch 'hotfix/3.4.3' 2015-06-24 11:41:31 +03:00
yuri
a0be338676 fix variable 2015-06-24 11:41:02 +03:00
yuri
58d0f2bd98 fix followers 2015-06-23 18:12:22 +03:00
yuri
4c92d54119 Merge branch 'hotfix/3.4.3' 2015-06-23 16:17:08 +03:00
yuri
711b2df143 Merge branch 'hotfix/3.4.3' of ssh://172.20.0.1/var/git/espo/backend into hotfix/3.4.3 2015-06-23 16:16:51 +03:00
yuri
0307900942 acl dashlet 2015-06-23 16:14:43 +03:00
yuri
4c60898002 cleanup 2015-06-23 14:41:38 +03:00
yuri
4d350b256b fix fatal 2015-06-23 14:36:40 +03:00
yuri
d41704f1b1 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-23 11:37:06 +03:00
yuri
5bbb5ee937 fix test connection error msg 2015-06-23 11:36:01 +03:00
yuri
50e825b7a0 layout change 2015-06-23 11:31:40 +03:00
yuri
dc036225be fix view helper 2015-06-23 11:29:52 +03:00
Taras Machyshyn
c5a8df84f7 Merge branch 'hotfix/3.4.3' 2015-06-23 11:16:41 +03:00
Taras Machyshyn
7ad6c495a6 Improvements 2015-06-23 11:13:21 +03:00
yuri
e8c217e468 followed bool filter 2015-06-18 17:17:52 +03:00
yuri
9e32298d42 css 2015-06-17 16:38:00 +03:00
yuri
e4d833e49f css 2015-06-17 11:39:49 +03:00
yuri
8505f583f4 css 2015-06-17 11:38:24 +03:00
yuri
c1de2d9bd5 fix css 2015-06-16 11:34:11 +03:00
yuri
d192e0aabf fix css 2015-06-16 11:25:08 +03:00
yuri
fb5b464bf6 fix enum 2015-06-15 12:25:17 +03:00
yuri
eb71379562 fix unicode and multi enum storing 2015-06-15 12:17:49 +03:00
yuri
b603543537 layouts 2015-06-15 10:22:43 +03:00
yuri
344da24b5e fix stream fetched twice 2015-06-12 14:50:54 +03:00
yuri
23ef028cb4 fix varchar search 2015-06-12 12:06:19 +03:00
yuri
492d4869c2 disable cut param for text 2015-06-12 11:02:02 +03:00
yuri
56e45c32f8 fix draft 2015-06-12 10:24:00 +03:00
yuri
cb41c55e7a bottom mode 2015-06-11 16:42:58 +03:00
yuri
7d63eaf3e0 fix bottom panels 2015-06-11 16:34:03 +03:00
yuri
1538b08fd9 version 2015-06-11 14:06:11 +03:00
yuri
82a8914848 fix entity manager 2015-06-11 14:03:28 +03:00
yuri
2d5bf843d5 fix css 2015-06-11 12:22:37 +03:00
yuri
f22f6d54aa edit bottom 2015-06-11 12:20:11 +03:00
yuri
d609e4f70b fix merge and mass u pdate 2015-06-11 11:49:32 +03:00
yuri
8f56769e14 change document layout 2015-06-11 10:58:04 +03:00
yuri
fa5b2da69e change documnts 2015-06-11 10:52:14 +03:00
yuri
937202784d autocomplete category tree 2015-06-11 10:49:34 +03:00
yuri
07424df41a document mass update 2015-06-11 10:47:46 +03:00
yuri
e960ac472e version 2015-06-10 17:45:40 +03:00
yuri
84113356b5 fix mass update 2015-06-10 17:45:03 +03:00
yuri
3844946dc0 fix parent 2015-06-10 17:40:14 +03:00
yuri
9ecdf5713c fix create 2015-06-10 17:32:56 +03:00
yuri
f1abd22512 fix email template 2015-06-10 15:40:26 +03:00
yuri
c963058571 improve field hide/show 2015-06-10 12:04:23 +03:00
yuri
7e264780ec fix acl 2015-06-09 16:29:46 +03:00
Taras Machyshyn
0750a89f74 Ukrainian corrections 2015-06-09 16:07:47 +03:00
Taras Machyshyn
5b52668359 Fixed metadata cache bug 2015-06-09 15:51:23 +03:00
Taras Machyshyn
3c91f8450d Bug fixing 2015-06-09 14:05:01 +03:00
yuri
f820168283 Merge branch 'hotfix/3.3.1' 2015-06-09 12:54:37 +03:00
yuri
bdb90a0016 Merge branch 'hotfix/3.3.1' of ssh://172.20.0.1/var/git/espo/backend into hotfix/3.3.1 2015-06-09 12:54:20 +03:00
yuri
521fa42bf1 fix layout 2015-06-09 12:25:15 +03:00
yuri
1b272ea0c7 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-09 12:22:01 +03:00
Taras Machyshyn
b055adfd87 Updated composer.lock file 2015-06-09 12:21:46 +03:00
yuri
42ea6e0d7c cleanup 2015-06-09 12:11:17 +03:00
yuri
20b21622ed layout manager improvement 2015-06-09 11:57:11 +03:00
yuri
34c61a2fc5 lang 2015-06-09 10:47:43 +03:00
yuri
cf8198dc98 version 2015-06-09 10:31:30 +03:00
yuri
c57fd2c55e Merge branch 'master' of https://github.com/espocrm/espocrm 2015-06-08 17:52:57 +03:00
yuri
3669bf4e11 fix modal 2015-06-08 17:29:58 +03:00
yuri
b6bbdada06 modal fit height 2015-06-08 17:17:14 +03:00
yuri
804a618408 folders width 2015-06-05 15:27:07 +03:00
yuri
a1192474d9 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-05 14:53:24 +03:00
yuri
dd28642370 setReadOnly form action 2015-06-05 14:53:11 +03:00
Taras Machyshyn
b92295cbb1 Installer: added check PHP < 5.4.0 2015-06-05 13:08:47 +03:00
Taras Machyshyn
d186cd2b1a Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-05 12:23:18 +03:00
Taras Machyshyn
9ebee47d5c Orm converter improvements 2015-06-05 12:23:05 +03:00
yuri
3fdc7c8cf7 create button change 2015-06-05 11:10:07 +03:00
Yuri Kuznetsov
b298b26bab Merge pull request #53 from alasdaircr/attr-not-empty
Fix ifAttrNotEmpty failing with boolean attributes
2015-06-05 10:17:54 +03:00
Alasdair Campbell
0a38857e64 Fix ifAttrNotEmpty failing with boolean attributes 2015-06-05 00:06:31 +01:00
yuri
2497e9bd88 fix modals 2015-06-04 17:52:24 +03:00
yuri
bee44612e5 external account id max length 2015-06-04 11:33:11 +03:00
Yuri Kuznetsov
8946b4ad11 Merge pull request #52 from alasdaircr/post-entrypoints
PATCH: Allow POST entrypoints
2015-06-04 10:10:34 +03:00
Alasdair Campbell
d4b78b9977 PATCH: Allow POST entrypoints 2015-06-03 16:12:17 +01:00
yuri
f9614385df Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-03 16:30:22 +03:00
yuri
7352abebe9 activities control 2015-06-03 16:30:12 +03:00
yuri
5c57b34893 user activities 2015-06-03 15:55:13 +03:00
yuri
0d873b7302 fix campaign fields 2015-06-03 12:41:06 +03:00
yuri
ccca6a8f55 fix fullForm link 2015-06-03 11:16:09 +03:00
Taras Machyshyn
bad9cc848f Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-02 17:31:18 +03:00
Taras Machyshyn
e3ab16a7bf Merge branch 'hotfix/3.3.1' 2015-06-02 17:31:04 +03:00
Taras Machyshyn
6db068e625 Improve Extension installation 2015-06-02 17:29:58 +03:00
Taras Machyshyn
64b1ac3ccf Rebuild fixes 2015-06-02 17:23:57 +03:00
yuri
ca038970ff folders notify 2015-06-02 17:11:39 +03:00
yuri
4d852c8515 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-06-02 17:09:00 +03:00
yuri
b96ea5100b modals select 2015-06-02 17:05:51 +03:00
yuri
fd86727bfc scopes in entity templates 2015-06-02 15:52:54 +03:00
yuri
8dacf66242 record tree create acl 2015-06-02 15:44:36 +03:00
Taras Machyshyn
bbb4271dd1 Merge branch 'hotfix/3.3.1' 2015-06-02 15:33:45 +03:00
Taras Machyshyn
8b72499c19 Databse rebuild fixes 2015-06-02 15:31:20 +03:00
yuri
0a9a5a47af document folders 3 2015-06-02 12:19:28 +03:00
yuri
4304724315 disable isOverdue field 2015-06-02 11:02:37 +03:00
yuri
8dc3c146e0 fix 2015-05-29 18:14:50 +03:00
yuri
7cefff04a7 document folders 2 2015-05-29 17:18:42 +03:00
yuri
dd6d6995b9 row actions active fix 2015-05-28 16:59:36 +03:00
yuri
3606dc39e3 document folder 1 2015-05-28 16:19:37 +03:00
yuri
03fef2fc8c Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-05-28 11:38:16 +03:00
yuri
704e548654 opp lead source disable customization and none for empty 2015-05-28 11:35:26 +03:00
yuri
6120d5501d fix followers order 2015-05-28 10:47:13 +03:00
Taras Machyshyn
3f8c338265 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-05-27 17:19:18 +03:00
Taras Machyshyn
ec07b23af8 Test corrections 2015-05-27 17:19:04 +03:00
yuri
cc349ca545 tooltip 2015-05-27 16:39:36 +03:00
yuri
b16ec66eb3 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-05-27 16:34:31 +03:00
yuri
22667e17f1 Repository: leftJoin method 2015-05-27 16:34:18 +03:00
yuri
5741834d53 fix test 2015-05-27 16:32:18 +03:00
yuri
0df39cdc4f fix middle tables 2015-05-27 16:30:36 +03:00
yuri
70489e8846 email loop prevention and query middle table change 2015-05-27 16:17:45 +03:00
Taras Machyshyn
c4558ec633 Merge branch 'hotfix/3.3.1' 2015-05-27 16:03:09 +03:00
Taras Machyshyn
5b500ae42a Added support UTF-8 strings for saved JSON data 2015-05-27 16:01:24 +03:00
yuri
cdbe6a2383 active filter 2 2015-05-26 16:32:29 +03:00
yuri
48c650eab2 user active filter 2015-05-26 16:31:33 +03:00
yuri
0c815b5761 followers 3 2015-05-26 16:17:24 +03:00
yuri
9b104b9a16 followers 2 2015-05-26 12:26:30 +03:00
yuri
97248e2b18 fix users panel 2015-05-26 11:41:15 +03:00
yuri
b3aa244f4e fix side panels 2015-05-26 11:40:13 +03:00
yuri
45c59ff242 fix createRelated 2015-05-26 11:30:25 +03:00
yuri
0038c3666d followers 1 2015-05-26 11:25:29 +03:00
yuri
7cfebbf87e fix entryPoint error messages 2015-05-26 10:34:57 +03:00
yuri
0cd3666a96 Merge branch 'hotfix/3.3.1' 2015-05-25 11:15:06 +03:00
yuri
d4a5f68398 fix before remove 2015-05-25 11:14:53 +03:00
yuri
1a30a9c29a pre-loader huck 2015-05-22 16:51:20 +03:00
yuri
cd75ddbbd7 select filter search 2015-05-22 16:46:03 +03:00
yuri
55aedb7194 selectRelated filters 2015-05-22 15:40:37 +03:00
yuri
aa303d164f reply from histpry panel 2015-05-22 15:17:55 +03:00
yuri
1723f63b21 label 2015-05-22 11:47:16 +03:00
yuri
55fef695ec fix panels 2015-05-22 11:42:44 +03:00
yuri
42ee41ae54 cleanup 2015-05-22 11:10:03 +03:00
yuri
676f480db8 full form on modal header 2015-05-21 15:34:07 +03:00
yuri
233408b076 wysiwyg size and scroll 2 2015-05-21 14:55:05 +03:00
yuri
9dfec82f6e fix frontend acl 2015-05-21 12:33:21 +03:00
yuri
3c791b6363 wysiwyg size and scroll 2015-05-21 11:39:51 +03:00
yuri
5a0e5f6804 total count in title 2015-05-21 11:13:25 +03:00
yuri
3376ab06d0 improve reply email 2015-05-21 11:01:42 +03:00
yuri
e8b22f9331 remove email ico 2015-05-21 10:33:59 +03:00
yuri
0b9104f992 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-05-20 17:12:28 +03:00
yuri
566d0e50a6 unlink all 2015-05-20 17:11:55 +03:00
yuri
be5a6a0ee0 fix controller 2015-05-20 16:10:07 +03:00
yuri
4df460d6cb fix paneld 2015-05-20 14:31:20 +03:00
yuri
7443c969b1 refactor panels 2015-05-20 14:27:38 +03:00
Taras Machyshyn
3b5b1fb1b3 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-05-20 13:05:18 +03:00
Taras Machyshyn
5737927e2d Merge branch 'hotfix/3.3.1' 2015-05-20 13:05:01 +03:00
Taras Machyshyn
c59b837315 Fixed a bug with '__APPEND__' merge 2015-05-20 13:03:33 +03:00
yuri
ce75b68df0 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2015-05-20 12:02:51 +03:00
yuri
d17257fc95 link fields filters fix 2015-05-20 12:02:07 +03:00
Taras Machyshyn
ed996eff43 Merge branch 'hotfix/3.3.1' 2015-05-20 10:57:20 +03:00
Taras Machyshyn
8f70c32687 Correction Ukrainian translation 2015-05-20 10:36:08 +03:00
yuri
d134db65a3 fix varchar searc 2015-05-19 18:07:56 +03:00
yuri
deaa3f3f73 fix varchar searc 2015-05-19 18:05:50 +03:00
yuri
5f5f6dcf38 fix query sanitize 2015-05-19 15:31:06 +03:00
yuri
8e373a9c33 fix warnings 2015-05-19 15:23:44 +03:00
yuri
f7a367d755 email to case 2015-05-19 15:17:11 +03:00
yuri
fea113269b compose email from detail view imporovement 2015-05-19 15:01:36 +03:00
yuri
5299da7a21 contact target list for import 2015-05-19 12:28:39 +03:00
yuri
9a06ee3221 opted out panel 2015-05-19 12:16:40 +03:00
yuri
5b489e2341 target list opted out api 2015-05-19 11:48:43 +03:00
yuri
5b0e4f910d fix target list add 2015-05-18 18:10:43 +03:00
Taras Machyshyn
575a4f12cc Fixed a bug with deleting/adding an autoincrement field 2015-05-18 16:14:55 +03:00
yuri
9b77f74e53 optedOut column 2015-05-18 12:02:34 +03:00
yuri
7be801c647 target list btn style 2015-05-18 11:30:14 +03:00
yuri
a95471a239 fix lang 2015-05-18 11:26:54 +03:00
yuri
8982993813 dropdownItemList 2015-05-18 11:25:17 +03:00
Taras Machyshyn
cc48dc2a65 Fixed a bug with module 'order' option 2015-05-18 10:47:21 +03:00
yuri
9e0d8632f5 email ui improvements 2015-05-15 17:46:17 +03:00
yuri
2f751085e0 bcc 2015-05-15 17:37:06 +03:00
yuri
f5faae13c4 email icon 2 2015-05-15 17:30:04 +03:00
yuri
015fd4014c email ico 2015-05-15 17:22:11 +03:00
yuri
ff9c68d7f6 createdAccount filter 2015-05-15 16:45:28 +03:00
yuri
323138eebf filter email by subject 2015-05-15 16:36:42 +03:00
yuri
43f15252bb relatedAttributeFunctions 2015-05-15 15:26:17 +03:00
yuri
25ad4ffa43 campaign and document small improvements 2015-05-15 15:06:50 +03:00
yuri
0cd3a464d8 acl improvement 2015-05-15 12:15:14 +03:00
yuri
71e9b313bb campaign label 2015-05-15 11:08:12 +03:00
yuri
9b13f82c55 selectize 2015-05-15 11:01:57 +03:00
yuri
20cf214187 stream hover 2015-05-14 12:26:26 +03:00
yuri
2d06568470 hover list row 2015-05-14 12:19:09 +03:00
yuri
59ccd121c5 fix modal in notification 2015-05-14 11:18:47 +03:00
yuri
caa0256f19 fix email notification 2015-05-14 10:54:13 +03:00
809 changed files with 15402 additions and 5664 deletions

5
.gitignore vendored
View File

@@ -9,7 +9,10 @@
/client
/test.php
/main.html
/frontend/client/css/bootstrap.css
/frontend/client/css/espo.css
/frontend/client/css/espo-vertical.css
/frontend/client/css/sakura.css
/frontend/client/css/sakura-vertical.css
/tests/testData/cache/*
composer.phar
vendor/

View File

@@ -15,6 +15,7 @@ DirectoryIndex index.php index.html
RewriteRule ^/?data/logs/ - [F]
RewriteRule ^/?data/cache/ - [F]
RewriteRule ^/?data/upload/ - [F]
RewriteRule ^/?data/\.backup/ - [F]
RewriteRule ^/?application/ - [F]
RewriteRule ^/?custom/ - [F]
RewriteRule ^/?vendor/ - [F]

View File

@@ -21,7 +21,7 @@
module.exports = function (grunt) {
var jsFilesToMinify = [
'client/lib/jquery-2.0.2.min.js',
'client/lib/jquery-2.1.4.min.js',
'client/lib/underscore-min.js',
'client/lib/backbone-min.js',
'client/lib/handlebars.js',
@@ -36,34 +36,8 @@ module.exports = function (grunt) {
'client/lib/bull.min.js',
'client/src/namespace.js',
'client/src/exceptions.js',
'client/src/app.js',
'client/src/utils.js',
'client/src/storage.js',
'client/src/loader.js',
'client/src/pre-loader.js',
'client/src/ui.js',
'client/src/acl.js',
'client/src/model.js',
'client/src/model-offline.js',
'client/src/metadata.js',
'client/src/language.js',
'client/src/cache.js',
'client/src/controller.js',
'client/src/router.js',
'client/src/date-time.js',
'client/src/field-manager.js',
'client/src/search-manager.js',
'client/src/collection.js',
'client/src/multi-collection.js',
'client/src/view-helper.js',
'client/src/layout-manager.js',
'client/src/model-factory.js',
'client/src/collection-factory.js',
'client/src/models/settings.js',
'client/src/models/user.js',
'client/src/models/preferences.js',
'client/src/controllers/base.js',
'client/src/view.js',
'client/src/utils.js'
];
grunt.initConfig({
@@ -85,22 +59,44 @@ module.exports = function (grunt) {
final: ['build/tmp'],
},
less: {
bootstrap: {
espo: {
options: {
yuicompress: true,
},
files: {
'frontend/client/css/bootstrap.css': 'frontend/less/espo/main.less',
'frontend/client/css/espo.css': 'frontend/less/espo/main.less',
},
},
sakura: {
options: {
yuicompress: true,
},
files: {
'frontend/client/css/sakura.css': 'frontend/less/sakura/main.less',
},
},
espoVertical: {
options: {
yuicompress: true,
},
files: {
'frontend/client/css/espo-vertical.css': 'frontend/less/espo-vertical/main.less',
},
},
sakuraVertical: {
options: {
yuicompress: true,
},
files: {
'frontend/client/css/sakura-vertical.css': 'frontend/less/sakura-vertical/main.less',
},
}
},
cssmin: {
minify: {
files: {
'build/tmp/client/css/espo.min.css': [
'frontend/client/css/bootstrap.css',
'frontend/client/css/datepicker.css',
'frontend/client/css/jquery.timepicker.css',
'build/tmp/client/css/espo.css': [
'frontend/client/css/espo.css',
]
}
},
@@ -157,6 +153,7 @@ module.exports = function (grunt) {
'rebuild.php',
'clear_cache.php',
'upgrade.php',
'extension.php',
'index.php',
'LICENSE.txt',
'.htaccess',

View File

@@ -22,8 +22,10 @@
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error,
\Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\NotFound;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class Admin extends \Espo\Core\Controllers\Base
{
@@ -34,17 +36,19 @@ class Admin extends \Espo\Core\Controllers\Base
}
}
public function actionRebuild($params, $data)
public function postActionRebuild($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
$result = $this->getContainer()->get('dataManager')->rebuild();
return $result;
}
public function actionClearCache($params, $data)
public function postActionClearCache($params, $data)
{
$result = $this->getContainer()->get('dataManager')->clearCache();
return $result;
}
@@ -55,8 +59,13 @@ class Admin extends \Espo\Core\Controllers\Base
return $scheduledJob->getAllNamesOnly();
}
public function actionUploadUpgradePackage($params, $data)
public function postActionUploadUpgradePackage($params, $data)
{
if ($this->getConfig()->get('restrictedMode')) {
if (!$this->getUser()->get('isSuperAdmin')) {
throw new Forbidden();
}
}
$upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer());
$upgradeId = $upgradeManager->upload($data);
@@ -68,10 +77,15 @@ class Admin extends \Espo\Core\Controllers\Base
);
}
public function actionRunUpgrade($params, $data)
public function postActionRunUpgrade($params, $data)
{
$upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer());
if ($this->getConfig()->get('restrictedMode')) {
if (!$this->getUser()->get('isSuperAdmin')) {
throw new Forbidden();
}
}
$upgradeManager = new \Espo\Core\UpgradeManager($this->getContainer());
$upgradeManager->install($data);
return true;

View File

@@ -31,15 +31,20 @@ class App extends \Espo\Core\Controllers\Base
$preferences = $this->getPreferences()->toArray();
unset($preferences['smtpPassword']);
$user = $this->getUser();
if (!$user->has('teamsIds')) {
$user->loadLinkMultipleField('teams');
}
return array(
'user' => $this->getUser()->toArray(),
'user' => $user->toArray(),
'acl' => $this->getAcl()->getMap(),
'preferences' => $preferences,
'token' => $this->getUser()->get('token')
);
}
public function actionDestroyAuthToken($params, $data)
public function postActionDestroyAuthToken($params, $data)
{
$token = $data['token'];
if (empty($token)) {

View File

@@ -18,25 +18,32 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class Attachment extends \Espo\Core\Controllers\Record
{
public function actionUpload($params, $data)
{
public function actionUpload($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
list($prefix, $contents) = explode(',', $data);
$contents = base64_decode($contents);
$attachment = $this->getEntityManager()->getEntity('Attachment');
$this->getEntityManager()->saveEntity($attachment);
$this->getEntityManager()->saveEntity($attachment);
$this->getContainer()->get('fileManager')->putContents('data/upload/' . $attachment->id, $contents);
return array(
'attachmentId' => $attachment->id
);
);
}
}

View File

@@ -18,49 +18,49 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
class AuthToken extends \Espo\Core\Controllers\Record
{
{
protected function checkControllerAccess()
{
if (!$this->getUser()->isAdmin()) {
throw new Forbidden();
}
}
public function actionUpdate($params, $data)
{
throw new Forbidden();
}
}
public function actionCreate($params, $data)
{
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)
{
throw new Forbidden();
}
}
}

View File

@@ -23,6 +23,7 @@
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class EmailAccount extends \Espo\Core\Controllers\Record
{

View File

@@ -58,6 +58,11 @@ class Extension extends \Espo\Core\Controllers\Record
if (!$request->isPost()) {
throw new Forbidden();
}
if ($this->getConfig()->get('restrictedMode')) {
if (!$this->getUser()->get('isSuperAdmin')) {
throw new Forbidden();
}
}
$manager = new \Espo\Core\ExtensionManager($this->getContainer());
@@ -71,11 +76,14 @@ class Extension extends \Espo\Core\Controllers\Record
if (!$request->isPost()) {
throw new Forbidden();
}
if ($this->getConfig()->get('restrictedMode')) {
if (!$this->getUser()->get('isSuperAdmin')) {
throw new Forbidden();
}
}
$manager = new \Espo\Core\ExtensionManager($this->getContainer());
$manager->uninstall($data);
return true;
}
@@ -99,12 +107,18 @@ class Extension extends \Espo\Core\Controllers\Record
throw new Forbidden();
}
public function actionDelete($params)
public function actionDelete($params, $data, $request)
{
if (!$request->isDelete()) {
throw BadRequest();
}
if ($this->getConfig()->get('restrictedMode')) {
if (!$this->getUser()->get('isSuperAdmin')) {
throw new Forbidden();
}
}
$manager = new \Espo\Core\ExtensionManager($this->getContainer());
$manager->delete($params);
return true;
}

View File

@@ -18,12 +18,13 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class ExternalAccount extends \Espo\Core\Controllers\Record
{
@@ -34,7 +35,7 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
$integrations = $this->getEntityManager()->getRepository('Integration')->find();
$arr = array();
foreach ($integrations as $entity) {
if ($entity->get('enabled') && $this->getMetadata()->get('integrations.' . $entity->id .'.allowUserAccounts')) {
if ($entity->get('enabled') && $this->getMetadata()->get('integrations.' . $entity->id .'.allowUserAccounts')) {
$arr[] = array(
'id' => $entity->id
);
@@ -77,15 +78,18 @@ class ExternalAccount extends \Espo\Core\Controllers\Record
return $entity->toArray();
}
public function actionUpdate($params, $data)
public function actionUpdate($params, $data, $request)
{
return $this->actionPatch($params, $data);
return $this->actionPatch($params, $data, $request);
}
public function actionPatch($params, $data)
public function actionPatch($params, $data, $request)
{
list($integration, $userId) = explode('__', $params['id']);
if (!$request->isPost() && !$request->isPatch()) {
throw new BadRequest();
}
list($integration, $userId) = explode('__', $params['id']);
if ($this->getUser()->id != $userId) {
throw new Forbidden();

View File

@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
@@ -30,10 +30,10 @@ class GlobalSearch extends \Espo\Core\Controllers\Base
public function actionSearch($params, $data, $request)
{
$query = $params['query'];
$offset = $request->get('offset');
$maxSize = $request->get('maxSize');
$offset = intval($request->get('offset'));
$maxSize = intval($request->get('maxSize'));
return $this->getService('GlobalSearch')->find($query, $offset, $maxSize);
}
}

View File

@@ -71,10 +71,14 @@ class Import extends \Espo\Core\Controllers\Record
return $this->getContainer()->get('entityManager');
}
public function actionUploadFile($params, $data)
public function actionUploadFile($params, $data, $request)
{
$contents = $data;
if (!$request->isPost()) {
throw new BadRequest();
}
$attachment = $this->getEntityManager()->getEntity('Attachment');
$attachment->set('type', 'text/csv');
$attachment->set('role', 'Import File');
@@ -88,24 +92,34 @@ class Import extends \Espo\Core\Controllers\Record
);
}
public function actionRevert($params, $data)
public function actionRevert($params, $data, $request)
{
if (empty($data['id'])) {
throw new BadRequest();
}
if (!$request->isPost()) {
throw new BadRequest();
}
return $this->getService('Import')->revert($data['id']);
}
public function actionRemoveDuplicates($params, $data)
public function actionRemoveDuplicates($params, $data, $request)
{
if (empty($data['id'])) {
throw new BadRequest();
}
if (!$request->isPost()) {
throw new BadRequest();
}
return $this->getService('Import')->removeDuplicates($data['id']);
}
public function actionCreate($params, $data)
public function actionCreate($params, $data, $request)
{
if (!$request->isPost() && !$request->isPut()) {
throw new BadRequest();
}
$importParams = array(
'headerRow' => $data['headerRow'],
'fieldDelimiter' => $data['fieldDelimiter'],

View File

@@ -22,6 +22,9 @@
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class InboundEmail extends \Espo\Core\Controllers\Record
{
protected function checkControllerAccess()

View File

@@ -18,21 +18,23 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class Integration extends \Espo\Core\Controllers\Record
{
{
protected function checkControllerAccess()
{
if (!$this->getUser()->isAdmin()) {
throw new Forbidden();
}
}
public function actionIndex($params, $data, $request)
{
return false;
@@ -40,22 +42,25 @@ class Integration extends \Espo\Core\Controllers\Record
public function actionRead($params, $data, $request)
{
$entity = $this->getEntityManager()->getEntity('Integration', $params['id']);
$entity = $this->getEntityManager()->getEntity('Integration', $params['id']);
return $entity->toArray();
}
public function actionUpdate($params, $data)
public function actionUpdate($params, $data, $request)
{
return $this->actionPatch($params, $data);
return $this->actionPatch($params, $data, $request);
}
public function actionPatch($params, $data)
public function actionPatch($params, $data, $request)
{
if (!$request->isPut() && !$request->isPatch()) {
throw new BadRequest();
}
$entity = $this->getEntityManager()->getEntity('Integration', $params['id']);
$entity->set($data);
$this->getEntityManager()->saveEntity($entity);
return $entity->toArray();
return $entity->toArray();
}
}

View File

@@ -0,0 +1,72 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
class Job extends \Espo\Core\Controllers\Record
{
protected function checkControllerAccess()
{
if (!$this->getUser()->isAdmin()) {
throw new Forbidden();
}
}
public function actionCreate($params, $data)
{
throw new Forbidden();
}
public function actionUpdate($params, $data)
{
throw new Forbidden();
}
public function actionPatch($params, $data)
{
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)
{
throw new Forbidden();
}
public function actionRemoveLink($params, $data)
{
throw new Forbidden();
}
}

View File

@@ -26,6 +26,7 @@ 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 Layout extends \Espo\Core\Controllers\Base
{
@@ -38,12 +39,16 @@ class Layout extends \Espo\Core\Controllers\Base
return $data;
}
public function actionUpdate($params, $data)
public function actionUpdate($params, $data, $request)
{
if (!$this->getUser()->isAdmin()) {
throw new Forbidden();
}
if (!$request->isPut() && !$request->isPatch()) {
throw new BadRequest();
}
$layoutManager = $this->getContainer()->get('layout');
$layoutManager->set($data, $params['scope'], $params['name']);
$result = $layoutManager->save();
@@ -57,8 +62,20 @@ class Layout extends \Espo\Core\Controllers\Base
return $layoutManager->get($params['scope'], $params['name']);
}
public function actionPatch($params, $data)
public function actionPatch($params, $data, $request)
{
return $this->actionUpdate($params, $data);
return $this->actionUpdate($params, $data, $request);
}
public function actionResetToDefault($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (empty($data['scope']) || empty($data['name'])) {
throw new BadRequest();
}
return $this->getContainer()->get('layout')->resetToDefault($data['scope'], $data['name']);
}
}

View File

@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
@@ -32,32 +32,32 @@ class Notification extends \Espo\Core\Controllers\Base
{
$scope = $params['scope'];
$id = $params['id'];
$userId = $this->getUser()->id;
$offset = intval($request->get('offset'));
$maxSize = intval($request->get('maxSize'));
$maxSize = intval($request->get('maxSize'));
$params = array(
'offset' => $offset,
'maxSize' => $maxSize,
);
$result = $this->getService('Notification')->getList($userId, $params);
$result = $this->getService('Notification')->getList($userId, $params);
return array(
'total' => $result['total'],
'list' => $result['collection']->toArray()
);
}
public function actionNotReadCount()
{
$userId = $this->getUser()->id;
return $this->getService('Notification')->getNotReadCount($userId);
}
public function actionMarkAllRead($params, $data, $request)
public function postActionMarkAllRead($params, $data, $request)
{
$userId = $this->getUser()->id;
return $this->getService('Notification')->markAllRead($userId);

View File

@@ -53,27 +53,34 @@ class Preferences extends \Espo\Core\Controllers\Base
}
}
public function actionDelete($params, $data)
public function actionDelete($params, $data, $request)
{
$userId = $params['id'];
if (empty($userId)) {
throw new BadRequest();
}
if (!$request->isDelete()) {
throw new BadRequest();
}
$this->handleUserAccess($userId);
return $this->getEntityManager()->getRepository('Preferences')->resetToDefaults($userId);
}
public function actionPatch($params, $data)
public function actionPatch($params, $data, $request)
{
return $this->actionUpdate($params, $data);
return $this->actionUpdate($params, $data, $request);
}
public function actionUpdate($params, $data)
public function actionUpdate($params, $data, $request)
{
$userId = $params['id'];
$this->handleUserAccess($userId);
if (!$request->isPost() && !$request->isPatch()) {
throw new BadRequest();
}
if (array_key_exists('smtpPassword', $data)) {
$data['smtpPassword'] = $this->getCrypt()->encrypt($data['smtpPassword']);
}

View File

@@ -24,6 +24,7 @@ namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class Settings extends \Espo\Core\Controllers\Base
{
@@ -46,17 +47,21 @@ class Settings extends \Espo\Core\Controllers\Base
return $this->getConfigData();
}
public function actionUpdate($params, $data)
public function actionUpdate($params, $data, $request)
{
return $this->actionPatch($params, $data);
return $this->actionPatch($params, $data, $request);
}
public function actionPatch($params, $data)
public function actionPatch($params, $data, $request)
{
if (!$this->getUser()->isAdmin()) {
throw new Forbidden();
}
if (!$request->isPut() && !$request->isPatch()) {
throw new BadRequest();
}
if (isset($data['useCache']) && $data['useCache'] != $this->getConfig()->get('useCache')) {
$this->getContainer()->get('dataManager')->clearCache();
}

View File

@@ -38,6 +38,7 @@ class Stream extends \Espo\Core\Controllers\Base
$offset = intval($request->get('offset'));
$maxSize = intval($request->get('maxSize'));
$after = $request->get('after');
$filter = $request->get('filter');
$service = $this->getService('Stream');
@@ -52,6 +53,7 @@ class Stream extends \Espo\Core\Controllers\Base
'offset' => $offset,
'maxSize' => $maxSize,
'after' => $after,
'filter' => $filter
));
return array(

View File

@@ -18,12 +18,12 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Controllers;
class Team extends \Espo\Core\Controllers\Record
{
}

View File

@@ -0,0 +1,31 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
class Template extends \Espo\Core\Controllers\Record
{
}

View File

@@ -53,7 +53,10 @@ class User extends \Espo\Core\Controllers\Record
if (!$request->isPost()) {
throw new BadRequest();
}
return $this->getService('User')->changePassword($this->getUser()->id, $data['password']);
if (!array_key_exists('password', $data) || !array_key_exists('currentPassword', $data)) {
throw new BadRequest();
}
return $this->getService('User')->changePassword($this->getUser()->id, $data['password'], true, $data['currentPassword']);
}
public function actionChangePasswordByRequest($params, $data, $request)

View File

@@ -76,7 +76,7 @@ class Acl
public function checkScope($scope, $action = null, $isOwner = null, $inTeam = null, $entity = null)
{
return $this->getAclManager()->checkScope($this->getUser(), $subject, $action, $isOwner, $inTeam, $entity) ;
return $this->getAclManager()->checkScope($this->getUser(), $scope, $action, $isOwner, $inTeam, $entity) ;
}
}

View File

@@ -105,7 +105,7 @@ class Base implements Injectable
public function checkScope(User $user, $data, $scope, $action = null, $isOwner = null, $inTeam = null, Entity $entity = null)
{
if (is_null($data)) {
return true;
return false;
}
if ($data === false) {
return false;

View File

@@ -34,9 +34,9 @@ class Table
private $cacheFile;
private $actionList = array('read', 'edit', 'delete');
private $actionList = ['read', 'edit', 'delete'];
private $levelList = array('all', 'team', 'own', 'no');
private $levelList = ['all', 'team', 'own', 'no'];
protected $fileManager;
@@ -112,12 +112,14 @@ class Table
{
$aclTables = [];
$assignmentPermissionList = [];
$userPermissionList = [];
$userRoles = $this->user->get('roles');
foreach ($userRoles as $role) {
$aclTables[] = $role->get('data');
$assignmentPermissionList[] = $role->get('assignmentPermission');
$userPermissionList[] = $role->get('userPermission');
}
$teams = $this->user->get('teams');
@@ -126,11 +128,14 @@ class Table
foreach ($teamRoles as $role) {
$aclTables[] = $role->get('data');
$assignmentPermissionList[] = $role->get('assignmentPermission');
$userPermissionList[] = $role->get('userPermission');
}
}
$this->data['table'] = $this->merge($aclTables);
$this->data['assignmentPermission'] = $this->mergeValues($assignmentPermissionList, 'all');
$this->data['assignmentPermission'] = $this->mergeValues($assignmentPermissionList, $this->metadata->get('app.acl.valueDefaults.assignmentPermission', 'all'));
$this->data['userPermission'] = $this->mergeValues($userPermissionList, $this->metadata->get('app.acl.valueDefaults.userPermission', 'no'));
}
private function initSolid()
@@ -222,8 +227,11 @@ class Table
foreach ($scopeList as $scope) {
if (!array_key_exists($scope, $data)) {
$aclType = $this->metadata->get('scopes.' . $scope . '.acl');
if (!empty($aclType) && ($aclType === true || $aclType === 'record')) {
$data[$scope] = $this->metadata->get('app.acl.recordDefault');
if ($aclType === true) {
$aclType = 'recordAllTeamOwnNo';
}
if (!empty($aclType)) {
$data[$scope] = $this->metadata->get('app.acl.defaults.' . $aclType, true);
}
}
}

View File

@@ -115,7 +115,7 @@ class AclManager
if ($user->isAdmin()) {
return true;
}
$this->getTable($user)->get($permission);
return $this->getTable($user)->get($permission);
}
public function checkReadOnlyTeam(User $user, $scope)
@@ -166,7 +166,7 @@ class AclManager
return true;
}
$data = $this->getTable($user)->getScopeData($entity->getEntityType());
return $this->getImplementation($scope)->checkEntity($user, $entity, $data, $action);
return $this->getImplementation($entity->getEntityType())->checkEntity($user, $entity, $data, $action);
}
public function checkScope(User $user, $scope, $action = null, $isOwner = null, $inTeam = null, $entity = null)

View File

@@ -86,10 +86,12 @@ class Application
public function runClient()
{
$config = $this->getContainer()->get('config');
$themeManager = $this->getContainer()->get('themeManager');
$html = file_get_contents('main.html');
$html = str_replace('{{cacheTimestamp}}', $config->get('cacheTimestamp', 0), $html);
$html = str_replace('{{useCache}}', $config->get('useCache') ? 'true' : 'false' , $html);
$html = str_replace('{{stylesheet}}', $themeManager->getStylesheet(), $html);
$html = str_replace('{{runScript}}', 'app.start();' , $html);
echo $html;
exit;
@@ -105,22 +107,23 @@ class Application
$container = $this->getContainer();
$slim->get('/', function() {});
$slim->post('/', function() {});
$entryPointManager = new \Espo\Core\EntryPointManager($container);
$auth = $this->getAuth();
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $entryPointManager->checkAuthRequired($entryPoint), true);
$slim->add($apiAuth);
try {
$auth = $this->getAuth();
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $entryPointManager->checkAuthRequired($entryPoint), true);
$slim->add($apiAuth);
$slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container) {
try {
$slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container) {
$entryPointManager->run($entryPoint);
} catch (\Exception $e) {
$container->get('output')->processError($e->getMessage(), $e->getCode(), true);
}
});
});
$slim->run();
$slim->run();
} catch (\Exception $e) {
$container->get('output')->processError($e->getMessage(), $e->getCode(), true);
}
}
public function runCron()

View File

@@ -161,6 +161,14 @@ class Container
);
}
private function loadNumber()
{
return new \Espo\Core\Utils\Number(
$this->get('config')->get('decimalMark'),
$this->get('config')->get('thousandSeparator')
);
}
private function loadServiceFactory()
{
return new \Espo\Core\ServiceFactory(
@@ -236,6 +244,7 @@ class Container
return new \Espo\Core\Utils\Language(
$this->get('fileManager'),
$this->get('config'),
$this->get('metadata'),
$this->get('preferences')
);
}
@@ -269,6 +278,14 @@ class Container
);
}
private function loadThemeManager()
{
return new \Espo\Core\Utils\ThemeManager(
$this->get('config'),
$this->get('metadata')
);
}
public function setUser($user)
{
$this->data['user'] = $user;

View File

@@ -87,18 +87,27 @@ class ControllerManager
$actionNameUcfirst = ucfirst($actionName);
$beforeMethodName = 'before' . $actionNameUcfirst;
$actionMethodName = 'action' . $actionNameUcfirst;
$afterMethodName = 'after' . $actionNameUcfirst;
$fullActionMethodName = strtolower($request->getMethod()) . ucfirst($actionMethodName);
if (method_exists($controller, $fullActionMethodName)) {
$primaryActionMethodName = $fullActionMethodName;
} else {
$primaryActionMethodName = $actionMethodName;
}
if (!method_exists($controller, $primaryActionMethodName)) {
throw new NotFound("Action '$actionName' (".$request->getMethod().") does not exist in controller '$controller'");
}
if (method_exists($controller, $beforeMethodName)) {
$controller->$beforeMethodName($params, $data, $request);
}
$actionMethodName = 'action' . $actionNameUcfirst;
if (!method_exists($controller, $actionMethodName)) {
throw new NotFound("Action '$actionMethodName' does not exist in controller '$controller'");
}
$result = $controller->$primaryActionMethodName($params, $data, $request);
$result = $controller->$actionMethodName($params, $data, $request);
$afterMethodName = 'after' . $actionNameUcfirst;
if (method_exists($controller, $afterMethodName)) {
$controller->$afterMethodName($params, $data, $request);
}

View File

@@ -51,7 +51,7 @@ class Record extends Base
$service = $this->getServiceFactory()->create($name);
} else {
$service = $this->getServiceFactory()->create($this->defaultRecordServiceName);
$service->setEntityName($name);
$service->setEntityType($name);
}
return $service;
@@ -69,13 +69,17 @@ class Record extends Base
return $entity->toArray();
}
public function actionPatch($params, $data)
public function actionPatch($params, $data, $request)
{
return $this->actionUpdate($params, $data);
return $this->actionUpdate($params, $data, $request);
}
public function actionCreate($params, $data)
public function actionCreate($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'edit')) {
throw new Forbidden();
}
@@ -89,8 +93,12 @@ class Record extends Base
throw new Error();
}
public function actionUpdate($params, $data)
public function actionUpdate($params, $data, $request)
{
if (!$request->isPut() && !$request->isPatch()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'edit')) {
throw new Forbidden();
}
@@ -121,7 +129,7 @@ class Record extends Base
$maxSize = self::MAX_SIZE_LIMIT;
}
if (!empty($maxSize) && $maxSize > self::MAX_SIZE_LIMIT) {
throw new Forbidden();
throw new Forbidden("Max should should not exceed " . self::MAX_SIZE_LIMIT . ". Use pagination (offset, limit).");
}
$result = $this->getRecordService()->findEntities(array(
@@ -135,7 +143,7 @@ class Record extends Base
return array(
'total' => $result['total'],
'list' => $result['collection']->toArray()
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
);
}
@@ -170,12 +178,16 @@ class Record extends Base
return array(
'total' => $result['total'],
'list' => $result['collection']->toArray()
'list' => isset($result['collection']) ? $result['collection']->toArray() : $result['list']
);
}
public function actionDelete($params)
public function actionDelete($params, $data, $request)
{
if (!$request->isDelete()) {
throw new BadRequest();
}
$id = $params['id'];
if ($this->getRecordService()->deleteEntity($id)) {
@@ -186,7 +198,7 @@ class Record extends Base
public function actionExport($params, $data, $request)
{
if ($this->getConfig()->get('disableExport') && !$this->getUser()->isAdmin()) {
if ($this->getConfig()->get('exportDisabled') && !$this->getUser()->isAdmin()) {
throw new Forbidden();
}
@@ -212,6 +224,10 @@ class Record extends Base
public function actionMassUpdate($params, $data, $request)
{
if (!$request->isPut()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'edit')) {
throw new Forbidden();
}
@@ -235,6 +251,9 @@ class Record extends Base
public function actionMassDelete($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'delete')) {
throw new Forbidden();
}
@@ -254,10 +273,14 @@ class Record extends Base
return $idsRemoved;
}
public function actionCreateLink($params, $data)
public function actionCreateLink($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (empty($params['id']) || empty($params['link'])) {
throw BadRequest();
throw new BadRequest();
}
$id = $params['id'];
@@ -294,13 +317,17 @@ class Record extends Base
throw new Error();
}
public function actionRemoveLink($params, $data)
public function actionRemoveLink($params, $data, $request)
{
if (!$request->isDelete()) {
throw new BadRequest();
}
$id = $params['id'];
$link = $params['link'];
if (empty($params['id']) || empty($params['link'])) {
throw BadRequest();
throw new BadRequest();
}
$foreignIds = array();
@@ -326,8 +353,11 @@ class Record extends Base
throw new Error();
}
public function actionFollow($params)
public function actionFollow($params, $data, $request)
{
if (!$request->isPut()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'read')) {
throw new Forbidden();
}
@@ -335,8 +365,11 @@ class Record extends Base
return $this->getRecordService()->follow($id);
}
public function actionUnfollow($params)
public function actionUnfollow($params, $data, $request)
{
if (!$request->isDelete()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'read')) {
throw new Forbidden();
}

View File

@@ -28,9 +28,9 @@ use \Espo\Core\Exceptions\NotFound,
class EntryPointManager
{
private $container;
private $fileManager;
private $container;
private $fileManager;
protected $data = null;
@@ -38,7 +38,7 @@ class EntryPointManager
protected $allowedMethods = array(
'run',
);
);
/**
* @var array - path to entryPoint files
@@ -46,14 +46,14 @@ class EntryPointManager
private $paths = array(
'corePath' => 'application/Espo/EntryPoints',
'modulePath' => 'application/Espo/Modules/{*}/EntryPoints',
'customPath' => 'custom/Espo/Custom/EntryPoints',
'customPath' => 'custom/Espo/Custom/EntryPoints',
);
public function __construct(\Espo\Core\Container $container)
{
$this->container = $container;
$this->fileManager = $container->get('fileManager');
$this->container = $container;
$this->fileManager = $container->get('fileManager');
}
protected function getContainer()
@@ -69,16 +69,16 @@ class EntryPointManager
public function checkAuthRequired($name)
{
$className = $this->getClassName($name);
if ($className === false) {
if (!$className) {
throw new NotFound();
}
return $className::$authRequired;
return $className::$authRequired;
}
public function run($name)
public function run($name)
{
$className = $this->getClassName($name);
if ($className === false) {
if (!$className) {
throw new NotFound();
}
$entryPoint = new $className($this->container);
@@ -89,7 +89,7 @@ class EntryPointManager
protected function getClassName($name)
{
$name = Util::normilizeClassName($name);
if (!isset($this->data)) {
$this->init();
}
@@ -98,8 +98,8 @@ class EntryPointManager
if (isset($this->data[$name])) {
return $this->data[$name];
}
return false;
return false;
}
@@ -108,8 +108,7 @@ class EntryPointManager
$classParser = $this->getContainer()->get('classParser');
$classParser->setAllowedMethods($this->allowedMethods);
$this->data = $classParser->getData($this->paths, $this->cacheFile);
}
}
}

View File

@@ -67,6 +67,21 @@ abstract class Base
return $this->getContainer()->get('metadata');
}
protected function getDateTime()
{
return $this->getContainer()->get('dateTime');
}
protected function getNumber()
{
return $this->getContainer()->get('number');
}
protected function getFileManager()
{
return $this->getContainer()->get('fileManager');
}
public function __construct(Container $container)
{
$this->container = $container;

View File

@@ -104,6 +104,9 @@ class HookManager
foreach ($this->data[$scope][$hookName] as $className) {
if (empty($this->hooks[$className])) {
$this->hooks[$className] = $this->createHookByClassName($className);
if (empty($this->hooks[$className])) {
continue;
}
}
$hook = $this->hooks[$className];
$hook->$hookName($injection, $options);
@@ -122,7 +125,7 @@ class HookManager
}
return $hook;
}
throw new Error("Class '$className' does not exist");
$GLOBALS['log']->error("Hook class '{$name}' does not exist.");
}
/**

View File

@@ -0,0 +1,140 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Core\Htmlizer;
use Espo\ORM\Entity;
use Espo\Core\Exceptions\Error;
use Espo\Core\Utils\File\Manager as FileManager;
use Espo\Core\Utils\DateTime;
use Espo\Core\Utils\Number;
require('vendor/zordius/lightncandy/src/lightncandy.php');
class Htmlizer
{
protected $fileManager;
protected $dateTime;
protected $config;
public function __construct(FileManager $fileManager, DateTime $dateTime, Number $number)
{
$this->fileManager = $fileManager;
$this->dateTime = $dateTime;
$this->number = $number;
}
protected function formatNumber($value)
{
return $this->number->format($value);
}
protected function format($value)
{
if (is_float($value) || is_int($value)) {
$value = $this->formatNumber($value);
} else if (is_string($value)) {
$value = nl2br($value);
}
return $value;
}
protected function getDataFromEntity(Entity $entity)
{
$data = $entity->toArray();
$fieldDefs = $entity->getFields();
$fieldList = array_keys($fieldDefs);
foreach ($fieldList as $field) {
$type = null;
if (!empty($fieldDefs[$field]['type'])) {
$type = $fieldDefs[$field]['type'];
}
if ($type == Entity::DATETIME) {
if (!empty($data[$field])) {
$data[$field] = $this->dateTime->convertSystemDateTime($data[$field]);
}
} else if ($type == Entity::DATE) {
if (!empty($data[$field])) {
$data[$field] = $this->dateTime->convertSystemDate($data[$field]);
}
} else if ($type == Entity::JSON_ARRAY) {
if (!empty($data[$field])) {
$list = $data[$field];
$newList = [];
foreach ($list as $item) {
$v = $item;
if ($item instanceof \StdClass) {
$v = get_object_vars($v);
}
foreach ($v as $k => $w) {
$v[$k] = $this->format($v[$k]);
}
$newList[] = $v;
}
$data[$field] = $newList;
}
} else if ($type == Entity::JSON_OBJECT) {
if (!empty($data[$field])) {
$value = $data[$field];
if ($value instanceof \StdClass) {
$data[$field] = get_object_vars($value);
}
foreach ($data[$field] as $k => $w) {
$data[$field][$k] = $this->format($data[$field][$k]);
}
}
}
if (array_key_exists($field, $data)) {
$data[$field] = $this->format($data[$field]);
}
}
return $data;
}
public function render(Entity $entity, $template)
{
$code = \LightnCandy::compile($template);
$id = uniqid('', true);
$fileName = 'data/cache/template-' . $id;
$this->fileManager->putContents($fileName, $code);
$renderer = include($fileName);
$this->fileManager->removeFile($fileName);
$data = $this->getDataFromEntity($entity);
$html = $renderer($data);
$html = str_replace('?entryPoint=attachment&amp;', '?entryPoint=attachment&', $html);
$html = preg_replace('/\?entryPoint=attachment\&id=(.*)/', 'data/upload/$1', $html);
return $html;
}
}

View File

@@ -99,6 +99,7 @@ class Importer
$usersIds = $duplicate->get('usersIds');
$usersIds[] = $userId;
$duplicate->set('usersIds', $usersIds);
$this->getEntityManager()->saveEntity($duplicate);
if (!empty($teamsIds)) {
@@ -136,6 +137,10 @@ class Importer
$this->importPartDataToEmail($email, $message, $inlineIds, 'text/plain');
}
if (!$email->get('body') && $email->get('bodyPlain')) {
$email->set('body', $email->get('bodyPlain'));
}
$body = $email->get('body');
if (!empty($body)) {
foreach ($inlineIds as $cid => $attachmentId) {
@@ -251,6 +256,15 @@ class Importer
$type = strtok($part->contentType, ';');
}
$contentDisposition = false;
if (isset($part->ContentDisposition)) {
if (strpos(strtolower($part->ContentDisposition), 'attachment') === 0) {
$contentDisposition = 'attachment';
} else if (strpos(strtolower($part->ContentDisposition), 'inline') === 0) {
$contentDisposition = 'inline';
}
}
if (empty($type)) {
if (!empty($defaultContentType)) {
$type = $defaultContentType;
@@ -260,28 +274,26 @@ class Importer
}
$encoding = null;
$isAttachment = true;
if ($type == 'text/plain' || $type == 'text/html') {
$isAttachment = false;
$content = $this->getContentFromPart($part);
if ($type == 'text/plain') {
if ($email->get('bodyPlain')) {
$isAttachment = true;
} else {
$email->set('bodyPlain', $content);
if (!$email->get('body')) {
$email->set('body', $content);
if ($contentDisposition !== 'inline' && $contentDisposition !== 'attachment') {
$isAttachment = false;
$content = $this->getContentFromPart($part);
if ($type == 'text/plain') {
$bodyPlain = '';
if ($email->get('bodyPlain')) {
$bodyPlain .= $email->get('bodyPlain') . "\n";
}
}
} else if ($type == 'text/html') {
if ($email->get('isHtml')) {
$isAttachment = true;
} else {
$email->set('body', $content);
$bodyPlain .= $content;
$email->set('bodyPlain', $bodyPlain);
} else if ($type == 'text/html') {
$body = '';
if ($email->get('body')) {
$body .= $email->get('body') . "<br>";
}
$body .= $content;
$email->set('isHtml', true);
$email->set('body', $body);
}
}
}
@@ -293,16 +305,26 @@ class Importer
$fileName = null;
$contentId = null;
if (isset($part->ContentDisposition)) {
if (strpos($part->ContentDisposition, 'attachment') === 0) {
if ($contentDisposition) {
if ($contentDisposition === 'attachment') {
if (preg_match('/filename="?([^"]+)"?/i', $part->ContentDisposition, $m)) {
$fileName = $m[1];
$disposition = 'attachment';
}
} else if (strpos($part->ContentDisposition, 'inline') === 0) {
$contentId = trim($part->contentID, '<>');
$fileName = $contentId;
$disposition = 'inline';
} else if ($contentDisposition === 'inline') {
if (isset($part->contentID)) {
$contentId = trim($part->contentID, '<>');
$fileName = $contentId;
$disposition = 'inline';
} else {
// hack for iOS not proper attachments
if (empty($fileName)) {
if (preg_match('/filename="?([^"]+)"?/i', $part->ContentDisposition, $m)) {
$fileName = $m[1];
$disposition = 'attachment';
}
}
}
}
}

View File

@@ -10,37 +10,5 @@ use Zend\Loader\PluginClassLocator;
class Headers extends \Zend\Mail\Headers
{
public static function fromString($string, $EOL = self::EOL)
{
$headers = new static();
$currentLine = '';
// iterate the header lines, some might be continuations
foreach (explode($EOL, $string) as $line) {
// check if a header name is present
if (preg_match('/^(?P<name>[\x21-\x39\x3B-\x7E]+):.*$/', $line, $matches)) {
if ($currentLine) {
// a header name was present, then store the current complete line
$headers->addHeaderLine($currentLine);
}
$currentLine = trim($line);
} elseif (preg_match('/^\s+.*$/', $line, $matches)) {
// continuation: append to current line
$currentLine .= $line;
} elseif (preg_match('/^\s*$/', $line)) {
// empty line indicates end of headers
break;
} else {
// Line does not match header format!
throw new Exception\RuntimeException(sprintf(
'Line "%s"does not match header format!',
$line
));
}
}
if ($currentLine) {
$headers->addHeaderLine($currentLine);
}
return $headers;
}
}

View File

@@ -131,7 +131,7 @@ class Sender
return $this;
}
public function send(Email $email, $params = array())
public function send(Email $email, $params = array(), &$message = null)
{
$message = new Message();
$config = $this->config;
@@ -164,6 +164,10 @@ class Sender
$message->addFrom($fromAddress, $fromName);
}
if (!$email->get('from')) {
$email->set('from', $fromAddress);
}
if (!empty($params['replyToAddress'])) {
$replyToName = null;
if (!empty($params['replyToName'])) {

View File

@@ -37,6 +37,7 @@ class Entity extends \Espo\ORM\Entity
$collection = $this->get($field, $defs);
$ids = array();
$names = new \stdClass();
$types = new \stdClass();
if (!empty($columns)) {
$columnsData = new \stdClass();
}
@@ -46,6 +47,7 @@ class Entity extends \Espo\ORM\Entity
$id = $e->id;
$ids[] = $id;
$names->$id = $e->get('name');
$types->$id = $e->get('type');
if (!empty($columns)) {
$columnsData->$id = new \stdClass();
foreach ($columns as $column => $f) {
@@ -57,6 +59,7 @@ class Entity extends \Espo\ORM\Entity
$this->set($field . 'Ids', $ids);
$this->set($field . 'Names', $names);
$this->set($field . 'Types', $types);
if (!empty($columns)) {
$this->set($field . 'Columns', $columnsData);
}

View File

@@ -162,8 +162,6 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
public function remove(Entity $entity, array $options = array())
{
$this->getEntityManager()->getHookManager()->process($this->entityName, 'beforeRemove', $entity, $options);
$result = parent::remove($entity, $options);
if ($result) {
$this->getEntityManager()->getHookManager()->process($this->entityName, 'afterRemove', $entity, $options);

View File

@@ -0,0 +1,50 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Core\Pdf;
require "vendor/tecnick.com/tcpdf/tcpdf.php";
class Tcpdf extends \TCPDF
{
protected $footerHtml = '';
protected $footerPosition = 15;
public function setFooterHtml($html)
{
$this->footerHtml = $html;
}
public function setFooterPosition($position)
{
$this->footerPosition = $position;
}
public function Footer() {
$this->SetY((-1) * $this->footerPosition);
$html = str_replace('{pageNumber}', '{:pnp:}', $this->footerHtml);
$this->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, '', 0, false, 'T');
}
}

View File

@@ -209,10 +209,9 @@ class Base
$defs = $relDefs[$link];
if ($defs['type'] == 'manyMany') {
$joins[] = $link;
if (!empty($defs['relationName']) && !empty($defs['midKeys'])) {
if (!empty($defs['midKeys'])) {
$key = $defs['midKeys'][1];
$relationName = lcfirst($defs['relationName']);
$part[$relationName . '.' . $key] = $idsValue;
$part[$link . 'Middle.' . $key] = $idsValue;
}
} else if ($defs['type'] == 'belongsTo') {
if (!empty($defs['key'])) {
@@ -227,6 +226,7 @@ class Base
$result['whereClause'][] = $part;
}
$result['joins'] = array_merge($result['joins'], $joins);
$result['joins'] = array_unique($result['joins']);
$result['distinct'] = true;
}
@@ -314,6 +314,46 @@ class Base
}
}
public function manageAccess(&$result)
{
if (empty($result)) {
$result = array();
}
if (empty($result['joins'])) {
$result['joins'] = [];
}
if (empty($result['leftJoins'])) {
$result['leftJoins'] = [];
}
if (empty($result['whereClause'])) {
$result['whereClause'] = array();
}
if (empty($result['customJoin'])) {
$result['customJoin'] = [];
}
$this->access($result);
}
public function manageTextFilter($textFilter, &$result)
{
if (empty($result)) {
$result = array();
}
if (empty($result['joins'])) {
$result['joins'] = [];
}
if (empty($result['leftJoins'])) {
$result['leftJoins'] = [];
}
if (empty($result['whereClause'])) {
$result['whereClause'] = array();
}
if (empty($result['customJoin'])) {
$result['customJoin'] = [];
}
$this->q(array('q' => $textFilter), $result);
}
protected function access(&$result)
{
if ($this->acl->checkReadOnlyOwn($this->entityType)) {
@@ -440,6 +480,24 @@ class Base
$where['type'] = 'after';
$dt->setTimezone(new \DateTimeZone('UTC'));
$where['value'] = $dt->format($format);
break;
case 'lastSevenDays':
$where['type'] = 'between';
$dtFrom = clone $dt;
$dt->setTimezone(new \DateTimeZone('UTC'));
$to = $dt->format($format);
$dtFrom->modify('-7 day');
$dtFrom->setTime(0, 0, 0);
$dtFrom->setTimezone(new \DateTimeZone('UTC'));
$from = $dtFrom->format($format);
$where['value'] = [$from, $to];
break;
case 'on':
$where['type'] = 'between';
@@ -569,6 +627,15 @@ class Base
case 'future':
$part[$item['field'] . '>='] = date('Y-m-d');
break;
case 'lastSevenDays':
$dt1 = new \DateTime();
$dt2 = clone $dt1;
$dt2->modify('-7 days');
$part['AND'] = array(
$item['field'] . '>=' => $dt2->format('Y-m-d'),
$item['field'] . '<=' => $dt1->format('Y-m-d'),
);
break;
case 'currentMonth':
$dt = new \DateTime();
$part['AND'] = array(

View File

@@ -0,0 +1,9 @@
{
"entity": true,
"layouts": true,
"tab": true,
"acl": true,
"customizable": true,
"importable": true,
"notifications": true
}

View File

@@ -0,0 +1,9 @@
{
"entity": true,
"layouts": true,
"tab": true,
"acl": true,
"customizable": true,
"importable": false,
"notifications": false
}

View File

@@ -0,0 +1,9 @@
{
"entity": true,
"layouts": true,
"tab": true,
"acl": true,
"customizable": true,
"importable": true,
"notifications": true
}

View File

@@ -57,10 +57,10 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
//check permissions copied and deleted files
$this->checkIsWritable();
$this->backupExistingFiles();
$this->beforeRunAction();
$this->backupExistingFiles();
/* run before install script */
$this->runScript('before');

View File

@@ -56,17 +56,17 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
/* copy core files */
if (!$this->copyFiles()) {
throw new $this->throwErrorAndRemovePackage('Cannot copy files.');
$this->throwErrorAndRemovePackage('Cannot copy files.');
}
/* remove extension files, saved in fileList */
if (!$this->deleteFiles(true)) {
throw new $this->throwErrorAndRemovePackage('Permission denied to delete files.');
$this->throwErrorAndRemovePackage('Permission denied to delete files.');
}
}
if (!$this->systemRebuild()) {
throw new $this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
}
/* run after uninstall script */

View File

@@ -25,19 +25,19 @@ namespace Espo\Core\Utils;
class Crypt
{
private $config;
private $key = null;
private $cryptKey = null;
private $iv = null;
public function __construct($config)
{
$this->config = $config;
$this->cryptKey = $config->get('cryptKey', '');
}
protected function getKey()
{
if (empty($this->key)) {
@@ -53,13 +53,13 @@ class Crypt
}
return $this->iv;
}
public function encrypt($string)
{
$iv = $this->getIv();
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->getKey(), $string, MCRYPT_MODE_CBC, $iv) . $iv);
}
public function decrypt($encryptedString)
{
$encryptedString = base64_decode($encryptedString);
@@ -68,7 +68,7 @@ class Crypt
$iv = substr($encryptedString, -16);
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $this->getKey(), $string, MCRYPT_MODE_CBC, $iv));
}
public function generateKey()
{
return md5(uniqid());

View File

@@ -33,16 +33,8 @@ class Converter
private $schemaConverter;
private $schemaFromMetadata = null;
/**
* @var array $meta - metadata array
*/
//private $meta;
public function __construct(\Espo\Core\Utils\Metadata $metadata, \Espo\Core\Utils\File\Manager $fileManager)
{
$this->metadata = $metadata;
@@ -53,7 +45,6 @@ class Converter
$this->schemaConverter = new Schema\Converter($this->fileManager);
}
protected function getMetadata()
{
return $this->metadata;
@@ -69,13 +60,11 @@ class Converter
return $this->schemaConverter;
}
public function getSchemaFromMetadata($entityList = null)
{
$ormMeta = $this->getMetadata()->getOrmMetadata();
$entityDefs = $this->getMetadata()->get('entityDefs');
$this->schemaFromMetadata = $this->getSchemaConverter()->process($ormMeta, $entityDefs, $entityList);
$this->schemaFromMetadata = $this->getSchemaConverter()->process($ormMeta, $entityList);
return $this->schemaFromMetadata;
}
@@ -98,11 +87,4 @@ class Converter
return $result;
}
}
?>
}

View File

@@ -22,12 +22,13 @@
namespace Espo\Core\Utils\Database\DBAL\Platforms;
use Doctrine\DBAL\Schema\TableDiff,
Doctrine\DBAL\Schema\Index,
Doctrine\DBAL\Schema\Table,
Doctrine\DBAL\Schema\Constraint,
Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\Constraint;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Column;
class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
{
@@ -39,21 +40,52 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
$queryParts[] = 'RENAME TO ' . $diff->newName;
}
foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
//espo: It works not correctly. It can rename some existing fields
foreach ($diff->renamedColumns as $oldColumnName => $column) {
if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) {
continue;
}
//espo: remaned autoincrement field
if ($column->getAutoincrement()) {
$diff->removedColumns[$oldColumnName] = new Column($oldColumnName, $column->getType(), $column->toArray());
$columnName = $column->getQuotedName($this);
$diff->addedColumns[$columnName] = $column;
continue;
}
//END espo
$columnArray = $column->toArray();
$columnArray['comment'] = $this->getColumnComment($column);
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
}
/*$queryParts[] = 'CHANGE ' . $oldColumnName . ' '
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); */
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); //espo: fixed the problem
} //espo: END
foreach ($diff->removedColumns as $column) {
if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) {
continue;
}
//espo: remove autoincrement option
if ($column->getAutoincrement()) {
$columnName = $column->getQuotedName($this);
$changedColumn = clone $column;
$changedColumn->setNotNull(false);
$changedColumn->setAutoincrement(false);
$changedProperties = array(
'notnull',
'autoincrement',
);
$diff->changedColumns[$columnName] = new ColumnDiff($columnName, $changedColumn, $changedProperties, $column);
}
//END espo
//$queryParts[] = 'DROP ' . $column->getQuotedName($this); //espo: no needs to remove columns
}
@@ -71,19 +103,15 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
}
//espo: It works not correctly. It can rename some existing fields
foreach ($diff->renamedColumns as $oldColumnName => $column) {
if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) {
foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
continue;
}
$columnArray = $column->toArray();
$columnArray['comment'] = $this->getColumnComment($column);
/*$queryParts[] = 'CHANGE ' . $oldColumnName . ' '
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); */
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); //espo: fixed the problem
} //espo: END
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
}
$sql = array();
$tableSql = array();

View File

@@ -79,7 +79,7 @@ class Converter
protected $idParams = array(
'dbType' => 'varchar',
'len' => '24',
'len' => 24,
);
/**
@@ -107,9 +107,9 @@ class Converter
return $this->metadata;
}
protected function getEntityDefs()
protected function getEntityDefs($reload = false)
{
if (empty($this->entityDefs)) {
if (empty($this->entityDefs) || $reload) {
$this->entityDefs = $this->getMetadata()->get('entityDefs');
}
@@ -131,9 +131,14 @@ class Converter
return $this->metadataHelper;
}
/**
* Orm metadata convertation process
*
* @return array
*/
public function process()
{
$entityDefs = $this->getEntityDefs();
$entityDefs = $this->getEntityDefs(true);
$ormMeta = array();
foreach($entityDefs as $entityName => $entityMeta) {
@@ -185,12 +190,12 @@ class Converter
switch ($fieldParams['type']) {
case 'id':
if ($fieldParams['dbType'] != 'int') {
$fieldParams = array_merge($fieldParams, $this->idParams);
$fieldParams = array_merge($this->idParams, $fieldParams);
}
break;
case 'foreignId':
$fieldParams = array_merge($fieldParams, $this->idParams);
$fieldParams = array_merge($this->idParams, $fieldParams);
$fieldParams['notNull'] = false;
break;
@@ -221,6 +226,11 @@ class Converter
*/
protected function convertFields($entityName, &$entityMeta)
{
//List of unmerged fields with default field defenitions in $outputMeta
$unmergedFields = array(
'name',
);
$outputMeta = array(
'id' => array(
'type' => Entity::ID,
@@ -230,6 +240,10 @@ class Converter
'type' => isset($entityMeta['fields']['name']['type']) ? $entityMeta['fields']['name']['type'] : Entity::VARCHAR,
'notStorable' => true,
),
'deleted' => array(
'type' => Entity::BOOL,
'default' => false,
),
);
foreach($entityMeta['fields'] as $fieldName => $fieldParams) {
@@ -238,8 +252,14 @@ class Converter
$fieldTypeMeta = $this->getMetadataHelper()->getFieldDefsByType($fieldParams);
$fieldDefs = $this->convertField($entityName, $fieldName, $fieldParams, $fieldTypeMeta);
if ($fieldDefs !== false) {
$outputMeta[$fieldName] = $fieldDefs; //push fieldDefs to the main array
//push fieldDefs to the ORM metadata array
if (isset($outputMeta[$fieldName]) && !in_array($fieldName, $unmergedFields)) {
$outputMeta[$fieldName] = array_merge($outputMeta[$fieldName], $fieldDefs);
} else {
$outputMeta[$fieldName] = $fieldDefs;
}
}
/** check and set the linkDefs from 'fields' metadata */
@@ -254,13 +274,6 @@ class Converter
}
}
if (!isset($outputMeta['deleted'])) {
$outputMeta['deleted'] = array(
'type' => Entity::BOOL,
'default' => false,
);
}
return $outputMeta;
}
@@ -308,6 +321,15 @@ class Converter
'type' => 'varchar',
'notStorable' => true,
);
$ormMeta[$entityName]['fields']['followersIds'] = array(
'type' => 'jsonArray',
'notStorable' => true,
);
$ormMeta[$entityName]['fields']['followersNames'] = array(
'type' => 'jsonObject',
'notStorable' => true,
);
}
} //END: add a field 'isFollowed' for stream => true
@@ -316,12 +338,6 @@ class Converter
protected function convertField($entityName, $fieldName, array $fieldParams, $fieldTypeMeta = null)
{
/** set default type if exists */
if (!isset($fieldParams['type']) || empty($fieldParams['type'])) {
$GLOBALS['log']->debug('Field type does not exist for '.$entityName.':'.$fieldName.'. Use default type ['.$this->defaultFieldType.']');
$fieldParams['type'] = $this->defaultFieldType;
} /** END: set default type if exists */
/** merge fieldDefs option from field definition */
if (!isset($fieldTypeMeta)) {
$fieldTypeMeta = $this->getMetadataHelper()->getFieldDefsByType($fieldParams);
@@ -362,8 +378,6 @@ class Converter
return array();
}
$entityDefs = $this->getEntityDefs();
$relationships = array();
foreach($entityMeta['links'] as $linkName => $linkParams) {

View File

@@ -0,0 +1,51 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Core\Utils\Database\Orm\Fields;
class AttachmentMultiple extends Base
{
protected function load($fieldName, $entityType)
{
$data = array(
$entityType => array (
'fields' => array(
$fieldName.'Ids' => array(
'type' => 'varchar',
'notStorable' => true
),
$fieldName.'Names' => array(
'type' => 'varchar',
'notStorable' => true
),
)
),
'unset' => array(
$entityType => array(
'fields.'.$fieldName,
),
),
);
return $data;
}
}

View File

@@ -28,8 +28,6 @@ class RelationManager
{
private $metadata;
private $entityDefs;
public function __construct(\Espo\Core\Utils\Metadata $metadata)
{
$this->metadata = $metadata;
@@ -40,16 +38,6 @@ class RelationManager
return $this->metadata;
}
protected function getEntityDefs()
{
if (empty($this->entityDefs)) {
$this->entityDefs = $this->getMetadata()->get('entityDefs');
}
return $this->entityDefs;
}
public function getLinkEntityName($entityName, $linkParams)
{
return isset($linkParams['entity']) ? $linkParams['entity'] : $entityName;
@@ -110,7 +98,7 @@ class RelationManager
public function convert($linkName, $linkParams, $entityName, $ormMeta)
{
$entityDefs = $this->getEntityDefs();
$entityDefs = $this->getMetadata()->get('entityDefs');
$foreignEntityName = $this->getLinkEntityName($entityName, $linkParams);
$foreignLink = $this->getForeignLink($linkName, $linkParams, $entityDefs[$foreignEntityName]);

View File

@@ -32,7 +32,7 @@ class Attachments extends HasChildren
$entityName => array (
'fields' => array(
$linkName.'Types' => array(
'type' => 'varchar',
'type' => 'jsonObject',
'notStorable' => true,
),
),

View File

@@ -47,11 +47,10 @@ class Converter
'unique' => 'unique',
);
//todo: same array in Converters\Orm
protected $idParams = array(
'dbType' => 'varchar',
'len' => '24',
'len' => 24,
);
//todo: same array in Converters\Orm
@@ -68,8 +67,6 @@ class Converter
{
$this->fileManager = $fileManager;
$this->dbalSchema = new \Espo\Core\Utils\Database\DBAL\Schema\Schema();
$this->typeList = array_keys(\Doctrine\DBAL\Types\Type::getTypesMap());
}
@@ -78,13 +75,31 @@ class Converter
return $this->fileManager;
}
protected function getSchema()
/**
* Get schema
*
* @param boolean $reload
*
* @return \Doctrine\DBAL\Schema\Schema
*/
protected function getSchema($reload = false)
{
if (!isset($this->dbalSchema) || $reload) {
$this->dbalSchema = new \Espo\Core\Utils\Database\DBAL\Schema\Schema();
}
return $this->dbalSchema;
}
public function process(array $ormMeta, $entityDefs, $entityList = null)
/**
* Schema convertation process
*
* @param array $ormMeta
* @param array|null $entityList
*
* @return \Doctrine\DBAL\Schema\Schema
*/
public function process(array $ormMeta, $entityList = null)
{
$GLOBALS['log']->debug('Schema\Converter - Start: building schema');
@@ -106,7 +121,7 @@ class Converter
$ormMeta = array_intersect_key($ormMeta, array_flip($dependentEntities));
}
$schema = $this->getSchema();
$schema = $this->getSchema(true);
$tables = array();
foreach ($ormMeta as $entityName => $entityParams) {

View File

@@ -126,20 +126,18 @@ class EntityManager
}
$labelCreate = $this->getLanguage()->translate('Create') . ' ' . $labelSingular;
$scopeData = array(
'entity' => true,
'layouts' => true,
'tab' => true,
'acl' => true,
'module' => 'Custom',
'isCustom' => true,
'customizable' => true,
'importable' => true,
'type' => $type,
'stream' => $stream,
'notifications' => true
);
$this->getMetadata()->set('scopes', $name, $scopeData);
$filePath = "application/Espo/Core/Templates/Metadata/{$type}/scopes.json";
$scopesDataContents = $this->getFileManager()->getContents($filePath);
$scopesDataContents = str_replace('{entityType}', $name, $scopesDataContents);
$scopesData = Json::decode($scopesDataContents, true);
$scopesData['stream'] = $stream;
$scopesData['type'] = $type;
$scopesData['module'] = 'Custom';
$scopesData['object'] = true;
$scopesData['isCustom'] = true;
$this->getMetadata()->set('scopes', $name, $scopesData);
$filePath = "application/Espo/Core/Templates/Metadata/{$type}/entityDefs.json";
$entityDefsDataContents = $this->getFileManager()->getContents($filePath);
@@ -280,6 +278,12 @@ class EntityManager
throw new Conflict('Link ['.$entityForeign.'::'.$linkForeign.'] already exists.');
}
if ($entity === $entityForeign) {
if ($link === ucfirst($entity) || $linkForeign === ucfirst($entity)) {
throw new Conflict();
}
}
switch ($linkType) {
case 'oneToMany':
if ($this->getMetadata()->get('entityDefs.' . $entityForeign . '.field.' . $linkForeign)) {

View File

@@ -28,10 +28,12 @@ use Espo\Core\Utils\Json;
class FileUnifier
{
private $fileManager;
private $metadata;
public function __construct(\Espo\Core\Utils\File\Manager $fileManager)
public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Metadata $metadata = null)
{
$this->fileManager = $fileManager;
$this->metadata = $metadata;
}
protected function getFileManager()
@@ -39,6 +41,11 @@ class FileUnifier
return $this->fileManager;
}
protected function getMetadata()
{
return $this->metadata;
}
/**
* Unite files content
*
@@ -53,7 +60,7 @@ class FileUnifier
if (!empty($paths['modulePath'])) {
$moduleDir = strstr($paths['modulePath'], '{*}', true);
$moduleList = $this->getFileManager()->getFileList($moduleDir, false, '', false);
$moduleList = isset($this->metadata) ? $this->getMetadata()->getModuleList() : $this->getFileManager()->getFileList($moduleDir, false, '', false);
foreach ($moduleList as $moduleName) {
$moduleFilePath = str_replace('{*}', $moduleName, $paths['modulePath']);

View File

@@ -242,7 +242,7 @@ class Manager
public function putContentsJson($path, $data)
{
if (!Utils\Json::isJSON($data)) {
$data = Utils\Json::encode($data, JSON_PRETTY_PRINT);
$data = Utils\Json::encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
return $this->putContents($path, $data, LOCK_EX);
@@ -283,7 +283,7 @@ class Manager
$data = Utils\Util::merge($savedDataArray, $newDataArray);
if ($isReturnJson) {
$data = Utils\Json::encode($data, JSON_PRETTY_PRINT);
$data = Utils\Json::encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
if ($isPhp) {

View File

@@ -27,15 +27,17 @@ use Espo\Core\Utils;
class Unifier
{
private $fileManager;
private $metadata;
protected $params = array(
'unsetFileName' => 'unset.json',
'defaultsPath' => 'application/Espo/Core/defaults',
);
public function __construct(\Espo\Core\Utils\File\Manager $fileManager)
public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Metadata $metadata = null)
{
$this->fileManager = $fileManager;
$this->metadata = $metadata;
}
protected function getFileManager()
@@ -43,6 +45,11 @@ class Unifier
return $this->fileManager;
}
protected function getMetadata()
{
return $this->metadata;
}
/**
* Unite file content to the file
*
@@ -58,11 +65,12 @@ class Unifier
if (!empty($paths['modulePath'])) {
$customDir = strstr($paths['modulePath'], '{*}', true);
$dirList = $this->getFileManager()->getFileList($customDir, false, '', false);
foreach ($dirList as $dirName) {
$curPath = str_replace('{*}', $dirName, $paths['modulePath']);
$content = Utils\Util::merge($content, $this->unifySingle($curPath, $name, $recursively, $dirName));
$moduleList = isset($this->metadata) ? $this->getMetadata()->getModuleList() : $this->getFileManager()->getFileList($customDir, false, '', false);
foreach ($moduleList as $moduleName) {
$curPath = str_replace('{*}', $moduleName, $paths['modulePath']);
$content = Utils\Util::merge($content, $this->unifySingle($curPath, $name, $recursively, $moduleName));
}
}

View File

@@ -30,6 +30,7 @@ class Language
{
private $fileManager;
private $config;
private $metadata;
private $preferences;
private $unifier;
@@ -62,13 +63,14 @@ class Language
);
public function __construct(\Espo\Core\Utils\File\Manager $fileManager, \Espo\Core\Utils\Config $config, \Espo\Entities\Preferences $preferences = null)
public function __construct(File\Manager $fileManager, Config $config, Metadata $metadata, \Espo\Entities\Preferences $preferences = null)
{
$this->fileManager = $fileManager;
$this->config = $config;
$this->metadata = $metadata;
$this->preferences = $preferences;
$this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager);
$this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager, $this->metadata);
}
protected function getFileManager()
@@ -81,6 +83,11 @@ class Language
return $this->config;
}
protected function getMetadata()
{
return $this->metadata;
}
protected function getPreferences()
{
return $this->preferences;

View File

@@ -66,23 +66,31 @@ class Layout
return $this->metadata;
}
protected function sanitizeInput($name)
{
return preg_replace("([\.]{2,})", '', $name);
}
/**
* Get Layout context
*
* @param $controller
* @param $scope
* @param $name
*
* @return json
*/
public function get($controller, $name)
public function get($scope, $name)
{
if (isset($this->changedData[$controller][$name])) {
return Json::encode($this->changedData[$controller][$name]);
$scope = $this->sanitizeInput($scope);
$name = $this->sanitizeInput($name);
if (isset($this->changedData[$scope][$name])) {
return Json::encode($this->changedData[$scope][$name]);
}
$fileFullPath = Util::concatPath($this->getLayoutPath($controller, true), $name.'.json');
$fileFullPath = Util::concatPath($this->getLayoutPath($scope, true), $name.'.json');
if (!file_exists($fileFullPath)) {
$fileFullPath = Util::concatPath($this->getLayoutPath($controller), $name.'.json');
$fileFullPath = Util::concatPath($this->getLayoutPath($scope), $name.'.json');
}
if (!file_exists($fileFullPath)) {
@@ -101,21 +109,39 @@ class Layout
/**
* Set Layout data
* Ex. $controller = Account, $name = detail then will be created a file layoutFolder/Account/detail.json
* Ex. $scope = Account, $name = detail then will be created a file layoutFolder/Account/detail.json
*
* @param array $data
* @param string $controller - ex. Account
* @param string $scope - ex. Account
* @param string $name - detail
*
* @return void
*/
public function set($data, $controller, $name)
public function set($data, $scope, $name)
{
if (empty($controller) || empty($name)) {
$scope = $this->sanitizeInput($scope);
$name = $this->sanitizeInput($name);
if (empty($scope) || empty($name)) {
return false;
}
$this->changedData[$controller][$name] = $data;
$this->changedData[$scope][$name] = $data;
}
public function resetToDefault($scope, $name)
{
$scope = $this->sanitizeInput($scope);
$name = $this->sanitizeInput($name);
$filePath = 'custom/Espo/Custom/Resources/layouts/' . $scope . '/' . $name . '.json';
if ($this->getFileManager()->isFile($filePath)) {
$this->getFileManager()->removeFile($filePath);
}
if (!empty($this->changedData[$scope]) && !empty($this->changedData[$scope][$name])) {
unset($this->changedData[$scope][$name]);
}
return $this->get($scope, $name);
}
/**
@@ -128,15 +154,15 @@ class Layout
$result = true;
if (!empty($this->changedData)) {
foreach ($this->changedData as $controllerName => $rowData) {
foreach ($this->changedData as $scope => $rowData) {
foreach ($rowData as $layoutName => $layoutData) {
if (empty($controllerName) || empty($layoutName)) {
if (empty($scope) || empty($layoutName)) {
continue;
}
$layoutPath = $this->getLayoutPath($controllerName, true);
$data = Json::encode($layoutData, \JSON_PRETTY_PRINT);
$layoutPath = $this->getLayoutPath($scope, true);
$data = Json::encode($layoutData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
$result &= $this->getFileManager()->putContents(array($layoutPath, $layoutName.'.json'), $data);
}
@@ -162,17 +188,20 @@ class Layout
/**
* Merge layout data
* Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json
* Ex. $scope= Account, $name= detail then will be created a file layoutFolder/Account/detail.json
*
* @param JSON string $data
* @param string $controller - ex. Account
* @param string $scope - ex. Account
* @param string $name - detail
*
* @return bool
*/
public function merge($data, $controller, $name)
public function merge($data, $scope, $name)
{
$prevData = $this->get($controller, $name);
$scope = $this->sanitizeInput($scope);
$name = $this->sanitizeInput($name);
$prevData = $this->get($scope, $name);
$prevDataArray = Json::getArrayData($prevData);
$dataArray = Json::getArrayData($data);
@@ -180,7 +209,7 @@ class Layout
$data = Util::merge($prevDataArray, $dataArray);
$data = Json::encode($data);
return $this->set($data, $controller, $name);
return $this->set($data, $scope, $name);
}
/**
@@ -208,9 +237,4 @@ class Layout
return $path;
}
}
?>

View File

@@ -28,8 +28,6 @@ class Metadata
{
protected $meta = null;
protected $scopes = array();
private $config;
private $unifier;
private $fileManager;
@@ -92,7 +90,7 @@ class Metadata
protected function getUnifier()
{
if (!isset($this->unifier)) {
$this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager);
$this->unifier = new \Espo\Core\Utils\File\Unifier($this->fileManager, $this);
}
return $this->unifier;
@@ -153,6 +151,7 @@ class Metadata
if (file_exists($this->cacheFile) && !$reload) {
$this->meta = $this->getFileManager()->getPhpContents($this->cacheFile);
} else {
$this->clearVars();
$this->meta = $this->getUnifier()->unify($this->name, $this->paths, true);
$this->meta = $this->setLanguageFromConfig($this->meta);
$this->meta = $this->addAdditionalFields($this->meta);
@@ -479,8 +478,7 @@ class Metadata
}
}
krsort($modulesToSort);
asort($modulesToSort);
array_multisort(array_values($modulesToSort), SORT_ASC, array_keys($modulesToSort), SORT_ASC, $modulesToSort);
$this->moduleList = array_keys($modulesToSort);
}
@@ -531,4 +529,16 @@ class Metadata
return $path;
}
/**
* Clear metadata variables when reload meta
*
* @return void
*/
protected function clearVars()
{
$this->meta = null;
$this->moduleList = null;
$this->ormMeta = null;
}
}

View File

@@ -0,0 +1,60 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Core\Utils;
class Number
{
protected $decimalMark;
protected $thousandSeparator;
public function __construct($decimalMark = '.', $thousandSeparator = ',')
{
$this->decimalMark = $decimalMark;
$this->thousandSeparator = $thousandSeparator;
}
public function format($value, $decimals = null)
{
if (!is_null($decimals)) {
return number_format($value, $decimals, $this->decimalMark, $this->thousandSeparator);
} else {
$s = strval($value);
$arr = explode('.', $value);
$r = '0';
if (!empty($arr[0])) {
$r = number_format(intval($arr[0]), 0, '.', $this->thousandSeparator);
}
if (!empty($arr[1])) {
$r = $r . $this->decimalMark . $arr[1];
}
return $r;
}
}
}

View File

@@ -0,0 +1,52 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Core\Utils;
class ThemeManager
{
protected $config;
protected $metadata;
private $defaultName = 'Espo';
private $defaultStylesheet = 'Espo';
public function __construct(Config $config, Metadata $metadata)
{
$this->config = $config;
$this->metadata = $metadata;
}
public function getName()
{
return $this->config->get('theme', $this->defaultName);
}
public function getStylesheet()
{
return $this->metadata->get('themes.' . $this->getName() . '.stylesheet', 'client/css/espo.css');
}
}

View File

@@ -186,19 +186,25 @@ class Util
*/
public static function unsetInArrayByValue($needle, array $haystack, $reIndex = true)
{
$doReindex = false;
foreach($haystack as $key => $value) {
if (is_array($value)) {
$haystack[$key] = static::unsetInArrayByValue($needle, $value);
} else if ($needle === $value) {
unset($haystack[$key]);
if ($reIndex) {
array_splice($haystack, $key, 1);
} else {
unset($haystack[$key]);
$doReindex = true;
}
}
}
if ($doReindex) {
$haystack = array_values($haystack);
}
return $haystack;
}

View File

@@ -91,7 +91,7 @@ return array (
"tabList" => array("Account", "Contact", "Lead", "Opportunity", "Calendar", "Meeting", "Call", "Task", "Case", "Email", "Document", "Campaign"),
"quickCreateList" => array("Account", "Contact", "Lead", "Opportunity", "Meeting", "Call", "Task", "Case"),
'calendarDefaultEntity' => 'Meeting',
'disableExport' => false,
'exportDisabled' => false,
'assignmentEmailNotifications' => false,
'assignmentEmailNotificationsEntityList' => array('Lead', 'Opportunity', 'Task', 'Case'),
'assignmentNotificationsEntityList' => array('Meeting', 'Call', 'Task', 'Email'),
@@ -101,6 +101,8 @@ return array (
'maxEmailAccountCount' => 2,
'followCreatedEntities' => false,
'b2cMode' => false,
'restrictedMode' => false,
'theme' => 'Espo',
'isInstalled' => false,
);

View File

@@ -1,6 +1,6 @@
[{
"label":"",
"rows": [
[{"name":"name"}]
[{"name":"name", "fullWidth": true}, false]
]
}]

View File

@@ -84,14 +84,14 @@ return array (
'permissionMap',
'permissionRules',
'passwordSalt',
'cryptKey'
'cryptKey',
'restrictedMode',
'userLimit',
'stylesheet'
),
'adminItems' =>
array (
'devMode',
'outboundEmailIsShared',
'outboundEmailFromName',
'outboundEmailFromAddress',
'smtpServer',
'smtpPort',
'smtpAuth',

View File

@@ -0,0 +1,28 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Entities;
class Template extends \Espo\Core\ORM\Entity
{
}

View File

@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\EntryPoints;
@@ -29,7 +29,7 @@ use \Espo\Core\Exceptions\BadRequest;
class ChangePassword extends \Espo\Core\EntryPoints\Base
{
public static $authRequired = false;
public function run()
{
$requestId = $_GET['id'];
@@ -38,6 +38,7 @@ class ChangePassword extends \Espo\Core\EntryPoints\Base
}
$config = $this->getConfig();
$themeManager = $this->getThemeManager();
$p = $this->getEntityManager()->getRepository('PasswordChangeRequest')->where(array(
'requestId' => $requestId
@@ -56,9 +57,15 @@ class ChangePassword extends \Espo\Core\EntryPoints\Base
$html = file_get_contents('main.html');
$html = str_replace('{{cacheTimestamp}}', $config->get('cacheTimestamp', 0), $html);
$html = str_replace('{{useCache}}', $config->get('useCache') ? 'true' : 'false' , $html);
$html = str_replace('{{stylesheet}}', $themeManager->getStylesheet(), $html);
$html = str_replace('{{runScript}}', $runScript , $html);
echo $html;
exit;
}
protected function getThemeManager()
{
return $this->getContainer()->get('themeManager');
}
}

View File

@@ -43,10 +43,10 @@ class Download extends \Espo\Core\EntryPoints\Base
public function run()
{
$id = $_GET['id'];
if (empty($id)) {
if (empty($_GET['id'])) {
throw new BadRequest();
}
$id = $_GET['id'];
$attachment = $this->getEntityManager()->getEntity('Attachment', $id);

View File

@@ -30,13 +30,13 @@ use \Espo\Core\Exceptions\Error;
class Image extends \Espo\Core\EntryPoints\Base
{
public static $authRequired = true;
protected $allowedFileTypes = array(
'image/jpeg',
'image/png',
'image/gif',
);
protected $imageSizes = array(
'xxx-small' => array(18, 18),
'xx-small' => array(32, 32),
@@ -47,59 +47,58 @@ class Image extends \Espo\Core\EntryPoints\Base
'x-large' => array(864, 864),
'xx-large' => array(1024, 1024),
);
public function run()
{
if (empty($_GET['id'])) {
throw new BadRequest();
}
$id = $_GET['id'];
$size = null;
if (!empty($_GET['size'])) {
$size = $_GET['size'];
}
$this->show($id, $size);
}
protected function show($id, $size)
{
$attachment = $this->getEntityManager()->getEntity('Attachment', $id);
if (!$attachment) {
throw new NotFound();
}
if ($attachment->get('parentId') && $attachment->get('parentType')) {
$parent = $this->getEntityManager()->getEntity($attachment->get('parentType'), $attachment->get('parentId'));
if ($parent && !$this->getAcl()->check($parent)) {
throw new Forbidden();
}
}
$filePath = "data/upload/{$attachment->id}";
$fileType = $attachment->get('type');
if (!file_exists($filePath)) {
throw new NotFound();
}
if (!in_array($fileType, $this->allowedFileTypes)) {
throw new Error();
}
if (!empty($size)) {
if (!empty($this->imageSizes[$size])) {
$thumbFilePath = "data/upload/thumbs/{$attachment->id}_{$size}";
if (!file_exists($thumbFilePath)) {
$targetImage = $this->getThumbImage($filePath, $fileType, $size);
ob_start();
switch ($fileType) {
case 'image/jpeg':
imagejpeg($targetImage);
@@ -117,12 +116,12 @@ class Image extends \Espo\Core\EntryPoints\Base
$this->getContainer()->get('fileManager')->putContents($thumbFilePath, $contents);
}
$filePath = $thumbFilePath;
} else {
throw new Error();
}
}
if (!empty($size)) {
$fileName = $attachment->id . '_' . $size . '.jpg';
} else {
@@ -143,12 +142,12 @@ class Image extends \Espo\Core\EntryPoints\Base
readfile($filePath);
exit;
}
protected function getThumbImage($filePath, $fileType, $size)
{
list($originalWidth, $originalHeight) = getimagesize($filePath);
list($width, $height) = $this->imageSizes[$size];
if ($originalWidth <= $width && $originalHeight <= $height) {
$targetWidth = $originalWidth;
$targetHeight = $originalHeight;
@@ -169,7 +168,7 @@ class Image extends \Espo\Core\EntryPoints\Base
}
}
}
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
switch ($fileType) {
case 'image/jpeg':
@@ -189,8 +188,8 @@ class Image extends \Espo\Core\EntryPoints\Base
imagecopyresampled($targetImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight);
break;
}
return $targetImage;
}
}

View File

@@ -0,0 +1,95 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\EntryPoints;
use \Espo\Core\Exceptions\NotFound;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
use \Espo\Core\Htmlizer\Htmlizer;
class Pdf extends \Espo\Core\EntryPoints\Base
{
public static $authRequired = true;
public function run()
{
if (empty($_GET['entityId']) || empty($_GET['entityType']) || empty($_GET['templateId'])) {
throw new BadRequest();
}
$entityId = $_GET['entityId'];
$entityType = $_GET['entityType'];
$templateId = $_GET['templateId'];
$entity = $this->getEntityManager()->getEntity($entityType, $entityId);
$template = $this->getEntityManager()->getEntity('Template', $templateId);
$this->getContainer()->get('serviceFactory')->create($entityType)->loadAdditionalFields($entity);
if (!$entity || !$template) {
throw new NotFound();
}
if ($template->get('entityType') !== $entityType) {
throw new Forbidden();
}
if (!$this->getAcl()->check($entity, 'read') || !$this->getAcl()->check($template, 'read')) {
throw new Forbidden();
}
$fileName = $entity->get('name') . '.pdf';
$htmlizer = new Htmlizer($this->getFileManager(), $this->getDateTime(), $this->getNumber());
$pdf = new \Espo\Core\Pdf\Tcpdf();
$pdf->setFont('freesans', '', 12, '', true);
$pdf->setPrintHeader(false);
$pdf->setAutoPageBreak(true, $template->get('bottomMargin'));
$pdf->setMargins($template->get('leftMargin'), $template->get('topMargin'), $template->get('rightMargin'));
if ($template->get('printFooter')) {
$htmlFooter = $htmlizer->render($entity, $template->get('footer'));
$pdf->setFooterPosition($template->get('footerPosition'));
$pdf->setFooterHtml($htmlFooter);
} else {
$pdf->setPrintFooter(false);
}
$pdf->addPage();
$htmlHeader = $htmlizer->render($entity, $template->get('header'));
$pdf->writeHTML($htmlHeader, true, false, true, false, '');
$htmlBody = $htmlizer->render($entity, $template->get('body'));
$pdf->writeHTML($htmlBody, true, false, true, false, '');
$pdf->output($fileName);
exit;
}
}

View File

@@ -29,7 +29,9 @@ class Notifications extends \Espo\Core\Hooks\Base
{
public static $order = 10;
protected $noticatorsHash = array();
protected $notifatorsHash = array();
private $streamService;
protected function init()
{
@@ -44,6 +46,11 @@ class Notifications extends \Espo\Core\Hooks\Base
return $this->getInjection('container');
}
protected function getServiceFactory()
{
return $this->getContainer()->get('serviceFactory');
}
protected function getMetadata()
{
return $this->getInjection('metadata');
@@ -59,7 +66,7 @@ class Notifications extends \Espo\Core\Hooks\Base
protected function getNotificator($entityType)
{
if (empty($this->noticatorsHash[$entityType])) {
if (empty($this->notifatorsHash[$entityType])) {
$normalizedName = Util::normilizeClassName($entityType);
$className = '\\Espo\\Custom\\Notificators\\' . $normalizedName;
@@ -81,19 +88,19 @@ class Notifications extends \Espo\Core\Hooks\Base
$notificator->inject($name, $this->getContainer()->get($name));
}
$this->noticatorsHash[$entityType] = $notificator;
$this->notifatorsHash[$entityType] = $notificator;
}
return $this->noticatorsHash[$entityType];
return $this->notifatorsHash[$entityType];
}
public function afterSave(Entity $entity, array $options = array())
{
$entityType = $entity->getEntityType();
if (!empty($options['silent']) && !empty($options['noNotifications'])) {
return;
}
$entityType = $entity->getEntityType();
if (!$this->checkHasStream($entityType)) {
if (in_array($entityType, $this->getConfig()->get('assignmentNotificationsEntityList', []))) {
$notificator = $this->getNotificator($entityType);
@@ -102,5 +109,43 @@ class Notifications extends \Espo\Core\Hooks\Base
}
}
public function beforeRemove(Entity $entity, array $options = array())
{
if (!empty($options['silent']) && !empty($options['noNotifications'])) {
return;
}
$entityType = $entity->getEntityType();
if ($this->checkHasStream($entityType)) {
$followersData = $this->getStreamService()->getEntityFollowers($entity);
foreach ($followersData['idList'] as $userId) {
if ($userId === $this->getUser()->id) {
continue;
}
$notification = $this->getEntityManager()->getEntity('Notification');
$notification->set(array(
'userId' => $userId,
'type' => 'EntityRemoved',
'data' => array(
'entityType' => $entity->getEntityType(),
'entityId' => $entity->id,
'entityName' => $entity->get('name'),
'userId' => $this->getUser()->id,
'userName' => $this->getUser()->get('name')
)
));
$this->getEntityManager()->saveEntity($notification);
}
}
}
protected function getStreamService()
{
if (empty($this->streamService)) {
$this->streamService = $this->getServiceFactory()->create('Stream');
}
return $this->streamService;
}
}

View File

@@ -137,7 +137,7 @@ class Stream extends \Espo\Core\Hooks\Base
protected function getAutofollowUserIdList(Entity $entity, array $ignoreList = array())
{
$entityType = $entity->getEntityName();
$entityType = $entity->getEntityType();
$pdo = $this->getEntityManager()->getPDO();
$userIdList = [];
@@ -160,7 +160,7 @@ class Stream extends \Espo\Core\Hooks\Base
public function afterSave(Entity $entity, array $options = array())
{
$entityName = $entity->getEntityName();
$entityName = $entity->getEntityType();
if ($this->checkHasStream($entity)) {
if ($entity->isNew()) {

View File

@@ -40,7 +40,7 @@ class Cleanup extends \Espo\Core\Jobs\Base
protected function cleanupJobs()
{
$query = "DELETE FROM `job` WHERE DATE(modified_at) < '".$this->getDate()."' ";
$query = "DELETE FROM `job` WHERE DATE(modified_at) < '".$this->getCleanupFromDate()."' AND status <> 'Pending'";
$pdo = $this->getEntityManager()->getPDO();
$sth = $pdo->prepare($query);
@@ -64,14 +64,14 @@ class Cleanup extends \Espo\Core\Jobs\Base
$delSql = "DELETE FROM `scheduled_job_log_record`
WHERE scheduled_job_id = '".$id."'
AND DATE(created_at) < '".$this->getDate()."'
AND DATE(created_at) < '".$this->getCleanupFromDate()."'
AND id NOT IN ('".implode("', '", $lastRowIds)."')
";
$pdo->query($delSql);
}
}
protected function getDate($format = 'Y-m-d')
protected function getCleanupFromDate($format = 'Y-m-d')
{
$datetime = new \DateTime();
$datetime->modify($this->period);

View File

@@ -1,4 +1,4 @@
<?php
<?php
/************************************************************************
* This file is part of EspoCRM.
*
@@ -27,16 +27,16 @@ use \Espo\ORM\Entity;
class EmailReminder
{
protected $entityManager;
protected $mailSender;
protected $config;
protected $dateTime;
protected $language;
public function __construct($entityManager, $mailSender, $config, $dateTime, $language)
{
$this->entityManager = $entityManager;
@@ -45,17 +45,17 @@ class EmailReminder
$this->dateTime = $dateTime;
$this->language = $language;
}
protected function getEntityManager()
{
return $this->entityManager;
}
protected function parseInvitationTemplate($contents, $entity, $user = null)
{
$contents = str_replace('{eventType}', strtolower($this->language->translate($entity->getEntityName(), 'scopeNames')), $contents);
$preferences = $this->getEntityManager()->getEntity('Preferences', $user->id);
$timezone = $preferences->get('timeZone');
@@ -103,7 +103,7 @@ class EmailReminder
return file_get_contents($fileName);
}
public function send(Entity $reminder)
{
$user = $this->getEntityManager()->getEntity('User', $reminder->get('userId'));
@@ -123,7 +123,7 @@ class EmailReminder
$subject = $this->parseInvitationTemplate($subjectTpl, $entity, $user);
$subject = str_replace(array("\n", "\r"), '', $subject);
$body = $this->parseInvitationTemplate($bodyTpl, $entity, $user);
$email->set('subject', $subject);
@@ -134,7 +134,7 @@ class EmailReminder
$emailSender = $this->mailSender;
$emailSender->send($email);
$this->getEntityManager()->removeEntity($email);
}
}

View File

@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Modules\Crm\Controllers;
@@ -29,7 +29,7 @@ use \Espo\Core\Exceptions\Error,
class Activities extends \Espo\Core\Controllers\Base
{
public static $defaultAction = 'index';
public function actionListCalendarEvents($params, $data, $request)
{
if (!$this->getAcl()->check('Calendar')) {
@@ -38,12 +38,12 @@ class Activities extends \Espo\Core\Controllers\Base
$from = $request->get('from');
$to = $request->get('to');
if (empty($from) || empty($to)) {
throw new BadRequest();
}
$service = $this->getService('Activities');
return $service->getEvents($this->getUser()->id, $from, $to);
}
@@ -51,7 +51,7 @@ class Activities extends \Espo\Core\Controllers\Base
public function actionPopupNotifications()
{
$userId = $this->getUser()->id;
return $this->getService('Activities')->getPopupNotifications($userId);
}
@@ -72,30 +72,37 @@ class Activities extends \Espo\Core\Controllers\Base
public function actionList($params, $data, $request)
{
$name = $params['name'];
if (!in_array($name, array('activities', 'history'))) {
if (!in_array($name, ['activities', 'history'])) {
throw new BadRequest();
}
$entityName = $params['scope'];
if (empty($params['scope'])) {
throw new BadRequest();
}
if (empty($params['id'])) {
throw new BadRequest();
}
$entityType = $params['scope'];
$id = $params['id'];
$offset = intval($request->get('offset'));
$maxSize = intval($request->get('maxSize'));
$asc = $request->get('asc') === 'true';
$sortBy = $request->get('sortBy');
$where = $request->get('where');
$scope = null;
if (!empty($where) && !empty($where['scope']) && $where['scope'] !== 'false') {
$scope = $where['scope'];
if (is_array($where) && !empty($where[0]) && $where[0] !== 'false') {
$scope = $where[0];
}
$service = $this->getService('Activities');
$methodName = 'get' . ucfirst($name);
return $service->$methodName($entityName, $id, array(
return $service->$methodName($entityType, $id, array(
'scope' => $scope,
'offset' => $offset,
'maxSize' => $maxSize,

View File

@@ -0,0 +1,28 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Modules\Crm\Controllers;
class DocumentFolder extends \Espo\Core\Templates\Controllers\CategoryTree
{
}

View File

@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Modules\Crm\Controllers;
@@ -27,16 +27,19 @@ use \Espo\Core\Exceptions\BadRequest;
class Lead extends \Espo\Core\Controllers\Record
{
public function actionConvert($params, $data)
{
public function actionConvert($params, $data, $request)
{
if (empty($data['id'])) {
throw new BadRequest();
}
if (!$request->isPost()) {
throw new BadRequest();
}
$entity = $this->getRecordService()->convert($data['id'], $data['records']);
if (!empty($entity)) {
return $entity->toArray();
}
throw new Error();
throw new Error();
}
}

View File

@@ -22,7 +22,27 @@
namespace Espo\Modules\Crm\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class TargetList extends \Espo\Core\Controllers\Record
{
public function actionUnlinkAll($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (empty($data['id'])) {
throw new BadRequest();
}
if (empty($data['link'])) {
throw new BadRequest();
}
return $this->getRecordService()->unlinkAll($data['id'], $data['link']);
}
}

View File

@@ -18,11 +18,11 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
namespace Espo\Modules\Crm\Entities;
class Document extends \Espo\Core\Entities\Person
class Document extends \Espo\Core\ORM\Entity
{
}

View File

@@ -0,0 +1,29 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Modules\Crm\Entities;
class DocumentFolder extends \Espo\Core\Templates\Entities\CategoryTree
{
}

View File

@@ -34,7 +34,7 @@ class CheckEmailAccounts extends \Espo\Core\Jobs\Base
try {
$service->fetchFromMailServer($entity);
} catch (\Exception $e) {
$GLOBALS['log']->error('Job CheckEmailAccounts: [' . $e->getCode() . '] ' .$e->getMessage());
$GLOBALS['log']->error('Job CheckEmailAccounts '.$entity->id.': [' . $e->getCode() . '] ' .$e->getMessage());
}
}

View File

@@ -34,7 +34,7 @@ class CheckInboundEmails extends \Espo\Core\Jobs\Base
try {
$service->fetchFromMailServer($entity);
} catch (\Exception $e) {
$GLOBALS['log']->error('Job CheckInboundEmails: [' . $e->getCode() . '] ' .$e->getMessage());
$GLOBALS['log']->error('Job CheckInboundEmails '.$entity->id.': [' . $e->getCode() . '] ' .$e->getMessage());
}
}

View File

@@ -0,0 +1,67 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Modules\Crm\Repositories;
use Espo\ORM\Entity;
class CaseObj extends \Espo\Core\ORM\Repositories\RDB
{
public function afterSave(Entity $entity, array $options)
{
$result = parent::afterSave($entity, $options);
$this->handleAfterSaveContacts($entity, $options);
return $result;
}
protected function handleAfterSaveContacts(Entity $entity, array $options)
{
$contactIdChanged = $entity->has('contactId') && $entity->get('contactId') != $entity->getFetched('contactId');
if ($contactIdChanged) {
$contactId = $entity->get('contactId');
if (empty($contactId)) {
$this->unrelate($entity, 'contacts', $entity->getFetched('contactId'));
return;
}
}
if ($contactIdChanged) {
$pdo = $this->getEntityManager()->getPDO();
$sql = "
SELECT id FROM case_contact
WHERE
contact_id = ".$pdo->quote($contactId)." AND
case_id = ".$pdo->quote($entity->id)." AND
deleted = 0
";
$sth = $pdo->prepare($sql);
$sth->execute();
if (!$sth->fetch()) {
$this->relate($entity, 'contacts', $contactId);
}
}
}
}

View File

@@ -43,7 +43,17 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
public function afterSave(Entity $entity, array $options)
{
$result = parent::afterSave($entity, $options);
$this->handleAfterSaveAccounts($entity, $options);
if ($entity->has('targetListId') && $entity->isNew()) {
$this->relate($entity, 'targetLists', $entity->get('targetListId'));
}
return $result;
}
protected function handleAfterSaveAccounts(Entity $entity, array $options)
{
$accountIdChanged = $entity->has('accountId') && $entity->get('accountId') != $entity->getFetched('accountId');
$titleChanged = $entity->has('title') && $entity->get('title') != $entity->getFetched('title');
@@ -51,7 +61,7 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
$accountId = $entity->get('accountId');
if (empty($accountId)) {
$this->unrelate($entity, 'accounts', $entity->getFetched('accountId'));
return $result;
return;
}
}
@@ -59,7 +69,7 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
if (empty($accountId)) {
$accountId = $entity->getFetched('accountId');
if (empty($accountId)) {
return $result;
return;
}
}
}
@@ -91,8 +101,6 @@ class Contact extends \Espo\Core\ORM\Repositories\RDB
}
}
}
return $result;
}
}

View File

@@ -0,0 +1,27 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 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/.
************************************************************************/
namespace Espo\Modules\Crm\Repositories;
class DocumentFolder extends \Espo\Core\Repositories\CategoryTree
{
}

View File

@@ -91,8 +91,6 @@ class Meeting extends \Espo\Core\ORM\Repositories\RDB
}
return $reminders;
$entity->set('reminders', $reminders);
}
protected function afterSave(Entity $entity, array $options)

View File

@@ -10,16 +10,21 @@
"sicCode": "WKN Nummer",
"industry": "Branche",
"type": "Typ",
"contactRole": "Rolle"
"contactRole": "Funktion",
"campaign": "Kampagne"
},
"links": {
"contacts": "Kontakte",
"opportunities": "Verkaufschancen",
"cases": "Fälle",
"documents": "Dokumente",
"meetingsPrimary": "Meetings (intern)",
"callsPrimary": "Anrufe (intern)",
"tasksPrimary": "Aufgaben (intern)"
"meetingsPrimary": "Meetings (erweitert)",
"callsPrimary": "Anrufe (erweitert)",
"tasksPrimary": "Aufgaben (erweitert)",
"emailsPrimary": "E-Mails (erweitert)",
"targetLists": "Kontaktlisten",
"campaignLogRecords": "Kampagnen Log",
"campaign": "Kampagne"
},
"options": {
"type": {
@@ -39,17 +44,20 @@
"Computer": "Informationstechnologie",
"Education": "Bildungswesen",
"Electronics": "Elektronik",
"Energy": "Energieerzeuger",
"Entertainment & Leisure": "Freizeit- und Unterhaltungsindustrie",
"Finance": "Finanzsektor",
"Food & Beverage": "Speisen und Getränke",
"Grocery": "Einzelhandel",
"Healthcare": "Gesundheitswesen",
"Insurance": "Versicherung",
"Legal": "Rechtswesen",
"Manufacturing": "Produktion",
"Publishing": "Medien",
"Real Estate": "Immobilien",
"Service": "Dienstleistung",
"Service": "Service",
"Sports": "Sport",
"Sofware": "Software",
"Software": "Software",
"Technology": "Technologie",
"Telecommunications": "Telekommunikation",
"Television": "Fernsehen",
@@ -60,5 +68,9 @@
"labels": {
"Create Account": "Firma erstellen",
"Copy Billing": "Rechnungsadresse kopieren"
},
"presetFilters": {
"customers": "Kunden",
"partners": "Partner"
}
}

View File

@@ -1,5 +1,6 @@
{
"layouts": {
"detailConvert": "Interessent umwandeln"
"detailConvert": "Interessent umwandeln",
"listForAccount": "Liste (für Firma)"
}
}

View File

@@ -14,7 +14,8 @@
"reminders": "Erinnerungen",
"account": "Firma"
},
"links": {},
"links": {
},
"options": {
"status": {
"Planned": "Geplant",
@@ -32,6 +33,10 @@
"Tentative": "Mit Vorbehalt"
}
},
"massActions": {
"setHeld": "Auf gehalten setzen",
"setNotHeld": "Auf nicht gehalten setzen"
},
"labels": {
"Create Call": "Anruf erstellen",
"Set Held": "Auf gehalten setzen",

View File

@@ -0,0 +1,56 @@
{
"fields": {
"name": "Name",
"description": "Beschreibung",
"status": "Status",
"type": "Typ",
"startDate": "Startdatum",
"endDate": "Enddatum",
"targetLists": "Kontaktlisten",
"sentCount": "Gesendet",
"openedCount": "Geöffnet",
"clickedCount": "Geklickt",
"optedOutCount": "Keine E-Mails",
"bouncedCount": "Nicht zustellbar",
"hardBouncedCount": "Hard Bounced",
"softBouncedCount": "Soft Bounced",
"leadCreatedCount": "Erstellte Interessenten",
"revenue": "Umsatz",
"revenueConverted": "Umsatz (konvertiert)",
"budget": "Budget"
},
"links": {
"targetLists": "Kontaktlisten",
"accounts": "Firmen",
"contacts": "Kontakte",
"leads": "Interessenten",
"opportunities": "Verkaufschancen",
"campaignLogRecords": "Protokoll"
},
"options": {
"type": {
"Email": "E-Mail",
"Web": "Web",
"Television": "Fernsehen",
"Radio": "Radio Button",
"Newsletter": "Newsletter",
"Mail": "Mail"
},
"status": {
"Planning": "Planung",
"Active": "Aktiv",
"Inactive": "Inaktiv",
"Complete": "Fertig"
}
},
"labels": {
"Create Campaign": "Neue Kampagne",
"Target Lists": "Kontaktlisten",
"Statistics": "Statistik",
"hard": "hart",
"soft": "weich"
},
"presetFilters": {
"active": "Aktiv"
}
}

View File

@@ -0,0 +1,24 @@
{
"fields": {
"action": "Aktion",
"actionDate": "Datum",
"data": "Daten",
"campaign": "Kampagne",
"parent": "Zielkontakt",
"object": "Objekt",
"application": "Applikation"
},
"options": {
"action": {
"Sent": "Gesendet",
"Opened": "Geöffnet",
"Opted Out": "Keine E-Mails",
"Bounced": "Nicht zustellbar",
"Clicked": "Geklickt",
"Lead Created": "Interessent erstellt"
}
},
"labels": {
"All": "Alle"
}
}

View File

@@ -5,11 +5,22 @@
"status": "Status",
"account": "Firma",
"contact": "Kontakt",
"contacts": "Kontakte",
"priority": "Priorität",
"type": "Typ",
"description": "Beschreibung"
"description": "Beschreibung",
"inboundEmail": "Eingehende E-Mails"
},
"links": {
"inboundEmail": "Eingehende E-Mails",
"account": "Firma",
"contact": "Kontakt (Primär)",
"Contacts": "Kontakte",
"meetings": "Meetings",
"calls": "Anrufe",
"tasks": "Aufgaben",
"emails": "E-Mails"
},
"links": {},
"options": {
"status": {
"New": "Neu",
@@ -19,7 +30,7 @@
"Rejected": "Abgelehnt",
"Duplicate": "Duplizieren"
},
"priority": {
"priority" : {
"Low": "Niedrig",
"Normal": "Normal",
"High": "Hoch",

View File

@@ -10,12 +10,21 @@
"doNotCall": "Nicht anrufen",
"address": "Adresse",
"opportunityRole": "Verkaufschance Rolle",
"accountRole": "Rolle",
"description": "Beschreibung"
"accountRole": "Funktion",
"description": "Beschreibung",
"campaign": "Kampagne",
"targetLists": "Kontaktlisten",
"targetList": "Kontaktliste"
},
"links": {
"opportunities": "Verkaufschancen",
"cases": "Fälle"
"cases": "Fälle",
"targetLists": "Kontaktlisten",
"campaignLogRecords": "Kampagnen Log",
"campaign": "Kampagne",
"account": "Firma (Primär)",
"accounts": "Firmen",
"casesPrimary": "Fälle (Primär)"
},
"labels": {
"Create Contact": "Kontakt erstellen"

View File

@@ -11,11 +11,14 @@
"source": "Quelle",
"publishDate": "Veröffentlichungsdatum",
"expirationDate": "Ablaufdatum",
"description": "Beschreibung"
"description": "Beschreibung",
"accounts": "Firmen",
"folder": "Ordner"
},
"links": {
"accounts": "Firmen",
"opportunities": "Verkaufschancen"
"opportunities": "Verkaufschancen",
"folder": "Ordner"
},
"options": {
"status": {
@@ -23,6 +26,13 @@
"Draft": "Entwurf",
"Expired": "Abgelaufen",
"Canceled": "Storniert"
},
"type": {
"": "Kein(e)",
"Contract": "Vertrag",
"NDA": "NDA",
"EULA": "EULA",
"License Agreement": "Lizenz Vereinbarung"
}
},
"presetFilters": {

View File

@@ -0,0 +1,9 @@
{
"labels": {
"Create DocumentFolder": "Dokumente Ordner erstellen",
"Manage Categories": "Ordner verwalten"
},
"links": {
"documents": "Dokumente"
}
}

View File

@@ -0,0 +1,8 @@
{
"labels": {
"Create Lead": "Interessent erstellen",
"Create Contact": "Kontakt erstellen",
"Create Task": "Neue Aufgabe",
"Create Case": "Fall erstellen"
}
}

View File

@@ -10,8 +10,10 @@
"Call": "Anruf",
"Task": "Aufgabe",
"Case": "Fall",
"InboundEmail": "Eingehende E-Mails",
"Document": "Dokument"
"Document": "Dokument",
"DocumentFolder": "Dokumente Ordner",
"Campaign": "Kampagne",
"TargetList": "Kontaktliste"
},
"scopeNamesPlural": {
"Account": "Firmen",
@@ -24,8 +26,10 @@
"Call": "Anrufe",
"Task": "Aufgaben",
"Case": "Fälle",
"InboundEmail": "Eingehende E-Mails",
"Document": "Dokumente"
"Document": "Dokumente",
"DocumentFolder": "Dokumente Ordner",
"Campaign": "Kampagnen",
"TargetList": "Kontaktlisten"
},
"dashlets": {
"Leads": "Meine Interessenten",
@@ -38,7 +42,7 @@
"OpportunitiesByStage": "Verkaufschancen nach Verkaufsphase",
"OpportunitiesByLeadSource": "Verkaufschancen nach Quelle",
"SalesByMonth": "Umsätze nach Monat",
"SalesPipeline": "Verkaufspipeline"
"SalesPipeline": "Verkaufspipeline"
},
"labels": {
"Create InboundEmail": "Eingehende E-Mail erstellen",
@@ -52,29 +56,29 @@
"Log Call": "Anruf erfassen",
"Archive Email": "E-Mail archivieren",
"Create Task": "Neue Aufgabe",
"Tasks": "Aufgaben"
"Tasks": "Aufgaben"
},
"fields": {
"billingAddressCity": "Ort",
"billingAddressCountry": "Land",
"billingAddressPostalCode": "PLZ",
"billingAddressState": "Bundesland\/Kanton",
"billingAddressState": "Bundesland/Kanton",
"billingAddressStreet": "Straße",
"addressCity": "Ort",
"addressStreet": "Straße",
"addressCountry": "Land",
"addressState": "Bundesland\/Kanton",
"addressPostalCode": "PLZ",
"addressState": "Bundesland/Kanton",
"addressPostalCode": "PLZ",
"shippingAddressCity": "Ort (Lieferadresse)",
"shippingAddressStreet": "Straße (Lieferadresse)",
"shippingAddressCountry": "Land (Lieferadresse)",
"shippingAddressState": "Bundesland\/Kanton (Lieferadresse)",
"shippingAddressState": "Bundesland/Kanton (Lieferadresse)",
"shippingAddressPostalCode": "PLZ (Lieferadresse)"
},
"links": {
"contacts": "Kontakte",
"opportunities": "Verkaufschancen",
"leads": "Interessenten",
"leads": "Interessenten",
"meetings": "Meetings",
"calls": "Anrufe",
"tasks": "Aufgaben",
@@ -83,7 +87,7 @@
"cases": "Fälle",
"documents": "Dokumente",
"account": "Firma",
"opportunity": "Verkaufschance",
"opportunity": "Verkaufschance",
"contact": "Kontakt",
"parent": "Bezieht sich auf"
},

Some files were not shown because too many files have changed in this diff Show More