Merge branch 'hotfix/5.6.14'

This commit is contained in:
yuri
2019-09-13 13:05:21 +03:00
13 changed files with 91 additions and 10 deletions

View File

@@ -65,7 +65,7 @@ class AddLinkMultipleIdType extends \Espo\Core\Formula\Functions\Base
}
} else {
if (!is_string($id)) {
throw new Error();
return;
}
$this->getEntity()->addLinkMultipleId($link, $id);
}

View File

@@ -177,7 +177,7 @@ class Sender
return $this;
}
public function send(Email $email, $params = [], &$message = null, $attachmentList = [])
public function send(Email $email, $params = [], $message = null, $attachmentList = [])
{
if (!$message) {
$message = new Message();

View File

@@ -739,7 +739,7 @@ class Activities extends \Espo\Core\Services\Base
$orderBy = null;
$order = null;
if (!empty($selectParams['orderBy'])) {
$order = $selectParams['order'];
$order = $selectParams['order'] ?? null;
$orderBy = $selectParams['orderBy'];
}

View File

@@ -1083,7 +1083,7 @@ abstract class Base
if (!empty($item[1])) {
$orderInternal = $item[1];
}
$arr[] = $this->getOrderPart($entity, $orderByInternal, $orderInternal, false, $params);
$arr[] = $this->getOrderPart($entity, $orderByInternal, $orderInternal, $useColumnAlias, $params);
}
}
return implode(", ", $arr);
@@ -1091,7 +1091,11 @@ abstract class Base
if (strpos($orderBy, 'LIST:') === 0) {
list($l, $field, $list) = explode(':', $orderBy);
$fieldPath = $this->getFieldPathForOrderBy($entity, $field, $params);
if ($useColumnAlias) {
$fieldPath = '`'. $this->sanitizeSelectAlias($field) . '`';
} else {
$fieldPath = $this->getFieldPathForOrderBy($entity, $field, $params);
}
$listQuoted = [];
$list = array_reverse(explode(',', $list));
foreach ($list as $i => $listItem) {

View File

@@ -4,6 +4,7 @@
"action": "Action",
"createdAt": "Date",
"user": "User",
"userType": "User Type",
"target": "Target",
"targetType": "Target Type",
"authToken": "Auth Token",

View File

@@ -3,5 +3,6 @@
"target",
"createdAt",
"ipAddress",
"user"
"user",
"userType"
]

View File

@@ -26,6 +26,13 @@
"user": {
"type": "link"
},
"userType": {
"type": "foreign",
"link": "user",
"field": "type",
"view": "views/fields/foreign-enum",
"notStorable": true
},
"ipAddress": {
"type": "varchar",
"maxLength": "39"

View File

@@ -10,7 +10,7 @@
<ul class="dropdown-menu pull-left">
{{#each dropdownItemList}}
{{#if this}}
<li class="{{#if hidden}}hidden{{/if}}"><a href="javascript:" class="action" data-action="{{name}}">{{#if html}}{{{html}}}{{else}}{{translate label scope=../../../entityType}}{{/if}}</a></li>
<li class="{{#if hidden}}hidden{{/if}}"><a href="javascript:" class="action" data-action="{{name}}" {{#each data}} data-{{@key}}="{{./this}}"{{/each}}>{{#if html}}{{{html}}}{{else}}{{translate label scope=../../../entityType}}{{/if}}</a></li>
{{else}}
{{#unless @first}}
{{#unless @last}}

View File

@@ -33,19 +33,35 @@ define('utils', [], function () {
handleAction: function (viewObject, e) {
var $target = $(e.currentTarget);
var action = $target.data('action');
var fired = false;
if (action) {
var data = $target.data();
var method = 'action' + Espo.Utils.upperCaseFirst(action);
if (typeof viewObject[method] == 'function') {
viewObject[method].call(viewObject, data, e);
e.preventDefault();
e.stopPropagation();
fired = true;
} else if (data.handler) {
e.preventDefault();
e.stopPropagation();
fired = true;
require(data.handler, function (Handler) {
var handler = new Handler(viewObject);
handler[method].call(handler, data, e);
});
}
if (fired) {
var $dropdown = $target.closest('.dropdown-menu');
if ($dropdown.length) {
var $dropdownToggle = $dropdown.parent().find('[data-toggle="dropdown"]');
if ($dropdownToggle.length) {
$dropdownToggle.dropdown('toggle');
}
}
}
}
},

View File

@@ -45,6 +45,8 @@ Espo.define('views/email-template/record/detail', 'views/record/detail', functio
if (!bodyView) return;
if (this.model.get('isHtml')) {
var $anchor = $(window.getSelection().anchorNode);
if (!$anchor.closest('.note-editing-area').length) return;
bodyView.$summernote.summernote('insertText', tag);
} else {
var $body = bodyView.$element;

View File

@@ -299,6 +299,56 @@ define('views/record/detail', ['views/record/base', 'view-record-helper'], funct
name: 'viewFollowers'
});
}
if (this.type === 'detail') {
this.additionalActionsDefs = {};
var additionalActionList = [];
(this.getMetadata().get(['clientDefs', this.scope, this.type + 'ActionList']) || []).forEach(function (item) {
if (typeof item === 'string') {
item = {
name: item,
};
}
var item = Espo.Utils.clone(item);
var name = item.name;
if (!item.label) item.html = this.translate(name, 'actions', this.scope);
this.addDropdownItem(item);
if (!Espo.Utils.checkActionAvailability(this.getHelper(), item)) return;
additionalActionList.push(item);
var viewObject = this;
if (item.initFunction && item.data.handler) {
this.wait(new Promise(function (resolve) {
require(item.data.handler, function (Handler) {
var handler = new Handler(viewObject);
handler[item.initFunction].call(handler);
resolve();
});
}));
}
if (!Espo.Utils.checkActionAccess(this.getAcl(), this.model, item, true)) {
item.hidden = true;
}
}, this);
if (additionalActionList.length) {
this.listenTo(this.model, 'sync', function () {
additionalActionList.forEach(function (item) {
if (Espo.Utils.checkActionAccess(this.getAcl(), this.model, item, true)) {
this.showActionItem(item.name);
} else {
this.hideActionItem(item.name);
}
}, this);
}, this);
}
}
},
disableActionItems: function () {
@@ -1565,7 +1615,7 @@ define('views/record/detail', ['views/record/base', 'view-record-helper'], funct
}
this.getRouter().navigate(url, {trigger: true});
}
},
});
});

View File

@@ -1,6 +1,6 @@
{
"name": "espocrm",
"version": "5.6.13",
"version": "5.6.14",
"description": "",
"main": "index.php",
"repository": {

View File

@@ -131,7 +131,7 @@ class LanguageTest extends \PHPUnit\Framework\TestCase
'en_US' => 'English (United States)',
]
],
'testHtml' => '&lt;a href=&quot;javascript: alert(1)&quot;&gt;test&lt;/a&gt;',
'testHtml' => '&lt;a href="javascript: alert(1)"&gt;test&lt;/a&gt;',
],
];