What does this do? It shows things like FreeTextFields to customers based upon the queue they choose. It's client-side and relies on CSS to hide elements. Also, this code shows you how you can change the body based upon the queue.
Edit Kernel/Output/HTML/Standard (or your theme! recommended!)/CustomerTicketMessage.dtl
This was a fun thing. It's not perfect, and you should test things out before going live, but take a look:
A while ago I submitted this: http://forums.otrs.org/viewtopic.php?f=62&t=5157#p23375
But, let's see if we can make a Free Text field show up only on certain queues...
I have sneaky way of doing it. Let's say js actually works...
Code: Select all
<script type="text/javascript">
Core.Customer.InitFocus();
//above two lines are already there
switch ($('#Dest').val() ) { //this is where the queue is relevant (Dest = Queue)
case "3\|\|Junk": // need to slash escape the pipes
document.compose.RichText.value = "This is junk<br/>and line 2"; // only if you want to change the body. destroys user input if queue changes
document.getElementById('TicketFreeText1').style.display = 'block';
document.getElementById('LabelTicketFreeText1').style.display = 'block';
break;
default:
document.compose.RichText.value = $('#Dest').val(); //remove this. debug only. shows queue information
document.getElementById('TicketFreeText1').style.display = 'none';
document.getElementById('LabelTicketFreeText1').style.display = 'none';
}
// the following two lines are the existing last two lines of CustomerTicketMessage.dtl
</script>
<!-- dtl:js_on_document_complete -->
*similar* entries can be made in AgentTicketPhone.dtl and AgentTicketEmail.dtl (maybe not, but check this post: http://blog.otrs.org/2010/11/02/otrs-3- ... templates/)
PLEASE ask questions. DO NOT copy this stuff verbatim. You're going to get javascript errors if you try to address FreeText fields or queues or elements that don't exist/aren't enabled in sysconfig.