stream internal posts 3
This commit is contained in:
@@ -277,6 +277,8 @@
|
||||
"postTargetYou": "{user} posted to you",
|
||||
"postTargetYouAndOthers": "{user} posted to {target} and you",
|
||||
"postTargetAll": "{user} posted to all",
|
||||
"postTargetSelf": "{user} posted to self",
|
||||
"postTargetSelfAndOthers": "{user} posted to {target} and self",
|
||||
|
||||
"mentionInPost": "{user} mentioned {mentioned} in {entityType} {entity}",
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ class Stream extends \Espo\Core\Services\Base
|
||||
$e->set('relatedName', $entity->get('name'));
|
||||
}
|
||||
}
|
||||
if ($e->get('type') == 'Post' && $e->get('parentId') === null) {
|
||||
if ($e->get('type') == 'Post' && $e->get('parentId') === null && !$e->get('isGlobal')) {
|
||||
$e->loadLinkMultipleField('users');
|
||||
if (count($e->get('usersIds')) == 0) {
|
||||
$e->loadLinkMultipleField('teams');
|
||||
|
||||
@@ -74,22 +74,34 @@ Espo.define('views/stream/notes/post', 'views/stream/note', function (Dep) {
|
||||
|
||||
this.messageData['targetType'] = this.translateEntityType('User', userIdList.length > 1);
|
||||
|
||||
var userHtml = '';
|
||||
var userHtmlList = [];
|
||||
userIdList.forEach(function (userId) {
|
||||
if (userId === this.getUser().id) {
|
||||
this.messageName = 'postTargetYou';
|
||||
if (userIdList.length > 1) {
|
||||
this.messageName = 'postTargetYouAndOthers';
|
||||
if (userIdList.length === 1 && userIdList[0] === this.model.get('createdById')) {
|
||||
this.messageName = 'postTargetSelf';
|
||||
} else {
|
||||
var userHtml = '';
|
||||
var userHtmlList = [];
|
||||
userIdList.forEach(function (userId) {
|
||||
if (userId === this.getUser().id) {
|
||||
this.messageName = 'postTargetYou';
|
||||
if (userIdList.length > 1) {
|
||||
if (userId === this.model.get('createdById')) {
|
||||
this.messageName = 'postTargetSelfAndOthers';
|
||||
} else {
|
||||
this.messageName = 'postTargetYouAndOthers';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (userId === this.model.get('createdById')) {
|
||||
this.messageName = 'postTargetSelfAndOthers';
|
||||
} else {
|
||||
var userName = userNameHash[userId];
|
||||
if (userName) {
|
||||
userHtmlList.push('<a href="#User/view/' + userId + '">' + userName + '</a>');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var userName = userNameHash[userId];
|
||||
if (userName) {
|
||||
userHtmlList.push('<a href="#User/view/' + userId + '">' + userName + '</a>');
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.messageData['target'] = userHtmlList.join(', ');
|
||||
}, this);
|
||||
this.messageData['target'] = userHtmlList.join(', ');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user