Kludge to assign a State to a Response Template

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Kludge to assign a State to a Response Template

Post by crythias »

In ArticleActionMenu.tt

Around line 100, you can find the following, which you can just add if/then:

Code: Select all

    if ($(this).val() > 0) {
        URL = Core.Config.Get('Baselink') + $(this).parents().serialize();
        if ($(this).val() == 3) {
           URL = URL + '&StateID=7';
           }
        window.setTimeout(function() {
Basically, if the response template ID is 3, the StateID will be 7.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
tpsupport
Znuny newbie
Posts: 75
Joined: 02 Feb 2011, 14:45
Znuny Version: 6.0.12

Re: Kludge to assign a State to a Response Template

Post by tpsupport »

Hi crythias,

This is what I was looking for! Unfortnately this modification seems to only work for OTRS 5. Can it be adopted for OTRS 6 as well and how?
Javascript has been removed from templates in OTRS, see https://blog.otrs.com/2017/03/21/no-jav ... -tt-files/.

Thanks!
Znuny 6.5 LTS - Ubuntu 20.04 x64, Azure Database for MySQL server 5.7, Perl 5.22.1, Apache/2.4.18
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Kludge to assign a State to a Response Template

Post by crythias »

Even though javascript has been removed from templates, it's still available to add in Configuration via the Module Registration part. Just add a .js file to the list for the module you want to work.

You can override onchange that way.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply