Customization of fields in CustomerTicketMessage.tt

Moderator: crythias

Post Reply
vincentb
OTRS newbie
Posts: 5
Joined: 30 Jan 2021, 07:51
Znuny / OTRS Version: 6 community
Real Name: Vincent B.

Customization of fields in CustomerTicketMessage.tt

Post by vincentb »

Hello,

To make my dynamic field SiteCode appear in the customer ticket creation form, I have added to CustomerTicketMessage.tt this code:

Code: Select all

<div class="Row Row_DynamicField_SiteCode">
    <label id="LabelDynamicField_SiteCode" for="DynamicField_SiteCode" class="Mandatory">
        <span class="Marker">*</span> Store Number:</label>
    <div class="Field">
        <input type="text" class="DynamicFieldText W50pc" id="DynamicField_SiteCode" name="DynamicField_SiteCode" title="Store Number" value="" />
      </div> 
   <div class="Clear"></div>
</div>
In the resulting customer form, I see the field as expected, I can enter a value in it. However after form submission, the value of the dynamic field "SiteCode" is not updated as I would have expected.

Note: I did not add "SiteCode" to Ticket::Frontend::CustomerTicketMessage###DynamicField. In fact I plan to add some condition for this code in .tt file to be called. Most often I do not want this "SiteCode" to appear in the CustomerTicketMessage form.

Any clue to make this work?
reneeb
OTRS guru
Posts: 4933
Joined: 13 Mar 2011, 09:54
Znuny / OTRS Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Customization of fields in CustomerTicketMessage.tt

Post by reneeb »

I would try to do it that way:

* Install https://opar.perl-services.de/dist/Hide ... elds-6.0.5
* Configure the package
* Add the field to Ticket::Frontend::CustomerTicketMessage###DynamicField
* If needed, add a sysconfig option to define the filter
Perl / OTRS development: http://perl-services.de
Free OTRS add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply