mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
Merge branch 'hotfix/5.6.14'
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"action": "Action",
|
||||
"createdAt": "Date",
|
||||
"user": "User",
|
||||
"userType": "User Type",
|
||||
"target": "Target",
|
||||
"targetType": "Target Type",
|
||||
"authToken": "Auth Token",
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"target",
|
||||
"createdAt",
|
||||
"ipAddress",
|
||||
"user"
|
||||
"user",
|
||||
"userType"
|
||||
]
|
||||
@@ -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"
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "5.6.13",
|
||||
"version": "5.6.14",
|
||||
"description": "",
|
||||
"main": "index.php",
|
||||
"repository": {
|
||||
|
||||
@@ -131,7 +131,7 @@ class LanguageTest extends \PHPUnit\Framework\TestCase
|
||||
'en_US' => 'English (United States)',
|
||||
]
|
||||
],
|
||||
'testHtml' => '<a href="javascript: alert(1)">test</a>',
|
||||
'testHtml' => '<a href="javascript: alert(1)">test</a>',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user