How To Show/Hide Dynamic Field for specific Queue

Moderator: crythias

Locked
dtosun
Znuny newbie
Posts: 24
Joined: 12 Sep 2012, 14:00
Znuny Version: 4.0.13
Real Name: Dursun Tosun

How To Show/Hide Dynamic Field for specific Queue

Post by dtosun »

Hi,

My version is 3.3.8. I use this code in AgentTicketClose.dtl. But it doesnt work. What is wrong?

Code: Select all

<script type="text/javascript">//<![CDATA[
function nonetext() {
    $("[id^=DynamicField]").parent().addClass( 'Hidden' );
    $("[id^=LabelDynamicField]").parent().addClass('Hidden');
}
    $('#Dest').bind('change', function (Event) {
        Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'Dest', ['TypeID', 'NewUserID', 'NewResponsibleID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', 'To', 'Cc', 'Bcc', 'StandardTemplateID' $Data{"DynamicFieldNamesStrg"}]);
    switch ( $('#Dest').val() ) {
            case "5\|\|Helpdesk": // need to slash escape the pipes. Also, need to be in numerical order
                nonetext();
                $('#DynamicField_Solution').parent().removeClass( 'Hidden' );
                $('#LabelDynamicField_Solution').parent().removeClass( 'Hidden' );
            break;
            default:
                nonetext();

        }
    });
//]]></script>    
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Agent.TicketAction.Init();
nonetext(); 
//]]></script>
<!--dtl:js_on_document_complete-->
Last edited by crythias on 11 Jul 2014, 15:54, edited 1 time in total.
Reason: Howtos are not for questions
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How To Show/Hide Dynamic Field for specific Queue

Post by crythias »

AgentTicketClose.dtl uses AgentTicketActionCommon, so not sure how you're going to do this (only) for AgentTicketClose.


Core.AJAX.FormUpdate($('#NewPhoneTicket') works for forms with an id of NewPhoneTicket

AgentTicketActionCommon uses id of Compose, so try that.

Also, Destination/Queue *generally* isn't changed on ticket close.
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
Locked