"Lock" menu item rename issue

Moderator: crythias

Locked
GlebTyazhyolov
Znuny newbie
Posts: 5
Joined: 22 May 2015, 11:12
Znuny Version: OTRS 4.0
Real Name: Глеб Андреевич Тяжёлов
Company: ООО "АйТиИ"

"Lock" menu item rename issue

Post by GlebTyazhyolov »

Hello all,

I trying to rename "Lock" menu item in AgentTicketZoom.

To do so I go to Frontend::Agent::Ticket::MenuModule
And change Lock menu "Name" field
Ticket::Frontend::MenuModule###100-Lock
Name: Lock

change to
Name: LockZ

Also (just for test) rename another menu item
Ticket::Frontend::MenuModule###000-Back
Name: Back

change to
Name: BackZ

Then Update, back to AgentTicketZoom and see, Back menu item changed to BackZ but Lock stays the same.

Is it bug or feature? =)

PS (i need to rename it to make custom translation for menu item. Currently translation of word "Lock" changes it in menu and also in dashlet column head. I want different translation, verb for menu and noun for column header)
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: "Lock" menu item rename issue

Post by wurzel »

Hi,

you did the renaming the right way. It may be caching (broswer) causing this effect.

GlebTyazhyolov wrote: PS (i need to rename it to make custom translation for menu item. Currently translation of word "Lock" changes it in menu and also in dashlet column head. I want different translation, verb for menu and noun for column header)
for translations read https://otrs.github.io/doc/manual/devel ... slate.html
(it is the same in 4.0.x)

different translations for one and same word... don't know

Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: "Lock" menu item rename issue

Post by RStraub »

Hey there,

nice find.


The "lock" is actually hardcoded. Take a look at "~otrs/Kernel/Output/TicketMenuLock.pm" at line 124:
return {
%{ $Param{Config} },
%{ $Param{Ticket} },
%Param,
Name => 'Lock',
Description => 'Lock it to work on it',
Link =>
'Action=AgentTicketLock;Subaction=Lock;TicketID=[% Data.TicketID | uri %];[% Env("ChallengeTokenParam") | html %]',
};
I doubt this is how it is intended, makes the name in the sysconfig very useless, doesn't it ?
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
GlebTyazhyolov
Znuny newbie
Posts: 5
Joined: 22 May 2015, 11:12
Znuny Version: OTRS 4.0
Real Name: Глеб Андреевич Тяжёлов
Company: ООО "АйТиИ"

Re: "Lock" menu item rename issue

Post by GlebTyazhyolov »

wurzel wrote: different translations for one and same word... don't know
We try to move away from IT (or OTRS specific) terminology to make interface more friendly for non-IT users. So words will not be same.
Menu "Lock" should became "Begin work", and column head difinitely should not be "Begin work" =)
GlebTyazhyolov
Znuny newbie
Posts: 5
Joined: 22 May 2015, 11:12
Znuny Version: OTRS 4.0
Real Name: Глеб Андреевич Тяжёлов
Company: ООО "АйТиИ"

Re: "Lock" menu item rename issue

Post by GlebTyazhyolov »

RStraub wrote: I doubt this is how it is intended, makes the name in the sysconfig very useless, doesn't it ?
Yes, it's a bit counterintuitive.

Probably developers had some reasons to hardcode that value? Who knows.

Will try to change in code and look will it break my system or not.

Thanks for idea!

Regards,
Gleb
GlebTyazhyolov
Znuny newbie
Posts: 5
Joined: 22 May 2015, 11:12
Znuny Version: OTRS 4.0
Real Name: Глеб Андреевич Тяжёлов
Company: ООО "АйТиИ"

Re: "Lock" menu item rename issue

Post by GlebTyazhyolov »

I successfuly changed the button label by using RStraub method. Also I understand why Lock can't be renamed like other menu items.

From the "Configuaration" point of view this is a single button "Lock". But in real it's two button "Lock" and "Unlock", or, by other words, this is button with two states, each of them have different name and do different Action. It's why it cannot be renamed by standard way.

It's sad that there is no more convinient way to rename it, because this "hack" will be overwritten one day by update or will be lost in the case of migration to other server.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: "Lock" menu item rename issue

Post by RStraub »

You could put the modified file into the ~otrs/Custom/... folder (keeping same structure).

That way, when you upgrade, you can easily track what you changed and modify it again, or just keep the modified custom-files.

But you are right, it might appear cumbersome. On the other hand you get near endless possibilities to customize OTRS to your needs.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
GlebTyazhyolov
Znuny newbie
Posts: 5
Joined: 22 May 2015, 11:12
Znuny Version: OTRS 4.0
Real Name: Глеб Андреевич Тяжёлов
Company: ООО "АйТиИ"

Re: "Lock" menu item rename issue

Post by GlebTyazhyolov »

I like your idea. Thanks, Rolf.
Locked