Closed BurtGummer closed 1 week ago
I initially tried to fix this but failed with https://github.com/znuny/Znuny/pull/436 (and failed because sadly its not that simple as I initially thought) and was adviced to create an issue in the feature-request repository instead https://github.com/znuny/znuny-feature-requests/issues/51. So effectivly this is a "duplicate" however I also consider this rather a bug than a feature and sadly there hasn't been any activity in trying to address this issue yet as we're in exactly the same boat as @BurtGummer.
there is also a thread about in the forum: https://community.znuny.org/viewtopic.php?f=35&t=43841&p=177871
Mention fullname has been put as roadmap for 7.x here.. https://www.znuny.org/en/roadmap
Quick work around:
Admin > Mentions::RichTextEditor###Templates
{fullname} (<a class="Mention" href="#" title="{fullname}">@{username}</a>)
UserEmail => $User{UserEmail},
(+) UserFullname => $User{UserFullname},
(-) <span>[% Data.UserLogin | html %]</span>
(+) <span>[% Data.UserFullname | html %] - [% Data.UserLogin | html %]</span>
Mention text
Mention dashboard
Mention history
Mention toolbar
Mention ticket widget
I DID NOT CHECK AGAINST EMAIL. DO TEST YOURSELF
Hi,
you both are correct. It is not that simple and it would be nice to have it changed.
Maybe it helps @tgurr when I explain how this all works together:
A user creates a mention in the gui. We store this info in a link, which is later identified by this code:
Kernel::System::Ticket::Event::Mentions; L:70
my $MentionedUserIDs = $MentionObject->GetMentionedUserIDsFromString(
HTMLString => $HTMLBody,
PlainTextString => $Article{Body} // '',
Limit => $MentionsLimit,
);
In
> Kernel::System::Mention;
> L:559
the check against that is performed.
```Perl
sub GetMentionedUserIDsFromString {
...
...
my @MentionedUsers = (
$Param{HTMLString}
=~ m{<a\b[^>]*?\bclass="Mention"[^>]*?>\Q$MentionsTriggerConfig->{User}\E(.*?)<\/a>}sg
);
my @MentionedGroups = (
$Param{HTMLString}
=~ m{<a\b[^>]*?\bclass="GroupMention"[^>]*?>\Q$MentionsTriggerConfig->{Group}\E(.*?)<\/a>}sg
);
There are multiple ways to change this:
and of course, replace the output template.
<Setting Name="Mentions::RichTextEditor###Templates" Required="0" Valid="1">
<Description Translatable="1">Frontend registration of input/output templates for mention plugin of CKEditor.</Description>
<Navigation>Core</Navigation>
<Value>
<Hash>
<Item Key="Users">
<Hash>
<Item Key="ItemTemplate"><li class="Mention" data-id="{id}">{fullname}</li></Item>
<Item Key="OutputTemplate"><a class="Mention" href="#">@{username}</a> </Item>
</Hash>
</Item>
<Item Key="Groups">
<Hash>
<Item Key="ItemTemplate"><li class="Mention" data-id="{id}">{name} ({mentionLabel})</li></Item>
<Item Key="OutputTemplate"><a class="GroupMention" href="#">{name}</a> </Item>
</Hash>
</Item>
</Hash>
</Value>
</Setting>
maybe this points to the correct direction to update the PR. As already mentioned, it is on the roadmap for 7.1. A backport is not planned at the moment.
Regards and thank you for contributing. Johannes
Mention fullname has been put as roadmap for 7.x here.. https://www.znuny.org/en/roadmap
Quick work around:
- Admin > Mentions::RichTextEditor###Templates
- Users > OutputTemplate >
{fullname} (<a class="Mention" href="#" title="{fullname}">@{username}</a>)
[...]
Does someone try this solution? Normaly I dont like changing the code .. 🤔
The feature to use the user fullname as mention label will be fixed within the upcoming Znuny 7.1.1
Hello,
that's the only reason why we can't use this great feature: We use a number as login, not the real name. This means that @12345 and not @firstname lastname is displayed in the ticket body. I can search with the Realname and I got a list with "Firstname Lastname". But after I select a User, its changed to @12345.
Is there any way to configure WHAT is displayed at this point?
Znuny 6.5.5, Debian 11, OpenLDAP.