Re: show/hide dynamic fields on phone ticket

Dimitrakakis Georgios <[email protected]>
Newsgroups gmane.comp.otrs.user
Message-ID <[email protected]>
I am interested in this as well but what do you mean by "freely selectable feature"? Can it be installed without an OTRS Business Solution license and how?

Regards,

G.

From: otrs [mailto:[email protected]] On Behalf Of Carlos Rodriguez
Sent: Tuesday, November 01, 2016 1:07 AM
To: User questions and discussions about OTRS.
Subject: Re: [otrs] show/hide dynamic fields on phone ticket

I would recommend the OTRS Business Solution(tm) Freely Selectable Feature OTRSTicketMaskExtensions (Ticket Forms<https://www.otrs.com/otrs-business-solution-feature/ticket-forms/>), it with handle the show and hide of the dynamic fields but also the mandatory status, that is not trivial.

((enjoy))

Carlos Rodríguez




On Oct 31, 2016, at 3:39 PM, Kent Kollasch <[email protected]<mailto:[email protected]>> wrote:

the last problem is setting/removing the class Validate_Required for the dynamic fields.  If I set it in sysconfig to manditory, I need to be able to clear this if the field isn't being shown.

On 10/31/2016 3:32 PM, Kent Kollasch wrote:
I figured it out...  Works pretty good...
### shows dynamic fields based on ticket type ###
       switch ($('#TypeID').val() ) {
             case "4":
                 document.getElementById('id Supervisor').style.display = 'block';
                 document.getElementById('id Department').style.display = 'block';
                 document.getElementById('id ProdLine').style.display = 'block';
                 document.getElementById('id Item').style.display = 'block';
                 document.getElementById('id Problem').style.display = 'block';
                 document.getElementById('id Solution').style.display = 'block';
             break;

        default:
                 document.getElementById('id Supervisor').style.display = 'none';
                 document.getElementById('id Department').style.display = 'none';
                 document.getElementById('id ProdLine').style.display = 'none';
                 document.getElementById('id Item').style.display = 'none';
                 document.getElementById('id Problem').style.display = 'none';
                 document.getElementById('id Solution').style.display = 'none';
             break;
       }

[% RenderBlockStart("DynamicField") %]
                        <div id="id [% Data.Name %]" style="display:none;" class="Row Row_DynamicField_[% Data.Name | html %]" className="TicketFreeText Validate_Required ServerError" >
                            [% Data.Label %]<div class="Field">[% Data.Field %]</div>
                            <div class="Clear"></div>
                        </div>
[% RenderBlockEnd("DynamicField") %]


On 10/31/2016 3:12 PM, Kent Kollasch wrote:
Hi,
I'm trying to show/hide dynamic fields on new phone ticket based on ticket type.
I'm having mixed results, only the first dynamic field shows up, the rest stay hidden.  I've add the following to Custom/Kernel/Output/HTML/Templates/Standard/AgentTicketPhone.tt.
[% RenderBlockStart("TicketType") %]
                    <label class="Mandatory" for="TypeID"><span class="Marker">*</span> [% Translate("Type") | html %]:</label>
                    <div class="Field">
                        [% Data.TypeStrg %]
                        <div id="TypeIDError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>
                        <div id="TypeIDServerError" class="TooltipErrorMessage"><p>[% Translate("This field is required.") | html %]</p></div>

[% WRAPPER JSOnDocumentComplete %]
<script type="text/javascript">//<![CDATA[
    $('#TypeID').bind('change', function (Event) {
        Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'TypeID', ['Dest', 'NewUserID', 'NewResponsibleID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', 'To', 'Cc', 'Bcc', 'StandardTemplateID' [% Data.DynamicFieldNamesStrg %]]);

### shows dynamic fields based on ticket type ###
       switch ($('#TypeID').val() ) {
             case "4":
                 document.getElementById('id name').style.display = 'block';
             break;

        default:
                  document.getElementById('id name').style.display = 'none';
       }

    });
//]]></script>
[% END %]


[% RenderBlockStart("DynamicField") %]
                        <div id="id name" style="display:none;" class="Row Row_DynamicField_[% Data.Name | html %]" className="TicketFreeText Validate_Required ServerError" >
                            [% Data.Label %]<div class="Field">[% Data.Field %]</div>
                            <div class="Clear"></div>
                        </div>
[% RenderBlockEnd("DynamicField") %]

Thanks,
Kent


--

Kent C. Kollasch <mailto:[email protected]><mailto:[email protected]>

Director of Information Technology

Art's-Way Manufacturing Co., Inc.

Phone: (712) 864-0025

Fax: (712) 864-3154



This message may contain information that is confidential and subject to privilege.

If you are not the intended recipient and have received this e-mail in error, please

disregard and do not open attachments, if any. Please note that the view or opinions

presented in this e-mail are solely those of the author.




---------------------------------------------------------------------

OTRS mailing list: otrs - Webpage: http://otrs.org/

Archive: http://lists.otrs.org/pipermail/otrs

To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs



--

Kent C. Kollasch <mailto:[email protected]><mailto:[email protected]>

Director of Information Technology

Art's-Way Manufacturing Co., Inc.

Phone: (712) 864-0025

Fax: (712) 864-3154



This message may contain information that is confidential and subject to privilege.

If you are not the intended recipient and have received this e-mail in error, please

disregard and do not open attachments, if any. Please note that the view or opinions

presented in this e-mail are solely those of the author.




---------------------------------------------------------------------

OTRS mailing list: otrs - Webpage: http://otrs.org/

Archive: http://lists.otrs.org/pipermail/otrs

To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs



--

Kent C. Kollasch <mailto:[email protected]><mailto:[email protected]>

Director of Information Technology

Art's-Way Manufacturing Co., Inc.

Phone: (712) 864-0025

Fax: (712) 864-3154



This message may contain information that is confidential and subject to privilege.

If you are not the intended recipient and have received this e-mail in error, please

disregard and do not open attachments, if any. Please note that the view or opinions

presented in this e-mail are solely those of the author.
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs

______________________________________________________________________________
Το περιεχόμενο αυτού του ηλεκτρονικού μηνύματος και τυχόν συνημμένα αρχεία είναι εμπιστευτικά. Απευθύνεται μόνο στους αναφερόμενους παραλήπτες. Αν λάβατε αυτό το μήνυμα εκ παραδρομής, παρακαλείσθε να επικοινωνήσετε αμέσως με τον αποστολέα του μηνύματος ή τον διαχειριστή του συστήματος και να μην αποκαλύψετε σε κανένα το περιεχόμενο. Οι απόψεις που εκφράζονται ανήκουν στον συγγραφέα και δεν εκφράζουν κατ' ανάγκη τις απόψεις της Παγκρήτιας Συνεταιριστικής Τράπεζας.

The contents of this email and any attachments are confidential. It is intended for the named recipients only. If you have received this email in error please notify the system administrator or the sender immediately and do not disclose the contents to anyone. Any views or opinions presented are of the author and not necessarily represent those of Pancretan Cooperative Bank

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.