Turning Template buttons into a drop-down list?

Moderator: crythias

Post Reply
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Turning Template buttons into a drop-down list?

Post by Mothra »

I've been using the (slightly hidden) option in AgentTicketPhone.dtl and AgentTicketEmail.dtl where you can add template buttons that will then populate the rest of the form data for you. However, once you've got a handful of those buttons, it can look rather ugly, and I need 20 of these things.

I thought it would be relatively straightforward to convert the buttons into HTML select/options, but it seems the majority of browsers don't support onClick or onChange events for each option. This means I need to move the onChange event into the select tag, which sort of works if I hadrcode the action to call a single template, but I'm having difficulty getting the right syntax to substitute in the option index.

Here's what I have so far (picks just the first template, but drop down is reset to default value after picking):

Code: Select all

<select name="templatePicker" onChange="$('#Template1').submit()">
    <option>-</option>
    <option value="$Text{"Example Template 1"}">$Text{"Example Template 1"}</option>
    <option value="$Text{"Example Template 2"}">$Text{"Example Template 2"}</option>
</select>
Has anyone managed to solve this?
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Post Reply