Moving dynamic fields around the phone ticket form [solved]

Moderator: crythias

Locked
otrsgsy
Znuny newbie
Posts: 16
Joined: 17 Aug 2012, 12:50
Znuny Version: 3.1.8
Real Name: Dan

Moving dynamic fields around the phone ticket form [solved]

Post by otrsgsy »

I have created a number of dynamic fields and have configured them to only appear when certain services are selected via the Dynamic Ticket Templates add-on.

The new phone ticket works fine with these fields at the bottom of the form however I would like them at the top so I have hard coded each field where I want them to appear. At this point everything is OK and the form submits and creates a ticket.

The issue with hard coding the fields in is that they are duplicated at the top and bottom of the form. To get around this I have attempted to comment out the default dynamic field function at the bottom of the form but this stops the form from being submitted.

Example of hard coded field:

Code: Select all

<!-- dtl:block:DynamicField_System -->
	<div class="Row Row_DynamicField_$QData{"Name"}">
		$Data{"Label"}
		<div class="Field">
			$Data{"Field"}
		</div>
		<div class="Clear"></div>
	</div>
<!-- dtl:block:DynamicField_System -->
Here is my commented block:

Code: Select all

# <!-- dtl:block:DynamicField -->
# 	<div class="Row Row_DynamicField_$QData{"Name"}">
# 		$Data{"Label"}
# 		<div class="Field">
# 			$Data{"Field"}
# 		</div>
# 		<div class="Clear"></div>
# 	</div>
# <!-- dtl:block:DynamicField -->
I have also tried hiding the code using class="hidden" divs, but that also fails.

Has anyone else had this problem or know a solution?

Thanks
Last edited by otrsgsy on 21 May 2013, 17:41, edited 1 time in total.
OTRS 3.1.12
Ubuntu
MYSQL DB
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Moving dynamic fields around the phone ticket form

Post by crythias »

Whether they exist or not, all dynamic fields have to be represented as blocks if you're not using the automatic order. Don't forget, though, that you can (should be able to?) change this order via SysConfig.
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
otrsgsy
Znuny newbie
Posts: 16
Joined: 17 Aug 2012, 12:50
Znuny Version: 3.1.8
Real Name: Dan

Re: Moving dynamic fields around the phone ticket form

Post by otrsgsy »

Excellent. The ticket is now working. :D

Solution Steps:

1. Comment out the original dynamic field function at the bottom of the ticket dtl file.
2. Add new blocks for ALL dynamic fields (system and manually added fields) to the ticket dtl file.
3. Go to the config for Frontend::Agent::Ticket::ViewPhoneNew and add all of the unwanted dynamic fields to the Ticket::Frontend::AgentTicketPhone###DynamicField list and set the content value to 0.

Oddly I didn't need to add every single dynamic field, but just the ones I didn't want to appear and also the ones that I wanted to be present even without a template selected. E.g. MasterSlave and TicketFreeText14(Impact) are on the list and set to 1.

here is my list (there are another 6 custom dynamic fields not listed):

1 - MasterSlave
1 - TicketFreeText14
1 - Alternative contact name (new custom dynamic field)
0 - TicketFreeText13
0 - TicketFreeText15
0 - TicketFreeText16
0 - TicketFreeTime3
0 - TicketFreeTime4
0 - TicketFreeTime5
0 - TicketFreeTime6

Many thanks.
Dan
OTRS 3.1.12
Ubuntu
MYSQL DB
Locked