Compare commits

...

918 Commits

Author SHA1 Message Date
yuri 31f380a03a russian lang 2016-02-29 12:03:38 +02:00
yuri 7e23960196 v 2016-02-26 17:11:36 +02:00
yuri d3b9f2479b fix export 2016-02-26 17:11:32 +02:00
yuri c211842b52 fix metadata 2016-02-26 15:17:33 +02:00
yuri 3e11c0cfc1 fix loader 2016-02-26 12:23:53 +02:00
yuri 6747440b00 document folder customizable 2016-02-26 12:09:30 +02:00
yuri dc1c4b1e78 fix lang 2016-02-26 10:48:01 +02:00
yuri 26f2fba3ac cleanyp 2016-02-25 16:17:55 +02:00
yuri eb481c689b fix warnings 2016-02-25 16:16:40 +02:00
yuri 88c3984d35 date: ever filter 2016-02-25 13:07:50 +02:00
yuri 4eae088973 fix flotr2: remove underscore 2016-02-25 12:19:11 +02:00
yuri 60ae0fb365 fix 2016-02-25 10:28:21 +02:00
yuri ab36f41fc3 duration notStorable 2016-02-24 17:51:13 +02:00
yuri 98de243e37 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2016-02-24 15:31:45 +02:00
yuri 0c6ccabbeb fix checkEntityForDuplicate 2016-02-24 15:31:26 +02:00
yuri a66e6111cb fix detail view buttons fixed possition 2016-02-24 12:11:00 +02:00
yuri caf5c8806a chart outlineColor 2016-02-24 11:43:48 +02:00
yuri 0154dfd6a1 view naming fix 2016-02-24 11:36:43 +02:00
yuri e545e68877 version 2016-02-24 10:43:43 +02:00
yuri fa24c2b7fe fix array field 2016-02-23 16:43:02 +02:00
Taras Machyshyn df2b7d9659 Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend 2016-02-23 15:58:24 +02:00
Taras Machyshyn cc395232ff Fixed ukrainian translation 2016-02-23 15:58:10 +02:00
yuri 47afb83536 fix datetime 2016-02-23 15:48:13 +02:00
yuri 02d1b50b59 view naming 2016-02-23 15:42:05 +02:00
yuri bd86eb08fa fix account list layout 2016-02-23 15:10:47 +02:00
yuri b3c1a45b72 task: add parent to filters layout 2016-02-23 12:41:34 +02:00
yuri 15678e59e2 fix search frontend 2016-02-23 12:41:00 +02:00
yuri 6fe379bab3 link multiple and attachment multiple listLayoutDisabled 2016-02-23 11:54:48 +02:00
yuri 39ecb2fd37 cleanup 2016-02-23 11:51:36 +02:00
yuri 988c0059ff import language file 2016-02-23 11:34:15 +02:00
yuri 61ff31b3b7 trim 2016-02-23 11:17:05 +02:00
yuri 7c1a098b89 change account layouts 2016-02-22 16:47:52 +02:00
yuri f843593843 add country to lead small view 2016-02-22 16:38:22 +02:00
yuri c34eb915bc fix email draft 2016-02-22 15:54:37 +02:00
yuri 9508432294 opportunity set probability if empty 2016-02-22 15:00:40 +02:00
yuri 0959962269 version 2016-02-22 14:53:05 +02:00
yuri e39a91bde6 fix view naming 2016-02-22 12:42:09 +02:00
yuri 51f5dbe25c address list view 2016-02-22 11:47:45 +02:00
yuri 6fd5c6cbe7 fix view naming 2016-02-22 11:18:07 +02:00
yuri 6622b09eaa fix issue that search input not stored 2016-02-22 11:16:47 +02:00
yuri 9bb9f066cd fix dashboard 2016-02-19 18:15:28 +02:00
yuri 03110b47df change account list layout 2016-02-19 17:41:15 +02:00
yuri 034e532e05 change contact list layout 2016-02-19 17:35:07 +02:00
yuri c306af8b4c readable date formats according to selecred date format 2016-02-19 12:21:23 +02:00
yuri bd4a784676 move readable date formats to date-time.js 2016-02-19 12:10:55 +02:00
yuri 4ca0a9dc5f fix german salutations 2016-02-19 12:03:15 +02:00
yuri c6816b01b5 bool field filter: checked by default 2016-02-19 11:51:27 +02:00
yuri bc7583ccb4 improve role table ui 2016-02-19 11:32:16 +02:00
yuri 318e43aca3 json formating 2016-02-19 10:38:05 +02:00
yuri ea992f727b admin page: move user interface upper 2016-02-18 18:19:03 +02:00
yuri 5bdb16f98c fix home icon position 2016-02-18 18:09:27 +02:00
yuri faa06993e6 cacheTimestamp fix for no cache 2016-02-18 18:06:50 +02:00
yuri f6e0d017b2 change home icon 2016-02-18 18:03:16 +02:00
yuri 8ea56a74b0 code style link 2016-02-18 17:23:18 +02:00
yuri d4c9666f85 contributing file 2016-02-18 17:19:43 +02:00
yuri 5f376304ce portal entryPoint changes 2016-02-18 11:41:56 +02:00
yuri dbb29f25ab portal fixes 2016-02-17 17:31:10 +02:00
yuri da059b2589 portal changes 2016-02-17 16:54:53 +02:00
yuri fee64fd5ac fix lang 2016-02-17 12:48:30 +02:00
yuri 85de9f7a6f entryPoint data 2016-02-17 12:47:16 +02:00
yuri 5beb7641af portal folder 2016-02-17 12:35:19 +02:00
yuri 249852c3d7 baseBath 2016-02-16 17:27:45 +02:00
yuri 223d07579b display total count by default 2016-02-16 12:01:20 +02:00
yuri 74fb359740 pdf fontface in config 2016-02-16 10:48:40 +02:00
yuri f7ffadc76f fix template vars sorting 2016-02-16 10:40:19 +02:00
yuri fc03141dee calendar: fix issue with date w/o time 2016-02-16 10:25:38 +02:00
yuri 8d29014811 added cs_CZ lang 2016-02-15 16:18:52 +02:00
yuri 7dcbbcb98d version 2016-02-15 12:36:33 +02:00
yuri 60b9200247 fix vertical theme pagination issue 2016-02-15 12:19:02 +02:00
yuri fa4d1d70d5 naming fix 2016-02-15 12:01:05 +02:00
yuri de6cc1f9bb currency rounding 2016-02-15 11:52:20 +02:00
yuri 5fb6abe0e1 keep history in converted laed 2016-02-15 11:41:38 +02:00
yuri 94073b8aad account filters layout change 2016-02-15 11:16:40 +02:00
yuri 0e83e21aa0 use wildcard in address search 2016-02-15 11:14:56 +02:00
yuri 63bbf72942 fix company logo 403 error 2016-02-15 11:12:54 +02:00
yuri dbaa41b161 refresh list view after create / edit 2016-02-15 10:53:25 +02:00
yuri ed673dbe0d fix portal isDefault 2016-02-15 10:39:18 +02:00
yuri d54ccb0c9e fix config 2016-02-12 18:40:23 +02:00
yuri b29cbec3a1 kb fix 2016-02-12 12:33:19 +02:00
yuri edc967c118 campaign: dont count test in statistics 2016-02-12 11:40:45 +02:00
yuri e80681da22 change password url 2016-02-12 10:44:05 +02:00
yuri 03ec9c9378 attachment related field 2016-02-11 14:26:11 +02:00
yuri 6c54306cd6 fix email template 2016-02-11 12:48:33 +02:00
yuri db49af84f4 kb portals 2016-02-11 12:29:12 +02:00
yuri 79a29531e9 fix import 2016-02-10 14:45:12 +02:00
yuri c3de7f022e stream dashlet view list 2016-02-10 12:55:27 +02:00
yuri 59a3111596 fix acl 2016-02-10 12:49:06 +02:00
yuri cf8dfadbdf dont display global search if no acl access 2016-02-10 11:58:07 +02:00
yuri e500b2c906 user filters 2016-02-10 11:25:02 +02:00
yuri 0d9417cc3e create portal user 2016-02-10 11:21:50 +02:00
yuri eb57d70182 fix lang 2016-02-10 10:27:37 +02:00
yuri 215b572d70 color fix 2016-02-10 10:01:46 +02:00
yuri bc72f7f3e6 record dachlet check access 2016-02-09 16:18:09 +02:00
yuri b449473f10 fix typo 2016-02-09 15:45:44 +02:00
yuri 6f23362bfd record dashlet url 2016-02-09 15:32:54 +02:00
yuri 074d2cc119 fix role 2016-02-09 12:33:20 +02:00
yuri 725cd224c1 fix portal html and 2016 2016-02-09 11:55:21 +02:00
yuri 2baee2398b fix portal html 2016-02-09 11:44:17 +02:00
yuri 1a8f8875fd fix show hide field 2016-02-09 10:46:40 +02:00
yuri 9cecea8317 theme in diff 2016-02-09 10:45:53 +02:00
yuri 05ac6ea0b8 fix cache 2016-02-08 18:22:56 +02:00
yuri cce8186ccf fix dashlet 2016-02-08 17:39:19 +02:00
yuri b143d1a30e show hide field for middle record 2016-02-08 17:09:50 +02:00
yuri 4c5f2e6b40 fixes 2016-02-08 16:54:58 +02:00
yuri 6bc2c7a576 theme manager fix 2016-02-08 16:03:09 +02:00
yuri 2412c7521b theme css use cacheTimestamp 2016-02-08 15:59:07 +02:00
yuri c964897c59 fix list view show more 2016-02-08 13:00:47 +02:00
yuri 6abdc001e5 attachment: forbid parent 2016-02-08 11:56:47 +02:00
yuri 83943d1daa fix auto follow notification 2016-02-08 11:06:52 +02:00
yuri eedd54d10a fix email modal 2016-02-05 16:40:03 +02:00
yuri c8a3736816 attachment: small changes 2016-02-05 16:31:31 +02:00
yuri e727196424 email address search check email create access 2016-02-05 16:06:07 +02:00
yuri d0f715863c cleanup attachments w/o parent 2016-02-05 15:57:29 +02:00
yuri ae94113370 attachment set size if empty 2016-02-05 12:43:16 +02:00
yuri 3fbe4970b2 clientDefs compose modal view 2016-02-05 12:31:54 +02:00
yuri 54e6e3bf39 fix mail sender 2016-02-05 12:16:17 +02:00
yuri f2a7d3ae86 fix array 2016-02-05 11:06:31 +02:00
yuri 3799dd739b Attachment Multiple: sourceList to field manager 2016-02-05 10:55:16 +02:00
yuri 3161419682 fix pdf 2016-02-04 17:41:50 +02:00
yuri bdc277e557 fix pdf 2016-02-04 17:39:38 +02:00
yuri a515cd29a0 fix pdf 2016-02-04 17:38:26 +02:00
yuri 770a2b83f0 Pdf service 2016-02-04 17:35:48 +02:00
yuri f9df8a757d attachment getFilePath method 2016-02-04 15:57:53 +02:00
yuri 6d17017c2d wysiwyg: auto height 2016-02-04 13:08:18 +02:00
yuri 9fea9d46fb fix attachment entry point 2016-02-04 12:44:37 +02:00
yuri 3925d83b68 when select display only not empty categories 2016-02-04 12:30:43 +02:00
yuri ca23f1d58e add document 2016-02-04 12:15:28 +02:00
yuri 4492293464 new view naming 2016-02-03 15:30:33 +02:00
yuri cd0a32846c added theme 2016-02-03 11:52:16 +02:00
yuri f5d0a80626 impoty: empty assigned user 2016-02-03 10:43:42 +02:00
yuri 1b0fdad357 chache user layout 2016-02-02 17:03:28 +02:00
yuri 9ea5e3f4d0 email-to-case: no distribution 2016-02-02 15:58:40 +02:00
yuri 79416d7ac5 fix note error 2016-02-02 15:54:35 +02:00
yuri 52c6ecbcb6 new view name standard 2016-02-02 15:37:09 +02:00
yuri f6732e72d2 notification: related id 2016-02-02 12:48:31 +02:00
yuri bbf2128c8a fix notification all read 2016-02-02 12:19:01 +02:00
yuri d5ba8058e4 notification list view link 2016-02-02 11:28:32 +02:00
yuri 926e243aa3 Notification remove 2016-02-01 17:36:53 +02:00
yuri ed7d24bc8f notification fronend refactor 2016-02-01 17:09:45 +02:00
yuri 4f4069c3d7 case distribution small change 2016-02-01 15:49:03 +02:00
yuri 9426a09a40 fix stream post view 2016-02-01 11:51:53 +02:00
yuri bfd9b40a5b fix email create contact 2016-02-01 11:04:39 +02:00
yuri e94da5c189 select manager: addAndWhere addOrWhere 2016-01-29 16:56:51 +02:00
yuri 36847497fc fix case assignment if email is duplicate 2016-01-29 16:30:09 +02:00
yuri 0bb52a11ea fix email sent filter 2016-01-29 15:08:34 +02:00
yuri 9f7043a85d isFromTeams filter 2016-01-29 14:54:46 +02:00
yuri eafb8bd2cb fix portal auth 2016-01-29 11:36:17 +02:00
yuri 63eeea7b26 lang 2016-01-29 11:29:07 +02:00
yuri eac2372e00 edit dd for stream panel 2016-01-29 11:26:04 +02:00
yuri d9e972684c change portal user name autofill 2016-01-29 11:12:39 +02:00
yuri aaa9d1a7b4 add items to default filter layouts 2016-01-29 10:46:57 +02:00
yuri df9a778ba0 portal dev 2016-01-28 17:55:28 +02:00
yuri 68612cf9d1 fux uk_UA 2016-01-28 16:26:07 +02:00
yuri 26b72ea73d Added Mass Email link 2016-01-28 16:19:59 +02:00
yuri e8c570f5df fix emailReplyToAllByDefault 2016-01-28 16:10:29 +02:00
yuri abbf601325 Preferences: replyEmailToAllByDefault 2016-01-28 15:57:23 +02:00
yuri 1cd73e2f50 fix lang 2016-01-28 15:33:11 +02:00
yuri 4b49bf280b portalUserLimit 2016-01-28 15:23:44 +02:00
yuri 48302fae95 code improvements 2016-01-28 13:00:39 +02:00
yuri c525698427 fix reply cc 2016-01-27 16:29:47 +02:00
yuri 64738979e3 fix campaign revenue sum 2016-01-27 16:17:06 +02:00
yuri bed7434cd0 Settings: added readableDateFormatDisabled 2016-01-27 15:42:19 +02:00
yuri 95f23863d4 attachment: sourceId 2016-01-27 11:56:22 +02:00
yuri 1406527755 text field parameters added 2016-01-27 11:08:16 +02:00
yuri 78395407e3 load jsLibs before login 2016-01-27 10:53:28 +02:00
yuri 26e5c802b6 portal dev 2016-01-26 16:26:10 +02:00
yuri 2f5f64e53c added d/m/y date format 2016-01-26 11:17:22 +02:00
yuri a1c95fe0e9 kb changes 2016-01-26 11:17:09 +02:00
yuri eb17c54dd6 opportunity assigned user not required 2016-01-25 15:58:51 +02:00
yuri f3207a271a fix acl delete own record 2016-01-25 11:25:55 +02:00
yuri ea76104b80 role: change order 2016-01-25 11:25:39 +02:00
yuri 3d5be39d46 fix quick create acl 2016-01-25 11:25:19 +02:00
yuri 1678bb070e dashlets changes 2016-01-22 16:52:08 +02:00
yuri 470a49d6cd fix record list dashlet 2016-01-22 16:04:02 +02:00
yuri bb11a26816 role: clear cache on team change 2016-01-22 16:01:17 +02:00
yuri 06e6b19c40 siteUrl and text search filters 2016-01-22 15:43:37 +02:00
yuri f085bf5e58 dashlet layouts dev 2016-01-22 15:01:30 +02:00
yuri 2437388bf0 dashboard improvements 2016-01-21 17:47:45 +02:00
yuri fb70c9dce6 calendar size fix 2016-01-21 10:35:28 +02:00
yuri 30384a713e calendar dashlet size 2016-01-20 18:12:17 +02:00
yuri cc26345db6 Merge branch 'master' of https://github.com/espocrm/espocrm 2016-01-20 18:03:45 +02:00
yuri f29534531d dashboard improvements 2016-01-20 18:03:37 +02:00
Yuri Kuznetsov 00a2eae74e Merge pull request #82 from alasdaircr/PATCH_warning
Typo in variable name
2016-01-20 15:19:51 +02:00
Alasdair Campbell 283cac586d PATCH: warning 2016-01-20 11:03:20 +00:00
yuri ca33cab247 fix currency change trigger 2016-01-20 12:51:09 +02:00
yuri 52fb9f8b0a increase max lenngth of attachment field 2016-01-18 16:54:49 +02:00
yuri 10fee4d974 after relate event 2016-01-18 16:48:00 +02:00
yuri 6edf6ae9f2 refactor stream query 2016-01-18 16:23:54 +02:00
yuri 58e0ee5721 portal dev 2016-01-18 15:35:23 +02:00
yuri 6354c72334 knowledge base dev 2016-01-15 16:36:20 +02:00
yuri f93e6c03c9 knowledge base dev 2016-01-15 15:23:49 +02:00
yuri ef5fec4282 portal dev 2016-01-15 14:41:58 +02:00
yuri 6dc13f229e is not read 2016-01-15 13:27:49 +02:00
yuri f148bb0089 email: is read and is important filters 2016-01-15 13:24:06 +02:00
yuri 9b9a472dd5 portal dev 2016-01-15 12:52:23 +02:00
yuri f965acf384 kb fixes 2016-01-14 17:12:36 +02:00
yuri f7e3fb3e15 knowledge base 2016-01-14 16:41:27 +02:00
yuri a8396df545 document folder acl 2016-01-14 12:02:29 +02:00
yuri 3cd91ba15e cleanup 2016-01-13 17:39:05 +02:00
yuri 2433f0d626 document changes 2016-01-13 17:30:24 +02:00
yuri c0b5661ef4 fix list tree 2016-01-13 17:30:09 +02:00
yuri ff81306e90 fix list and list tree views 2016-01-13 16:40:27 +02:00
yuri d51e38bb6e portal dev 2016-01-13 13:08:35 +02:00
yuri 5c1ae72bc6 fix text fields undefined 2016-01-13 11:16:46 +02:00
yuri b1ada57d93 portal dev 2016-01-12 15:51:30 +02:00
yuri e7afe68868 dev 2016-01-11 16:02:03 +02:00
yuri f6f58c679d fixes 2016-01-08 15:18:48 +02:00
yuri 4b4f8d2cc4 dev and fix 2016-01-08 14:50:46 +02:00
yuri 7dc230d731 portal development 2016-01-08 14:39:59 +02:00
yuri db7e33fa61 development 2016-01-05 18:04:15 +02:00
yuri e4d6b13d27 fixes 2016-01-05 13:00:30 +02:00
yuri 3177945146 portal auth 2016-01-05 11:49:14 +02:00
yuri ef9c5da2d6 portal development 2016-01-04 16:14:18 +02:00
yuri 18423c0ba1 acl portal 2015-12-29 15:16:49 +02:00
yuri f629cb3af6 role appearance change 2015-12-29 12:09:58 +02:00
yuri d081d6b2d9 portal dev 2015-12-28 17:37:17 +02:00
yuri ab3dfe4bf6 portal dev 2015-12-28 16:58:16 +02:00
yuri a472e6d348 Portal Roles 2015-12-28 14:43:10 +02:00
yuri fa014bb232 modal fixes 2015-12-25 18:31:20 +02:00
yuri bdee4068c0 fixes 2015-12-25 18:01:02 +02:00
yuri 025e7134fc acl changes and portal entity 2015-12-25 17:01:50 +02:00
yuri a388638a91 fix field readOnly 2015-12-25 15:52:30 +02:00
yuri e7b8283fdc modals fixes 2015-12-25 12:30:56 +02:00
yuri d7172f8ebe acl changes and fixes 2015-12-25 12:04:41 +02:00
yuri bc0ea9ab3a readOnly attributes 2015-12-25 10:59:28 +02:00
yuri 838f8ba3b3 fix contact layout 2015-12-24 18:03:24 +02:00
yuri 4da13a55cf hasOne link and portal user fields 2015-12-24 18:01:59 +02:00
yuri 8489bca8c0 portal fields 2015-12-24 14:59:01 +02:00
yuri d620b36dd1 Merge branch 'hotfix/3.9.3' 2015-12-23 12:37:19 +02:00
yuri 89b5daebee fix ua lang 2015-12-23 12:37:05 +02:00
yuri fdea3231e9 acl and search 2015-12-23 12:09:42 +02:00
yuri 882b74a31f fix acl and relogin issue 2015-12-23 10:43:49 +02:00
yuri 181a680296 acl and export 2015-12-23 10:06:35 +02:00
yuri d7d93e6a79 role panels 2015-12-22 16:59:52 +02:00
yuri d6ee607b9d fix email save 2015-12-22 15:57:01 +02:00
yuri 75f26e3ecc navigate in quick view 2 2015-12-22 15:43:35 +02:00
yuri e959bcb369 trim 2015-12-22 11:28:56 +02:00
yuri c9eea8796f next prev title 2015-12-21 17:28:38 +02:00
yuri 8d44e0b1ad next prev in preview 2015-12-21 17:26:37 +02:00
yuri 947f47ef25 role add field translte 2015-12-21 16:03:32 +02:00
yuri 27e5df5367 field level acl frontend 2 2015-12-21 15:15:06 +02:00
yuri b7b64d7b32 duplicate changes 2015-12-21 11:25:23 +02:00
yuri 4f9a6a0dd0 acl table change 2015-12-18 18:00:49 +02:00
yuri bb5543fc81 role field security detail view 2015-12-18 17:45:42 +02:00
yuri 8b1ffaac3f disable template 2015-12-18 11:46:06 +02:00
yuri 0961ceb203 field level client side 1 2015-12-17 16:44:32 +02:00
yuri 96ca44f91b fix acl table 2015-12-17 15:14:23 +02:00
yuri 869bf46070 attributes instead of fields; server side field level security 2015-12-17 14:58:19 +02:00
yuri af039971a6 fix acl 2015-12-16 17:44:39 +02:00
yuri 5b614691fd acl table refactor 2015-12-16 17:36:11 +02:00
yuri 39295d2d6f merge 2015-12-16 11:27:24 +02:00
yuri 51952a9283 fix issue that email reply stylesheet was broken 2015-12-16 11:26:16 +02:00
yuri e88ffc1270 wyywyg full screen button 2015-12-15 18:23:08 +02:00
yuri c7fccac10c summernote upgrade 2015-12-15 18:18:23 +02:00
yuri cdb4b4e7bd summernote upgrade 2015-12-15 18:18:02 +02:00
yuri 3fa6ac5042 Merge branch 'master' of https://github.com/espocrm/espocrm 2015-12-15 15:59:04 +02:00
Yuri Kuznetsov 47e52b6670 Merge pull request #73 from ayman-alkom/master
Translate Turkish dates
2015-12-15 15:58:45 +02:00
yuri 461eb480f1 move populate assigned user and assigned teams to view 2015-12-15 14:49:55 +02:00
yuri b73cbef3d4 Merge branch 'hotfix/3.9.3' 2015-12-15 11:03:16 +02:00
yuri c6abb0a531 fix stream list 2015-12-15 11:03:03 +02:00
yuri 7227122fd8 Merge branch 'hotfix/3.9.3' 2015-12-15 11:01:18 +02:00
yuri cf3228466d fix list 2015-12-15 11:01:06 +02:00
yuri 4452db65ed Merge branch 'hotfix/3.9.3' 2015-12-15 10:30:33 +02:00
yuri 635f0d4891 fix remove from list 2015-12-15 10:30:23 +02:00
yuri 3da60c1ada rdb before after methods added 2015-12-14 17:39:43 +02:00
yuri 7187156390 rdb relate methods 2015-12-14 17:34:20 +02:00
yuri b764fd8da2 fix email select manager 2015-12-14 15:44:04 +02:00
yuri da6d590cc1 select manager change 2015-12-14 15:43:33 +02:00
Ayman Alkom 3b265056c2 Translate Turkish dates 2015-12-14 15:11:39 +02:00
yuri 7fe08f1669 acl fixes 2015-12-14 11:58:14 +02:00
yuri dc0a616ec8 select manager changes 2015-12-11 14:43:02 +02:00
yuri 7dc43e5ccc entity class fixes 2015-12-11 12:50:23 +02:00
yuri 9a78cf2389 acl changes 2015-12-11 12:17:15 +02:00
yuri b0e050ceac email assignedUsers 2015-12-10 18:05:37 +02:00
yuri 90f06fc532 setReadOnly locked 2015-12-10 16:45:13 +02:00
yuri 6d3d922290 hide show field changhe 2015-12-10 16:04:02 +02:00
yuri 3c2bc8871e fix 2015-12-10 16:01:43 +02:00
yuri 16399bf71d acl email 2015-12-10 15:48:11 +02:00
yuri abf963099c acl load and promises 2015-12-10 12:01:01 +02:00
yuri b7ab6953cd fixes in record view 2015-12-09 18:53:13 +02:00
yuri 1628821cdd changes in record 2015-12-09 18:46:05 +02:00
yuri fbf98e9754 frontend client refactor 2015-12-09 17:21:05 +02:00
yuri b4ec610fc2 record fixes 2015-12-09 17:20:53 +02:00
yuri e2a63729b6 record view refactor 2015-12-09 12:58:45 +02:00
yuri b72924c126 panel view disabled check 2015-12-08 17:15:04 +02:00
yuri 115bcc626a Merge branch 'stable' 2015-12-08 17:05:48 +02:00
yuri 083e248f21 fix logo 2 2015-12-08 16:56:14 +02:00
yuri df422f6365 v 2015-12-08 16:51:10 +02:00
yuri 47a2fee51d fix logo 2015-12-08 16:50:35 +02:00
yuri 3fabdc1d44 Merge branch 'hotfix/3.9.2' 2015-12-08 16:23:20 +02:00
yuri 4b0be0137c fix user detail view 2015-12-08 16:23:12 +02:00
yuri 7fdb40b44e more view refactoring 2015-12-08 16:21:35 +02:00
yuri 929eeddce7 grand record view refactor 2015-12-08 12:59:19 +02:00
yuri ea5d27a87f detail view refactor 2015-12-07 17:08:17 +02:00
yuri 0da898a242 show hide field method changes 2015-12-04 16:16:10 +02:00
yuri 4a14cb0e8c showPanel hidePanel methods 2015-12-04 15:55:41 +02:00
yuri 509c7f3989 stream acl 2015-12-04 15:22:18 +02:00
yuri 38514941b8 clearfix 2015-12-04 14:24:03 +02:00
yuri 3212f59cf2 fix css 2015-12-04 14:12:59 +02:00
yuri ad25e13cf0 acl view change 2015-12-04 12:42:36 +02:00
yuri fadd4ffe42 refactor acl table 2015-12-04 12:02:38 +02:00
yuri 7a3e36c092 notifications suprt parent 2015-12-04 11:10:34 +02:00
yuri 730e8143e7 scope disabled check 2015-12-03 15:37:59 +02:00
yuri a401c4cd4c set is fetched 2015-12-03 15:34:59 +02:00
yuri 51bf1343c8 notifications and acl 2015-12-03 15:32:35 +02:00
yuri 343986bf83 email notificator acl check 2015-12-03 14:46:46 +02:00
yuri d0b3ab57de Merge branch 'hotfix/3.9.2' 2015-12-03 14:26:04 +02:00
yuri d79993ba11 phone field type fix 2015-12-03 14:25:37 +02:00
yuri 6ca6f45b58 stream and acl 2015-12-03 13:54:07 +02:00
yuri d3b50c077b ability to disable scope 2015-12-03 12:42:25 +02:00
yuri 2c4ba8c1b5 lang 2015-12-03 11:08:29 +02:00
yuri a8e00dda0b fix main view $el emptyied 2015-12-02 13:22:27 +02:00
yuri 7b88c008de fix naming 2015-12-02 13:09:20 +02:00
yuri 2c251133af naming fix 2015-12-02 13:07:48 +02:00
yuri c079b256f0 fix naming 2015-12-02 12:40:27 +02:00
yuri 6a9abab7ea refactor settings views 2015-12-02 12:23:10 +02:00
yuri f59c217053 fields/base small change 2015-12-02 11:18:51 +02:00
yuri 57008f834a Merge branch 'hotfix/3.9.2' 2015-12-02 10:47:36 +02:00
yuri 7b90e74b97 view refactoring 2015-12-02 10:47:28 +02:00
yuri da62759130 destroy popover on remove 2015-11-30 16:40:01 +02:00
yuri 7cfae284ae remove main.html 2015-11-30 15:25:18 +02:00
yuri d946eed86a html folder 2015-11-30 15:22:52 +02:00
yuri 030e4ac7ab Merge branch 'hotfix/3.9.2' 2015-11-30 14:23:22 +02:00
yuri 2e04fd5a3b style 2015-11-30 14:14:29 +02:00
yuri 6174245b22 cleanup 2015-11-30 12:22:48 +02:00
yuri 9b9d3d9634 ORM: ability to join children 2015-11-30 11:15:21 +02:00
yuri f98d5a4ee9 fix typo 2015-11-30 10:26:08 +02:00
yuri c653d731cc fix readme 2015-11-27 17:14:07 +02:00
yuri f4582ac3a6 change readme 2015-11-27 17:11:14 +02:00
yuri 5bb7842585 client manager 2015-11-27 16:58:05 +02:00
yuri e13a722dca cleanup and style fix 2015-11-27 16:03:27 +02:00
yuri dba325aa61 join conditions and alias 2015-11-27 12:21:40 +02:00
yuri 59dccbedbd fix activities queries 2015-11-27 12:05:48 +02:00
yuri df32edf85f version 2015-11-27 11:47:15 +02:00
yuri 0385513f0e rename checkPemission and fix calendar 2015-11-27 11:46:52 +02:00
yuri 710fdebbec email account small fixes 2015-11-27 11:02:49 +02:00
yuri 7b707716f9 scheduled jobs ui changes 2015-11-27 10:35:54 +02:00
yuri 8cdb2df433 email template: assignmed user not required 2015-11-27 10:28:58 +02:00
yuri 6c1fb42f59 exclude by email address 2015-11-26 15:04:30 +02:00
yuri 233da7a0be mass email: dont send twice 2015-11-26 12:24:14 +02:00
yuri 612f73dac9 link Parent filters 2015-11-26 11:48:40 +02:00
yuri 3ae7634b15 campaign log lan 2015-11-26 11:10:27 +02:00
yuri 9cfabebdad fix default config 2015-11-25 16:01:57 +02:00
yuri 0522796fe3 po lang fix 2015-11-25 12:46:20 +02:00
yuri 261e76458a fix lang 2015-11-25 12:45:36 +02:00
yuri 4f2d218a82 improve po and lang 2015-11-25 12:22:46 +02:00
yuri 4f531da9f5 de_DE 2015-11-25 10:33:39 +02:00
yuri c8adb52b7a dashlet calendar and scopeList from metadata 2015-11-24 13:13:35 +02:00
yuri 5152e1ff36 po.js code style 2015-11-24 12:55:50 +02:00
yuri 5b1cfbdcfc fix lang 2015-11-24 12:34:13 +02:00
yuri 00b690da99 notification enhancement 2015-11-24 12:21:33 +02:00
yuri ed63848efa fix lang 2015-11-24 11:37:15 +02:00
yuri d174fe3e6f fix activities 2015-11-23 18:19:54 +02:00
yuri e1a505955e calendar metadata 2015-11-23 17:49:20 +02:00
yuri a30b638a8d personal email accounts link on admin panel 2015-11-23 16:57:22 +02:00
yuri c37fb02b9e record view impovements 2015-11-23 16:44:40 +02:00
yuri 3fc5b08969 form leave off confirmation while inline edit 2015-11-23 16:06:43 +02:00
yuri 0209bc3cd3 Merge branch 'master' of https://github.com/espocrm/espocrm 2015-11-23 12:52:12 +02:00
yuri db02fc4e55 refactor calendar backend 2015-11-23 12:52:05 +02:00
yuri d7787a829e refactor activities backend 2015-11-23 12:25:31 +02:00
Yuri Kuznetsov acdea144bc Merge pull request #70 from PanuWeb/translateES
New Translations ES
2015-11-22 16:23:17 +02:00
PanuWeb 700bb150bb Remaking translations II. Translations dumped and not know why. 2015-11-20 22:56:12 -03:00
PanuWeb 9a22ed262b Remaking translations. Translations dumped and not know why. 2015-11-20 22:52:44 -03:00
PanuWeb 65827b2c02 Fix 'options'. 2015-11-20 22:38:59 -03:00
PanuWeb e23e80347b Difficult words translated. 2015-11-20 22:29:05 -03:00
PanuWeb ddedbfc999 Fix missing 'Save'. Add missing translations. 2015-11-20 21:55:32 -03:00
yuri d6144f777c cleanup 2015-11-20 16:58:43 +02:00
yuri a328eff3ae fix package.json 2015-11-20 16:43:59 +02:00
yuri 45bc019967 ver 2015-11-20 16:43:21 +02:00
yuri 2aafca7ae4 fix in about 2015-11-20 16:35:06 +02:00
yuri 13a38f9767 fix in about 2015-11-20 16:32:18 +02:00
yuri fcf07cdf7c additions in about page 2015-11-20 16:29:30 +02:00
yuri 723a01c12d fix warning 2015-11-20 15:53:50 +02:00
yuri 0c1526cb69 fix notices and logging 2015-11-20 15:47:45 +02:00
yuri e25cd0c1a5 jobSchedulingMap 2015-11-20 15:21:33 +02:00
yuri a3683b76b8 authTokenControl job 2015-11-20 15:02:13 +02:00
yuri e4e56489d7 fix notice 2015-11-20 13:13:04 +02:00
yuri 1db01f1b5f naming fix 2015-11-19 16:38:37 +02:00
yuri d9a134bb3a logo refactoring 2015-11-19 15:09:11 +02:00
yuri 1cb762fae7 map field 2015-11-19 11:25:33 +02:00
yuri 16e57e38a3 fix image preview 2015-11-18 17:38:21 +02:00
yuri 42cb6fff5c navigate through image attachments 2015-11-18 16:55:01 +02:00
yuri 55239615ef email trash 2015-11-18 12:45:47 +02:00
yuri 6083531c4a record list changes 2015-11-18 12:45:07 +02:00
yuri 65cae656c3 fix stream note rowActions 2015-11-18 10:43:17 +02:00
yuri ab928c56ad list view improvement: keep selection after return 2015-11-17 17:15:58 +02:00
yuri 884a135397 email is read fix 2015-11-17 16:54:28 +02:00
yuri da2baec89d improve list layout load 2015-11-17 16:03:29 +02:00
yuri 59dfa99ff3 inbound email: addAllTeamUsers field 2015-11-17 15:44:50 +02:00
yuri e15c748470 ics cleanup 2015-11-17 12:12:07 +02:00
yuri 51fc8ac9b1 fix linkMultiple field 2015-11-17 12:08:12 +02:00
yuri a4c0d7874f link fields create attributes 2015-11-17 11:46:26 +02:00
yuri 2f62a455a3 email: change list layout 2015-11-16 18:41:40 +02:00
yuri a7a3d8a0a7 fix record tree 2015-11-16 17:40:36 +02:00
yuri 1a7774341a fix 2015-11-16 17:33:51 +02:00
yuri 0d4565962f email template editQuick is wide 2015-11-16 17:28:05 +02:00
yuri a2ff2e2f5e Email: show replied field after reply 2015-11-16 17:22:07 +02:00
yuri b038a9449f Email Template: one-off field added 2015-11-16 16:52:14 +02:00
yuri 160d10c5d1 opt out in ui 2015-11-16 13:11:29 +02:00
yuri 4eb842d37d fix linkMultiple edit html 2015-11-16 12:47:30 +02:00
yuri 7fd78a71fd cleanup 2015-11-16 12:45:41 +02:00
yuri 88fb06d982 fix documents 2015-11-16 12:43:20 +02:00
yuri c8a208db4b documents: account panel by default 2015-11-16 12:27:38 +02:00
yuri 2aaec4ea99 documents navigation fix 2015-11-16 12:22:05 +02:00
yuri b64c897f33 email template filters 2015-11-13 16:52:59 +02:00
yuri 64bf4b8296 change order of email dropdown 2015-11-13 16:35:25 +02:00
yuri 52bb6d10be sort email templates by date created 2015-11-13 15:32:53 +02:00
yuri 3527abb171 tagetLists field for Account 2015-11-13 12:08:41 +02:00
yuri 8bdbac85a8 configurable notification sound 2015-11-13 11:46:10 +02:00
yuri 13eb8630ca try catch for email sendings 2015-11-12 17:47:43 +02:00
yuri e749ec6943 Merge branch 'hotfix/3.8.1' 2015-11-12 15:29:36 +02:00
yuri c0d0c72392 fix email filter 2015-11-12 15:29:25 +02:00
yuri f1834147c7 is on of filter 2015-11-12 12:21:33 +02:00
yuri e044d34abd entity manager: dont allow to change linkMultipleField if not custom 2015-11-12 10:37:20 +02:00
yuri bfcc5b0b14 spelling fix 2015-11-11 17:42:04 +02:00
yuri 7a5b3b23e6 varchar filters added 2015-11-11 16:50:15 +02:00
yuri 9e15565227 linkMultiple in Entity Manager 2015-11-11 15:21:18 +02:00
yuri 79e6befdf4 commit fix link manager view 2015-11-11 11:06:47 +02:00
yuri 07ff4cb3d1 refactoring and modal fix 2015-11-11 10:41:08 +02:00
yuri 961a5bb8a0 entityManager relationName 2015-11-10 18:26:10 +02:00
yuri bf5f0e0e7f cleanup 2015-11-10 16:15:05 +02:00
yuri 329f05fd5b email attachment encoded fix 2015-11-10 12:42:57 +02:00
yuri 2661511bbc silent email notification param 2015-11-10 11:46:55 +02:00
yuri cea3c8609b email failed 2015-11-10 10:40:35 +02:00
yuri 35cbbb06ce remove stream from default tabList 2015-11-10 10:31:02 +02:00
yuri 1383a5d5da fix warning 2015-11-10 10:30:14 +02:00
yuri 67857ef93c fix warning 2 2015-11-09 17:07:56 +02:00
yuri f93cc5b472 fix warning 2015-11-09 17:06:19 +02:00
yuri e9df433b27 gruntfile fix 2015-11-09 15:59:37 +02:00
yuri dc300dbbe0 mass email schedule each hour 2015-11-09 12:20:09 +02:00
yuri c6b905d503 fix import rn 2015-11-09 11:38:07 +02:00
yuri 73c1cc40eb version 2015-11-06 11:36:53 +02:00
yuri 38cf2d8500 email: change row-action 2015-11-05 17:20:39 +02:00
yuri 747c7742da email improvements: isUsers field 2015-11-05 16:57:08 +02:00
yuri 5365818d82 fix show/hide fields 2015-11-05 16:07:18 +02:00
yuri eddc32ebd7 fix bad comments 2015-11-05 16:01:40 +02:00
yuri 7ae41e414b email selectManager changes 2015-11-05 15:56:42 +02:00
yuri 6572d2a998 no disconnect for smtp 2015-11-05 11:39:43 +02:00
yuri 6a2314060f force to close sockets for emails 2015-11-05 11:20:24 +02:00
yuri 6a5e22eaa0 cleanup 2015-11-04 17:10:47 +02:00
yuri 98f77041e8 cleanup 2015-11-04 17:09:11 +02:00
yuri 5fb0ddb1d2 fix in export 2015-11-04 16:24:52 +02:00
yuri 7bfedff3c8 export refactor 2015-11-04 16:23:48 +02:00
yuri cc364bc088 summernote insertText 2015-11-04 15:25:51 +02:00
yuri 81fd286834 trim 2015-11-04 12:05:52 +02:00
yuri 7d3af14f4d date sent for inbound email 2015-11-04 11:41:39 +02:00
yuri 37f5244790 fix warning in language 2015-11-04 11:02:54 +02:00
yuri 61fd827dca email template label fix 2015-11-04 10:58:44 +02:00
yuri de68abfbb4 license 2015-11-04 10:56:15 +02:00
yuri 03ecfdb805 fix lang 2015-11-04 10:55:22 +02:00
yuri 2061bf68af Merge branch 'master' of https://github.com/espocrm/espocrm 2015-11-03 17:25:09 +02:00
yuri 79f9aae744 Merge branch 'hotfix/3.7.5' 2015-11-03 17:24:43 +02:00
yuri d6fe7b59eb fix campaign statistics 2015-11-03 17:24:37 +02:00
yuri 7287854cc0 silent and noStream 2015-11-03 15:43:44 +02:00
Yuri Kuznetsov dd5a395061 Merge pull request #64 from PanuWeb/translateES
Updated Spanish translation
2015-11-03 10:21:33 +02:00
PanuWeb da1b92fdd4 Complete missing translations. 2015-11-02 18:48:38 -03:00
PanuWeb f1f23b37c4 Improved some translations. 2015-11-02 18:30:58 -03:00
yuri fea5669078 improve navigate 2015-10-30 17:57:56 +02:00
yuri 9fb88a6b92 changes for navigation buttons 2015-10-30 17:48:48 +02:00
yuri 3eb6648d2b prevNextButtons in detail view 2015-10-30 17:30:01 +02:00
yuri 7e8f0db610 change lang 2015-10-30 12:26:51 +02:00
yuri 6c57d9c658 fix calendar ratio 2015-10-30 12:24:47 +02:00
yuri bc3e873ef7 upgrade fullcalendar 2015-10-30 12:00:10 +02:00
yuri 50105087cc stream filters and panel filters 2015-10-30 11:41:29 +02:00
yuri f3406f1fcd stream filters 2015-10-30 11:17:29 +02:00
yuri 8e105205a4 fix small 2015-10-29 16:43:42 +02:00
yuri 6a496be1fa exportSkipFieldList 2015-10-29 15:50:24 +02:00
yuri ecc6e9f4ec restrict access to mention 2015-10-29 15:20:55 +02:00
yuri deee30eb3e entity manager: no stream for user 2015-10-29 11:26:50 +02:00
yuri c92ba7f8f6 stream tab 2015-10-29 11:20:47 +02:00
yuri 5f46b2f74a user stream 2015-10-29 11:03:32 +02:00
yuri 5c642f93e9 notifications about post to all 2015-10-28 17:33:52 +02:00
yuri 915c58e9ab revert comment 2015-10-28 17:28:19 +02:00
yuri ff437c204f notifications about post 2015-10-28 17:27:42 +02:00
yuri e25bfbf1d7 license fix 2015-10-28 16:39:05 +02:00
yuri ab4e16e9e7 post to users 2015-10-28 16:22:07 +02:00
yuri d60d8bdcae user stream 2015-10-28 12:19:49 +02:00
yuri a1f641af7a stream post for user 2015-10-28 11:17:38 +02:00
yuri 5cae8f359a fix installer jquery 2015-10-27 17:39:26 +02:00
yuri 19e10aa748 stream post 2015-10-27 17:12:27 +02:00
yuri 0e24774fb9 stream post 2015-10-27 16:14:46 +02:00
yuri 31d31fca73 fix strem acl 2015-10-27 12:48:59 +02:00
yuri f874aed44f stream post client 2015-10-27 12:37:58 +02:00
yuri 04ce825191 stream post 2 2015-10-26 17:14:33 +02:00
yuri 516f2218d4 stream post 2015-10-26 12:54:59 +02:00
yuri 3cbf1447c9 Merge branch 'hotfix/3.7.5' 2015-10-26 11:10:22 +02:00
yuri 1c3ca4aa5a fix vertical navbar scroll 2015-10-26 11:09:57 +02:00
yuri 143ab06a74 error messages 2015-10-26 10:44:38 +02:00
yuri c9609bf707 stream internal posts 3 2015-10-23 16:28:28 +03:00
yuri 291380c6b4 stream internal posts 2 2015-10-23 15:55:49 +03:00
yuri 74edceaf67 stream internal posts 1 2015-10-23 14:59:22 +03:00
yuri 84754077c5 calendar scope list configuranle 2015-10-22 17:12:34 +03:00
yuri e2dae62fa9 fix panel filters 2015-10-22 15:50:37 +03:00
yuri e0d475e2da fix panel filters 2015-10-22 15:50:09 +03:00
yuri 02cdf522f6 campaign tooltips 2 2015-10-22 15:01:00 +03:00
yuri 8345307760 campaign tooltips 2015-10-22 14:59:36 +03:00
yuri 888bb9d3db Merge branch 'hotfix/3.7.4' 2015-10-22 11:35:50 +03:00
yuri 0a0f8da2f4 fix auth for 5.5 2015-10-22 10:41:07 +03:00
yuri bb5d5a0ccf text filter default search by email address 2015-10-21 17:14:57 +03:00
yuri 1bd5eac103 ver 2015-10-21 10:09:21 +03:00
yuri 61957e628b fix optOut 2015-10-21 10:07:15 +03:00
yuri 97aab07d77 merge 2015-10-20 17:55:54 +03:00
yuri c5296bf906 typo 2015-10-20 17:52:26 +03:00
yuri 707f1a0b5c fix typo 2015-10-20 17:48:41 +03:00
yuri 5ffa68bee1 Merge branch 'hotfix/3.7.4' 2015-10-20 17:38:11 +03:00
yuri a16919f10b fix typo 2015-10-20 17:38:04 +03:00
yuri 7050757e4e fix campaign type 2015-10-20 17:22:52 +03:00
yuri cbd7ef4737 merge 2015-10-20 15:48:48 +03:00
yuri d27e9c91e7 import: dont import if no fields 2015-10-20 15:47:42 +03:00
yuri 5e1c7bce33 leads actual filter 2015-10-20 15:38:25 +03:00
yuri a23ac54da0 email template: translate enum 2015-10-20 15:32:01 +03:00
yuri 260c050f36 fix email address 2 2015-10-20 13:01:14 +03:00
yuri fc5c07927f fix email address case 2015-10-20 12:57:42 +03:00
yuri d321f0d701 email invitees duplicates 2015-10-20 12:32:50 +03:00
yuri dddedcf088 Merge branch 'hotfix/3.7.4' 2015-10-20 12:27:13 +03:00
yuri 95cbc138f7 meeting/call/task and converted leads 2015-10-20 12:27:05 +03:00
yuri 395063ea35 order global search 2015-10-20 11:42:16 +03:00
yuri 835f95eb52 email template list layout 2015-10-20 11:29:05 +03:00
yuri c0f6c91a0e fix email draft 2015-10-20 11:26:09 +03:00
yuri b410d0e66f todays task 2015-10-19 17:43:32 +03:00
yuri 52853a4dc4 Merge branch 'stable' 2015-10-19 16:18:24 +03:00
yuri d04f72cfd8 vers 2015-10-19 16:14:44 +03:00
yuri a9203b8e22 fix global search 2015-10-19 16:13:52 +03:00
yuri 31c7fdcfa6 manual merge 2015-10-19 15:37:41 +03:00
yuri e89c7c9328 email filter improvement 2015-10-19 15:36:22 +03:00
yuri 7808865080 import csv label 2015-10-19 15:27:09 +03:00
yuri 5283d1b6ae Merge branch 'master' of https://github.com/espocrm/espocrm 2015-10-16 17:20:47 +03:00
yuri da6546779a Merge branch 'hotfix/3.7.3' 2015-10-16 17:20:25 +03:00
yuri 404e2de3b6 fix email isRead 2015-10-16 17:19:51 +03:00
Yuri Kuznetsov 9ba2611f3f Update README.md 2015-10-16 14:22:49 +03:00
yuri f02dabc540 industry list 2015-10-16 13:50:42 +03:00
yuri c29da46a97 fix client side access denied 2015-10-16 13:07:37 +03:00
yuri b7702d2418 order fields in entity manager 2015-10-16 12:40:15 +03:00
yuri 2bc56db4c6 fix edit view link to detail 2015-10-16 12:33:59 +03:00
yuri dd0ef5455e fix 2015-10-16 10:40:45 +03:00
Yuri Kuznetsov 7cffefff1c Update README.md 2015-10-15 12:50:19 +03:00
yuri a8396df12a Merge branch 'hotfix/3.7.2' 2015-10-15 12:06:44 +03:00
yuri 901bee6d3f fix campaign 2015-10-15 11:52:25 +03:00
yuri 3375eff719 Merge branch 'hotfix/3.7.2' 2015-10-14 15:13:59 +03:00
yuri 72a0415207 fix orderBy by alias 2015-10-14 13:03:08 +03:00
yuri de69652137 fix id in model.set 2015-10-14 11:35:21 +03:00
yuri f6b696aad6 Merge branch 'master' of https://github.com/espocrm/espocrm 2015-10-13 15:57:43 +03:00
yuri e7018965c9 ajaxCall and Import not Duplicate 2015-10-13 15:57:30 +03:00
Yuri Kuznetsov 126eaed2ca Merge pull request #62 from PanuWeb/translateES
Spanish translations - es_ES (Complete)
2015-10-12 16:40:59 +03:00
yuri 8916b5eca8 Merge branch 'hotfix/3.7.2' 2015-10-12 15:17:43 +03:00
yuri dda34dce5f notImportable linkMultiple 2015-10-12 10:45:33 +03:00
yuri 1cd2d6b35e target lists field not importable 2015-10-12 10:43:50 +03:00
yuri 9888ec8a6f fix global searct 2015-10-12 10:30:16 +03:00
PanuWeb e2d5592d0a Spanish translations - es_ES (Complete) 2015-10-10 14:37:31 -03:00
PanuWeb 242d1fcfe5 Spanish translations - es_ES (90/100) 2015-10-10 13:32:46 -03:00
PanuWeb 77b0ebfa76 Spanish translations - es_ES (80/100) 2015-10-09 22:24:24 -03:00
yuri ea5321577a fix target list import 2015-10-08 17:55:48 +03:00
yuri 89508ccc3e change email labels 2015-10-08 10:54:33 +03:00
yuri 24d80f86e5 Merge branch 'hotfix/3.7.2' 2015-10-07 16:53:34 +03:00
yuri 23c772e029 fix config 2015-10-07 16:53:22 +03:00
yuri e0b6c2cf6f Merge branch 'hotfix/3.7.2' 2015-10-07 15:00:31 +03:00
yuri e67387d9ea additionalSelectColumns 2015-10-07 15:00:03 +03:00
yuri aac356d2a3 Merge branch 'hotfix/3.7.2' 2015-10-07 12:22:21 +03:00
yuri 2156094407 cleanup 2015-10-07 12:21:59 +03:00
yuri 54a6bc9c87 Merge branch 'hotfix/3.7.2' 2015-10-07 12:18:10 +03:00
yuri 03d5bf1ef2 tree impr 2015-10-07 12:18:01 +03:00
yuri b12b3895ec Merge branch 'hotfix/3.7.2' 2015-10-07 12:08:21 +03:00
yuri 42f57409c8 list tree imp 2015-10-07 12:08:11 +03:00
yuri 69d7ce408d fix preferences layout 2015-10-07 11:24:52 +03:00
yuri 15b3c0440c lead converted panel change 2015-10-07 10:56:56 +03:00
yuri e1f0715c4d email import: relate to converted entity if lead is converted 2015-10-07 10:35:07 +03:00
yuri 15aec72e97 fix double quick view 2015-10-07 10:33:47 +03:00
yuri 66eade5db7 v 2015-10-07 10:20:37 +03:00
yuri ea733bb48e versuin 2015-10-07 10:05:31 +03:00
yuri 83d9d1d924 campaign statystic percentage 2015-10-06 13:19:30 +03:00
yuri 5935bb012d stream entity type capitalized 2015-10-06 12:05:34 +03:00
yuri 48139b2be8 fix nl_NL 2015-10-06 11:52:36 +03:00
yuri 415babde64 excluding target list 2015-10-06 11:28:57 +03:00
yuri f5f5f46c75 unsubscribe entirely 2015-10-05 14:58:45 +03:00
yuri 3d89e25349 label 2015-10-05 14:36:52 +03:00
yuri 1f57a01d5d linkMultiple field for search 2015-10-05 14:34:16 +03:00
yuri 7c890aa83a fix empty tablist 2015-10-02 17:23:02 +03:00
yuri 62a29c86ab fix record controller 2015-10-02 15:27:34 +03:00
yuri bd57b6bb8e detailLayout param 2 2015-10-02 15:10:13 +03:00
yuri 9ab1d16ea0 detailLayout param 2015-10-02 15:09:39 +03:00
yuri 435aa28ca2 iconHtml for menu items 2015-10-01 13:11:05 +03:00
yuri 4bd375f154 fix notice 2015-09-30 17:22:15 +03:00
yuri d6521f9176 de_DE 2015-09-30 15:07:20 +03:00
yuri f8e0e4955a fix meeting onlymy 2015-09-30 15:06:34 +03:00
yuri 7957359c15 fix prev 2015-09-30 11:41:53 +03:00
yuri bdc3731b9a fix select manager 2015-09-30 11:39:11 +03:00
yuri 6b8af1220b opp lost filter 2015-09-30 10:24:39 +03:00
yuri 58fffeaa84 fix typo 2015-09-29 17:56:35 +03:00
yuri 5806785286 fix email notification dups 2015-09-29 11:56:15 +03:00
yuri 2f2d9b5f6f fix roles 2015-09-29 10:27:02 +03:00
yuri 5af20c1ee0 merge targetLists 2015-09-28 16:41:28 +03:00
yuri 7620be3b40 ve 2015-09-28 14:26:20 +03:00
yuri 86f591b409 trim emails when search 2015-09-28 11:18:12 +03:00
yuri 533dfe24d0 default dashlet options 2015-09-28 11:08:13 +03:00
yuri 10c51dc46e target lists panels 2015-09-28 10:55:58 +03:00
yuri a9d24a1e09 fix mass update 2015-09-28 10:45:30 +03:00
yuri 0cfe093701 fix german language 2015-09-28 10:29:50 +03:00
yuri 11ec99fe6a duplicate email template 2015-09-28 10:26:59 +03:00
yuri b07e5a6da2 campaign list layout 2015-09-28 10:24:10 +03:00
yuri 151738f896 fix tracking img 2015-09-28 10:23:20 +03:00
yuri 075a370e7a fix log opened 2015-09-25 16:46:55 +03:00
yuri e7aa147b90 fix import 2015-09-25 15:41:38 +03:00
yuri 2e988fab6d css fiux 2015-09-25 14:51:56 +03:00
yuri b38e03a53a cleanup 2015-09-25 11:32:17 +03:00
yuri 68e01f9e6f fix backbone id 2015-09-25 11:25:24 +03:00
yuri 4d32955e28 wysywyg field 2015-09-24 17:30:39 +03:00
yuri 13a2aa7f03 decrease wysywyg height 2015-09-24 17:17:17 +03:00
yuri ac91087b82 header menu improvements 2015-09-24 12:55:47 +03:00
yuri 57a4a30402 updade history panel on activities changes 2015-09-24 12:26:27 +03:00
yuri dd3ee8d69a update backbone and improve list view listening 2015-09-24 12:05:22 +03:00
yuri accbc9582e add email settings 2015-09-24 10:47:26 +03:00
yuri 4a2845d7a5 showNewRecords stream panel 2015-09-23 15:41:13 +03:00
yuri 9b2ae8992f stream fetch new 2015-09-23 15:26:20 +03:00
yuri 1bb0038be8 dont reset filters if primary filter changed 2015-09-23 11:32:38 +03:00
yuri 6c4e73f1c4 created by field in export 2015-09-23 09:53:02 +03:00
yuri 72f5dbea87 created fields in export 2015-09-23 09:52:10 +03:00
yuri aeb8411695 de_DE 2015-09-23 09:49:47 +03:00
yuri df6db9bd47 changes in mass email 2015-09-22 16:26:13 +03:00
yuri ab17044da9 grunt 2015-09-22 15:41:38 +03:00
yuri 7356bd98ab fix filter 2015-09-22 13:23:44 +03:00
yuri a631e52f63 fix usubscribe email link 2015-09-22 12:50:23 +03:00
yuri b925100df7 fix importer 2015-09-22 12:49:47 +03:00
yuri eeba65440c email template info 2015-09-22 11:46:02 +03:00
yuri 95f72933a4 fix header menu 2015-09-22 11:28:20 +03:00
yuri 4b03e74662 update zend 2015-09-22 10:27:20 +03:00
yuri b316eeb3eb fix attachment download 2015-09-21 18:44:03 +03:00
yuri 53e6904ce1 fix campaign 2015-09-21 12:38:26 +03:00
yuri e2b9647cf1 not render list after sync if modal is opened 2015-09-21 12:02:50 +03:00
yuri 1145406531 remove queue after mass email remove 2015-09-21 11:41:14 +03:00
yuri 9ce65c9a2b fix email account 2015-09-18 17:20:43 +03:00
yuri 2ec1db8379 refactor select manager 2 2015-09-18 17:19:23 +03:00
yuri 8074baef56 activities dashlet 2015-09-18 15:44:19 +03:00
yuri 4584211c04 select manager refactoring 2015-09-18 13:51:00 +03:00
yuri 290099641b dont show declined meetings/calls in only my 2015-09-18 12:00:49 +03:00
yuri d0c3044e8e dont show declined in calendar 2015-09-18 11:58:44 +03:00
yuri 4e983ff440 user calendar 2015-09-17 17:38:48 +03:00
yuri 9aba8b0d8f format address in js 2015-09-17 15:26:08 +03:00
yuri ee6ef6694f custom tab list 2015-09-17 15:01:11 +03:00
yuri 8330137c4e fixes with assignment in mass update and autopopulate 2015-09-17 13:18:05 +03:00
yuri bd420ad963 clear roles cache on team change 2015-09-17 12:18:12 +03:00
yuri e03bedf439 job improvement 2015-09-17 11:46:05 +03:00
yuri 5cba246bb2 improve link 2 2015-09-17 11:21:26 +03:00
yuri 3490c16285 link select improvements 2015-09-17 11:19:33 +03:00
yuri 957fda9e8e clear cache if user changed roles 2015-09-17 11:00:21 +03:00
yuri b940adc341 clear roles cache after role change 2015-09-17 10:46:18 +03:00
yuri f44a093ea9 acl for activities 2015-09-16 15:53:21 +03:00
yuri 0b6dc1ff5f acl attendees 2015-09-16 15:41:28 +03:00
yuri 907eb5feb5 opted out remove 2015-09-16 15:17:14 +03:00
yuri 17a339c318 target list no remove 2015-09-16 14:24:49 +03:00
yuri 3bea161618 tooltip 2015-09-16 12:50:57 +03:00
yuri b39a4a3624 track opened 2015-09-16 12:46:28 +03:00
yuri 2530d13d25 mass email test send 2015-09-16 12:26:19 +03:00
yuri 67e152c923 mass email dev 2015-09-15 15:38:58 +03:00
yuri 4934d4ad95 cleanup 2015-09-15 15:17:34 +03:00
yuri 9a072949fd lead listSmall change 2015-09-15 15:15:55 +03:00
yuri 6e5f8676a1 campaign dev 2015-09-15 14:59:03 +03:00
yuri 5a52484295 panel filters 2015-09-15 12:41:30 +03:00
yuri a3338b0db7 mass email dev 2015-09-15 11:40:27 +03:00
yuri d212d4a193 dev 2015-09-11 17:45:49 +03:00
yuri e3f9a0f607 dev 2015-09-11 17:02:01 +03:00
yuri 91b7635d26 dev 2015-09-11 16:47:50 +03:00
yuri 532581cb50 small change 2015-09-11 11:47:19 +03:00
yuri 9b4a3a8ca9 fix lang 2015-09-11 11:43:01 +03:00
yuri 564c397258 Merge branch 'hotfix/3.6.3' 2015-09-11 11:27:45 +03:00
yuri 22e81898c0 fix external account 2015-09-11 11:27:30 +03:00
yuri ec863fe09a dev 2015-09-11 11:25:11 +03:00
yuri cb9a1d31d8 email account readOnl 2015-09-11 11:05:00 +03:00
yuri 0e8d0495a9 dev 2015-09-10 17:58:03 +03:00
yuri fa19e5ebce dev 2015-09-10 17:27:27 +03:00
yuri b67e8960fa Merge branch 'hotfix/3.6.3' 2015-09-10 11:02:06 +03:00
yuri 6efd697a1e fix email import counter 2015-09-10 10:57:48 +03:00
yuri a9379dcf0a Merge branch 'hotfix/3.6.3' 2015-09-10 10:41:44 +03:00
yuri 9798f399bd fix import time 2015-09-10 10:41:37 +03:00
yuri a520510f9b Merge branch 'hotfix/3.6.3' 2015-09-10 10:36:21 +03:00
yuri fbfe82870f fix import dates 2015-09-10 10:36:00 +03:00
yuri 3b668f4dbd dev 2015-09-10 10:22:19 +03:00
yuri 62eb54d853 dev 2015-09-09 17:03:37 +03:00
yuri 81335454fd fix insert template 2015-09-09 17:03:32 +03:00
yuri 1b33221fc1 autoincrement field change 2015-09-09 09:49:01 +03:00
yuri 152c96838f detailSmall layouts changes 2015-09-09 09:42:18 +03:00
yuri f78af9b204 dev 2015-09-08 17:51:00 +03:00
yuri 302b9e759f campaign log acl 2015-09-08 17:29:00 +03:00
yuri dab7e329df dev 2015-09-08 17:22:36 +03:00
yuri 6a93fe77ca dev 2015-09-08 15:56:00 +03:00
yuri 0e21a9bf91 dev 2015-09-08 15:18:44 +03:00
yuri 723f504a56 dev 2015-09-08 12:21:49 +03:00
yuri 121b324532 add activities and tasks actions 2015-09-07 11:21:56 +03:00
yuri c54a4eee95 varchar trim and system emails 2015-09-04 17:17:41 +03:00
yuri 2a03797436 return list fix 2015-09-04 16:11:49 +03:00
yuri 55dc4d1e77 loader change 2015-09-04 15:14:39 +03:00
yuri cb51feef48 fix email importer 2015-09-04 13:24:28 +03:00
yuri e75c957aad Merge branch 'hotfix/3.6.3' 2015-09-04 12:42:27 +03:00
yuri e08624fae3 fix preferences controler 2015-09-04 12:42:09 +03:00
yuri e8ac486d4a default select filters 2015-09-04 12:34:30 +03:00
yuri 1ded65b85d fix selectRelatedFilters 2015-09-04 12:14:23 +03:00
yuri 35b2f0e57e fix removeButton 2015-09-04 11:57:58 +03:00
yuri d6ef8e1b33 fix list view return 2015-09-04 11:36:19 +03:00
yuri 118025f646 fix currency 2015-09-03 16:31:41 +03:00
yuri 0888752e2a range fields 2015-09-03 15:59:13 +03:00
yuri df5177a565 activities panel change 2015-09-03 12:15:45 +03:00
yuri 3f03770b6e refactor activities service 2015-09-03 11:59:19 +03:00
yuri 27ebac0722 app status styles 2015-09-03 11:25:09 +03:00
yuri e5b46bc547 email replyTo 2015-09-03 11:05:20 +03:00
yuri 468a236ce1 fix edit layout column 2015-09-02 15:40:18 +03:00
yuri 6fda3dd147 mass update layout fix 2015-09-02 15:17:09 +03:00
yuri 9f0705c82d pass event obj to actions 2015-09-02 14:02:48 +03:00
yuri 0ab0de2371 fix linkMultipeCategoryTree 2015-09-02 13:18:47 +03:00
yuri ba7d79ef39 Merge branch 'master' of https://github.com/espocrm/espocrm 2015-09-02 11:56:39 +03:00
yuri c0e51d85b5 vertical theme width 2015-09-02 11:56:30 +03:00
yuri 80334d59ff back route and isReturn 2015-09-02 11:20:00 +03:00
yuri 759ad1a8d3 rename scheduled job 2015-09-02 10:05:44 +03:00
yuri 7c569d3880 fix global search padding 2015-09-02 10:03:14 +03:00
yuri 7b21b82a2e email to case fix 2015-09-02 10:00:15 +03:00
yuri 5e86c5da8c list view return imporovement 2015-09-02 09:40:17 +03:00
Yuri Kuznetsov 9998f82596 Update README.md 2015-09-01 21:42:29 +03:00
Yuri Kuznetsov 9cb3f5fb3a Update README.md 2015-09-01 21:40:40 +03:00
yuri dcce3335cd returnDispatchParams 2015-09-01 16:30:41 +03:00
yuri 5f9b4d99f3 list view stored 2015-09-01 16:02:39 +03:00
yuri a6f4111383 automatically accept meeting/call for current user 2015-09-01 12:58:37 +03:00
yuri 569180ed86 email important 2015-09-01 12:31:08 +03:00
yuri f9cc21a06d import update 2015-08-31 15:19:09 +03:00
yuri e5ad31a965 prevent loop 2015-08-31 12:24:46 +03:00
yuri 5252d63260 lastXDays and nextXDays filters 2015-08-31 12:10:44 +03:00
yuri a9fea0b9f5 change default jobs 2015-08-31 11:27:45 +03:00
yuri cee91eb6af email replied 2015-08-31 11:23:39 +03:00
yuri c61765cc31 Merge branch 'hotfix/3.6.3' 2015-08-28 15:50:28 +03:00
yuri 03d3884bf4 follow fix 2015-08-28 15:50:09 +03:00
yuri cb01caddd3 Merge branch 'hotfix/3.6.2' 2015-08-28 14:30:56 +03:00
yuri 725a2be959 fix resize 3 2015-08-28 14:30:17 +03:00
yuri 45d2cec423 Merge branch 'hotfix/3.6.2' 2015-08-28 14:24:41 +03:00
yuri 08b576105c fix nav resize 2 2015-08-28 14:24:27 +03:00
yuri 6d86c65ea6 Merge branch 'hotfix/3.6.2' 2015-08-27 17:13:01 +03:00
yuri 0e19fe087b fix email restricted appearance 2015-08-27 17:12:42 +03:00
yuri 2571f967b7 displayTotalCount option 2015-08-27 16:04:21 +03:00
yuri a93d5a0678 change email filter descriptipon 2015-08-27 16:00:21 +03:00
yuri be1647548a email filters final 2015-08-27 15:50:49 +03:00
yuri 91571fa47c fix readOnly and create 2015-08-27 15:43:05 +03:00
yuri cf3220581f Merge branch 'hotfix/3.6.2' 2015-08-27 15:29:37 +03:00
yuri 44ddf9b400 fix acl manager 2015-08-27 15:29:30 +03:00
yuri 99b4f7eb5c email filters dev 2015-08-27 15:28:36 +03:00
yuri 803111b12f Merge branch 'hotfix/3.6.2' 2015-08-27 12:17:35 +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 2ceb686198 Merge branch 'hotfix/3.6.2' 2015-08-27 10:29:33 +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 cefe304c2f filters 2 2015-08-26 16:30:45 +03:00
yuri cbe4f0009b Merge branch 'hotfix/3.6.2' 2015-08-26 12:09:12 +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 2d1aa77ddc email filter 2 2015-08-25 16:16:12 +03:00
yuri 5357061d52 campaign lead created change 2015-08-25 10:30:52 +03:00
yuri 13b7db63d0 add createdBy filters 2015-08-25 09:40:22 +03:00
yuri 62b0020c67 email filters dev 2015-08-24 17:33:43 +03:00
yuri 4512dfd420 refactor acl and assigmnent permissions, email filter entity 2015-08-24 16:50:54 +03:00
yuri b1303cb50e rename hasAttachments 2015-08-24 15:07:47 +03:00
yuri 3facbc782b Merge branch 'hotfix/3.6.2' 2015-08-24 14:50:05 +03:00
yuri cdcaf7cd24 fix auth tokens 2015-08-24 14:49:53 +03:00
yuri dae249e4b2 Merge branch 'hotfix/3.6.2' 2015-08-24 12:10:29 +03:00
yuri ce782ab8bd de_DE 2015-08-24 12:10:18 +03:00
yuri 2497ab6a5e hasAttachments icon 2015-08-24 12:03:40 +03:00
yuri 2d00b27fb6 translatedOptions param 2015-08-24 11:48:45 +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 e94564b5e7 Merge branch 'hotfix/3.5.2' 2015-07-28 14:38:49 +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 ca64d7c8ec Merge branch 'hotfix/3.5.1' 2015-07-23 16:10:25 +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
2006 changed files with 60252 additions and 13767 deletions
+6 -2
View File
@@ -6,10 +6,14 @@
/data/config.php
/build
/node_modules
/client
/test.php
/main.html
/frontend/client/css/bootstrap.css
/client/css/espo.css
/client/css/espo-vertical.css
/client/css/sakura.css
/client/css/sakura-vertical.css
/client/css/violet.css
/client/css/violet-vertical.css
/tests/testData/cache/*
composer.phar
vendor/
+3
View File
@@ -0,0 +1,3 @@
Before we can merge your pull request you need to accept our CLA [here](https://github.com/espocrm/cla). It's very simple to do.
[Code Style Guidelines](https://github.com/espocrm/espocrm/wiki/Code-Style-Guidelines).
+70 -14
View File
@@ -23,6 +23,7 @@ module.exports = function (grunt) {
var jsFilesToMinify = [
'client/lib/jquery-2.1.4.min.js',
'client/lib/underscore-min.js',
'client/lib/es6-promise.min.js',
'client/lib/backbone-min.js',
'client/lib/handlebars.js',
'client/lib/base64.js',
@@ -46,7 +47,7 @@ module.exports = function (grunt) {
mkdir: {
tmp: {
options: {
mode: 0775,
mode: 0755,
create: [
'build/tmp',
]
@@ -59,22 +60,60 @@ module.exports = function (grunt) {
final: ['build/tmp'],
},
less: {
bootstrap: {
espo: {
options: {
yuicompress: true,
},
files: {
'frontend/client/css/bootstrap.css': 'frontend/less/espo/main.less',
},
'client/css/espo.css': 'frontend/less/espo/main.less',
}
},
espoVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/espo-vertical.css': 'frontend/less/espo-vertical/main.less',
}
},
sakura: {
options: {
yuicompress: true,
},
files: {
'client/css/sakura.css': 'frontend/less/sakura/main.less',
}
},
sakuraVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/sakura-vertical.css': 'frontend/less/sakura-vertical/main.less',
}
},
violet: {
options: {
yuicompress: true,
},
files: {
'client/css/violet.css': 'frontend/less/violet/main.less',
}
},
violetVertical: {
options: {
yuicompress: true,
},
files: {
'client/css/violet-vertical.css': 'frontend/less/violet-vertical/main.less',
}
}
},
cssmin: {
minify: {
files: {
'build/tmp/client/css/espo.min.css': [
'frontend/client/css/bootstrap.css',
'frontend/client/css/datepicker.css',
'frontend/client/css/jquery.timepicker.css',
'build/tmp/client/css/espo.css': [
'client/css/espo.css',
]
}
},
@@ -85,13 +124,13 @@ module.exports = function (grunt) {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
},
'build/tmp/client/espo.min.js': jsFilesToMinify.map(function (item) {
return 'frontend/' + item;
return '' + item;
})
},
copy: {
frontendFolders: {
expand: true,
cwd: 'frontend/client',
cwd: 'client',
src: [
'src/**',
'res/**',
@@ -106,13 +145,13 @@ module.exports = function (grunt) {
dest: 'build/tmp/client',
},
frontendHtml: {
src: 'frontend/html/reset.html',
src: 'frontend/reset.html',
dest: 'build/tmp/reset.html'
},
frontendLib: {
expand: true,
dot: true,
cwd: 'frontend/client/lib',
cwd: 'client/lib',
src: '**',
dest: 'build/tmp/client/lib/',
},
@@ -125,12 +164,15 @@ module.exports = function (grunt) {
'custom/**',
'data/.data',
'install/**',
'portal/**',
'vendor/**',
'html/**',
'bootstrap.php',
'cron.php',
'rebuild.php',
'clear_cache.php',
'upgrade.php',
'extension.php',
'index.php',
'LICENSE.txt',
'.htaccess',
@@ -165,6 +207,16 @@ module.exports = function (grunt) {
'build/EspoCRM-<%= pkg.version %>/**/*.html',
'build/EspoCRM-<%= pkg.version %>/**/*.txt',
]
},
folders: {
options: {
mode: '755'
},
src: [
'build/EspoCRM-<%= pkg.version %>/install',
'build/EspoCRM-<%= pkg.version %>/api',
'build/EspoCRM-<%= pkg.version %>/api/v1',
]
}
},
replace: {
@@ -179,8 +231,12 @@ module.exports = function (grunt) {
},
files: [
{
src: 'frontend/html/main.html',
dest: 'build/tmp/main.html'
src: 'build/tmp/html/main.html',
dest: 'build/tmp/html/main.html'
},
{
src: 'build/tmp/html/portal.html',
dest: 'build/tmp/html/portal.html'
}
]
},
+7 -7
View File
@@ -631,29 +631,29 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
EspoCRM - Open Source CRM
Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
EspoCRM is free software: you can redistribute it and/or modify
This program 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,
This program 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/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
EspoCRM Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
EspoCRM comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
+10 -6
View File
@@ -26,9 +26,9 @@ Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our
Never update composer dependencies if you are going to contribute code back.
Now you can build.
Now you can build. Build will create compiled css files.
If your repository is accessible via a web server then you can run EspoCRM by url `http://PROJECT_URL/frontend`. To compose a proper config.php and populate database you can run install by opening `http(s)://{YOUR_CRM_URL}/install` location in a browser. Also you need to run build before to have compiled css.
To compose a proper config.php and populate database you can run install by opening `http(s)://{YOUR_CRM_URL}/install` location in a browser. Then open `data/config.php` file and add `isDeveloperMode => true`.
### How to build
@@ -40,20 +40,24 @@ You need to have nodejs and Grunt CLI installed.
The build will be created in the `build` directory.
### How to make translation
### How to contribute
Before we can merge your pull request you need to accept our CLA [here](https://github.com/espocrm/cla). It's very simple to do.
### How to make a translation
Build po file with command:
`node po.js en_EN`
(specify needed language instead of en_EN)
After that tranlate the generated po file.
After that translate the generated po file.
Build json files from the translated po file:
1. Put your po file espocrm-en_EN.po to the `build` directory
1. Put your po file espocrm-en_EN.po into `build` directory
2. Run `node lang.js en_EN`
The files will be created in build directory.
Json files will be created in build directory grouped by folders.
### License
+7
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
require_once('../../bootstrap.php');
+12
View File
@@ -0,0 +1,12 @@
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
+39
View File
@@ -0,0 +1,39 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
require_once('../../../bootstrap.php');
if (!empty($_GET['portalId'])) {
$portalId = $_GET['portalId'];
} else {
$portalId = explode('/', $_SERVER['REQUEST_URI'])[count(explode('/', $_SERVER['SCRIPT_NAME'])) - 1];
}
$app = new \Espo\Core\Portal\Application($portalId);
$app->run();
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="rule 1G" stopProcessing="true">
<match url="^" />
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
+93
View File
@@ -0,0 +1,93 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Acl;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class Attachment extends \Espo\Core\Acl\Base
{
public function checkEntityRead(User $user, Entity $entity, $data)
{
if ($user->isAdmin()) {
return true;
}
if ($entity->get('parentType') === 'Settings') {
return true;
}
$parent = null;
$hasParent = false;
if ($entity->get('parentId') && $entity->get('parentType')) {
$hasParent = true;
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
} else if ($entity->get('relatedId') && $entity->get('relatedType')) {
$hasParent = true;
$parent = $this->getEntityManager()->getEntity($entity->get('relatedType'), $entity->get('relatedId'));
}
if ($hasParent) {
if ($parent) {
if ($parent->getEntityType() === 'Note') {
if ($parent->get('parentId') && $parent->get('parentType')) {
$parentOfParent = $this->getEntityManager()->getEntity($parent->get('parentType'), $parent->get('parentId'));
if ($parentOfParent && $this->getAclManager()->checkEntity($user, $parentOfParent)) {
return true;
}
} else {
return true;
}
} else {
if ($this->getAclManager()->checkEntity($user, $parent)) {
return true;
}
}
}
} else {
return true;
}
if ($this->checkEntity($user, $entity, $data, 'read')) {
return true;
}
return false;
}
public function checkIsOwner(User $user, Entity $entity)
{
if ($user->id === $entity->get('createdById')) {
return true;
}
return false;
}
}
+15 -7
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Acl;
@@ -37,8 +44,8 @@ class Email extends \Espo\Core\Acl\Base
if ($data === false) {
return false;
}
if (is_array($data)) {
if (empty($data['read']) || $data['read'] == 'no') {
if (is_object($data)) {
if ($data->read === false || $data->read === 'no') {
return false;
}
}
@@ -55,18 +62,19 @@ class Email extends \Espo\Core\Acl\Base
public function checkIsOwner(User $user, Entity $entity)
{
if ($entity->has('assignedUserId')) {
if ($user->id === $entity->get('assignedUserId')) {
return true;
}
if ($user->id === $entity->get('assignedUserId')) {
return true;
}
if ($user->id === $entity->get('createdById')) {
return true;
}
if ($entity->hasLinkMultipleId('assignedUsers', $user->id)) {
return true;
}
return false;
}
}
+53
View File
@@ -0,0 +1,53 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Acl;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class EmailFilter extends \Espo\Core\Acl\Base
{
public function checkIsOwner(User $user, Entity $entity)
{
if ($entity->has('parentId') && $entity->has('parentType')) {
$parentType = $entity->get('parentType');
$parentId = $entity->get('parentId');
if (!$parentType || !$parentId) return;
$parent = $this->getEntityManager()->getEntity($parentType, $parentId);
if ($parent && $parent->has('assignedUserId') && $parent->get('assignedUserId') === $user->id) {
return true;
}
}
return;
}
}
+45
View File
@@ -0,0 +1,45 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Acl;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class Notification extends \Espo\Core\Acl\Base
{
public function checkIsOwner(User $user, Entity $entity)
{
if ($user->id === $entity->get('userId')) {
return true;
}
return false;
}
}
+41
View File
@@ -0,0 +1,41 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Acl;
use \Espo\ORM\Entity;
class User extends \Espo\Core\Acl\Base
{
public function checkIsOwner(\Espo\Entities\User $user, Entity $entity)
{
return $user->id === $entity->id;
}
}
+93
View File
@@ -0,0 +1,93 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\AclPortal;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class Attachment extends \Espo\Core\AclPortal\Base
{
public function checkEntityRead(User $user, Entity $entity, $data)
{
if ($user->isAdmin()) {
return true;
}
if ($entity->get('parentType') === 'Settings') {
return true;
}
$parent = null;
$hasParent = false;
if ($entity->get('parentId') && $entity->get('parentType')) {
$hasParent = true;
$parent = $this->getEntityManager()->getEntity($entity->get('parentType'), $entity->get('parentId'));
} else if ($entity->get('relatedId') && $entity->get('relatedType')) {
$hasParent = true;
$parent = $this->getEntityManager()->getEntity($entity->get('relatedType'), $entity->get('relatedId'));
}
if ($hasParent) {
if ($parent) {
if ($parent->getEntityType() === 'Note') {
if ($parent->get('parentId') && $parent->get('parentType')) {
$parentOfParent = $this->getEntityManager()->getEntity($parent->get('parentType'), $parent->get('parentId'));
if ($parentOfParent && $this->getAclManager()->checkEntity($user, $parentOfParent)) {
return true;
}
} else {
return true;
}
} else {
if ($this->getAclManager()->checkEntity($user, $parent)) {
return true;
}
}
}
} else {
return true;
}
if ($this->checkEntity($user, $entity, $data, 'read')) {
return true;
}
return false;
}
public function checkIsOwner(User $user, Entity $entity)
{
if ($user->id === $entity->get('createdById')) {
return true;
}
return false;
}
}
+71
View File
@@ -0,0 +1,71 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\AclPortal;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class Email extends \Espo\Core\AclPortal\Base
{
public function checkEntityRead(User $user, Entity $entity, $data)
{
if ($this->checkEntity($user, $entity, $data, 'read')) {
return true;
}
if ($data === false) {
return false;
}
if (is_object($data)) {
if ($data->read === false || $data->read === 'no') {
return false;
}
}
if (!$entity->has('usersIds')) {
$entity->loadLinkMultipleField('users');
}
$userIdList = $entity->get('usersIds');
if (is_array($userIdList) && in_array($user->id, $userIdList)) {
return true;
}
return false;
}
public function checkIsOwner(User $user, Entity $entity)
{
if ($user->id === $entity->get('createdById')) {
return true;
}
return false;
}
}
@@ -0,0 +1,45 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\AclPortal;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class Notification extends \Espo\Core\AclPortal\Base
{
public function checkIsOwner(User $user, Entity $entity)
{
if ($user->id === $entity->get('userId')) {
return true;
}
return false;
}
}
+41
View File
@@ -0,0 +1,41 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\AclPortal;
use \Espo\ORM\Entity;
class User extends \Espo\Core\AclPortal\Base
{
public function checkIsOwner(\Espo\Entities\User $user, Entity $entity)
{
return $user->id === $entity->id;
}
}
+29 -8
View File
@@ -18,12 +18,21 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error,
\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 +43,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 +66,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 +84,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;
+14 -3
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -28,23 +35,27 @@ class App extends \Espo\Core\Controllers\Base
{
public function actionUser()
{
$preferences = $this->getPreferences()->toArray();
$preferences = $this->getPreferences()->getValues();
unset($preferences['smtpPassword']);
$user = $this->getUser();
if (!$user->has('teamsIds')) {
$user->loadLinkMultipleField('teams');
}
if ($user->get('isPortalUser')) {
$user->loadAccountField();
$user->loadLinkMultipleField('accounts');
}
return array(
'user' => $user->toArray(),
'user' => $user->getValues(),
'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)) {
+19 -2
View File
@@ -18,15 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class Attachment extends \Espo\Core\Controllers\Record
{
public function actionUpload($params, $data)
public function actionUpload($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (!$this->getAcl()->checkScope('Attachment', 'create')) {
throw new Forbidden();
}
list($prefix, $contents) = explode(',', $data);
$contents = base64_decode($contents);
+17 -10
View File
@@ -18,49 +18,56 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
class 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();
}
}
}
+92 -14
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -28,9 +35,12 @@ use \Espo\Core\Exceptions\Error;
class Email extends \Espo\Core\Controllers\Record
{
public function actionGetCopiedAttachments($params, $data, $request)
public function postActionGetCopiedAttachments($params, $data, $request)
{
$id = $request->get('id');
if (empty($data['id'])) {
throw new BadRequest();
}
$id = $data['id'];
return $this->getRecordService()->getCopiedAttachments($id);
}
@@ -63,25 +73,93 @@ class Email extends \Espo\Core\Controllers\Record
return $this->getRecordService()->sendTestEmail($data);
}
public function actionMarkAsRead($params, $data, $request)
public function postActionMarkAsRead($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
if (!empty($data['ids'])) {
$ids = $data['ids'];
} else {
if (!empty($data['id'])) {
$ids = [$data['id']];
} else {
throw new BadRequest();
}
}
if (empty($data['ids']) || !is_array($data['ids'])) {
throw new BadRequest();
}
$ids = $data['ids'];
return $this->getRecordService()->markAsReadByIds($ids);
return $this->getRecordService()->markAsReadByIdList($ids);
}
public function actionMarkAllAsRead($params, $data, $request)
public function postActionMarkAsNotRead($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
if (!empty($data['ids'])) {
$ids = $data['ids'];
} else {
if (!empty($data['id'])) {
$ids = [$data['id']];
} else {
throw new BadRequest();
}
}
return $this->getRecordService()->markAsNotReadByIdList($ids);
}
public function postActionMarkAllAsRead($params, $data, $request)
{
return $this->getRecordService()->markAllAsRead();
}
public function postActionMarkAsImportant($params, $data, $request)
{
if (!empty($data['ids'])) {
$ids = $data['ids'];
} else {
if (!empty($data['id'])) {
$ids = [$data['id']];
} else {
throw new BadRequest();
}
}
return $this->getRecordService()->markAsImportantByIdList($ids);
}
public function postActionMarkAsNotImportant($params, $data, $request)
{
if (!empty($data['ids'])) {
$ids = $data['ids'];
} else {
if (!empty($data['id'])) {
$ids = [$data['id']];
} else {
throw new BadRequest();
}
}
return $this->getRecordService()->markAsNotImportantByIdList($ids);
}
public function postActionMoveToTrash($params, $data)
{
if (!empty($data['ids'])) {
$ids = $data['ids'];
} else {
if (!empty($data['id'])) {
$ids = [$data['id']];
} else {
throw new BadRequest();
}
}
return $this->getRecordService()->moveToTrashByIdList($ids);
}
public function postActionRetrieveFromTrash($params, $data)
{
if (!empty($data['ids'])) {
$ids = $data['ids'];
} else {
if (!empty($data['id'])) {
$ids = [$data['id']];
} else {
throw new BadRequest();
}
}
return $this->getRecordService()->retrieveFromTrashByIdList($ids);
}
}
@@ -18,11 +18,19 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class EmailAccount extends \Espo\Core\Controllers\Record
{
+16 -1
View File
@@ -18,14 +18,29 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
class EmailAddress extends \Espo\Core\Controllers\Record
{
public function actionSearchInAddressBook($params, $data, $request)
{
if (!$this->getAcl()->checkScope('Email')) {
throw new Forbidden();
}
if (!$this->getAcl()->checkScope('Email', 'create')) {
throw new Forbidden();
}
$q = $request->get('q');
$limit = intval($request->get('limit'));
if (empty($limit) || $limit > 30) {
@@ -0,0 +1,36 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
class EmailFilter extends \Espo\Core\Controllers\Record
{
}
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
+45 -6
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -62,6 +69,9 @@ class EntityManager extends \Espo\Core\Controllers\Base
if (!empty($data['stream'])) {
$params['stream'] = $data['stream'];
}
if (!empty($data['disabled'])) {
$params['disabled'] = $data['disabled'];
}
if (!empty($data['sortBy'])) {
$params['sortBy'] = $data['sortBy'];
}
@@ -158,15 +168,31 @@ class EntityManager extends \Espo\Core\Controllers\Base
'linkType'
];
$d = array();
$additionalParamList = [
'relationName',
];
$params = array();
foreach ($paramList as $item) {
if (empty($data[$item])) {
throw new BadRequest();
}
$d[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
$params[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
}
$result = $this->getContainer()->get('entityManagerUtil')->createLink($d);
foreach ($additionalParamList as $item) {
$params[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
}
if (array_key_exists('linkMultipleField', $data)) {
$params['linkMultipleField'] = $data['linkMultipleField'];
}
if (array_key_exists('linkMultipleFieldForeign', $data)) {
$params['linkMultipleFieldForeign'] = $data['linkMultipleFieldForeign'];
}
$result = $this->getContainer()->get('entityManagerUtil')->createLink($params);
if ($result) {
$this->getContainer()->get('dataManager')->rebuild();
@@ -192,12 +218,25 @@ class EntityManager extends \Espo\Core\Controllers\Base
'labelForeign'
];
$d = array();
$additionalParamList = [];
$params = array();
foreach ($paramList as $item) {
$d[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
$params[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
}
$result = $this->getContainer()->get('entityManagerUtil')->updateLink($d);
foreach ($additionalParamList as $item) {
$params[$item] = filter_var($data[$item], \FILTER_SANITIZE_STRING);
}
if (array_key_exists('linkMultipleField', $data)) {
$params['linkMultipleField'] = $data['linkMultipleField'];
}
if (array_key_exists('linkMultipleFieldForeign', $data)) {
$params['linkMultipleFieldForeign'] = $data['linkMultipleFieldForeign'];
}
$result = $this->getContainer()->get('entityManagerUtil')->updateLink($params);
if ($result) {
$this->getContainer()->get('dataManager')->clearCache();
+26 -5
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -58,6 +65,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 +83,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 +114,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;
}
@@ -18,23 +18,38 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class ExternalAccount extends \Espo\Core\Controllers\Record
{
public static $defaultAction = 'list';
protected function checkControllerAccess()
{
if (!$this->getAcl()->checkScope('ExternalAccount')) {
throw new Forbidden();
}
}
public function actionList($params, $data, $request)
{
$integrations = $this->getEntityManager()->getRepository('Integration')->find();
$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 +92,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->isPut() && !$request->isPost() && !$request->isPatch()) {
throw new BadRequest();
}
list($integration, $userId) = explode('__', $params['id']);
if ($this->getUser()->id != $userId) {
throw new Forbidden();
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
+13 -6
View File
@@ -18,7 +18,14 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -29,11 +36,11 @@ class GlobalSearch extends \Espo\Core\Controllers\Base
{
public function actionSearch($params, $data, $request)
{
$query = $params['query'];
$offset = $request->get('offset');
$maxSize = $request->get('maxSize');
$query = $request->get('q');
$offset = intval($request->get('offset'));
$maxSize = intval($request->get('maxSize'));
return $this->getService('GlobalSearch')->find($query, $offset, $maxSize);
}
}
+7 -1
View File
@@ -18,13 +18,19 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
class I18n extends \Espo\Core\Controllers\Base
{
public function actionRead($params, $data)
{
return $this->getContainer()->get('language')->getAll();
+38 -4
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -71,10 +78,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 +99,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'],
@@ -119,6 +140,10 @@ class Import extends \Espo\Core\Controllers\Record
'action' => $data['action'],
);
if (array_key_exists('updateBy', $data)) {
$importParams['updateBy'] = $data['updateBy'];
}
$attachmentId = $data['attachmentId'];
if (!$this->getAcl()->check($data['entityType'], 'edit')) {
@@ -127,5 +152,14 @@ class Import extends \Espo\Core\Controllers\Record
return $this->getService('Import')->import($data['entityType'], $data['fields'], $attachmentId, $importParams);
}
public function postActionUnmarkAsDuplicate($params, $data)
{
if (empty($data['id']) || empty($data['entityType']) || empty($data['entityId'])) {
throw new BadRequest();
}
$this->getService('Import')->unmarkAsDuplicate($data['id'], $data['entityType'], $data['entityId']);
return true;
}
}
@@ -18,10 +18,20 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class InboundEmail extends \Espo\Core\Controllers\Record
{
protected function checkControllerAccess()
+23 -11
View File
@@ -18,21 +18,30 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\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 +49,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();
}
}
+79
View File
@@ -0,0 +1,79 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
class 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();
}
}
+27 -3
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -26,6 +33,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 +46,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 +69,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']);
}
}
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
+8 -1
View File
@@ -18,7 +18,14 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
+46 -12
View File
@@ -18,13 +18,20 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
class Notification extends \Espo\Core\Controllers\Base
class Notification extends \Espo\Core\Controllers\Record
{
public static $defaultAction = 'list';
@@ -32,35 +39,62 @@ 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'));
$after = $request->get('after');
$params = array(
'offset' => $offset,
'maxSize' => $maxSize,
'after' => $after
);
$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);
}
public function actionExport($params, $data, $request)
{
throw new Error();
}
public function actionMassUpdate($params, $data, $request)
{
throw new Error();
}
public function actionCreateLink($params, $data, $request)
{
throw new Error();
}
public function actionRemoveLink($params, $data, $request)
{
throw new Error();
}
public function actionMerge($params, $data, $request)
{
throw new Error();
}
}
+43
View File
@@ -0,0 +1,43 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Forbidden;
class Portal extends \Espo\Core\Controllers\Record
{
protected function checkControllerAccess()
{
$portalPermission = $this->getAcl()->get('portalPermission');
if (!$portalPermission || $portalPermission === 'no') {
throw new Forbidden();
}
}
}
@@ -0,0 +1,34 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
class PortalRole extends \Espo\Core\Controllers\Record
{
}
+30 -4
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -53,27 +60,42 @@ 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() && !$request->isPut()) {
throw new BadRequest();
}
if ($this->getAcl()->getLevel('Preferences', 'read') === 'no') {
throw new Forbidden();
}
foreach ($this->getAcl()->getScopeForbiddenAttributeList('Preferences', 'edit') as $attribute) {
unset($data[$attribute]);
}
if (array_key_exists('smtpPassword', $data)) {
$data['smtpPassword'] = $this->getCrypt()->encrypt($data['smtpPassword']);
}
@@ -113,6 +135,10 @@ class Preferences extends \Espo\Core\Controllers\Base
$entity->clear('smtpPassword');
foreach ($this->getAcl()->getScopeForbiddenAttributeList('Preferences', 'read') as $attribute) {
$entity->clear($attribute);
}
return $entity->toArray();
}
}
+8 -3
View File
@@ -18,12 +18,17 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
class Role extends \Espo\Core\Controllers\Record
{
}
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
+18 -3
View File
@@ -18,12 +18,20 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
class Settings extends \Espo\Core\Controllers\Base
{
@@ -38,6 +46,9 @@ class Settings extends \Espo\Core\Controllers\Base
unset($data[$field]);
}
}
$data['jsLibs'] = $this->getMetadata()->get('app.jsLibs');
return $data;
}
@@ -46,17 +57,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();
}
+8 -1
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -26,7 +33,7 @@ use \Espo\Core\Exceptions\Error;
class Stream extends \Espo\Core\Controllers\Base
{
const MAX_SIZE_LIMIT = 400;
const MAX_SIZE_LIMIT = 200;
public static $defaultAction = 'list';
+9 -2
View File
@@ -18,12 +18,19 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
class Team extends \Espo\Core\Controllers\Record
{
}
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
+20 -15
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Controllers;
@@ -48,22 +55,16 @@ class User extends \Espo\Core\Controllers\Record
return $this->getAclManager()->getMap($user);
}
public function actionChangeOwnPassword($params, $data, $request)
public function postActionChangeOwnPassword($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (!array_key_exists('password', $data) || !array_key_exists('currentPassword', $data)) {
throw new BadRequest();
}
return $this->getService('User')->changePassword($this->getUser()->id, $data['password'], true, $data['currentPassword']);
}
public function actionChangePasswordByRequest($params, $data, $request)
public function postActionChangePasswordByRequest($params, $data, $request)
{
if (!$request->isPost()) {
throw new BadRequest();
}
if (empty($data['requestId']) || empty($data['password'])) {
throw new BadRequest();
}
@@ -82,23 +83,27 @@ class User extends \Espo\Core\Controllers\Record
$this->getEntityManager()->removeEntity($p);
return $this->getService('User')->changePassword($userId, $data['password']);
if ($this->getService('User')->changePassword($userId, $data['password'])) {
return array(
'url' => $p->get('url')
);
}
}
public function actionPasswordChangeRequest($params, $data, $request)
public function postActionPasswordChangeRequest($params, $data, $request)
{
if (!$request->isPost()) {
throw new Forbidden();
}
if (empty($data['userName']) || empty($data['emailAddress'])) {
throw new BadRequest();
}
$userName = $data['userName'];
$emailAddress = $data['emailAddress'];
$url = null;
if (!empty($data['url'])) {
$url = $data['url'];
}
return $this->getService('User')->passwordChangeRequest($userName, $emailAddress);
return $this->getService('User')->passwordChangeRequest($userName, $emailAddress, $url);
}
}
+45 -5
View File
@@ -18,17 +18,27 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
use \Espo\ORM\Entity;
use \Espo\Entities\User;
class Acl
{
private $user;
private $aclManager;
public function __construct(AclManager $aclManager, \Espo\Entities\User $user)
public function __construct(AclManager $aclManager, User $user)
{
$this->aclManager = $aclManager;
$this->user = $user;
@@ -69,14 +79,44 @@ class Acl
return $this->getAclManager()->checkReadOnlyOwn($this->getUser(), $scope);
}
public function check($subject, $action = null, $isOwner = null, $inTeam = null)
public function check($subject, $action = null)
{
return $this->getAclManager()->check($this->getUser(), $subject, $action, $isOwner, $inTeam) ;
return $this->getAclManager()->check($this->getUser(), $subject, $action);
}
public function checkScope($scope, $action = null, $isOwner = null, $inTeam = null, $entity = null)
public function checkScope($scope, $action = null)
{
return $this->getAclManager()->checkScope($this->getUser(), $subject, $action, $isOwner, $inTeam, $entity) ;
return $this->getAclManager()->checkScope($this->getUser(), $scope, $action);
}
public function checkEntity(Entity $entity, $action = 'read')
{
return $this->getAclManager()->checkEntity($this->getUser(), $entity, $action);
}
public function checkUser($permission, User $entity)
{
return $this->getAclManager()->checkUser($this->getUser(), $permission, $entity);
}
public function checkIsOwner(Entity $entity)
{
return $this->getAclManager()->checkIsOwner($this->getUser(), $entity);
}
public function checkInTeam(Entity $entity)
{
return $this->getAclManager()->checkInTeam($this->getUser(), $entity);
}
public function getScopeForbiddenAttributeList($scope, $action = 'read', $thresholdLevel = 'no')
{
return $this->getAclManager()->getScopeForbiddenAttributeList($this->getUser(), $scope, $action, $thresholdLevel);
}
public function getScopeForbiddenFieldList($scope, $action = 'read', $thresholdLevel = 'no')
{
return $this->getAclManager()->getScopeForbiddenFieldList($this->getUser(), $scope, $action, $thresholdLevel);
}
}
+121 -78
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Acl;
@@ -35,6 +42,8 @@ class Base implements Injectable
'aclManager'
);
protected $scope;
protected $injections = array();
public function inject($name, $object)
@@ -42,9 +51,10 @@ class Base implements Injectable
$this->injections[$name] = $object;
}
public function __construct()
public function __construct($scope)
{
$this->init();
$this->scope = $scope;
}
protected function init()
@@ -81,29 +91,36 @@ class Base implements Injectable
return $this->getInjection('aclManager');
}
public function checkReadOnlyTeam(User $user, $scope, $data)
public function checkReadOnlyTeam(User $user, $data)
{
if (empty($data) || !is_array($data) || !isset($data['read'])) {
if (empty($data) || !is_object($data) || !isset($data->read)) {
return false;
}
return $data['read'] === 'team';
return $data->read === 'team';
}
public function checkReadOnlyOwn(User $user, $scope, $data)
public function checkReadOnlyOwn(User $user, $data)
{
if (empty($data) || !is_array($data) || !isset($data['read'])) {
if (empty($data) || !is_object($data) || !isset($data->read)) {
return false;
}
return $data['read'] === 'own';
return $data->read === 'own';
}
public function checkEntity(User $user, Entity $entity, $data, $action)
{
return $this->checkScope($user, $data, $entity->getEntityType(), $action, null, null, $entity);
if ($user->isAdmin()) {
return true;
}
return $this->checkScope($user, $data, $action, $entity);
}
public function checkScope(User $user, $data, $scope, $action = null, $isOwner = null, $inTeam = null, Entity $entity = null)
public function checkScope(User $user, $data, $action = null, Entity $entity = null, $entityAccessData = array())
{
if ($user->isAdmin()) {
return true;
}
if (is_null($data)) {
return false;
}
@@ -113,82 +130,103 @@ class Base implements Injectable
if ($data === true) {
return true;
}
if (!is_null($action)) {
if (array_key_exists($action, $data)) {
$value = $data[$action];
if ($value === 'all' || $value === true) {
return true;
}
if (!$value || $value === 'no') {
return false;
}
if (is_null($isOwner)) {
if ($entity) {
$isOwner = $this->checkIsOwner($user, $entity);
} else {
return true;
}
}
if ($isOwner) {
if ($value === 'own' || $value === 'team') {
return true;
}
}
if (is_null($inTeam) && $entity) {
$inTeam = $this->checkInTeam($user, $entity);
}
if ($inTeam) {
if ($value === 'team') {
return true;
}
}
return false;
}
if (is_string($data)) {
return true;
}
return true;
}
public function checkIsOwner(User $user, Entity $entity)
{
if ($entity->has('assignedUserId')) {
if ($user->id === $entity->get('assignedUserId')) {
$isOwner = null;
if (isset($entityAccessData['isOwner'])) {
$isOwner = $entityAccessData['isOwner'];
}
$inTeam = null;
if (isset($entityAccessData['inTeam'])) {
$inTeam = $entityAccessData['inTeam'];
}
if (is_null($action)) {
return true;
}
if (!isset($data->$action)) {
return true;
}
$value = $data->$action;
if ($value === 'all' || $value === 'yes' || $value === true) {
return true;
}
if (!$value || $value === 'no') {
return false;
}
if (is_null($isOwner)) {
if ($entity) {
$isOwner = $this->checkIsOwner($user, $entity);
} else {
return true;
}
}
if ($entity->has('createdById')) {
if ($user->id === $entity->get('createdById')) {
if ($isOwner) {
if ($value === 'own' || $value === 'team') {
return true;
}
}
if (is_null($inTeam) && $entity) {
$inTeam = $this->checkInTeam($user, $entity);
}
if ($inTeam) {
if ($value === 'team') {
return true;
}
}
return false;
}
public function checkIsOwner(User $user, Entity $entity)
{
if ($entity->hasAttribute('assignedUserId')) {
if ($entity->has('assignedUserId')) {
if ($user->id === $entity->get('assignedUserId')) {
return true;
}
}
} else if ($entity->hasAttribute('createdById')) {
if ($entity->has('createdById')) {
if ($user->id === $entity->get('createdById')) {
return true;
}
}
}
if ($entity->hasAttribute('assignedUsersIds') && $entity->hasRelation('assignedUsers')) {
if ($entity->hasLinkMultipleId('assignedUsers', $user->id)) {
return true;
}
}
return false;
}
public function checkInTeam(User $user, Entity $entity)
{
$userTeamIds = $user->get('teamsIds');
$userTeamIdList = $user->getLinkMultipleIdList('teams');
if (!$entity->hasRelation('teams') || !$entity->hasField('teamsIds')) {
if (!$entity->hasRelation('teams') || !$entity->hasAttribute('teamsIds')) {
return false;
}
if (!$entity->has('teamsIds')) {
$entity->loadLinkMultipleField('teams');
}
$entityTeamIdList = $entity->getLinkMultipleIdList('teams');
$teamIds = $entity->get('teamsIds');
if (empty($teamIds)) {
if (empty($entityTeamIdList)) {
return false;
}
foreach ($userTeamIds as $id) {
if (in_array($id, $teamIds)) {
foreach ($userTeamIdList as $id) {
if (in_array($id, $entityTeamIdList)) {
return true;
}
}
@@ -197,27 +235,32 @@ class Base implements Injectable
public function checkEntityDelete(User $user, Entity $entity, $data)
{
$result = $this->checkEntity($user, $entity, $data, 'delete');
if (!$result) {
if (is_array($data)) {
if ($data['edit'] != 'no') {
if ($entity->has('createdById') && $entity->get('createdById') == $user->id) {
if (!$entity->has('assignedUserId')) {
if ($user->isAdmin()) {
return true;
}
if ($this->checkEntity($user, $entity, $data, 'delete')) {
return true;
}
if (is_object($data)) {
if ($data->edit !== 'no' || $data->create !== 'no') {
if ($entity->has('createdById') && $entity->get('createdById') == $user->id) {
if (!$entity->has('assignedUserId')) {
return true;
} else {
if (!$entity->get('assignedUserId')) {
return true;
}
if ($entity->get('assignedUserId') == $entity->get('createdById')) {
return true;
} else {
if (!$entity->get('assignedUserId')) {
return true;
}
if ($entity->get('assignedUserId') == $entity->get('createdById')) {
return true;
}
}
}
}
}
}
return $result;
return false;
}
}
+525 -82
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Acl;
@@ -25,31 +32,69 @@ namespace Espo\Core\Acl;
use \Espo\Core\Exceptions\Error;
use \Espo\ORM\Entity;
use \Espo\Entities\User;
use \Espo\Core\Utils\Config;
use \Espo\Core\Utils\Metadata;
use \Espo\Core\Utils\FieldManager;
use \Espo\Core\Utils\File\Manager as FileManager;
class Table
{
private $data = array(
'table' => array()
protected $type = 'acl';
protected $defaultAclType = 'recordAllTeamOwnNo';
private $data = null;
protected $cacheFilePath;
protected $actionList = ['read', 'stream', 'edit', 'delete', 'create'];
protected $booleanActionList = ['create'];
protected $levelList = ['yes', 'all', 'team', 'own', 'no'];
protected $fieldActionList = ['read', 'edit'];
protected $fieldLevelList = ['yes', 'no'];
protected $valuePermissionList = ['assignmentPermission', 'userPermission', 'portalPermission'];
protected $valuePrtmissionHighestLevels = array(
'assignmentPermission' => 'all',
'userPermission' => 'all',
'portalPermission' => 'yes'
);
private $cacheFile;
private $fileManager;
private $actionList = ['read', 'edit', 'delete'];
private $metadata;
private $levelList = ['all', 'team', 'own', 'no'];
private $fieldManager;
protected $fileManager;
protected $forbiddenAttributesCache = array();
protected $metadata;
protected $forbiddenFieldsCache = array();
public function __construct(\Espo\Entities\User $user, $config = null, $fileManager = null, $metadata = null)
public function __construct(User $user, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManager $fieldManager = null)
{
$this->data = (object) [
'table' => (object) [],
'fieldTable' => (object) [],
'fieldTableQuickAccess' => (object) [],
];
$this->user = $user;
$this->metadata = $metadata;
if ($fieldManager) {
$this->fieldManager = $fieldManager;
}
if (!$this->user->isFetched()) {
throw new Error();
throw new Error('User must be fetched before ACL check.');
}
$this->user->loadLinkMultipleField('teams');
@@ -57,22 +102,46 @@ class Table
if ($fileManager) {
$this->fileManager = $fileManager;
}
$this->valuePermissionList = $this->metadata->get('app.' . $this->type . '.defs.valuePermissionList', $this->valuePermissionList);
$this->cacheFile = 'data/cache/application/acl/' . $user->id . '.php';
$this->initCacheFilePath();
if ($config && $config->get('useCache') && file_exists($this->cacheFile)) {
$cached = include $this->cacheFile;
if ($config && $config->get('useCache') && file_exists($this->cacheFilePath)) {
$cached = include $this->cacheFilePath;
$this->data = $cached;
$this->initSolid();
} else {
$this->load();
$this->initSolid();
if ($config && $fileManager && $config->get('useCache')) {
$this->buildCache();
}
}
}
protected function initCacheFilePath()
{
$this->cacheFilePath = 'data/cache/application/acl/' . $this->user->id . '.php';
}
protected function getUser()
{
return $this->user;
}
protected function getMetadata()
{
return $this->metadata;
}
protected function getFieldManager()
{
return $this->fieldManager;
}
protected function getConfig()
{
return $this->config;
}
public function getMap()
{
return $this->data;
@@ -80,8 +149,13 @@ class Table
public function getScopeData($scope)
{
if (array_key_exists($scope, $this->data['table'])) {
return $this->data['table'][$scope];
if (isset($this->data->table->$scope)) {
$data = $this->data->table->$scope;
if (is_string($data)) {
$data = $this->getScopeData($data);
return $data;
}
return $data;
}
return null;
}
@@ -92,17 +166,17 @@ class Table
return null;
}
if (array_key_exists($permission, $this->data)) {
return $this->data[$permission];
if (isset($this->data->$permission)) {
return $this->data->$permission;
}
return null;
}
public function getLevel($scope, $action)
{
if (array_key_exists($scope, $this->data['table'])) {
if (array_key_exists($action, $this->data['table'][$scope])) {
return $this->data['table'][$scope][$action];
if (isset($this->data->table->$scope)) {
if (isset($this->table->$scope->$action)) {
return $this->data->table->$scope->$action;
}
}
return false;
@@ -110,48 +184,343 @@ class Table
private function load()
{
$aclTables = [];
$assignmentPermissionList = [];
$userPermissionList = [];
$userRoles = $this->user->get('roles');
foreach ($userRoles as $role) {
$aclTables[] = $role->get('data');
$assignmentPermissionList[] = $role->get('assignmentPermission');
$userPermissionList[] = $role->get('userPermission');
$valuePermissionLists = (object)[];
foreach ($this->valuePermissionList as $permission) {
$valuePermissionLists->$permission = [];
}
$teams = $this->user->get('teams');
foreach ($teams as $team) {
$teamRoles = $team->get('roles');
foreach ($teamRoles as $role) {
$aclTables[] = $role->get('data');
$assignmentPermissionList[] = $role->get('assignmentPermission');
$userPermissionList[] = $role->get('userPermission');
$aclTableList = [];
$fieldTableList = [];
if (!$this->user->isAdmin()) {
$roleList = $this->getRoleList();
foreach ($roleList as $role) {
$aclTableList[] = $role->get('data');
$fieldTableList[] = $role->get('fieldData');
foreach ($this->valuePermissionList as $permission) {
$valuePermissionLists->{$permission}[] = $role->get($permission);
}
}
$aclTable = $this->mergeTableList($aclTableList);
$fieldTable = $this->mergeFieldTableList($fieldTableList);
$this->applyDefault($aclTable, $fieldTable);
$this->applyDisabled($aclTable, $fieldTable);
$this->applyMandatory($aclTable, $fieldTable);
} else {
$aclTable = (object) [];
foreach ($this->getScopeList() as $scope) {
if ($this->metadata->get("scopes.{$scope}.{$this->type}") === 'boolean') {
$aclTable->$scope = true;
} else {
if ($this->metadata->get("scopes.{$scope}.entity")) {
$aclTable->$scope = (object) [];
foreach ($this->actionList as $action) {
$aclTable->$scope->$action = 'all';
if (in_array($action, $this->booleanActionList)) {
$aclTable->$scope->$action = 'yes';
}
}
}
}
}
$fieldTable = (object) [];
}
foreach ($aclTable as $scope => $data) {
if (is_string($data)) {
if (isset($aclTable->$data)) {
$aclTable->$scope = $aclTable->$data;
}
}
}
$this->data['table'] = $this->merge($aclTables);
$this->data->table = $aclTable;
$this->data->fieldTable = $fieldTable;
$this->data['assignmentPermission'] = $this->mergeValues($assignmentPermissionList, $this->metadata->get('app.acl.valueDefaults.assignmentPermission', 'all'));
$this->data['userPermission'] = $this->mergeValues($userPermissionList, $this->metadata->get('app.acl.valueDefaults.userPermission', 'no'));
$this->fillFieldTableQuickAccess();
if (!$this->user->isAdmin()) {
foreach ($this->valuePermissionList as $permission) {
$this->data->$permission = $this->mergeValueList($valuePermissionLists->$permission, $this->metadata->get('app.'.$this->type.'.default.' . $permission, 'yes'));
if ($this->metadata->get('app.'.$this->type.'.mandatory.' . $permission)) {
$this->data->$permission = $this->metadata->get('app.'.$this->type.'.mandatory.' . $permission);
}
}
} else {
foreach ($this->valuePermissionList as $permission) {
if (isset($this->valuePrtmissionHighestLevels[$permission])) {
$this->data->$permission = $this->valuePrtmissionHighestLevels[$permission];
continue;
}
$this->data->$permission = 'all';
}
}
}
private function initSolid()
protected function getRoleList()
{
if (!$this->metadata) {
$roleList = [];
$userRoleList = $this->getUser()->get('roles');
foreach ($userRoleList as $role) {
$roleList[] = $role;
}
$teamList = $this->getUser()->get('teams');
foreach ($teamList as $team) {
$teamRoleList = $team->get('roles');
foreach ($teamRoleList as $role) {
$roleList[] = $role;
}
}
return $roleList;
}
public function getScopeForbiddenAttributeList($scope, $action = 'read', $thresholdLevel = 'no')
{
$key = $scope . '_'. $action . '_' . $thresholdLevel;
if (isset($this->forbiddenAttributesCache[$key])) {
return $this->forbiddenAttributesCache[$key];
}
$fieldTableQuickAccess = $this->data->fieldTableQuickAccess;
if (!isset($fieldTableQuickAccess->$scope) || !isset($fieldTableQuickAccess->$scope->attributes) || !isset($fieldTableQuickAccess->$scope->attributes->$action)) {
$this->forbiddenAttributesCache[$key] = [];
return [];
}
$levelList = [];
foreach ($this->fieldLevelList as $level) {
if (array_search($level, $this->fieldLevelList) >= array_search($thresholdLevel, $this->fieldLevelList)) {
$levelList[] = $level;
}
}
$attributeList = [];
foreach ($levelList as $level) {
if (!isset($fieldTableQuickAccess->$scope->attributes->$action->$level)) continue;
foreach ($fieldTableQuickAccess->$scope->attributes->$action->$level as $attribute) {
if (in_array($attribute, $attributeList)) continue;
$attributeList[] = $attribute;
}
}
$this->forbiddenAttributesCache[$key] = $attributeList;
return $attributeList;
}
public function getScopeForbiddenFieldList($scope, $action = 'read', $thresholdLevel = 'no')
{
$key = $scope . '_'. $action . '_' . $thresholdLevel;
if (isset($this->forbiddenFieldsCache[$key])) {
return $this->forbiddenFieldsCache[$key];
}
$fieldTableQuickAccess = $this->data->fieldTableQuickAccess;
if (!isset($fieldTableQuickAccess->$scope) || !isset($fieldTableQuickAccess->$scope->fields) || !isset($fieldTableQuickAccess->$scope->fields->$action)) {
$this->forbiddenFieldsCache[$key] = [];
return [];
}
$levelList = [];
foreach ($this->fieldLevelList as $level) {
if (array_search($level, $this->fieldLevelList) >= array_search($thresholdLevel, $this->fieldLevelList)) {
$levelList[] = $level;
}
}
$fieldList = [];
foreach ($levelList as $level) {
if (!isset($fieldTableQuickAccess->$scope->fields->$action->$level)) continue;
foreach ($fieldTableQuickAccess->$scope->fields->$action->$level as $field) {
if (in_array($field, $fieldList)) continue;
$fieldList[] = $field;
}
}
$this->forbiddenFieldsCache[$key] = $fieldList;
return $fieldList;
}
protected function fillFieldTableQuickAccess()
{
$fieldTable = $this->data->fieldTable;
$fieldTableQuickAccess = (object) [];
foreach (get_object_vars($fieldTable) as $scope => $scopeData) {
$fieldTableQuickAccess->$scope = (object) [
'attributes' => (object) [],
'fields' => (object) []
];
foreach ($this->fieldActionList as $action) {
$fieldTableQuickAccess->$scope->attributes->$action = (object) [];
$fieldTableQuickAccess->$scope->fields->$action = (object) [];
foreach ($this->fieldLevelList as $level) {
$fieldTableQuickAccess->$scope->attributes->$action->$level = [];
$fieldTableQuickAccess->$scope->fields->$action->$level = [];
}
}
foreach (get_object_vars($scopeData) as $field => $fieldData) {
$attributeList = $this->getFieldManager()->getAttributeList($scope, $field);
foreach ($this->fieldActionList as $action) {
if (!isset($fieldData->$action)) continue;
foreach ($this->fieldLevelList as $level) {
if ($fieldData->$action === $level) {
$fieldTableQuickAccess->$scope->fields->$action->{$level}[] = $field;
foreach ($attributeList as $attribute) {
$fieldTableQuickAccess->$scope->attributes->$action->{$level}[] = $attribute;
}
}
}
}
}
}
$this->data->fieldTableQuickAccess = $fieldTableQuickAccess;
}
protected function applyDefault(&$table, &$fieldTable)
{
if ($this->user->isAdmin()) {
return;
}
$data = $this->metadata->get('app.acl.solid', array());
$data = $this->metadata->get('app.'.$this->type.'.default.scopeLevel', array());
foreach ($data as $entityType => $item) {
$this->data['table'][$entityType] = $item;
foreach ($data as $scope => $item) {
if (isset($table->$scope)) continue;
$value = $item;
if (is_array($item)) {
$value = (object) $item;
}
$table->$scope = $value;
}
$defaultFieldData = $this->metadata->get('app.'.$this->type.'.default.fieldLevel', array());
foreach ($this->getScopeList() as $scope) {
if (isset($table->$scope) && $table->$scope === false) continue;
if (!$this->getMetadata()->get('scopes.' . $scope . '.entity')) continue;
$fieldList = array_keys($this->getMetadata()->get("entityDefs.{$scope}.fields", []));
$defaultScopeFieldData = $this->metadata->get('app.'.$this->type.'.default.scopeFieldLevel.' . $scope, array());
foreach (array_merge($defaultFieldData, $defaultScopeFieldData) as $field => $f) {
if (!in_array($field, $fieldList)) continue;
if (!isset($fieldTable->$scope)) {
$fieldTable->$scope = (object) [];
}
if (isset($fieldTable->$scope->$field)) continue;
$fieldTable->$scope->$field = (object) [];
foreach ($this->fieldActionList as $action) {
$level = 'no';
if ($f === true) {
$level = 'yes';
} else {
if (is_array($f) && isset($f[$action])) {
$level = $f[$action];
}
}
$fieldTable->$scope->$field->$action = $level;
}
}
}
foreach ($this->getScopeWithAclList() as $scope) {
if (!isset($table->$scope)) {
$aclType = $this->metadata->get('scopes.' . $scope . '.' . $this->type);
if ($aclType === true) {
$aclType = $this->defaultAclType;
}
if (!empty($aclType)) {
$defaultValue = $this->metadata->get('app.'.$this->type.'.scopeLevelTypesDefaults.' . $aclType, $this->metadata->get('app.'.$this->type.'.scopeLevelTypesDefaults.record'));
if (is_array($defaultValue)) {
$defaultValue = (object) $defaultValue;
}
$table->$scope = $defaultValue;
}
}
}
}
private function mergeValues(array $list, $defaultValue)
protected function applyMandatory(&$table, &$fieldTable)
{
if ($this->user->isAdmin()) {
return;
}
$data = $this->metadata->get('app.'.$this->type.'.mandatory.scopeLevel', array());
foreach ($data as $scope => $item) {
$value = $item;
if (is_array($item)) {
$value = (object) $item;
}
$table->$scope = $value;
}
$mandatoryFieldData = $this->metadata->get('app.'.$this->type.'.mandatory.fieldLevel', array());
foreach ($this->getScopeList() as $scope) {
if (isset($table->$scope) && $table->$scope === false) continue;
if (!$this->getMetadata()->get('scopes.' . $scope . '.entity')) continue;
$fieldList = array_keys($this->getMetadata()->get("entityDefs.{$scope}.fields", []));
$mandatoryScopeFieldData = $this->metadata->get('app.'.$this->type.'.mandatory.scopeFieldLevel.' . $scope, array());
foreach (array_merge($mandatoryFieldData, $mandatoryScopeFieldData) as $field => $f) {
if (!in_array($field, $fieldList)) continue;
if (!isset($fieldTable->$scope)) {
$fieldTable->$scope = (object) [];
}
$fieldTable->$scope->$field = (object) [];
foreach ($this->fieldActionList as $action) {
$level = 'no';
if ($f === true) {
$level = 'yes';
} else {
if (is_array($f) && isset($f[$action])) {
$level = $f[$action];
}
}
$fieldTable->$scope->$field->$action = $level;
}
}
}
}
protected function applyDisabled(&$table, &$fieldTable)
{
if ($this->user->isAdmin()) {
return;
}
foreach ($this->getScopeList() as $scope) {
if ($this->getMetadata()->get('scopes.' . $scope . '.disabled')) {
$table->$scope = false;
unset($fieldTable->$scope);
}
}
}
private function mergeValueList(array $list, $defaultValue)
{
$result = null;
foreach ($list as $level) {
@@ -171,51 +540,74 @@ class Table
return $result;
}
private function getScopeList()
protected function getScopeWithAclList()
{
$scopeList = [];
$scopes = $this->metadata->get('scopes');
foreach ($scopes as $scope => $d) {
if (!empty($d['acl'])) {
$scopeList[] = $scope;
}
if (empty($d['acl'])) continue;
$scopeList[] = $scope;
}
return $scopeList;
}
private function merge($tables)
protected function getScopeList()
{
$data = array();
$scopeList = $this->getScopeList();
$scopeList = [];
$scopes = $this->metadata->get('scopes');
foreach ($scopes as $scope => $d) {
$scopeList[] = $scope;
}
return $scopeList;
}
foreach ($tables as $table) {
private function mergeTableList(array $tableList)
{
$data = (object) [];
$scopeList = $this->getScopeWithAclList();
foreach ($tableList as $table) {
foreach ($scopeList as $scope) {
if (!isset($table->$scope)) {
continue;
}
if (!isset($table->$scope)) continue;
$row = $table->$scope;
if ($row == false) {
if (!isset($data[$scope])) {
$data[$scope] = false;
if (!isset($data->$scope)) {
$data->$scope = false;
}
} else if ($row === true) {
$data[$scope] = true;
$data->$scope = true;
} else {
if (!isset($data[$scope])) {
$data[$scope] = array();
if (!isset($data->$scope)) {
$data->$scope = (object) [];
}
if ($data[$scope] == false) {
$data[$scope] = array();
if ($data->$scope === false) {
$data->$scope = (object) [];
}
if (is_array($row) || $row instanceof \stdClass) {
foreach ($row as $action => $level) {
if (!isset($data[$scope][$action])) {
$data[$scope][$action] = $level;
if (!is_object($row)) continue;
foreach ($this->actionList as $i => $action) {
if (isset($row->$action)) {
$level = $row->$action;
if (!isset($data->$scope->$action)) {
$data->$scope->$action = $level;
} else {
if (array_search($data[$scope][$action], $this->levelList) > array_search($level, $this->levelList)) {
$data[$scope][$action] = $level;
if (array_search($data->$scope->$action, $this->levelList) > array_search($level, $this->levelList)) {
$data->$scope->$action = $level;
}
}
} else {
if ($i > 0) {
// TODO remove it
$previousAction = $this->actionList[$i - 1];
if (in_array($action, $this->booleanActionList)) {
$data->$scope->$action = 'yes';
} else {
if (isset($data->$scope->$previousAction)) {
$data->$scope->$action = $data->$scope->$previousAction;
}
}
}
}
@@ -224,24 +616,75 @@ class Table
}
}
foreach ($scopeList as $scope) {
if (!array_key_exists($scope, $data)) {
$aclType = $this->metadata->get('scopes.' . $scope . '.acl');
if ($aclType === true) {
$aclType = 'recordAllTeamOwnNo';
return $data;
}
private function mergeFieldTableList(array $tableList)
{
$data = (object) [];
$scopeList = $this->getScopeWithAclList();
foreach ($tableList as $table) {
foreach ($scopeList as $scope) {
if (!isset($table->$scope)) continue;
if (!isset($data->$scope)) {
$data->$scope = (object) [];
}
if (!empty($aclType)) {
$data[$scope] = $this->metadata->get('app.acl.defaults.' . $aclType, true);
}
}
if (!is_object($table->$scope)) continue;
$fieldList = array_keys($this->getMetadata()->get("entityDefs.{$scope}.fields", []));
foreach (get_object_vars($table->$scope) as $field => $row) {
if (!is_object($row)) continue;
if (!in_array($field, $fieldList)) continue;
if (!isset($data->$scope->$field)) {
$data->$scope->$field = (object) [];
}
foreach ($this->fieldActionList as $i => $action) {
if (!isset($row->$action)) continue;
$level = $row->$action;
if (!isset($data->$scope->$field->$action)) {
$data->$scope->$field->$action = $level;
} else {
if (array_search($data->$scope->$field->$action, $this->fieldLevelList) > array_search($level, $this->fieldLevelList)) {
$data->$scope->$field->$action = $level;
}
}
}
}
}
}
return $data;
}
private function buildCache()
{
$contents = '<' . '?'. 'php return ' . var_export($this->data, true) . ';';
$this->fileManager->putContents($this->cacheFile, $contents);
$contents = '<' . '?'. 'php return ' . $this->varExport($this->data) . ';';
$this->fileManager->putContents($this->cacheFilePath, $contents);
}
private function varExport($variable)
{
if ($variable instanceof \StdClass) {
$result = '(object) ' . $this->varExport(get_object_vars($variable), true);
} else if (is_array($variable)) {
$array = array();
foreach ($variable as $key => $value) {
$array[] = var_export($key, true).' => ' . $this->varExport($value, true);
}
$result = '['.implode(', ', $array).']';
} else {
$result = var_export($variable, true);
}
return $result;
}
}
+85 -30
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
@@ -38,6 +45,8 @@ class AclManager
private $tableHashMap = array();
protected $tableClassName = '\\Espo\\Core\\Acl\\Table';
public function __construct(Container $container)
{
$this->container = $container;
@@ -49,6 +58,11 @@ class AclManager
return $this->container;
}
protected function getMetadata()
{
return $this->metadata;
}
public function getImplementation($scope)
{
if (empty($this->implementationHashMap[$scope])) {
@@ -68,10 +82,10 @@ class AclManager
}
if (class_exists($className)) {
$acl = new $className();
$acl = new $className($scope);
$dependencies = $acl->getDependencyList();
foreach ($dependencies as $name) {
$acl->inject($name, $this->container->get($name));
$acl->inject($name, $this->getContainer()->get($name));
}
$this->implementationHashMap[$scope] = $acl;
} else {
@@ -90,8 +104,9 @@ class AclManager
$config = $this->getContainer()->get('config');
$fileManager = $this->getContainer()->get('fileManager');
$metadata = $this->getContainer()->get('metadata');
$fieldManager = $this->getContainer()->get('fieldManager');
$this->tableHashMap[$key] = new \Espo\Core\Acl\Table($user, $config, $fileManager, $metadata);
$this->tableHashMap[$key] = new $this->tableClassName($user, $config, $fileManager, $metadata, $fieldManager);
}
return $this->tableHashMap[$key];
@@ -112,9 +127,6 @@ class AclManager
public function get(User $user, $permission)
{
if ($user->isAdmin()) {
return true;
}
return $this->getTable($user)->get($permission);
}
@@ -124,7 +136,7 @@ class AclManager
return false;
}
$data = $this->getTable($user)->getScopeData($scope);
return $this->getImplementation($scope)->checkReadOnlyTeam($user, $scope, $data);
return $this->getImplementation($scope)->checkReadOnlyTeam($user, $data);
}
public function checkReadOnlyOwn(User $user, $scope)
@@ -133,49 +145,92 @@ class AclManager
return false;
}
$data = $this->getTable($user)->getScopeData($scope);
return $this->getImplementation($scope)->checkReadOnlyOwn($user, $scope, $data);
return $this->getImplementation($scope)->checkReadOnlyOwn($user, $data);
}
public function check(User $user, $subject, $action = null, $isOwner = null, $inTeam = null)
public function check(User $user, $subject, $action = null)
{
if ($user->isAdmin()) {
return true;
}
if (is_string($subject)) {
return $this->checkScope($user, $subject, $action, $isOwner, $inTeam);
return $this->checkScope($user, $subject, $action);
} else {
$entity = $subject;
if ($entity instanceof Entity) {
$entityType = $entity->getEntityType();
$impl = $this->getImplementation($entityType);
$methodName = 'checkEntity' . ucfirst($action);
if (method_exists($impl, $methodName)) {
$data = $this->getTable($user)->getScopeData($entityType);
return $impl->$methodName($user, $entity, $data);
}
return $this->checkEntity($user, $entity, $action);
}
}
}
public function checkEntity(User $user, Entity $entity, $action)
public function checkEntity(User $user, Entity $entity, $action = 'read')
{
if ($user->isAdmin()) {
return true;
$scope = $entity->getEntityType();
$data = $this->getTable($user)->getScopeData($scope);
$impl = $this->getImplementation($scope);
$methodName = 'checkEntity' . ucfirst($action);
if (method_exists($impl, $methodName)) {
return $impl->$methodName($user, $entity, $data);
}
$data = $this->getTable($user)->getScopeData($entity->getEntityType());
return $this->getImplementation($scope)->checkEntity($user, $entity, $data, $action);
return $impl->checkEntity($user, $entity, $data, $action);
}
public function checkScope(User $user, $scope, $action = null, $isOwner = null, $inTeam = null, $entity = null)
public function checkIsOwner(User $user, Entity $entity)
{
return $this->getImplementation($entity->getEntityType())->checkIsOwner($user, $entity);
}
public function checkInTeam(User $user, Entity $entity, $action)
{
return $this->getImplementation($entity->getEntityType())->checkInTeam($user, $entity);
}
public function checkScope(User $user, $scope, $action = null)
{
$data = $this->getTable($user)->getScopeData($scope);
return $this->getImplementation($scope)->checkScope($user, $data, $action);
}
public function checkUser(User $user, $permission, User $entity)
{
if ($user->isAdmin()) {
return true;
}
$data = $this->getTable($user)->getScopeData($scope);
return $this->getImplementation($scope)->checkScope($user, $data, $scope, $action, $isOwner, $inTeam, $entity);
if ($this->get($user, $permission) === 'no') {
if ($entity->id !== $user->id) {
return false;
}
} else if ($this->get($user, $permission) === 'team') {
if ($entity->id != $user->id) {
$teamIdList1 = $user->getTeamIdList();
$teamIdList2 = $entity->getTeamIdList();
$inTeam = false;
foreach ($teamIdList1 as $id) {
if (in_array($id, $teamIdList2)) {
$inTeam = true;
break;
}
}
if (!$inTeam) {
return false;
}
}
}
return true;
}
public function getScopeForbiddenAttributeList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
{
if ($user->isAdmin()) return [];
return $this->getTable($user)->getScopeForbiddenAttributeList($scope, $action, $thresholdLevel);
}
public function getScopeForbiddenFieldList(User $user, $scope, $action = 'read', $thresholdLevel = 'no')
{
if ($user->isAdmin()) return [];
return $this->getTable($user)->getScopeForbiddenFieldList($scope, $action, $thresholdLevel);
}
}
+212
View File
@@ -0,0 +1,212 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\AclPortal;
use \Espo\Entities\User;
use \Espo\ORM\Entity;
class Base extends \Espo\Core\Acl\Base
{
public function checkScope(User $user, $data, $action = null, Entity $entity = null, $entityAccessData = array())
{
if ($user->isAdmin()) {
return true;
}
if (is_null($data)) {
return false;
}
if ($data === false) {
return false;
}
if ($data === true) {
return true;
}
if (is_string($data)) {
return true;
}
$isOwner = null;
if (isset($entityAccessData['isOwner'])) {
$isOwner = $entityAccessData['isOwner'];
}
$inAccount = null;
if (isset($entityAccessData['inAccount'])) {
$inAccount = $entityAccessData['inAccount'];
}
$isOwnContact = null;
if (isset($entityAccessData['isOwnContact'])) {
$isOwnContact = $entityAccessData['isOwnContact'];
}
if (is_null($action)) {
return true;
}
if (!isset($data->$action)) {
return true;
}
$value = $data->$action;
if ($value === 'all' || $value === 'yes' || $value === true) {
return true;
}
if (!$value || $value === 'no') {
return false;
}
if (is_null($isOwner)) {
if ($entity) {
$isOwner = $this->checkIsOwner($user, $entity);
} else {
return true;
}
}
if ($isOwner) {
if ($value === 'own' || $value === 'account' || $value === 'contact') {
return true;
}
}
if ($value === 'account') {
if (is_null($inAccount) && $entity) {
$inAccount = $this->checkInAccount($user, $entity);
}
if ($inAccount) {
return true;
}
}
if ($value === 'contact') {
if (is_null($isOwnContact) && $entity) {
$isOwnContact = $this->checkIsOwnContact($user, $entity);
}
if ($isOwnContact) {
return true;
}
}
return false;
}
public function checkReadOnlyAccount(User $user, $data)
{
if (empty($data) || !is_object($data) || !isset($data->read)) {
return false;
}
return $data->read === 'account';
}
public function checkReadOnlyContact(User $user, $data)
{
if (empty($data) || !is_object($data) || !isset($data->read)) {
return false;
}
return $data->read === 'contact';
}
public function checkIsOwner(User $user, Entity $entity)
{
if ($entity->hasAttribute('createdById')) {
if ($entity->has('createdById')) {
if ($user->id === $entity->get('createdById')) {
return true;
}
}
}
return false;
}
public function checkInAccount(User $user, Entity $entity)
{
$accountIdList = $user->getLinkMultipleIdList('accounts');
if (count($accountIdList)) {
if ($entity->hasAttribute('accountId')) {
if (in_array($entity->get('accountId'), $accountIdList)) {
return true;
}
}
if ($entity->hasRelation('accounts')) {
$repository = $this->getEntityManager()->getRepository($entity->getEntityType());
foreach ($accountIdList as $accountId) {
if ($repository->isRelated($entity, 'accounts', $accountId)) {
return true;
}
}
}
if ($entity->hasAttribute('parentId') && $entity->hasRelation('parent')) {
if ($entity->get('parentType') === 'Account') {
if (in_array($entity->get('parentId'), $accountIdList)) {
return true;
}
}
}
}
return false;
}
public function checkIsOwnContact(User $user, Entity $entity)
{
$contactId = $user->get('contactId');
if ($contactId) {
if ($entity->hasAttribute('contactId')) {
if ($entity->get('contactId') === $contactId) {
return true;
}
}
if ($entity->hasRelation('contacts')) {
$repository = $this->getEntityManager()->getRepository($entity->getEntityType());
if ($repository->isRelated($entity, 'contacts', $contactId)) {
return true;
}
}
if ($entity->hasAttribute('parentId') && $entity->hasRelation('parent')) {
if ($entity->get('parentType') === 'Contact') {
if ($entity->get('parentId') === $contactId) {
return true;
}
}
}
}
return false;
}
}
+125
View File
@@ -0,0 +1,125 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\AclPortal;
use \Espo\Core\Exceptions\Error;
use \Espo\ORM\Entity;
use \Espo\Entities\User;
use \Espo\Entities\Portal;
use \Espo\Core\Utils\Config;
use \Espo\Core\Utils\Metadata;
use \Espo\Core\Utils\FieldManager;
use \Espo\Core\Utils\File\Manager as FileManager;
class Table extends \Espo\Core\Acl\Table
{
protected $type = 'aclPortal';
protected $portal;
protected $defaultAclType = 'recordAllOwnNo';
protected $levelList = ['yes', 'all', 'account', 'contact', 'own', 'no'];
protected $valuePermissionList = [];
public function __construct(User $user, Portal $portal, Config $config = null, FileManager $fileManager = null, Metadata $metadata = null, FieldManager $fieldManager = null)
{
if (empty($portal)) {
throw new Error("No portal was passed to AclPortal\\Table constructor.");
}
$this->portal = $portal;
parent::__construct($user, $config, $fileManager, $metadata, $fieldManager);
}
protected function getPortal()
{
return $this->portal;
}
protected function initCacheFilePath()
{
$this->cacheFilePath = 'data/cache/application/acl-portal/'.$this->getPortal()->id.'/' . $this->getUser()->id . '.php';
}
protected function getRoleList()
{
$roleList = [];
$userRoleList = $this->getUser()->get('portalRoles');
foreach ($userRoleList as $role) {
$roleList[] = $role;
}
$portalRoleList = $this->getPortal()->get('portalRoles');
foreach ($portalRoleList as $role) {
$roleList[] = $role;
}
return $roleList;
}
protected function getScopeWithAclList()
{
$scopeList = [];
$scopes = $this->getMetadata()->get('scopes');
foreach ($scopes as $scope => $d) {
if (empty($d['acl'])) continue;
if (empty($d['aclPortal'])) continue;
$scopeList[] = $scope;
}
return $scopeList;
}
protected function applyDefault(&$table, &$fieldTable)
{
parent::applyDefault($table, $fieldTable);
foreach ($this->getScopeList() as $scope) {
if (!isset($table->$scope)) {
$table->$scope = false;
}
}
}
protected function applyDisabled(&$table, &$fieldTable)
{
foreach ($this->getScopeList() as $scope) {
$d = $this->getMetadata()->get('scopes.' . $scope);
if ($d['disabled'] || $d['portalDisabled']) {
$table->$scope = false;
unset($fieldTable->$scope);
}
}
}
}
+78 -35
View File
@@ -18,35 +18,43 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
class Application
{
private $metadata;
private $container;
protected $container;
private $slim;
private $auth;
/**
* Constructor
*/
public function __construct()
{
$this->container = new Container();
date_default_timezone_set('UTC');
$GLOBALS['log'] = $this->container->get('log');
$this->initContainer();
$GLOBALS['log'] = $this->getContainer()->get('log');
$this->initAutoloads();
}
protected function initContainer()
{
$this->container = new Container();
}
public function getSlim()
{
if (empty($this->slim)) {
@@ -63,12 +71,9 @@ class Application
return $this->metadata;
}
protected function getAuth()
protected function createAuth()
{
if (empty($this->auth)) {
$this->auth = new \Espo\Core\Utils\Auth($this->container);
}
return $this->auth;
return new \Espo\Core\Utils\Auth($this->container);
}
public function getContainer()
@@ -85,17 +90,10 @@ class Application
public function runClient()
{
$config = $this->getContainer()->get('config');
$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('{{runScript}}', 'app.start();' , $html);
echo $html;
exit;
$this->getContainer()->get('clientManager')->display();
}
public function runEntryPoint($entryPoint)
public function runEntryPoint($entryPoint, $data = array(), $final = false)
{
if (empty($entryPoint)) {
throw new \Error();
@@ -104,18 +102,27 @@ class Application
$slim = $this->getSlim();
$container = $this->getContainer();
$slim->get('/', function() {});
$slim->post('/', function() {});
$slim->any('.*', function() {});
$entryPointManager = new \Espo\Core\EntryPointManager($container);
try {
$auth = $this->getAuth();
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $entryPointManager->checkAuthRequired($entryPoint), true);
$authRequired = $entryPointManager->checkAuthRequired($entryPoint);
$authNotStrict = $entryPointManager->checkNotStrictAuth($entryPoint);
if ($authRequired && !$authNotStrict) {
if (!$final && $portalId = $this->detectedPortalId()) {
$app = new \Espo\Core\Portal\Application($portalId);
$app->setBasePath($this->getBasePath());
$app->runEntryPoint($entryPoint, $data, true);
exit;
}
}
$auth = new \Espo\Core\Utils\Auth($this->container, $authNotStrict);
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth, $authRequired, true);
$slim->add($apiAuth);
$slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container) {
$entryPointManager->run($entryPoint);
$slim->hook('slim.before.dispatch', function () use ($entryPoint, $entryPointManager, $container, $data) {
$entryPointManager->run($entryPoint, $data);
});
$slim->run();
@@ -126,7 +133,7 @@ class Application
public function runCron()
{
$auth = $this->getAuth();
$auth = $this->createAuth();
$auth->useNoAuth(true);
$cronManager = new \Espo\Core\CronManager($this->container);
@@ -156,20 +163,25 @@ class Application
return false;
}
protected function createApiAuth($auth)
{
return new \Espo\Core\Utils\Api\Auth($auth);
}
protected function routeHooks()
{
$container = $this->getContainer();
$slim = $this->getSlim();
try {
$auth = $this->getAuth();
$auth = $this->createAuth();
} catch (\Exception $e) {
$container->get('output')->processError($e->getMessage(), $e->getCode());
}
$apiAuth = new \Espo\Core\Utils\Api\Auth($auth);
$this->getSlim()->add($apiAuth);
$apiAuth = $this->createApiAuth($auth);
$this->getSlim()->add($apiAuth);
$this->getSlim()->hook('slim.before.dispatch', function () use ($slim, $container) {
$route = $slim->router()->getCurrentRoute();
@@ -229,13 +241,19 @@ class Application
});
}
protected function initRoutes()
protected function getRouteList()
{
$routes = new \Espo\Core\Utils\Route($this->getContainer()->get('config'), $this->getMetadata(), $this->getContainer()->get('fileManager'));
$crudList = array_keys( $this->getContainer()->get('config')->get('crud') );
foreach ($routes->getAll() as $route) {
return $routes->getAll();
}
protected function initRoutes()
{
$crudList = array_keys($this->getContainer()->get('config')->get('crud'));
foreach ($this->getRouteList() as $route) {
$method = strtolower($route['method']);
if (!in_array($method, $crudList)) {
$GLOBALS['log']->error('Route: Method ['.$method.'] does not exist. Please check your route ['.$route['route'].']');
@@ -280,5 +298,30 @@ class Application
$classLoader->register(true);
}
public function setBasePath($basePath)
{
$this->getContainer()->get('clientManager')->setBasePath($basePath);
}
public function getBasePath()
{
return $this->getContainer()->get('clientManager')->getBasePath();
}
public function detectedPortalId()
{
if (!empty($_GET['portalId'])) {
return $_GET['portalId'];
}
if (!empty($_COOKIE['auth-token'])) {
$token = $this->getContainer()->get('entityManager')->getRepository('AuthToken')->where(array('token'=>$_COOKIE['auth-token']))->findOne();
if ($token && $token->get('portalId')) {
return $token->get('portalId');
}
}
return null;
}
}
+69 -34
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
@@ -33,7 +40,6 @@ class Container
*/
public function __construct()
{
}
public function get($name)
@@ -41,7 +47,15 @@ class Container
if (empty($this->data[$name])) {
$this->load($name);
}
return $this->data[$name];
if (isset($this->data[$name])) {
return $this->data[$name];
}
return null;
}
protected function set($name, $obj)
{
$this->data[$name] = $obj;
}
private function load($name)
@@ -81,16 +95,19 @@ class Container
protected function loadLog()
{
$logConfig = $this->get('config')->get('logger');
$config = $this->get('config');
$path = $config->get('logger.path', 'data/logs/espo.log');
$rotation = $config->get('logger.rotation', true);
$log = new \Espo\Core\Utils\Log('Espo');
$levelCode = $log->getLevelCode($config->get('logger.level', 'WARNING'));
$levelCode = $log->getLevelCode($logConfig['level']);
if ($logConfig['isRotate']) {
$handler = new \Espo\Core\Utils\Log\Monolog\Handler\RotatingFileHandler($logConfig['path'], $logConfig['maxRotateFiles'], $levelCode);
if ($rotation) {
$maxFileNumber = $config->get('logger.maxFileNumber', 30);
$handler = new \Espo\Core\Utils\Log\Monolog\Handler\RotatingFileHandler($path, $maxFileNumber, $levelCode);
} else {
$handler = new \Espo\Core\Utils\Log\Monolog\Handler\StreamHandler($logConfig['path'], $levelCode);
$handler = new \Espo\Core\Utils\Log\Monolog\Handler\StreamHandler($path, $levelCode);
}
$log->pushHandler($handler);
@@ -106,53 +123,54 @@ class Container
return $this;
}
private function loadSlim()
protected function loadSlim()
{
return new \Espo\Core\Utils\Api\Slim();
}
private function loadFileManager()
protected function loadFileManager()
{
return new \Espo\Core\Utils\File\Manager(
$this->get('config')
);
}
private function loadPreferences()
protected function loadPreferences()
{
return $this->get('entityManager')->getEntity('Preferences', $this->get('user')->id);
}
private function loadConfig()
protected function loadConfig()
{
return new \Espo\Core\Utils\Config(
new \Espo\Core\Utils\File\Manager()
);
}
private function loadHookManager()
protected function loadHookManager()
{
return new \Espo\Core\HookManager(
$this
);
}
private function loadOutput()
protected function loadOutput()
{
return new \Espo\Core\Utils\Api\Output(
$this->get('slim')
);
}
private function loadMailSender()
protected function loadMailSender()
{
$className = $this->getServiceClassName('mailSernder', '\\Espo\\Core\\Mail\\Sender');
return new $className(
$this->get('config')
$this->get('config'),
$this->get('entityManager')
);
}
private function loadDateTime()
protected function loadDateTime()
{
return new \Espo\Core\Utils\DateTime(
$this->get('config')->get('dateFormat'),
@@ -161,7 +179,7 @@ class Container
);
}
private function loadNumber()
protected function loadNumber()
{
return new \Espo\Core\Utils\Number(
$this->get('config')->get('decimalMark'),
@@ -169,14 +187,14 @@ class Container
);
}
private function loadServiceFactory()
protected function loadServiceFactory()
{
return new \Espo\Core\ServiceFactory(
$this
);
}
private function loadSelectManagerFactory()
protected function loadSelectManagerFactory()
{
return new \Espo\Core\SelectManagerFactory(
$this->get('entityManager'),
@@ -186,7 +204,7 @@ class Container
);
}
private function loadMetadata()
protected function loadMetadata()
{
return new \Espo\Core\Utils\Metadata(
$this->get('config'),
@@ -194,15 +212,16 @@ class Container
);
}
private function loadLayout()
protected function loadLayout()
{
return new \Espo\Core\Utils\Layout(
$this->get('fileManager'),
$this->get('metadata')
$this->get('metadata'),
$this->get('user')
);
}
private function loadAclManager()
protected function loadAclManager()
{
$className = $this->getServiceClassName('acl', '\\Espo\\Core\\AclManager');
return new $className(
@@ -210,7 +229,7 @@ class Container
);
}
private function loadAcl()
protected function loadAcl()
{
$className = $this->getServiceClassName('acl', '\\Espo\\Core\\Acl');
return new $className(
@@ -219,7 +238,7 @@ class Container
);
}
private function loadSchema()
protected function loadSchema()
{
return new \Espo\Core\Utils\Database\Schema\Schema(
$this->get('config'),
@@ -230,7 +249,7 @@ class Container
);
}
private function loadClassParser()
protected function loadClassParser()
{
return new \Espo\Core\Utils\File\ClassParser(
$this->get('fileManager'),
@@ -239,7 +258,7 @@ class Container
);
}
private function loadLanguage()
protected function loadLanguage()
{
return new \Espo\Core\Utils\Language(
$this->get('fileManager'),
@@ -249,28 +268,28 @@ class Container
);
}
private function loadCrypt()
protected function loadCrypt()
{
return new \Espo\Core\Utils\Crypt(
$this->get('config')
);
}
private function loadScheduledJob()
protected function loadScheduledJob()
{
return new \Espo\Core\Utils\ScheduledJob(
$this
);
}
private function loadDataManager()
protected function loadDataManager()
{
return new \Espo\Core\DataManager(
$this
);
}
private function loadFieldManager()
protected function loadFieldManager()
{
return new \Espo\Core\Utils\FieldManager(
$this->get('metadata'),
@@ -278,9 +297,25 @@ class Container
);
}
public function setUser($user)
protected function loadThemeManager()
{
$this->data['user'] = $user;
return new \Espo\Core\Utils\ThemeManager(
$this->get('config'),
$this->get('metadata')
);
}
protected function loadClientManager()
{
return new \Espo\Core\Utils\ClientManager(
$this->get('config'),
$this->get('themeManager')
);
}
public function setUser(\Espo\Entities\User $user)
{
$this->set('user', $user);
}
}
+24 -8
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
@@ -87,23 +94,32 @@ 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 '$controllerName'");
}
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);
}
if (is_array($result) || is_bool($result)) {
if (is_array($result) || is_bool($result) || $result instanceof \StdClass) {
return \Espo\Core\Utils\Json::encode($result);
}
+7 -1
View File
@@ -18,10 +18,16 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Controllers;
use \Espo\Core\Container;
use \Espo\Core\ServiceFactory;
use \Espo\Core\Utils\Util;
+40 -12
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Controllers;
@@ -80,7 +87,7 @@ class Record extends Base
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'edit')) {
if (!$this->getAcl()->check($this->name, 'create')) {
throw new Forbidden();
}
@@ -124,22 +131,34 @@ class Record extends Base
$asc = $request->get('asc') === 'true';
$sortBy = $request->get('sortBy');
$q = $request->get('q');
$primaryFilter = $request->get('primaryFilter');
$textFilter = $request->get('textFilter');
$boolFilterList = $request->get('boolFilterList');
if (empty($maxSize)) {
$maxSize = self::MAX_SIZE_LIMIT;
}
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(
$params = array(
'where' => $where,
'offset' => $offset,
'maxSize' => $maxSize,
'asc' => $asc,
'sortBy' => $sortBy,
'q' => $q,
));
'textFilter' => $textFilter
);
if ($request->get('primaryFilter')) {
$params['primaryFilter'] = $request->get('primaryFilter');
}
if ($request->get('boolFilterList')) {
$params['boolFilterList'] = $request->get('boolFilterList');
}
$result = $this->getRecordService()->findEntities($params);
return array(
'total' => $result['total'],
@@ -158,6 +177,7 @@ class Record extends Base
$asc = $request->get('asc') === 'true';
$sortBy = $request->get('sortBy');
$q = $request->get('q');
$textFilter = $request->get('textFilter');
if (empty($maxSize)) {
$maxSize = self::MAX_SIZE_LIMIT;
@@ -166,15 +186,23 @@ class Record extends Base
throw new Forbidden();
}
$result = $this->getRecordService()->findLinkedEntities($id, $link, array(
$params = array(
'where' => $where,
'offset' => $offset,
'maxSize' => $maxSize,
'asc' => $asc,
'sortBy' => $sortBy,
'q' => $q,
));
'textFilter' => $textFilter
);
if ($request->get('primaryFilter')) {
$params['primaryFilter'] = $request->get('primaryFilter');
}
if ($request->get('boolFilterList')) {
$params['boolFilterList'] = $request->get('boolFilterList');
}
$result = $this->getRecordService()->findLinkedEntities($id, $link, $params);
return array(
'total' => $result['total'],
@@ -198,7 +226,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();
}
@@ -293,18 +321,18 @@ class Record extends Base
$where = json_decode(json_encode($data['where']), true);
return $this->getRecordService()->linkEntityMass($id, $link, $where);
} else {
$foreignIds = array();
$foreignIdList = array();
if (isset($data['id'])) {
$foreignIds[] = $data['id'];
$foreignIdList[] = $data['id'];
}
if (isset($data['ids']) && is_array($data['ids'])) {
foreach ($data['ids'] as $foreignId) {
$foreignIds[] = $foreignId;
$foreignIdList[] = $foreignId;
}
}
$result = false;
foreach ($foreignIds as $foreignId) {
foreach ($foreignIdList as $foreignId) {
if ($this->getRecordService()->linkEntity($id, $link, $foreignId)) {
$result = true;
}
@@ -358,7 +386,7 @@ class Record extends Base
if (!$request->isPut()) {
throw new BadRequest();
}
if (!$this->getAcl()->check($this->name, 'read')) {
if (!$this->getAcl()->check($this->name, 'stream')) {
throw new Forbidden();
}
$id = $params['id'];
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Controllers;
@@ -30,7 +37,6 @@ use \Espo\Core\Utils\Util;
class RecordTree extends Record
{
public static $defaultAction = 'list';
protected $defaultRecordServiceName = 'RecordTree';
@@ -44,9 +50,11 @@ class RecordTree extends Record
$where = $request->get('where');
$parentId = $request->get('parentId');
$maxDepth = $request->get('maxDepth');
$onlyNotEmpty = $request->get('onlyNotEmpty');
$collection = $this->getRecordService()->getTree($parentId, array(
'where' => $where
'where' => $where,
'onlyNotEmpty' => $onlyNotEmpty
), 0, $maxDepth);
return array(
'list' => $collection->toArray(),
+7 -1
View File
@@ -18,10 +18,16 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
use \PDO;
use Espo\Core\Utils\Json;
use Espo\Core\Exceptions\NotFound;
+7 -1
View File
@@ -18,10 +18,16 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
class DataManager
{
private $container;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Entities;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Entities;
+18 -3
View File
@@ -18,10 +18,16 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
use \Espo\Core\Exceptions\NotFound,
\Espo\Core\Utils\Util;
@@ -75,7 +81,16 @@ class EntryPointManager
return $className::$authRequired;
}
public function run($name)
public function checkNotStrictAuth($name)
{
$className = $this->getClassName($name);
if (!$className) {
throw new NotFound();
}
return $className::$notStrictAuth;
}
public function run($name, $data = array())
{
$className = $this->getClassName($name);
if (!$className) {
@@ -83,7 +98,7 @@ class EntryPointManager
}
$entryPoint = new $className($this->container);
$entryPoint->run();
$entryPoint->run($data);
}
protected function getClassName($name)
+19 -2
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\EntryPoints;
@@ -32,6 +39,8 @@ abstract class Base
public static $authRequired = true;
public static $notStrictAuth = false;
protected function getContainer()
{
return $this->container;
@@ -82,12 +91,20 @@ abstract class Base
return $this->getContainer()->get('fileManager');
}
protected function getLanguage()
{
return $this->getContainer()->get('language');
}
protected function getClientManager()
{
return $this->getContainer()->get('clientManager');
}
public function __construct(Container $container)
{
$this->container = $container;
}
abstract public function run();
}
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Exceptions;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\ExternalAccount;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\ExternalAccount\Clients;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\ExternalAccount\Clients;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\ExternalAccount\Clients;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\ExternalAccount\OAuth2;
+11 -2
View File
@@ -18,10 +18,16 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core;
use \Espo\Core\Exceptions\Error,
\Espo\Core\Utils\Util;
@@ -104,6 +110,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 +131,7 @@ class HookManager
}
return $hook;
}
throw new Error("Class '$className' does not exist");
$GLOBALS['log']->error("Hook class '{$name}' does not exist.");
}
/**
+7
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Hooks;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Htmlizer;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Interfaces;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Interfaces;
+7
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Jobs;
+7
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Loaders;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Loaders;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Loaders;
@@ -0,0 +1,101 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Mail;
use \Espo\Entities\Email;
class FiltersMatcher
{
public function __construct()
{
}
public function match(Email $email, $filterList = [])
{
foreach ($filterList as $filter) {
if ($filter->get('from')) {
if ($this->matchString(strtolower($filter->get('from')), strtolower($email->get('from')))) {
return true;
}
}
if ($filter->get('to')) {
if ($email->get('to')) {
$toArr = explode(';', $email->get('to'));
foreach ($toArr as $to) {
if ($this->matchString(strtolower($filter->get('to')), strtolower($to))) {
return true;
}
}
}
}
if ($filter->get('subject')) {
if ($this->matchString($filter->get('subject'), $email->get('name'))) {
return true;
}
}
}
return false;
}
public function matchBody(Email $email, $filterList = [])
{
foreach ($filterList as $filter) {
if ($filter->get('bodyContains')) {
$phraseList = $filter->get('bodyContains');
$body = $email->get('body');
$bodyPlain = $email->get('bodyPlain');
foreach ($phraseList as $phrase) {
if (stripos($bodyPlain, $phrase) !== false) {
return true;
}
if (stripos($body, $phrase) !== false) {
return true;
}
}
}
}
return false;
}
protected function matchString($pattern, $value)
{
if ($pattern == $value) {
return true;
}
$pattern = preg_quote($pattern, '#');
$pattern = str_replace('\*', '.*', $pattern).'\z';
if (preg_match('#^'.$pattern.'#', $value)) {
return true;
}
return false;
}
}
+171 -49
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Mail;
@@ -25,6 +32,7 @@ namespace Espo\Core\Mail;
use \Zend\Mime\Mime as Mime;
use \Espo\ORM\Entity;
use \Espo\ORM\Email;
class Importer
{
@@ -34,11 +42,14 @@ class Importer
private $config;
private $filtersMatcher;
public function __construct($entityManager, $fileManager, $config)
{
$this->entityManager = $entityManager;
$this->fileManager = $fileManager;
$this->config = $config;
$this->filtersMatcher = new FiltersMatcher();
}
protected function getEntityManager()
@@ -55,7 +66,12 @@ class Importer
return $this->fileManager;
}
public function importMessage($message, $userId, $teamsIds = array())
protected function getFiltersMatcher()
{
return $this->filtersMatcher;
}
public function importMessage($message, $assignedUserId = null, $teamsIdList = [], $userIdList = [], $filterList = [])
{
try {
$email = $this->getEntityManager()->getEntity('Email');
@@ -68,9 +84,16 @@ class Importer
$email->set('isHtml', false);
$email->set('name', $subject);
$email->set('status', 'Archived');
$email->set('attachmentsIds', array());
$email->set('assignedUserId', $userId);
$email->set('teamsIds', $teamsIds);
$email->set('attachmentsIds', []);
if ($assignedUserId) {
$email->set('assignedUserId', $assignedUserId);
$email->set('assignedUsersIds', [$assignedUserId]);
}
$email->set('teamsIds', $teamsIdList);
if (!empty($userIdList)) {
$email->set('usersIds', $userIdList);
}
$fromArr = $this->getAddressListFromMessage($message, 'from');
if (isset($message->from)) {
@@ -82,31 +105,46 @@ class Importer
$toArr = $this->getAddressListFromMessage($message, 'to');
$ccArr = $this->getAddressListFromMessage($message, 'cc');
$replyToArr = $this->getAddressListFromMessage($message, 'replyTo');
$email->set('from', $fromArr[0]);
$email->set('to', implode(';', $toArr));
$email->set('cc', implode(';', $ccArr));
$email->set('replyTo', implode(';', $replyToArr));
if ($this->getFiltersMatcher()->match($email, $filterList)) {
return false;
}
if (isset($message->messageId) && !empty($message->messageId)) {
$email->set('messageId', $message->messageId);
if (isset($message->deliveredTo)) {
$email->set('messageIdInternal', $message->messageId . '-' . $message->deliveredTo);
}
if (stripos($message->messageId, '@espo-system') !== false) {
return;
}
}
if ($duplicate = $this->findDuplicate($email)) {
$duplicate->loadLinkMultipleField('users');
$usersIds = $duplicate->get('usersIds');
$usersIds[] = $userId;
$duplicate->set('usersIds', $usersIds);
if ($assignedUserId) {
$duplicate->addLinkMultipleId('users', $assignedUserId);
$duplicate->addLinkMultipleId('assignedUsers', $assignedUserId);
}
if (!empty($userIdList)) {
foreach ($userIdList as $uId) {
$duplicate->addLinkMultipleId('users', $uId);
}
}
$this->getEntityManager()->saveEntity($duplicate);
if (!empty($teamsIds)) {
foreach ($teamsIds as $teamId) {
if (!empty($teamsIdList)) {
foreach ($teamsIdList as $teamId) {
$this->getEntityManager()->getRepository('Email')->relate($duplicate, 'teams', $teamId);
}
}
return false;
return $duplicate;
}
if (isset($message->date)) {
@@ -136,6 +174,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) {
@@ -144,15 +186,54 @@ class Importer
$email->set('body', $body);
}
if ($this->getFiltersMatcher()->matchBody($email, $filterList)) {
return false;
}
$parentFound = false;
if (isset($message->inReplyTo) && !empty($message->inReplyTo)) {
$arr = explode(' ', $message->inReplyTo);
$inReplyTo = $arr[0];
$replied = $this->getEntityManager()->getRepository('Email')->where(array(
'messageId' => $inReplyTo
))->findOne();
if ($replied) {
$email->set('repliedId', $replied->id);
}
}
if (isset($message->references) && !empty($message->references)) {
$reference = str_replace(array('/', '@'), " ", trim($message->references, '<>'));
$arr = explode(' ', $message->references);
$reference = $arr[0];
$reference = str_replace(array('/', '@'), " ", trim($reference, '<>'));
$parentType = $parentId = null;
$emailSent = PHP_INT_MAX;
$n = sscanf($reference, '%s %s %d %d espo', $parentType, $parentId, $emailSent, $number);
if ($n == 4 && $emailSent < time()) {
if (!empty($parentType) && !empty($parentId)) {
if ($parentType == 'Lead') {
$parent = $this->getEntityManager()->getEntity('Lead', $parentId);
if ($parent && $parent->get('status') == 'Converted') {
if ($parent->get('createdAccountId')) {
$account = $this->getEntityManager()->getEntity('Account', $parent->get('createdAccountId'));
if ($account) {
$parentType = 'Account';
$parentId = $account->id;
}
} else {
if ($this->getConfig()->get('b2cMode')) {
if ($parent->get('createdContactId')) {
$contact = $this->getEntityManager()->getEntity('Contact', $parent->get('createdContactId'));
if ($contact) {
$parentType = 'Contact';
$parentId = $contact->id;
}
}
}
}
}
}
$email->set('parentType', $parentType);
$email->set('parentId', $parentId);
$parentFound = true;
@@ -165,10 +246,15 @@ class Importer
if ($from) {
$parentFound = $this->findParent($email, $from);
}
if (!$parentFound) {
if (!empty($toArr)) {
$parentFound = $this->findParent($email, $toArr[0]);
}
}
if (!$parentFound) {
if (!empty($replyToArr)) {
$parentFound = $this->findParent($email, $replyToArr[0]);
}
}
if (!$parentFound) {
if (!empty($toArr)) {
$parentFound = $this->findParent($email, $toArr[0]);
}
}
@@ -229,12 +315,20 @@ class Importer
}
}
protected function normilizeHeader($header)
{
if (is_a($header, 'ArrayIterator')) {
return $header->current();
} else {
return $header;
}
}
protected function getAddressListFromMessage($message, $type)
{
$addressList = array();
if (isset($message->$type)) {
$list = $message->getHeader($type)->getAddressList();
$list = $this->normilizeHeader($message->getHeader($type))->getAddressList();
foreach ($list as $address) {
$addressList[] = $address->getEmail();
}
@@ -251,6 +345,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 +363,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 !== '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,22 +394,23 @@ class Importer
$fileName = null;
$contentId = null;
if (isset($part->ContentDisposition)) {
if (strpos($part->ContentDisposition, 'attachment') === 0) {
if (preg_match('/filename="?([^"]+)"?/i', $part->ContentDisposition, $m)) {
$fileName = $m[1];
if ($contentDisposition) {
if ($contentDisposition === 'attachment') {
$fileName = $this->fetchFileNameFromContentDisposition($part->ContentDisposition);
if ($fileName) {
$disposition = 'attachment';
}
} else if (strpos($part->ContentDisposition, 'inline') === 0) {
} else if ($contentDisposition === 'inline') {
if (isset($part->contentID)) {
$contentId = trim($part->contentID, '<>');
$fileName = $contentId;
$disposition = 'inline';
} else {
// hack for iOS not proper attachments
// for iOS attachments
if (empty($fileName)) {
if (preg_match('/filename="?([^"]+)"?/i', $part->ContentDisposition, $m)) {
$fileName = $m[1];
$fileName = $this->fetchFileNameFromContentDisposition($part->ContentDisposition);
if ($fileName) {
$disposition = 'attachment';
}
}
@@ -317,7 +419,7 @@ class Importer
}
if (isset($part->contentTransferEncoding)) {
$encoding = strtolower($part->getHeader('Content-Transfer-Encoding')->getTransferEncoding());
$encoding = strtolower($this->normilizeHeader($part->getHeader('Content-Transfer-Encoding'))->getTransferEncoding());
}
$attachment = $this->getEntityManager()->getEntity('Attachment');
@@ -338,7 +440,7 @@ class Importer
$this->getEntityManager()->saveEntity($attachment);
$path = 'data/upload/' . $attachment->id;
$path = $this->getEntityManager()->getRepository('Attachment')->getFilePath($attachment);
$this->getFileManager()->putContents($path, $content);
if ($disposition == 'attachment') {
@@ -352,6 +454,26 @@ class Importer
} catch (\Exception $e) {}
}
protected function fetchFileNameFromContentDisposition($contentDisposition)
{
$m = array();
if (preg_match('/filename="?([^"]+)"?/i', $contentDisposition, $m)) {
$fileName = $m[1];
return $fileName;
} else if (preg_match('/filename\*="?([^"]+)"?/i', $contentDisposition, $m)) {
$fileName = $m[1];
if ($fileName && stripos($fileName, "''") !== false) {
list($encoding, $fileName) = explode("''", $fileName);
$fileName = rawurldecode($fileName);
if (strtoupper($encoding) !== 'UTF-8') {
$fileName = mb_convert_encoding($fileName, 'UTF-8', $encoding);
}
return $fileName;
}
}
return false;
}
protected function getContentFromPart($part)
{
if ($part instanceof \Zend\Mime\Part) {
@@ -365,7 +487,7 @@ class Importer
$encoding = null;
if (isset($part->contentTransferEncoding)) {
$cteHeader = $part->getHeader('Content-Transfer-Encoding');
$cteHeader = $this->normilizeHeader($part->getHeader('Content-Transfer-Encoding'));
$encoding = strtolower($cteHeader->getTransferEncoding());
}
@@ -376,7 +498,7 @@ class Importer
$charset = 'UTF-8';
if (isset($part->contentType)) {
$ctHeader = $part->getHeader('Content-Type');
$ctHeader = $this->normilizeHeader($part->getHeader('Content-Type'));
$charsetParamValue = $ctHeader->getParameter('charset');
if (!empty($charsetParamValue)) {
$charset = strtoupper($charsetParamValue);
@@ -384,7 +506,7 @@ class Importer
}
if (isset($part->contentTransferEncoding)) {
$cteHeader = $part->getHeader('Content-Transfer-Encoding');
$cteHeader = $this->normilizeHeader($part->getHeader('Content-Transfer-Encoding'));
if ($cteHeader->getTransferEncoding() == 'quoted-printable') {
$content = quoted_printable_decode($content);
}
@@ -0,0 +1,102 @@
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Espo\Core\Mail\Mail\Header;
use \Zend\Mail\Header;
use Zend\Mime\Mime;
class XQueueItemId implements Header\HeaderInterface
{
protected $fieldName = 'X-QueueItemId';
protected $id = null;
public static function fromString($headerLine)
{
list($name, $value) = Header\GenericHeader::splitHeaderLine($headerLine);
$value = Header\HeaderWrap::mimeDecodeValue($value);
if (strtolower($name) !== 'x-queue-item-id') {
throw new Header\Exception\InvalidArgumentException('Invalid header line for Message-ID string');
}
$header = new static();
$header->setId($value);
return $header;
}
public function getFieldName()
{
return $this->fieldName;
}
public function setFieldName($value)
{
}
public function setEncoding($encoding)
{
return $this;
}
public function setId($id)
{
$this->id = $id;
}
public function getEncoding()
{
return 'ASCII';
}
public function toString()
{
return $this->fieldName . ': ' . $this->getFieldValue();
}
public function getFieldValue($format = Header\HeaderInterface::FORMAT_RAW)
{
return $this->id;
}
}
+35 -1
View File
@@ -1,4 +1,38 @@
<?php
<?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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Mail\Mail;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Mail\Mail\Storage;
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Mail\Mail\Storage;
+44 -5
View File
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Mail;
@@ -38,18 +45,31 @@ class Sender
{
protected $config;
protected $entityManager;
protected $transport;
protected $isGlobal = false;
protected $params = array();
public function __construct($config)
public function __construct($config, $entityManager)
{
$this->config = $config;
$this->entityManager = $entityManager;
$this->useGlobal();
}
protected function getConfig()
{
return $this->config;
}
protected function getEntityManager()
{
return $this->entityManager;
}
public function resetParams()
{
$this->params = array();
@@ -131,9 +151,11 @@ class Sender
return $this;
}
public function send(Email $email, $params = array(), &$message = null)
public function send(Email $email, $params = array(), &$message = null, $attachmetList = [])
{
$message = new Message();
if (!$message) {
$message = new Message();
}
$config = $this->config;
$params = $this->params + $params;
@@ -206,13 +228,27 @@ class Sender
}
}
$value = $email->get('replyTo');
if ($value) {
$arr = explode(';', $value);
if (is_array($arr)) {
foreach ($arr as $address) {
$message->addReplyTo(trim($address));
}
}
}
$attachmentPartList = array();
$attachmentCollection = $email->get('attachments');
$attachmentInlineCollection = $email->getInlineAttachments();
foreach ($attachmetList as $attachment) {
$attachmentCollection[] = $attachment;
}
if (!empty($attachmentCollection)) {
foreach ($attachmentCollection as $a) {
$fileName = 'data/upload/' . $a->id;
$fileName = $this->getEntityManager()->getRepository('Attachment')->getFilePath($a);
$attachment = new MimePart(file_get_contents($fileName));
$attachment->disposition = Mime::DISPOSITION_ATTACHMENT;
$attachment->encoding = Mime::ENCODING_BASE64;
@@ -226,7 +262,7 @@ class Sender
if (!empty($attachmentInlineCollection)) {
foreach ($attachmentInlineCollection as $a) {
$fileName = 'data/upload/' . $a->id;
$fileName = $this->getEntityManager()->getRepository('Attachment')->getFilePath($a);
$attachment = new MimePart(file_get_contents($fileName));
$attachment->disposition = Mime::DISPOSITION_INLINE;
$attachment->encoding = Mime::ENCODING_BASE64;
@@ -311,6 +347,9 @@ class Sender
} else {
$messageId = '' . md5($email->get('name')) . '/' . time() . '/' . $rand . '@espo';
}
if ($email->get('isSystem')) {
$messageId .= '-system';
}
$messageIdHeader = new \Zend\Mail\Header\MessageId();
$messageIdHeader->setId($messageId);
@@ -18,6 +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/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Notificators;

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