Merge branch 'stable'

This commit is contained in:
yuri
2019-09-12 11:21:51 +03:00
10 changed files with 52 additions and 47 deletions
-1
View File
@@ -403,7 +403,6 @@ class Language
if (is_string($subData)) {
$subData = str_replace('<', '&lt;', $subData);
$subData = str_replace('>', '&gt;', $subData);
$subData = str_replace('"', '&quot;', $subData);
}
}
}
@@ -50,7 +50,8 @@
},
{
"label":"Folders",
"link":"#EmailFolder"
"link":"#EmailFolder",
"configCheck": "!emailFoldersDisabled"
},
{
"label":"Filters",
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-action="toggleCollapsable"">
<button type="button" class="navbar-toggle" data-action="toggleCollapsable">
<span class="fas fa-bars"></span>
</button>
<div class="navbar-logo-container"><a class="navbar-brand nav-link" href="#"><img src="{{logoSrc}}" class="logo"></span></a></div>
+20
View File
@@ -49,6 +49,26 @@ define('utils', [], function () {
}
},
checkActionAvailability: function (helper, item) {
var config = helper.config;
if (item.configCheck) {
var configCheck = item.configCheck;
var opposite = false;
if (configCheck.substr(0, 1) === '!') {
opposite = true;
configCheck = configCheck.substr(1);
}
var configCheckResult = config.getByPath(configCheck.split('.'));
if (opposite) {
configCheckResult = !configCheckResult;
}
if (!configCheckResult) return false;
}
return true;
},
checkActionAccess: function (acl, obj, item, isPrecise) {
var hasAccess = true;
if (item.acl) {
+3 -1
View File
@@ -314,13 +314,15 @@ define('view-helper', ['lib!client/lib/purify.min.js'], function () {
text = text.replace(item.regex, item.value);
});
options = options || {};
if (options.inline) {
text = marked.inlineLexer(text, []);
} else {
text = marked(text);
}
text = DOMPurify.sanitize(text);
text = DOMPurify.sanitize(text).toString();
text = text.replace(/<a href="mailto:(.*)"/gm, '<a href="javascript:" data-email-address="$1" data-action="mailTo"');
+8 -3
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/email/list', 'views/list', function (Dep) {
define('views/email/list', 'views/list', function (Dep) {
return Dep.extend({
@@ -65,13 +65,18 @@ Espo.define('views/email/list', 'views/list', function (Dep) {
}
this.foldersDisabled = this.foldersDisabled ||
this.getMetadata().get(['scopes', this.folderScope, 'disabled']) ||
!this.getAcl().checkScope(this.folderScope);
this.getConfig().get('emailFoldersDisabled') ||
this.getMetadata().get(['scopes', this.folderScope, 'disabled']) ||
!this.getAcl().checkScope(this.folderScope);
var params = this.options.params || {};
this.selectedFolderId = params.folder || this.defaultFolderId;
if (this.foldersDisabled) {
this.selectedFolderId = null;
}
this.applyFolder();
},
+6 -6
View File
@@ -87,15 +87,15 @@ define('views/main', 'view', function (Dep) {
if (this.menu) {
['buttons', 'actions', 'dropdown'].forEach(function (type) {
(this.menu[type] || []).forEach(function (item) {
item = Espo.Utils.clone(item);
menu[type] = menu[type] || [];
if (item.configCheck) {
if (!this.getConfig().getByPath(item.configCheck.split('.'))) return;
}
if (Espo.Utils.checkActionAccess(this.getAcl(), this.model || this.scope, item)) {
menu[type].push(item);
}
if (!Espo.Utils.checkActionAvailability(this.getHelper(), item)) return;
if (!Espo.Utils.checkActionAccess(this.getAcl(), this.model || this.scope, item)) return;
item.name = item.name || item.action;
item.action = item.action || this.name;
menu[type].push(item);
}, this);
}, this);
}
+8 -28
View File
@@ -947,20 +947,10 @@ define('views/record/list', 'view', function (Dep) {
(this.getMetadata().get(['clientDefs', this.scope, 'massActionList']) || []).forEach(function (item) {
var defs = this.getMetadata().get(['clientDefs', this.scope, 'massActionDefs', item]) || {};
var acl = defs.acl;
var aclScope = defs.aclScope;
if (acl || aclScope) {
if (!this.getAcl().check(aclScope || this.scope, acl)) {
return;
}
}
var configCheck = defs.configCheck;
if (configCheck) {
var arr = configCheck.split('.');
if (!this.getConfig().getByPath(arr)) {
return;
}
}
if (!Espo.Utils.checkActionAvailability(this.getHelper(), defs)) return;
if (!Espo.Utils.checkActionAccess(this.getAcl(), null, defs)) return;
this.massActionList.push(item);
}, this);
@@ -976,20 +966,10 @@ define('views/record/list', 'view', function (Dep) {
if (this.collection.url !== this.entityType) return;
if (~this.massActionList.indexOf(item)) {
var defs = this.getMetadata().get(['clientDefs', this.scope, 'massActionDefs', item]) || {};
var acl = defs.acl;
var aclScope = defs.aclScope;
if (acl || aclScope) {
if (!this.getAcl().check(aclScope || this.scope, acl)) {
return;
}
}
var configCheck = defs.configCheck;
if (configCheck) {
var arr = configCheck.split('.');
if (!this.getConfig().getByPath(arr)) {
return;
}
}
if (!Espo.Utils.checkActionAvailability(this.getHelper(), defs)) return;
if (!Espo.Utils.checkActionAccess(this.getAcl(), null, defs)) return;
this.checkAllResultMassActionList.push(item);
}
}, this);
+3 -5
View File
@@ -82,11 +82,9 @@ define('views/record/panels-container', 'view', function (Dep) {
applyAccessToActions: function (actionList) {
if (!actionList) return;
actionList.forEach(function (item) {
if (item.configCheck) {
if (!this.getConfig().getByPath(item.configCheck.split('.'))) {
item.hidden = true;
return;
}
if (!Espo.Utils.checkActionAvailability(this.getHelper(), item)) {
item.hidden = true;
return;
}
if (Espo.Utils.checkActionAccess(this.getAcl(), this.model, item, true)) {
if (item.isHiddenByAcl) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "espocrm",
"version": "5.6.12",
"version": "5.6.13",
"description": "",
"main": "index.php",
"repository": {