OPAR - OPM Package ARchive

Browseable collection of plugins for the popular ticket system software Znuny and ((OTRS)) Community Edition.


HideDynamicFields

Version
6.0.5
Other Versions
3.3.1, 5.0.4,
Uploaded by/on
reneeb on 22 Sep 2020
Framework
6.0.x
Links
Download Website
Description
Outputfilter to show/hide dynamic fields based on various ticket attributes

Rate/comment this package

HideDynamicFields

This modules helps you to show/hide dynamic fields in "new ticket" and other dialogs. When an agents changes the selection of a dropdown field, it is checked whether a dynamic field should be shown or hidden.

The standard installation of this addon adds a system configuration option that binds the dynamic field display to the chosen queue.

Hiding dynamic fields based on the selected queue

This is the standard feature of this addon. In several dialogs the dynamic fields can be hidden. First you have to define, which dialogs are affected:

In the system configuration setting Frontend::Output::FilterContent###HideDynamicFields you define in the Templates listing which actions should be handled. By default only AgentTicketEmail and AgentTicketPhone are handled. You can define any dialog where dynamic fields can be shown (e.g. AgentTicketCompose, AgentTicketNote, ...).

The next step is define, which dynamic fields should be hidden for certain queues. If you want to hide the field "OnboardTime" for the queue "IT", you have to define the key "IT" with the value "OnboardTime" in the system configuration setting HideDynamicFields::Filter###Dest.

If the field "SupportContract" when the agent selects the queue "Human Resources" or the ticket is in that queue, you have to define the key "Human Resources" with the value "SupportContract" in the above mentioned setting.

You can hide several fields, just provide a comma separated list of field names in the value part.

Defining your own bindings

But you can define your own bindings:

Create a custom sysconfig definition file. In this example an OTRS >= 6.0.x version is shown:

    <?xml version="1.0" encoding="utf-8"?>
    <otrs_config version="2.0" init="Config">
        <Setting Name="HideDynamicFields::Filter###PriorityID" Required="0" Valid="0">
            <Description Translatable="1">
                Defines which dynamic fields should be hidden for specific priorities
            </Description>
            <Navigation>Filters</Navigation>
            <Value>
                <Hash>
                    <Item Key="1 very low">NameOfDynamicField</Item>
                </Hash>
            </Value>
        </Setting>
    </otrs_config>

The "PriorityID" in the name can be replaced with any dropdown field name in the dialog. In the default installation it is Dest, in this case it is the priority selection (the field is named PriorityID).

The keys in the hash have to be the value of the dropdown for which one or more dynamic fields should be hidden. And the value is the name of the dynamic field.

Filter based on Dynamic Fields

You can bind the filters to Dynamic Fields as well.

    <?xml version="1.0" encoding="utf-8"?>
    <otrs_config version="2.0" init="Config">
        <Setting Name="HideDynamicFields::Filter###DynamicField_FieldName" Required="0" Valid="0">
            <Description Translatable="1">
                Defines which dynamic fields should be hidden for specific priorities
            </Description>
            <Navigation>Filters</Navigation>
            <Value>
                <Hash>
                    <Item Key="1 very low">NameOfDynamicField</Item>
                </Hash>
            </Value>
        </Setting>
    </otrs_config>

Any type of dynamic field should work, given the new option added in version 6.0.3: `HideDynamicFields::ValueTexts`

HideDynamicFields::ValueTexts

In this sysconfig option you can define what attribute of the bound field should be used to check if fields should be hidden.

E.g. in some dialogs the dropdown to select a queue has the id _Dest_ (AgentTicketPhone, AgentTicketEmail), in other dialogs (e.g. AgentTicketProcess) this dropdown has the id _QueueID_. If you want to use the Queue name in the filter sysconfig option (_HideDynamicFields::Filter###QueueID_) you have to tell HideDynamicFields this.

Thats what this config option is for. So in this case you have to define the key _QueueID_ (name of the filter) and the value _text_. Therefor the text of the selected option in the dropdown is checked if some fields should be hidden. If you want to use the queue id in the filter, then the correct value in this sysconfig option is _id_.

If you bind a filter to a dynamic field of type _Checkbox_, you have to use the value _bool_.