[Solved] Preserve Field values when using templates

Moderator: crythias

Locked
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

[Solved] Preserve Field values when using templates

Post by RStraub »

Hey there forum,

looking for help again :)

We're using templating in the AgentTicketPhone.dtl:
In the javascript part of the queue selection we added "$('#Template1').submit();"
and at the end of the file we have the template

Code: Select all

<form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" id="Template1">
    <input type="hidden" name="Action" value="$Env{"Action"}"/>
    <input type="hidden" name="Subaction" value="StoreNew"/>
    <input type="hidden" name="CustomerUser" value="Some_User"/>
    <input type="hidden" name="TypeID" value="7"/>
    [...]
    <input type="hidden" name="Subject" value="Some preffiled Text"/>
    [...]
</form>
This was a great way to prefill Subject and Body, but now we want to use this template whilst keeping allready entered data in Subject or Body (esp. for option "Split Ticket").

Thus I tried to use this line, as I saw it used somewhere else in the .dtl:

Code: Select all

    <input type="hidden" name="Subject" value="$QData{"Subject"}"/>
Am I on the right way? How can I preserve the values which are allready entered (If I delete the whole line, the subject field will empty on the template event)?


Best regards,
Rolf
Last edited by RStraub on 23 Apr 2014, 09:13, edited 1 time in total.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Preserve Field values when using templates

Post by crythias »

RStraub wrote:How can I preserve the values which are allready entered (If I delete the whole line, the subject field will empty on the template event)?
Javascript check if value exists in field do nothing else set.
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
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Preserve Field values when using templates

Post by RStraub »

Well that should have been obvious. Thanks crythias ;)
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Locked