stream internal posts 3

This commit is contained in:
yuri
2015-10-23 16:28:28 +03:00
parent 291380c6b4
commit c9609bf707
3 changed files with 30 additions and 16 deletions
@@ -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}",
+1 -1
View File
@@ -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');
+27 -15
View File
@@ -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(', ');
}
}
}
}